Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatabaseMetaData use of quoted/unquoted identifiers is inconsistent [JDBC231] #280

Closed
firebird-automations opened this issue Jan 27, 2012 · 7 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

Relate to JDBC331

The various metadata methods treat quoted and unquoted identifiers in an inconsistent way. For example getTables() and getColumns() will accept (and even require) quoted identifiers and will uppercase unquoted patterns. On the other hand getIndexInfo() only accepts unquoted identifiers and first tries the table name as is, and then tries it uppercase; using an actual quoted identifier (as accepted by getTables() and getColumns()) will not be accepted.

There is more inconsistent or questionable behaviour surrounding quoted and unquoted identifiers that needs to be investigated and made consistent; for example: should metadata methods return mixed case identifiers quoted or not (and what about identifiers that are equal to reserved (key)words), should mixed case identifiers actually be quoted when passed to the metadata method etc (getTables() specifies that the pattern should conform to the way it is stored in the database: quoted identifiers are stored mixed case without quotes, unquoted identifiers are stored uppercase).

Commits: 211a0be

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue relate to JDBC331 [ JDBC331 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

In Jaybird 3.0 the metadata parameters will be changed to comply with the JDBC specification with regard to case sensitivity, quoting etc. We must be careful for parts of Jaybird itself that relies on the existing case insensitivity.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]

Version: Jaybird 2.2.3 [ 10510 ]

Version: Jaybird 2.2.2 [ 10480 ]

Version: Jaybird 2.2.1 [ 10474 ]

Version: Jaybird 2.2.4 [ 10531 ]

Version: Jaybird 2.2.5 [ 10582 ]

Fix Version: Jaybird 3.0 [ 10440 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Commit: 211a0be

Stricter interpretation of JDBC requirements.

* Patterns are used as is (case sensitive),
* We no longer strip double quotes,
* `null` is always interpreted as `"%"` (or 'all') for pattern,
* Empty string is no longer interpreted as `"%"` (or 'all') unless explicitly allowed by the javadoc,
* Name parameters (non-patterns) no longer strip backslashes,
* We no longer try the uppercase variant if nothing is found.

The exception is the OO protocol which sometimes will try the uppercase variant (this might change in the future).

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment