Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 22, 2020
2 parents 88d22f0 + 620ea81 commit e3d692a
Show file tree
Hide file tree
Showing 135 changed files with 1,982 additions and 579 deletions.
6 changes: 3 additions & 3 deletions cmake/check_linker_flag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ FUNCTION(MY_CHECK_AND_SET_LINKER_FLAG flag_to_set)
RETURN()
ENDIF()
STRING(REGEX REPLACE "[-,= +]" "_" result "HAVE_LINK_FLAG_${flag_to_set}")
SET(SAVE_CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_REQUIRED_LINK_OPTIONS}")
SET(SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
SET(CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS} ${flag_to_check})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${flag_to_check})
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result})
SET(CMAKE_REQUIRED_LINK_OPTIONS "${SAVE_CMAKE_REQUIRED_LINK_OPTIONS}")
SET(CMAKE_REQUIRED_LIBRARIES "${SAVE_CMAKE_REQUIRED_LIBRARIES}")
IF (${result})
FOREACH(linktype SHARED MODULE EXE)
IF(ARGN)
Expand Down
4 changes: 2 additions & 2 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ check_if_skip_database(
if (databases_exclude_hash &&
find_filter_in_hashtable(name, databases_exclude_hash,
&database) &&
!database->has_tables) {
(!database->has_tables || !databases_include_hash)) {
/* Database is found and there are no tables specified,
skip entire db. */
return DATABASE_SKIP;
Expand Down Expand Up @@ -2720,7 +2720,7 @@ static lsn_t xtrabackup_copy_log(lsn_t start_lsn, lsn_t end_lsn, bool last)
scanned_lsn += data_len;
} else if (data_len
>= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE
|| data_len <= LOG_BLOCK_HDR_SIZE) {
|| data_len < LOG_BLOCK_HDR_SIZE) {
/* We got a garbage block (abrupt end of the log). */
msg(0,"garbage block: " LSN_PF ",%zu",scanned_lsn, data_len);
break;
Expand Down
26 changes: 13 additions & 13 deletions man/mysqlimport.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ all would be imported into a table named
patient\&.
.PP
.PP
\fBmysqldump\fR
\fBmysqlimport\fR
supports the following options, which can be specified on the command line or in the
[mysqldump]
[mysqlimport]
and
[client]
option file groups\&.
\fBmysqldump\fR
\fBmysqlimport\fR
also supports the options for processing option files\&.
.sp
.RS 4
Expand Down Expand Up @@ -267,17 +267,17 @@ Empty the table before importing the text file\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysqldump: fields-terminated-by option
.\" fields-terminated-by option: mysqldump
.\" mysqlimport: fields-terminated-by option
.\" fields-terminated-by option: mysqlimport
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
.\" mysqldump: fields-enclosed-by option
.\" fields-enclosed-by option: mysqldump
.\" mysqlimport: fields-enclosed-by option
.\" fields-enclosed-by option: mysqlimport
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
.\" mysqldump: fields-optionally-enclosed-by option
.\" fields-optionally-enclosed-by option: mysqldump
.\" mysqlimport: fields-optionally-enclosed-by option
.\" fields-optionally-enclosed-by option: mysqlimport
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
.\" mysqldump: fields-escaped-by option
.\" fields-escaped-by option: mysqldump
.\" mysqlimport: fields-escaped-by option
.\" fields-escaped-by option: mysqlimport
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options have the same meaning as the corresponding clauses for
Expand Down Expand Up @@ -379,8 +379,8 @@ lines of the data file\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysqldump: lines-terminated-by option
.\" lines-terminated-by option: mysqldump
.\" mysqlimport: lines-terminated-by option
.\" lines-terminated-by option: mysqlimport
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
.sp
This option has the same meaning as the corresponding clause for
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/include/galera_have_debug_sync.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--disable_query_log

--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'`

--if (!$galera_have_debug_sync) {
--skip Test requires Galera debug library with debug_sync functionality
}

--enable_query_log
50 changes: 50 additions & 0 deletions mysql-test/include/icp_debug_kill.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/count_sessions.inc

--disable_warnings
drop table if exists t0,t1,t2;
--enable_warnings

create table t0(a int primary key);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

create table t1(a int primary key);
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;

create table t2 (
kp1 int,
kp2 int,
col char(100),
key(kp1, kp2)
);
insert into t2 select a, a, a from t1;

select engine from information_schema.tables
where table_schema=database() and table_name='t2';

explain
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;

let $target_id= `select connection_id()`;

set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
send
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;

connect (con1, localhost, root,,);
connection con1;
set debug_sync='now WAIT_FOR at_icp_check';
evalp kill query $target_id;
set debug_sync='now SIGNAL go';

connection default;

--error ER_QUERY_INTERRUPTED
reap;
set debug_sync='RESET';

disconnect con1;
drop table t0,t1,t2;
--source include/wait_until_count_sessions.inc

1 change: 1 addition & 0 deletions mysql-test/include/mtr_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ BEGIN
AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
AND variable_name not like 'GTID%POS'
AND variable_name != 'GTID_BINLOG_STATE'
AND variable_name != 'THREAD_POOL_SIZE'
ORDER BY variable_name;

-- Dump all databases, there should be none
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/main/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -2517,6 +2517,17 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2, t1;
#
# MDEV-18163: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_rnd_next(); / Assertion
# `table_list->table' failed in find_field_in_table_ref / ERROR 1901
# (on optimized builds)
#
CREATE TABLE t1 (k1 varchar(10) DEFAULT 5);
CREATE TABLE t2 (i1 int);
ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `k1`
DROP TABLE t1,t2;
#
# End of 10.2 tests
#
#
Expand Down
14 changes: 14 additions & 0 deletions mysql-test/main/alter_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,20 @@ ALTER TABLE t2 DROP CONSTRAINT PRIMARY KEY;
SHOW CREATE TABLE t2;
DROP TABLE t2, t1;

--echo #
--echo # MDEV-18163: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
--echo # m_lock_type != 2' failed in handler::ha_rnd_next(); / Assertion
--echo # `table_list->table' failed in find_field_in_table_ref / ERROR 1901
--echo # (on optimized builds)
--echo #


CREATE TABLE t1 (k1 varchar(10) DEFAULT 5);
CREATE TABLE t2 (i1 int);
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
DROP TABLE t1,t2;

--echo #
--echo # End of 10.2 tests
--echo #
Expand Down
34 changes: 34 additions & 0 deletions mysql-test/main/aria_icp_debug.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set default_storage_engine=aria;
drop table if exists t0,t1,t2;
create table t0(a int primary key);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int primary key);
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
create table t2 (
kp1 int,
kp2 int,
col char(100),
key(kp1, kp2)
);
insert into t2 select a, a, a from t1;
select engine from information_schema.tables
where table_schema=database() and table_name='t2';
engine
Aria
explain
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range kp1 kp1 5 NULL 10 Using index condition
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
connect con1, localhost, root,,;
connection con1;
set debug_sync='now WAIT_FOR at_icp_check';
kill query $target_id;
set debug_sync='now SIGNAL go';
connection default;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
disconnect con1;
drop table t0,t1,t2;
set default_storage_engine=default;
5 changes: 5 additions & 0 deletions mysql-test/main/aria_icp_debug.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

set default_storage_engine=aria;
--source include/icp_debug_kill.inc
set default_storage_engine=default;

14 changes: 4 additions & 10 deletions mysql-test/main/information_schema,debug.rdiff
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
--- mysql-test/main/information_schema.result
+++ mysql-test/main/information_schema.result
@@ -2208,9 +2208,11 @@
# Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
#
@@ -2210,7 +2210,7 @@
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-Warnings:
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
Warnings:
-Warning 1931 Query execution was interrupted. The query examined at least 671 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
+ERROR HY000: Unknown error
+SHOW WARNINGS;
+Level Code Message
+Error 1105 Unknown error
+Warning 1931 Query execution was interrupted. The query examined at least 11 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
+Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
#
# End of 10.2 Test
#
34 changes: 34 additions & 0 deletions mysql-test/main/innodb_icp_debug.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set default_storage_engine=innodb;
drop table if exists t0,t1,t2;
create table t0(a int primary key);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int primary key);
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
create table t2 (
kp1 int,
kp2 int,
col char(100),
key(kp1, kp2)
);
insert into t2 select a, a, a from t1;
select engine from information_schema.tables
where table_schema=database() and table_name='t2';
engine
InnoDB
explain
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range kp1 kp1 5 NULL 11 Using index condition
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
connect con1, localhost, root,,;
connection con1;
set debug_sync='now WAIT_FOR at_icp_check';
kill query $target_id;
set debug_sync='now SIGNAL go';
connection default;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
disconnect con1;
drop table t0,t1,t2;
set default_storage_engine=default;
6 changes: 6 additions & 0 deletions mysql-test/main/innodb_icp_debug.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--source include/have_innodb.inc

