Skip to content

Commit 8976e8e

Browse files
authored
test: check MySQL and MariaDB together in the mysqldump script test (#2961)
67c6fe6 made the mysqldump test expect MARIADB to run the /*!40000 ... */ statements, but the comment above the assertions still says that only the MySQL dialect runs them. MYSQL and MARIADB now expect the same statements, so the test checks them in one loop under a comment that says so, and keeps the separate check that without a dialect the statements stay comments. Signed-off-by: minleejae <mmj9808@gmail.com>
1 parent f6f3905 commit 8976e8e

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎src/test/java/net/sf/jsqlparser/statement/lock/MySqlLockTablesTest.java‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,13 @@ void parsesAMysqldumpScript() throws JSQLParserException {
321321
+ "INSERT INTO `t` VALUES (1,'a'),(2,'b');\n"
322322
+ "/*!40000 ALTER TABLE `t` ENABLE KEYS */;\n"
323323
+ "UNLOCK TABLES;\n";
324-
// only the MySQL dialect runs the /*!40000 ... */ statements of a server of version 8.4
325-
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert", "Alter",
326-
"UnlockStatement"), dumpStatements(script, MYSQL));
327-
for (Consumer<CCJSqlParser> dialect : List.of(NO_DIALECT)) {
328-
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert",
329-
"UnlockStatement"), dumpStatements(script, dialect));
330-
}
331-
for (Consumer<CCJSqlParser> dialect : List.of(MARIADB)) {
332-
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert", "Alter",
333-
"UnlockStatement"), dumpStatements(script, dialect));
324+
// MySQL and MariaDB run the /*!40000 ... */ statements; without a dialect they are comments
325+
for (Consumer<CCJSqlParser> dialect : List.of(MYSQL, MARIADB)) {
326+
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert",
327+
"Alter", "UnlockStatement"), dumpStatements(script, dialect));
334328
}
329+
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert", "UnlockStatement"),
330+
dumpStatements(script, NO_DIALECT));
335331
}
336332

337333
private static List<String> dumpStatements(String script, Consumer<CCJSqlParser> dialect)

0 commit comments

Comments
 (0)