Skip to content

Commit 23753cd

Browse files
Merge pull request #2089 from taozhi8833998/fix-limit-snowflake
fix: limit is not reserved keyword in snowflake
2 parents 7b38b2b + 9c6a2e4 commit 23753cd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pegjs/snowflake.pegjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
'LEFT': true,
5252
'LIKE': true,
53-
'LIMIT': true,
53+
'LIMIT': false,
5454

5555
'NOT': true,
5656
'NULL': true,

test/snowflake.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ describe('snowflake', () => {
415415
'SELECT POSITION("3" IN split_part("W3Schools|com", "|", 11)) AS "MatchPosition"'
416416
]
417417
},
418+
{
419+
title: 'limit is not reserved keyword',
420+
sql: [
421+
'select * from tb where wins>=limit',
422+
'SELECT * FROM "tb" WHERE "wins" >= "limit"',
423+
]
424+
},
418425
]
419426
SQL_LIST.forEach(sqlInfo => {
420427
const { title, sql } = sqlInfo

0 commit comments

Comments
 (0)