From 5a44ffb36f1d292996dfff5f9390ce259acbd1a4 Mon Sep 17 00:00:00 2001 From: minleejae Date: Wed, 25 Nov 2026 13:32:42 +0900 Subject: [PATCH] test: check MySQL and MariaDB together in the mysqldump script test 67c6fe6ae 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 --- .../statement/lock/MySqlLockTablesTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/test/java/net/sf/jsqlparser/statement/lock/MySqlLockTablesTest.java b/src/test/java/net/sf/jsqlparser/statement/lock/MySqlLockTablesTest.java index e821ba457..38bc905b7 100644 --- a/src/test/java/net/sf/jsqlparser/statement/lock/MySqlLockTablesTest.java +++ b/src/test/java/net/sf/jsqlparser/statement/lock/MySqlLockTablesTest.java @@ -321,17 +321,13 @@ void parsesAMysqldumpScript() throws JSQLParserException { + "INSERT INTO `t` VALUES (1,'a'),(2,'b');\n" + "/*!40000 ALTER TABLE `t` ENABLE KEYS */;\n" + "UNLOCK TABLES;\n"; - // only the MySQL dialect runs the /*!40000 ... */ statements of a server of version 8.4 - assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert", "Alter", - "UnlockStatement"), dumpStatements(script, MYSQL)); - for (Consumer dialect : List.of(NO_DIALECT)) { - assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert", - "UnlockStatement"), dumpStatements(script, dialect)); - } - for (Consumer dialect : List.of(MARIADB)) { - assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert", "Alter", - "UnlockStatement"), dumpStatements(script, dialect)); + // MySQL and MariaDB run the /*!40000 ... */ statements; without a dialect they are comments + for (Consumer dialect : List.of(MYSQL, MARIADB)) { + assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Alter", "Insert", + "Alter", "UnlockStatement"), dumpStatements(script, dialect)); } + assertEquals(List.of("Drop", "CreateTable", "LockStatement", "Insert", "UnlockStatement"), + dumpStatements(script, NO_DIALECT)); } private static List dumpStatements(String script, Consumer dialect)