diff --git a/include/mysql.h b/include/mysql.h index c761938c39b..69fc8005d61 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -172,8 +172,9 @@ enum mysql_option MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER, MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH, /* MariaDB options */ - MYSQL_OPT_NONBLOCK=6000, - MYSQL_PROGRESS_CALLBACK + MYSQL_PROGRESS_CALLBACK=5999, + MYSQL_OPT_NONBLOCK, + MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY }; /** @@ -198,7 +199,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 f2bb110a3e7..d33822b2021 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); @@ -266,8 +266,9 @@ enum mysql_option MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT, MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER, MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH, - MYSQL_OPT_NONBLOCK=6000, - MYSQL_PROGRESS_CALLBACK + MYSQL_PROGRESS_CALLBACK=5999, + MYSQL_OPT_NONBLOCK, + MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY }; struct st_mysql_options_extention; struct st_mysql_options { @@ -286,7 +287,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/r/selectivity.result b/mysql-test/r/selectivity.result index 8371b0eb0b6..79ff506d603 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -77,9 +77,9 @@ order by s_suppkey; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using filesort 1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 10 100.00 Using where -3 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 0.20 Using where; Using temporary; Using filesort +3 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 100.00 Using where; Using temporary; Using filesort 2 SUBQUERY ALL NULL NULL NULL NULL 268 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 0.20 Using where; Using temporary; Using filesort +4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 268 100.00 Using where; Using temporary; Using filesort Warnings: Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index eba0ed2f32a..e32eea8827d 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -80,9 +80,9 @@ order by s_suppkey; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 10 100.00 Using where -3 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 228 0.14 Using where; Using temporary; Using filesort +3 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 228 100.00 Using where; Using temporary; Using filesort 2 SUBQUERY ALL NULL NULL NULL NULL 228 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 228 0.14 Using where; Using temporary; Using filesort +4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 228 100.00 Using where; Using temporary; Using filesort Warnings: Note 1003 select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result index eea8215b1d1..310df7e6d62 100644 --- a/mysql-test/suite/multi_source/gtid.result +++ b/mysql-test/suite/multi_source/gtid.result @@ -14,9 +14,9 @@ Note 1937 SLAVE '' started include/wait_for_slave_to_start.inc SET GLOBAL gtid_domain_id= 1; SET SESSION gtid_domain_id= 1; +CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES (1, "initial"); -CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t3 VALUES (101, "initial 1"); SET GLOBAL gtid_domain_id= 2; SET SESSION gtid_domain_id= 2; diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test index 06a0edf2ccc..d6b84fb7f3e 100644 --- a/mysql-test/suite/multi_source/gtid.test +++ b/mysql-test/suite/multi_source/gtid.test @@ -32,11 +32,17 @@ start all slaves; --connection master1 SET GLOBAL gtid_domain_id= 1; SET SESSION gtid_domain_id= 1; +CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES (1, "initial"); -CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t3 VALUES (101, "initial 1"); +# Make sure we have CREATE TABLE t3 from master1 before replicating INSERT INTO +# t3 from master2. +--connection slave1 +--let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.tables WHERE table_name = "t3" AND table_schema = "test" +--source include/wait_condition.inc + --connection master2 SET GLOBAL gtid_domain_id= 2; SET SESSION gtid_domain_id= 2; diff --git a/sql-common/client.c b/sql-common/client.c index a19bae35b78..920f2de0ca0 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -919,7 +919,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; @@ -1611,7 +1613,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; @@ -4254,6 +4258,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 9a943d8bb59..3b4119347c4 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 740d09e3cf9..ee1da6e9052 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -49,7 +49,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), @@ -62,7 +63,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 77204eb2d59..f651e332151 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -884,6 +884,7 @@ void end_slave() master_info_index= 0; active_mi= 0; mysql_mutex_unlock(&LOCK_active_mi); + free_all_rpl_filters(); DBUG_VOID_RETURN; } @@ -5025,6 +5026,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 @@ -5036,6 +5038,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) @@ -5155,14 +5159,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))) @@ -5182,6 +5187,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 9cc68339d6f..41a1ae583fc 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 c3cf866ca93..e776968792c 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/sql/sql_select.cc b/sql/sql_select.cc index b2c4c76486a..1cecfab70ec 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6901,6 +6901,18 @@ double JOIN::get_examined_rows() } +/** + @brief + Get the selectivity of equalities between columns when joining a table + + @param join The optimized join + @param idx The number of tables in the evaluated partual join + @param s The table to be joined for evaluation + @param rem_tables The bitmap of tables to be joined later + @param keyparts The number of key parts to used when joining s + @param ref_keyuse_steps Array of references to keyuses employed to join s +*/ + static double table_multi_eq_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, table_map rem_tables, uint keyparts, @@ -7011,6 +7023,19 @@ double table_multi_eq_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, return sel; } + +/** + @brief + Get the selectivity of conditions when joining a table + + @param join The optimized join + @param s The table to be joined for evaluation + @param rem_tables The bitmap of tables to be joined later + + @retval + selectivity of the conditions imposed on the rows of s +*/ + static double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, table_map rem_tables) @@ -7030,7 +7055,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, { if (pos->key == 0 && table_records > 0) { - sel*= table->quick_rows[s->quick->index]/table_records; + sel/= table->quick_rows[s->quick->index]/table_records; } } else if (pos->key != 0) @@ -7081,6 +7106,11 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, } while (keyuse->table == table && keyuse->key == key); } + /* + If the field f from the table is equal to a field from one the + earlier joined tables then the selectivity of the range conditions + over the field f must be discounted. + */ for (Field **f_ptr=table->field ; (field= *f_ptr) ; f_ptr++) { if (!bitmap_is_set(read_set, field->field_index) || @@ -12270,9 +12300,9 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, @endcode Thus, applying equalities from the where condition we basically can get more freedom in performing join operations. - Althogh we don't use this property now, it probably makes sense to use + Although we don't use this property now, it probably makes sense to use it in the future. - @param thd Thread handler + @param thd Thread handler @param cond condition to build the multiple equalities for @param inherited path to all inherited multiple equality items @param join_list list of join tables to which the condition @@ -12281,6 +12311,7 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, for on expressions @param[out] cond_equal_ref pointer to the structure to place built equalities in + @param link_equal_items equal fields are to be linked @return pointer to the transformed condition containing multiple equalities 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/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc index d1c82e81f75..245abc34695 100644 --- a/storage/perfschema/table_events_waits.cc +++ b/storage/perfschema/table_events_waits.cc @@ -131,7 +131,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_events_waits_current::m_field_def= -{ 19, field_types }; +{ 19, field_types, 0, (uint*) 0 }; PFS_engine_table_share table_events_waits_current::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 c71a1ed479e..3f8997b8c77 100644 --- a/storage/perfschema/table_ews_global_by_event_name.cc +++ b/storage/perfschema/table_ews_global_by_event_name.cc @@ -67,7 +67,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 a3d2fc454bb..5b13210c004 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 a891d2f04cd..473ea8b82cf 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 7b5441b684a..563307f97ad 100644 --- a/storage/perfschema/table_setup_consumers.cc +++ b/storage/perfschema/table_setup_consumers.cc @@ -108,7 +108,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 31e2adb0f62..060857c3a38 100644 --- a/storage/perfschema/table_setup_instruments.cc +++ b/storage/perfschema/table_setup_instruments.cc @@ -51,7 +51,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 a6a8a52b7e5..1176f1f34b1 100644 --- a/storage/perfschema/table_setup_timers.cc +++ b/storage/perfschema/table_setup_timers.cc @@ -65,7 +65,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 9631c5fb205..06889e735ba 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= @@ -219,7 +219,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= @@ -385,7 +385,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 91300d6b67e..2104c24b65c 100644 --- a/storage/perfschema/table_threads.cc +++ b/storage/perfschema/table_threads.cc @@ -98,7 +98,7 @@ static const TABLE_FIELD_TYPE field_types[]= TABLE_FIELD_DEF table_threads::m_field_def= -{ 14, field_types }; +{ 14, 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"