Skip to content

Commit

Permalink
Merge 10.8 into 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 3, 2022
2 parents 177345d + c8a1858 commit 15ce270
Show file tree
Hide file tree
Showing 21 changed files with 180 additions and 39 deletions.
2 changes: 1 addition & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void CorruptedPages::zero_out_free_pages()
die("Can't zero out corrupted page " UINT32PF " of tablespace %s",
*page_it, space_name.c_str());
msg("Corrupted page " UINT32PF
" of tablespace %s was successfuly fixed.",
" of tablespace %s was successfully fixed.",
*page_it, space_name.c_str());
}
}
Expand Down
7 changes: 6 additions & 1 deletion mysql-test/main/desc_index_range.result
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ set optimizer_trace=default;
#
# MDEV-27426: Wrong result upon query using index_merge with DESC key
#
CREATE OR REPLACE TABLE t1 (pk INT, a INT, b int, KEY(a), PRIMARY KEY(pk DESC)) ENGINE=InnoDB;
CREATE TABLE t1 (pk INT, a INT, b int, KEY(a), PRIMARY KEY(pk DESC))
ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,4,5),(2,9,6),(3,NULL,7),(4,NULL,8);
SELECT * FROM t1 WHERE pk > 10 OR a > 0;
pk a b
Expand All @@ -204,6 +205,10 @@ insert into t1 values (0, 111111, 255);
insert into t1 select seq+50000, NULL, seq+1000 from seq_1_to_260;
insert into t1 values (10000, NULL, 255);
insert into t1 select seq+20000, seq+20000, seq+20000 from seq_1_to_1500;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# Must use ROR-intersect:
explain select * from t1 where b = 255 AND a IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
Expand Down
5 changes: 4 additions & 1 deletion mysql-test/main/desc_index_range.test
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ set optimizer_trace=default;
--echo # MDEV-27426: Wrong result upon query using index_merge with DESC key
--echo #

CREATE OR REPLACE TABLE t1 (pk INT, a INT, b int, KEY(a), PRIMARY KEY(pk DESC)) ENGINE=InnoDB;
CREATE TABLE t1 (pk INT, a INT, b int, KEY(a), PRIMARY KEY(pk DESC))
ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,4,5),(2,9,6),(3,NULL,7),(4,NULL,8);

SELECT * FROM t1 WHERE pk > 10 OR a > 0;
Expand All @@ -118,6 +119,8 @@ insert into t1 select seq+50000, NULL, seq+1000 from seq_1_to_260;
insert into t1 values (10000, NULL, 255);
insert into t1 select seq+20000, seq+20000, seq+20000 from seq_1_to_1500;

analyze table t1;

--echo # Must use ROR-intersect:
explain select * from t1 where b = 255 AND a IS NULL;
select * from t1 where b = 255 AND a IS NULL;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/dyncol.result
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ select column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int);
column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int)
NULL
set names latin1;
# column existance test (names)
# column existence test (names)
set names utf8;
select column_exists(column_create("адын", 1212), "адын");
column_exists(column_create("адын", 1212), "адын")
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/dyncol.test
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ select column_get(column_create("1212", 2, "адын", 1, 3, 3), 4 as int);
select column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int);
set names latin1;

