Skip to content

Fails with unparenthesized comparison as IN left operand (MariaDB) #2501

@laowantong

Description

@laowantong

Database Engine MariaDB (and presumably MySQL).

To Reproduce

import pkg from 'node-sql-parser';
const { Parser } = pkg;
const parser = new Parser();

parser.parse("SELECT * FROM T1 WHERE a = b IN (SELECT flag FROM T2)");
  • node-sql-parser: 5.3.9
  • node: v18.12.0

Expected behavior
This statement is valid SQL for MySQL and MariaDB, and should not fail to parse.

Additional context
Works fine with parenthesis: SELECT * FROM T1 WHERE (a = b) IN (SELECT flag FROM T2)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions