1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00

Merge branch '10.4' into 10.5

This commit is contained in:
Sergei Golubchik
2021-02-23 13:01:27 +01:00
89 changed files with 1850 additions and 1359 deletions

View File

@@ -14,16 +14,10 @@ SET DEBUG_SYNC = 'now SIGNAL dml_pause';
SET DEBUG_SYNC = 'now WAIT_FOR dml_restart';
ROLLBACK;
BEGIN;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920;
ROLLBACK;
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688;
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done';
connect con2, localhost,root,,test;

View File

@@ -70,6 +70,27 @@ ERROR HY000: Tablespace has been discarded for table `t`
ALTER TABLE t FORCE;
ERROR HY000: Tablespace has been discarded for table `t`
DROP TABLE t;
#
# MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS
#
CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a))
ENGINE=InnoDB;
ALTER TABLE t1 CHANGE COLUMN a u INT;
SELECT sf.* FROM information_schema.innodb_sys_fields sf
INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id
INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id
WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos;
INDEX_ID NAME POS
ID b 0
ID c 0
ID u 1
DROP TABLE t1;
#
# End of 10.2 tests
#
#
# Check that innodb supports transactional=1
#
create table t1 (a int) transactional=1 engine=aria;
create table t2 (a int) transactional=1 engine=innodb;
show create table t1;
@@ -86,6 +107,9 @@ alter table t1 engine=innodb;
alter table t1 add column b int;
drop table t1,t2;
#
# End of 10.4 tests
#
#
# MDEV-21748 ASAN use-after-poison in PageBulk::insertPage()
#
CREATE TABLE t1 (pk TIMESTAMP PRIMARY KEY, a TIMESTAMP NULL UNIQUE)

View File

@@ -492,11 +492,18 @@ DROP TABLE t1;
DROP PROCEDURE get_index_id;
DROP PROCEDURE get_table_id;
create table t (a varchar(100)) engine=innodb;
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len
from information_schema.innodb_sys_columns sc
inner join information_schema.innodb_sys_tables st
on sc.table_id=st.table_id where st.name='test/t' and sc.name='a';
name pos mtype prtype len
a 0 1 524303 100
alter table t modify a varchar(110), algorithm=inplace;
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len
from information_schema.innodb_sys_columns sc
inner join information_schema.innodb_sys_tables st
on sc.table_id=st.table_id where st.name='test/t' and sc.name='a';
name pos mtype prtype len
a 0 1 524303 110
drop table t;
# End of 10.2 tests

View File

@@ -27,17 +27,11 @@ SET DEBUG_SYNC = 'now WAIT_FOR dml_restart';
ROLLBACK;
BEGIN;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920;
ROLLBACK;
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688;
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done';

View File

@@ -80,9 +80,26 @@ ALTER TABLE t ENGINE INNODB;
ALTER TABLE t FORCE;
DROP TABLE t;
#
# Check that innodb supports transactional=1
#
--echo #
--echo # MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS
--echo #
CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a))
ENGINE=InnoDB;
ALTER TABLE t1 CHANGE COLUMN a u INT;
--replace_column 1 ID
SELECT sf.* FROM information_schema.innodb_sys_fields sf
INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id
INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id
WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
--echo #
--echo # Check that innodb supports transactional=1
--echo #
create table t1 (a int) transactional=1 engine=aria;
create table t2 (a int) transactional=1 engine=innodb;
@@ -92,6 +109,10 @@ alter table t1 engine=innodb;
alter table t1 add column b int;
drop table t1,t2;
--echo #
--echo # End of 10.4 tests
--echo #
--echo #
--echo # MDEV-21748 ASAN use-after-poison in PageBulk::insertPage()
--echo #

View File

@@ -361,7 +361,15 @@ DROP PROCEDURE get_table_id;
# LEN must increase here
create table t (a varchar(100)) engine=innodb;
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len
from information_schema.innodb_sys_columns sc
inner join information_schema.innodb_sys_tables st
on sc.table_id=st.table_id where st.name='test/t' and sc.name='a';
alter table t modify a varchar(110), algorithm=inplace;
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len
from information_schema.innodb_sys_columns sc
inner join information_schema.innodb_sys_tables st
on sc.table_id=st.table_id where st.name='test/t' and sc.name='a';
drop table t;
--echo # End of 10.2 tests

View File

@@ -1 +0,0 @@
--innodb_fast_shutdown=0

View File

@@ -1,49 +0,0 @@
# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes
# This test requires a fresh server start-up and a slow shutdown.
# This was a suspected bug (not a bug).
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
-- disable_query_log
call mtr.add_suppression('\\[ERROR\\] InnoDB: Table `mysql`.`innodb_(table|index)_stats` not found');
call mtr.add_suppression('\\[ERROR\\] InnoDB: Fetch of persistent statistics requested for table `mysql`.`gtid_executed`');
let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1);
let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1);
DROP TABLE mysql.innodb_index_stats;
DROP TABLE mysql.innodb_table_stats;
-- enable_query_log
CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0;
RENAME TABLE t TO u;
DROP TABLE u;
SELECT @@innodb_fast_shutdown;
let $MYSQLD_DATADIR=`select @@datadir`;
--source include/shutdown_mysqld.inc
# Check the tail of ID_IND (SYS_TABLES.ID)
let IBDATA1=$MYSQLD_DATADIR/ibdata1;
perl;
my $file = $ENV{'IBDATA1'};
open(FILE, "<$file") || die "Unable to open $file";
# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID).
seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file";
die unless read(FILE, $_, 4) == 4;
my $sys_tables_id_root = unpack("N", $_);
print "Last record of ID_IND root page ($sys_tables_id_root):\n";
# This should be the last record in ID_IND. Dump it in hexadecimal.
seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file";
read(FILE, $_, 32) || die "Unable to read $file";
close(FILE);
print unpack("H*", $_), "\n";
EOF
--source include/start_mysqld.inc
-- disable_query_log
USE mysql;
eval $create1;
eval $create2;