Bug #35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
Submitted: 19 Mar 2008 8:38 Modified: 12 Nov 2009 19:23
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.1.23-rc, 5.0.56 OS:Any
Assigned to: Sergei Glukhov CPU Architecture:Any

[19 Mar 2008 8:38] Konstantin Osipov
Description:
MySQL does have 1 default catalog called "def".
This catalog is sent to the client in field metadata:

mysql> select distinct information_schema.tables.table_catalog from information_schema.tables;
Field   1:  `table_catalog`
Catalog:    `def`
Database:   ``
Table:      `tables`
Org_table:  ``
Type:       VAR_STRING
Collation:  latin1_swedish_ci (8)
Length:     512
Max_length: 0
Decimals:   0
Flags:      NUM 

+---------------+
| table_catalog |
+---------------+
| NULL          | 
+---------------+
1 row in set (0.00 sec)

However, it is not set when selecting the catalog from INFORMATION_SCHEMA.

How to repeat:
 select distinct information_schema.tables.table_catalog from information_schema.tables;

Suggested fix:
Return "def" as a result of the query above.
[19 Mar 2008 9:07] Valeriy Kravchuk
Thank you for a bug report.
[28 Mar 2008 16:15] Peter Gulutzan
The fact that this column is NULL is documented in the MySQL Reference Manual
http://dev.mysql.com/doc/refman/6.0/en/tables-table.html
[29 Mar 2008 21:59] Valeriy Kravchuk
If this is not a bug formally, then it is a feature request.
[16 Jan 2009 12:58] 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/commits/63445

2968 Sergey Glukhov	2009-01-16
      Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
      the fix: 
      set 'def' value for fields listed below
      
      schemata, tables, columns, statistics, views, user_privileges,
      schema_privileges, table_privileges, column_privileges
        TABLE_CATALOG
      events
        EVENT_CATALOG
      routines
        ROUTINE_CATALOG
      table_constraints
        CONSTRAINT_CATALOG
      key_column_usage
        CONSTRAINT_CATALOG, TABLE_CATALOG
      triggers
       TRIGGER_CATALOG,EVENT_OBJECT_CATALOG
      parameters
        SPECIFIC_CATALOG
      referential_constraints
        CONSTRAINT_CATALOG, UNIQUE_CONSTRAINT_CATALOG
      partitions
        TABLE_CATALOG
      files
        TABLE_CATALOG
[17 Feb 2009 10:14] 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/commits/66609

3052 Sergey Glukhov	2009-02-17
      additional fix for Bug#35427
[17 Feb 2009 15:46] 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/commits/66679

3054 Matthias Leich	2009-02-17
      Post fix for Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def
      gluh: sql/sql_show.cc
      mleich: Adjustments in tests
[19 Feb 2009 13:03] Bugs System
Pushed into 6.0.10-alpha (revid:sergey.glukhov@sun.com-20090218125737-5y5b2xo3duo1wlvo) (version source revid:matthias.leich@sun.com-20090217154740-kn2dxe6nhvhwirft) (merge vers: 6.0.10-alpha) (pib:6)
[20 Feb 2009 20:44] Paul DuBois
Noted in 6.0.10 changelog.

Columns that provide a catalog value in INFORMATION_SCHEMA tables
(for example, TABLES.TABLE_CATALOG) now have a value of def rather
than NULL.
[26 Oct 2009 8:34] 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/commits/88111

2920 Sergey Glukhov	2009-10-26
      Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
      additional fix(Betony)
     @ mysql-test/suite/funcs_1/r/is_user_privileges.result
        Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
        additional fix(Betony)
     @ mysql-test/suite/funcs_1/t/is_user_privileges.test
        Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
        additional fix(Betony)
[31 Oct 2009 8:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091031081410-qkxmjsdzjmj840aq) (version source revid:sergey.glukhov@sun.com-20091026074042-xsihxmt2sum705tp) (merge vers: 6.0.14-alpha) (pib:13)
[31 Oct 2009 17:45] Paul DuBois
Already fixed in earlier 6.0.x.

Setting report to NDI pending push to 5.5.x.
[12 Nov 2009 8:16] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:mikael@mysql.com-20091102100915-a2nbfxaqprpgptfw) (merge vers: 5.5.0-beta) (pib:13)
[12 Nov 2009 19:23] Paul DuBois
Noted in 5.5.0 changelog.
[26 Jul 2010 18:36] krunal prajapati
Hi all