1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

- Fix for BUG#1858 "SQL-Thread stops working when using optimize table":

we change THD::system_thread from a 'bool' to a bitmap to be able to
distinguish between delayed-insert threads and slave threads.
- Fix for BUG#1701 "Update from multiple tables" (one line in sql_parse.cc,
plus a new test rpl_multi_update.test). That's just adding an initialization.


sql/repl_failsafe.cc:
  comment to warn about this unused code
sql/slave.cc:
  Now thd->system_thread is a bitmap, not a bool.
sql/sql_class.h:
  'bool' for THD::system_thread is not accurate enough; sometimes we need
  to distinguish between delayed-insert threads and slave threads;
  so changing THD::system_thread to a bitmap (uint).
sql/sql_insert.cc:
  thd.system_thread is now a bitmap
sql/sql_parse.cc:
  We need to initialize thd->lex.select_lex.options in mysql_init_query();
  it's already initialized in dispatch_command() but replication calls
  mysql_parse() directly, thus bypassing dispatch_command().
  Not initing it here leads to a query influencing the next query,
  in the slave SQL thread.
  The initialization in dispatch_command() must be kept as this
  command uses the variable in tests, even when the command was not a
  query (i.e. when mysql_init_query() was not called).
This commit is contained in:
unknown
2003-12-04 22:42:18 +01:00
parent 0a9ae10f9e
commit 66927c51fa
7 changed files with 76 additions and 4 deletions

View File

@ -460,7 +460,7 @@ public:
long dbug_thread_id;
pthread_t real_id;
uint current_tablenr,tmp_table,cond_count;
uint server_status,open_options;
uint server_status,open_options,system_thread;
uint32 query_length;
uint32 db_length;
/* variables.transaction_isolation is reset to this after each commit */
@ -470,7 +470,7 @@ public:
bool set_query_id,locked,count_cuted_fields,some_tables_deleted;
bool no_errors, allow_sum_func, password, fatal_error;
bool query_start_used,last_insert_id_used,insert_id_used,rand_used;
bool system_thread,in_lock_tables,global_read_lock;
bool in_lock_tables,global_read_lock;
bool query_error, bootstrap, cleanup_done;
bool safe_to_cache_query;
bool volatile killed;
@ -592,6 +592,11 @@ public:
CHANGED_TABLE_LIST * changed_table_dup(const char *key, long key_length);
};
/* Flags for the THD::system_thread (bitmap) variable */
#define SYSTEM_THREAD_DELAYED_INSERT 1
#define SYSTEM_THREAD_SLAVE_IO 2
#define SYSTEM_THREAD_SLAVE_SQL 4
/*
Used to hold information about file and file structure in exchainge
via non-DB file (...INTO OUTFILE..., ...LOAD DATA...)