summaryrefslogtreecommitdiff
path: root/mysql-test/main/commit.test
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-12-08 13:14:17 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-12-09 12:09:03 +0530
commit860debaffc1e2dbfb30100ced1d2278f0e979956 (patch)
tree73ff7d64e529587d875b2ce465a6ad32e689dcf3 /mysql-test/main/commit.test
parentaa0e3805681552cff5dced141f695c96a4da872f (diff)
downloadmariadb-git-10.5-MDEV-515-1.tar.gz
MDEV-515 innodb bulk insert10.5-MDEV-515-1
- Introduced assign_stat_n_rows() in dict_table_t. It calculates the number of rows in the table and assign stat_n_rows during ha_innobase::open() - Introduced empty_table() in dict_table_t. Basically it empties all the indexes associated with table (not covered the fts index). This is undo operation of bulk operation. - Introduced new variable bulk_trx_id in dict_table_t. It stores the transaction id of bulk insert. Basically it is protected by exclusive lock of the table. - Introduced new variable non_empty in dict_table_t. It indicates the whether the table is empty. - If table is empty then INSERT, INSERT..SELECT does take exclusive lock on the table. - Introduced new undo log record "TRX_UNDO_UNEMPTY". It should be first undo log during bulk operation. While rollback, if innodb encounters the undo record then it should empty the table. Limitations: =========== - Parallel read should give empty table depends on bulk_trx_id - Need to handle the online alter when the table is empty.
Diffstat (limited to 'mysql-test/main/commit.test')
-rw-r--r--mysql-test/main/commit.test5
1 files changed, 4 insertions, 1 deletions
diff --git a/mysql-test/main/commit.test b/mysql-test/main/commit.test
index 762397dfa23..9f5e077fd2d 100644
--- a/mysql-test/main/commit.test
+++ b/mysql-test/main/commit.test
@@ -284,8 +284,11 @@ COMMIT;
SET @@completion_type=1;
COMMIT AND NO CHAIN;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
-START TRANSACTION;
TRUNCATE TABLE t1;
+# MDEV-515 takes X-lock on the table for the first insert.
+# So concurrent insert won't happen on the table
+INSERT INTO t1 VALUES(100);
+START TRANSACTION;
INSERT INTO t1 VALUES (1000);
SELECT * FROM t1;
--echo Should read '1000'