Skip to content

Commit 1619805

Browse files
fix: fix delimiter parsing (#28)
1 parent 56d8911 commit 1619805

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/Tests/PostgresqlQueryParserTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ LANGUAGE PLPGSQL AS
4747
'text';
4848
SELECT '1'
4949
""", 2)]
50+
[InlineData("""
51+
START TRANSACTION;
52+
53+
DO $EF$
54+
BEGIN
55+
INSERT INTO "AspNetUsers" ("Id", "UserName")
56+
VALUES ('65fe2157-3214-4de5-8664-2648b67c530e', 'John');
57+
END $EF$;
58+
59+
DO $EF$
60+
BEGIN
61+
INSERT INTO "AspNetUsers" ("Id", "UserName")
62+
VALUES ('7cc03149-09e9-42eb-9554-d3ce3bed15bd', 'Jane');
63+
END $EF$;
64+
65+
COMMIT;
66+
""", 4)]
5067
public void split_into_statements(string sql, int statementCount, params string[] expected)
5168
{
5269
var results = ParseCommand(sql);

src/dbup-postgresql/PostgresqlQueryParser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ public static IReadOnlyCollection<string> ParseRawQuery(
239239
goto Finish;
240240
}
241241

242-
pos += dollarTagEnd + 1; // If the substring is found adjust the position to be relative to the entire string
243242
currCharOfs = pos + dollarTagEnd - dollarTagStart + 2;
244243
ch = '\0';
245244
goto None;

0 commit comments

Comments
 (0)