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 /storage | |
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.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 14 | ||||
-rw-r--r-- | storage/innobase/dict/dict0stats.cc | 8 |
2 files changed, 15 insertions, 7 deletions
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}, |