You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :: syntax is a shorthand for CAST
A valid Postgresql expression such as
('x'||substr(md5(hostname),1,16))::bit(64)::bigint as id_,
results in a parse error.
The problem is that in JSqlParserCC.jjt, the repetition block for :: specifies zero or 1 occurrences
(that is, enclosed in square braces [ ... ])
The fix is to specify zero or more occurrences.
at line 2505 or so in JSqlParserCC.jjt, change the code from
The :: syntax is a shorthand for CAST
A valid Postgresql expression such as
('x'||substr(md5(hostname),1,16))::bit(64)::bigint as id_,
results in a parse error.
The problem is that in JSqlParserCC.jjt, the repetition block for :: specifies zero or 1 occurrences
(that is, enclosed in square braces [ ... ])
The fix is to specify zero or more occurrences.
at line 2505 or so in JSqlParserCC.jjt, change the code from
[ "::" type=ColDataType() {
castExpr = new CastExpression();
castExpr.setUseCastKeyword(false);
castExpr.setLeftExpression(retval);
castExpr.setType(type);
retval=castExpr;
} ]
to
( "::" type=ColDataType() {
castExpr = new CastExpression();
castExpr.setUseCastKeyword(false);
castExpr.setLeftExpression(retval);
castExpr.setType(type);
retval=castExpr;
} )*
I rebuilt JSqlParser using
mvn package
and the revised code passes all tests.
The revised code parsers the statement, and the default SQL generator returns the :: sequence.
The text was updated successfully, but these errors were encountered: