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 @@ -296,6 +296,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
296
296
| <K_SQL_CALC_FOUND_ROWS: "SQL_CALC_FOUND_ROWS">
297
297
| <K_SQL_NO_CACHE: "SQL_NO_CACHE">
298
298
| <K_USING:"USING">
299
+ | <K_SIGNED:"SIGNED">
299
300
| <K_UNSIGNED:"UNSIGNED">
300
301
| <K_VALIDATE : "VALIDATE">
301
302
| <K_VALUE:"VALUE">
@@ -3425,6 +3426,7 @@ ColDataType ColDataType():
3425
3426
| ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_XML> | tk=<K_INTERVAL> | tk=<DT_ZONE> | tk=<K_CHAR> )
3426
3427
{ colDataType.setDataType(tk.image); }
3427
3428
| tk=<K_UNSIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
3429
+ | tk=<K_SIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
3428
3430
)
3429
3431
3430
3432
[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 {
2798
2798
assertSqlCanBeParsedAndDeparsed ("SELECT count(*) FROM mytable WHERE 0" );
2799
2799
}
2800
2800
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
+
2801
2806
@ Test
2802
2807
public void testWhereIssue240_notBoolean () {
2803
2808
try {
You can’t perform that action at this time.
0 commit comments