Skip to content

Commit

Permalink
Merge 10.3 into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed May 25, 2021
2 parents 04de651 + 1864a8e commit 1dea7f7
Show file tree
Hide file tree
Showing 41 changed files with 509 additions and 92 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ FOREACH(_base
ENDIF()
ENDFOREACH()

IF(NOT RPM AND NOT DEB)
FOREACH(tool gtar tar)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()
ENDIF()

FIND_PACKAGE(Git)

Expand Down
13 changes: 13 additions & 0 deletions cmake/FindGit.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if(GIT_EXECUTABLE)
set(GIT_FOUND TRUE)
return()
endif()
if(DEFINED GIT_EXECUTABLE)
set(GIT_FOUND FALSE)
return()
endif()

set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
unset(CMAKE_MODULE_PATH)
include(FindGit)
set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
5 changes: 5 additions & 0 deletions cmake/FindJNI.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
if(JAVA_AWT_LIBRARY)
set(JNI_FOUND TRUE)
return()
endif()
if(DEFINED JAVA_AWT_LIBRARY)
set(JNI_FOUND FALSE)
return()
endif()

Expand Down
5 changes: 5 additions & 0 deletions cmake/FindJava.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
if(Java_JAVA_EXECUTABLE)
set(JAVA_FOUND TRUE)
return()
endif()
if(DEFINED Java_JAVA_EXECUTABLE)
set(JAVA_FOUND FALSE)
return()
endif()

Expand Down
6 changes: 6 additions & 0 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ ENDIF()

SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
SET(WITH_NUMA 0 CACHE BOOL "")
SET(CPU_LEVEL1_DCACHE_LINESIZE 0)

IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git)
SET(GIT_EXECUTABLE GIT_EXECUTABLE-NOTFOUND CACHE FILEPATH "")
ENDIF()

IF(WIN32)
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")
Expand Down
2 changes: 0 additions & 2 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)

Expand Down
4 changes: 4 additions & 0 deletions cmake/cpu_info.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

# Symbols with information about the CPU.

IF(NOT DEFINED CPU_LEVEL1_DCACHE_LINESIZE)

IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PROGRAM(SYSCTL sysctl)
MARK_AS_ADVANCED(SYSCTL)
Expand All @@ -37,3 +39,5 @@ ELSE()
)
ENDIF()
ENDIF()

ENDIF()
2 changes: 1 addition & 1 deletion dbug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
TARGET_LINK_LIBRARIES(factorial dbug)
ENDIF()

IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode AND NOT RPM AND NOT DEB)
FIND_PROGRAM(GROFF groff)
FIND_PROGRAM(NROFF nroff)
MARK_AS_ADVANCED(GROFF)
Expand Down
4 changes: 4 additions & 0 deletions debian/mariadb-plugin-connect.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
etc/mysql/conf.d/connect.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_connect.so
usr/share/mysql/Mongo2.jar
usr/share/mysql/Mongo3.jar
usr/share/mysql/JavaWrappers.jar
usr/share/mysql/JdbcInterface.jar
33 changes: 32 additions & 1 deletion mysql-test/main/ctype_filename.result
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,40 @@ SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a
@a BINARY @a REVERSE(@a) HEX(@a) HEX(REVERSE(@a))
aя a@r1 яa 61407231 40723161
#
# Beginning of 10.2 test.
#
# MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
# m_status == DA_OK_BULK' failed in Diagnostics_area::message from
# get_schema_tables_record
#
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
utf8 utf8 utf8
SET @old_character_set_client= @@character_set_client;
SET @old_character_set_connection= @@character_set_connection;
SET @old_character_set_results= @@character_set_results;
SET NAMES 'filename';
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'filename'
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
utf8 utf8 utf8
CREATE VIEW v2 AS SELECT 1;
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL VIEW NULL NULL
DROP VIEW v2;
SET @@character_set_client= @old_character_set_client;
SET @@character_set_connection= @old_character_set_connection;
SET @@character_set_results= @old_character_set_results;
#
# End of 10.2 test
#
#
# MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
#
SET CHARACTER_SET_CLIENT=17;
ERROR 42000: Variable 'character_set_client' can't be set to the value of '17'
SELECT doc.`Children`.0 FROM t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?Children??0?FROM?t1' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.0 FROM t1' at line 1
SET NAMES latin1;
# End of 10.3 tests
28 changes: 28 additions & 0 deletions mysql-test/main/ctype_filename.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,40 @@ select convert(convert(',' using filename) using binary);
SET NAMES utf8;
SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));

--echo #
--echo # Beginning of 10.2 test.
--echo #
--echo # MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
--echo # m_status == DA_OK_BULK' failed in Diagnostics_area::message from
--echo # get_schema_tables_record
--echo #

SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
SET @old_character_set_client= @@character_set_client;
SET @old_character_set_connection= @@character_set_connection;
SET @old_character_set_results= @@character_set_results;
--error ER_WRONG_VALUE_FOR_VAR
SET NAMES 'filename';
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
CREATE VIEW v2 AS SELECT 1;
SHOW TABLE STATUS;
DROP VIEW v2;
SET @@character_set_client= @old_character_set_client;
SET @@character_set_connection= @old_character_set_connection;
SET @@character_set_results= @old_character_set_results;

--echo #
--echo # End of 10.2 test
--echo #

--echo #
--echo # MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
--echo #

--error ER_WRONG_VALUE_FOR_VAR
SET CHARACTER_SET_CLIENT=17;
--error ER_PARSE_ERROR
SELECT doc.`Children`.0 FROM t1;
SET NAMES latin1;

