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

sp_tables procedure returns empty results when table_type is escaped twice #11

Closed
staticlibs opened this issue Mar 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@staticlibs
Copy link
Contributor

The following query (taken from real-life application):

EXEC sp_tables NULL, NULL, NULL, '''''''SYSTEM TABLE'''',''''TABLE'''',''''VIEW'''''''

returns correct results in MSSQL, but returns empty results in Babelfish.

This query is likely originates from mssql-jdbc implementation of JDBC getTables method. Empty result from sp_tables call does not allow table introspection to work.

Note, that @table_type parameter to sp_tables in this case is quote-escaped twice by the client app. Normal single quote-escaping works correctly in Babelfish:

EXEC sp_tables NULL, NULL, NULL, '''SYSTEM TABLE'',''VIEW'',''TABLE'''
@staticlibs staticlibs added the bug Something isn't working label Mar 1, 2024
@staticlibs
Copy link
Contributor Author

The fix to this is included with release 3.3-4-9-1, closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant