Skip to content

Commit 5be3eca

Browse files
committed
Merge origin/master
Conflicts: src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
2 parents 516ea8a + dd7eda0 commit 5be3eca

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,13 +1749,15 @@ FromItem SubJoin():
17491749
{
17501750
FromItem fromItem = null;
17511751
Join join = null;
1752-
List joinList = null;
1753-
SubJoin subJoin = new SubJoin();
1752+
List<Join> joinList = null;
17541753
}
17551754
{
1756-
fromItem=FromItem() { subJoin.setLeft(fromItem); }
1757-
joinList=SubJoinsList() { subJoin.setJoinList(joinList); }
1755+
fromItem=FromItem()
1756+
joinList=SubJoinsList()
17581757
{
1758+
SubJoin subJoin = new SubJoin();
1759+
subJoin.setLeft(fromItem);
1760+
subJoin.setJoinList(joinList);
17591761
return subJoin;
17601762
}
17611763
}
@@ -1778,7 +1780,6 @@ List SubJoinsList():
17781780
{
17791781

17801782
(join=JoinerExpression() { joinsList.add(join); })+
1781-
17821783
{ return joinsList; }
17831784
}
17841785

src/test/java/net/sf/jsqlparser/statement/alter/AlterTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public void testAddConstraintKeyIssue320() throws JSQLParserException {
360360
}
361361

362362
@Test
363-
public void testIssue633() throws JSQLParserException {
363+
public void testIssue633() throws JSQLParserException, JSQLParserException, JSQLParserException {
364364
assertSqlCanBeParsedAndDeparsed("ALTER TABLE team_phases ADD CONSTRAINT team_phases_id_key UNIQUE (id)");
365365
}
366366

@@ -383,4 +383,9 @@ public void testAlterTableIndex586() throws Exception {
383383
public void testIssue259() throws JSQLParserException {
384384
assertSqlCanBeParsedAndDeparsed("ALTER TABLE feature_v2 ADD COLUMN third_user_id int (10) unsigned DEFAULT '0' COMMENT '第三方用户id' after kdt_id");
385385
}
386+
387+
@Test
388+
public void testIssue633_2() throws JSQLParserException {
389+
assertSqlCanBeParsedAndDeparsed("CREATE INDEX idx_american_football_action_plays_1 ON american_football_action_plays USING btree (play_type)");
390+
}
386391
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,12 @@ public void testValues6BothVariants() throws JSQLParserException {
21822182
assertSqlCanBeParsedAndDeparsed(stmt);
21832183
}
21842184

2185+
@Test
2186+
public void testIntervalWithColumn() throws JSQLParserException {
2187+
String stmt = "SELECT DATE_ADD(start_date, INTERVAL duration MINUTE) AS end_datetime FROM appointment";
2188+
assertSqlCanBeParsedAndDeparsed(stmt);
2189+
}
2190+
21852191
@Test
21862192
public void testInterval1() throws JSQLParserException {
21872193
String stmt = "SELECT 5 + INTERVAL '3 days'";

src/test/java/net/sf/jsqlparser/statement/update/UpdateTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,9 @@ public void testUpdateIssue826() throws JSQLParserException {
150150
+ "where message_topic.name='test' \n"
151151
+ "AND message_topic_config.enable_flag='Y'", true);
152152
}
153+
154+
@Test
155+
public void testUpdateIssue750() throws JSQLParserException {
156+
assertSqlCanBeParsedAndDeparsed("update a,(select * from c) b set a.id=b.id where a.id=b.id", true);
157+
}
153158
}

0 commit comments

Comments
 (0)