summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-11-07 04:41:35 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-11-07 04:41:35 +0530
commit8c9cc2fb6eb2b3841dc34b40d6e936a322268148 (patch)
tree8fdd1726b933d81d07ca7bfcdc60785bc5c7bfab
parentd20de4d447c70512f915fca6d78b9a77bbaeb4c7 (diff)
downloadmariadb-git-bb-10.7-MDEV-26956.tar.gz
MDEV-26956 LeakSanitizer/Valgrind errors in trx_mod_table_time_t::start_bulk_insert upon adding system versioningbb-10.7-MDEV-26956
InnoDB fails to apply buffered insert operation for 'mysql/transaction_registry' table during system versioning DDL. To avoid this, DDL calls extra(HA_EXTRA_IGNORE_INSERT) to inform the InnoDB for applying the buffered insert operation.
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result11
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test12
-rw-r--r--sql/table.cc3
3 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index 2eb6f5d4d0a..f33bef890fd 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -211,3 +211,14 @@ c c2
DELETE FROM t;
COMMIT;
DROP TABLE t;
+#
+# MDEV-26956 LeakSanitizer/Valgrind errors in
+# trx_mod_table_time_t::start_bulk_insert
+# upon adding system versioning
+#
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index cfd79f05f6c..7719ae68d7b 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -221,3 +221,15 @@ SELECT * FROM t;
DELETE FROM t;
COMMIT;
DROP TABLE t;
+
+--echo #
+--echo # MDEV-26956 LeakSanitizer/Valgrind errors in
+--echo # trx_mod_table_time_t::start_bulk_insert
+--echo # upon adding system versioning
+--echo #
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+ PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
diff --git a/sql/table.cc b/sql/table.cc
index df94cac6475..b183ebd3254 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -9711,6 +9711,9 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
int error= table->file->ha_write_row(table->record[0]);
if (unlikely(error))
table->file->print_error(error, MYF(0));
+ /* extra() is used to apply the bulk insert operation
+ on mysql/transaction_registry table */
+ table->file->extra(HA_EXTRA_IGNORE_INSERT);
return error;
}