Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EXTRA_DIST = $(top_srcdir)/uthash/uthash.h \
$(top_srcdir)/debian/rules \
$(top_srcdir)/debian/source/format

TULIST = test1 test1-insert-ignore null-example appendkey prependkey issue29 issue52 issue55 issue_semicolon_truncate test_substring appendindex prependindex test_regex complex test_json_hyphen_path test_long_table_name test_json_long_values test_json_utf8
TULIST = test1 test1-insert-ignore null-example appendkey prependkey issue29 issue52 issue55 issue_semicolon_truncate test_substring appendindex prependindex test_regex complex test_json_hyphen_path test_long_table_name test_json_long_values test_json_utf8 test_insert_ignore_mysql9 test_insert_ignore_mariadb test_insert_delayed_mariadb test_insert_delayed_ignore_mariadb
PYTULIST = test_python test_large_python test_large_python_2 test_row_context test_pyargs test_latin1 test_pydef_json_long test_pydef_json_paths
PYTHON_SUPPORT = @PYTHON_SUPPORT@

Expand Down
4 changes: 2 additions & 2 deletions main/dumpscanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void set_working_table() {
}
}

^(INSERT|REPLACE)\ (\ IGNORE\ )?\INTO\ `[^`]+`(?:\ \([^\)]+\))? { DUPOUT
^(INSERT|REPLACE)\ +(DELAYED\ +)?(IGNORE\ +)?INTO\ `[^`]+`(?:\ \([^\)]+\))? { DUPOUT
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if (currenttableconfig) {
BEGIN(ST_VALUES);
DEBUG_MSG("\nENTERING STATE ST_VALUES")
Expand Down Expand Up @@ -231,7 +231,7 @@ static void set_working_table() {
<ST_VALUES>"-- ".* { DUPOUT }
<ST_VALUES>[ ] { DUPOUT }
<ST_VALUES>\n { DUPOUT dump_line_nb++;}
<ST_VALUES>^(INSERT|REPLACE)\ (\ IGNORE\ )?\INTO\ `[^`]+`(?:\ \([^\)]+\))? { DUPOUT
<ST_VALUES>^(INSERT|REPLACE)\ +(DELAYED\ +)?(IGNORE\ +)?INTO\ `[^`]+`(?:\ \([^\)]+\))? { DUPOUT
if (currenttableconfig) {
return INSERT_INTO;
}
Expand Down
13 changes: 13 additions & 0 deletions tests/test_insert_delayed_ignore_mariadb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Config file for test_insert_delayed_ignore_mariadb.sql
#
# INSERT IGNORE written with a single space, as by mariadb-dump --insert-ignore.
# These lines used to be copied unchanged, without anonymization (issue #62).
secret = 'lapin'
stats = 'no'

tables = {
`customers` = {
`email` = emailhash 'example.com' 10
`name` = texthash 8
}
}
58 changes: 58 additions & 0 deletions tests/test_insert_delayed_ignore_mariadb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.20-11.8.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: d
-- ------------------------------------------------------
-- Server version 11.8.9-MariaDB-ubu2404

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `customers` VALUES (1,'alice.martin@mail.test','Alice Martin','Lyon','2026-01-15 10:00:00');
INSERT DELAYED IGNORE INTO `customers` VALUES (2,'bob.oneil@mail.test','Bob O\'Neil','Paris','2026-02-20 11:30:00');
INSERT DELAYED IGNORE INTO `customers` VALUES (3,'carla.rossi@mail.test','Carla Rossi','Nice',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
COMMIT;
SET AUTOCOMMIT=@OLD_AUTOCOMMIT;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2026-10-04 14:25:31
58 changes: 58 additions & 0 deletions tests/test_insert_delayed_ignore_mariadb_anon.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.20-11.8.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: d
-- ------------------------------------------------------
-- Server version 11.8.9-MariaDB-ubu2404

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `customers` VALUES (1,'nnuaeelpxb@example.com','qoepvndw','Lyon','2026-01-15 10:00:00');
INSERT DELAYED IGNORE INTO `customers` VALUES (2,'dlhtusdhgq@example.com','nsesrybi','Paris','2026-02-20 11:30:00');
INSERT DELAYED IGNORE INTO `customers` VALUES (3,'jgmpfbqars@example.com','bzobifey','Nice',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
COMMIT;
SET AUTOCOMMIT=@OLD_AUTOCOMMIT;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2026-10-04 14:25:31
13 changes: 13 additions & 0 deletions tests/test_insert_delayed_mariadb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Config file for test_insert_delayed_mariadb.sql
#
# INSERT DELAYED, as written by mariadb-dump --delayed-insert.
# These lines used to be copied unchanged, without anonymization (issue #62).
secret = 'lapin'
stats = 'no'

tables = {
`customers` = {
`email` = emailhash 'example.com' 10
`name` = texthash 8
}
}
58 changes: 58 additions & 0 deletions tests/test_insert_delayed_mariadb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.20-11.8.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: d
-- ------------------------------------------------------
-- Server version 11.8.9-MariaDB-ubu2404

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT DELAYED INTO `customers` VALUES (1,'alice.martin@mail.test','Alice Martin','Lyon','2026-01-15 10:00:00');
INSERT DELAYED INTO `customers` VALUES (2,'bob.oneil@mail.test','Bob O\'Neil','Paris','2026-02-20 11:30:00');
INSERT DELAYED INTO `customers` VALUES (3,'carla.rossi@mail.test','Carla Rossi','Nice',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
COMMIT;
SET AUTOCOMMIT=@OLD_AUTOCOMMIT;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2026-10-04 14:25:31
58 changes: 58 additions & 0 deletions tests/test_insert_delayed_mariadb_anon.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.20-11.8.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: d
-- ------------------------------------------------------
-- Server version 11.8.9-MariaDB-ubu2404

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT DELAYED INTO `customers` VALUES (1,'nnuaeelpxb@example.com','qoepvndw','Lyon','2026-01-15 10:00:00');
INSERT DELAYED INTO `customers` VALUES (2,'dlhtusdhgq@example.com','nsesrybi','Paris','2026-02-20 11:30:00');
INSERT DELAYED INTO `customers` VALUES (3,'jgmpfbqars@example.com','bzobifey','Nice',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
COMMIT;
SET AUTOCOMMIT=@OLD_AUTOCOMMIT;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2026-10-04 14:25:31
13 changes: 13 additions & 0 deletions tests/test_insert_ignore_mariadb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Config file for test_insert_ignore_mariadb.sql
#
# INSERT IGNORE written with a single space, as by mariadb-dump --insert-ignore.
# These lines used to be copied unchanged, without anonymization (issue #62).
secret = 'lapin'
stats = 'no'

tables = {
`customers` = {
`email` = emailhash 'example.com' 10
`name` = texthash 8
}
}
60 changes: 60 additions & 0 deletions tests/test_insert_ignore_mariadb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.20-11.8.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: d
-- ------------------------------------------------------
-- Server version 11.8.9-MariaDB-ubu2404

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

SET @OLD_AUTOCOMMIT=@@AUTOCOMMIT, @@AUTOCOMMIT=0;
LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT IGNORE INTO `customers` VALUES (1,'alice.martin@mail.test','Alice Martin','Lyon','2026-01-15 10:00:00');
INSERT IGNORE INTO `customers` VALUES (2,'bob.oneil@mail.test','Bob O\'Neil','Paris','2026-02-20 11:30:00');
INSERT IGNORE INTO `customers` VALUES (3,'carla.rossi@mail.test','Carla Rossi','Nice',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;
COMMIT;
SET AUTOCOMMIT=@OLD_AUTOCOMMIT;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

-- Dump completed on 2026-10-04 14:25:30
Loading
Loading