[CONJ-892] getSchemaTerm returns "schema" instead of null or empty value Created: 2021-07-02 Updated: 2023-12-15 Resolved: 2023-12-15 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | metadata |
| Affects Version/s: | 2.5.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Maciek | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
N/A |
||
| Issue Links: |
|
||||||||
| Description |
|
Why return "schema" as preffered term for schema, when schema isn't supported? |
| Comments |
| Comment by Diego Dupin [ 2021-07-05 ] | ||||||||
|
SQL defined catalog and schema. MariaDB doesn't support catalog, using a constant catalog 'def'.
historically in jdbc driver, connection.catalog has been use, while schema is not (connection.getSchema() return null while connection.setSchema() doesn't do any action (and same thing in all metadata methods using catalog and schema). The good use in JDBC driver would be to use schema while not using catalog but there is no need for a radical change in driver while server doesn't have multiple multiple catalogs. mysql driver has a new option since 8.0.17 `databaseTerm` that default using historical catalog, but permiting if set to 'SCHEMA' to change to expected schema, ignoring catalog. One curious thing is returning "CATALOG" for DatabaseMetaData.getCatalogTerm() even if CATALOG is not supported in mysql. getSchemaTerm() change from "" to "SCHEMA" in 2.5 is accurate in term of metadata, but conflict with current historical use. I wonder what would be best. `databaseTerm` option implementation might have interest, correcting metadata accordingly. | ||||||||
| Comment by Diego Dupin [ 2023-12-15 ] | ||||||||
|
MariaDB (and MySQL) "database" term correspond to schema. At some point catalog might even be added. |