[CONJ-1129] Metadata getPrimaryKeys using like in place of strict equality Created: 2023-12-01  Updated: 2023-12-12  Resolved: 2023-12-01

Status: Closed
Project: MariaDB Connector/J
Component/s: metadata
Affects Version/s: None
Fix Version/s: 3.3.2

Type: Bug Priority: Major
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes CONJ-1142 Accessing INFORMATION_ SCHEMA STATIST... Closed

 Description   

created after https://jira.mariadb.org/browse/MDEV-32915.

Javadoc indicate that parameters must be :
Parameters:

  • catalog - a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
  • schema - a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
  • table - a table name; must match the table name as it is stored in the database
    But current implementation does do a pattern equality, so TABLE LIKE '<table>'. Table containing "_" will then do a pattern matching search in place of equality

At the same time, query can be improved, using INFORMATION_SCHEMA.STATISTICS table only. INFORMATION_SCHEMA.COLUMNS is redondant, since we can rely on INDEX_NAME='PRIMARY' to identify primary keys (user cannot create a non primary index with name 'PRIMARY')


Generated at Thu Feb 08 03:20:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.