File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -719,7 +719,7 @@ Statement Statement() #Statement:
719719 ( <ST_SEMICOLON> | <EOF> )
720720 )
721721 |
722- LOOKAHEAD( { getAsBoolean(Feature.allowUnsupportedStatements) } ) stm = UnsupportedStatement()
722+ LOOKAHEAD( { stm==null && getAsBoolean(Feature.allowUnsupportedStatements) } ) stm = UnsupportedStatement()
723723 } catch (ParseException ex) {
724724 if ( getAsBoolean(Feature.allowUnsupportedStatements) ) {
725725 stm = new UnsupportedStatement( stm.toString(), error_skipto(ST_SEMICOLON) );
Original file line number Diff line number Diff line change @@ -5814,4 +5814,22 @@ public void testIssue1833() throws JSQLParserException {
58145814 String stmt = "SELECT age, name, gender FROM user_info INTO TEMP user_temp WITH NO LOG" ;
58155815 assertSqlCanBeParsedAndDeparsed (stmt );
58165816 }
5817+
5818+ @ Test
5819+ void testGroupByWithHaving () throws JSQLParserException {
5820+ String sqlStr = "-- GROUP BY\n "
5821+ + "SELECT a\n "
5822+ + " , b\n "
5823+ + " , c\n "
5824+ + " , Sum( d )\n "
5825+ + "FROM t\n "
5826+ + "GROUP BY a\n "
5827+ + " , b\n "
5828+ + " , c\n "
5829+ + "HAVING Sum( d ) > 0\n "
5830+ + " AND Count( * ) > 1\n "
5831+ + ";" ;
5832+ Statement stmt = assertSqlCanBeParsedAndDeparsed (sqlStr );
5833+ Assertions .assertInstanceOf (Select .class , stmt );
5834+ }
58175835}
You can’t perform that action at this time.
0 commit comments