diff options
author | Michael Widenius <monty@askmonty.org> | 2013-06-22 18:47:12 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-06-22 18:47:12 +0300 |
commit | 5f4e0e87673317f3f20dff68c429f1d816e89a15 (patch) | |
tree | eb28781671aa84daaf5c6594270a2996a258d8fe | |
parent | 1f08a518589b79e9dd2897e6ebdb237bcc4c2221 (diff) | |
download | mariadb-git-5f4e0e87673317f3f20dff68c429f1d816e89a15.tar.gz |
Don't update table and index statics for temporary tables
Fixed type and testing of last_update type for innodb_table_stats
mysql-test/r/connect.result:
Removed tables which are not created anymore
sql/item_sum.h:
Fixed typo
sql/sql_base.cc:
Don't update table and index statics for temporary tables
sql/sys_vars.cc:
Merge
storage/innobase/dict/dict0stats.cc:
Fixed type last_update to TIMESTAMP.
-rw-r--r-- | mysql-test/r/connect.result | 12 | ||||
-rw-r--r-- | sql/item_sum.h | 4 | ||||
-rw-r--r-- | sql/sql_base.cc | 12 | ||||
-rw-r--r-- | sql/sys_vars.cc | 10 | ||||
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 14 | ||||
-rw-r--r-- | storage/innobase/dict/dict0stats.cc | 8 |
6 files changed, 27 insertions, 33 deletions
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index ec9a5ffd1c1..a6a26643c49 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -15,15 +15,11 @@ host index_stats innodb_index_stats innodb_table_stats -ndb_binlog_index plugin proc procs_priv proxies_priv servers -slave_master_info -slave_relay_log_info -slave_worker_info slow_log table_stats tables_priv @@ -57,15 +53,11 @@ host index_stats innodb_index_stats innodb_table_stats -ndb_binlog_index plugin proc procs_priv proxies_priv servers -slave_master_info -slave_relay_log_info -slave_worker_info slow_log table_stats tables_priv @@ -107,15 +99,11 @@ host index_stats innodb_index_stats innodb_table_stats -ndb_binlog_index plugin proc procs_priv proxies_priv servers -slave_master_info -slave_relay_log_info -slave_worker_info slow_log table_stats tables_priv diff --git a/sql/item_sum.h b/sql/item_sum.h index 1c692014652..40a28d8beae 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1073,7 +1073,7 @@ public: enum Sumfunctype sum_func () const {return MIN_FUNC;} bool add(); - const char *func_name() const { return "MY_MIN("; } + const char *func_name() const { return "min("; } Item *copy_or_same(THD* thd); }; @@ -1086,7 +1086,7 @@ public: enum Sumfunctype sum_func () const {return MAX_FUNC;} bool add(); - const char *func_name() const { return "MY_MAX("; } + const char *func_name() const { return "max("; } Item *copy_or_same(THD* thd); }; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e1a87138656..468cb4d9c46 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2360,18 +2360,6 @@ void close_temporary(TABLE *table, bool free_share, bool delete_table) DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", table->s->db.str, table->s->table_name.str)); - /* - in_use is not set for replication temporary tables during shutdown. - - table->file->get_table() could not be set for ALTER table - when we do not open it in engine. - */ - if (table->file->get_table() && table->in_use) - { - table->file->update_global_table_stats(); - table->file->update_global_index_stats(); - } - free_io_cache(table); closefrm(table, 0); if (delete_table) diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index d87c877ea6d..cd69bdad5df 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -320,6 +320,16 @@ static Sys_var_long Sys_pfs_digest_size( DEFAULT(-1), BLOCK_SIZE(1)); +static Sys_var_long Sys_pfs_connect_attrs_size( + "performance_schema_session_connect_attrs_size", + "Size of session attribute string buffer per thread." + " Use 0 to disable, -1 for automated sizing.", + PARSED_EARLY READ_ONLY + GLOBAL_VAR(pfs_param.m_session_connect_attrs_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024), + DEFAULT(-1), + BLOCK_SIZE(1)); + #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ static Sys_var_ulong Sys_auto_increment_increment( diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 8e111645880..0e308aa9ec4 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -5926,9 +5926,17 @@ dict_table_schema_check( return(DB_ERROR); } - /* check mtype for exact match */ - if (req_schema->columns[i].mtype != table->cols[j].mtype) { - + /* + check mtype for exact match. + This check is relaxed to allow use to use TIMESTAMP + (ie INT) for last_update instead of DATA_BINARY. + We have to test for both values as the innodb_table_stats + table may come from MySQL and have the old type. + */ + if (req_schema->columns[i].mtype != table->cols[j].mtype && + !(req_schema->columns[i].mtype == DATA_INT && + table->cols[j].mtype == DATA_FIXBINARY)) + { ut_snprintf(errstr, errstr_sz, "Column %s in table %s is %s " "but should be %s (type mismatch).", diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index ff7e1ce642c..ed10525b07d 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -175,8 +175,8 @@ dict_stats_persistent_storage_check( {"table_name", DATA_VARMYSQL, DATA_NOT_NULL, 192}, - {"last_update", DATA_FIXBINARY, - DATA_NOT_NULL, 4}, + {"last_update", DATA_INT, + DATA_NOT_NULL | DATA_UNSIGNED, 4}, {"n_rows", DATA_INT, DATA_NOT_NULL | DATA_UNSIGNED, 8}, @@ -206,8 +206,8 @@ dict_stats_persistent_storage_check( {"index_name", DATA_VARMYSQL, DATA_NOT_NULL, 192}, - {"last_update", DATA_FIXBINARY, - DATA_NOT_NULL, 4}, + {"last_update", DATA_INT, + DATA_NOT_NULL | DATA_UNSIGNED, 4}, {"stat_name", DATA_VARMYSQL, DATA_NOT_NULL, 64*3}, |