SHOW TABLE STATUS only shows tables after SHOW CREATE TABLE

Bug #622472 reported by Hartmut Holzgraefe on 2010-08-22
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Won't Fix
Low
Andrew Hutchings
7.0
Won't Fix
Low
Andrew Hutchings

Bug Description

drizzle> create table t1(id int primary key);
Query OK, 0 rows affected (0 sec)

drizzle> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t1 |
+----------------+
1 row in set (0 sec)

drizzle> show table status;
Empty set (0 sec)

drizzle> show create table t1;
+-------+---------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
  `id` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB COLLATE = utf8_general_ci |
+-------+---------------------------------------------------------------------------------------------------------+
1 row in set (0 sec)

drizzle> show table status;
+---------+--------+------+----------+--------+---------+------+----------------+------------+----------------+
| Session | Schema | Name | Type | Engine | Version | Rows | Avg_row_length | Table_size | Auto_increment |
+---------+--------+------+----------+--------+---------+------+----------------+------------+----------------+
| 0 | test | t1 | STANDARD | InnoDB | 1 | 1 | 6 | 16384 | 0 |
+---------+--------+------+----------+--------+---------+------+----------------+------------+----------------+
1 row in set (0 sec)

Test case added in the "broken" suite of my linked branch, run with

   cd tests; ./test-run --suite=broken show_table_status_bug_lp622472

Current result:

  broken.show_table_status_bug_lp622472 [ fail ]
  --- /home/hartmut/projects/drizzle/bzr/drizzle-bug622472/tests/suite/broken/r/show_table_status_bug_lp622472.result 2010-08-23 17:12:27.000000000 +0300
  +++ /home/hartmut/projects/drizzle/bzr/drizzle-bug622472/tests/suite/broken/r/show_table_status_bug_lp622472.reject 2010-08-23 18:31:35.000000000 +0300
  @@ -4,7 +4,6 @@
   CREATE TABLE t1 (id INT PRIMARY KEY);
   SHOW TABLE STATUS LIKE 't1';
   Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
-0 test t1 STANDARD InnoDB 1 1 6 16384 0
   SHOW CREATE TABLE t1;
   Table Create Table
   t1 CREATE TABLE `t1` (

  drizzletest: Result content mismatch

Changed in drizzle:
assignee: nobody → Andrew Hutchings (linuxjedi)
Andrew Hutchings (linuxjedi) wrote :

I don't think it is possible to fix this without poisoning the table cache (I believe that is how MySQL solves it).

Basically 'show table status' scans for tables already in the cache and gives results for those.

Andrew Hutchings (linuxjedi) wrote :

From Brian:

I would leave it as is, and document. (I seem to remember that Innodb won't give good results unless the table has been in use)
For Inno you need to do a table scane to get all of hose.

Closing as Won't Fix. On my list to be documented when documentation project starts.

Changed in drizzle:
status: Confirmed → Won't Fix
milestone: 2010-09-13 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers