Skip to content

Commit

Permalink
feat: MS SQL Server UPDATE ... Index Hint
Browse files Browse the repository at this point in the history
  • Loading branch information
manticore-projects committed Sep 13, 2023
1 parent 9ca1f21 commit f919e00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import static net.sf.jsqlparser.test.TestUtils.assertOracleHintExists;
import static net.sf.jsqlparser.test.TestUtils.assertSqlCanBeParsedAndDeparsed;
import static net.sf.jsqlparser.test.TestUtils.assertUpdateMysqlHintExists;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -210,7 +211,9 @@ public void testOracleHint() throws JSQLParserException {

@Test
public void testMysqlHint() throws JSQLParserException {
assertUpdateMysqlHintExists("UPDATE demo FORCE INDEX (idx_demo) SET col1 = NULL WHERE col2 = 1", true, "FORCE", "INDEX", "idx_demo");
assertUpdateMysqlHintExists(
"UPDATE demo FORCE INDEX (idx_demo) SET col1 = NULL WHERE col2 = 1", true, "FORCE",
"INDEX", "idx_demo");
}

@Test
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/net/sf/jsqlparser/test/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ public static void assertOracleHintExists(String sql, boolean assertDeparser, St
}
}

public static void assertUpdateMysqlHintExists(String sql, boolean assertDeparser, String action, String qualifier, String... indexNames)
public static void assertUpdateMysqlHintExists(String sql, boolean assertDeparser,
String action, String qualifier, String... indexNames)
throws JSQLParserException {
if (assertDeparser) {
assertSqlCanBeParsedAndDeparsed(sql, true);
Expand Down

0 comments on commit f919e00

Please sign in to comment.