forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '\' as ESCAPE character for sp_columns_100 for LIKE operator (bab…
…elfish-for-postgresql#2935) There are few occurrences where we use procedure sp_columns_100 to fetch column metadata. The issue with this procedure is, when the table name contains _ character, we may obtain some unexpected output. This is because in some places we are using using sp_columns_100 incorrectly with a backslash escaping underscores (e.g. “\_“). Underscores are wildcards in sp_columns_100 (and in LIKE in general), but sp_columns_100 does not use a backslash as an escape character. Till now, sp_columns_100 , was invoking a plpgsql function sp_column_100_internal which used PG’s SIMILAR TO to operator, which does use a backslash as the default escape character. With BABEL-4953, we have updated the definition of sp_columns_100 where we removed redundant function call and implemented the procedure by using TSQL LIKE operator on column name, which will create some problems in other places. The change in the new version is correct. However, since currently we rely on the incorrect functionality of the escape characters, we are making this temporary change for now. Once, we have fixed the dependencies on this procedure, we need to revert it. Signed-off-by: Shameem Ahmed <[email protected]>
- Loading branch information
1 parent
77ab175
commit 0ba8d35
Showing
4 changed files
with
164 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters