forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue of preserving case of column names in SELECT corrname.c…
…olname and Fix the issue of preserving case of column names in SELECT corrname.colname. (babelfish-for-postgresql#1941) This commit fix preserving the original case spelling of column names while selecting named column with a correlation name. It also fix the crash is pre_transform_target_entry for queries that involves DELETE ... OUTPUT with JOIN statement. Issue 1: When selecting named column with a correlation name, the lowercase spelling is always returned. The case of column name is not preserved. For instance, select ABC from table, here ABC is the column name. In this case column name becomes down cased. To address this issue, We've made some code modifications to ensure that the column name is handled correctly, whether it's truncated or its case needs to be preserved. Issue 2: For the delete queries with join statement, somehow the res->location is not processed correctly. This causes server to crash as the value of last_dot pointer has never been computed. In this commit, we implemented a check which first computed whether the res->location is correct or not and then further proceed with the code. Task: BABEL-4279, BABEL-4484 Signed-off-by: Riya Jain <[email protected]>
- Loading branch information
1 parent
6f64310
commit 3b93f27
Showing
16 changed files
with
825 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-- tsql | ||
DROP VIEW test_babel_4279_v1; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v2; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v3; | ||
GO | ||
|
||
DROP TABLE test_babel_4279_t1; | ||
GO | ||
|
||
USE [test_babel_4279_d.1]; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_sv1; | ||
GO | ||
|
||
DROP TABLE test_babel_4279_s1.test_babel_4279_st1; | ||
GO | ||
|
||
DROP SCHEMA test_babel_4279_s1; | ||
GO | ||
|
||
USE MASTER; | ||
GO | ||
|
||
DROP DATABASE [test_babel_4279_d.1]; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v4; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v5; | ||
GO | ||
|
||
DROP TABLE test_babel_4279_t2; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v6; | ||
GO | ||
|
||
DROP TABLE "tngdf'".[sc,sdg"fdsngjds']; | ||
GO | ||
|
||
DROP SCHEMA "tngdf'"; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v7; | ||
GO | ||
|
||
DROP TABLE test_babel_4279_t3; | ||
GO | ||
|
||
DROP VIEW test_babel_4279_v8; | ||
GO | ||
|
||
DROP TABLE test_babel_4279_t4; | ||
GO |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-- tsql | ||
CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v1 AS SELECT test_babel_4279_t1.[ABC.nfds] from test_babel_4279_t1; | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v2 AS SELECT [test_babel_4279_t1].[ABC.nfds] ,test_babel_4279_t1.[DEf.j] from test_babel_4279_t1; | ||
GO | ||
|
||
CREATE DATABASE [test_babel_4279_d.1]; | ||
GO | ||
|
||
USE [test_babel_4279_d.1]; | ||
GO | ||
|
||
CREATE SCHEMA test_babel_4279_s1; | ||
GO | ||
|
||
CREATE TABLE test_babel_4279_s1.test_babel_4279_st1([ABC.nfds] INT, [DEf.j] INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_sv1 AS SELECT [test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from test_babel_4279_s1.test_babel_4279_st1; | ||
GO | ||
|
||
USE MASTER | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v3 AS SELECT [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1]; | ||
GO | ||
|
||
CREATE TABLE test_babel_4279_t2(您您对您对您对您对您对您对您对您对您对您您您 INT, 对您对您对您对您对您对您对您 INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v4 AS SELECT test_babel_4279_t2.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2; | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v5 AS SELECT ぁあ.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2 AS ぁあ; | ||
GO | ||
|
||
CREATE SCHEMA "tngdf'"; | ||
GO | ||
|
||
CREATE TABLE "tngdf'".[sc,sdg"fdsngjds']("AB[C" INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v6 AS SELECT "tngdf'".[sc,sdg"fdsngjds']."AB[C" from "tngdf'".[sc,sdg"fdsngjds']; | ||
GO | ||
|
||
CREATE TABLE test_babel_4279_t3(ABCD INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v7 AS SELECT test_babel_4279_t3.ABCD FROM test_babel_4279_t3; | ||
GO | ||
|
||
CREATE TABLE test_babel_4279_t4([ぁあ'"] INT); | ||
GO | ||
|
||
CREATE VIEW test_babel_4279_v8 AS SELECT test_babel_4279_t4.[ぁあ'"] FROM test_babel_4279_t4; | ||
GO |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
-- psql | ||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v1'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds"<newline> FROM master_dbo.test_babel_4279_t1; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v2'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds",<newline> test_babel_4279_t1."def.j" AS "DEf.j"<newline> FROM master_dbo.test_babel_4279_t1; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_sv1'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds"<newline> FROM "test_babel_4279_d.1_test_babel_4279_s1".test_babel_4279_st1; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v3'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds"<newline> FROM "test_babel_4279_d.1_test_babel_4279_s1".test_babel_4279_st1; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v4'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_t2."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de"<newline> FROM master_dbo.test_babel_4279_t2; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v5'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT "ぁあ"."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de"<newline> FROM master_dbo.test_babel_4279_t2 "ぁあ"; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v6'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT "sc,sdg""fdsngjds'"."ab[c" AS "AB[C"<newline> FROM "master_tngdf'"."sc,sdg""fdsngjds'"; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v7'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_t3.abcd AS "ABCD"<newline> FROM master_dbo.test_babel_4279_t3; | ||
~~END~~ | ||
|
||
|
||
SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v8'; | ||
GO | ||
~~START~~ | ||
text | ||
SELECT test_babel_4279_t4."ぁあ'"""<newline> FROM master_dbo.test_babel_4279_t4; | ||
~~END~~ | ||
|
Oops, something went wrong.