Bug #64914 Update_time is NULL for InnoDB tables
Submitted: 9 Apr 2012 9:00 Modified: 15 Sep 2014 5:16
Reporter: xiaobin lin (OCA) Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, table status, Update_time

[9 Apr 2012 9:00] xiaobin lin
This is duplicated with http://bugs.mysql.com/bug.php?id=14374

I think for tables that are created under innodb_file_per_table mode, we can simply get the mtime of the ibd file, and fill into the result of "show table status"

How to repeat:
show table status like 'innodb table';

Suggested fix:

> 		if (ib_table->space != TRX_SYS_SYSTEM_RSEG_ID)
>		{
>			my_snprintf(path, sizeof(path), "%s/%s%s",
>				mysql_data_home, ib_table->name, ha_innobase_exts[0]);
>			unpack_filename(path,path);
>			if (os_file_get_status(path,&stat_info)) {
>				stats.update_time = (ulong) stat_info.mtime;
>			}
>		}
[9 Apr 2012 19:15] Valeriy Kravchuk
Thank you for the feature request and code contributed.
[15 Sep 2014 5:14] Marko Mäkelä
Posted by developer:
WL#6658 implemented update_time for InnoDB tables.
Note that it is not persistent across server restarts.
WL#6917 was filed for making update_time persistent.
[15 Sep 2014 5:16] Marko Mäkelä
This is a duplicate of

Bug#14374 Update_time is NULL for InnoDB tables

The bug was fixed in MySQL 5.7.2.