Skip to content

Commit 6fe135c

Browse files
committed
test: expect MariaDB to run the /*!40000 */ statements of a mysqldump script
#2891 made Dialect.MARIADB run executable comments the MariaDB way, so /*!40000 ... */ now yields statements under MARIADB. The mysqldump test from #2888 still expected MARIADB to skip them, and master has failed since 247e31c. MariaDB 11.8.9 runs /*!40000 ... */, skips /*!50700 ... */ and runs /*M!100000 ... */, so the test now expects the same statements for MYSQL and MARIADB and keeps the comment reading without a dialect. Signed-off-by: minleejae <mmj9808@gmail.com>
1 parent 247e31c commit 6fe135c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +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, MARIADB)) {
328-
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert",
329-
"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));
330328
}
329+
assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert", "UnlockStatement"),
330+
dumpStatements(script, NO_DIALECT));
331331
}
332332

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

0 commit comments

Comments
 (0)