revision-id: 7e756437789d61aa751592a7444316d116e677e0 (mariadb-10.2.19-3-g7e756437789) parent(s): 01d3e401971ab51bb4a2b9c8438b27d0161267f9 9e23171c70b57c2af40a976fcd62bdbac6b26349 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-11-14 18:40:09 +0100 message: Merge branch '10.1' into 10.2 mysql-test/r/partition_innodb.result | 29 +++++++++++++++++++++++++++++ mysql-test/t/partition_innodb.test | 32 ++++++++++++++++++++++++++++++++ sql/sql_update.cc | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --cc mysql-test/r/partition_innodb.result index 942455f23ed,c00a75fed90..98134c0345a --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@@ -898,32 -891,30 +898,61 @@@ SELECT b FROM t1 WHERE b = 0 ERROR HY000: Table definition has changed, please retry transaction SELECT b FROM t1 WHERE b = 0; ERROR HY000: Table definition has changed, please retry transaction +disconnect con1; DROP TABLE t1; # + # MDEV-11167: InnoDB: Warning: using a partial-field key prefix + # in search, results in assertion failure or "Can't find record" error + # ++set @save_sql_mode = @@sql_mode; ++set sql_mode=""; + CREATE TABLE t1 (a INT) ENGINE=InnoDB; + CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2; + CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION; + INSERT INTO t1 VALUES (1),(2); + INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); + Warnings: + Warning 1366 Incorrect integer value: 'three' for column 'b' at row 2 + UPDATE v SET a = NULL; + Warnings: + Warning 1292 Truncated incorrect DOUBLE value: 'foo' + DROP view v; + DROP TABLE t1, t2; + SET @save_isp=@@innodb_stats_persistent; + SET GLOBAL innodb_stats_persistent= ON; + CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2; + INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66); + CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION; + UPDATE v SET f2 = NULL; -ERROR HY000: CHECK OPTION failed 'test.v' ++ERROR 44000: CHECK OPTION failed `test`.`v` + SET GLOBAL innodb_stats_persistent= @save_isp; + DROP view v; + DROP TABLE t; ++set sql_mode= @save_sql_mode; ++# +# Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE +# MYSQL.INNODB_TABLE_STATS +# +CREATE DATABASE test_jfg; +CREATE TABLE test_jfg.test_jfg1 (id int(10) unsigned NOT NULL,PRIMARY +KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1; +CREATE TABLE test_jfg.test_jfg2 (id int(10) unsigned NOT NULL,PRIMARY +KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1 +PARTITION BY RANGE ( id ) (PARTITION p1000 VALUES LESS THAN (1000) +ENGINE = InnoDB,PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = +InnoDB); +SELECT database_name, table_name FROM mysql.innodb_table_stats WHERE +database_name = 'test_jfg'; +database_name table_name +test_jfg test_jfg1 +test_jfg test_jfg2#P#p1000 +test_jfg test_jfg2#P#pmax +RENAME TABLE test_jfg.test_jfg1 TO test_jfg.test_jfg11; +RENAME TABLE test_jfg.test_jfg2 TO test_jfg.test_jfg12; +SELECT database_name, table_name FROM mysql.innodb_table_stats WHERE +database_name = 'test_jfg'; +database_name table_name +test_jfg test_jfg11 +test_jfg test_jfg12#P#p1000 +test_jfg test_jfg12#P#pmax +DROP DATABASE test_jfg; diff --cc mysql-test/t/partition_innodb.test index 7b5a69fe622,54994bc5a66..5dcb83b5737 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@@ -992,30 -999,32 +992,62 @@@ SELECT b FROM t1 WHERE b = 0 --disconnect con1 DROP TABLE t1; + --echo # + --echo # MDEV-11167: InnoDB: Warning: using a partial-field key prefix + --echo # in search, results in assertion failure or "Can't find record" error + --echo # + ++set @save_sql_mode = @@sql_mode; ++set sql_mode=""; + CREATE TABLE t1 (a INT) ENGINE=InnoDB; + CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2; + CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION; - ++ + INSERT INTO t1 VALUES (1),(2); + INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); + UPDATE v SET a = NULL; - ++ + DROP view v; + DROP TABLE t1, t2; + + SET @save_isp=@@innodb_stats_persistent; + SET GLOBAL innodb_stats_persistent= ON; + + CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2; + INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66); + CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION; + --error ER_VIEW_CHECK_FAILED + UPDATE v SET f2 = NULL; + + SET GLOBAL innodb_stats_persistent= @save_isp; + DROP view v; + DROP TABLE t; ++set sql_mode= @save_sql_mode; ++ +--echo # +--echo # Bug#26390658 RENAMING A PARTITIONED TABLE DOES NOT UPDATE +--echo # MYSQL.INNODB_TABLE_STATS +--echo # + +CREATE DATABASE test_jfg; + +CREATE TABLE test_jfg.test_jfg1 (id int(10) unsigned NOT NULL,PRIMARY +KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1; +CREATE TABLE test_jfg.test_jfg2 (id int(10) unsigned NOT NULL,PRIMARY +KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1 +PARTITION BY RANGE ( id ) (PARTITION p1000 VALUES LESS THAN (1000) +ENGINE = InnoDB,PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = +InnoDB); + +--replace_result #p# #P# +SELECT database_name, table_name FROM mysql.innodb_table_stats WHERE +database_name = 'test_jfg'; + +RENAME TABLE test_jfg.test_jfg1 TO test_jfg.test_jfg11; +RENAME TABLE test_jfg.test_jfg2 TO test_jfg.test_jfg12; + +--replace_result #p# #P# +SELECT database_name, table_name FROM mysql.innodb_table_stats WHERE +database_name = 'test_jfg'; +DROP DATABASE test_jfg;