Skip to content

Commit 0e7bda0

Browse files
committed
Fix parsing of LEFT() and RIGHT() in PostgreSQL
Fixes #108
1 parent a89b7a6 commit 0e7bda0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/parser.pegjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7404,6 +7404,8 @@ postgres_func_keyword
74047404
/ LOCALTIME
74057405
/ LOCALTIMESTAMP
74067406
/ CURRENT_SCHEMA
7407+
/ RIGHT
7408+
/ LEFT
74077409

74087410
sqlite_func_keyword
74097411
= GLOB

test/expr/func_call.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ describe("function call", () => {
149149
it("IF() function", () => {
150150
testExpr(`IF(x > 3, 'yes', 'no')`);
151151
});
152+
});
152153

154+
dialect(["mysql", "mariadb", "bigquery", "postgresql"], () => {
153155
it("LEFT() / RIGHT() functions", () => {
154156
testExpr(`LEFT('hello', 3)`);
155157
testExpr(`RIGHT('hello', 3)`);

0 commit comments

Comments
 (0)