--echo # column existance test (names)
--echo # column existence test (names)
set names utf8;
select column_exists(column_create("адын", 1212), "адын");
select column_exists(column_create("адын", 1212), "aады");
Expand Down
5 changes: 3 additions & 2 deletions mysql-test/main/group_min_max.result
Original file line number Diff line number Diff line change
Expand Up @@ -4057,9 +4057,10 @@ KEY `index_t1_on_owner_id_and_foo` (`owner_id`,`foo`)
INSERT INTO t1 (owner_id, foo, whatever)
VALUES (1, TRUE, "yello"), (1, FALSE, "yello"), (2, TRUE, "yello"),
(2, TRUE, "yello"), (2, FALSE, "yello");
EXPLAIN SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
EXPLAIN
SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL index_t1_on_owner_id_and_foo 7 NULL 5 Using where; Using index
1 SIMPLE t1 index NULL index_t1_on_owner_id_and_foo 7 NULL # Using where; Using index
SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
owner_id
1
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/main/group_min_max.test
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,9 @@ CREATE TABLE `t1` (
INSERT INTO t1 (owner_id, foo, whatever)
VALUES (1, TRUE, "yello"), (1, FALSE, "yello"), (2, TRUE, "yello"),
(2, TRUE, "yello"), (2, FALSE, "yello");
EXPLAIN SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
--replace_column 9 #
EXPLAIN
SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
SELECT DISTINCT owner_id FROM t1 WHERE foo = true GROUP BY owner_id HAVING (COUNT(*) = 1);
DROP TABLE t1;

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/archive/discover.result
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ drop table t1;
db.opt
t0.ARZ
#
# discover of table non-existance on drop
# discover of table non-existence on drop
#
select * from t0;
a
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/archive/discover.test
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ drop table t1;
--list_files $mysqld_datadir/test

--echo #
--echo # discover of table non-existance on drop
--echo # discover of table non-existence on drop
--echo #
select * from t0;
remove_file $mysqld_datadir/test/t0.ARZ;
Expand Down Expand Up @@ -119,7 +119,7 @@ select * from t1;
--list_files $mysqld_datadir/test

#
# MDEV-4955 discover of table non-existance on CREATE
# MDEV-4955 discover of table non-existence on CREATE
#
create table t1 (a int) engine=archive;
select * from t1;
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/innodb/r/default_row_format_create.result
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
DROP TABLE IF EXISTS t;
SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY)
ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB;
SET GLOBAL innodb_compression_level=0;
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
DROP TABLE t;
TRUNCATE tt;
SET GLOBAL innodb_compression_level=@save_level;
3 changes: 3 additions & 0 deletions mysql-test/suite/innodb/t/default_row_format_create.test
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ DROP TABLE IF EXISTS t;

SET GLOBAL innodb_compression_level=1;
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY)
ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB;
SET GLOBAL innodb_compression_level=0;
--error ER_ILLEGAL_HA_CREATE_OPTION
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
--error ER_CANT_CREATE_TABLE
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
DROP TABLE t;
TRUNCATE tt;
SET GLOBAL innodb_compression_level=@save_level;
4 changes: 2 additions & 2 deletions mysql-test/suite/mariabackup/log_page_corruption.result
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ test/t3_inc
------
# Full backup prepare
# "innodb_corrupted_pages" file must not exist after successful prepare
FOUND 1 /was successfuly fixed.*/ in backup.log
FOUND 1 /was successfully fixed.*/ in backup.log
# Check that fixed pages are zero-filled
# Incremental backup prepare
# "innodb_corrupted_pages" file must not exist after successful prepare
# do not remove "innodb_corrupted_pages" in incremental dir
FOUND 1 /was successfuly fixed.*/ in backup.log
FOUND 1 /was successfully fixed.*/ in backup.log
# Check that fixed pages are zero-filled
# shutdown server
# remove datadir
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/mariabackup/log_page_corruption.test
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir > $backuplog;
--echo # "innodb_corrupted_pages" file must not exist after successful prepare
--error 1
--file_exists $targetdir/innodb_corrupted_pages
--let SEARCH_PATTERN=was successfuly fixed.*
--let SEARCH_PATTERN=was successfully fixed.*
--let SEARCH_FILE=$backuplog
--source include/search_pattern_in_file.inc

Expand All @@ -347,7 +347,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir --incremental-dir=$incdir > $
--file_exists $targetdir/innodb_corrupted_pages
--echo # do not remove "innodb_corrupted_pages" in incremental dir
--file_exists $incdir/innodb_corrupted_pages
--let SEARCH_PATTERN=was successfuly fixed.*
--let SEARCH_PATTERN=was successfully fixed.*
--let SEARCH_FILE=$backuplog
--source include/search_pattern_in_file.inc

