taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL

Home Page:https://taozhi8833998.github.io/node-sql-parser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throws syntax error when trying to `astify` composite check constraints

1ilit opened this issue · comments

Describe the bug
Throws syntax error when trying to astify composite check constraints

Database Engine
MySQL

To Reproduce
-the SQL that be parsed

CREATE TABLE `Pattern` (
  `IsInterpolated` INT NOT NULL,
  `Value` DOUBLE,
  CONSTRAINT `CHK_Value_IsInterpolated` CHECK ((`Value` IS NOT NULL) OR (`IsInterpolated` = 0))
);

-the node-sql-parser version
v5.0.0
-the node version
v18.18.0

Expected behavior
Produce the ast for the constraint

Additional context
Minimal reproducible example: https://stackblitz.com/edit/stackblitz-starters-9dpxty?file=index.js