-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for the crash in pre_transform_target_entry (#1931)
This pull request fix the crash is `pre_transform_target_entry` for queries that involves DELETE ... OUTPUT with JOIN statement. For the delete queries with join statement, the `res->location` will be passed zero. This causes server to crash as the value of `last_dot` pointer has never been computed. This commit implements a check which first computed whether the `res->location` is correct or not and then further proceed to find original identifier. Task: BABEL-4484 Signed-off-by: Riya Jain <[email protected]>
- Loading branch information
1 parent
d41258d
commit 5865f45
Showing
8 changed files
with
82 additions
and
8 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,8 @@ | ||
DROP TABLE test_babel_4484_t1; | ||
GO | ||
|
||
DROP TABLE test_babel_4484_t2; | ||
GO | ||
|
||
DROP TABLE test_babel_4484_t3; | ||
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,8 @@ | ||
CREATE TABLE test_babel_4484_t1(ABC int, ced varchar(10)); | ||
GO | ||
|
||
CREATE TABLE test_babel_4484_t2(ABC int, 您您 varchar(10)); | ||
GO | ||
|
||
CREATE TABLE test_babel_4484_t3(ABC int, 您您对您对您对您对您对您对您对您对您对您您您 int); | ||
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,28 @@ | ||
SELECT set_config('babelfishpg_tsql.enable_sll_parse_mode', 'true', false); | ||
GO | ||
~~START~~ | ||
text | ||
on | ||
~~END~~ | ||
|
||
|
||
DELETE test_babel_4484_t1 OUTPUT test_babel_4484_t1.ced FROM test_babel_4484_t1 INNER JOIN test_babel_4484_t2 ON test_babel_4484_t1.ABC = test_babel_4484_t2.ABC WHERE test_babel_4484_t1.ABC = 1; | ||
GO | ||
~~START~~ | ||
varchar | ||
~~END~~ | ||
|
||
|
||
DELETE test_babel_4484_t2 OUTPUT test_babel_4484_t2.您您 FROM test_babel_4484_t2 INNER JOIN test_babel_4484_t3 ON test_babel_4484_t2.ABC = test_babel_4484_t3.ABC WHERE test_babel_4484_t2.ABC = 1; | ||
GO | ||
~~START~~ | ||
varchar | ||
~~END~~ | ||
|
||
|
||
SELECT test_babel_4484_t1.ced FROM test_babel_4484_t1 INNER JOIN test_babel_4484_t2 ON test_babel_4484_t1.ABC = test_babel_4484_t2.ABC WHERE test_babel_4484_t1.ABC = 1; | ||
GO | ||
~~START~~ | ||
varchar | ||
~~END~~ | ||
|
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,8 @@ | ||
DROP TABLE test_babel_4484_t1; | ||
GO | ||
|
||
DROP TABLE test_babel_4484_t2; | ||
GO | ||
|
||
DROP TABLE test_babel_4484_t3; | ||
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,8 @@ | ||
CREATE TABLE test_babel_4484_t1(ABC int, ced varchar(10)); | ||
GO | ||
|
||
CREATE TABLE test_babel_4484_t2(ABC int, 您您 varchar(10)); | ||
GO | ||
|
||
CREATE TABLE test_babel_4484_t3(ABC int, 您您对您对您对您对您对您对您对您对您对您您您 int); | ||
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,11 @@ | ||
SELECT set_config('babelfishpg_tsql.enable_sll_parse_mode', 'true', false); | ||
GO | ||
|
||
DELETE test_babel_4484_t1 OUTPUT test_babel_4484_t1.ced FROM test_babel_4484_t1 INNER JOIN test_babel_4484_t2 ON test_babel_4484_t1.ABC = test_babel_4484_t2.ABC WHERE test_babel_4484_t1.ABC = 1; | ||
GO | ||
|
||
DELETE test_babel_4484_t2 OUTPUT test_babel_4484_t2.您您 FROM test_babel_4484_t2 INNER JOIN test_babel_4484_t3 ON test_babel_4484_t2.ABC = test_babel_4484_t3.ABC WHERE test_babel_4484_t2.ABC = 1; | ||
GO | ||
|
||
SELECT test_babel_4484_t1.ced FROM test_babel_4484_t1 INNER JOIN test_babel_4484_t2 ON test_babel_4484_t1.ABC = test_babel_4484_t2.ABC WHERE test_babel_4484_t1.ABC = 1; | ||
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 |
---|---|---|
|
@@ -473,3 +473,4 @@ sys_asymmetric_keys | |
sys_certificates | ||
sys_database_permissions | ||
BABEL-4279 | ||
BABEL-4484 |