set default_storage_engine=innodb;
--source include/icp_debug_kill.inc
set default_storage_engine=default;

15 changes: 15 additions & 0 deletions mysql-test/main/limit_rows_examined.result
Original file line number Diff line number Diff line change
Expand Up @@ -861,3 +861,18 @@ Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 22 rows, which exceeds LIMIT ROWS EXAMINED (21). The query result may be incomplete
drop view v;
drop table t1, t2;
#
# 10.1 Test
#
# MDEV-17729: Assertion `! is_set() || m_can_overwrite_status'
# failed in Diagnostics_area::set_error_status
#
set @old_mode= @@sql_mode;
CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT, c CHAR(20));
INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0');
SET @@sql_mode='STRICT_TRANS_TABLES';
INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2;
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete
SET @@sql_mode=@old_mode;
DROP TABLE t1;
17 changes: 17 additions & 0 deletions mysql-test/main/limit_rows_examined.test
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,20 @@ EXECUTE ps;

drop view v;
drop table t1, t2;

--echo #
--echo # 10.1 Test
--echo #
--echo # MDEV-17729: Assertion `! is_set() || m_can_overwrite_status'
--echo # failed in Diagnostics_area::set_error_status
--echo #
set @old_mode= @@sql_mode;

CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT, c CHAR(20));
INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0');

