Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

test: add a complex test case (#2385)

rebelice5cf6eb9118f6
diff --git a/plugin/parser/split_multi_sql_test.go b/plugin/parser/split_multi_sql_test.go
index 5772cba635..77bb264ae2 100644
--- a/plugin/parser/split_multi_sql_test.go
+++ b/plugin/parser/split_multi_sql_test.go
@@ -147,6 +147,25 @@ func TestPGSplitMultiSQL(t *testing.T) {
},
},
},
+ {
+ statement: `INSERT INTO "public"."table"("id","content")
+ VALUES
+ (12,'table column name () { :xna,sydfn,,kasdfyn;}; /////test string/// 0'),
+ (133,'knuandfan public table id\';create table t(a int, b int);set @text=\'\\\\kdaminxkljasdfiebkla.unkonwn\'+\'abcdef.xyz\\\'; local xxxyy.abcddd.mysql @text;------- '),
+ (1444,'table t xyz abc a\'a\\\\\\\\\'b"c>?>xxxxxx%}}%%>c<[[?${12344556778990{%}}cake\\');`,
+ want: resData{
+ res: []SingleSQL{
+ {
+ Text: `INSERT INTO "public"."table"("id","content")
+ VALUES
+ (12,'table column name () { :xna,sydfn,,kasdfyn;}; /////test string/// 0'),
+ (133,'knuandfan public table id\';create table t(a int, b int);set @text=\'\\\\kdaminxkljasdfiebkla.unkonwn\'+\'abcdef.xyz\\\'; local xxxyy.abcddd.mysql @text;------- '),
+ (1444,'table t xyz abc a\'a\\\\\\\\\'b"c>?>xxxxxx%}}%%>c<[[?${12344556778990{%}}cake\\');`,
+ Line: 1,
+ },
+ },
+ },
+ },
{
statement: `INSERT INTO t VALUES ('klajfas)`,
want: resData{