Many relational databases reference CATALOG and SCHEMA in ways
that do not directly correspond to what MySQL refers to as a
database. It is neither a CATALOG nor a SCHEMA. Generally,
catalogs are collections of schemas, so the fully qualified
name would look like
catalog.schema.table.column
.
Historically with MySQL ODBC Driver, CATALOG and DATABASE were
two names used for the same thing. At the same time SCHEMA was
often used as a synonym for a MySQL Database. This would
suggest that CATALOG equals a SCHEMA, which is incorrect, but
in the MySQL Server context they would be the same thing.
In ODBC both schemas and catalogs can be used when referring to database objects such as tables. The expectation on how to interpret these schema and catalog notions differs between developers, which is why both the NO_CATALOG and NO_SCHEMA options exist: to cover all these expectations and allow one to disable interpreting ODBC function parameters as CATALOG or SCHEMA explicitly.
The Connector/ODBC driver does not allow using catalog and schema functionality at the same time because it would cause unsupported naming. However, some software such as MS SQL Server might try do so through the linked server objects. This is why Connector/ODBC 8.0.26 added a NO_SCHEMA option to MySQL ODBC Driver to report schemas as not supported, which is already done for catalogs with the NO_CATALOG option. Using NO_SCHEMA causes the driver to report schema operations unsupported through SQLGetInfo() call. As a result the client software will not attempt to access tables as catalog.schema.table, but instead as catalog.table.
Table 8.1 Connector/ODBC NO_CATALOG and NO_SCHEMA combinations
NO_CATALOG | NO_SCHEMA | Description and notes |
---|---|---|
true |
true |
Driver does not support catalogs nor schemas. |
false |
true |
Catalogs are supported and interpreted as MySQL database names, specifying schema triggers an error. |
true |
false |
Schemas are supported and interpreted as MySQL database names, specifying catalog triggers an error. |
false |
false |
Both catalogs and schemas are supported but it is an error if both are specified at the same time. If only catalog or only schema is specified, it is interpreted as a MySQL database name. |