Expand Down
70 changes: 70 additions & 0 deletions mysql-test/suite/parts/r/engine_defined_part_attributes.result
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,73 @@ SUBPARTITION BY HASH (`id`)
(SUBPARTITION `spt3` ENGINE = InnoDB,
SUBPARTITION `spt4` ENGINE = InnoDB))
DROP TABLE `t11`;
#
# MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values
#
# restart: --innodb-sys-tablespaces
CREATE TABLE `t12` (
id INT
) ENGINE=InnoDB PARTITION BY HASH(id)
(
pt1 PAGE_COMPRESSED=0
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
name flag
test/t12#P#pt1 21
ALTER TABLE `t12` ADD PARTITION (
PARTITION pt2 PAGE_COMPRESSED=1
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
name flag
test/t12#P#pt1 21
test/t12#P#pt2 1610612789
ALTER TABLE `t12` ADD PARTITION (
PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';
name flag
test/t12#P#pt1 21
test/t12#P#pt2 1610612789
test/t12#P#pt3 805306421
DROP TABLE `t12`;
CREATE TABLE `t13` (
`id` INT
) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) (
PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0,
PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
PARTITION pt3 VALUES LESS THAN MAXVALUE
);
SHOW CREATE TABLE `t13`;
Table Create Table
t13 CREATE TABLE `t13` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1
PARTITION BY RANGE (`id`)
(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 0,
PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3,
PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
name flag
test/t13#P#pt1 21
test/t13#P#pt2 805306421
test/t13#P#pt3 1610612789
ALTER TABLE `t13` PARTITION BY RANGE(id) (
PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
PARTITION pt2 VALUES LESS THAN (200),
PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0
);
SHOW CREATE TABLE `t13`;
Table Create Table
t13 CREATE TABLE `t13` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1
PARTITION BY RANGE (`id`)
(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3,
PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB,
PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB PAGE_COMPRESSED = 0)
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';
name flag
test/t13#P#pt1 805306421
test/t13#P#pt2 1610612789
test/t13#P#pt3 21
DROP TABLE `t13`;
47 changes: 47 additions & 0 deletions mysql-test/suite/parts/t/engine_defined_part_attributes.test
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,50 @@ SUBPARTITION BY HASH(id) (
SHOW CREATE TABLE `t11`;

DROP TABLE `t11`;

--echo #
--echo # MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values
--echo #

--let $restart_parameters= --innodb-sys-tablespaces
--source include/restart_mysqld.inc

CREATE TABLE `t12` (
id INT
) ENGINE=InnoDB PARTITION BY HASH(id)
(
pt1 PAGE_COMPRESSED=0
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

ALTER TABLE `t12` ADD PARTITION (
PARTITION pt2 PAGE_COMPRESSED=1
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

ALTER TABLE `t12` ADD PARTITION (
PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3
);
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

DROP TABLE `t12`;

CREATE TABLE `t13` (
`id` INT
) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) (
PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0,
PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
PARTITION pt3 VALUES LESS THAN MAXVALUE
);
SHOW CREATE TABLE `t13`;
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';

ALTER TABLE `t13` PARTITION BY RANGE(id) (
PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3,
PARTITION pt2 VALUES LESS THAN (200),
PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0
);
SHOW CREATE TABLE `t13`;
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';

DROP TABLE `t13`;
4 changes: 2 additions & 2 deletions scripts/sys_schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5367,9 +5367,9 @@ name, then 'TEMPORARY' will be returned.

##### Parameters

* in_db (VARCHAR(64)): The database name to check for the existance of the table in.
* in_db (VARCHAR(64)): The database name to check for the existence of the table in.

* in_table (VARCHAR(64)): The name of the table to check the existance of.
* in_table (VARCHAR(64)): The name of the table to check the existence of.

* out_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY'): The return value: whether the table exists. The value is one of:
- '' - the table does not exist neither as a base table, view, nor temporary table.
Expand Down
4 changes: 2 additions & 2 deletions scripts/sys_schema/procedures/table_exists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE table_exists (
-----------
in_db (VARCHAR(64)):
The database name to check for the existance of the table in.
The database name to check for the existence of the table in.
in_table (VARCHAR(64)):
The name of the table to check the existance of.
The name of the table to check the existence of.
out_exists ENUM('''', ''BASE TABLE'', ''VIEW'', ''TEMPORARY''):
The return value: whether the table exists. The value is one of:
Expand Down
2 changes: 1 addition & 1 deletion sql/semisync_master_ack_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Select_socket_listener

bool listen_on_sockets()
{
/* Reinitialze the fds with active fds before calling select */
/* Reinitialize the fds with active fds before calling select */
m_fds= m_init_fds;
struct timeval tv= {1,0};
/* select requires max fd + 1 for the first argument */
Expand Down
4 changes: 3 additions & 1 deletion sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4497,7 +4497,7 @@ int create_table_impl(THD *thd,
else if (options.if_not_exists())
{
/*
We never come here as part of normal create table as table existance
We never come here as part of normal create table as table existence
is checked in open_and_lock_tables(). We may come here as part of
ALTER TABLE when converting a table for a distributed engine to a
a local one.
Expand Down Expand Up @@ -10318,6 +10318,8 @@ do_continue:;
{
DBUG_RETURN(true);
}
if (parse_engine_part_options(thd, table))
DBUG_RETURN(true);
}
#endif

Expand Down
Loading

0 comments on commit 15ce270

Please sign in to comment.