File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
297297| <K_SQL_CALC_FOUND_ROWS: "SQL_CALC_FOUND_ROWS">
298298| <K_SQL_NO_CACHE: "SQL_NO_CACHE">
299299| <K_USING:"USING">
300+ | <K_SIGNED:"SIGNED">
300301| <K_UNSIGNED:"UNSIGNED">
301302| <K_VALIDATE : "VALIDATE">
302303| <K_VALUE:"VALUE">
@@ -3436,6 +3437,7 @@ ColDataType ColDataType():
34363437 | ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_XML> | tk=<K_INTERVAL> | tk=<DT_ZONE> | tk=<K_CHAR> )
34373438 { colDataType.setDataType(tk.image); }
34383439 | tk=<K_UNSIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
3440+ | tk=<K_SIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
34393441 )
34403442
34413443 [LOOKAHEAD(2) "(" {tk2 =null;} ( (tk=<S_LONG> [ tk2=<K_BYTE> | tk2=<K_CHAR> ] | tk=<S_CHAR_LITERAL> | tk=<S_IDENTIFIER> )
Original file line number Diff line number Diff line change @@ -2798,6 +2798,11 @@ public void testWhereIssue240_0() throws JSQLParserException {
27982798 assertSqlCanBeParsedAndDeparsed ("SELECT count(*) FROM mytable WHERE 0" );
27992799 }
28002800
2801+ @ Test
2802+ public void testCastToSignedInteger () throws JSQLParserException {
2803+ assertSqlCanBeParsedAndDeparsed ("SELECT CAST(contact_id AS SIGNED INTEGER) FROM contact WHERE contact_id = 20" );
2804+ }
2805+
28012806 @ Test
28022807 public void testWhereIssue240_notBoolean () {
28032808 try {
You can’t perform that action at this time.
0 commit comments