diff options
author | aditya <aditya.a@oracle.com> | 2015-04-06 12:27:12 +0530 |
---|---|---|
committer | aditya <aditya.a@oracle.com> | 2015-04-06 12:27:12 +0530 |
commit | 232d8bbdb165260ba8eca51565067a93659bea6f (patch) | |
tree | c4ec869f2a0dd8c44c2daf623bd58926d8bcfcb6 /storage/innobase | |
parent | c01d13b1371b58e7ff7509a07d57991fd12e6bca (diff) | |
download | mariadb-git-232d8bbdb165260ba8eca51565067a93659bea6f.tar.gz |
Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE WRONG FOR PARTITIONED TABLES
PROBLEM
Create time is calculated as last status change time of .frm file.
The first problem was that innodb was passing file name as
"table_name#po#p0.frm" to the stat() call which calculates the create time.
Since there is no frm file with this name create_time will be stored as NULL.
The second problem is ha_partition::info() updates stats for create time
when HA_STATUS_CONST flag was set ,where as innodb calculates this statistic
when HA_STATUS_TIME is set,which causes create_time to be set as NULL.
Fix
Pass proper .frm name to stat() call and calculate create time when
HA_STATUS_CONST flag is set.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6ec7586779a..b8ec8f60f28 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8172,17 +8172,6 @@ ha_innobase::info_low( prebuilt->trx->op_info = "returning various info to MySQL"; } - my_snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, ib_table->name, reg_ext); - - unpack_filename(path,path); - - /* Note that we do not know the access time of the table, - nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ - - if (os_file_get_status(path,&stat_info)) { - stats.create_time = (ulong) stat_info.ctime; - } } if (flag & HA_STATUS_VARIABLE) { @@ -8379,6 +8368,20 @@ ha_innobase::info_low( } dict_table_stats_unlock(ib_table, RW_S_LATCH); + + my_snprintf(path, sizeof(path), "%s/%s%s", + mysql_data_home, + table->s->normalized_path.str, + reg_ext); + + unpack_filename(path,path); + + /* Note that we do not know the access time of the table, + nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ + + if (os_file_get_status(path,&stat_info)) { + stats.create_time = (ulong) stat_info.ctime; + } } if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { |