Closed Nymphium closed 3 years ago
Parser.parse_stmt rejects statements which contains uuid (, more presicely /\buuid\b/ as regexp) as column name. For example:
Parser.parse_stmt
uuid
/\buuid\b/
utop # Sqlgg.Parser.parse_stmt {|SELECT uuid FROM table|};; Exception: Sqlgg.Parser_utils.Error (Sqlgg.Sql_parser.MenhirBasics.Error, (1, 11, "uuid", " FROM table")). utop # Sqlgg.Parser.parse_stmt {|SELECT * FROM tbl WHERE uuid = 'something' |};; Exception: Sqlgg.Parser_utils.Error (Sqlgg.Sql_parser.MenhirBasics.Error, (1, 28, "uuid", " = 'something' ")). utop # Sqlgg.Parser.parse_stmt {|SELECT * FROM tbl WHERE name = 'uuid' |};; (* it's ok *) - : Sqlgg.Sql.stmt = Sqlgg.Sql.Select ...
uuid is reserved identifier in sql, use escaping for column names (backticks in mysql).
Parser.parse_stmt
rejects statements which containsuuid
(, more presicely/\buuid\b/
as regexp) as column name. For example: