File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1269,9 +1269,11 @@ AllTableColumns AllTableColumns():
1269
1269
1270
1270
Alias Alias():
1271
1271
{ String name = null;
1272
+ Token token = null;
1272
1273
boolean useAs = false; }
1273
1274
{
1274
- [<K_AS> { useAs = true; } ] name=RelObjectName()
1275
+ [<K_AS> { useAs = true; } ]
1276
+ ( name=RelObjectName() | token=<S_CHAR_LITERAL> { name=token.image; } )
1275
1277
{ return new Alias(name,useAs); }
1276
1278
}
1277
1279
Original file line number Diff line number Diff line change @@ -2750,4 +2750,8 @@ public void testIssue582NumericConstants() throws JSQLParserException {
2750
2750
assertSqlCanBeParsedAndDeparsed ("SELECT x'009fd'" );
2751
2751
assertSqlCanBeParsedAndDeparsed ("SELECT X'009fd'" );
2752
2752
}
2753
+
2754
+ public void testIssue583CharacterLiteralAsAlias () throws JSQLParserException {
2755
+ assertSqlCanBeParsedAndDeparsed ("SELECT CASE WHEN T.ISC = 1 THEN T.EXTDESC WHEN T.b = 2 THEN '2' ELSE T.C END AS 'Test' FROM T" );
2756
+ }
2753
2757
}
You can’t perform that action at this time.
0 commit comments