From 29ffd6363917b4240c5f7c5411a2ae59b4a6dc21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 16 Feb 2012 16:26:12 +0000 Subject: [PATCH] - up to 5.5.20 Changed files: bug860910.patch -> 1.5 bug917246.patch -> 1.1 control_online_alter_index.patch -> 1.8 group_commit.patch -> 1.4 innodb_adaptive_hash_index_partitions.patch -> 1.13 innodb_admin_command_base.patch -> 1.11 innodb_buffer_pool_pages_i_s.patch -> 1.12 innodb_buffer_pool_shm.patch -> 1.12 innodb_deadlock_count.patch -> 1.10 innodb_dict_size_limit.patch -> 1.10 innodb_expand_fast_index_creation.patch -> 1.7 innodb_expand_import.patch -> 1.11 innodb_extend_slow.patch -> 1.12 innodb_extra_rseg.patch -> 1.10 innodb_fake_changes.patch -> 1.5 innodb_fast_checksum.patch -> 1.11 innodb_files_extend.patch -> 1.11 innodb_fix_misc.patch -> 1.13 innodb_io_patches.patch -> 1.11 innodb_kill_idle_transaction.patch -> 1.4 innodb_lru_dump_restore.patch -> 1.10 innodb_opt_lru_count.patch -> 1.9 innodb_overwrite_relay_log_info.patch -> 1.11 innodb_pass_corrupt_table.patch -> 1.13 innodb_recovery_patches.patch -> 1.11 innodb_separate_doublewrite.patch -> 1.14 innodb_show_lock_name.patch -> 1.10 innodb_show_status.patch -> 1.10 innodb_show_status_extend.patch -> 1.11 innodb_show_sys_tables.patch -> 1.11 innodb_split_buf_pool_mutex.patch -> 1.12 innodb_stats.patch -> 1.11 innodb_thread_concurrency_timer_based.patch -> 1.10 log_connection_error.patch -> 1.8 log_warnings_suppress.patch -> 1.10 mysql.spec -> 1.567 optimizer_fix.patch -> 1.8 processlist_row_stats.patch -> 1.8 query_cache_enhance.patch -> 1.13 response_time_distribution.patch -> 1.12 show_slave_status_nolock.patch -> 1.10 show_temp.patch -> 1.11 slow_extended.patch -> 1.13 sphinx-mysql.patch -> 1.2 sql_no_fcache.patch -> 1.10 subunit.patch -> 1.5 userstat.patch -> 1.12 --- bug860910.patch | 2 +- bug917246.patch | 17 + control_online_alter_index.patch | 2 +- group_commit.patch | 52 +-- innodb_adaptive_hash_index_partitions.patch | 16 +- innodb_admin_command_base.patch | 2 +- innodb_buffer_pool_pages_i_s.patch | 6 +- innodb_buffer_pool_shm.patch | 4 +- innodb_deadlock_count.patch | 6 +- innodb_dict_size_limit.patch | 18 +- innodb_expand_fast_index_creation.patch | 10 +- innodb_expand_import.patch | 22 +- innodb_extend_slow.patch | 54 +-- innodb_extra_rseg.patch | 2 +- innodb_fake_changes.patch | 16 +- innodb_fast_checksum.patch | 8 +- innodb_files_extend.patch | 34 +- innodb_fix_misc.patch | 54 +-- innodb_io_patches.patch | 58 ++- innodb_kill_idle_transaction.patch | 10 +- innodb_lru_dump_restore.patch | 38 +- innodb_opt_lru_count.patch | 32 +- innodb_overwrite_relay_log_info.patch | 4 +- innodb_pass_corrupt_table.patch | 80 ++-- innodb_recovery_patches.patch | 4 +- innodb_separate_doublewrite.patch | 40 +- innodb_show_lock_name.patch | 8 +- innodb_show_status.patch | 16 +- innodb_show_status_extend.patch | 14 +- innodb_show_sys_tables.patch | 2 +- innodb_split_buf_pool_mutex.patch | 423 +++++++++++--------- innodb_stats.patch | 48 +-- innodb_thread_concurrency_timer_based.patch | 12 +- log_connection_error.patch | 6 +- log_warnings_suppress.patch | 8 +- mysql.spec | 17 +- optimizer_fix.patch | 4 +- processlist_row_stats.patch | 2 +- query_cache_enhance.patch | 4 +- response_time_distribution.patch | 30 +- show_slave_status_nolock.patch | 4 +- show_temp.patch | 10 +- slow_extended.patch | 22 +- sphinx-mysql.patch | 189 --------- sql_no_fcache.patch | 16 +- subunit.patch | 10 +- userstat.patch | 78 ++-- 47 files changed, 696 insertions(+), 818 deletions(-) create mode 100644 bug917246.patch delete mode 100644 sphinx-mysql.patch diff --git a/bug860910.patch b/bug860910.patch index 759d521..f35a187 100644 --- a/bug860910.patch +++ b/bug860910.patch @@ -77,7 +77,7 @@ +--source include/rpl_end.inc --- a/sql/log.cc +++ b/sql/log.cc -@@ -5076,6 +5076,12 @@ +@@ -5112,6 +5112,12 @@ user_var_event->type, user_var_event->charset_number, flags); diff --git a/bug917246.patch b/bug917246.patch new file mode 100644 index 0000000..9c43316 --- /dev/null +++ b/bug917246.patch @@ -0,0 +1,17 @@ +--- /dev/null ++++ b/mysql-test/r/percona_innodb_version.result +@@ -0,0 +1,3 @@ ++SELECT @@innodb_version; ++@@innodb_version ++1.1.x-x.x +--- /dev/null ++++ b/mysql-test/t/percona_innodb_version.test +@@ -0,0 +1,8 @@ ++--source include/have_innodb.inc ++ ++######################################################################## ++# Bug #917246: Unintentional change of innodb_version format in 5.1.60 ++######################################################################## ++ ++--replace_regex /1\.1\.[0-9]+-[0-9]+\.[0-9]+/1.1.x-x.x/ ++SELECT @@innodb_version; diff --git a/control_online_alter_index.patch b/control_online_alter_index.patch index f51a5c6..29c0051 100644 --- a/control_online_alter_index.patch +++ b/control_online_alter_index.patch @@ -58,7 +58,7 @@ for (idx_p= index_drop_buffer, idx_end_p= idx_p + index_drop_count; --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -2192,6 +2192,13 @@ +@@ -2265,6 +2265,13 @@ GLOBAL_VAR(opt_optimizer_fix), NO_CMD_LINE, DEFAULT(TRUE)); diff --git a/group_commit.patch b/group_commit.patch index 3e64147..ec57a9e 100644 --- a/group_commit.patch +++ b/group_commit.patch @@ -522,7 +522,7 @@ sync_period_ptr(sync_period), is_relay_log(0), signal_cnt(0), description_event_for_exec(0), description_event_for_queue(0) -@@ -5325,19 +5327,15 @@ +@@ -5361,19 +5363,15 @@ SYNOPSIS write_cache() cache Cache to write to the binary log @@ -544,7 +544,7 @@ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) return ER_ERROR_ON_WRITE; uint length= my_b_bytes_in_cache(cache), group, carry, hdr_offs; -@@ -5448,6 +5446,8 @@ +@@ -5484,6 +5482,8 @@ } /* Write data to the binary log file */ @@ -553,7 +553,7 @@ if (my_b_write(&log_file, cache->read_pos, length)) return ER_ERROR_ON_WRITE; thd->binlog_bytes_written+= length; -@@ -5456,9 +5456,6 @@ +@@ -5492,9 +5492,6 @@ DBUG_ASSERT(carry == 0); @@ -563,7 +563,7 @@ return 0; // All OK } -@@ -5499,8 +5496,6 @@ +@@ -5535,8 +5532,6 @@ if (!is_open()) DBUG_RETURN(error); @@ -572,7 +572,7 @@ Incident incident= INCIDENT_LOST_EVENTS; Incident_log_event ev(thd, incident, write_error_msg); if (lock) -@@ -5549,112 +5544,332 @@ +@@ -5585,112 +5580,332 @@ 'cache' needs to be reinitialized after this functions returns. */ @@ -971,7 +971,7 @@ /** Wait until we get a signal that the relay log has been updated. -@@ -6059,6 +6274,68 @@ +@@ -6095,6 +6310,68 @@ } @@ -1040,7 +1040,7 @@ /********* transaction coordinator log for 2pc - mmap() based solution *******/ /* -@@ -6195,6 +6472,7 @@ +@@ -6231,6 +6508,7 @@ mysql_mutex_init(key_LOCK_pool, &LOCK_pool, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_active, &COND_active, 0); mysql_cond_init(key_COND_pool, &COND_pool, 0); @@ -1048,7 +1048,7 @@ inited=6; -@@ -6202,6 +6480,8 @@ +@@ -6238,6 +6516,8 @@ active=pages; pool=pages+1; pool_last=pages+npages-1; @@ -1057,7 +1057,7 @@ return 0; -@@ -6307,7 +6587,7 @@ +@@ -6343,7 +6623,7 @@ to the position in memory where xid was logged to. */ @@ -1066,7 +1066,7 @@ { int err; PAGE *p; -@@ -6446,7 +6726,9 @@ +@@ -6482,7 +6762,9 @@ mysql_mutex_destroy(&LOCK_sync); mysql_mutex_destroy(&LOCK_active); mysql_mutex_destroy(&LOCK_pool); @@ -1076,7 +1076,7 @@ case 5: data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails case 4: -@@ -6656,42 +6938,87 @@ +@@ -6692,42 +6974,87 @@ mysql_cond_destroy(&COND_prep_xids); } @@ -1176,7 +1176,7 @@ } int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle) -@@ -6760,9 +7087,67 @@ +@@ -6796,9 +7123,67 @@ { return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file; } @@ -1244,7 +1244,7 @@ struct st_mysql_storage_engine binlog_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; -@@ -6777,7 +7162,7 @@ +@@ -6813,7 +7198,7 @@ binlog_init, /* Plugin Init */ NULL, /* Plugin Deinit */ 0x0100 /* 1.0 */, @@ -1446,7 +1446,7 @@ class Log_event_handler --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -1490,6 +1490,7 @@ +@@ -1495,6 +1495,7 @@ ha_end(); if (tc_log) tc_log->close(); @@ -1454,7 +1454,7 @@ delegates_destroy(); xid_cache_free(); table_def_free(); -@@ -4061,6 +4062,8 @@ +@@ -3911,6 +3912,8 @@ query_response_time_init(); #endif // HAVE_RESPONSE_TIME_DISTRIBUTION /* We have to initialize the storage engines before CSV logging */ @@ -1463,7 +1463,7 @@ init_global_table_stats(); init_global_index_stats(); -@@ -8004,6 +8007,7 @@ +@@ -7872,6 +7875,7 @@ key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; PSI_mutex_key key_RELAYLOG_LOCK_index; @@ -1471,7 +1471,7 @@ static PSI_mutex_info all_server_mutexes[]= { -@@ -8024,6 +8028,7 @@ +@@ -7892,6 +7896,7 @@ { &key_delayed_insert_mutex, "Delayed_insert::mutex", 0}, { &key_hash_filo_lock, "hash_filo::lock", 0}, { &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL}, @@ -1479,7 +1479,7 @@ { &key_LOCK_connection_count, "LOCK_connection_count", PSI_FLAG_GLOBAL}, { &key_LOCK_crypt, "LOCK_crypt", PSI_FLAG_GLOBAL}, { &key_LOCK_delayed_create, "LOCK_delayed_create", PSI_FLAG_GLOBAL}, -@@ -8039,6 +8044,7 @@ +@@ -7907,6 +7912,7 @@ "LOCK_global_index_stats", PSI_FLAG_GLOBAL}, { &key_LOCK_gdl, "LOCK_gdl", PSI_FLAG_GLOBAL}, { &key_LOCK_global_system_variables, "LOCK_global_system_variables", PSI_FLAG_GLOBAL}, @@ -1487,7 +1487,7 @@ { &key_LOCK_manager, "LOCK_manager", PSI_FLAG_GLOBAL}, { &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL}, { &key_LOCK_rpl_status, "LOCK_rpl_status", PSI_FLAG_GLOBAL}, -@@ -8050,6 +8056,7 @@ +@@ -7918,6 +7924,7 @@ { &key_LOCK_temporary_tables, "THD::LOCK_temporary_tables", 0}, { &key_LOCK_user_conn, "LOCK_user_conn", PSI_FLAG_GLOBAL}, { &key_LOCK_uuid_generator, "LOCK_uuid_generator", PSI_FLAG_GLOBAL}, @@ -1495,7 +1495,7 @@ { &key_LOG_LOCK_log, "LOG::LOCK_log", 0}, { &key_master_info_data_lock, "Master_info::data_lock", 0}, { &key_master_info_run_lock, "Master_info::run_lock", 0}, -@@ -8097,6 +8104,7 @@ +@@ -7965,6 +7972,7 @@ key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; PSI_cond_key key_RELAYLOG_update_cond; @@ -1503,7 +1503,7 @@ static PSI_cond_info all_server_conds[]= { -@@ -8113,8 +8121,10 @@ +@@ -7981,8 +7989,10 @@ { &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0}, { &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0}, { &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL}, @@ -1516,7 +1516,7 @@ { &key_item_func_sleep_cond, "Item_func_sleep::cond", 0}, --- a/sql/mysqld.h +++ b/sql/mysqld.h -@@ -273,6 +273,7 @@ +@@ -274,6 +274,7 @@ key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; extern PSI_mutex_key key_RELAYLOG_LOCK_index; @@ -1524,7 +1524,7 @@ extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, -@@ -293,6 +294,7 @@ +@@ -294,6 +295,7 @@ key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; extern PSI_cond_key key_RELAYLOG_update_cond; @@ -1552,7 +1552,7 @@ mysql_mutex_destroy(&LOCK_thd_data); mysql_mutex_destroy(&LOCK_temporary_tables); #ifndef DBUG_OFF -@@ -5292,6 +5296,24 @@ +@@ -5297,6 +5301,24 @@ DBUG_RETURN(0); } @@ -1887,7 +1887,7 @@ trx_deregister_from_2pc(trx); -@@ -10982,6 +11149,7 @@ +@@ -10981,6 +11148,7 @@ srv_active_wake_master_thread(); @@ -1895,7 +1895,7 @@ if (thd_sql_command(thd) != SQLCOM_XA_PREPARE && (all || !thd_test_options( -@@ -11008,6 +11176,7 @@ +@@ -11007,6 +11175,7 @@ mysql_mutex_lock(&prepare_commit_mutex); trx_owns_prepare_commit_mutex_set(trx); } diff --git a/innodb_adaptive_hash_index_partitions.patch b/innodb_adaptive_hash_index_partitions.patch index f7312b1..ed42237 100644 --- a/innodb_adaptive_hash_index_partitions.patch +++ b/innodb_adaptive_hash_index_partitions.patch @@ -851,7 +851,7 @@ #ifdef UNIV_DEBUG block->page.in_page_hash = FALSE; -@@ -1427,7 +1428,11 @@ +@@ -1429,7 +1430,11 @@ ulint p; #ifdef UNIV_SYNC_DEBUG @@ -864,7 +864,7 @@ #endif /* UNIV_SYNC_DEBUG */ ut_ad(!btr_search_enabled); -@@ -2142,6 +2147,7 @@ +@@ -2144,6 +2149,7 @@ { block->check_index_page_at_flush = FALSE; block->index = NULL; @@ -874,7 +874,7 @@ block->n_fields = 1; --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c -@@ -560,7 +560,7 @@ +@@ -576,7 +576,7 @@ mutex_exit(&buf_pool->LRU_list_mutex); @@ -883,7 +883,7 @@ chunk = buf_pool->chunks; for (j = buf_pool->n_chunks; j--; chunk++) { buf_block_t* block = chunk->blocks; -@@ -572,16 +572,16 @@ +@@ -588,16 +588,16 @@ continue; } @@ -905,7 +905,7 @@ --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c -@@ -1846,7 +1846,7 @@ +@@ -1851,7 +1851,7 @@ zero. */ for (;;) { @@ -916,7 +916,7 @@ } --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -11833,6 +11833,11 @@ +@@ -11832,6 +11832,11 @@ "Disable with --skip-innodb-adaptive-hash-index.", NULL, innodb_adaptive_hash_index_update, TRUE); @@ -928,7 +928,7 @@ static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay, PLUGIN_VAR_RQCMDARG, "Replication thread delay (ms) on the slave server if " -@@ -12253,6 +12258,7 @@ +@@ -12252,6 +12257,7 @@ MYSQL_SYSVAR(use_sys_stats_table), MYSQL_SYSVAR(stats_sample_pages), MYSQL_SYSVAR(adaptive_hash_index), @@ -1411,7 +1411,7 @@ --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1580,6 +1580,7 @@ +@@ -1600,6 +1600,7 @@ complete, though: there may have been hash collisions, record deletions, etc. */ diff --git a/innodb_admin_command_base.patch b/innodb_admin_command_base.patch index 9bc1415..9177386 100644 --- a/innodb_admin_command_base.patch +++ b/innodb_admin_command_base.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -11999,7 +11999,8 @@ +@@ -12041,7 +12041,8 @@ i_s_innodb_sys_foreign_cols, i_s_innodb_sys_stats, i_s_innodb_table_stats, diff --git a/innodb_buffer_pool_pages_i_s.patch b/innodb_buffer_pool_pages_i_s.patch index e6ef9a3..9465995 100644 --- a/innodb_buffer_pool_pages_i_s.patch +++ b/innodb_buffer_pool_pages_i_s.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c -@@ -4161,6 +4161,36 @@ +@@ -4163,6 +4163,36 @@ mutex_exit(block_mutex); } @@ -46,7 +46,7 @@ @return TRUE */ --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -12296,6 +12296,9 @@ +@@ -12338,6 +12338,9 @@ i_s_innodb_sys_stats, i_s_innodb_table_stats, i_s_innodb_index_stats, @@ -793,7 +793,7 @@ #endif /* i_s_h */ --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1161,6 +1161,14 @@ +@@ -1181,6 +1181,14 @@ /*===========*/ const buf_pool_t* buf_pool) /*!< in: buffer pool */ __attribute__((nonnull, const)); diff --git a/innodb_buffer_pool_shm.patch b/innodb_buffer_pool_shm.patch index 47ee587..3dca118 100644 --- a/innodb_buffer_pool_shm.patch +++ b/innodb_buffer_pool_shm.patch @@ -55,7 +55,7 @@ srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; srv_n_file_io_threads = (ulint) innobase_file_io_threads; -@@ -11864,6 +11872,16 @@ +@@ -11863,6 +11871,16 @@ "Number of buffer pool instances, set to higher value on high-end machines to increase scalability", NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L); @@ -72,7 +72,7 @@ static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, PLUGIN_VAR_RQCMDARG, "Helps in performance tuning in heavily concurrent environments.", -@@ -12170,6 +12188,8 @@ +@@ -12209,6 +12227,8 @@ MYSQL_SYSVAR(autoextend_increment), MYSQL_SYSVAR(buffer_pool_size), MYSQL_SYSVAR(buffer_pool_instances), diff --git a/innodb_deadlock_count.patch b/innodb_deadlock_count.patch index 4e38012..4e64e5e 100644 --- a/innodb_deadlock_count.patch +++ b/innodb_deadlock_count.patch @@ -28,7 +28,7 @@ Gets the size of a lock struct. --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h -@@ -767,6 +767,7 @@ +@@ -770,6 +770,7 @@ ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */ ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */ @@ -48,7 +48,7 @@ break; --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c -@@ -474,6 +474,7 @@ +@@ -477,6 +477,7 @@ static ulint srv_n_rows_deleted_old = 0; static ulint srv_n_rows_read_old = 0; @@ -56,7 +56,7 @@ UNIV_INTERN ulint srv_n_lock_wait_count = 0; UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; -@@ -2290,6 +2291,7 @@ +@@ -2293,6 +2294,7 @@ export_vars.innodb_buffer_pool_pages_data = LRU_len; export_vars.innodb_buffer_pool_pages_dirty = flush_list_len; export_vars.innodb_buffer_pool_pages_free = free_len; diff --git a/innodb_dict_size_limit.patch b/innodb_dict_size_limit.patch index cadea6f..49da2f3 100644 --- a/innodb_dict_size_limit.patch +++ b/innodb_dict_size_limit.patch @@ -289,7 +289,7 @@ mutex_exit(&(dict_sys->mutex)); if (table != NULL) { -@@ -1259,6 +1263,64 @@ +@@ -1264,6 +1268,64 @@ dict_mem_table_free(table); } @@ -354,7 +354,7 @@ /****************************************************************//** If the given column name is reserved for InnoDB system columns, return TRUE. -@@ -1763,6 +1825,11 @@ +@@ -1768,6 +1830,11 @@ ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(mutex_own(&(dict_sys->mutex))); @@ -377,9 +377,9 @@ {"have_atomic_builtins", (char*) &export_vars.innodb_have_atomic_builtins, SHOW_BOOL}, {"log_waits", -@@ -11774,6 +11776,11 @@ - "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)", - NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib); +@@ -11813,6 +11815,11 @@ + NULL, NULL, 0, 0, 1, 0); + #endif +static MYSQL_SYSVAR_ULONG(dict_size_limit, srv_dict_size_limit, + PLUGIN_VAR_RQCMDARG, @@ -389,7 +389,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), -@@ -11843,6 +11850,7 @@ +@@ -11882,6 +11889,7 @@ MYSQL_SYSVAR(flush_neighbor_pages), MYSQL_SYSVAR(read_ahead), MYSQL_SYSVAR(adaptive_flushing_method), @@ -425,7 +425,7 @@ or freed in a file segment. */ --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1575,6 +1575,15 @@ +@@ -1595,6 +1595,15 @@ #define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b)) /* @} */ @@ -495,7 +495,7 @@ /*-------------------------------------------*/ extern ulint srv_n_rows_inserted; -@@ -714,6 +715,7 @@ +@@ -717,6 +718,7 @@ ulint innodb_data_writes; /*!< I/O write requests */ ulint innodb_data_written; /*!< Data bytes written */ ulint innodb_data_reads; /*!< I/O read requests */ @@ -514,7 +514,7 @@ /*-------------------------------------------*/ UNIV_INTERN ulong srv_n_spin_wait_rounds = 30; UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; -@@ -2222,6 +2224,7 @@ +@@ -2225,6 +2227,7 @@ export_vars.innodb_data_reads = os_n_file_reads; export_vars.innodb_data_writes = os_n_file_writes; export_vars.innodb_data_written = srv_data_written; diff --git a/innodb_expand_fast_index_creation.patch b/innodb_expand_fast_index_creation.patch index f1df4cd..dda5b1a 100644 --- a/innodb_expand_fast_index_creation.patch +++ b/innodb_expand_fast_index_creation.patch @@ -884,7 +884,7 @@ --- a/sql/sql_lex.h +++ b/sql/sql_lex.h -@@ -1013,6 +1013,9 @@ +@@ -1014,6 +1014,9 @@ List alter_list; List key_list; List create_list; @@ -894,7 +894,7 @@ uint flags; enum enum_enable_or_disable keys_onoff; enum tablespace_op_type tablespace_op; -@@ -1024,6 +1027,8 @@ +@@ -1025,6 +1028,8 @@ Alter_info() : @@ -903,7 +903,7 @@ flags(0), keys_onoff(LEAVE_AS_IS), tablespace_op(NO_TABLESPACE_OP), -@@ -1039,6 +1044,9 @@ +@@ -1040,6 +1045,9 @@ alter_list.empty(); key_list.empty(); create_list.empty(); @@ -1322,7 +1322,7 @@ --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -710,6 +710,14 @@ +@@ -783,6 +783,14 @@ ON_CHECK(event_scheduler_check), ON_UPDATE(event_scheduler_update)); #endif @@ -1425,7 +1425,7 @@ --expire-logs-days=# If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup -@@ -777,6 +781,7 @@ +@@ -781,6 +785,7 @@ div-precision-increment 4 engine-condition-pushdown TRUE event-scheduler OFF diff --git a/innodb_expand_import.patch b/innodb_expand_import.patch index eaf2256..3605d61 100644 --- a/innodb_expand_import.patch +++ b/innodb_expand_import.patch @@ -51,7 +51,7 @@ #ifndef UNIV_HOTBACKUP # include "buf0lru.h" # include "ibuf0ibuf.h" -@@ -3033,6 +3041,84 @@ +@@ -3041,6 +3049,84 @@ } /********************************************************************//** @@ -136,7 +136,7 @@ Tries to open a single-table tablespace and optionally checks the space id is right in it. If does not succeed, prints an error message to the .err log. This function is used to open a tablespace when we start up mysqld, and also in -@@ -3055,8 +3141,11 @@ +@@ -3063,8 +3149,11 @@ accessing the first page of the file */ ulint id, /*!< in: space id */ ulint flags, /*!< in: tablespace flags */ @@ -149,7 +149,7 @@ { os_file_t file; char* filepath; -@@ -3079,7 +3168,7 @@ +@@ -3087,7 +3176,7 @@ file = os_file_create_simple_no_error_handling( innodb_file_data_key, filepath, OS_FILE_OPEN, @@ -158,7 +158,7 @@ if (!success) { /* The following call prints an error message */ os_file_get_last_error(TRUE); -@@ -3126,6 +3215,453 @@ +@@ -3134,6 +3223,453 @@ space_id = fsp_header_get_space_id(page); space_flags = fsp_header_get_flags(page); @@ -612,7 +612,7 @@ ut_free(buf2); if (UNIV_UNLIKELY(space_id != id -@@ -3167,6 +3703,269 @@ +@@ -3175,6 +3711,269 @@ os_file_close(file); mem_free(filepath); @@ -884,7 +884,7 @@ #endif /* !UNIV_HOTBACKUP */ --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -7422,6 +7422,14 @@ +@@ -7421,6 +7421,14 @@ err = row_discard_tablespace_for_mysql(dict_table->name, trx); } else { err = row_import_tablespace_for_mysql(dict_table->name, trx); @@ -899,9 +899,9 @@ } err = convert_error_code_to_mysql(err, dict_table->flags, NULL); -@@ -11781,6 +11789,11 @@ - "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)", - NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib); +@@ -11820,6 +11828,11 @@ + NULL, NULL, 0, 0, 1, 0); + #endif +static MYSQL_SYSVAR_ULONG(import_table_from_xtrabackup, srv_expand_import, + PLUGIN_VAR_RQCMDARG, @@ -911,7 +911,7 @@ static MYSQL_SYSVAR_ULONG(dict_size_limit, srv_dict_size_limit, PLUGIN_VAR_RQCMDARG, "Limit the allocated memory for dictionary cache. (0: unlimited)", -@@ -11855,6 +11868,7 @@ +@@ -11894,6 +11907,7 @@ MYSQL_SYSVAR(flush_neighbor_pages), MYSQL_SYSVAR(read_ahead), MYSQL_SYSVAR(adaptive_flushing_method), @@ -1120,7 +1120,7 @@ /** When mysqld is run, the default directory "." is the mysqld datadir, but in the MySQL Embedded Server Library and ibbackup it is not the default -@@ -473,8 +474,11 @@ +@@ -478,8 +479,11 @@ accessing the first page of the file */ ulint id, /*!< in: space id */ ulint flags, /*!< in: tablespace flags */ diff --git a/innodb_extend_slow.patch b/innodb_extend_slow.patch index 278bf67..28c495f 100644 --- a/innodb_extend_slow.patch +++ b/innodb_extend_slow.patch @@ -48,7 +48,7 @@ /* IMPLEMENTATION OF THE BUFFER POOL -@@ -1869,8 +1903,16 @@ +@@ -1871,8 +1905,16 @@ mutex_t* block_mutex; ibool must_read; unsigned access_time; @@ -65,7 +65,7 @@ buf_pool->stat.n_page_gets++; for (;;) { -@@ -1888,7 +1930,7 @@ +@@ -1890,7 +1932,7 @@ //buf_pool_mutex_exit(buf_pool); rw_lock_s_unlock(&buf_pool->page_hash_latch); @@ -74,7 +74,7 @@ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG ut_a(++buf_dbg_counter % 37 || buf_validate()); -@@ -1984,6 +2026,13 @@ +@@ -1986,6 +2028,13 @@ /* Let us wait until the read operation completes */ @@ -88,7 +88,7 @@ for (;;) { enum buf_io_fix io_fix; -@@ -1998,6 +2047,12 @@ +@@ -2000,6 +2049,12 @@ break; } } @@ -101,7 +101,7 @@ } #ifdef UNIV_IBUF_COUNT_DEBUG -@@ -2312,6 +2367,11 @@ +@@ -2314,6 +2369,11 @@ ibool must_read; ulint retries = 0; mutex_t* block_mutex = NULL; @@ -113,7 +113,7 @@ buf_pool_t* buf_pool = buf_pool_get(space, offset); ut_ad(mtr); -@@ -2341,6 +2401,9 @@ +@@ -2343,6 +2403,9 @@ || ibuf_page_low(space, zip_size, offset, FALSE, file, line, NULL)); #endif @@ -123,7 +123,7 @@ buf_pool->stat.n_page_gets++; fold = buf_page_address_fold(space, offset); loop: -@@ -2411,9 +2474,9 @@ +@@ -2413,9 +2476,9 @@ return(NULL); } @@ -135,7 +135,7 @@ retries = 0; } else if (retries < BUF_PAGE_READ_MAX_RETRIES) { -@@ -2723,6 +2786,13 @@ +@@ -2725,6 +2788,13 @@ /* Let us wait until the read operation completes */ @@ -149,7 +149,7 @@ for (;;) { enum buf_io_fix io_fix; -@@ -2737,6 +2807,12 @@ +@@ -2739,6 +2809,12 @@ break; } } @@ -162,7 +162,7 @@ } fix_type = MTR_MEMO_BUF_FIX; -@@ -2763,13 +2839,17 @@ +@@ -2765,13 +2841,17 @@ read-ahead */ buf_read_ahead_linear(space, zip_size, offset, @@ -181,7 +181,7 @@ return(block); } -@@ -2793,6 +2873,7 @@ +@@ -2795,6 +2875,7 @@ unsigned access_time; ibool success; ulint fix_type; @@ -189,7 +189,7 @@ ut_ad(block); ut_ad(mtr); -@@ -2870,6 +2951,10 @@ +@@ -2872,6 +2953,10 @@ #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(block->page.file_page_was_freed == FALSE); #endif @@ -200,7 +200,7 @@ if (UNIV_UNLIKELY(!access_time)) { /* In the case of a first access, try to apply linear read-ahead */ -@@ -2877,7 +2962,7 @@ +@@ -2879,7 +2964,7 @@ buf_read_ahead_linear(buf_block_get_space(block), buf_block_get_zip_size(block), buf_block_get_page_no(block), @@ -209,7 +209,7 @@ } #ifdef UNIV_IBUF_COUNT_DEBUG -@@ -2887,6 +2972,9 @@ +@@ -2889,6 +2974,9 @@ buf_pool = buf_pool_from_block(block); buf_pool->stat.n_page_gets++; @@ -219,7 +219,7 @@ return(TRUE); } -@@ -2909,6 +2997,7 @@ +@@ -2911,6 +2999,7 @@ buf_pool_t* buf_pool; ibool success; ulint fix_type; @@ -227,7 +227,7 @@ ut_ad(mtr); ut_ad(mtr->state == MTR_ACTIVE); -@@ -2995,6 +3084,11 @@ +@@ -2997,6 +3086,11 @@ #endif buf_pool->stat.n_page_gets++; @@ -355,7 +355,7 @@ --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c -@@ -4757,7 +4757,7 @@ +@@ -4765,7 +4765,7 @@ node->name, node->handle, buf, offset_low, offset_high, page_size * n_pages, @@ -364,7 +364,7 @@ #endif if (success) { node->size += n_pages; -@@ -5084,7 +5084,7 @@ +@@ -5092,7 +5092,7 @@ i/o on a tablespace which does not exist */ UNIV_INTERN ulint @@ -373,7 +373,7 @@ /*===*/ ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE, ORed to OS_FILE_LOG, if a log i/o -@@ -5109,8 +5109,9 @@ +@@ -5117,8 +5117,9 @@ void* buf, /*!< in/out: buffer where to store read data or from where to write; in aio this must be appropriately aligned */ @@ -384,7 +384,7 @@ { ulint mode; fil_space_t* space; -@@ -5278,7 +5279,7 @@ +@@ -5286,7 +5287,7 @@ #else /* Queue the aio request */ ret = os_aio(type, mode | wake_later, node->name, node->handle, buf, @@ -445,7 +445,7 @@ /*********************************************************************//** Note that a transaction has been registered with MySQL. @return true if transaction is registered with MySQL 2PC coordinator */ -@@ -9418,6 +9454,25 @@ +@@ -9417,6 +9453,25 @@ statement has ended */ if (trx->n_mysql_tables_in_use == 0) { @@ -514,7 +514,7 @@ order to contract the insert buffer tree. Technically, this function is like --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h -@@ -615,9 +615,12 @@ +@@ -620,9 +620,12 @@ Reads or writes data. This operation is asynchronous (aio). @return DB_SUCCESS, or DB_TABLESPACE_DELETED if we are trying to do i/o on a tablespace which does not exist */ @@ -528,7 +528,7 @@ /*===*/ ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE, ORed to OS_FILE_LOG, if a log i/o -@@ -642,8 +645,9 @@ +@@ -647,8 +650,9 @@ void* buf, /*!< in/out: buffer where to store read data or from where to write; in aio this must be appropriately aligned */ @@ -887,7 +887,7 @@ /* The following counter is incremented whenever there is some user activity in the server */ UNIV_INTERN ulint srv_activity_count = 0; -@@ -1234,6 +1237,10 @@ +@@ -1237,6 +1240,10 @@ ibool has_slept = FALSE; srv_conc_slot_t* slot = NULL; ulint i; @@ -898,7 +898,7 @@ #ifdef UNIV_SYNC_DEBUG ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch)); -@@ -1314,6 +1321,7 @@ +@@ -1317,6 +1324,7 @@ switches. */ if (SRV_THREAD_SLEEP_DELAY > 0) { os_thread_sleep(SRV_THREAD_SLEEP_DELAY); @@ -906,7 +906,7 @@ } trx->op_info = ""; -@@ -1373,6 +1381,14 @@ +@@ -1376,6 +1384,14 @@ #ifdef UNIV_SYNC_DEBUG ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch)); #endif /* UNIV_SYNC_DEBUG */ @@ -921,7 +921,7 @@ trx->op_info = "waiting in InnoDB queue"; thd_wait_begin(trx->mysql_thd, THD_WAIT_USER_LOCK); -@@ -1381,6 +1397,12 @@ +@@ -1384,6 +1400,12 @@ trx->op_info = ""; diff --git a/innodb_extra_rseg.patch b/innodb_extra_rseg.patch index 2a8a35b..90ab33c 100644 --- a/innodb_extra_rseg.patch +++ b/innodb_extra_rseg.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -11664,6 +11664,7 @@ +@@ -11706,6 +11706,7 @@ NULL, /* reserved */ 0, /* flags */ }, diff --git a/innodb_fake_changes.patch b/innodb_fake_changes.patch index f459b00..e6ec1d4 100644 --- a/innodb_fake_changes.patch +++ b/innodb_fake_changes.patch @@ -214,7 +214,7 @@ /* Transaction is deregistered only in a commit or a rollback. If it is deregistered we know there cannot be resources to be freed and we could return immediately. For the time being, we play safe -@@ -7544,6 +7557,12 @@ +@@ -7543,6 +7556,12 @@ trx = innobase_trx_allocate(thd); @@ -227,7 +227,7 @@ /* Latch the InnoDB data dictionary exclusively so that no deadlocks or lock waits can happen in it during a table create operation. Drop table etc. do this latching in row0mysql.c. */ -@@ -7764,6 +7783,10 @@ +@@ -7763,6 +7782,10 @@ DBUG_RETURN(HA_ERR_CRASHED); } @@ -238,7 +238,7 @@ /* Truncate the table in InnoDB */ error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); -@@ -7820,6 +7843,12 @@ +@@ -7819,6 +7842,12 @@ trx = innobase_trx_allocate(thd); @@ -251,7 +251,7 @@ name_len = strlen(name); ut_a(name_len < 1000); -@@ -7906,6 +7935,12 @@ +@@ -7905,6 +7934,12 @@ trx->mysql_thd = NULL; #else trx = innobase_trx_allocate(thd); @@ -264,7 +264,7 @@ #endif row_drop_database_for_mysql(namebuf, trx); my_free(namebuf); -@@ -8011,6 +8046,11 @@ +@@ -8010,6 +8045,11 @@ trx_search_latch_release_if_reserved(parent_trx); trx = innobase_trx_allocate(thd); @@ -276,7 +276,7 @@ error = innobase_rename_table(trx, from, to, TRUE); -@@ -10881,6 +10921,10 @@ +@@ -10880,6 +10920,10 @@ return(0); } @@ -287,8 +287,8 @@ thd_get_xid(thd, (MYSQL_XID*) &trx->xid); /* Release a possible FIFO ticket and search latch. Since we will -@@ -12438,6 +12482,7 @@ - MYSQL_SYSVAR(rollback_segments), +@@ -12480,6 +12524,7 @@ + #endif MYSQL_SYSVAR(corrupt_table_action), MYSQL_SYSVAR(lazy_drop_table), + MYSQL_SYSVAR(fake_changes), diff --git a/innodb_fast_checksum.patch b/innodb_fast_checksum.patch index 92e7943..0a733db 100644 --- a/innodb_fast_checksum.patch +++ b/innodb_fast_checksum.patch @@ -106,7 +106,7 @@ /* We overwrite the first 4 bytes of the end lsn field to store --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c -@@ -3095,13 +3095,24 @@ +@@ -3103,13 +3103,24 @@ return(TRUE); } @@ -132,7 +132,7 @@ return(FALSE); } -@@ -3117,7 +3128,9 @@ +@@ -3125,7 +3136,9 @@ if (!zip_size) { mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, srv_use_checksums @@ -161,7 +161,7 @@ srv_blocking_lru_restore = (ibool) innobase_blocking_lru_restore; -@@ -11542,6 +11544,15 @@ +@@ -11541,6 +11543,15 @@ "Disable with --skip-innodb-checksums.", NULL, NULL, TRUE); @@ -177,7 +177,7 @@ static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, PLUGIN_VAR_READONLY, "The common part for InnoDB table spaces.", -@@ -12073,6 +12084,7 @@ +@@ -12112,6 +12123,7 @@ MYSQL_SYSVAR(buffer_pool_size), MYSQL_SYSVAR(buffer_pool_instances), MYSQL_SYSVAR(checksums), diff --git a/innodb_files_extend.patch b/innodb_files_extend.patch index 65592ac..dd08f6e 100644 --- a/innodb_files_extend.patch +++ b/innodb_files_extend.patch @@ -16,7 +16,7 @@ fprintf(stderr, "InnoDB: Error: the size of single-table" " tablespace file %s\n" -@@ -4161,7 +4161,7 @@ +@@ -4169,7 +4169,7 @@ size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; #ifndef UNIV_HOTBACKUP @@ -25,7 +25,7 @@ fprintf(stderr, "InnoDB: Error: the size of single-table tablespace" " file %s\n" -@@ -4181,7 +4181,7 @@ +@@ -4189,7 +4189,7 @@ /* Align the memory for file i/o if we might have O_DIRECT set */ page = ut_align(buf2, UNIV_PAGE_SIZE); @@ -34,7 +34,7 @@ success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE); /* We have to read the tablespace id from the file */ -@@ -5159,9 +5159,9 @@ +@@ -5167,9 +5167,9 @@ ut_ad(ut_is_2pow(zip_size)); ut_ad(buf); ut_ad(len > 0); @@ -49,7 +49,7 @@ # ifndef UNIV_LOG_DEBUG --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c -@@ -656,16 +656,18 @@ +@@ -595,16 +595,18 @@ 0 for uncompressed pages */ ulint offset) /*!< in: page offset */ { @@ -78,7 +78,7 @@ ut_ad(ut_is_2pow(zip_size)); if (!zip_size) { -@@ -1464,12 +1466,12 @@ +@@ -1403,12 +1405,12 @@ mtr); xdes_init(descr, mtr); @@ -175,7 +175,7 @@ #ifndef MYSQL_SERVER innodb_overwrite_relay_log_info = FALSE; #endif -@@ -7290,9 +7352,9 @@ +@@ -7289,9 +7351,9 @@ | DICT_TF_COMPACT | DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT; @@ -188,7 +188,7 @@ } } -@@ -11553,6 +11615,16 @@ +@@ -11552,6 +11614,16 @@ "#### Attention: The checksum is not compatible for normal or disabled version! ####", NULL, NULL, FALSE); @@ -205,7 +205,7 @@ static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir, PLUGIN_VAR_READONLY, "The common part for InnoDB table spaces.", -@@ -12079,6 +12151,8 @@ +@@ -12118,6 +12190,8 @@ NULL, NULL, 0, &corrupt_table_action_typelib); static struct st_mysql_sys_var* innobase_system_variables[]= { @@ -216,7 +216,7 @@ MYSQL_SYSVAR(buffer_pool_size), --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1705,7 +1705,7 @@ +@@ -1725,7 +1725,7 @@ time_t last_printout_time; /*!< when buf_print_io was last time called */ @@ -225,7 +225,7 @@ /*!< Statistics of buddy system, indexed by block size */ buf_pool_stat_t stat; /*!< current statistics */ -@@ -1803,7 +1803,7 @@ +@@ -1823,7 +1823,7 @@ UT_LIST_BASE_NODE_T(buf_page_t) zip_clean; /*!< unmodified compressed pages */ #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ @@ -234,7 +234,7 @@ /*!< buddy free lists */ buf_page_t watch[BUF_POOL_WATCH_SIZE]; -@@ -1811,9 +1811,9 @@ +@@ -1831,9 +1831,9 @@ pool watches. Protected by buf_pool->mutex. */ @@ -249,7 +249,7 @@ #endif --- a/storage/innobase/include/buf0types.h +++ b/storage/innobase/include/buf0types.h -@@ -67,12 +67,13 @@ +@@ -70,12 +70,13 @@ #define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT) #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT) @@ -412,7 +412,7 @@ dest_offset = nth_file * group->file_size; #ifdef UNIV_DEBUG -@@ -1794,9 +1799,7 @@ +@@ -1797,9 +1802,7 @@ ulint i; ut_ad(mutex_own(&(log_sys->mutex))); @@ -423,7 +423,7 @@ buf = group->checkpoint_buf; -@@ -1810,6 +1813,7 @@ +@@ -1813,6 +1816,7 @@ mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size); #ifdef UNIV_LOG_ARCHIVE @@ -431,7 +431,7 @@ if (log_sys->archiving_state == LOG_ARCH_OFF) { archived_lsn = IB_ULONGLONG_MAX; } else { -@@ -1823,7 +1827,9 @@ +@@ -1826,7 +1830,9 @@ mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn); #else /* UNIV_LOG_ARCHIVE */ @@ -538,7 +538,7 @@ readahead request. */ --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c -@@ -1562,11 +1562,13 @@ +@@ -1582,11 +1582,13 @@ } #endif /* UNIV_LOG_ARCHIVE */ @@ -554,7 +554,7 @@ return(DB_ERROR); } -@@ -1575,7 +1577,7 @@ +@@ -1595,7 +1597,7 @@ for (i = 0; i < srv_n_data_files; i++) { #ifndef __WIN__ diff --git a/innodb_fix_misc.patch b/innodb_fix_misc.patch index 19ca31e..e58c5e5 100644 --- a/innodb_fix_misc.patch +++ b/innodb_fix_misc.patch @@ -12,7 +12,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c -@@ -1979,6 +1979,27 @@ +@@ -1981,6 +1981,27 @@ #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ } @@ -40,7 +40,7 @@ if (UNIV_UNLIKELY(!bpage->zip.data)) { /* There is no compressed page. */ err_exit: -@@ -2487,6 +2508,27 @@ +@@ -2489,6 +2510,27 @@ block = (buf_block_t*) buf_page_hash_get_low( buf_pool, space, offset, fold); if (block) { @@ -68,7 +68,7 @@ block_mutex = buf_page_get_mutex_enter((buf_page_t*)block); ut_a(block_mutex); } -@@ -3409,11 +3451,28 @@ +@@ -3411,11 +3453,28 @@ fold = buf_page_address_fold(space, offset); @@ -97,7 +97,7 @@ if (watch_page && !buf_pool_watch_is_sentinel(buf_pool, watch_page)) { /* The page is already in the buffer pool. */ watch_page = NULL; -@@ -3544,6 +3603,7 @@ +@@ -3546,6 +3605,7 @@ bpage->state = BUF_BLOCK_ZIP_PAGE; bpage->space = space; bpage->offset = offset; @@ -105,7 +105,7 @@ #ifdef UNIV_DEBUG bpage->in_page_hash = FALSE; -@@ -3628,6 +3688,7 @@ +@@ -3630,6 +3690,7 @@ fold = buf_page_address_fold(space, offset); @@ -113,7 +113,7 @@ //buf_pool_mutex_enter(buf_pool); mutex_enter(&buf_pool->LRU_list_mutex); rw_lock_x_lock(&buf_pool->page_hash_latch); -@@ -3635,6 +3696,21 @@ +@@ -3637,6 +3698,21 @@ block = (buf_block_t*) buf_page_hash_get_low( buf_pool, space, offset, fold); @@ -135,7 +135,7 @@ if (block && buf_page_in_file(&block->page) && !buf_pool_watch_is_sentinel(buf_pool, &block->page)) { -@@ -3988,8 +4064,11 @@ +@@ -3990,8 +4066,11 @@ } if (io_type == BUF_IO_WRITE @@ -176,7 +176,7 @@ return(TRUE); --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c -@@ -529,6 +529,62 @@ +@@ -545,6 +545,62 @@ } } @@ -239,7 +239,7 @@ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG /********************************************************************//** Insert a compressed block into buf_pool->zip_clean in the LRU order. */ -@@ -1483,6 +1539,10 @@ +@@ -1499,6 +1555,10 @@ return(FALSE); } @@ -296,7 +296,7 @@ fil_system->spaces = hash_create(hash_size); fil_system->name_hash = hash_create(hash_size); -@@ -2344,7 +2347,11 @@ +@@ -2352,7 +2355,11 @@ completely and permanently. The flag is_being_deleted also prevents fil_flush() from being applied to this tablespace. */ @@ -308,7 +308,7 @@ #endif /* printf("Deleting tablespace %s id %lu\n", space->name, id); */ -@@ -4731,6 +4738,10 @@ +@@ -4739,6 +4746,10 @@ ulint page_size; ibool success = TRUE; @@ -319,7 +319,7 @@ fil_mutex_enter_and_prepare_for_io(space_id); space = fil_space_get_by_id(space_id); -@@ -4742,6 +4753,7 @@ +@@ -4750,6 +4761,7 @@ *actual_size = space->size; mutex_exit(&fil_system->mutex); @@ -327,7 +327,7 @@ return(TRUE); } -@@ -4774,6 +4786,8 @@ +@@ -4782,6 +4794,8 @@ offset_low = ((start_page_no - file_start_page_no) % (4096 * ((1024 * 1024) / page_size))) * page_size; @@ -336,7 +336,7 @@ #ifdef UNIV_HOTBACKUP success = os_file_write(node->name, node->handle, buf, offset_low, offset_high, -@@ -4783,8 +4797,10 @@ +@@ -4791,8 +4805,10 @@ node->name, node->handle, buf, offset_low, offset_high, page_size * n_pages, @@ -348,7 +348,7 @@ if (success) { node->size += n_pages; space->size += n_pages; -@@ -4830,6 +4846,7 @@ +@@ -4838,6 +4854,7 @@ printf("Extended %s to %lu, actual size %lu pages\n", space->name, size_after_extend, *actual_size); */ mutex_exit(&fil_system->mutex); @@ -356,7 +356,7 @@ fil_flush(space_id, TRUE); -@@ -5192,6 +5209,22 @@ +@@ -5200,6 +5217,22 @@ srv_data_written+= len; } @@ -379,7 +379,7 @@ /* Reserve the fil_system mutex and make sure that we can open at least one file while holding it, if the file is not already open */ -@@ -5333,10 +5366,24 @@ +@@ -5341,10 +5374,24 @@ #else /* Queue the aio request */ ret = os_aio(type, mode | wake_later, node->name, node->handle, buf, @@ -405,7 +405,7 @@ ut_a(ret); if (mode == OS_AIO_SYNC) { -@@ -5436,6 +5483,7 @@ +@@ -5444,6 +5491,7 @@ fil_node_t* fil_node; void* message; ulint type; @@ -413,7 +413,7 @@ ut_ad(fil_validate_skip()); -@@ -5443,10 +5491,10 @@ +@@ -5451,10 +5499,10 @@ srv_set_io_thread_op_info(segment, "native aio handle"); #ifdef WIN_ASYNC_IO ret = os_aio_windows_handle(segment, 0, &fil_node, @@ -426,7 +426,7 @@ #else ut_error; ret = 0; /* Eliminate compiler warning */ -@@ -5455,7 +5503,22 @@ +@@ -5463,7 +5511,22 @@ srv_set_io_thread_op_info(segment, "simulated aio handle"); ret = os_aio_simulated_handle(segment, &fil_node, @@ -452,7 +452,7 @@ ut_a(ret); --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -12150,6 +12150,12 @@ +@@ -12189,6 +12189,12 @@ "except for the deletion.", NULL, NULL, 0, &corrupt_table_action_typelib); @@ -465,15 +465,15 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(page_size), MYSQL_SYSVAR(log_block_size), -@@ -12244,6 +12250,7 @@ - MYSQL_SYSVAR(purge_batch_size), - MYSQL_SYSVAR(rollback_segments), +@@ -12286,6 +12292,7 @@ + MYSQL_SYSVAR(flush_checkpoint_debug), + #endif MYSQL_SYSVAR(corrupt_table_action), + MYSQL_SYSVAR(lazy_drop_table), NULL }; -@@ -12253,7 +12260,7 @@ +@@ -12295,7 +12302,7 @@ &innobase_storage_engine, innobase_hton_name, plugin_author, @@ -484,7 +484,7 @@ NULL, /* Plugin Deinit */ --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1455,6 +1455,7 @@ +@@ -1475,6 +1475,7 @@ 0 if the block was never accessed in the buffer pool */ /* @} */ @@ -888,7 +888,7 @@ UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500; --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c -@@ -2167,7 +2167,7 @@ +@@ -2187,7 +2187,7 @@ if (srv_print_verbose_log) { ut_print_timestamp(stderr); fprintf(stderr, diff --git a/innodb_io_patches.patch b/innodb_io_patches.patch index 7483ca4..4351131 100644 --- a/innodb_io_patches.patch +++ b/innodb_io_patches.patch @@ -155,7 +155,7 @@ return(0); --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c -@@ -2601,7 +2601,7 @@ +@@ -2609,7 +2609,7 @@ os_thread_sleep(20000); @@ -164,7 +164,7 @@ goto retry; -@@ -2815,7 +2815,7 @@ +@@ -2823,7 +2823,7 @@ goto error_exit; } @@ -173,7 +173,7 @@ if (!ret) { fputs("InnoDB: Error: file flush of tablespace ", stderr); -@@ -3001,7 +3001,7 @@ +@@ -3009,7 +3009,7 @@ } } @@ -182,7 +182,7 @@ if (!success) { goto func_exit; -@@ -3023,7 +3023,7 @@ +@@ -3031,7 +3031,7 @@ goto func_exit; } @@ -191,7 +191,7 @@ func_exit: os_file_close(file); ut_free(buf2); -@@ -4006,7 +4006,7 @@ +@@ -4014,7 +4014,7 @@ size_after_extend, *actual_size); */ mutex_exit(&fil_system->mutex); @@ -200,7 +200,7 @@ return(success); } -@@ -4577,8 +4577,9 @@ +@@ -4585,8 +4585,9 @@ void fil_flush( /*======*/ @@ -211,7 +211,7 @@ { fil_space_t* space; fil_node_t* node; -@@ -4649,7 +4650,7 @@ +@@ -4657,7 +4658,7 @@ /* fprintf(stderr, "Flushing to file %s\n", node->name); */ @@ -220,7 +220,7 @@ mutex_enter(&fil_system->mutex); -@@ -4732,7 +4733,7 @@ +@@ -4740,7 +4741,7 @@ a non-existing space id. */ for (i = 0; i < n_space_ids; i++) { @@ -272,7 +272,7 @@ srv_force_recovery = (ulint) innobase_force_recovery; srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; -@@ -11142,7 +11162,7 @@ +@@ -11141,7 +11161,7 @@ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, "Purge threads can be either 0 or 1.", NULL, NULL, @@ -281,7 +281,7 @@ 0, /* Minimum value */ 1, 0); /* Maximum value */ -@@ -11184,12 +11204,18 @@ +@@ -11183,12 +11203,18 @@ innodb_file_format_max_validate, innodb_file_format_max_update, "Antelope"); @@ -306,7 +306,7 @@ static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, -@@ -11294,7 +11320,7 @@ +@@ -11293,7 +11319,7 @@ static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", @@ -315,7 +315,7 @@ static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, -@@ -11451,6 +11477,135 @@ +@@ -11450,6 +11476,135 @@ "trigger a readahead.", NULL, NULL, 56, 0, 64, 0); @@ -451,7 +451,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), -@@ -11471,6 +11626,7 @@ +@@ -11470,6 +11625,7 @@ MYSQL_SYSVAR(file_format_check), MYSQL_SYSVAR(file_format_max), MYSQL_SYSVAR(flush_log_at_trx_commit), @@ -459,7 +459,7 @@ MYSQL_SYSVAR(flush_method), MYSQL_SYSVAR(force_recovery), MYSQL_SYSVAR(large_prefix), -@@ -11510,6 +11666,13 @@ +@@ -11509,6 +11665,13 @@ MYSQL_SYSVAR(show_verbose_locks), MYSQL_SYSVAR(show_locks_held), MYSQL_SYSVAR(version), @@ -473,7 +473,7 @@ MYSQL_SYSVAR(use_sys_malloc), MYSQL_SYSVAR(use_native_aio), MYSQL_SYSVAR(change_buffering), -@@ -11522,6 +11685,9 @@ +@@ -11521,6 +11684,9 @@ MYSQL_SYSVAR(purge_threads), MYSQL_SYSVAR(purge_batch_size), MYSQL_SYSVAR(rollback_segments), @@ -524,7 +524,7 @@ /** read only pages belonging to the insert buffer tree */ --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h -@@ -658,8 +658,9 @@ +@@ -663,8 +663,9 @@ void fil_flush( /*======*/ @@ -1600,7 +1600,7 @@ mutex_enter(&kernel_mutex); --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c -@@ -1217,6 +1217,9 @@ +@@ -1237,6 +1237,9 @@ } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) { srv_unix_file_flush_method = SRV_UNIX_O_DIRECT; @@ -1926,3 +1926,27 @@ # Performance schema variables are too long for files named # 'mysql-test/suite/sys_vars/t/' ... +--- a/mysql-test/suite/innodb/t/innodb_cmp_drop_table-master.opt ++++ b/mysql-test/suite/innodb/t/innodb_cmp_drop_table-master.opt +@@ -1 +1 @@ +---innodb-buffer-pool-size=8M ++--innodb-buffer-pool-size=32M +--- a/mysql-test/suite/innodb/t/innodb_cmp_drop_table.test ++++ b/mysql-test/suite/innodb/t/innodb_cmp_drop_table.test +@@ -36,13 +36,14 @@ + + -- disable_query_log + +--- let $i = 400 ++-- let $i = 4000 ++begin; + while ($i) + { + insert into t2 values(repeat('abcdefghijklmnopqrstuvwxyz',1000)); + dec $i; + } +- ++commit; + -- enable_query_log + + # now there should be no 8K pages in the buffer pool diff --git a/innodb_kill_idle_transaction.patch b/innodb_kill_idle_transaction.patch index 30521b2..ed7bdf3 100644 --- a/innodb_kill_idle_transaction.patch +++ b/innodb_kill_idle_transaction.patch @@ -114,7 +114,7 @@ #ifdef HAVE_PSI_INTERFACE /* Register keys with MySQL performance schema */ if (PSI_server) { -@@ -11695,6 +11699,57 @@ +@@ -11694,6 +11698,57 @@ return(false); } @@ -172,7 +172,7 @@ static SHOW_VAR innodb_status_variables_export[]= { {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC}, {NullS, NullS, SHOW_LONG} -@@ -11986,6 +12041,15 @@ +@@ -11985,6 +12040,15 @@ "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket", NULL, NULL, 500L, 1L, ~0L, 0); @@ -188,7 +188,7 @@ static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, "Number of file I/O threads in InnoDB.", -@@ -12288,6 +12352,7 @@ +@@ -12327,6 +12391,7 @@ MYSQL_SYSVAR(fast_checksum), MYSQL_SYSVAR(commit_concurrency), MYSQL_SYSVAR(concurrency_tickets), @@ -198,7 +198,7 @@ MYSQL_SYSVAR(data_home_dir), --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h -@@ -296,6 +296,7 @@ +@@ -299,6 +299,7 @@ extern ulint srv_activity_count; extern ulint srv_fatal_semaphore_wait_threshold; extern ulint srv_dml_needed_delay; @@ -242,7 +242,7 @@ /* How much data manipulation language (DML) statements need to be delayed, in microseconds, in order to reduce the lagging of the purge thread. */ UNIV_INTERN ulint srv_dml_needed_delay = 0; -@@ -2834,6 +2843,36 @@ +@@ -2837,6 +2846,36 @@ old_sema = sema; } diff --git a/innodb_lru_dump_restore.patch b/innodb_lru_dump_restore.patch index 4d94440..957cf02 100644 --- a/innodb_lru_dump_restore.patch +++ b/innodb_lru_dump_restore.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c -@@ -2183,6 +2183,289 @@ +@@ -2197,6 +2197,289 @@ memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur); } @@ -310,7 +310,7 @@ /*==============*/ --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c -@@ -5299,6 +5299,70 @@ +@@ -5307,6 +5307,70 @@ return(DB_SUCCESS); } @@ -401,7 +401,7 @@ #ifdef HAVE_LARGE_PAGES if ((os_use_large_pages = (ibool) my_use_large_pages)) os_large_page_size = (ulint) opt_large_page_size; -@@ -11925,6 +11929,19 @@ +@@ -11964,6 +11968,19 @@ "Limit the allocated memory for dictionary cache. (0: unlimited)", NULL, NULL, 0, 0, LONG_MAX, 0); @@ -421,7 +421,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), -@@ -12009,6 +12026,8 @@ +@@ -12048,6 +12065,8 @@ MYSQL_SYSVAR(random_read_ahead), MYSQL_SYSVAR(read_ahead_threshold), MYSQL_SYSVAR(io_capacity), @@ -540,7 +540,7 @@ an exclusive lock on the buffer frame. The flag is cleared and the x-lock --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h -@@ -648,6 +648,14 @@ +@@ -653,6 +653,14 @@ void* message, /*!< in: message for aio handler if non-sync aio used, else ignored */ trx_t* trx); @@ -557,7 +557,7 @@ handler for completed requests. The aio array of pending requests is divided --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h -@@ -361,6 +361,12 @@ +@@ -364,6 +364,12 @@ reading of a disk page */ extern ulint srv_buf_pool_reads; @@ -570,7 +570,7 @@ /** Status variables to be passed to MySQL */ typedef struct export_var_struct export_struc; -@@ -666,6 +672,16 @@ +@@ -669,6 +675,16 @@ /*=====================*/ void* arg); /*!< in: a dummy parameter required by os_thread_create */ @@ -602,10 +602,15 @@ /* structure to pass status variables to MySQL */ UNIV_INTERN export_struc export_vars; -@@ -2710,6 +2716,58 @@ - OS_THREAD_DUMMY_RETURN; - } +@@ -2708,6 +2714,58 @@ + /* We count the number of threads in os_thread_exit(). A created + thread should always use that to exit and not use return() to exit. */ ++ os_thread_exit(NULL); ++ ++ OS_THREAD_DUMMY_RETURN; ++} ++ +/*********************************************************************//** +A thread which restores the buffer pool from a dump file on startup and does +periodic buffer pool dumps. @@ -653,14 +658,9 @@ + /* We count the number of threads in os_thread_exit(). A created + thread should always use that to exit and not use return() to exit. */ + -+ os_thread_exit(NULL); -+ -+ OS_THREAD_DUMMY_RETURN; -+} -+ - /**********************************************************************//** - Check whether any background thread is active. - @return FALSE if all are are suspended or have exited. */ + os_thread_exit(NULL); + + OS_THREAD_DUMMY_RETURN; --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -87,6 +87,7 @@ @@ -683,7 +683,7 @@ /** We use this mutex to test the return value of pthread_mutex_trylock on successful locking. HP-UX does NOT return 0, though Linux et al do. */ -@@ -1821,6 +1822,15 @@ +@@ -1841,6 +1842,15 @@ os_thread_create(&srv_monitor_thread, NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); diff --git a/innodb_opt_lru_count.patch b/innodb_opt_lru_count.patch index 0c39e9e..d2f80fd 100644 --- a/innodb_opt_lru_count.patch +++ b/innodb_opt_lru_count.patch @@ -29,7 +29,7 @@ #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG block->n_pointers = 0; #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ -@@ -1401,7 +1401,7 @@ +@@ -1403,7 +1403,7 @@ memcpy(dpage, bpage, sizeof *dpage); @@ -38,7 +38,7 @@ ut_d(bpage->in_page_hash = FALSE); /* relocate buf_pool->LRU */ -@@ -3223,8 +3223,8 @@ +@@ -3225,8 +3225,8 @@ bpage->in_zip_hash = FALSE; bpage->in_flush_list = FALSE; bpage->in_free_list = FALSE; @@ -48,7 +48,7 @@ ut_d(bpage->in_page_hash = TRUE); -@@ -3389,7 +3389,7 @@ +@@ -3391,7 +3391,7 @@ ibuf_merge_or_delete_for_page(NULL, space, offset, zip_size, TRUE); /* Flush pages from the end of the LRU list if necessary */ @@ -94,7 +94,7 @@ return(FALSE); } -@@ -1985,8 +1988,14 @@ +@@ -2049,8 +2052,14 @@ buf_page_t* bpage; ulint n_replaceable; ulint distance = 0; @@ -110,7 +110,7 @@ n_replaceable = UT_LIST_GET_LEN(buf_pool->free); -@@ -1997,7 +2006,13 @@ +@@ -2061,7 +2070,13 @@ + BUF_FLUSH_EXTRA_MARGIN(buf_pool)) && (distance < BUF_LRU_FREE_SEARCH_LEN(buf_pool))) { @@ -125,7 +125,7 @@ mutex_enter(block_mutex); -@@ -2012,11 +2027,18 @@ +@@ -2076,11 +2091,18 @@ bpage = UT_LIST_GET_PREV(LRU, bpage); } @@ -145,7 +145,7 @@ } return(BUF_FLUSH_FREE_BLOCK_MARGIN(buf_pool) -@@ -2034,7 +2056,8 @@ +@@ -2098,7 +2120,8 @@ void buf_flush_free_margin( /*==================*/ @@ -155,7 +155,7 @@ { ulint n_to_flush; -@@ -2045,7 +2068,7 @@ +@@ -2109,7 +2132,7 @@ n_flushed = buf_flush_LRU(buf_pool, n_to_flush); @@ -164,7 +164,7 @@ /* There was an LRU type flush batch already running; let us wait for it to end */ -@@ -2058,8 +2081,9 @@ +@@ -2122,8 +2145,9 @@ Flushes pages from the end of all the LRU lists. */ UNIV_INTERN void @@ -175,7 +175,7 @@ { ulint i; -@@ -2068,7 +2092,7 @@ +@@ -2132,7 +2156,7 @@ buf_pool = buf_pool_from_array(i); @@ -186,7 +186,7 @@ --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c -@@ -923,7 +923,7 @@ +@@ -934,7 +934,7 @@ /* No free block was found: try to flush the LRU list */ @@ -195,7 +195,7 @@ ++srv_buf_pool_wait_free; os_aio_simulated_wake_handler_threads(); -@@ -1120,7 +1120,7 @@ +@@ -1131,7 +1131,7 @@ /* Remove the block from the LRU list */ UT_LIST_REMOVE(LRU, buf_pool->LRU, bpage); @@ -204,7 +204,7 @@ buf_unzip_LRU_remove_block_if_needed(bpage); -@@ -1199,7 +1199,7 @@ +@@ -1210,7 +1210,7 @@ ut_ad(!bpage->in_LRU_list); UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage); @@ -213,7 +213,7 @@ if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { -@@ -1269,7 +1269,7 @@ +@@ -1280,7 +1280,7 @@ buf_pool->LRU_old_len++; } @@ -222,7 +222,7 @@ if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { -@@ -1513,7 +1513,7 @@ +@@ -1524,7 +1524,7 @@ buf_page_set_old(b, buf_page_is_old(b)); #endif /* UNIV_LRU_DEBUG */ } else { @@ -271,7 +271,7 @@ if (buf_debug_prints) { --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1404,11 +1404,11 @@ +@@ -1424,11 +1424,11 @@ UT_LIST_NODE_T(buf_page_t) LRU; /*!< node of the LRU list */ diff --git a/innodb_overwrite_relay_log_info.patch b/innodb_overwrite_relay_log_info.patch index cf8e7d4..ee69f58 100644 --- a/innodb_overwrite_relay_log_info.patch +++ b/innodb_overwrite_relay_log_info.patch @@ -248,7 +248,7 @@ trx_commit_for_mysql(trx); } -@@ -11131,6 +11323,12 @@ +@@ -11130,6 +11322,12 @@ "The common part for InnoDB table spaces.", NULL, NULL, NULL); @@ -261,7 +261,7 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, "Enable InnoDB doublewrite buffer (enabled by default). " -@@ -11608,6 +11806,7 @@ +@@ -11647,6 +11845,7 @@ MYSQL_SYSVAR(old_blocks_pct), MYSQL_SYSVAR(old_blocks_time), MYSQL_SYSVAR(open_files), diff --git a/innodb_pass_corrupt_table.patch b/innodb_pass_corrupt_table.patch index a4dd11c..fcd4909 100644 --- a/innodb_pass_corrupt_table.patch +++ b/innodb_pass_corrupt_table.patch @@ -338,7 +338,7 @@ if (!ready) { return(block); -@@ -1945,6 +1951,13 @@ +@@ -1947,6 +1953,13 @@ return(NULL); } @@ -352,7 +352,7 @@ block_mutex = buf_page_get_mutex_enter(bpage); rw_lock_s_unlock(&buf_pool->page_hash_latch); -@@ -2524,6 +2537,13 @@ +@@ -2526,6 +2539,13 @@ return(NULL); } @@ -366,7 +366,7 @@ switch (buf_block_get_state(block)) { buf_page_t* bpage; ibool success; -@@ -3198,6 +3218,7 @@ +@@ -3200,6 +3220,7 @@ bpage->newest_modification = 0; bpage->oldest_modification = 0; HASH_INVALIDATE(bpage, hash); @@ -374,7 +374,7 @@ #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG bpage->file_page_was_freed = FALSE; #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ -@@ -3836,6 +3857,7 @@ +@@ -3838,6 +3859,7 @@ (ulong) bpage->offset); } @@ -382,7 +382,7 @@ /* From version 3.23.38 up we store the page checksum to the 4 first bytes of the page end lsn field */ -@@ -3877,6 +3899,23 @@ +@@ -3879,6 +3901,23 @@ REFMAN "forcing-innodb-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); @@ -406,7 +406,7 @@ if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) { /* If page space id is larger than TRX_SYS_SPACE (0), we will attempt to mark the corresponding -@@ -3893,6 +3932,7 @@ +@@ -3895,6 +3934,7 @@ } } } @@ -414,7 +414,7 @@ if (recv_recovery_is_on()) { /* Pages must be uncompressed for crash recovery. */ -@@ -3902,8 +3942,11 @@ +@@ -3904,8 +3944,11 @@ if (uncompressed && !recv_no_ibuf_operations) { ibuf_merge_or_delete_for_page( @@ -462,7 +462,7 @@ /* If table->ibd_file_missing == TRUE, this will print an error message and return without doing anything. */ -@@ -1293,7 +1294,7 @@ +@@ -1298,7 +1299,7 @@ + dict_sys->size) > srv_dict_size_limit ) { prev_table = UT_LIST_GET_PREV(table_LRU, table); @@ -471,7 +471,7 @@ goto next_loop; cached_foreign_tables = 0; -@@ -4367,6 +4368,12 @@ +@@ -4377,6 +4378,12 @@ heap = mem_heap_create(1000); while (index) { @@ -484,7 +484,7 @@ size = btr_get_size(index, BTR_TOTAL_SIZE); index->stat_index_size = size; -@@ -4514,6 +4521,12 @@ +@@ -4524,6 +4531,12 @@ heap = mem_heap_create(1000); while (index) { @@ -497,7 +497,7 @@ /*===========================================*/ { dict_table_t* sys_stats; -@@ -4706,6 +4719,13 @@ +@@ -4716,6 +4729,13 @@ || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO && dict_index_is_clust(index)))) { ulint size; @@ -511,7 +511,7 @@ size = btr_get_size(index, BTR_TOTAL_SIZE); index->stat_index_size = size; -@@ -5685,4 +5705,42 @@ +@@ -5695,4 +5715,42 @@ index->type |= DICT_CORRUPT; } @@ -584,7 +584,7 @@ UT_LIST_ADD_LAST(space_list, fil_system->space_list, space); mutex_exit(&fil_system->mutex); -@@ -5277,6 +5280,34 @@ +@@ -5285,6 +5288,34 @@ ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0); ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0); @@ -619,7 +619,7 @@ #ifdef UNIV_HOTBACKUP /* In ibbackup do normal i/o, not aio */ if (type == OS_FILE_READ) { -@@ -5291,6 +5322,8 @@ +@@ -5299,6 +5330,8 @@ ret = os_aio(type, mode | wake_later, node->name, node->handle, buf, offset_low, offset_high, len, node, message, trx); #endif @@ -628,7 +628,7 @@ ut_a(ret); if (mode == OS_AIO_SYNC) { -@@ -5791,3 +5824,46 @@ +@@ -5799,3 +5832,46 @@ return 0; } } @@ -677,7 +677,7 @@ + --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c -@@ -369,6 +369,12 @@ +@@ -308,6 +308,12 @@ ut_ad(id || !zip_size); block = buf_page_get(id, zip_size, 0, RW_X_LATCH, mtr); @@ -690,7 +690,7 @@ header = FSP_HEADER_OFFSET + buf_block_get_frame(block); buf_block_dbg_add_level(block, SYNC_FSP_PAGE); -@@ -787,6 +793,12 @@ +@@ -726,6 +732,12 @@ fsp_header_t* sp_header; block = buf_page_get(space, zip_size, 0, RW_X_LATCH, mtr); @@ -703,7 +703,7 @@ buf_block_dbg_add_level(block, SYNC_FSP_PAGE); sp_header = FSP_HEADER_OFFSET + buf_block_get_frame(block); -@@ -1866,6 +1878,11 @@ +@@ -1805,6 +1817,11 @@ { fseg_inode_t* inode; @@ -715,7 +715,7 @@ for (; i < FSP_SEG_INODES_PER_PAGE(zip_size); i++) { inode = fsp_seg_inode_page_get_nth_inode( -@@ -1979,6 +1996,11 @@ +@@ -1918,6 +1935,11 @@ page = buf_block_get_frame(block); @@ -727,7 +727,7 @@ n = fsp_seg_inode_page_find_free(page, 0, zip_size, mtr); ut_a(n != ULINT_UNDEFINED); -@@ -2072,6 +2094,11 @@ +@@ -2011,6 +2033,11 @@ inode = fut_get_ptr(space, zip_size, inode_addr, RW_X_LATCH, mtr); @@ -739,7 +739,7 @@ if (UNIV_UNLIKELY(!mach_read_from_8(inode + FSEG_ID))) { inode = NULL; -@@ -2098,7 +2125,7 @@ +@@ -2037,7 +2064,7 @@ { fseg_inode_t* inode = fseg_inode_try_get(header, space, zip_size, mtr); @@ -748,7 +748,7 @@ return(inode); } -@@ -3304,6 +3331,11 @@ +@@ -3243,6 +3270,11 @@ descr = xdes_get_descriptor(space, zip_size, page, mtr); @@ -760,7 +760,7 @@ ut_a(descr); if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)) { fputs("InnoDB: Dump of the tablespace extent descriptor: ", -@@ -3551,6 +3583,11 @@ +@@ -3490,6 +3522,11 @@ descr = xdes_get_descriptor(space, zip_size, header_page, mtr); @@ -772,7 +772,7 @@ /* Check that the header resides on a page which has not been freed yet */ -@@ -3635,6 +3672,12 @@ +@@ -3574,6 +3611,12 @@ inode = fseg_inode_get(header, space, zip_size, mtr); @@ -908,7 +908,7 @@ switch (ret) { case DB_SUCCESS: error = 0; -@@ -6137,6 +6188,10 @@ +@@ -6136,6 +6187,10 @@ { DBUG_ENTER("change_active_index"); @@ -919,7 +919,7 @@ ut_ad(user_thd == ha_thd()); ut_a(prebuilt->trx == thd_to_trx(user_thd)); -@@ -6250,6 +6305,10 @@ +@@ -6249,6 +6304,10 @@ DBUG_ENTER("general_fetch"); @@ -930,7 +930,7 @@ ut_a(prebuilt->trx == thd_to_trx(user_thd)); innodb_srv_conc_enter_innodb(prebuilt->trx); -@@ -6259,6 +6318,10 @@ +@@ -6258,6 +6317,10 @@ innodb_srv_conc_exit_innodb(prebuilt->trx); @@ -941,7 +941,7 @@ switch (ret) { case DB_SUCCESS: error = 0; -@@ -7525,10 +7588,18 @@ +@@ -7524,10 +7587,18 @@ update_thd(ha_thd()); @@ -960,7 +960,7 @@ error = convert_error_code_to_mysql(error, prebuilt->table->flags, NULL); -@@ -8040,6 +8111,16 @@ +@@ -8039,6 +8110,16 @@ return(ranges + (double) rows / (double) total_rows * time_for_scan); } @@ -977,7 +977,7 @@ /*********************************************************************//** Calculates the key number used inside MySQL for an Innobase index. We will first check the "index translation table" for a match of the index to get -@@ -8217,7 +8298,7 @@ +@@ -8216,7 +8297,7 @@ ib_table = prebuilt->table; if (flag & HA_STATUS_TIME) { @@ -986,7 +986,7 @@ /* In sql_show we call with this flag: update then statistics so that they are up-to-date */ -@@ -8517,10 +8598,18 @@ +@@ -8516,10 +8597,18 @@ THD* thd, /*!< in: connection thread handle */ HA_CHECK_OPT* check_opt) /*!< in: currently ignored */ { @@ -1005,7 +1005,7 @@ return(0); } -@@ -8756,6 +8845,10 @@ +@@ -8755,6 +8844,10 @@ my_error(ER_QUERY_INTERRUPTED, MYF(0)); } @@ -1016,7 +1016,7 @@ DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT); } -@@ -9526,6 +9619,10 @@ +@@ -9525,6 +9618,10 @@ update_thd(thd); @@ -1027,7 +1027,7 @@ if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) { ut_print_timestamp(stderr); fprintf(stderr, -@@ -11990,6 +12087,26 @@ +@@ -11989,6 +12086,26 @@ "dump file (if present). Disabled by default.", NULL, NULL, FALSE); @@ -1054,7 +1054,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), -@@ -12083,6 +12200,7 @@ +@@ -12082,6 +12199,7 @@ #ifdef UNIV_DEBUG MYSQL_SYSVAR(flush_checkpoint_debug), #endif @@ -1104,7 +1104,7 @@ block, index != NULL && dict_index_is_ibuf(index) --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h -@@ -1003,7 +1003,7 @@ +@@ -1023,7 +1023,7 @@ const buf_block_t* block) /*!< in: pointer to the control block */ __attribute__((pure)); #else /* UNIV_DEBUG */ @@ -1113,7 +1113,7 @@ #endif /* UNIV_DEBUG */ /*********************************************************************//** Gets the space id of a block. -@@ -1450,6 +1450,7 @@ +@@ -1470,6 +1470,7 @@ 0 if the block was never accessed in the buffer pool */ /* @} */ @@ -1132,7 +1132,7 @@ /*********************************************************************//** Gets the current size of buffer buf_pool in bytes. @return size in bytes */ -@@ -637,6 +637,12 @@ +@@ -681,6 +681,12 @@ /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ { @@ -1175,7 +1175,7 @@ #ifdef UNIV_DEBUG --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h -@@ -754,6 +754,19 @@ +@@ -759,6 +759,19 @@ fil_system_hash_nodes(void); /*========================*/ @@ -1359,7 +1359,7 @@ /*-------------------------------------------*/ --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c -@@ -2155,6 +2155,13 @@ +@@ -2175,6 +2175,13 @@ os_fast_mutex_free(&srv_os_test_mutex); diff --git a/innodb_recovery_patches.patch b/innodb_recovery_patches.patch index a5c40c8..0972c42 100644 --- a/innodb_recovery_patches.patch +++ b/innodb_recovery_patches.patch @@ -124,7 +124,7 @@ srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; srv_use_checksums = (ibool) innobase_use_checksums; -@@ -11391,6 +11394,11 @@ +@@ -11390,6 +11393,11 @@ "The common part for InnoDB table spaces.", NULL, NULL, NULL); @@ -136,7 +136,7 @@ static MYSQL_SYSVAR_BOOL(recovery_update_relay_log, innobase_overwrite_relay_log_info, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, "During InnoDB crash recovery on slave overwrite relay-log.info " -@@ -11879,6 +11887,7 @@ +@@ -11918,6 +11926,7 @@ MYSQL_SYSVAR(data_file_path), MYSQL_SYSVAR(data_home_dir), MYSQL_SYSVAR(doublewrite), diff --git a/innodb_separate_doublewrite.patch b/innodb_separate_doublewrite.patch index f299d28..c7d098f 100644 --- a/innodb_separate_doublewrite.patch +++ b/innodb_separate_doublewrite.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c -@@ -3805,7 +3805,8 @@ +@@ -3807,7 +3807,8 @@ read_space_id = mach_read_from_4( frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); @@ -262,7 +262,7 @@ if (err != DB_SUCCESS) { return(err); -@@ -4168,7 +4178,7 @@ +@@ -4176,7 +4186,7 @@ } #ifndef UNIV_HOTBACKUP @@ -271,7 +271,7 @@ fprintf(stderr, "InnoDB: Error: tablespace id %lu in file %s" " is not sensible\n", -@@ -4177,7 +4187,7 @@ +@@ -4185,7 +4195,7 @@ goto func_exit; } #else @@ -280,7 +280,7 @@ char* new_path; fprintf(stderr, -@@ -4998,7 +5008,7 @@ +@@ -5006,7 +5016,7 @@ } if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE @@ -289,7 +289,7 @@ /* The node is in the LRU list, remove it */ ut_a(UT_LIST_GET_LEN(system->LRU) > 0); -@@ -5044,7 +5054,7 @@ +@@ -5052,7 +5062,7 @@ } if (node->n_pending == 0 && node->space->purpose == FIL_TABLESPACE @@ -298,7 +298,7 @@ /* The node must be put back to the LRU list */ UT_LIST_ADD_FIRST(LRU, system->LRU, node); } -@@ -5655,7 +5665,7 @@ +@@ -5663,7 +5673,7 @@ ut_a(fil_node->n_pending == 0); ut_a(fil_node->open); ut_a(fil_node->space->purpose == FIL_TABLESPACE); @@ -316,9 +316,9 @@ - +#include "trx0sys.h" - #define FSP_HEADER_OFFSET FIL_PAGE_DATA /* Offset of the space header - within a file page */ -@@ -999,10 +999,10 @@ + /* FILE SEGMENT INODE + ================== +@@ -938,10 +938,10 @@ flst_init(header + FSP_SEG_INODES_FREE, mtr); mlog_write_ull(header + FSP_SEG_ID, 1, mtr); @@ -350,7 +350,7 @@ srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table; /* -------------- Log files ---------------------------*/ -@@ -11772,6 +11775,11 @@ +@@ -11771,6 +11774,11 @@ "Path to individual files and their sizes.", NULL, NULL, NULL); @@ -362,7 +362,7 @@ static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "The AUTOINC lock modes supported by InnoDB: " -@@ -11951,6 +11959,7 @@ +@@ -11990,6 +11998,7 @@ MYSQL_SYSVAR(commit_concurrency), MYSQL_SYSVAR(concurrency_tickets), MYSQL_SYSVAR(data_file_path), @@ -536,7 +536,7 @@ #ifdef UNIV_LOG_ARCHIVE ulint* min_arch_log_no,/*!< out: min of archived log numbers in data files */ -@@ -747,6 +748,7 @@ +@@ -748,6 +749,7 @@ *sum_of_new_sizes = 0; *create_new_db = FALSE; @@ -544,7 +544,7 @@ srv_normalize_path_for_win(srv_data_home); -@@ -984,6 +986,142 @@ +@@ -1004,6 +1006,142 @@ srv_data_file_is_raw_partition[i] != 0); } @@ -622,8 +622,8 @@ + (ulong) TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * 9); + } + -+ fil_read_flushed_lsn_and_arch_log_no( -+ files[i], one_opened, ++ fil_read_first_page( ++ files[i], one_opened, &flags, +#ifdef UNIV_LOG_ARCHIVE + min_arch_log_no, max_arch_log_no, +#endif /* UNIV_LOG_ARCHIVE */ @@ -687,7 +687,7 @@ return(DB_SUCCESS); } -@@ -997,6 +1135,7 @@ +@@ -1017,6 +1155,7 @@ /*====================================*/ { ibool create_new_db; @@ -695,7 +695,7 @@ ibool log_file_created; ibool log_created = FALSE; ibool log_opened = FALSE; -@@ -1462,6 +1601,7 @@ +@@ -1482,6 +1621,7 @@ } err = open_or_create_data_files(&create_new_db, @@ -703,7 +703,7 @@ #ifdef UNIV_LOG_ARCHIVE &min_arch_log_no, &max_arch_log_no, #endif /* UNIV_LOG_ARCHIVE */ -@@ -1629,6 +1769,14 @@ +@@ -1649,6 +1789,14 @@ after the double write buffer has been created. */ trx_sys_create(); @@ -718,7 +718,7 @@ dict_create(); srv_startup_is_before_trx_rollback_phase = FALSE; -@@ -1662,6 +1810,13 @@ +@@ -1682,6 +1830,13 @@ recv_recovery_from_archive_finish(); #endif /* UNIV_LOG_ARCHIVE */ } else { @@ -732,7 +732,7 @@ /* Check if we support the max format that is stamped on the system tablespace. -@@ -1748,6 +1903,17 @@ +@@ -1768,6 +1923,17 @@ we have finished the recovery process so that the image of TRX_SYS_PAGE_NO is not stale. */ trx_sys_file_format_tag_init(); diff --git a/innodb_show_lock_name.patch b/innodb_show_lock_name.patch index 3ef91cb..2fd62c1 100644 --- a/innodb_show_lock_name.patch +++ b/innodb_show_lock_name.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -9710,9 +9710,8 @@ +@@ -9709,9 +9709,8 @@ rw_lock_wait_time += mutex->lspent_time; } #else /* UNIV_DEBUG */ @@ -19,7 +19,7 @@ buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", (ulong) mutex->count_os_wait); -@@ -9727,10 +9726,8 @@ +@@ -9726,10 +9725,8 @@ if (block_mutex) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, @@ -32,7 +32,7 @@ buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", (ulong) block_mutex_oswait_count); -@@ -9759,9 +9756,8 @@ +@@ -9758,9 +9755,8 @@ continue; } @@ -44,7 +44,7 @@ buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu", (ulong) lock->count_os_wait); -@@ -9775,10 +9771,8 @@ +@@ -9774,10 +9770,8 @@ if (block_lock) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, diff --git a/innodb_show_status.patch b/innodb_show_status.patch index cad3b5a..de505e4 100644 --- a/innodb_show_status.patch +++ b/innodb_show_status.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c -@@ -4365,6 +4365,7 @@ +@@ -4372,6 +4372,7 @@ } total_info->pool_size += pool_info->pool_size; @@ -15,7 +15,7 @@ total_info->lru_len += pool_info->lru_len; total_info->old_lru_len += pool_info->old_lru_len; total_info->free_list_len += pool_info->free_list_len; -@@ -4430,6 +4431,8 @@ +@@ -4437,6 +4438,8 @@ pool_info->pool_size = buf_pool->curr_size; @@ -24,7 +24,7 @@ pool_info->lru_len = UT_LIST_GET_LEN(buf_pool->LRU); pool_info->old_lru_len = buf_pool->LRU_old_len; -@@ -4551,14 +4554,16 @@ +@@ -4558,14 +4561,16 @@ ut_ad(pool_info); fprintf(file, @@ -59,7 +59,7 @@ --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c -@@ -4889,3 +4889,30 @@ +@@ -4897,3 +4897,30 @@ fil_system = NULL; } @@ -101,7 +101,7 @@ {"buffer_pool_pages_free", (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG}, #ifdef UNIV_DEBUG -@@ -11208,6 +11210,16 @@ +@@ -11207,6 +11209,16 @@ "Force InnoDB to not use next-key locking, to use only row-level locking.", NULL, NULL, FALSE); @@ -118,7 +118,7 @@ #ifdef UNIV_LOG_ARCHIVE static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, -@@ -11395,7 +11407,7 @@ +@@ -11394,7 +11406,7 @@ static MYSQL_SYSVAR_STR(version, innodb_version_str, PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY, @@ -127,7 +127,7 @@ static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, -@@ -11495,6 +11507,8 @@ +@@ -11494,6 +11506,8 @@ MYSQL_SYSVAR(thread_concurrency), MYSQL_SYSVAR(thread_sleep_delay), MYSQL_SYSVAR(autoinc_lock_mode), @@ -148,7 +148,7 @@ ulint free_list_len; /*!< Length of buf_pool->free list */ --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h -@@ -726,6 +726,17 @@ +@@ -731,6 +731,17 @@ /*============================*/ ulint id); /*!< in: space id */ diff --git a/innodb_show_status_extend.patch b/innodb_show_status_extend.patch index 5289c89..5758429 100644 --- a/innodb_show_status_extend.patch +++ b/innodb_show_status_extend.patch @@ -240,7 +240,7 @@ /** The lock system */ --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h -@@ -739,6 +739,11 @@ +@@ -742,6 +742,11 @@ /** Status variables to be passed to MySQL */ struct export_var_struct{ @@ -252,7 +252,7 @@ ulint innodb_data_pending_reads; /*!< Pending reads */ ulint innodb_data_pending_writes; /*!< Pending writes */ ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */ -@@ -756,6 +761,9 @@ +@@ -759,6 +764,9 @@ #ifdef UNIV_DEBUG ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */ #endif /* UNIV_DEBUG */ @@ -262,7 +262,7 @@ ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */ ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */ ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */ -@@ -765,13 +773,43 @@ +@@ -768,13 +776,43 @@ ulint innodb_buffer_pool_read_ahead_rnd;/*!< srv_read_ahead_rnd */ ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */ ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/ @@ -306,7 +306,7 @@ ulint innodb_os_log_written; /*!< srv_os_log_written */ ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */ ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */ -@@ -780,6 +818,8 @@ +@@ -783,6 +821,8 @@ ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */ ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */ ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */ @@ -315,7 +315,7 @@ ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */ ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */ ib_int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time -@@ -789,11 +829,18 @@ +@@ -792,11 +832,18 @@ / srv_n_lock_wait_count */ ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time / 1000 */ @@ -383,7 +383,7 @@ } --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c -@@ -2259,12 +2259,49 @@ +@@ -2262,12 +2262,49 @@ ulint LRU_len; ulint free_len; ulint flush_list_len; @@ -433,7 +433,7 @@ export_vars.innodb_data_pending_reads = os_n_pending_reads; export_vars.innodb_data_pending_writes -@@ -2303,6 +2340,92 @@ +@@ -2306,6 +2343,92 @@ export_vars.innodb_buffer_pool_pages_misc = buf_pool_get_n_pages() - LRU_len - free_len; diff --git a/innodb_show_sys_tables.patch b/innodb_show_sys_tables.patch index b0b939c..5ad8beb 100644 --- a/innodb_show_sys_tables.patch +++ b/innodb_show_sys_tables.patch @@ -39,7 +39,7 @@ Determine the flags of a table described in SYS_TABLES. --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc -@@ -11908,7 +11908,14 @@ +@@ -11950,7 +11950,14 @@ i_s_innodb_cmp, i_s_innodb_cmp_reset, i_s_innodb_cmpmem, diff --git a/innodb_split_buf_pool_mutex.patch b/innodb_split_buf_pool_mutex.patch index 1534b07..dd69aee 100644 --- a/innodb_split_buf_pool_mutex.patch +++ b/innodb_split_buf_pool_mutex.patch @@ -527,7 +527,7 @@ buf_pool_mutex_exit(buf_pool); return(DB_SUCCESS); -@@ -1374,7 +1402,11 @@ +@@ -1376,7 +1404,11 @@ ulint fold; buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); @@ -540,7 +540,7 @@ ut_ad(mutex_own(buf_page_get_mutex(bpage))); ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE); ut_a(bpage->buf_fix_count == 0); -@@ -1485,21 +1517,32 @@ +@@ -1487,21 +1519,32 @@ buf_page_t* bpage; ulint i; buf_pool_t* buf_pool = buf_pool_get(space, offset); @@ -574,7 +574,7 @@ for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) { bpage = &buf_pool->watch[i]; -@@ -1523,10 +1566,12 @@ +@@ -1525,10 +1568,12 @@ bpage->space = space; bpage->offset = offset; bpage->buf_fix_count = 1; @@ -588,7 +588,7 @@ return(NULL); case BUF_BLOCK_ZIP_PAGE: ut_ad(bpage->in_page_hash); -@@ -1544,6 +1589,8 @@ +@@ -1546,6 +1591,8 @@ ut_error; /* Fix compiler warning */ @@ -597,7 +597,7 @@ return(NULL); } -@@ -1561,7 +1608,11 @@ +@@ -1563,7 +1610,11 @@ space, offset) */ buf_page_t* watch) /*!< in/out: sentinel for watch */ { @@ -610,7 +610,7 @@ HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, watch); ut_d(watch->in_page_hash = FALSE); -@@ -1583,28 +1634,31 @@ +@@ -1585,28 +1636,31 @@ buf_pool_t* buf_pool = buf_pool_get(space, offset); ulint fold = buf_page_address_fold(space, offset); @@ -646,7 +646,7 @@ } /****************************************************************//** -@@ -1624,14 +1678,16 @@ +@@ -1626,14 +1680,16 @@ buf_pool_t* buf_pool = buf_pool_get(space, offset); ulint fold = buf_page_address_fold(space, offset); @@ -665,7 +665,7 @@ return(ret); } -@@ -1648,13 +1704,15 @@ +@@ -1650,13 +1706,15 @@ { buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); @@ -683,7 +683,7 @@ } /********************************************************************//** -@@ -1678,14 +1736,20 @@ +@@ -1680,14 +1738,20 @@ ut_a(buf_page_in_file(bpage)); if (buf_page_peek_if_too_old(bpage)) { @@ -708,7 +708,7 @@ } } -@@ -1702,7 +1766,8 @@ +@@ -1704,7 +1768,8 @@ buf_block_t* block; buf_pool_t* buf_pool = buf_pool_get(space, offset); @@ -718,7 +718,7 @@ block = (buf_block_t*) buf_page_hash_get(buf_pool, space, offset); -@@ -1711,7 +1776,8 @@ +@@ -1713,7 +1778,8 @@ block->check_index_page_at_flush = FALSE; } @@ -728,7 +728,7 @@ } #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG -@@ -1731,7 +1797,8 @@ +@@ -1733,7 +1799,8 @@ buf_page_t* bpage; buf_pool_t* buf_pool = buf_pool_get(space, offset); @@ -738,7 +738,7 @@ bpage = buf_page_hash_get(buf_pool, space, offset); -@@ -1742,7 +1809,8 @@ +@@ -1744,7 +1811,8 @@ bpage->file_page_was_freed = TRUE; } @@ -748,7 +748,7 @@ return(bpage); } -@@ -1763,7 +1831,8 @@ +@@ -1765,7 +1833,8 @@ buf_page_t* bpage; buf_pool_t* buf_pool = buf_pool_get(space, offset); @@ -758,7 +758,7 @@ bpage = buf_page_hash_get(buf_pool, space, offset); -@@ -1772,7 +1841,8 @@ +@@ -1774,7 +1843,8 @@ bpage->file_page_was_freed = FALSE; } @@ -768,7 +768,7 @@ return(bpage); } -@@ -1804,8 +1874,9 @@ +@@ -1806,8 +1876,9 @@ buf_pool->stat.n_page_gets++; for (;;) { @@ -779,7 +779,7 @@ bpage = buf_page_hash_get(buf_pool, space, offset); if (bpage) { ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage)); -@@ -1814,7 +1885,8 @@ +@@ -1816,7 +1887,8 @@ /* Page not in buf_pool: needs to be read from file */ @@ -789,7 +789,7 @@ buf_read_page(space, zip_size, offset); -@@ -1826,10 +1898,15 @@ +@@ -1828,10 +1900,15 @@ if (UNIV_UNLIKELY(!bpage->zip.data)) { /* There is no compressed page. */ err_exit: @@ -806,7 +806,7 @@ ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage)); switch (buf_page_get_state(bpage)) { -@@ -1838,24 +1915,43 @@ +@@ -1840,24 +1917,43 @@ case BUF_BLOCK_MEMORY: case BUF_BLOCK_REMOVE_HASH: case BUF_BLOCK_ZIP_FREE: @@ -855,7 +855,7 @@ buf_block_buf_fix_inc((buf_block_t*) bpage, __FILE__, __LINE__); goto got_block; -@@ -1868,7 +1964,7 @@ +@@ -1870,7 +1966,7 @@ must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ; access_time = buf_page_is_accessed(bpage); @@ -864,7 +864,7 @@ mutex_exit(block_mutex); -@@ -2179,7 +2275,7 @@ +@@ -2181,7 +2277,7 @@ const buf_block_t* block) /*!< in: pointer to block, not dereferenced */ { @@ -873,7 +873,7 @@ if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) { /* The pointer should be aligned. */ -@@ -2215,6 +2311,7 @@ +@@ -2217,6 +2313,7 @@ ulint fix_type; ibool must_read; ulint retries = 0; @@ -881,7 +881,7 @@ buf_pool_t* buf_pool = buf_pool_get(space, offset); ut_ad(mtr); -@@ -2248,18 +2345,24 @@ +@@ -2250,18 +2347,24 @@ fold = buf_page_address_fold(space, offset); loop: block = guess; @@ -908,7 +908,7 @@ block = guess = NULL; } else { ut_ad(!block->page.in_zip_hash); -@@ -2268,12 +2371,19 @@ +@@ -2270,12 +2373,19 @@ } if (block == NULL) { @@ -928,7 +928,7 @@ block = NULL; } -@@ -2285,12 +2395,14 @@ +@@ -2287,12 +2397,14 @@ space, offset, fold); if (UNIV_LIKELY_NULL(block)) { @@ -945,7 +945,7 @@ if (mode == BUF_GET_IF_IN_POOL || mode == BUF_PEEK_IF_IN_POOL -@@ -2343,7 +2455,8 @@ +@@ -2345,7 +2457,8 @@ /* The page is being read to buffer pool, but we cannot wait around for the read to complete. */ @@ -955,7 +955,7 @@ return(NULL); } -@@ -2353,38 +2466,49 @@ +@@ -2355,38 +2468,49 @@ ibool success; case BUF_BLOCK_FILE_PAGE: @@ -1012,7 +1012,7 @@ { buf_page_t* hash_bpage; -@@ -2397,35 +2521,47 @@ +@@ -2399,35 +2523,47 @@ while buf_pool->mutex was released. Free the block that was allocated. */ @@ -1066,7 +1066,7 @@ buf_block_init_low(block); block->lock_hash_val = lock_rec_hash(space, offset); -@@ -2435,7 +2571,7 @@ +@@ -2437,7 +2573,7 @@ if (buf_page_get_state(&block->page) == BUF_BLOCK_ZIP_PAGE) { #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG @@ -1075,7 +1075,7 @@ &block->page); #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ ut_ad(!block->page.in_flush_list); -@@ -2453,18 +2589,23 @@ +@@ -2455,18 +2591,23 @@ /* Insert at the front of unzip_LRU list */ buf_unzip_LRU_add_block(block, FALSE); @@ -1101,7 +1101,7 @@ buf_page_free_descriptor(bpage); /* Decompress the page and apply buffered operations -@@ -2478,12 +2619,15 @@ +@@ -2480,12 +2621,15 @@ } /* Unfix and unlatch the block. */ @@ -1120,7 +1120,7 @@ rw_lock_x_unlock(&block->lock); break; -@@ -2499,7 +2643,7 @@ +@@ -2501,7 +2645,7 @@ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); @@ -1129,7 +1129,7 @@ #if UNIV_WORD_SIZE == 4 /* On 32-bit systems, there is no padding in buf_page_t. On other systems, Valgrind could complain about uninitialized pad -@@ -2512,8 +2656,8 @@ +@@ -2514,8 +2658,8 @@ /* Try to evict the block from the buffer pool, to use the insert buffer (change buffer) as much as possible. */ @@ -1140,7 +1140,7 @@ if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) { /* Set the watch, as it would have been set if the page were not in the -@@ -2522,6 +2666,9 @@ +@@ -2524,6 +2668,9 @@ space, offset, fold); if (UNIV_LIKELY_NULL(block)) { @@ -1150,7 +1150,7 @@ /* The page entered the buffer pool for some reason. Try to -@@ -2529,7 +2676,7 @@ +@@ -2531,7 +2678,7 @@ goto got_block; } } @@ -1159,7 +1159,7 @@ fprintf(stderr, "innodb_change_buffering_debug evict %u %u\n", (unsigned) space, (unsigned) offset); -@@ -2551,13 +2698,14 @@ +@@ -2553,13 +2700,14 @@ ut_a(mode == BUF_GET_POSSIBLY_FREED || !block->page.file_page_was_freed); #endif @@ -1176,7 +1176,7 @@ if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { buf_page_set_accessed_make_young(&block->page, access_time); -@@ -2790,9 +2938,11 @@ +@@ -2792,9 +2940,11 @@ buf_pool = buf_pool_from_block(block); if (mode == BUF_MAKE_YOUNG && buf_page_peek_if_too_old(&block->page)) { @@ -1190,7 +1190,7 @@ } else if (!buf_page_is_accessed(&block->page)) { /* Above, we do a dirty read on purpose, to avoid mutex contention. The field buf_page_t::access_time -@@ -2800,9 +2950,11 @@ +@@ -2802,9 +2952,11 @@ field must be protected by mutex, however. */ ulint time_ms = ut_time_ms(); @@ -1204,7 +1204,7 @@ } ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD); -@@ -2869,18 +3021,21 @@ +@@ -2871,18 +3023,21 @@ ut_ad(mtr); ut_ad(mtr->state == MTR_ACTIVE); @@ -1229,7 +1229,7 @@ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); -@@ -2970,7 +3125,10 @@ +@@ -2972,7 +3127,10 @@ buf_page_t* hash_page; ut_ad(buf_pool == buf_pool_get(space, offset)); @@ -1241,7 +1241,7 @@ ut_ad(mutex_own(&(block->mutex))); ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE); -@@ -2999,11 +3157,14 @@ +@@ -3001,11 +3159,14 @@ if (UNIV_LIKELY(!hash_page)) { } else if (buf_pool_watch_is_sentinel(buf_pool, hash_page)) { /* Preserve the reference count. */ @@ -1257,7 +1257,7 @@ } else { fprintf(stderr, "InnoDB: Error: page %lu %lu already found" -@@ -3013,7 +3174,8 @@ +@@ -3015,7 +3176,8 @@ (const void*) hash_page, (const void*) block); #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG mutex_exit(&block->mutex); @@ -1267,7 +1267,7 @@ buf_print(); buf_LRU_print(); buf_validate(); -@@ -3096,7 +3258,9 @@ +@@ -3098,7 +3260,9 @@ fold = buf_page_address_fold(space, offset); @@ -1278,7 +1278,7 @@ watch_page = buf_page_hash_get_low(buf_pool, space, offset, fold); if (watch_page && !buf_pool_watch_is_sentinel(buf_pool, watch_page)) { -@@ -3105,9 +3269,15 @@ +@@ -3107,9 +3271,15 @@ err_exit: if (block) { mutex_enter(&block->mutex); @@ -1295,7 +1295,7 @@ bpage = NULL; goto func_exit; -@@ -3130,6 +3300,8 @@ +@@ -3132,6 +3302,8 @@ buf_page_init(buf_pool, space, offset, fold, block); @@ -1304,7 +1304,7 @@ /* The block must be put to the LRU list, to the old blocks */ buf_LRU_add_block(bpage, TRUE/* to old blocks */); -@@ -3157,7 +3329,7 @@ +@@ -3159,7 +3331,7 @@ been added to buf_pool->LRU and buf_pool->page_hash. */ mutex_exit(&block->mutex); @@ -1313,7 +1313,7 @@ mutex_enter(&block->mutex); block->page.zip.data = data; -@@ -3170,13 +3342,14 @@ +@@ -3172,13 +3344,14 @@ buf_unzip_LRU_add_block(block, TRUE); } @@ -1329,7 +1329,7 @@ /* If buf_buddy_alloc() allocated storage from the LRU list, it released and reacquired buf_pool->mutex. Thus, we must -@@ -3192,7 +3365,10 @@ +@@ -3194,7 +3367,10 @@ /* The block was added by some other thread. */ watch_page = NULL; @@ -1341,7 +1341,7 @@ bpage = NULL; goto func_exit; -@@ -3240,20 +3416,26 @@ +@@ -3242,20 +3418,26 @@ HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, bpage); @@ -1369,7 +1369,7 @@ if (mode == BUF_READ_IBUF_PAGES_ONLY) { -@@ -3295,7 +3477,9 @@ +@@ -3297,7 +3479,9 @@ fold = buf_page_address_fold(space, offset); @@ -1380,7 +1380,7 @@ block = (buf_block_t*) buf_page_hash_get_low( buf_pool, space, offset, fold); -@@ -3311,7 +3495,9 @@ +@@ -3313,7 +3497,9 @@ #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ /* Page can be found in buf_pool */ @@ -1391,7 +1391,7 @@ buf_block_free(free_block); -@@ -3333,6 +3519,7 @@ +@@ -3335,6 +3521,7 @@ mutex_enter(&block->mutex); buf_page_init(buf_pool, space, offset, fold, block); @@ -1399,7 +1399,7 @@ /* The block must be put to the LRU list */ buf_LRU_add_block(&block->page, FALSE); -@@ -3359,7 +3546,7 @@ +@@ -3361,7 +3548,7 @@ the reacquisition of buf_pool->mutex. We also must defer this operation until after the block descriptor has been added to buf_pool->LRU and buf_pool->page_hash. */ @@ -1408,7 +1408,7 @@ mutex_enter(&block->mutex); block->page.zip.data = data; -@@ -3377,7 +3564,8 @@ +@@ -3379,7 +3566,8 @@ buf_page_set_accessed(&block->page, time_ms); @@ -1418,7 +1418,7 @@ mtr_memo_push(mtr, block, MTR_MEMO_BUF_FIX); -@@ -3432,7 +3620,9 @@ +@@ -3434,7 +3622,9 @@ ibool ret = TRUE; /* First unfix and release lock on the bpage */ @@ -1429,7 +1429,7 @@ mutex_enter(buf_page_get_mutex(bpage)); ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_READ); ut_ad(bpage->buf_fix_count == 0); -@@ -3453,11 +3643,15 @@ +@@ -3455,11 +3645,15 @@ ret = FALSE; } @@ -1446,7 +1446,7 @@ return(ret); } -@@ -3475,6 +3669,8 @@ +@@ -3477,6 +3671,8 @@ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); const ibool uncompressed = (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); @@ -1455,7 +1455,7 @@ ut_a(buf_page_in_file(bpage)); -@@ -3617,8 +3813,26 @@ +@@ -3619,8 +3815,26 @@ } } @@ -1483,7 +1483,7 @@ #ifdef UNIV_IBUF_COUNT_DEBUG if (io_type == BUF_IO_WRITE || uncompressed) { -@@ -3641,6 +3855,7 @@ +@@ -3643,6 +3857,7 @@ the x-latch to this OS thread: do not let this confuse you in debugging! */ @@ -1491,7 +1491,7 @@ ut_ad(buf_pool->n_pend_reads > 0); buf_pool->n_pend_reads--; buf_pool->stat.n_pages_read++; -@@ -3658,6 +3873,9 @@ +@@ -3660,6 +3875,9 @@ buf_flush_write_complete(bpage); @@ -1501,7 +1501,7 @@ if (uncompressed) { rw_lock_s_unlock_gen(&((buf_block_t*) bpage)->lock, BUF_IO_WRITE); -@@ -3680,8 +3898,8 @@ +@@ -3682,8 +3900,8 @@ } #endif /* UNIV_DEBUG */ @@ -1511,7 +1511,7 @@ } /*********************************************************************//** -@@ -3698,7 +3916,9 @@ +@@ -3700,7 +3918,9 @@ ut_ad(buf_pool); @@ -1522,7 +1522,7 @@ chunk = buf_pool->chunks; -@@ -3715,7 +3935,9 @@ +@@ -3717,7 +3937,9 @@ } } @@ -1533,7 +1533,7 @@ return(TRUE); } -@@ -3763,7 +3985,8 @@ +@@ -3765,7 +3987,8 @@ freed = buf_LRU_search_and_free_block(buf_pool, 100); } @@ -1543,7 +1543,7 @@ ut_ad(UT_LIST_GET_LEN(buf_pool->LRU) == 0); ut_ad(UT_LIST_GET_LEN(buf_pool->unzip_LRU) == 0); -@@ -3776,7 +3999,8 @@ +@@ -3778,7 +4001,8 @@ memset(&buf_pool->stat, 0x00, sizeof(buf_pool->stat)); buf_refresh_io_stats(buf_pool); @@ -1553,7 +1553,7 @@ } /*********************************************************************//** -@@ -3818,7 +4042,10 @@ +@@ -3820,7 +4044,10 @@ ut_ad(buf_pool); @@ -1565,7 +1565,7 @@ chunk = buf_pool->chunks; -@@ -3913,7 +4140,7 @@ +@@ -3918,7 +4145,7 @@ /* Check clean compressed-only blocks. */ for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; @@ -1574,7 +1574,7 @@ ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); switch (buf_page_get_io_fix(b)) { case BUF_IO_NONE: -@@ -3944,7 +4171,7 @@ +@@ -3950,7 +4177,7 @@ buf_flush_list_mutex_enter(buf_pool); for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; @@ -1583,7 +1583,7 @@ ut_ad(b->in_flush_list); ut_a(b->oldest_modification); n_flush++; -@@ -4003,6 +4230,8 @@ +@@ -4010,6 +4237,8 @@ } ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == n_lru); @@ -1592,7 +1592,7 @@ if (UT_LIST_GET_LEN(buf_pool->free) != n_free) { fprintf(stderr, "Free list len %lu, free blocks %lu\n", (ulong) UT_LIST_GET_LEN(buf_pool->free), -@@ -4013,8 +4242,11 @@ +@@ -4020,8 +4249,11 @@ ut_a(buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE] == n_single_flush); ut_a(buf_pool->n_flush[BUF_FLUSH_LIST] == n_list_flush); ut_a(buf_pool->n_flush[BUF_FLUSH_LRU] == n_lru_flush); @@ -1605,7 +1605,7 @@ ut_a(buf_LRU_validate()); ut_a(buf_flush_validate(buf_pool)); -@@ -4070,7 +4302,9 @@ +@@ -4077,7 +4309,9 @@ index_ids = mem_alloc(size * sizeof *index_ids); counts = mem_alloc(sizeof(ulint) * size); @@ -1616,7 +1616,7 @@ buf_flush_list_mutex_enter(buf_pool); fprintf(stderr, -@@ -4139,7 +4373,9 @@ +@@ -4146,7 +4380,9 @@ } } @@ -1627,7 +1627,7 @@ for (i = 0; i < n_found; i++) { index = dict_index_get_if_in_cache(index_ids[i]); -@@ -4196,7 +4432,7 @@ +@@ -4203,7 +4439,7 @@ buf_chunk_t* chunk; ulint fixed_pages_number = 0; @@ -1636,7 +1636,7 @@ chunk = buf_pool->chunks; -@@ -4230,7 +4466,7 @@ +@@ -4237,7 +4473,7 @@ /* Traverse the lists of clean and dirty compressed-only blocks. */ for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b; @@ -1645,7 +1645,7 @@ ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE); ut_a(buf_page_get_io_fix(b) != BUF_IO_WRITE); -@@ -4242,7 +4478,7 @@ +@@ -4249,7 +4485,7 @@ buf_flush_list_mutex_enter(buf_pool); for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b; @@ -1654,7 +1654,7 @@ ut_ad(b->in_flush_list); switch (buf_page_get_state(b)) { -@@ -4268,7 +4504,7 @@ +@@ -4275,7 +4511,7 @@ buf_flush_list_mutex_exit(buf_pool); mutex_exit(&buf_pool->zip_mutex); @@ -1663,7 +1663,7 @@ return(fixed_pages_number); } -@@ -4426,6 +4662,8 @@ +@@ -4433,6 +4669,8 @@ /* Find appropriate pool_info to store stats for this buffer pool */ pool_info = &all_pool_info[pool_id]; @@ -1672,7 +1672,7 @@ buf_pool_mutex_enter(buf_pool); buf_flush_list_mutex_enter(buf_pool); -@@ -4541,6 +4779,8 @@ +@@ -4548,6 +4786,8 @@ pool_info->unzip_cur = buf_LRU_stat_cur.unzip; buf_refresh_io_stats(buf_pool); @@ -1681,7 +1681,7 @@ buf_pool_mutex_exit(buf_pool); } -@@ -4785,11 +5025,13 @@ +@@ -4792,11 +5032,13 @@ { ulint len; @@ -2127,7 +2127,7 @@ } --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c -@@ -143,8 +143,9 @@ +@@ -147,8 +147,9 @@ void buf_LRU_block_free_hashed_page( /*===========================*/ @@ -2138,7 +2138,7 @@ /******************************************************************//** Determines if the unzip_LRU list should be used for evicting a victim -@@ -154,15 +155,20 @@ +@@ -158,15 +159,20 @@ ibool buf_LRU_evict_from_unzip_LRU( /*=========================*/ @@ -2161,7 +2161,7 @@ return(FALSE); } -@@ -171,14 +177,20 @@ +@@ -175,14 +181,20 @@ decompressed pages in the buffer pool. */ if (UT_LIST_GET_LEN(buf_pool->unzip_LRU) <= UT_LIST_GET_LEN(buf_pool->LRU) / 10) { @@ -2182,9 +2182,9 @@ /* Calculate the average over past intervals, and add the values of the current interval. */ -@@ -246,18 +258,25 @@ +@@ -250,18 +262,25 @@ page_arr = ut_malloc( - sizeof(ulint) * BUF_LRU_DROP_SEARCH_HASH_SIZE); + sizeof(ulint) * BUF_LRU_DROP_SEARCH_SIZE); - buf_pool_mutex_enter(buf_pool); + //buf_pool_mutex_enter(buf_pool); @@ -2209,7 +2209,7 @@ ut_a(buf_page_in_file(bpage)); if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE -@@ -266,23 +285,27 @@ +@@ -270,24 +289,30 @@ /* Compressed pages are never hashed. Skip blocks of other tablespaces. Skip I/O-fixed blocks (to be dealt with later). */ @@ -2234,12 +2234,15 @@ /* Store the page number so that we can drop the hash index in a batch later. */ page_arr[num_entries] = bpage->offset; ++ + mutex_exit(block_mutex); + - ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); + ut_a(num_entries < BUF_LRU_DROP_SEARCH_SIZE); ++ ++num_entries; -@@ -292,14 +315,16 @@ + if (num_entries < BUF_LRU_DROP_SEARCH_SIZE) { +@@ -296,14 +321,16 @@ /* Array full. We release the buf_pool->mutex to obey the latching order. */ @@ -2258,7 +2261,7 @@ /* Note that we released the buf_pool mutex above after reading the prev_bpage during processing of a -@@ -317,13 +342,23 @@ +@@ -321,13 +348,23 @@ /* If, however, bpage has been removed from LRU list to the free list then we should restart the scan. bpage->state is protected by buf_pool mutex. */ @@ -2283,67 +2286,73 @@ /* Drop any remaining batch of search hashed pages. */ buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, num_entries); -@@ -345,7 +380,9 @@ - ibool all_freed; +@@ -351,7 +388,9 @@ + ulint i; scan_again: - buf_pool_mutex_enter(buf_pool); + //buf_pool_mutex_enter(buf_pool); + mutex_enter(&buf_pool->LRU_list_mutex); + rw_lock_x_lock(&buf_pool->page_hash_latch); + buf_flush_list_mutex_enter(buf_pool); all_freed = TRUE; +@@ -364,7 +403,7 @@ -@@ -375,8 +412,15 @@ - all_freed = FALSE; - goto next_page; - } else { -- block_mutex = buf_page_get_mutex(bpage); -- mutex_enter(block_mutex); -+ block_mutex = buf_page_get_mutex_enter(bpage); -+ -+ if (!block_mutex) { -+ /* It may be impossible case... -+ Something wrong, so will be scan_again */ -+ -+ all_freed = FALSE; -+ goto next_page; -+ } + ut_a(buf_page_in_file(bpage)); - if (bpage->buf_fix_count > 0) { +- prev_bpage = UT_LIST_GET_PREV(list, bpage); ++ prev_bpage = UT_LIST_GET_PREV(flush_list, bpage); -@@ -409,7 +453,9 @@ - ulint page_no; - ulint zip_size; + /* bpage->space and bpage->io_fix are protected by + buf_pool->mutex and block_mutex. It is safe to check +@@ -388,8 +427,14 @@ + will stay in the flush_list because buf_flush_remove() + needs buf_pool->mutex as well. */ + buf_flush_list_mutex_exit(buf_pool); +- block_mutex = buf_page_get_mutex(bpage); +- mutex_enter(block_mutex); ++ block_mutex = buf_page_get_mutex_enter(bpage); ++ ++ if (!block_mutex) { ++ /* It may be impossible case... ++ Something wrong, so will be scan_again */ ++ all_freed = FALSE; ++ goto next_page; ++ } -- buf_pool_mutex_exit(buf_pool); -+ //buf_pool_mutex_exit(buf_pool); -+ mutex_exit(&buf_pool->LRU_list_mutex); -+ rw_lock_x_unlock(&buf_pool->page_hash_latch); + if (bpage->buf_fix_count > 0) { + mutex_exit(block_mutex); +@@ -440,9 +485,15 @@ + mutex_exit(block_mutex); - zip_size = buf_page_get_zip_size(bpage); - page_no = buf_page_get_page_no(bpage); -@@ -433,7 +479,7 @@ + /* Now it is safe to release the buf_pool->mutex. */ +- buf_pool_mutex_exit(buf_pool); ++ //buf_pool_mutex_exit(buf_pool); ++ mutex_exit(&buf_pool->LRU_list_mutex); ++ rw_lock_x_unlock(&buf_pool->page_hash_latch); ++ + os_thread_yield(); +- buf_pool_mutex_enter(buf_pool); ++ //buf_pool_mutex_enter(buf_pool); ++ mutex_enter(&buf_pool->LRU_list_mutex); ++ rw_lock_x_lock(&buf_pool->page_hash_latch); ++ - if (buf_LRU_block_remove_hashed_page(bpage, TRUE) - != BUF_BLOCK_ZIP_FREE) { -- buf_LRU_block_free_hashed_page((buf_block_t*) bpage); -+ buf_LRU_block_free_hashed_page((buf_block_t*) bpage, TRUE); - mutex_exit(block_mutex); - } else { - /* The block_mutex should have been released -@@ -446,7 +492,9 @@ - bpage = prev_bpage; + mutex_enter(block_mutex); + buf_page_unset_sticky(bpage); +@@ -454,7 +505,9 @@ + i = 0; } - buf_pool_mutex_exit(buf_pool); -+ //buf_pool_mutex_exit(buf_pool); ++// buf_pool_mutex_exit(buf_pool); + mutex_exit(&buf_pool->LRU_list_mutex); + rw_lock_x_unlock(&buf_pool->page_hash_latch); + buf_flush_list_mutex_exit(buf_pool); - if (!all_freed) { - os_thread_sleep(20000); -@@ -493,7 +541,9 @@ + ut_ad(buf_flush_validate(buf_pool)); +@@ -504,7 +557,9 @@ buf_page_t* b; buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); @@ -2354,7 +2363,7 @@ ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_PAGE); /* Find the first successor of bpage in the LRU list -@@ -501,17 +551,17 @@ +@@ -512,17 +567,17 @@ b = bpage; do { b = UT_LIST_GET_NEXT(LRU, b); @@ -2376,7 +2385,7 @@ } } #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ -@@ -525,18 +575,19 @@ +@@ -536,18 +591,19 @@ buf_LRU_free_from_unzip_LRU_list( /*=============================*/ buf_pool_t* buf_pool, /*!< in: buffer pool instance */ @@ -2398,7 +2407,7 @@ /* Theoratically it should be much easier to find a victim from unzip_LRU as we can choose even a dirty block (as we'll -@@ -546,7 +597,7 @@ +@@ -557,7 +613,7 @@ if we have done five iterations so far. */ if (UNIV_UNLIKELY(n_iterations >= 5) @@ -2407,7 +2416,7 @@ return(FALSE); } -@@ -554,18 +605,25 @@ +@@ -565,18 +621,25 @@ distance = 100 + (n_iterations * UT_LIST_GET_LEN(buf_pool->unzip_LRU)) / 5; @@ -2435,7 +2444,7 @@ mutex_exit(&block->mutex); if (freed) { -@@ -584,35 +642,46 @@ +@@ -595,35 +658,46 @@ buf_LRU_free_from_common_LRU_list( /*==============================*/ buf_pool_t* buf_pool, @@ -2487,7 +2496,7 @@ mutex_exit(block_mutex); if (freed) { -@@ -649,16 +718,23 @@ +@@ -660,16 +734,23 @@ n_iterations / 5 of the unzip_LRU list. */ { ibool freed = FALSE; @@ -2496,12 +2505,12 @@ - buf_pool_mutex_enter(buf_pool); + if (UT_LIST_GET_LEN(buf_pool->unzip_LRU)) + have_LRU_mutex = TRUE; - -- freed = buf_LRU_free_from_unzip_LRU_list(buf_pool, n_iterations); ++ + //buf_pool_mutex_enter(buf_pool); + if (have_LRU_mutex) + mutex_enter(&buf_pool->LRU_list_mutex); -+ + +- freed = buf_LRU_free_from_unzip_LRU_list(buf_pool, n_iterations); + freed = buf_LRU_free_from_unzip_LRU_list(buf_pool, n_iterations, have_LRU_mutex); if (!freed) { @@ -2514,7 +2523,7 @@ if (!freed) { buf_pool->LRU_flush_ended = 0; } else if (buf_pool->LRU_flush_ended > 0) { -@@ -666,6 +742,8 @@ +@@ -677,6 +758,8 @@ } buf_pool_mutex_exit(buf_pool); @@ -2523,7 +2532,7 @@ return(freed); } -@@ -726,7 +804,9 @@ +@@ -737,7 +820,9 @@ buf_pool = buf_pool_from_array(i); @@ -2534,7 +2543,7 @@ if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) -@@ -736,7 +816,9 @@ +@@ -747,7 +832,9 @@ ret = TRUE; } @@ -2545,7 +2554,7 @@ } return(ret); -@@ -754,9 +836,10 @@ +@@ -765,9 +852,10 @@ { buf_block_t* block; @@ -2558,7 +2567,7 @@ if (block) { -@@ -765,7 +848,9 @@ +@@ -776,7 +864,9 @@ ut_ad(!block->page.in_flush_list); ut_ad(!block->page.in_LRU_list); ut_a(!buf_page_in_file(&block->page)); @@ -2569,7 +2578,7 @@ mutex_enter(&block->mutex); -@@ -775,6 +860,8 @@ +@@ -786,6 +876,8 @@ ut_ad(buf_pool_from_block(block) == buf_pool); mutex_exit(&block->mutex); @@ -2578,7 +2587,7 @@ } return(block); -@@ -797,7 +884,7 @@ +@@ -808,7 +900,7 @@ ibool mon_value_was = FALSE; ibool started_monitor = FALSE; loop: @@ -2587,7 +2596,7 @@ if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->curr_size / 20) { -@@ -865,7 +952,7 @@ +@@ -876,7 +968,7 @@ /* If there is a block in the free list, take it */ block = buf_LRU_get_free_only(buf_pool); @@ -2596,7 +2605,7 @@ if (block) { ut_ad(buf_pool_from_block(block) == buf_pool); -@@ -965,7 +1052,8 @@ +@@ -976,7 +1068,8 @@ ulint new_len; ut_a(buf_pool->LRU_old); @@ -2606,7 +2615,7 @@ ut_ad(buf_pool->LRU_old_ratio >= BUF_LRU_OLD_RATIO_MIN); ut_ad(buf_pool->LRU_old_ratio <= BUF_LRU_OLD_RATIO_MAX); #if BUF_LRU_OLD_RATIO_MIN * BUF_LRU_OLD_MIN_LEN <= BUF_LRU_OLD_RATIO_DIV * (BUF_LRU_OLD_TOLERANCE + 5) -@@ -1031,7 +1119,8 @@ +@@ -1042,7 +1135,8 @@ { buf_page_t* bpage; @@ -2616,7 +2625,7 @@ ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN); /* We first initialize all blocks in the LRU list as old and then use -@@ -1066,13 +1155,14 @@ +@@ -1077,13 +1171,14 @@ ut_ad(buf_pool); ut_ad(bpage); ut_ad(buf_page_in_file(bpage)); @@ -2633,7 +2642,7 @@ UT_LIST_REMOVE(unzip_LRU, buf_pool->unzip_LRU, block); } -@@ -1090,7 +1180,8 @@ +@@ -1101,7 +1196,8 @@ ut_ad(buf_pool); ut_ad(bpage); @@ -2643,7 +2652,7 @@ ut_a(buf_page_in_file(bpage)); -@@ -1167,12 +1258,13 @@ +@@ -1178,12 +1274,13 @@ ut_ad(buf_pool); ut_ad(block); @@ -2659,7 +2668,7 @@ if (old) { UT_LIST_ADD_LAST(unzip_LRU, buf_pool->unzip_LRU, block); -@@ -1193,7 +1285,8 @@ +@@ -1204,7 +1301,8 @@ ut_ad(buf_pool); ut_ad(bpage); @@ -2669,7 +2678,7 @@ ut_a(buf_page_in_file(bpage)); -@@ -1244,7 +1337,8 @@ +@@ -1255,7 +1353,8 @@ ut_ad(buf_pool); ut_ad(bpage); @@ -2679,7 +2688,7 @@ ut_a(buf_page_in_file(bpage)); ut_ad(!bpage->in_LRU_list); -@@ -1323,7 +1417,8 @@ +@@ -1334,7 +1433,8 @@ { buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); @@ -2689,7 +2698,7 @@ if (bpage->old) { buf_pool->stat.n_pages_made_young++; -@@ -1362,17 +1457,18 @@ +@@ -1373,17 +1473,18 @@ buf_LRU_free_block( /*===============*/ buf_page_t* bpage, /*!< in: block to be freed */ @@ -2711,7 +2720,7 @@ ut_ad(!bpage->in_flush_list == !bpage->oldest_modification); #if UNIV_WORD_SIZE == 4 /* On 32-bit systems, there is no padding in buf_page_t. On -@@ -1381,7 +1477,7 @@ +@@ -1392,7 +1493,7 @@ UNIV_MEM_ASSERT_RW(bpage, sizeof *bpage); #endif @@ -2720,7 +2729,7 @@ /* Do not free buffer-fixed or I/O-fixed blocks. */ return(FALSE); -@@ -1415,7 +1511,7 @@ +@@ -1426,7 +1527,7 @@ alloc: b = buf_page_alloc_descriptor(); ut_a(b); @@ -2729,7 +2738,7 @@ } #ifdef UNIV_DEBUG -@@ -1426,6 +1522,39 @@ +@@ -1437,6 +1538,39 @@ } #endif /* UNIV_DEBUG */ @@ -2769,7 +2778,7 @@ if (buf_LRU_block_remove_hashed_page(bpage, zip) != BUF_BLOCK_ZIP_FREE) { ut_a(bpage->buf_fix_count == 0); -@@ -1442,6 +1571,10 @@ +@@ -1453,6 +1587,10 @@ ut_a(!hash_b); @@ -2780,7 +2789,7 @@ b->state = b->oldest_modification ? BUF_BLOCK_ZIP_DIRTY : BUF_BLOCK_ZIP_PAGE; -@@ -1517,6 +1650,7 @@ +@@ -1528,6 +1666,7 @@ buf_LRU_add_block_low(b, buf_page_is_old(b)); } @@ -2788,11 +2797,13 @@ if (b->state == BUF_BLOCK_ZIP_PAGE) { #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG buf_LRU_insert_zip_clean(b); -@@ -1534,9 +1668,12 @@ +@@ -1543,12 +1682,13 @@ + /* Prevent buf_page_get_gen() from + decompressing the block while we release buf_pool->mutex and block_mutex. */ - b->buf_fix_count++; - b->io_fix = BUF_IO_READ; -+ mutex_exit(&buf_pool->zip_mutex); +- mutex_enter(&buf_pool->zip_mutex); + buf_page_set_sticky(b); + mutex_exit(&buf_pool->zip_mutex); } - buf_pool_mutex_exit(buf_pool); @@ -2802,7 +2813,7 @@ mutex_exit(block_mutex); /* Remove possible adaptive hash index on the page. -@@ -1568,7 +1705,9 @@ +@@ -1580,7 +1720,9 @@ : BUF_NO_CHECKSUM_MAGIC); } @@ -2813,7 +2824,7 @@ mutex_enter(block_mutex); if (b) { -@@ -1578,13 +1717,17 @@ +@@ -1589,13 +1731,17 @@ mutex_exit(&buf_pool->zip_mutex); } @@ -2832,7 +2843,7 @@ } return(TRUE); -@@ -1596,13 +1739,14 @@ +@@ -1607,13 +1753,14 @@ void buf_LRU_block_free_non_file_page( /*=============================*/ @@ -2849,7 +2860,7 @@ ut_ad(mutex_own(&block->mutex)); switch (buf_block_get_state(block)) { -@@ -1636,18 +1780,21 @@ +@@ -1647,18 +1794,21 @@ if (data) { block->page.zip.data = NULL; mutex_exit(&block->mutex); @@ -2875,7 +2886,7 @@ UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE); } -@@ -1677,7 +1824,11 @@ +@@ -1688,7 +1838,11 @@ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); ut_ad(bpage); @@ -2888,7 +2899,7 @@ ut_ad(mutex_own(buf_page_get_mutex(bpage))); ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE); -@@ -1785,7 +1936,9 @@ +@@ -1796,7 +1950,9 @@ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG mutex_exit(buf_page_get_mutex(bpage)); @@ -2899,7 +2910,7 @@ buf_print(); buf_LRU_print(); buf_validate(); -@@ -1807,17 +1960,17 @@ +@@ -1818,17 +1974,17 @@ ut_a(buf_page_get_zip_size(bpage)); #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG @@ -2921,7 +2932,7 @@ buf_page_free_descriptor(bpage); return(BUF_BLOCK_ZIP_FREE); -@@ -1839,13 +1992,13 @@ +@@ -1850,13 +2006,13 @@ ut_ad(!bpage->in_flush_list); ut_ad(!bpage->in_LRU_list); mutex_exit(&((buf_block_t*) bpage)->mutex); @@ -2938,7 +2949,7 @@ mutex_enter(&((buf_block_t*) bpage)->mutex); page_zip_set_size(&bpage->zip, 0); } -@@ -1871,18 +2024,19 @@ +@@ -1882,18 +2038,19 @@ void buf_LRU_block_free_hashed_page( /*===========================*/ @@ -2962,7 +2973,7 @@ } /******************************************************************//** -@@ -1897,7 +2051,7 @@ +@@ -1908,7 +2065,7 @@ { if (buf_LRU_block_remove_hashed_page(bpage, TRUE) != BUF_BLOCK_ZIP_FREE) { @@ -2971,7 +2982,7 @@ } } -@@ -1925,7 +2079,8 @@ +@@ -1936,7 +2093,8 @@ } if (adjust) { @@ -2981,7 +2992,7 @@ if (ratio != buf_pool->LRU_old_ratio) { buf_pool->LRU_old_ratio = ratio; -@@ -1937,7 +2092,8 @@ +@@ -1948,7 +2106,8 @@ } } @@ -2991,7 +3002,7 @@ } else { buf_pool->LRU_old_ratio = ratio; } -@@ -2042,7 +2198,8 @@ +@@ -2053,7 +2212,8 @@ ulint new_len; ut_ad(buf_pool); @@ -3001,7 +3012,7 @@ if (UT_LIST_GET_LEN(buf_pool->LRU) >= BUF_LRU_OLD_MIN_LEN) { -@@ -2103,16 +2260,22 @@ +@@ -2114,16 +2274,22 @@ ut_a(buf_pool->LRU_old_len == old_len); @@ -3026,7 +3037,7 @@ UT_LIST_VALIDATE(unzip_LRU, buf_block_t, buf_pool->unzip_LRU, ut_ad(ut_list_node_313->in_unzip_LRU_list && ut_list_node_313->page.in_LRU_list)); -@@ -2126,7 +2289,8 @@ +@@ -2137,7 +2303,8 @@ ut_a(buf_page_belongs_to_unzip_LRU(&block->page)); } @@ -3036,7 +3047,7 @@ } /**********************************************************************//** -@@ -2162,7 +2326,8 @@ +@@ -2173,7 +2340,8 @@ const buf_page_t* bpage; ut_ad(buf_pool); @@ -3046,7 +3057,7 @@ bpage = UT_LIST_GET_FIRST(buf_pool->LRU); -@@ -2219,7 +2384,8 @@ +@@ -2230,7 +2398,8 @@ bpage = UT_LIST_GET_NEXT(LRU, bpage); } @@ -3312,7 +3323,7 @@ /*********************************************************************//** Get the flush type of a page. @return flush type */ -@@ -1332,7 +1355,7 @@ +@@ -1352,7 +1375,7 @@ All these are protected by buf_pool->mutex. */ /* @{ */ @@ -3321,7 +3332,7 @@ /*!< based on state, this is a list node, protected either by buf_pool->mutex or by -@@ -1360,6 +1383,10 @@ +@@ -1380,6 +1403,10 @@ BUF_BLOCK_REMOVE_HASH or BUF_BLOCK_READY_IN_USE. */ @@ -3332,7 +3343,7 @@ #ifdef UNIV_DEBUG ibool in_flush_list; /*!< TRUE if in buf_pool->flush_list; when buf_pool->flush_list_mutex is -@@ -1452,11 +1479,11 @@ +@@ -1472,11 +1499,11 @@ a block is in the unzip_LRU list if page.state == BUF_BLOCK_FILE_PAGE and page.zip.data != NULL */ @@ -3346,7 +3357,7 @@ mutex_t mutex; /*!< mutex protecting this block: state (also protected by the buffer pool mutex), io_fix, buf_fix_count, -@@ -1636,6 +1663,11 @@ +@@ -1656,6 +1683,11 @@ pool instance, protects compressed only pages (of type buf_page_t, not buf_block_t */ @@ -3358,7 +3369,7 @@ ulint instance_no; /*!< Array index of this buffer pool instance */ ulint old_pool_size; /*!< Old pool size in bytes */ -@@ -1789,8 +1821,8 @@ +@@ -1809,8 +1841,8 @@ /** Test if a buffer pool mutex is owned. */ #define buf_pool_mutex_own(b) mutex_own(&b->mutex) /** Acquire a buffer pool mutex. */ @@ -3426,7 +3437,7 @@ /*********************************************************************//** Get the flush type of a page. @return flush type */ -@@ -443,8 +472,8 @@ +@@ -444,8 +473,8 @@ enum buf_io_fix io_fix) /*!< in: io_fix state */ { #ifdef UNIV_DEBUG @@ -3437,7 +3448,25 @@ #endif ut_ad(mutex_own(buf_page_get_mutex(bpage))); -@@ -474,14 +503,14 @@ +@@ -482,7 +511,7 @@ + { + #ifdef UNIV_DEBUG + buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); +- ut_ad(buf_pool_mutex_own(buf_pool)); ++ ut_ad(mutex_own(&buf_pool->LRU_list_mutex)); + #endif + ut_ad(mutex_own(buf_page_get_mutex(bpage))); + ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_NONE); +@@ -500,7 +529,7 @@ + { + #ifdef UNIV_DEBUG + buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); +- ut_ad(buf_pool_mutex_own(buf_pool)); ++ ut_ad(mutex_own(&buf_pool->LRU_list_mutex)); + #endif + ut_ad(mutex_own(buf_page_get_mutex(bpage))); + ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_PIN); +@@ -518,14 +547,14 @@ const buf_page_t* bpage) /*!< control block being relocated */ { #ifdef UNIV_DEBUG @@ -3456,7 +3485,7 @@ && bpage->buf_fix_count == 0); } -@@ -495,8 +524,8 @@ +@@ -539,8 +568,8 @@ const buf_page_t* bpage) /*!< in: control block */ { #ifdef UNIV_DEBUG @@ -3467,7 +3496,7 @@ #endif ut_ad(buf_page_in_file(bpage)); -@@ -516,7 +545,8 @@ +@@ -560,7 +589,8 @@ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); #endif /* UNIV_DEBUG */ ut_a(buf_page_in_file(bpage)); @@ -3477,7 +3506,7 @@ ut_ad(bpage->in_LRU_list); #ifdef UNIV_LRU_DEBUG -@@ -563,9 +593,10 @@ +@@ -607,9 +637,10 @@ ulint time_ms) /*!< in: ut_time_ms() */ { #ifdef UNIV_DEBUG @@ -3490,7 +3519,7 @@ ut_a(buf_page_in_file(bpage)); if (!bpage->access_time) { -@@ -808,19 +839,19 @@ +@@ -852,19 +883,19 @@ /*===========*/ buf_block_t* block) /*!< in, own: block to be freed */ { @@ -3514,7 +3543,7 @@ } #endif /* !UNIV_HOTBACKUP */ -@@ -868,17 +899,17 @@ +@@ -912,17 +943,17 @@ page frame */ { ib_uint64_t lsn; @@ -3537,7 +3566,7 @@ return(lsn); } -@@ -896,7 +927,7 @@ +@@ -940,7 +971,7 @@ #ifdef UNIV_SYNC_DEBUG buf_pool_t* buf_pool = buf_pool_from_bpage((buf_page_t*)block); @@ -3546,7 +3575,7 @@ && (block->page.buf_fix_count == 0)) || rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE)); #endif /* UNIV_SYNC_DEBUG */ -@@ -1026,7 +1057,11 @@ +@@ -1070,7 +1101,11 @@ buf_page_t* bpage; ut_ad(buf_pool); @@ -3559,7 +3588,7 @@ ut_ad(fold == buf_page_address_fold(space, offset)); /* Look for the page in the hash table */ -@@ -1111,11 +1146,13 @@ +@@ -1155,11 +1190,13 @@ const buf_page_t* bpage; buf_pool_t* buf_pool = buf_pool_get(space, offset); @@ -3575,7 +3604,7 @@ return(bpage != NULL); } -@@ -1243,4 +1280,38 @@ +@@ -1287,4 +1324,38 @@ buf_pool_mutex_exit(buf_pool); } } diff --git a/innodb_stats.patch b/innodb_stats.patch index d0a9300..8e79026 100644 --- a/innodb_stats.patch +++ b/innodb_stats.patch @@ -278,10 +278,16 @@ } if (node->state == INDEX_CREATE_INDEX_TREE) { -@@ -1183,6 +1322,66 @@ - } +@@ -1177,6 +1316,66 @@ + return(NULL); + } - /****************************************************************//** ++ thr->run_node = que_node_get_parent(node); ++ ++ return(thr); ++} ++ ++/****************************************************************//** +*/ +UNIV_INTERN +que_thr_t* @@ -336,15 +342,9 @@ + return(NULL); + } + -+ thr->run_node = que_node_get_parent(node); -+ -+ return(thr); -+} -+ -+/****************************************************************//** - Creates the foreign key constraints system tables inside InnoDB - at database creation or database start if they are not found or are - not of the right form. + thr->run_node = que_node_get_parent(node); + + return(thr); --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -755,7 +755,7 @@ @@ -356,7 +356,7 @@ } return(table); -@@ -4344,6 +4344,295 @@ +@@ -4354,6 +4354,295 @@ } /*********************************************************************//** @@ -652,7 +652,7 @@ Calculates new estimates for table and index statistics. The statistics are used in query optimization. */ UNIV_INTERN -@@ -4351,10 +4640,11 @@ +@@ -4361,10 +4650,11 @@ dict_update_statistics( /*===================*/ dict_table_t* table, /*!< in/out: table */ @@ -665,7 +665,7 @@ { dict_index_t* index; ulint sum_of_index_sizes = 0; -@@ -4371,6 +4661,27 @@ +@@ -4381,6 +4671,27 @@ return; } @@ -693,7 +693,7 @@ /* Find out the sizes of the indexes and how many different values for the key they approximately have */ -@@ -4435,6 +4746,11 @@ +@@ -4445,6 +4756,11 @@ index = dict_table_get_next_index(index); } while (index); @@ -705,7 +705,7 @@ index = dict_table_get_first_index(table); table->stat_n_rows = index->stat_n_diff_key_vals[ -@@ -4452,6 +4768,78 @@ +@@ -4462,6 +4778,78 @@ dict_table_stats_unlock(table, RW_X_LATCH); } @@ -784,7 +784,7 @@ /**********************************************************************//** Prints info of a foreign key constraint. */ static -@@ -4529,7 +4917,8 @@ +@@ -4539,7 +4927,8 @@ ut_ad(mutex_own(&(dict_sys->mutex))); @@ -961,7 +961,7 @@ break; case DB_RECORD_NOT_FOUND: error = HA_ERR_KEY_NOT_FOUND; -@@ -6197,6 +6217,11 @@ +@@ -6196,6 +6216,11 @@ case DB_SUCCESS: error = 0; table->status = 0; @@ -973,7 +973,7 @@ break; case DB_RECORD_NOT_FOUND: error = HA_ERR_END_OF_FILE; -@@ -8150,11 +8175,35 @@ +@@ -8149,11 +8174,35 @@ /* In sql_show we call with this flag: update then statistics so that they are up-to-date */ @@ -1010,7 +1010,7 @@ prebuilt->trx->op_info = "returning various info to MySQL"; } -@@ -8239,7 +8288,7 @@ +@@ -8238,7 +8287,7 @@ are asked by MySQL to avoid locking. Another reason to avoid the call is that it uses quite a lot of CPU. See Bug#38185. */ @@ -1019,7 +1019,7 @@ || !(flag & HA_STATUS_VARIABLE_EXTRA)) { /* We do not update delete_length if no locking is requested so the "old" value can -@@ -11512,6 +11561,26 @@ +@@ -11511,6 +11560,26 @@ "The number of index pages to sample when calculating statistics (default 8)", NULL, NULL, 8, 1, ~0ULL, 0); @@ -1046,7 +1046,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled, PLUGIN_VAR_OPCMDARG, "Enable InnoDB adaptive hash index (enabled by default). " -@@ -11844,6 +11913,9 @@ +@@ -11883,6 +11952,9 @@ MYSQL_SYSVAR(recovery_update_relay_log), MYSQL_SYSVAR(rollback_on_timeout), MYSQL_SYSVAR(stats_on_metadata), @@ -1056,7 +1056,7 @@ MYSQL_SYSVAR(stats_sample_pages), MYSQL_SYSVAR(adaptive_hash_index), MYSQL_SYSVAR(stats_method), -@@ -11915,7 +11987,10 @@ +@@ -11957,7 +12029,10 @@ i_s_innodb_sys_columns, i_s_innodb_sys_fields, i_s_innodb_sys_foreign, diff --git a/innodb_thread_concurrency_timer_based.patch b/innodb_thread_concurrency_timer_based.patch index ec7cf47..d3eb06a 100644 --- a/innodb_thread_concurrency_timer_based.patch +++ b/innodb_thread_concurrency_timer_based.patch @@ -25,7 +25,7 @@ #ifdef UNIV_LOG_ARCHIVE srv_log_archive_on = (ulint) innobase_log_archive; #endif /* UNIV_LOG_ARCHIVE */ -@@ -11602,6 +11606,12 @@ +@@ -11601,6 +11605,12 @@ "Maximum delay between polling for a spin lock (6 by default)", NULL, NULL, 6L, 0L, ~0L, 0); @@ -38,7 +38,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, PLUGIN_VAR_RQCMDARG, "Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.", -@@ -11820,6 +11830,7 @@ +@@ -11859,6 +11869,7 @@ MYSQL_SYSVAR(spin_wait_delay), MYSQL_SYSVAR(table_locks), MYSQL_SYSVAR(thread_concurrency), @@ -67,7 +67,7 @@ UNIV_INTERN ulong srv_thread_concurrency = 0; /* this mutex protects srv_conc data structures */ -@@ -1145,6 +1146,75 @@ +@@ -1148,6 +1149,75 @@ /*********************************************************************//** Puts an OS thread to wait if there are too many concurrent threads (>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */ @@ -143,7 +143,7 @@ UNIV_INTERN void srv_conc_enter_innodb( -@@ -1179,6 +1249,13 @@ +@@ -1182,6 +1252,13 @@ return; } @@ -157,7 +157,7 @@ os_fast_mutex_lock(&srv_conc_mutex); retry: if (trx->declared_to_be_inside_innodb) { -@@ -1332,6 +1409,14 @@ +@@ -1335,6 +1412,14 @@ } ut_ad(srv_conc_n_threads >= 0); @@ -172,7 +172,7 @@ os_fast_mutex_lock(&srv_conc_mutex); -@@ -1365,6 +1450,13 @@ +@@ -1368,6 +1453,13 @@ return; } diff --git a/log_connection_error.patch b/log_connection_error.patch index 3f40922..0f6440a 100644 --- a/log_connection_error.patch +++ b/log_connection_error.patch @@ -16,7 +16,7 @@ +Comment= --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -5098,6 +5098,10 @@ +@@ -4959,6 +4959,10 @@ DBUG_PRINT("error",("Too many connections")); close_connection(thd, ER_CON_COUNT_ERROR); @@ -27,7 +27,7 @@ delete thd; DBUG_VOID_RETURN; } -@@ -5481,6 +5485,10 @@ +@@ -5342,6 +5346,10 @@ if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) || my_net_init(&thd->net, thd->net.vio)) { @@ -38,7 +38,7 @@ close_connection(thd, ER_OUT_OF_RESOURCES); delete thd; continue; -@@ -5676,6 +5684,10 @@ +@@ -5537,6 +5545,10 @@ event_conn_closed)) || my_net_init(&thd->net, thd->net.vio)) { diff --git a/log_warnings_suppress.patch b/log_warnings_suppress.patch index ff29768..9d03cdc 100644 --- a/log_warnings_suppress.patch +++ b/log_warnings_suppress.patch @@ -19,7 +19,7 @@ +2011-02-21 rename patch log_warning_silence.patch to log_warnings_suppress.patch. Also rename variable "log_warning_silence" to "log_warning_suppress". --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -628,6 +628,8 @@ +@@ -632,6 +632,8 @@ SHOW_COMP_OPTION have_crypt, have_compress; SHOW_COMP_OPTION have_profiling; @@ -30,7 +30,7 @@ pthread_key(MEM_ROOT**,THR_MALLOC); --- a/sql/mysqld.h +++ b/sql/mysqld.h -@@ -228,6 +228,8 @@ +@@ -229,6 +229,8 @@ extern TYPELIB thread_handling_typelib; extern my_decimal decimal_zero; @@ -41,7 +41,7 @@ using my_pthread_setspecific_ptr()/my_thread_getspecific_ptr(). --- a/sql/sql_class.cc +++ b/sql/sql_class.cc -@@ -5024,7 +5024,7 @@ +@@ -5029,7 +5029,7 @@ ER_BINLOG_UNSAFE_STATEMENT, ER(ER_BINLOG_UNSAFE_STATEMENT), ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); @@ -62,7 +62,7 @@ SLAVE_EXEC_MODE_LAST_BIT}; --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -1499,6 +1499,15 @@ +@@ -1572,6 +1572,15 @@ READ_ONLY GLOBAL_VAR(mysqld_port), CMD_LINE(REQUIRED_ARG, 'P'), VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1)); diff --git a/mysql.spec b/mysql.spec index cd4a680..11ce34e 100644 --- a/mysql.spec +++ b/mysql.spec @@ -35,15 +35,15 @@ Summary(ru.UTF-8): MySQL - быстрый SQL-сервер Summary(uk.UTF-8): MySQL - швидкий SQL-сервер Summary(zh_CN.UTF-8): MySQL数据库服务器 Name: mysql -Version: 5.5.19 -Release: 3 +Version: 5.5.20 +Release: 1 License: GPL + MySQL FLOSS Exception Group: Applications/Databases # Source0Download: http://dev.mysql.com/downloads/mysql/5.5.html#downloads Source0: http://vesta.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.5/%{name}-%{version}.tar.gz -# Source0-md5: a78cf450974e9202bd43674860349b5a -Source100: http://www.sphinxsearch.com/files/sphinx-2.0.1-beta.tar.gz -# Source100-md5: 95c217d81d0b7a4ff73d5297318c3481 +# Source0-md5: 375794ebf84b4c7b63f1676bc7416cd0 +Source100: http://sphinxsearch.com/files/sphinx-2.0.3-release.tar.gz +# Source100-md5: a1293aecd5034aa797811610beb7ba89 Source1: %{name}.init Source2: %{name}.sysconfig Source3: %{name}.logrotate @@ -74,8 +74,6 @@ Patch18: %{name}-sphinx.patch Patch19: %{name}-chain-certs.patch # from fedora Patch20: %{name}-dubious-exports.patch -# http://sphinxsearch.com/bugs/view.php?id=676 -Patch21: sphinx-mysql.patch # Patch100: microsec_process.patch Patch101: optimizer_fix.patch @@ -140,6 +138,7 @@ Patch159: bug860910.patch Patch160: bug45702.patch Patch161: group_commit.patch Patch162: warning_fixes.patch +Patch163: bug917246.patch # URL: http://www.mysql.com/products/community/ BuildRequires: bison @@ -571,9 +570,6 @@ mv sphinx-*/mysqlse storage/sphinx %patch14 -p0 %patch19 -p1 %patch20 -p1 -cd storage/sphinx -%patch21 -p1 -cd ../.. # %patch100 -p1 %patch101 -p1 @@ -638,6 +634,7 @@ cd ../.. %patch160 -p1 %patch161 -p1 %patch162 -p1 +%patch163 -p1 # # to get these files rebuild diff --git a/optimizer_fix.patch b/optimizer_fix.patch index af2089d..c3dac07 100644 --- a/optimizer_fix.patch +++ b/optimizer_fix.patch @@ -18,7 +18,7 @@ +Ported to 5.1.42 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -430,6 +430,7 @@ +@@ -434,6 +434,7 @@ MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout= 0; #endif /* defined(ENABLED_DEBUG_SYNC) */ my_bool opt_old_style_user_limits= 0, trust_function_creators= 0; @@ -138,7 +138,7 @@ DBUG_RETURN(HA_POS_ERROR); /* This shouldn't happend */ --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -2186,6 +2186,12 @@ +@@ -2259,6 +2259,12 @@ VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1)); diff --git a/processlist_row_stats.patch b/processlist_row_stats.patch index 322f341..6bddefd 100644 --- a/processlist_row_stats.patch +++ b/processlist_row_stats.patch @@ -7,7 +7,7 @@ # should be done or reviewed by the maintainer! --- a/sql/sql_class.cc +++ b/sql/sql_class.cc -@@ -2419,6 +2419,7 @@ +@@ -2424,6 +2424,7 @@ thd->sent_row_count++; thd->sent_row_count_2++; diff --git a/query_cache_enhance.patch b/query_cache_enhance.patch index eae04d2..305783f 100644 --- a/query_cache_enhance.patch +++ b/query_cache_enhance.patch @@ -25,7 +25,7 @@ +2010-11 - Ported to 5.5 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -904,6 +904,7 @@ +@@ -909,6 +909,7 @@ #endif #ifdef HAVE_QUERY_CACHE ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE; @@ -719,7 +719,7 @@ NET net; // client connection descriptor --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -1815,6 +1815,11 @@ +@@ -1888,6 +1888,11 @@ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_query_cache_size)); diff --git a/response_time_distribution.patch b/response_time_distribution.patch index 1c1f8cc..603c8e8 100644 --- a/response_time_distribution.patch +++ b/response_time_distribution.patch @@ -2886,7 +2886,7 @@ +2010-09-15 add column 'total' --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt -@@ -51,7 +51,7 @@ +@@ -52,7 +52,7 @@ message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c mysqld.cc net_serv.cc keycaches.cc ../sql-common/client_plugin.c @@ -2895,7 +2895,7 @@ ../sql-common/pack.c parse_file.cc password.c procedure.cc protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc -@@ -59,7 +59,7 @@ +@@ -60,7 +60,7 @@ sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc @@ -2935,7 +2935,7 @@ #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ -@@ -611,7 +613,7 @@ +@@ -615,7 +617,7 @@ MY_LOCALE *my_default_lc_messages; MY_LOCALE *my_default_lc_time_names; @@ -2944,7 +2944,7 @@ SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; SHOW_COMP_OPTION have_profiling; -@@ -912,6 +914,10 @@ +@@ -917,6 +919,10 @@ my_bool opt_enable_shared_memory; HANDLE smem_event_connect_request= 0; #endif @@ -2955,7 +2955,7 @@ my_bool opt_use_ssl = 0; char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL, -@@ -1483,6 +1489,9 @@ +@@ -1488,6 +1494,9 @@ my_free(opt_bin_logname); bitmap_free(&temp_pool); free_max_user_conn(); @@ -2965,7 +2965,7 @@ #ifdef HAVE_REPLICATION end_slave_list(); #endif -@@ -4010,6 +4019,9 @@ +@@ -3860,6 +3869,9 @@ if (!DEFAULT_ERRMSGS[0][0]) unireg_abort(1); @@ -2975,7 +2975,7 @@ /* We have to initialize the storage engines before CSV logging */ if (ha_init()) { -@@ -6905,6 +6917,11 @@ +@@ -6773,6 +6785,11 @@ #else have_query_cache=SHOW_OPTION_NO; #endif @@ -3374,7 +3374,7 @@ +#endif // QUERY_RESPONSE_TIME_H --- a/sql/set_var.h +++ b/sql/set_var.h -@@ -293,6 +293,7 @@ +@@ -294,6 +294,7 @@ extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen; extern SHOW_COMP_OPTION have_query_cache; @@ -3486,7 +3486,7 @@ %token QUICK %token RANGE_SYM /* SQL-2003-R */ %token READS_SYM /* SQL-2003-R */ -@@ -11100,6 +11101,15 @@ +@@ -11105,6 +11106,15 @@ { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } @@ -3502,7 +3502,7 @@ | CREATE PROCEDURE_SYM sp_name { LEX *lex= Lex; -@@ -11339,6 +11349,12 @@ +@@ -11344,6 +11354,12 @@ Lex->type|= REFRESH_SLAVE; Lex->reset_slave_info.all= false; } @@ -3515,7 +3515,7 @@ | MASTER_SYM { Lex->type|= REFRESH_MASTER; } | DES_KEY_FILE -@@ -12646,6 +12662,7 @@ +@@ -12651,6 +12667,7 @@ | PROXY_SYM {} | QUARTER_SYM {} | QUERY_SYM {} @@ -3525,15 +3525,15 @@ | REBUILD_SYM {} --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -49,6 +49,7 @@ - #include "../storage/perfschema/pfs_server.h" - #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ +@@ -51,6 +51,7 @@ + + TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 }; +#include "query_response_time.h" /* This forward declaration is needed because including sql_base.h causes further includes. [TODO] Eliminate this forward declaration -@@ -1866,6 +1867,26 @@ +@@ -1939,6 +1940,26 @@ DEFAULT(FALSE)); #endif /* HAVE_QUERY_CACHE */ diff --git a/show_slave_status_nolock.patch b/show_slave_status_nolock.patch index b18bb4a..32dcd7f 100644 --- a/show_slave_status_nolock.patch +++ b/show_slave_status_nolock.patch @@ -26,7 +26,7 @@ { "NVARCHAR", SYM(NVARCHAR_SYM)}, --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -3121,6 +3121,7 @@ +@@ -2971,6 +2971,7 @@ {"show_relaylog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_RELAYLOG_EVENTS]), SHOW_LONG_STATUS}, {"show_slave_hosts", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_HOSTS]), SHOW_LONG_STATUS}, {"show_slave_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_STAT]), SHOW_LONG_STATUS}, @@ -105,7 +105,7 @@ %token STDDEV_SAMP_SYM /* SQL-2003-N */ %token STD_SYM %token STOP_SYM -@@ -11106,6 +11107,11 @@ +@@ -11111,6 +11112,11 @@ { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } diff --git a/show_temp.patch b/show_temp.patch index 6fa2c34..77fca60 100644 --- a/show_temp.patch +++ b/show_temp.patch @@ -25,7 +25,7 @@ SCH_VARIABLES, --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -3101,6 +3101,7 @@ +@@ -2951,6 +2951,7 @@ {"show_storage_engines", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STORAGE_ENGINES]), SHOW_LONG_STATUS}, {"show_table_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TABLE_STATUS]), SHOW_LONG_STATUS}, {"show_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TABLES]), SHOW_LONG_STATUS}, @@ -33,7 +33,7 @@ {"show_triggers", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TRIGGERS]), SHOW_LONG_STATUS}, {"show_variables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS}, {"show_warnings", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS}, -@@ -7802,6 +7803,7 @@ +@@ -7670,6 +7671,7 @@ PSI_mutex_key key_LOCK_des_key_file; #endif /* HAVE_OPENSSL */ @@ -41,7 +41,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create, -@@ -7855,6 +7857,7 @@ +@@ -7723,6 +7725,7 @@ { &key_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL}, { &key_LOCK_table_share, "LOCK_table_share", PSI_FLAG_GLOBAL}, { &key_LOCK_thd_data, "THD::LOCK_thd_data", 0}, @@ -387,7 +387,7 @@ OPEN_TRIGGER_ONLY|OPTIMIZE_I_S_TABLE}, --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy -@@ -10893,6 +10893,15 @@ +@@ -10898,6 +10898,15 @@ if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES)) MYSQL_YYABORT; } @@ -405,7 +405,7 @@ LEX *lex= Lex; --- a/sql/mysqld.h +++ b/sql/mysqld.h -@@ -233,6 +233,7 @@ +@@ -234,6 +234,7 @@ extern PSI_mutex_key key_LOCK_des_key_file; #endif diff --git a/slow_extended.patch b/slow_extended.patch index dd3aff7..86728cf 100644 --- a/slow_extended.patch +++ b/slow_extended.patch @@ -411,7 +411,7 @@ ulonglong lock_utime, bool is_command, --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -421,6 +421,10 @@ +@@ -425,6 +425,10 @@ char* opt_secure_file_priv; my_bool opt_log_slow_admin_statements= 0; my_bool opt_log_slow_slave_statements= 0; @@ -422,7 +422,7 @@ my_bool lower_case_file_system= 0; my_bool opt_large_pages= 0; my_bool opt_super_large_pages= 0; -@@ -5892,14 +5896,10 @@ +@@ -5753,14 +5757,10 @@ "Don't log extra information to update and slow-query logs.", &opt_short_log_format, &opt_short_log_format, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -439,7 +439,7 @@ {"log-slow-queries", OPT_SLOW_QUERY_LOG, "Log slow queries to a table or log file. Defaults logging to table " "mysql.slow_log or hostname-slow.log if --log-output=file is used. " -@@ -7288,6 +7288,10 @@ +@@ -7156,6 +7156,10 @@ C_MODE_END @@ -450,7 +450,7 @@ /** Get server options from the command line, and perform related server initializations. -@@ -7437,6 +7441,8 @@ +@@ -7305,6 +7309,8 @@ global_system_variables.long_query_time= (ulonglong) (global_system_variables.long_query_time_double * 1e6); @@ -569,7 +569,7 @@ } -@@ -3682,8 +3717,6 @@ +@@ -3687,8 +3722,6 @@ backup->in_sub_stmt= in_sub_stmt; backup->enable_slow_log= enable_slow_log; backup->limit_found_rows= limit_found_rows; @@ -578,7 +578,7 @@ backup->cuted_fields= cuted_fields; backup->client_capabilities= client_capabilities; backup->savepoints= transaction.savepoints; -@@ -3691,6 +3724,7 @@ +@@ -3696,6 +3729,7 @@ first_successful_insert_id_in_prev_stmt; backup->first_successful_insert_id_in_cur_stmt= first_successful_insert_id_in_cur_stmt; @@ -586,7 +586,7 @@ if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) && !is_current_stmt_binlog_format_row()) -@@ -3706,13 +3740,74 @@ +@@ -3711,13 +3745,74 @@ /* Disable result sets */ client_capabilities &= ~CLIENT_MULTI_RESULTS; in_sub_stmt|= new_state; @@ -663,7 +663,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) { -@@ -3753,7 +3848,6 @@ +@@ -3758,7 +3853,6 @@ first_successful_insert_id_in_cur_stmt= backup->first_successful_insert_id_in_cur_stmt; limit_found_rows= backup->limit_found_rows; @@ -671,7 +671,7 @@ client_capabilities= backup->client_capabilities; /* If we've left sub-statement mode, reset the fatal error flag. -@@ -3771,8 +3865,8 @@ +@@ -3776,8 +3870,8 @@ The following is added to the old values as we are interested in the total complexity of the query */ @@ -1072,7 +1072,7 @@ { --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -972,6 +972,29 @@ +@@ -1045,6 +1045,29 @@ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_cached_long_query_time)); @@ -1102,7 +1102,7 @@ static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type) { if (type == OPT_SESSION) -@@ -2904,6 +2927,123 @@ +@@ -2977,6 +3000,123 @@ DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_log_state)); diff --git a/sphinx-mysql.patch b/sphinx-mysql.patch deleted file mode 100644 index 764ac91..0000000 --- a/sphinx-mysql.patch +++ /dev/null @@ -1,189 +0,0 @@ -Index: mysqlse/ha_sphinx.cc -=================================================================== ---- mysqlse/ha_sphinx.cc (wersja 2920) -+++ mysqlse/ha_sphinx.cc (wersja 2921) -@@ -24,7 +24,10 @@ - - #include - --#if MYSQL_VERSION_ID>50100 -+#if MYSQL_VERSION_ID>=50515 -+#include "sql_class.h" -+#include "sql_array.h" -+#elif MYSQL_VERSION_ID>50100 - #include "mysql_priv.h" - #include - #else -@@ -119,6 +122,22 @@ - - #endif - -+#if MYSQL_VERSION_ID>=50515 -+ -+#define sphinx_hash_init my_hash_init -+#define sphinx_hash_free my_hash_free -+#define sphinx_hash_search my_hash_search -+#define sphinx_hash_delete my_hash_delete -+ -+#else -+ -+#define sphinx_hash_init hash_init -+#define sphinx_hash_free hash_free -+#define sphinx_hash_search hash_search -+#define sphinx_hash_delete hash_delete -+ -+#endif -+ - ///////////////////////////////////////////////////////////////////////////// - - // FIXME! make this all dynamic -@@ -675,8 +694,8 @@ - if ( !sphinx_init ) - { - sphinx_init = 1; -- VOID ( pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST ) ); -- hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0, -+ void ( pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST ) ); -+ sphinx_hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0, - sphinx_get_key, 0, 0 ); - - #if MYSQL_VERSION_ID > 50100 -@@ -726,7 +745,7 @@ - sphinx_init = 0; - if ( sphinx_open_tables.records ) - error = 1; -- hash_free ( &sphinx_open_tables ); -+ sphinx_hash_free ( &sphinx_open_tables ); - pthread_mutex_destroy ( &sphinx_mutex ); - } - -@@ -1131,12 +1150,12 @@ - { - // check if we already have this share - #if MYSQL_VERSION_ID>=50120 -- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, (const uchar *) table_name, strlen(table_name) ); -+ pShare = (CSphSEShare*) sphinx_hash_search ( &sphinx_open_tables, (const uchar *) table_name, strlen(table_name) ); - #else - #ifdef __WIN__ -- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, (const byte *) table_name, strlen(table_name) ); -+ pShare = (CSphSEShare*) sphinx_hash_search ( &sphinx_open_tables, (const byte *) table_name, strlen(table_name) ); - #else -- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, table_name, strlen(table_name) ); -+ pShare = (CSphSEShare*) sphinx_hash_search ( &sphinx_open_tables, table_name, strlen(table_name) ); - #endif // win - #endif // pre-5.1.20 - -@@ -1188,7 +1207,7 @@ - - if ( !--pShare->m_iUseCount ) - { -- hash_delete ( &sphinx_open_tables, (byte *)pShare ); -+ sphinx_hash_delete ( &sphinx_open_tables, (byte *)pShare ); - SafeDelete ( pShare ); - } - -@@ -2073,15 +2092,29 @@ - } else - { - int tmp_errno; -+ bool bError = false; -+ -+#if MYSQL_VERSION_ID>=50515 -+ struct addrinfo tmp_hostent, *hp; -+ tmp_errno = getaddrinfo ( sHost, NULL, &tmp_hostent, &hp ); -+ if ( !tmp_errno ) -+ { -+ freeaddrinfo ( hp ); -+ bError = true; -+ } -+#else - struct hostent tmp_hostent, *hp; - char buff2 [ GETHOSTBYNAME_BUFF_SIZE ]; -- -- hp = my_gethostbyname_r ( sHost, &tmp_hostent, -- buff2, sizeof(buff2), &tmp_errno ); -+ hp = my_gethostbyname_r ( sHost, &tmp_hostent, buff2, sizeof(buff2), &tmp_errno ); - if ( !hp ) - { - my_gethostbyname_r_free(); -+ bError = true; -+ } -+#endif - -+ if ( bError ) -+ { - char sError[256]; - my_snprintf ( sError, sizeof(sError), "failed to resolve searchd host (name=%s)", sHost ); - -@@ -2089,9 +2122,13 @@ - SPH_RET(-1); - } - -- memcpy ( &sin.sin_addr, hp->h_addr, -- Min ( sizeof(sin.sin_addr), (size_t)hp->h_length ) ); -+#if MYSQL_VERSION_ID>=50515 -+ memcpy ( &sin.sin_addr, hp->ai_addr, Min ( sizeof(sin.sin_addr), (size_t)hp->ai_addrlen ) ); -+ freeaddrinfo ( hp ); -+#else -+ memcpy ( &sin.sin_addr, hp->h_addr, Min ( sizeof(sin.sin_addr), (size_t)hp->h_length ) ); - my_gethostbyname_r_free(); -+#endif - } - } else - { -@@ -2932,7 +2969,7 @@ - - for ( uint32 i=0; i50100 -+#if MYSQL_VERSION_ID>=50515 -+#define TABLE_ARG TABLE_SHARE -+#elif MYSQL_VERSION_ID>50100 - #define TABLE_ARG st_table_share - #else - #define TABLE_ARG st_table -@@ -47,7 +49,7 @@ - - public: - #if MYSQL_VERSION_ID<50100 -- ha_sphinx ( TABLE_ARG * table_arg ); -+ ha_sphinx ( TABLE_ARG * table_arg ); // NOLINT - #else - ha_sphinx ( handlerton * hton, TABLE_ARG * table_arg ); - #endif -@@ -90,7 +92,7 @@ - int index_init ( uint keynr, bool sorted ); // 5.1.x - int index_init ( uint keynr ) { return index_init ( keynr, false ); } // 5.0.x - -- int index_end (); -+ int index_end (); - int index_read ( byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag ); - int index_read_idx ( byte * buf, uint idx, const byte * key, uint key_len, enum ha_rkey_function find_flag ); - int index_next ( byte * buf ); -Index: mysqlse/CMakeLists.txt -=================================================================== ---- mysqlse/CMakeLists.txt (wersja 2920) -+++ mysqlse/CMakeLists.txt (wersja 2921) -@@ -8,4 +8,9 @@ - ${CMAKE_SOURCE_DIR}/regex) - - SET(SPHINX_SOURCES ha_sphinx.cc) -+IF(MYSQL_VERSION_ID LESS 50515) - ADD_LIBRARY(sphinx ha_sphinx.cc) -+ELSE() -+SET(SPHINX_PLUGIN_DYNAMIC "ha_sphinx") -+MYSQL_ADD_PLUGIN(sphinx ${SPHINX_SOURCES} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES mysys) -+ENDIF() diff --git a/sql_no_fcache.patch b/sql_no_fcache.patch index 764ca03..930a0c1 100644 --- a/sql_no_fcache.patch +++ b/sql_no_fcache.patch @@ -139,7 +139,7 @@ { "SQL_TSI_SECOND", SYM(SECOND_SYM)}, --- a/sql/mysqld.h +++ b/sql/mysqld.h -@@ -194,6 +194,8 @@ +@@ -195,6 +195,8 @@ extern char language[FN_REFLEN]; extern "C" MYSQL_PLUGIN_IMPORT ulong server_id; extern ulong concurrency; @@ -162,7 +162,7 @@ #include #include -@@ -487,6 +492,11 @@ +@@ -491,6 +496,11 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong max_connections, max_connect_errors; @@ -174,7 +174,7 @@ /* Maximum length of parameter value which can be set through mysql_send_long_data() call. -@@ -4252,6 +4262,97 @@ +@@ -4102,6 +4112,97 @@ #define decrement_handler_count() #endif /* defined(_WIN32) || defined(HAVE_SMEM) */ @@ -272,7 +272,7 @@ #ifndef EMBEDDED_LIBRARY #ifndef DBUG_OFF -@@ -4510,6 +4611,10 @@ +@@ -4363,6 +4464,10 @@ test_lc_time_sz(); #endif @@ -283,7 +283,7 @@ /* We have enough space for fiddling with the argv, continue */ -@@ -4713,6 +4818,10 @@ +@@ -4574,6 +4679,10 @@ } #endif clean_up(1); @@ -294,7 +294,7 @@ mysqld_exit(0); } -@@ -6553,6 +6662,7 @@ +@@ -6421,6 +6530,7 @@ {"Delayed_errors", (char*) &delayed_insert_errors, SHOW_LONG}, {"Delayed_insert_threads", (char*) &delayed_insert_threads, SHOW_LONG_NOFLUSH}, {"Delayed_writes", (char*) &delayed_insert_writes, SHOW_LONG}, @@ -314,7 +314,7 @@ lex->leaf_tables_insert= 0; --- a/sql/sql_lex.h +++ b/sql/sql_lex.h -@@ -2345,6 +2345,7 @@ +@@ -2346,6 +2346,7 @@ enum enum_yes_no_unknown tx_chain, tx_release; bool safe_to_cache_query; @@ -378,7 +378,7 @@ %token SQL_SMALL_RESULT %token SQL_SYM /* SQL-2003-R */ %token SQL_THREAD -@@ -7357,6 +7358,10 @@ +@@ -7362,6 +7363,10 @@ Lex->select_lex.sql_cache= SELECT_LEX::SQL_NO_CACHE; } } diff --git a/subunit.patch b/subunit.patch index 358609c..8dc034c 100644 --- a/subunit.patch +++ b/subunit.patch @@ -189,7 +189,7 @@ require "lib/mtr_process.pl"; require "lib/mtr_io.pl"; -@@ -291,6 +292,7 @@ +@@ -292,6 +293,7 @@ my $opt_valgrind_path; my $valgrind_reports= 0; my $opt_callgrind; @@ -197,7 +197,7 @@ my %mysqld_logs; my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions. -@@ -630,6 +632,7 @@ +@@ -631,6 +633,7 @@ # Report test status mtr_report_test($result); @@ -205,7 +205,7 @@ if ( $result->is_failed() ) { -@@ -1142,6 +1145,7 @@ +@@ -1144,6 +1147,7 @@ 'valgrind-option=s' => \@valgrind_args, 'valgrind-path=s' => \$opt_valgrind_path, 'callgrind' => \$opt_callgrind, @@ -213,7 +213,7 @@ 'debug-sync-timeout=i' => \$opt_debug_sync_timeout, # Directories -@@ -1703,11 +1707,18 @@ +@@ -1705,11 +1709,18 @@ unless @valgrind_args; } @@ -233,7 +233,7 @@ # Don't add --quiet; you will loose the summary reports. -@@ -5796,6 +5807,10 @@ +@@ -5831,6 +5842,10 @@ mtr_add_arg($args, "--tool=callgrind"); mtr_add_arg($args, "--base=$opt_vardir/log"); } diff --git a/userstat.patch b/userstat.patch index bf16eaa..5c2265a 100644 --- a/userstat.patch +++ b/userstat.patch @@ -363,7 +363,7 @@ /* Log error with all enabled log event handlers -@@ -5026,6 +5033,8 @@ +@@ -5062,6 +5069,8 @@ thd->first_successful_insert_id_in_prev_stmt_for_binlog); if (e.write(file)) goto err; @@ -372,7 +372,7 @@ } if (thd->auto_inc_intervals_in_cur_stmt_for_binlog.nb_elements() > 0) { -@@ -5037,12 +5046,16 @@ +@@ -5073,12 +5082,16 @@ minimum()); if (e.write(file)) goto err; @@ -389,7 +389,7 @@ } if (thd->user_var_events.elements) { -@@ -5065,6 +5078,8 @@ +@@ -5101,6 +5114,8 @@ flags); if (e.write(file)) goto err; @@ -398,7 +398,7 @@ } } } -@@ -5076,6 +5091,8 @@ +@@ -5112,6 +5127,8 @@ if (event_info->write(file) || DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0)) goto err; @@ -407,7 +407,7 @@ error= 0; err: -@@ -5310,7 +5327,8 @@ +@@ -5346,7 +5363,8 @@ be reset as a READ_CACHE to be able to read the contents from it. */ @@ -417,7 +417,7 @@ { Mutex_sentry sentry(lock_log ? &LOCK_log : NULL); -@@ -5357,6 +5375,7 @@ +@@ -5393,6 +5411,7 @@ /* write the first half of the split header */ if (my_b_write(&log_file, header, carry)) return ER_ERROR_ON_WRITE; @@ -425,7 +425,7 @@ /* copy fixed second half of header to cache so the correct -@@ -5425,6 +5444,7 @@ +@@ -5461,6 +5480,7 @@ /* Write data to the binary log file */ if (my_b_write(&log_file, cache->read_pos, length)) return ER_ERROR_ON_WRITE; @@ -433,7 +433,7 @@ cache->read_pos=cache->read_end; // Mark buffer used up } while ((length= my_b_fill(cache))); -@@ -5548,20 +5568,23 @@ +@@ -5584,20 +5604,23 @@ Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"), TRUE, FALSE, TRUE, 0); if (qinfo.write(&log_file)) goto err; @@ -481,7 +481,7 @@ MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; } --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -441,6 +441,7 @@ +@@ -445,6 +445,7 @@ MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout= 0; #endif /* defined(ENABLED_DEBUG_SYNC) */ my_bool opt_old_style_user_limits= 0, trust_function_creators= 0; @@ -489,7 +489,7 @@ my_bool opt_optimizer_fix= 0; /* True if there is at least one per-hour limit for some user, so we should -@@ -492,6 +493,7 @@ +@@ -496,6 +497,7 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong max_connections, max_connect_errors; @@ -497,7 +497,7 @@ /* flashcache */ int cachedev_fd; -@@ -641,7 +643,9 @@ +@@ -645,7 +647,9 @@ LOCK_crypt, LOCK_global_system_variables, LOCK_user_conn, LOCK_slave_list, LOCK_active_mi, @@ -508,7 +508,7 @@ /** The below lock protects access to two global server variables: max_prepared_stmt_count and prepared_stmt_count. These variables -@@ -1504,6 +1508,11 @@ +@@ -1509,6 +1513,11 @@ #ifdef HAVE_RESPONSE_TIME_DISTRIBUTION query_response_time_free(); #endif // HAVE_RESPONSE_TIME_DISTRIBUTION @@ -520,7 +520,7 @@ #ifdef HAVE_REPLICATION end_slave_list(); #endif -@@ -1607,6 +1616,10 @@ +@@ -1612,6 +1621,10 @@ mysql_cond_destroy(&COND_thread_cache); mysql_cond_destroy(&COND_flush_thread_cache); mysql_cond_destroy(&COND_manager); @@ -531,7 +531,7 @@ } #endif /*EMBEDDED_LIBRARY*/ -@@ -3088,6 +3101,7 @@ +@@ -2938,6 +2951,7 @@ {"show_binlog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS}, {"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS}, {"show_charsets", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS}, @@ -539,7 +539,7 @@ {"show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS}, {"show_contributors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS}, {"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS}, -@@ -3108,6 +3122,7 @@ +@@ -2958,6 +2972,7 @@ #endif {"show_function_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS_FUNC]), SHOW_LONG_STATUS}, {"show_grants", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_GRANTS]), SHOW_LONG_STATUS}, @@ -547,7 +547,7 @@ {"show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS}, {"show_master_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS}, {"show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS}, -@@ -3126,10 +3141,13 @@ +@@ -2976,10 +2991,13 @@ {"show_slave_status_nolock", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_NOLOCK_STAT]), SHOW_LONG_STATUS}, {"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS}, {"show_storage_engines", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STORAGE_ENGINES]), SHOW_LONG_STATUS}, @@ -561,7 +561,7 @@ {"show_variables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS}, {"show_warnings", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS}, {"slave_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS}, -@@ -3667,6 +3685,13 @@ +@@ -3517,6 +3535,13 @@ mysql_mutex_init(key_LOCK_server_started, &LOCK_server_started, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_server_started, &COND_server_started, NULL); @@ -575,7 +575,7 @@ sp_cache_init(); #ifdef HAVE_EVENT_SCHEDULER Events::init_mutexes(); -@@ -4036,6 +4061,9 @@ +@@ -3886,6 +3911,9 @@ query_response_time_init(); #endif // HAVE_RESPONSE_TIME_DISTRIBUTION /* We have to initialize the storage engines before CSV logging */ @@ -585,7 +585,7 @@ if (ha_init()) { sql_print_error("Can't init databases"); -@@ -4172,6 +4200,9 @@ +@@ -4022,6 +4050,9 @@ init_max_user_conn(); init_update_queries(); @@ -595,7 +595,7 @@ DBUG_RETURN(0); } -@@ -5226,6 +5257,7 @@ +@@ -5087,6 +5118,7 @@ { sql_print_warning("%s", ER_DEFAULT(ER_CON_COUNT_ERROR)); } @@ -603,7 +603,7 @@ delete thd; DBUG_VOID_RETURN; } -@@ -7957,6 +7989,8 @@ +@@ -7825,6 +7857,8 @@ key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create, key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log, @@ -612,7 +612,7 @@ key_LOCK_gdl, key_LOCK_global_system_variables, key_LOCK_manager, key_LOCK_prepared_stmt_count, -@@ -7996,6 +8030,13 @@ +@@ -7864,6 +7898,13 @@ { &key_LOCK_delayed_insert, "LOCK_delayed_insert", PSI_FLAG_GLOBAL}, { &key_LOCK_delayed_status, "LOCK_delayed_status", PSI_FLAG_GLOBAL}, { &key_LOCK_error_log, "LOCK_error_log", PSI_FLAG_GLOBAL}, @@ -644,7 +644,7 @@ extern my_bool opt_optimizer_fix; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern my_bool opt_secure_auth; -@@ -182,6 +184,7 @@ +@@ -183,6 +185,7 @@ extern ulong slave_trans_retries; extern uint slave_net_timeout; extern uint max_user_connections; @@ -652,7 +652,7 @@ extern ulong what_to_log,flush_time; extern ulong max_prepared_stmt_count, prepared_stmt_count; extern ulong open_files_limit; -@@ -209,6 +212,11 @@ +@@ -210,6 +213,11 @@ extern struct system_variables max_system_variables; extern struct system_status_var global_status_var; extern struct rand_struct sql_rand; @@ -664,7 +664,7 @@ extern const char *opt_date_time_formats[]; extern handlerton *partition_hton; extern handlerton *myisam_hton; -@@ -251,6 +259,8 @@ +@@ -252,6 +260,8 @@ key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create, key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log, @@ -673,7 +673,7 @@ key_LOCK_gdl, key_LOCK_global_system_variables, key_LOCK_logger, key_LOCK_manager, key_LOCK_prepared_stmt_count, -@@ -350,7 +360,9 @@ +@@ -351,7 +361,9 @@ LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone, LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_system_variables, LOCK_user_conn, @@ -684,7 +684,7 @@ extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_thread_count; #ifdef HAVE_OPENSSL extern mysql_mutex_t LOCK_des_key_file; -@@ -462,6 +474,16 @@ +@@ -463,6 +475,16 @@ return id; } @@ -843,7 +843,7 @@ /* Init THD for query processing. -@@ -2120,6 +2216,32 @@ +@@ -2125,6 +2221,32 @@ } #endif @@ -876,7 +876,7 @@ struct Item_change_record: public ilink { -@@ -2296,6 +2418,7 @@ +@@ -2301,6 +2423,7 @@ } thd->sent_row_count++; @@ -884,7 +884,7 @@ if (thd->vio_ok()) DBUG_RETURN(protocol->write()); -@@ -2388,6 +2511,7 @@ +@@ -2393,6 +2516,7 @@ select_export::~select_export() { thd->sent_row_count=row_count; @@ -892,7 +892,7 @@ } -@@ -3411,6 +3535,7 @@ +@@ -3416,6 +3540,7 @@ if (likely(thd != 0)) { /* current_thd==0 when close_connection() calls net_send_error() */ thd->status_var.bytes_sent+= length; @@ -900,7 +900,7 @@ } } -@@ -3418,6 +3543,7 @@ +@@ -3423,6 +3548,7 @@ void thd_increment_bytes_received(ulong length) { current_thd->status_var.bytes_received+= length; @@ -2944,7 +2944,7 @@ %token USE_FRM %token USE_SYM %token USING /* SQL-2003-R */ -@@ -11121,6 +11126,41 @@ +@@ -11126,6 +11131,41 @@ MYSQL_YYABORT; #endif // HAVE_RESPONSE_TIME_DISTRIBUTION } @@ -2986,7 +2986,7 @@ | CREATE PROCEDURE_SYM sp_name { LEX *lex= Lex; -@@ -11366,6 +11406,16 @@ +@@ -11371,6 +11411,16 @@ Lex->type|= REFRESH_QUERY_RESPONSE_TIME; #endif // HAVE_RESPONSE_TIME_DISTRIBUTION } @@ -3003,7 +3003,7 @@ | MASTER_SYM { Lex->type|= REFRESH_MASTER; } | DES_KEY_FILE -@@ -12510,6 +12560,7 @@ +@@ -12515,6 +12565,7 @@ | CHAIN_SYM {} | CHANGED {} | CIPHER_SYM {} @@ -3011,7 +3011,7 @@ | CLIENT_SYM {} | CLASS_ORIGIN_SYM {} | COALESCE {} -@@ -12578,6 +12629,7 @@ +@@ -12583,6 +12634,7 @@ | HOSTS_SYM {} | HOUR_SYM {} | IDENTIFIED_SYM {} @@ -3019,7 +3019,7 @@ | IGNORE_SERVER_IDS_SYM {} | INVOKER_SYM {} | IMPORT {} -@@ -12729,6 +12781,7 @@ +@@ -12734,6 +12786,7 @@ | SUSPEND_SYM {} | SWAPS_SYM {} | SWITCHES_SYM {} @@ -3027,7 +3027,7 @@ | TABLE_NAME_SYM {} | TABLES {} | TABLE_CHECKSUM_SYM {} -@@ -12754,6 +12807,7 @@ +@@ -12759,6 +12812,7 @@ | UNKNOWN_SYM {} | UNTIL_SYM {} | USER {} @@ -3219,7 +3219,7 @@ #define REG_NEW_RECORD 2 /* Write a new record if not found */ --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -1638,6 +1638,17 @@ +@@ -1711,6 +1711,17 @@ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_read_only), ON_UPDATE(fix_read_only)); -- 2.44.0