File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2195,7 +2195,7 @@ regexp_op_right
21952195 }
21962196
21972197like_op_right
2198- = op :like_op __ right :(literal / comparison_expr ) __ es :escape_op ? {
2198+ = op :like_op __ right :(comparison_expr / literal ) __ es :escape_op ? {
21992199 if (es) right .escape = es
22002200 return { op: op, right: right };
22012201 }
Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ describe('sqlite', () => {
269269 const sql = `SELECT * FROM table_name WHERE column_name LIKE '%pattern%' ESCAPE '\'`
270270 expect ( getParsedSql ( sql ) ) . to . be . equal ( `SELECT * FROM "table_name" WHERE "column_name" LIKE '%pattern%' ESCAPE '\'` )
271271 } )
272+ it ( 'should support string concatenation in LIKE opts' , ( ) => {
273+ const sql = `SELECT * FROM file WHERE path LIKE 'C:' || CHAR(92) || 'Users' || CHAR(92) || 'example.txt'`
274+ expect ( getParsedSql ( sql ) ) . to . be . equal ( `SELECT * FROM "file" WHERE "path" LIKE 'C:' || CHAR(92) || 'Users' || CHAR(92) || 'example.txt'` )
275+ } )
272276 it ( 'should support GROUP_CONCAT' , ( ) => {
273277 const sql = `SELECT
274278 CASE
You can’t perform that action at this time.
0 commit comments