1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Thirunarayanan Balathandayuthapani
2018-10-08 21:40:18 +05:30
parent 1ebe841fb8
commit e9d9ca8c44
4 changed files with 40 additions and 0 deletions

View File

@@ -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;