Bug #9317 Wrong count for tables in INFORMATION_SCHEMA
Submitted: 21 Mar 2005 16:57 Modified: 31 Mar 2005 6:25
Reporter: Hakan Kuecuekyilmaz
Status: Closed
Category:Server Severity:S2 (Serious)
Version:5.0.3 OS:Linux (SuSE 9.0)
Assigned to: Sergey Gluhov Target Version:

[21 Mar 2005 16:57] Hakan Kuecuekyilmaz
Description:
Changeset is 1.1829 non-debug-build (BUILD/compile-pentium)

SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'MY1';

+----------+
| count(*) |
+----------+
|     1276 |
+----------+
1 row in set (51.91 sec)

Should be ~14000.

Also 
"SELECT count(*) FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = 'MY1';"
and
"SELECT count(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'MY1';"

gives wrong count.

How to repeat:
Populate a lot of tables and views and try queries.
[23 Mar 2005 4:15] Jorge del Conde
Hi Hakank,

Can you tell me exactly how to reproduce this ? ... i wasn't able to get similar results
to what you expected.
[24 Mar 2005 13:29] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23347
[25 Mar 2005 9:28] Alexander Barkov
Sergey, Ok to push after cosmetic changes in several places:

Please change

      if (schema_table_store_record(thd, table))
        return 1;
      return 0;

to

    return schema_table_store_record(thd, table);

  return
[25 Mar 2005 10:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23370
[25 Mar 2005 12:57] Sergey Gluhov
Fixed in 5.0.4
[31 Mar 2005 6:25] Paul DuBois
Noted in 5.0.4 changelog.