SET @@sql_mode='STRICT_TRANS_TABLES';
INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2;

SET @@sql_mode=@old_mode;
DROP TABLE t1;
8 changes: 8 additions & 0 deletions mysql-test/main/log_tables.result
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@ slow_log
slow_log_new
drop table slow_log_new, general_log_new;
use test;
SET GLOBAL LOG_OUTPUT = 'FILE';
SET GLOBAL slow_query_log = 1;
SET GLOBAL general_log = 1;
ALTER TABLE mysql.slow_log ADD COLUMN comment_text TEXT NOT NULL;
ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL;
SET GLOBAL LOG_OUTPUT = 'NONE';
ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
ALTER TABLE mysql.general_log DROP COLUMN comment_text;
SET GLOBAL LOG_OUTPUT = 'TABLE';
SET GLOBAL general_log = 0;
FLUSH LOGS;
Expand Down
20 changes: 19 additions & 1 deletion mysql-test/main/log_tables.test
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ select * from general_log where argument like '%general_log%';

#
# Check some basic queries interfering with the log tables.
# In our test we'll use a tbale with verbose comments to the short
# In our test we'll use a table with verbose comments to the short
# command type names, used in the tables
#

Expand Down Expand Up @@ -474,6 +474,24 @@ show tables like "%log%";
drop table slow_log_new, general_log_new;
use test;

#
# Bug#69953 / MDEV-4851
# Log tables should be modifable on LOG_OUTPUT != TABLE
#
#

SET GLOBAL LOG_OUTPUT = 'FILE';
SET GLOBAL slow_query_log = 1;
SET GLOBAL general_log = 1;

ALTER TABLE mysql.slow_log ADD COLUMN comment_text TEXT NOT NULL;
ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL;

SET GLOBAL LOG_OUTPUT = 'NONE';
ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
ALTER TABLE mysql.general_log DROP COLUMN comment_text;


#
# Bug#27857 (Log tables supplies the wrong value for generating
# AUTO_INCREMENT numbers)
Expand Down
3 changes: 1 addition & 2 deletions mysql-test/main/multi_update_big.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
# The protocolling of many inserts into t1 is suppressed.
INSERT INTO t1 SELECT seq,seq FROM seq_1_to_2097152;
ALTER TABLE t1 ADD INDEX i1(a);
DELETE FROM t1 WHERE a > 2000000;
CREATE TABLE t2 LIKE t1;
Expand Down

0 comments on commit e3d692a

Please sign in to comment.