Skip to content

Commit 7b2b0f6

Browse files
committed
corrected bug within RelObjectNameExt processing
1 parent 18a0693 commit 7b2b0f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ options{
2626
DEBUG_PARSER=false;
2727
DEBUG_LOOKAHEAD=false;
2828
DEBUG_TOKEN_MANAGER=false;
29+
CACHE_TOKENS=true;
2930
// FORCE_LA_CHECK=true;
3031
UNICODE_INPUT=true;
3132
// JAVA_TEMPLATE_TYPE = "modern";
@@ -798,7 +799,7 @@ String RelObjectNameExt():
798799
String result=null;
799800
}
800801
{
801-
( result=RelObjectName() | tk=<K_LEFT> | tk=<K_RIGHT> | tk=<K_SET> | <K_DOUBLE>)
802+
( result=RelObjectName() | tk=<K_LEFT> | tk=<K_RIGHT> | tk=<K_SET> | tk=<K_DOUBLE> | tk=<K_IF>)
802803
{
803804
if (tk!=null) result=tk.image;
804805
return result;

src/test/java/net/sf/jsqlparser/test/select/SelectTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,4 +2596,8 @@ public void testMysqlMultipleIndexHints() throws JSQLParserException {
25962596
assertSqlCanBeParsedAndDeparsed("SELECT column FROM testtable AS t0 IGNORE INDEX (index1,index2)");
25972597
assertSqlCanBeParsedAndDeparsed("SELECT column FROM testtable AS t0 FORCE INDEX (index1,index2)");
25982598
}
2599+
2600+
public void testProblemIssue435() throws JSQLParserException {
2601+
assertSqlCanBeParsedAndDeparsed("SELECT if(z, 'a', 'b') AS business_type FROM mytable1");
2602+
}
25992603
}

0 commit comments

Comments
 (0)