--echo # End of 10.3 tests
2 changes: 1 addition & 1 deletion mysql-test/main/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
local-infile TRUE
lock-wait-timeout 86400
log-bin (No default value)
log-bin foo
log-bin-compress FALSE
log-bin-compress-min-len 256
log-bin-index (No default value)
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/mysqld--help.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# force symbolic-links=0 (valgrind build has a different default)
#

exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --log-bin=foo --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;

# The inline perl code below will copy $MYSQL_TMP_DIR/mysqld--help.txt
# to output, but filter away some variable stuff (e.g. paths).
Expand Down
21 changes: 20 additions & 1 deletion mysql-test/main/subselect4.result
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,15 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
a
DROP TABLE t1,t2;
# End of 10.2 tests
#
# MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
#
select 1 from dual where 1 in (select 5 from dual where 1);
1
create table t1 (a int);
insert into t1 values (1),(2),(3);
update t1 set a = 2 where a in (select a from dual where a = a);
drop table t1;
#
# MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
#
Expand Down Expand Up @@ -2847,6 +2855,17 @@ INSERT INTO t2 VALUES (3),(4);
SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
#
# MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
#
CREATE TABLE t1 (i1 int);
insert into t1 values (1),(2);
SELECT 1
FROM (t1 JOIN t1 AS ref_t1 ON
(t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
# End of 10.2 tests
# End of 10.3 tests
#
# MDEV-19134: EXISTS() slower if ORDER BY is defined
Expand Down
27 changes: 26 additions & 1 deletion mysql-test/main/subselect4.test
Original file line number Diff line number Diff line change
Expand Up @@ -2236,7 +2236,17 @@ SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);

DROP TABLE t1,t2;

--echo # End of 10.2 tests
--echo #
--echo # MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
--echo #

select 1 from dual where 1 in (select 5 from dual where 1);

create table t1 (a int);
insert into t1 values (1),(2),(3);

update t1 set a = 2 where a in (select a from dual where a = a);
drop table t1;

--echo #
--echo # MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
Expand Down Expand Up @@ -2353,6 +2363,21 @@ INSERT INTO t2 VALUES (3),(4); # Optional, fails either way
SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
drop table t1,t2;

--echo #
--echo # MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
--echo #
CREATE TABLE t1 (i1 int);
insert into t1 values (1),(2);

--error ER_SUBQUERY_NO_1_ROW
SELECT 1
FROM (t1 JOIN t1 AS ref_t1 ON
(t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));

DROP TABLE t1;

--echo # End of 10.2 tests

--echo # End of 10.3 tests

--echo #
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (f INT) ENGINE=INNODB
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f INT) ENGINE=INNODB
DROP TABLE t1,t2;
FLUSH LOGS;
RESET MASTER;
#
# Kill OPTIMIZE command after table modification
#
Expand Down
5 changes: 4 additions & 1 deletion mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SET debug_sync = 'reset';
--source include/show_binlog_events.inc
DROP TABLE t1,t2;

FLUSH LOGS;
RESET MASTER;

--echo #
--echo # Kill OPTIMIZE command after table modification
Expand All @@ -81,6 +81,9 @@ eval KILL $thd_id;
SET debug_sync = 'reset';
--disconnect con1

--let $wait_binlog_event= OPTIMIZE
--source include/wait_for_binlog_event.inc

DROP TABLE t1,t2;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
FLUSH LOGS;
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_reject_queries : assertion in inline_mysql_socket_send
galera_var_replicate_myisam_on : MDEV-24062 Galera test failure on galera_var_replicate_myisam_on
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
#galera_wan : MDEV-17259 Test failure on galera.galera_wan
mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' failed: 2000: Unknown MySQL error
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
#sql_log_bin : MDEV-21491 galera.sql_log_bin
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
pxc-421: wsrep_provider is read-only for security reasons
12 changes: 12 additions & 0 deletions mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-25271 Double free of table when inplace alter
# FTS add index fails
#
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: Error number .* means");
call mtr.add_suppression("InnoDB: Cannot create file");
call mtr.add_suppression("InnoDB: Failed to create");
CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
DROP TABLE t1;
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/suite/innodb_fts/r/misc_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
#
# MDEV-25663 Double free of transaction during TRUNCATE
#
call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)");
SET DEBUG_DBUG='-d,ib_create_table_fail_too_many_trx';
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET @save_dbug= @@debug_dbug;
SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
TRUNCATE t1;
ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB
SET debug_dbug=@save_dbug;
DROP TABLE t1;
# End of 10.3 tests
1 change: 1 addition & 0 deletions mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--enable-plugin-innodb-sys-tables
19 changes: 19 additions & 0 deletions mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,25 @@ ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # MDEV-25271 Double free of table when inplace alter
--echo # FTS add index fails
--echo #
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: Error number .* means");
call mtr.add_suppression("InnoDB: Cannot create file");
call mtr.add_suppression("InnoDB: Failed to create");

let MYSQLD_DATADIR=`select @@datadir`;
CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
let $fts_aux_file= `select concat('FTS_',right(concat(repeat('0',16), lower(hex(TABLE_ID))),16),'_BEING_DELETED.ibd') FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/t1'`;
write_file $MYSQLD_DATADIR/test/$fts_aux_file;
EOF
--error ER_GET_ERRNO
ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
DROP TABLE t1;
remove_file $MYSQLD_DATADIR/test/$fts_aux_file;

# Add more than one FTS index
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
Expand Down
Loading

0 comments on commit 1dea7f7

Please sign in to comment.