diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-10-08 21:40:18 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-10-08 21:40:18 +0530 |
commit | e9d9ca8c44c96e5943c0175177b3377a65b2d76f (patch) | |
tree | caa582fdbc583ffd67625087b7534cee8aa5a032 /mysql-test/suite/gcol | |
parent | 1ebe841fb85725c2a6aaecb3bca41ec098a5193d (diff) | |
download | mariadb-git-e9d9ca8c44c96e5943c0175177b3377a65b2d76f.tar.gz |
MDEV-16980 Wrongly set tablename len while opening the
table for purge thread
Problem:
=======
Purge tries to fetch mdl lock for the whole table even though it tries
to open one of the partition. But table name length was wrongly set to indicate
the partition name too.
Solution:
========
- Table name length should identify the table name only not the partition name.
Diffstat (limited to 'mysql-test/suite/gcol')
-rw-r--r-- | mysql-test/suite/gcol/r/gcol_partition_innodb.result | 17 | ||||
-rw-r--r-- | mysql-test/suite/gcol/t/gcol_partition_innodb.test | 20 |
2 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/gcol_partition_innodb.result b/mysql-test/suite/gcol/r/gcol_partition_innodb.result index 9a0e676e76f..7600c9792f1 100644 --- a/mysql-test/suite/gcol/r/gcol_partition_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_partition_innodb.result @@ -1,4 +1,6 @@ SET @@session.default_storage_engine = 'InnoDB'; +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; drop table if exists t1; # Case 1. Partitioning by RANGE based on a non-stored generated column. CREATE TABLE t1 ( @@ -86,6 +88,20 @@ CHECK TABLE t EXTENDED; Table Op Msg_type Msg_text test.t check status OK DROP TABLE t; +# +# MDEV-16980 Wrongly set tablename len while opening the +# table for purge thread +# +CREATE TABLE t1(pk SERIAL, d DATE, vd DATE AS (d) VIRTUAL, +PRIMARY KEY(pk), KEY (vd))ENGINE=InnoDB +PARTITION BY HASH(pk) PARTITIONS 2; +INSERT IGNORE INTO t1 (d) VALUES ('2015-04-14'); +SET sql_mode= ''; +REPLACE INTO t1 SELECT * FROM t1; +Warnings: +Warning 1906 The value specified for generated column 'vd' in table 't1' ignored +DROP TABLE t1; +InnoDB 0 transactions not purged DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; @@ -93,3 +109,4 @@ DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS trg1; DROP TRIGGER IF EXISTS trg2; set sql_warnings = 0; +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; diff --git a/mysql-test/suite/gcol/t/gcol_partition_innodb.test b/mysql-test/suite/gcol/t/gcol_partition_innodb.test index 06e6ccc1ba4..75e2f80af20 100644 --- a/mysql-test/suite/gcol/t/gcol_partition_innodb.test +++ b/mysql-test/suite/gcol/t/gcol_partition_innodb.test @@ -30,6 +30,8 @@ # Set the session storage engine --source include/have_innodb.inc eval SET @@session.default_storage_engine = 'InnoDB'; +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; ##### Workarounds for known open engine specific bugs # none @@ -41,6 +43,24 @@ eval SET @@session.default_storage_engine = 'InnoDB'; #------------------------------------------------------------------------------# # Execute storage engine specific tests +--echo # +--echo # MDEV-16980 Wrongly set tablename len while opening the +--echo # table for purge thread +--echo # + +CREATE TABLE t1(pk SERIAL, d DATE, vd DATE AS (d) VIRTUAL, + PRIMARY KEY(pk), KEY (vd))ENGINE=InnoDB + PARTITION BY HASH(pk) PARTITIONS 2; + +INSERT IGNORE INTO t1 (d) VALUES ('2015-04-14'); +SET sql_mode= ''; +REPLACE INTO t1 SELECT * FROM t1; + +# Cleanup +DROP TABLE t1; + +--source suite/innodb/include/wait_all_purged.inc #------------------------------------------------------------------------------# # Cleanup --source suite/gcol/inc/gcol_cleanup.inc +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; |