Bug #47697 | Inconsistencies in the query outputs on INFORMATION_SCHEMA.TABLES. | ||
---|---|---|---|
Submitted: | 29 Sep 2009 6:19 | Modified: | 29 Sep 2009 6:56 |
Reporter: | Ritheesh Vedire | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Information schema | Severity: | S2 (Serious) |
Version: | 5.1.39 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[29 Sep 2009 6:19]
Ritheesh Vedire
[29 Sep 2009 6:56]
Valeriy Kravchuk
Verified with 5.1.39 on Windows: mysql> select * from information_schema.tables where table_schema='test' and eng ine is NULL\G *************************** 1. row *************************** TABLE_CATALOG: NULL TABLE_SCHEMA: test TABLE_NAME: t1 TABLE_TYPE: BASE TABLE ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULL MAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULL TABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: Unknown table engine 'MYYYYY' *************************** 2. row *************************** TABLE_CATALOG: NULL TABLE_SCHEMA: test TABLE_NAME: t3 TABLE_TYPE: BASE TABLE ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULL MAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULL TABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: Can't find file: 't3' (errno: 2) 2 rows in set (0.00 sec) mysql> select table_name from information_schema.tables where table_schema='test ' and engine is NULL; Empty set (0.02 sec) mysql> select version(); +------------------+ | version() | +------------------+ | 5.1.39-community | +------------------+ 1 row in set (0.03 sec) So, we have clear inconsistency. In the test database above t2 is MyISAM table. t1 was MyISAM with the same structure as t2, but with MyISAM replaced by MYYYY in the .frm file. For t3 the t2.frm file was copied with the name t3.frm, but no t3.MYD or t3.MYI files are present: mysql> show create table t1\G ERROR 1286 (42000): Unknown table engine 'MYYYYY' mysql> show create table t2\G *************************** 1. row *************************** Table: t2 Create Table: CREATE TABLE `t2` ( `c1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 1 row in set (0.00 sec) mysql> show create table t3\G ERROR 1017 (HY000): Can't find file: 't3' (errno: 2)
[27 Oct 2009 12:38]
Ritheesh Vedire
Out of the outputs generated by SELECT * and SELECT <table_name> which of them is the correct one?
[5 Nov 2015 10:35]
Jean Weisbuch
I am hitting the same bug on 5.5.46 : * SELECT * FROM information_schema.tables WHERE table_type='VIEW' AND table_comment LIKE '%invalid%'; => Takes 3 minutes and returns 5 rows containing invalid VIEWs on different databases * SELECT table_schema, table_name FROM information_schema.tables WHERE table_type='VIEW' AND table_comment LIKE '%invalid%'; => Takes 40 seconds and returns 0 rows and 28 warnings but "SHOW WARNINGS" only returns 2 rows of invalid views on the database in USE for this query