[ODBC-298] Make "MS Access" behavior of SQLTables default Created: 2020-12-11  Updated: 2023-04-14  Resolved: 2022-02-14

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.10
Fix Version/s: 3.2.0, 3.1.16

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by ODBC-329 Wrong Result from SQLTables Closed
Relates
relates to ODBC-297 Listing a Database with name fem also... Closed

 Description   

Currently in case of NULL catalog name, SQLTables returns tables from all databases. That was our interpretation of specs, but it happens to be incorrect. That is already changed for MS Access - tables for currently selected DB are returned only, and should become a default behavior.



 Comments   
Comment by Lawrin Novitsky [ 2022-02-13 ]

Since this behavior is changed back and forth from version to version, it's probably better to make it optional, and leave current behavior default in current(3.1) series, and new/old one to be default in the next(3.2) series.

Comment by Lawrin Novitsky [ 2022-02-13 ]

Current behavior is justified by this:
https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/arguments-in-catalog-functions says, that SQLTables arguments are pattern values, and if you follow the link for pattern values description https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/pattern-value-arguments, you can read there "Passing a null pointer to a search pattern argument does not constrain the search for that argument; that is, a null pointer and the search pattern % (any characters) are equivalent.". This quote suggests, that our (current) interpretation is correct, and have the right to stay at least as optional. Especially since it was in all 3.1 ga releases.

Comment by Lawrin Novitsky [ 2022-02-14 ]

The option NULLISCURRENT has been added. If it's set, new(that also happens to be old) behavior is enforced, and NULL catalog value is treated as "currently selected schema". Otherwise NULL means "any schema" as it is now. I'll probably give another think what should be the default for this option in the 3.2. Changing behavior back and forth is not the best idea as well.

Comment by Lawrin Novitsky [ 2023-04-14 ]

"NULL catalog parameter means current schema" has been made default behavior in 3.2.0

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