Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2079 06/01/20 00:40:56 cps@stripped +15 -0
Fix the tree: plugin-related changes, necessary for
CSV storage engine to be statically compiled.
Derived from antony's patch.
storage/csv/ha_tina.h
1.12 06/01/20 00:40:51 cps@stripped +4 -1
fix prototype to get rid of THD
storage/csv/ha_tina.cc
1.31 06/01/20 00:40:51 cps@stripped +13 -16
fix ha_tina to be able to build it static
storage/csv/Makefile.am
1.5 06/01/20 00:40:51 cps@stripped +6 -7
compile CSV into a static lib to be
linked into mysqld
sql/sql_lex.h
1.212 06/01/20 00:40:51 cps@stripped +6 -0
Don't include all the types and files when not building mysqld
sql/sql_class.h
1.284 06/01/20 00:40:51 cps@stripped +5 -1
Don't include all the types and files when not building mysqld
sql/sql_class.cc
1.238 06/01/20 00:40:51 cps@stripped +19 -0
New plugin functions
sql/mysql_priv.h
1.371 06/01/20 00:40:51 cps@stripped +14 -0
Don't include all the types and files when not building mysqld
declare new plugin functions
sql/lock.cc
1.86 06/01/20 00:40:51 cps@stripped +5 -2
don's assume that handler knows about THD
sql/item.h
1.188 06/01/20 00:40:51 cps@stripped +2 -1
Don't include all the types and files when not building mysqld
sql/handler.h
1.183 06/01/20 00:40:51 cps@stripped +9 -1
fix prototype to get rid of THD
declare functions used by plugins
sql/handler.cc
1.213 06/01/20 00:40:51 cps@stripped +6 -0
new function for plugins
sql/ha_myisam.h
1.72 06/01/20 00:40:51 cps@stripped +4 -1
fix prototype to get rid of THD
sql/ha_myisam.cc
1.170 06/01/20 00:40:51 cps@stripped +4 -1
fix prototype to get rid of THD
configure.in
1.333 06/01/20 00:40:51 cps@stripped +2 -2
compile CSV statically
config/ac-macros/storage.m4
1.4 06/01/20 00:40:51 cps@stripped +4 -1
don't add objects to the object list if
we don't have them
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cps
# Host: outpost.site
# Root: /home/cps/mysql/devel/test-6
--- 1.332/configure.in 2006-01-19 05:55:59 +03:00
+++ 1.333/configure.in 2006-01-20 00:40:51 +03:00
@@ -2437,8 +2437,8 @@
\$(top_builddir)/storage/archive/libarchive.a, [
AC_CONFIG_FILES(storage/archive/Makefile)
])
-MYSQL_STORAGE_ENGINE(csv,,,"yes",,tina_hton,storage/csv,
- ../storage/csv/ha_tina.o,,[
+MYSQL_STORAGE_ENGINE(csv,,,"yes",,tina_hton,storage/csv,no,
+ \$(top_builddir)/storage/csv/libcsv.a,[
AC_CONFIG_FILES(storage/csv/Makefile)
])
MYSQL_STORAGE_ENGINE(blackhole)
--- 1.169/sql/ha_myisam.cc 2006-01-19 05:56:00 +03:00
+++ 1.170/sql/ha_myisam.cc 2006-01-20 00:40:51 +03:00
@@ -296,7 +296,10 @@
#endif /* HAVE_REPLICATION */
-bool ha_myisam::check_if_locking_is_allowed(THD *thd, TABLE *table, uint count)
+bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table,
+ uint count,
+ bool called_by_logger_thread)
{
/*
To be able to open and lock for reading system tables like 'mysql.proc',
--- 1.71/sql/ha_myisam.h 2006-01-19 05:56:00 +03:00
+++ 1.72/sql/ha_myisam.h 2006-01-20 00:40:51 +03:00
@@ -60,7 +60,10 @@
uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
uint checksum() const;
- virtual bool check_if_locking_is_allowed(THD *thd, TABLE *table, uint count);
+ virtual bool check_if_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table,
+ uint count,
+ bool called_by_logger_thread);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(byte * buf);
--- 1.212/sql/handler.cc 2006-01-17 10:37:24 +03:00
+++ 1.213/sql/handler.cc 2006-01-20 00:40:51 +03:00
@@ -1425,6 +1425,12 @@
** General handler functions
****************************************************************************/
+
+void handler::ha_statistic_increment(ulong SSV::*offset) const
+{
+ statistic_increment(table->in_use->status_var.*offset, &LOCK_status);
+}
+
/*
Open database-handler.
--- 1.182/sql/handler.h 2006-01-19 05:56:00 +03:00
+++ 1.183/sql/handler.h 2006-01-20 00:40:51 +03:00
@@ -1006,6 +1006,8 @@
byte *end_of_used_area; /* End of area that was used by handler */
} HANDLER_BUFFER;
+typedef struct system_status_var SSV;
+
class handler :public Sql_alloc
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -1027,6 +1029,9 @@
virtual int rnd_init(bool scan) =0;
virtual int rnd_end() { return 0; }
+ void ha_statistic_increment(ulong SSV::*offset) const;
+
+
private:
virtual int reset() { return extra(HA_EXTRA_RESET); }
public:
@@ -1109,7 +1114,10 @@
TRUE Locking is allowed
FALSE Locking is not allowed. The error was thrown.
*/
- virtual bool check_if_locking_is_allowed(THD *thd, TABLE *table, uint count)
+ virtual bool check_if_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table,
+ uint count,
+ bool called_by_logger_thread)
{
return TRUE;
}
--- 1.187/sql/item.h 2006-01-06 21:34:56 +03:00
+++ 1.188/sql/item.h 2006-01-20 00:40:51 +03:00
@@ -1932,7 +1932,7 @@
virtual Item *real_item() { return ref; }
};
-
+#ifdef MYSQL_SERVER
#include "gstream.h"
#include "spatial.h"
#include "item_sum.h"
@@ -1945,6 +1945,7 @@
#include "item_uniq.h"
#include "item_subselect.h"
#include "item_xmlfunc.h"
+#endif
class Item_copy_string :public Item
{
--- 1.85/sql/lock.cc 2006-01-19 05:56:00 +03:00
+++ 1.86/sql/lock.cc 2006-01-20 00:40:51 +03:00
@@ -617,8 +617,11 @@
Check if we can lock the table. For some tables we cannot do that
beacause of handler-specific locking issues.
*/
- if (!table_ptr[i]->file->check_if_locking_is_allowed(thd, table_ptr[i],
- count))
+ if (!table_ptr[i]-> file->
+ check_if_locking_is_allowed(thd->lex->sql_command, thd->lex->type,
+ table_ptr[i], count,
+ (thd == logger.get_general_log_thd()) ||
+ (thd == logger.get_slow_log_thd())))
return 0;
}
--- 1.370/sql/mysql_priv.h 2006-01-19 05:56:00 +03:00
+++ 1.371/sql/mysql_priv.h 2006-01-20 00:40:51 +03:00
@@ -477,6 +477,11 @@
}
#define current_thd _current_thd()
+/* below functions are required for plugins as THD class is opaque */
+my_bool thd_in_lock_tables(const THD *thd);
+my_bool thd_tablespace_op(const THD *thd);
+const char *thd_proc_info(THD *thd, const char *info);
+
/*
External variables
*/
@@ -507,7 +512,9 @@
class sys_var;
#include "item.h"
extern my_decimal decimal_zero;
+#ifdef MYSQL_SERVER
typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
+#endif
/* sql_parse.cc */
void free_items(Item *item);
void cleanup_items(Item *item);
@@ -545,6 +552,7 @@
#include "sql_class.h"
#include "sql_acl.h"
#include "tztime.h"
+#ifdef MYSQL_SERVER
#include "opt_range.h"
#ifdef HAVE_QUERY_CACHE
@@ -841,6 +849,8 @@
Field *
find_field_in_table_sef(TABLE *table, const char *name);
+#endif /* MYSQL_SERVER */
+
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
struct st_des_keyblock
@@ -858,6 +868,7 @@
bool load_des_key_file(const char *file_name);
#endif /* HAVE_OPENSSL */
+#ifdef MYSQL_SERVER
/* sql_do.cc */
bool mysql_do(THD *thd, List<Item> &values);
@@ -1169,6 +1180,7 @@
int key_rec_cmp(void *key_info, byte *a, byte *b);
bool init_errmessage(void);
+#endif /* MYSQL_SERVER */
void sql_perror(const char *message);
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
@@ -1191,6 +1203,7 @@
bool fn_format_relative_to_data_home(my_string to, const char *name,
const char *dir, const char *extension);
+#ifdef MYSQL_SERVER
File open_binlog(IO_CACHE *log, const char *log_file_name,
const char **errmsg);
@@ -1739,4 +1752,5 @@
#define check_stack_overrun(A, B, C) 0
#endif
+#endif /* MYSQL_SERVER */
#endif /* MYSQL_CLIENT */
--- 1.237/sql/sql_class.cc 2006-01-18 11:46:25 +03:00
+++ 1.238/sql/sql_class.cc 2006-01-20 00:40:51 +03:00
@@ -167,6 +167,25 @@
reset_open_tables_state();
}
+my_bool thd_in_lock_tables(const THD *thd)
+{
+ return thd->in_lock_tables;
+}
+
+
+my_bool thd_tablespace_op(const THD *thd)
+{
+ return thd->tablespace_op;
+}
+
+
+const char *thd_proc_info(THD *thd, const char *info)
+{
+ const char *old_info= thd->proc_info;
+ thd->proc_info= info;
+ return old_info;
+}
+
/*
Pass nominal parameters to Statement constructor only to ensure that
--- 1.283/sql/sql_class.h 2006-01-18 11:47:54 +03:00
+++ 1.284/sql/sql_class.h 2006-01-20 00:40:51 +03:00
@@ -171,6 +171,7 @@
class delayed_insert;
class select_result;
+class Time_zone;
#define THD_SENTRY_MAGIC 0xfeedd1ff
#define THD_SENTRY_GONE 0xdeadbeef
@@ -344,6 +345,8 @@
#define last_system_status_var com_stmt_close
+#ifdef MYSQL_SERVER
+
void free_tmp_table(THD *thd, TABLE *entry);
@@ -354,7 +357,6 @@
#define INIT_ARENA_DBUG_INFO
#endif
-
class Query_arena
{
public:
@@ -1905,3 +1907,5 @@
/* Functions in sql_class.cc */
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);
+
+#endif /* MYSQL_SERVER */
--- 1.211/sql/sql_lex.h 2006-01-17 10:37:27 +03:00
+++ 1.212/sql/sql_lex.h 2006-01-20 00:40:51 +03:00
@@ -29,6 +29,7 @@
class partition_info;
class event_timed;
+#ifdef MYSQL_SERVER
/*
The following hack is needed because mysql_yacc.cc does not define
YYSTYPE before including this file
@@ -43,6 +44,7 @@
#include "sql_yacc.h"
#define LEX_YYSTYPE YYSTYPE *
#endif
+#endif
/*
When a command is added here, be sure it's also added in mysqld.cc
@@ -115,6 +117,8 @@
*/
#define DESCRIBE_PARTITIONS 4
+#ifdef MYSQL_SERVER
+
enum enum_sp_suid_behaviour
{
SP_IS_DEFAULT_SUID= 0,
@@ -1109,3 +1113,5 @@
extern pthread_key(LEX*,THR_LEX);
#define current_lex (current_thd->lex)
+
+#endif
--- 1.3/config/ac-macros/storage.m4 2005-12-22 01:57:53 +03:00
+++ 1.4/config/ac-macros/storage.m4 2006-01-20 00:40:51 +03:00
@@ -39,7 +39,10 @@
AC_DEFINE([$5])
mysql_se_decls="${mysql_se_decls},$6"
mysql_se_htons="${mysql_se_htons},&$6"
- mysql_se_objs="$mysql_se_objs $8"
+ if test "$8" != "no"
+ then
+ mysql_se_objs="$mysql_se_objs $8"
+ fi
mysql_se_dirs="$mysql_se_dirs $7"
mysql_se_libs="$mysql_se_libs $9"
else
--- 1.4/storage/csv/Makefile.am 2006-01-05 16:16:22 +03:00
+++ 1.5/storage/csv/Makefile.am 2006-01-20 00:40:51 +03:00
@@ -24,17 +24,16 @@
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
-I$(srcdir)
-WRAPLIBS=
-pkglib_LTLIBRARIES = ha_csv.la
-
-ha_csv_la_LDFLAGS = -module
-noinst_HEADERS = ha_tina.h
-ha_csv_la_SOURCES = ha_tina.cc
+pkglib_LIBRARIES = libcsv.a
LDADD =
-DEFS = -DMYSQL_SERVER @DEFS@
+DEFS = @DEFS@
+
+libcsv_a_CXXFLAGS = $(AM_CFLAGS)
+noinst_HEADERS = ha_tina.h
+libcsv_a_SOURCES = ha_tina.cc
# Don't update the files from bitkeeper
%::SCCS/s.%
--- 1.30/storage/csv/ha_tina.cc 2006-01-19 05:56:01 +03:00
+++ 1.31/storage/csv/ha_tina.cc 2006-01-20 00:40:51 +03:00
@@ -590,7 +590,10 @@
}
-bool ha_tina::check_if_locking_is_allowed(THD *thd, TABLE *table, uint count)
+bool ha_tina::check_if_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table,
+ uint count,
+ bool called_by_logger_thread)
{
/*
Deny locking of the log tables, which is incompatible with
@@ -598,11 +601,10 @@
general_log_thd or slow_log_thd.
*/
if (table->s->log_table &&
- thd->lex->sql_command != SQLCOM_TRUNCATE &&
- !(thd->lex->sql_command == SQLCOM_FLUSH &&
- thd->lex->type & REFRESH_LOG) &&
- (thd != logger.get_general_log_thd()) &&
- (thd != logger.get_slow_log_thd()) &&
+ sql_command != SQLCOM_TRUNCATE &&
+ !(sql_command == SQLCOM_FLUSH &&
+ type & REFRESH_LOG) &&
+ !called_by_logger_thread &&
(table->reginfo.lock_type >= TL_READ_NO_INSERT))
{
/*
@@ -665,7 +667,7 @@
int size;
DBUG_ENTER("ha_tina::write_row");
- statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
@@ -714,9 +716,7 @@
int size;
DBUG_ENTER("ha_tina::update_row");
-
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
@@ -751,8 +751,7 @@
int ha_tina::delete_row(const byte * buf)
{
DBUG_ENTER("ha_tina::delete_row");
- statistic_increment(table->in_use->status_var.ha_delete_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_delete_count);
if (chain_append())
DBUG_RETURN(-1);
@@ -903,8 +902,7 @@
{
DBUG_ENTER("ha_tina::rnd_next");
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
current_position= next_position;
if (!share->mapped_file)
@@ -941,8 +939,7 @@
int ha_tina::rnd_pos(byte * buf, byte *pos)
{
DBUG_ENTER("ha_tina::rnd_pos");
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
current_position= my_get_ptr(pos,ref_length);
DBUG_RETURN(find_current_row(buf));
}
--- 1.11/storage/csv/ha_tina.h 2006-01-19 05:56:01 +03:00
+++ 1.12/storage/csv/ha_tina.h 2006-01-20 00:40:51 +03:00
@@ -104,7 +104,10 @@
*/
ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; }
- virtual bool check_if_locking_is_allowed(THD *thd, TABLE *table, uint count);
+ virtual bool check_if_locking_is_allowed(uint sql_command,
+ ulong type, TABLE *table,
+ uint count,
+ bool called_by_logger_thread);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(byte * buf);
| Thread |
|---|
| • bk commit into 5.1 tree (cps:1.2079) | Petr Chardin | 19 Jan |