Skip to content

Commit f919e00

Browse files
feat: MS SQL Server UPDATE ... Index Hint
- sourced from https://github.com/joeqiao1984/JSqlParser/tree/indexHintsInUpdate - resolves PR #1662
1 parent 9ca1f21 commit f919e00

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import static net.sf.jsqlparser.test.TestUtils.assertOracleHintExists;
2626
import static net.sf.jsqlparser.test.TestUtils.assertSqlCanBeParsedAndDeparsed;
27+
import static net.sf.jsqlparser.test.TestUtils.assertUpdateMysqlHintExists;
2728
import static org.junit.jupiter.api.Assertions.assertEquals;
2829
import static org.junit.jupiter.api.Assertions.assertFalse;
2930
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -210,7 +211,9 @@ public void testOracleHint() throws JSQLParserException {
210211

211212
@Test
212213
public void testMysqlHint() throws JSQLParserException {
213-
assertUpdateMysqlHintExists("UPDATE demo FORCE INDEX (idx_demo) SET col1 = NULL WHERE col2 = 1", true, "FORCE", "INDEX", "idx_demo");
214+
assertUpdateMysqlHintExists(
215+
"UPDATE demo FORCE INDEX (idx_demo) SET col1 = NULL WHERE col2 = 1", true, "FORCE",
216+
"INDEX", "idx_demo");
214217
}
215218

216219
@Test

src/test/java/net/sf/jsqlparser/test/TestUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ public static void assertOracleHintExists(String sql, boolean assertDeparser, St
412412
}
413413
}
414414

415-
public static void assertUpdateMysqlHintExists(String sql, boolean assertDeparser, String action, String qualifier, String... indexNames)
415+
public static void assertUpdateMysqlHintExists(String sql, boolean assertDeparser,
416+
String action, String qualifier, String... indexNames)
416417
throws JSQLParserException {
417418
if (assertDeparser) {
418419
assertSqlCanBeParsedAndDeparsed(sql, true);

0 commit comments

Comments
 (0)