Skip to content

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

@staticlibs

Description

@staticlibs

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'''

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions