| Bug #69990 | CREATE_TIME and UPDATE_TIME are wrong for partitioned tables | ||
|---|---|---|---|
| Submitted: | 12 Aug 2013 7:22 | Modified: | 8 May 2015 15:32 |
| Reporter: | Justin Swanhart | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Information schema | Severity: | S1 (Critical) |
| Version: | 5.6.13 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[12 Aug 2013 7:22]
Justin Swanhart
[12 Aug 2013 12:10]
MySQL Verification Team
Hello Justin, Thank you for the bug report and the test case. Verified as described. Thanks, Umesh
[12 Aug 2013 12:12]
MySQL Verification Team
Also, INFORMATION_SCHEMA PARTITIONS Table too doesn't show CREATE_TIME and UPDATE_TIME for partitioned tables.
// 5.6.13
mysql> select distinct table_name,CREATE_TIME, UPDATE_TIME, CHECK_TIME from information_schema.partitions where table_schema='test'
-> ;
+------------+---------------------+-------------+------------+
| table_name | CREATE_TIME | UPDATE_TIME | CHECK_TIME |
+------------+---------------------+-------------+------------+
| animals | 2013-08-12 17:06:07 | NULL | NULL |
| car_read | NULL | NULL | NULL |
| cust_car | 2013-08-12 17:20:18 | NULL | NULL |
+------------+---------------------+-------------+------------+
3 rows in set (0.01 sec)
mysql> select table_name,CREATE_TIME, UPDATE_TIME, CHECK_TIME from information_schema.partitions where table_schema='test';
+------------+---------------------+-------------+------------+
| table_name | CREATE_TIME | UPDATE_TIME | CHECK_TIME |
+------------+---------------------+-------------+------------+
| animals | 2013-08-12 17:06:07 | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| car_read | NULL | NULL | NULL |
| cust_car | 2013-08-12 17:20:18 | NULL | NULL |
+------------+---------------------+-------------+------------+
18 rows in set (0.02 sec)
[8 May 2015 15:32]
Jon Stephens
Documented fix in the 5.5.44 and 5.6.25 changelogs as follows:
The CREATE_TIME column of the INFORMATION_SCHEMA.TABLES table
now shows the correct table creation time for partitioned InnoDB
tables. The CREATE_TIME column of the
INFORMATION_SCHEMA.PARTITIONS table now shows the correct
partition creation time for a partition of partitioned InnoDB
tables.
Documented fix in the 5.7.8 changelog as above, plus the following:
The UPDATE_TIME column of the INFORMATION_SCHEMA.TABLES table
now shows when a partitioned InnoDB table was last updated by an
INSERT, DELETE, or UPDATE. The UPDATE_TIME column of the
INFORMATION_SCHEMA.PARTITIONS table now shows when a partition
of a partitioned InnoDB table was last updated.
Also updated the descriptions of the affected INFORMATION_SCHEMA table columns.
Closed.
[23 Jun 2015 13:57]
Laurynas Biveinis
commit 232d8bbdb165260ba8eca51565067a93659bea6f
Author: aditya <aditya.a@oracle.com>
Date: Mon Apr 6 12:27:12 2015 +0530
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.
commit 195062883527917fc50c6fba5aaed201b8fe4446
Author: aditya <aditya.a@oracle.com>
Date: Tue Apr 7 09:56:28 2015 +0530
Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE WRONG FOR PARTITIONED TABLES
Posty push fix for test case
[9 Apr 2019 14:48]
Manuel RODRIGUEZ
Crete and modified times are necessary also for views, but in microseconds because running a script can create more than 6 views in the same second. Thanks.
