Why is the database name showing up under the TABLE_SCHEMA and not the TABLE_CATALOG? I
was very surprised when I ran the below query against the tables information_schema:
mysql> select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE from
> information_schema.tables where table_name like 'cat%';
+---------------+--------------+------------+------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE |
+---------------+--------------+------------+------------+
| NULL | test | cat | BASE TABLE |
| NULL | test | cattest | BASE TABLE |
| NULL | test | catview | VIEW |
+---------------+--------------+------------+------------+
3 rows in set (0.01 sec)
I expected test to appear as the TABLE_CATALOG and NULL to appear as the schema.
I didn't think MySQL had the concept of a "schema" for example with SQL Server you can
have a database (or Catalog) called "accounts" and within it have two tables
user1.employees and user2.employees, where user1 and user2 are the schema's.
Since MySQL tables are db.tablename this seems to indicate that the result set would have
db returned as the catalog and nothing as the schema.
Is this correct behavior?
-Barb.