diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 339d27bff00..5376ed58974 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -21,8 +21,8 @@ source ./VERSION UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" RELEASE_EXTRA="" -RELEASE_NAME=mariadb -PATCHLEVEL="" +RELEASE_NAME="" +PATCHLEVEL="+maria" LOGSTRING="MariaDB build" # Look up distro-version specific stuff. diff --git a/include/mysql.h b/include/mysql.h index fa62026b44a..122b5a2751f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -169,7 +169,7 @@ enum mysql_option MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_PROGRESS_CALLBACK, /* MariaDB options */ - MYSQL_OPT_NONBLOCK=6000 + MYSQL_OPT_NONBLOCK=6000, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY }; /** @@ -194,7 +194,7 @@ struct st_mysql_options { unsigned long max_allowed_packet; my_bool use_ssl; /* if to use SSL or not */ my_bool compress,named_pipe; - my_bool unused1; + my_bool use_thread_specific_memory; my_bool unused2; my_bool unused3; my_bool unused4; diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 331183180c0..b3a56dfd90b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -83,7 +83,7 @@ enum enum_mysql_set_option my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags); void my_net_local_init(NET *net); void net_end(NET *net); - void net_clear(NET *net, my_bool clear_buffer); +void net_clear(NET *net, my_bool clear_buffer); my_bool net_realloc(NET *net, size_t length); my_bool net_flush(NET *net); my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); @@ -263,7 +263,7 @@ enum mysql_option MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_PROGRESS_CALLBACK, - MYSQL_OPT_NONBLOCK=6000 + MYSQL_OPT_NONBLOCK=6000, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY }; struct st_mysql_options_extention; struct st_mysql_options { @@ -282,7 +282,7 @@ struct st_mysql_options { unsigned long max_allowed_packet; my_bool use_ssl; my_bool compress,named_pipe; - my_bool unused1; + my_bool use_thread_specific_memory; my_bool unused2; my_bool unused3; my_bool unused4; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ea2ebfe4d38..de42d1640d1 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4783,6 +4783,9 @@ sub extract_warning_lines ($$) { qr|Warning: io_setup\(\) failed|, qr|Warning: io_setup\(\) attempt|, qr|setrlimit could not change the size of core files to 'infinity';|, + qr|feedback plugin: failed to retrieve the MAC address|, + qr|Plugin 'FEEDBACK' init function returned error|, + qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|, ); my $matched_lines= []; diff --git a/mysql-test/r/myisam-metadata.result b/mysql-test/r/myisam-metadata.result index 5192253d5d1..4d49bac9436 100644 --- a/mysql-test/r/myisam-metadata.result +++ b/mysql-test/r/myisam-metadata.result @@ -5,7 +5,10 @@ a VARCHAR(100), INDEX(a) ) ENGINE=MyISAM; ALTER TABLE t1 DISABLE KEYS; +SET debug_sync= 'myisam_after_repair_by_sort SIGNAL waiting WAIT_FOR go'; ALTER TABLE t1 ENABLE KEYS; +SET debug_sync= 'now WAIT_FOR waiting'; +SET debug_sync= 'now SIGNAL go'; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 10 Dynamic 100000 27 # # # 0 NULL # # # latin1_swedish_ci NULL diff --git a/mysql-test/suite/innodb/t/innodb_bug51920.test b/mysql-test/suite/innodb/t/innodb_bug51920.test index 0d4715712b0..c83e00db22a 100644 --- a/mysql-test/suite/innodb/t/innodb_bug51920.test +++ b/mysql-test/suite/innodb/t/innodb_bug51920.test @@ -36,7 +36,7 @@ let $wait_condition = # depending on platform. # connection con1; --- error 1317, 2006, 2013 +-- error 1317, 2006, 2013, ER_CONNECTION_KILLED reap; connection default; DROP TABLE bug51920; diff --git a/mysql-test/suite/multi_source/reset_master_slave.inc b/mysql-test/suite/multi_source/reset_master_slave.inc index 63ba3ee00af..2678602291f 100644 --- a/mysql-test/suite/multi_source/reset_master_slave.inc +++ b/mysql-test/suite/multi_source/reset_master_slave.inc @@ -23,6 +23,7 @@ while ($con_name != 'No such row') --error 0,ER_FLUSH_MASTER_BINLOG_CLOSED reset master; +set global gtid_pos=''; eval set default_master_connection = '$default_master'; --source include/end_include_file.inc diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result index 39c94fda736..fa738fbf712 100644 --- a/mysql-test/suite/multi_source/simple.result +++ b/mysql-test/suite/multi_source/simple.result @@ -11,8 +11,8 @@ include/wait_for_slave_to_start.inc set default_master_connection = ''; show all slaves status; Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Using_Gtid Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos -slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-slave1.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 1 0 0 1073741824 7 0 60.000 0-1-3 -slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 0-1-3 +slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 311 mysqld-relay-bin-slave1.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 1 0 0 1073741824 7 0 60.000 +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 start all slaves; stop slave 'slave1'; show slave 'slave1' status; @@ -60,18 +60,18 @@ Using_Gtid 0 reset slave 'slave1'; show all slaves status; Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Using_Gtid Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos -slave1 127.0.0.1 root MYPORT_1 60 4 599 No No 0 0 0 904 None 0 No NULL No 0 0 1 0 0 1073741824 7 0 60.000 0-1-3 -slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 0-1-3 +slave1 127.0.0.1 root MYPORT_1 60 4 599 No No 0 0 0 904 None 0 No NULL No 0 0 1 0 0 1073741824 7 0 60.000 +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 reset slave 'slave1' all; show all slaves status; Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Using_Gtid Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos -slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 0-1-3 +slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 Yes Yes 0 0 311 904 None 0 No 0 No 0 0 2 0 0 1073741824 7 0 60.000 stop all slaves; Warnings: Note 1938 SLAVE 'slave2' stopped show all slaves status; Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Using_Gtid Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Pos -slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 No No 0 0 311 904 None 0 No NULL No 0 0 2 0 0 1073741824 7 0 60.000 0-1-3 +slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 311 mysqld-relay-bin-slave2.000002 599 master-bin.000001 No No 0 0 311 904 None 0 No NULL No 0 0 2 0 0 1073741824 7 0 60.000 stop all slaves; include/reset_master_slave.inc include/reset_master_slave.inc diff --git a/mysql-test/t/myisam-metadata.test b/mysql-test/t/myisam-metadata.test index c5327aa3a71..2bbcc89a702 100644 --- a/mysql-test/t/myisam-metadata.test +++ b/mysql-test/t/myisam-metadata.test @@ -3,6 +3,7 @@ # --source include/big_test.inc +--source include/have_debug_sync.inc --disable_warnings DROP TABLE IF EXISTS t1; @@ -29,15 +30,18 @@ while ($1) --enable_query_log --connect(con1,localhost,root,,) ---send +SET debug_sync= 'myisam_after_repair_by_sort SIGNAL waiting WAIT_FOR go'; +send ALTER TABLE t1 ENABLE KEYS; --connection default ---let $wait_timeout=10 +--let $wait_timeout=60 --let $show_statement= SHOW PROCESSLIST --let $field= State --let $condition= = 'Repair by sorting' --source include/wait_show_condition.inc +SET debug_sync= 'now WAIT_FOR waiting'; +SET debug_sync= 'now SIGNAL go'; --replace_column 7 # 8 # 9 # 12 # 13 # 14 # SHOW TABLE STATUS LIKE 't1'; diff --git a/sql-common/client.c b/sql-common/client.c index 2d83f2ef215..507917b0722 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -892,7 +892,9 @@ void free_old_query(MYSQL *mysql) if (mysql->fields) free_root(&mysql->field_alloc,MYF(0)); /* Assume rowlength < 8192 */ - init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&mysql->field_alloc, 8192, 0, + MYF(mysql->options.use_thread_specific_memory ? + MY_THREAD_SPECIFIC : 0)); mysql->fields= 0; mysql->field_count= 0; /* For API */ mysql->warning_count= 0; @@ -1578,7 +1580,9 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, DBUG_RETURN(0); } /* Assume rowlength < 8192 */ - init_alloc_root(&result->alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&result->alloc, 8192, 0, + MYF(mysql->options.use_thread_specific_memory ? + MY_THREAD_SPECIFIC : 0)); result->alloc.min_malloc=sizeof(MYSQL_ROWS); prev_ptr= &result->data; result->rows=0; @@ -4206,6 +4210,9 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) case MYSQL_OPT_RECONNECT: mysql->reconnect= *(my_bool *) arg; break; + case MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY: + mysql->options.use_thread_specific_memory= *(my_bool *) arg; + break; case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: if (*(my_bool*) arg) mysql->options.client_flag|= CLIENT_SSL_VERIFY_SERVER_CERT; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index b7e82d8b4b9..edd4e248038 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -163,7 +163,7 @@ const TABLE_FIELD_TYPE event_table_fields[ET_FIELD_COUNT] = }; static const TABLE_FIELD_DEF - event_table_def= {ET_FIELD_COUNT, event_table_fields}; +event_table_def= {ET_FIELD_COUNT, event_table_fields, 0, (uint*) 0}; class Event_db_intact : public Table_check_intact { diff --git a/sql/keycaches.cc b/sql/keycaches.cc index 9e4b943dc83..120aa7e1029 100644 --- a/sql/keycaches.cc +++ b/sql/keycaches.cc @@ -225,3 +225,7 @@ void free_rpl_filter(const char *name, Rpl_filter *filter) delete filter; } +void free_all_rpl_filters() +{ + rpl_filters.delete_elements((void (*)(const char*, uchar*)) free_rpl_filter); +} diff --git a/sql/keycaches.h b/sql/keycaches.h index 2d52cb28973..32537339e2e 100644 --- a/sql/keycaches.h +++ b/sql/keycaches.h @@ -53,5 +53,6 @@ Rpl_filter *create_rpl_filter(const char *name, uint length); Rpl_filter *get_rpl_filter(LEX_STRING *filter_name); Rpl_filter *get_or_create_rpl_filter(const char *name, uint length); void free_rpl_filter(const char *name, Rpl_filter *filter); +void free_all_rpl_filters(void); #endif /* KEYCACHES_INCLUDED */ diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 11c6e54c8f8..7733354b106 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -48,7 +48,8 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id), info_fd(-1), cur_log_fd(-1), relay_log(&sync_relaylog_period), sync_counter(0), is_relay_log_recovery(is_slave_recovery), - save_temporary_tables(0), cur_log_old_open_count(0), group_relay_log_pos(0), + save_temporary_tables(0), mi(0), + cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0), #if HAVE_valgrind is_fake(FALSE), @@ -61,7 +62,7 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) gtid_sub_id(0), tables_to_lock(0), tables_to_lock_count(0), last_event_start_time(0), deferred_events(NULL),m_flags(0), row_stmt_start_timestamp(0), long_find_row_note_printed(false), - m_annotate_event(0), mi(0) + m_annotate_event(0) { DBUG_ENTER("Relay_log_info::Relay_log_info"); diff --git a/sql/slave.cc b/sql/slave.cc index 2e436d5e8b4..36d26e76dce 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -870,6 +870,7 @@ void end_slave() master_info_index= 0; active_mi= 0; mysql_mutex_unlock(&LOCK_active_mi); + free_all_rpl_filters(); DBUG_VOID_RETURN; } @@ -5003,6 +5004,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, int last_errno= -2; // impossible error ulong err_count=0; char llbuff[22]; + my_bool my_true= 1; DBUG_ENTER("connect_to_master"); #ifndef DBUG_OFF @@ -5014,6 +5016,8 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout); mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout); + mysql_options(mysql, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); #ifdef HAVE_OPENSSL if (mi->ssl) @@ -5129,14 +5133,15 @@ MYSQL *rpl_connect_master(MYSQL *mysql) { THD *thd= current_thd; Master_info *mi= my_pthread_getspecific_ptr(Master_info*, RPL_MASTER_INFO); + bool allocated= false; + my_bool my_true= 1; + if (!mi) { sql_print_error("'rpl_connect_master' must be called in slave I/O thread context."); return NULL; } - bool allocated= false; - if (!mysql) { if(!(mysql= mysql_init(NULL))) @@ -5156,6 +5161,8 @@ MYSQL *rpl_connect_master(MYSQL *mysql) */ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout); mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout); + mysql_options(mysql, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); #ifdef HAVE_OPENSSL if (mi->ssl) diff --git a/sql/sp.cc b/sql/sp.cc index b80fa968483..2aec9d19869 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -168,7 +168,7 @@ TABLE_FIELD_TYPE proc_table_fields[MYSQL_PROC_FIELD_COUNT] = }; static const TABLE_FIELD_DEF - proc_table_def= {MYSQL_PROC_FIELD_COUNT, proc_table_fields}; +proc_table_def= {MYSQL_PROC_FIELD_COUNT, proc_table_fields, 0, (uint*) 0 }; /*************************************************************************/ diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7810bdb16e2..69290a64a29 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -171,7 +171,7 @@ TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = { }; const TABLE_FIELD_DEF - mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields}; +mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields, 0, (uint*) 0 }; static LEX_STRING native_password_plugin_name= { C_STRING_WITH_LEN("mysql_native_password") diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index effbe899e7f..cc45ae059ae 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -423,8 +423,10 @@ int federatedx_io_mysql::actual_query(const char *buffer, uint length) if (!mysql.net.vio) { + my_bool my_true= 1; + if (!(mysql_init(&mysql))) - DBUG_RETURN(-1); + DBUG_RETURN(-1); /* BUG# 17044 Federated Storage Engine is not UTF8 clean @@ -433,6 +435,8 @@ int federatedx_io_mysql::actual_query(const char *buffer, uint length) */ /* this sets the csname like 'set names utf8' */ mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, get_charsetname()); + mysql_options(&mysql, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); if (!mysql_real_connect(&mysql, get_hostname(), diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index d760fcf082f..c3f5e6add73 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -3593,12 +3593,15 @@ int ha_federatedx::discover_assisted(handlerton *hton, THD* thd, MYSQL_RES *res; MYSQL_ROW rdata; ulong *rlen; + my_bool my_true= 1; if (parse_url(thd->mem_root, &tmp_share, table_s, 1)) return HA_WRONG_CREATE_OPTION; mysql_init(&mysql); mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, cs->csname); + mysql_options(&mysql, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); if (!mysql_real_connect(&mysql, tmp_share.hostname, tmp_share.username, tmp_share.password, tmp_share.database, diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index 0a1d3b41d0c..0d036f6f032 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -1369,7 +1369,6 @@ os_file_set_nocache( #endif static int os_file_set_atomic_writes(os_file_t file, const char *name) { - static int first_time = 1; int atomic_option = 1; int ret = ioctl (file, DFS_IOCTL_ATOMIC_WRITE_SET, &atomic_option); @@ -2027,7 +2026,7 @@ os_file_set_size( "InnoDB: Error: preallocating data for" " file %s failed at\n" "InnoDB: offset 0 size %lld %lld. Operating system" - " error number %llu.\n" + " error number %d.\n" "InnoDB: Check that the disk is not full" " or a disk quota exceeded.\n" "InnoDB: Some operating system error numbers" diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 192e2ed32a1..8d2a2d3aec3 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -1246,17 +1246,13 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend, { MARIA_BLOCK_INFO block_info; MARIA_SHARE *share= info->s; - my_off_t start_recpos, start_block, pos; - uchar *to; - ulong left_length; + my_off_t UNINIT_VAR(start_recpos), start_block, pos; + uchar *UNINIT_VAR(to); + ulong UNINIT_VAR(left_length); uint b_type; char llbuff[22],llbuff2[22],llbuff3[22]; DBUG_ENTER("check_dynamic_record"); - LINT_INIT(left_length); - LINT_INIT(start_recpos); - LINT_INIT(to); - pos= 0; while (pos < share->state.state.data_file_length) { @@ -1847,10 +1843,8 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend, pos < share->state.state.data_file_length; pos+= block_size, page++) { - uint row_count, real_row_count, empty_space, page_type, bitmap_pattern; + uint UNINIT_VAR(row_count), real_row_count, empty_space, page_type, bitmap_pattern; uint bitmap_for_page; - LINT_INIT(row_count); - LINT_INIT(empty_space); if (_ma_killed_ptr(param)) { diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 30124b2205d..1e8adb64981 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -758,13 +758,11 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) struct st_state_copy *state_copies= NULL, /**< fixed-size cache of states */ *state_copies_end, /**< cache ends here */ *state_copy; /**< iterator in cache */ - TRANSLOG_ADDRESS state_copies_horizon; /**< horizon of states' _copies_ */ + TRANSLOG_ADDRESS UNINIT_VAR(state_copies_horizon); /**< horizon of states' _copies_ */ struct st_filter_param filter_param; PAGECACHE_FLUSH_FILTER filter; DBUG_ENTER("collect_tables"); - LINT_INIT(state_copies_horizon); - /* let's make a list of distinct shares */ mysql_mutex_lock(&THR_LOCK_maria); for (nb= 0, pos= maria_open_list; pos; pos= pos->next) diff --git a/storage/maria/ma_rt_split.c b/storage/maria/ma_rt_split.c index ea90b60ce12..d14422a21d2 100644 --- a/storage/maria/ma_rt_split.c +++ b/storage/maria/ma_rt_split.c @@ -185,18 +185,14 @@ static int split_maria_rtree_node(SplitStruct *node, int n_entries, double **d_buffer, int n_dim) { SplitStruct *cur; - SplitStruct *a; - SplitStruct *b; + SplitStruct *UNINIT_VAR(a); + SplitStruct *UNINIT_VAR(b); double *g1= reserve_coords(d_buffer, n_dim); double *g2= reserve_coords(d_buffer, n_dim); - SplitStruct *next; - int next_node; + SplitStruct *UNINIT_VAR(next); + int UNINIT_VAR(next_node); int i; SplitStruct *end= node + n_entries; - LINT_INIT(a); - LINT_INIT(b); - LINT_INIT(next); - LINT_INIT(next_node); if (all_size < min_size * 2) { diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index e5fed8731dd..5432f4fa605 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -30,6 +30,7 @@ #include "rt_index.h" #include "sql_table.h" // tablename_to_filename #include "sql_class.h" // THD +#include "debug_sync.h" ulonglong myisam_recover_options; static ulong opt_myisam_block_size; @@ -1127,6 +1128,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) thd_proc_info(thd, "Repair by sorting"); error = mi_repair_by_sort(¶m, file, fixed_name, test(param.testflag & T_QUICK)); + DEBUG_SYNC(thd, "myisam_after_repair_by_sort"); } if (error && file->create_unique_index_by_sort && share->state.dupp_key != MAX_KEY) diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc index 8408cc55975..864cecd32b5 100644 --- a/storage/perfschema/table_events_waits.cc +++ b/storage/perfschema/table_events_waits.cc @@ -113,7 +113,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_events_waits_current::m_field_def= -{ 16, field_types }; +{ 16, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_events_waits_current::m_share= diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc index 05f280f8521..15fe0d5202b 100644 --- a/storage/perfschema/table_events_waits_summary.cc +++ b/storage/perfschema/table_events_waits_summary.cc @@ -69,7 +69,7 @@ static const TABLE_FIELD_TYPE ews_by_thread_by_event_name_field_types[]= TABLE_FIELD_DEF table_events_waits_summary_by_thread_by_event_name::m_field_def= -{ 7, ews_by_thread_by_event_name_field_types }; +{ 7, ews_by_thread_by_event_name_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_events_waits_summary_by_thread_by_event_name::m_share= @@ -381,7 +381,7 @@ static const TABLE_FIELD_TYPE ews_by_instance_field_types[]= TABLE_FIELD_DEF table_events_waits_summary_by_instance::m_field_def= -{ 7, ews_by_instance_field_types }; +{ 7, ews_by_instance_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_events_waits_summary_by_instance::m_share= diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc index 3177584231d..a880a96be4c 100644 --- a/storage/perfschema/table_ews_global_by_event_name.cc +++ b/storage/perfschema/table_ews_global_by_event_name.cc @@ -64,7 +64,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_ews_global_by_event_name::m_field_def= -{ 6, field_types }; +{ 6, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_ews_global_by_event_name::m_share= diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc index 9ae732a0e1c..2c116ce1eb2 100644 --- a/storage/perfschema/table_file_instances.cc +++ b/storage/perfschema/table_file_instances.cc @@ -49,7 +49,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_file_instances::m_field_def= -{ 3, field_types }; +{ 3, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_file_instances::m_share= diff --git a/storage/perfschema/table_file_summary.cc b/storage/perfschema/table_file_summary.cc index a954db7ef4e..104fa0fbd36 100644 --- a/storage/perfschema/table_file_summary.cc +++ b/storage/perfschema/table_file_summary.cc @@ -59,7 +59,7 @@ static const TABLE_FIELD_TYPE fs_by_event_name_field_types[]= TABLE_FIELD_DEF table_file_summary_by_event_name::m_field_def= -{ 5, fs_by_event_name_field_types }; +{ 5, fs_by_event_name_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_file_summary_by_event_name::m_share= @@ -222,7 +222,7 @@ static const TABLE_FIELD_TYPE fs_by_instance_field_types[]= TABLE_FIELD_DEF table_file_summary_by_instance::m_field_def= -{ 6, fs_by_instance_field_types }; +{ 6, fs_by_instance_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_file_summary_by_instance::m_share= diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc index acd379bc57b..3c5d5a09772 100644 --- a/storage/perfschema/table_performance_timers.cc +++ b/storage/perfschema/table_performance_timers.cc @@ -53,7 +53,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_performance_timers::m_field_def= -{ 4, field_types }; +{ 4, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_performance_timers::m_share= diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc index 601e0483b14..aa86b094c08 100644 --- a/storage/perfschema/table_setup_consumers.cc +++ b/storage/perfschema/table_setup_consumers.cc @@ -79,7 +79,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_setup_consumers::m_field_def= -{ 2, field_types }; +{ 2, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_setup_consumers::m_share= diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc index 480c0dbc13f..d3f39635bed 100644 --- a/storage/perfschema/table_setup_instruments.cc +++ b/storage/perfschema/table_setup_instruments.cc @@ -49,7 +49,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_setup_instruments::m_field_def= -{ 3, field_types }; +{ 3, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_setup_instruments::m_share= diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc index f8b1bfa4fe2..0bba71c7e2f 100644 --- a/storage/perfschema/table_setup_timers.cc +++ b/storage/perfschema/table_setup_timers.cc @@ -52,7 +52,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_setup_timers::m_field_def= -{ 2, field_types }; +{ 2, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_setup_timers::m_share= diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc index f2bd9fa1a28..584817d695d 100644 --- a/storage/perfschema/table_sync_instances.cc +++ b/storage/perfschema/table_sync_instances.cc @@ -50,7 +50,7 @@ static const TABLE_FIELD_TYPE mutex_field_types[]= TABLE_FIELD_DEF table_mutex_instances::m_field_def= -{ 3, mutex_field_types }; +{ 3, mutex_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_mutex_instances::m_share= @@ -218,7 +218,7 @@ static const TABLE_FIELD_TYPE rwlock_field_types[]= TABLE_FIELD_DEF table_rwlock_instances::m_field_def= -{ 4, rwlock_field_types }; +{ 4, rwlock_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_rwlock_instances::m_share= @@ -383,7 +383,7 @@ static const TABLE_FIELD_TYPE cond_field_types[]= TABLE_FIELD_DEF table_cond_instances::m_field_def= -{ 2, cond_field_types }; +{ 2, cond_field_types, 0, (uint*) 0 }; PFS_engine_table_share table_cond_instances::m_share= diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc index 541ba860386..bbbfa28fa0f 100644 --- a/storage/perfschema/table_threads.cc +++ b/storage/perfschema/table_threads.cc @@ -47,7 +47,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_threads::m_field_def= -{ 3, field_types }; +{ 3, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_threads::m_share= diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc index 23bf21b6cbe..9f5097b59ce 100644 --- a/storage/sphinx/ha_sphinx.cc +++ b/storage/sphinx/ha_sphinx.cc @@ -2333,7 +2333,11 @@ int ha_sphinx::write_row ( byte * ) SPH_RET ( ER_OUT_OF_RESOURCES ); unsigned int uTimeout = 1; - mysql_options ( pConn, MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&uTimeout ); + my_bool my_true= 1; + mysql_options(pConn, MYSQL_OPT_CONNECT_TIMEOUT, + (const char*) &uTimeout); + mysql_options(pConn, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); if ( !mysql_real_connect ( pConn, m_pShare->m_sHost, "root", "", "", m_pShare->m_iPort, m_pShare->m_sSocket, 0 ) ) SPH_RET ( HandleMysqlError ( pConn, ER_CONNECT_TO_FOREIGN_DATA_SOURCE ) ); @@ -2392,7 +2396,11 @@ int ha_sphinx::delete_row ( const byte * ) SPH_RET ( ER_OUT_OF_RESOURCES ); unsigned int uTimeout = 1; - mysql_options ( pConn, MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&uTimeout ); + my_bool my_true= 1; + mysql_options(pConn, MYSQL_OPT_CONNECT_TIMEOUT, + (const char*) &uTimeout); + mysql_options(pConn, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*) &my_true); if ( !mysql_real_connect ( pConn, m_pShare->m_sHost, "root", "", "", m_pShare->m_iPort, m_pShare->m_sSocket, 0 ) ) SPH_RET ( HandleMysqlError ( pConn, ER_CONNECT_TO_FOREIGN_DATA_SOURCE ) ); diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 8f1b3e46bb2..8f7f8216782 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -1462,7 +1462,6 @@ os_file_set_nocache( #endif static int os_file_set_atomic_writes(os_file_t file, const char *name) { - static int first_time = 1; int atomic_option = 1; int ret = ioctl (file, DFS_IOCTL_ATOMIC_WRITE_SET, &atomic_option); @@ -2138,7 +2137,7 @@ os_file_set_size( "InnoDB: Error: preallocating data for" " file %s failed at\n" "InnoDB: offset 0 size %lld %lld. Operating system" - " error number %llu.\n" + " error number %d.\n" "InnoDB: Check that the disk is not full" " or a disk quota exceeded.\n" "InnoDB: Some operating system error numbers"