-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support empty double-quoted string in SQL object body (#3121)
This fixes the long-standing bug that a reference to a double-quoted empty string, when located in the body of a procedure, function or trigger, raises an error even though QUOTED_IDENTIFIER is OFF. This is due to the PG backend interpreting any double-quoted string as an identifier, whose length cannot be zero. It is fixed by replacing "" by '' at the ANTLR stage. Signed-off-by: Rob Verschoor <[email protected]>
- Loading branch information
1 parent
aed2667
commit 6e9a934
Showing
7 changed files
with
1,028 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
test/JDBC/expected/empty_dq_string_in_object-vu-cleanup.out
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,58 @@ | ||
drop table t1_empty_dq_string | ||
go | ||
drop table t2_empty_dq_string | ||
go | ||
drop table t3_empty_dq_string | ||
go | ||
drop table t4_empty_dq_string | ||
go | ||
drop table t5_empty_dq_string | ||
go | ||
drop table t6_empty_dq_string | ||
go | ||
drop table t7_empty_dq_string | ||
go | ||
drop procedure p1_empty_dq_string | ||
go | ||
drop function f1_empty_dq_string | ||
go | ||
drop procedure p2_empty_dq_string | ||
go | ||
drop function f2_empty_dq_string | ||
go | ||
drop procedure p2a_empty_dq_string | ||
go | ||
drop function f2a_empty_dq_string | ||
go | ||
drop procedure p2b_empty_dq_string | ||
go | ||
drop procedure p3_empty_dq_string | ||
go | ||
drop procedure p4_empty_dq_string | ||
go | ||
drop function f4_empty_dq_string | ||
go | ||
drop procedure p5_empty_dq_string | ||
go | ||
drop function f5_empty_dq_string | ||
go | ||
drop procedure p6_empty_dq_string | ||
go | ||
drop procedure p7_empty_dq_string | ||
go | ||
drop procedure p7a_empty_dq_string | ||
go | ||
drop procedure p7b_empty_dq_string | ||
go | ||
drop function f7b_empty_dq_string | ||
go | ||
drop procedure p7c_empty_dq_string | ||
go | ||
set quoted_identifier on | ||
go | ||
drop table "t8_empty_dq_string" | ||
go | ||
drop procedure "p8_empty_dq_string" | ||
go | ||
drop function "f8_empty_dq_string" | ||
go |
31 changes: 31 additions & 0 deletions
31
test/JDBC/expected/empty_dq_string_in_object-vu-prepare.out
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,31 @@ | ||
create table t1_empty_dq_string(a int) | ||
go | ||
create table t2_empty_dq_string(a int) | ||
go | ||
create table t3_empty_dq_string(a int) | ||
go | ||
create table t4_empty_dq_string(a int) | ||
go | ||
create table t5_empty_dq_string(a int, b varchar(10)) | ||
insert t5_empty_dq_string values(1, 'test 1') | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
create table t6_empty_dq_string(a int, b varchar(10)) | ||
insert t6_empty_dq_string values(1, 'test 1') | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
create table t7_empty_dq_string(a int, b varchar(10)) | ||
insert t7_empty_dq_string values(1, 'test 1') | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
set quoted_identifier on | ||
go | ||
create table "t8_empty_dq_string"("a" int, "b" varchar(10)) | ||
insert "t8_empty_dq_string" values(1, 'test 1') | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
Oops, something went wrong.