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 */
297
297
| <K_SQL_CALC_FOUND_ROWS: "SQL_CALC_FOUND_ROWS">
298
298
| <K_SQL_NO_CACHE: "SQL_NO_CACHE">
299
299
| <K_USING:"USING">
300
+ | <K_SIGNED:"SIGNED">
300
301
| <K_UNSIGNED:"UNSIGNED">
301
302
| <K_VALIDATE : "VALIDATE">
302
303
| <K_VALUE:"VALUE">
@@ -3436,6 +3437,7 @@ ColDataType ColDataType():
3436
3437
| ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_XML> | tk=<K_INTERVAL> | tk=<DT_ZONE> | tk=<K_CHAR> )
3437
3438
{ colDataType.setDataType(tk.image); }
3438
3439
| 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);}
3439
3441
)
3440
3442
3441
3443
[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