`Int11` int(11) DEFAULT NULL CHECK (`Int11` MOD 5 = 0),
[SyntaxError]: Expected "!=", "#", ... , or [ \t\n\r] but "M" found.
That seems to be tripping on the MOD operator.
NSP 5.3.2
Node 22
MOD and % are synonym operators - but only in MySQL/MariaDB, not in most other databases. I checked documentation for PostgreSQL and SQLite and it doesn't look like they support the MOD synonym. This "seems" to be an issue that is limited in scope.
Both "%" and "MOD" are in a comment in mysql.pegjs but MOD is not in the list of processed operators.
That seems to be tripping on the
MOD
operator.NSP 5.3.2 Node 22
MOD
and%
are synonym operators - but only in MySQL/MariaDB, not in most other databases. I checked documentation for PostgreSQL and SQLite and it doesn't look like they support theMOD
synonym. This "seems" to be an issue that is limited in scope.Both "%" and "MOD" are in a comment in mysql.pegjs but MOD is not in the list of processed operators.
https://github.com/taozhi8833998/node-sql-parser/blob/feca67f1f086cd0c99b8a8f80fca1786fabab9fe/pegjs/mysql.pegjs#L2856
I believe adding it here will fix the issue for MySQL (similar for MariaDB).
https://github.com/taozhi8833998/node-sql-parser/blob/feca67f1f086cd0c99b8a8f80fca1786fabab9fe/pegjs/mysql.pegjs#L3058
I made an attempt to fix the issue and have submitted a PR.