From 9c6a2e4d69d60147e1d64cbf9ee8138be5afca8c Mon Sep 17 00:00:00 2001 From: taozhi8833998 Date: Wed, 28 Aug 2024 20:28:22 +0800 Subject: [PATCH] fix: limit is not reserved keyword in snowflake --- pegjs/snowflake.pegjs | 2 +- test/snowflake.spec.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pegjs/snowflake.pegjs b/pegjs/snowflake.pegjs index 0e440f66..4313a559 100644 --- a/pegjs/snowflake.pegjs +++ b/pegjs/snowflake.pegjs @@ -50,7 +50,7 @@ 'LEFT': true, 'LIKE': true, - 'LIMIT': true, + 'LIMIT': false, 'NOT': true, 'NULL': true, diff --git a/test/snowflake.spec.js b/test/snowflake.spec.js index d5989be1..4b564baa 100644 --- a/test/snowflake.spec.js +++ b/test/snowflake.spec.js @@ -415,6 +415,13 @@ describe('snowflake', () => { 'SELECT POSITION("3" IN split_part("W3Schools|com", "|", 11)) AS "MatchPosition"' ] }, + { + title: 'limit is not reserved keyword', + sql: [ + 'select * from tb where wins>=limit', + 'SELECT * FROM "tb" WHERE "wins" >= "limit"', + ] + }, ] SQL_LIST.forEach(sqlInfo => { const { title, sql } = sqlInfo