taozhi8833998 / taozhi8833998/node-sql-parser
Support Parenthesis-less BINARY Operator Syntax
@taozhi8833998 is already working on this.
Since Jan 26, 2026.
- Dominant language
- PEG.js
- Stars
- 1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
node-sql-parser currently fails to parse the parenthesis-less form of the MySQL BINARY operator. In MySQL, BINARY can be used both as an operator (without parentheses) and as a function (with parentheses), but the parser only supports the function form.
Database Engine
MySQL
To Reproduce
-- Example 1: In SELECT clause
SELECT BINARY username, COUNT(*)
FROM users;
-- Example 2: In GROUP BY clause
SELECT username, COUNT(*)
FROM users
GROUP BY BINARY username;
-- Example 3: In ORDER BY clause
SELECT username
FROM users
ORDER BY BINARY username;
-- Example 4: In WHERE condition
SELECT *
FROM users
WHERE username = BINARY 'John';
Expected behavior
The parser should correctly recognize and handle the parenthesis-less form of the BINARY operator, just as it handles the parenthesized form.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.