Skip to content

Commit

Permalink
Merge branch 'bb-10.5-release' into 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed May 7, 2021
2 parents a5b3982 + 3f55c56 commit 35977e8
Show file tree
Hide file tree
Showing 110 changed files with 1,800 additions and 533 deletions.
27 changes: 13 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
PROJECT(MySQL)

# Remove the following comment if you don't want to have striped binaries
# in RPM's:
Expand Down Expand Up @@ -49,8 +50,16 @@ IF(NOT DEFINED MANUFACTURER)
MARK_AS_ADVANCED(MANUFACTURER)
ENDIF()

SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# Setting build type to RelWithDebInfo as none was specified.")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
FORCE)
# Set the possible values of build type for cmake-gui
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF()


# MAX_INDEXES - Set the maximum number of indexes per table, default 64
SET(MAX_INDEXES 64 CACHE STRING "Max number of indexes")
Expand All @@ -76,18 +85,8 @@ IF(UNIX AND NOT APPLE)
MARK_AS_ADVANCED(WITH_PIC)
ENDIF()

# Optionally set project name, e.g.
# foo.xcodeproj (mac) or foo.sln (windows)
# This is used by TokuDB only
SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
IF(DEFINED MYSQL_PROJECT_NAME)
SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
ELSE()
SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
MARK_AS_ADVANCED(MYSQL_PROJECT_NAME)
ENDIF()
PROJECT(${MYSQL_PROJECT_NAME})

IF(CMAKE_VERSION VERSION_LESS "3.1")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down
2 changes: 1 addition & 1 deletion cmake/libutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
LIST(REVERSE OSLIBS)
LIST(REMOVE_DUPLICATES OSLIBS)
LIST(REVERSE OSLIBS)
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
TARGET_LINK_LIBRARIES(${TARGET} LINK_PRIVATE ${OSLIBS})
ENDIF()

# Make the generated dummy source file depended on all static input
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Build-Depends: bison,
cracklib-runtime <!nocheck>,
debhelper (>= 9.20160709~),
dh-exec,
dh-systemd,
flex [amd64],
gdb <!nocheck>,
libaio-dev [linux-any],
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
4 changes: 2 additions & 2 deletions libmysqld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ IF(NOT DISABLE_SHARED)
# libmysqld
SET_TARGET_PROPERTIES(libmysqld PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(mysqlserver PROPERTIES CLEAN_DIRECT_OUTPUT 1)
TARGET_LINK_LIBRARIES(mysqlserver tpool)
TARGET_LINK_LIBRARIES(mysqlserver LINK_PRIVATE tpool ${CRC32_LIBRARY})
IF(LIBMYSQLD_SO_EXTRA_LIBS)
TARGET_LINK_LIBRARIES(libmysqld ${LIBMYSQLD_SO_EXTRA_LIBS})
TARGET_LINK_LIBRARIES(libmysqld LINK_PRIVATE ${LIBMYSQLD_SO_EXTRA_LIBS})
ENDIF()
ENDIF()
ENDIF()
34 changes: 34 additions & 0 deletions mysql-test/main/derived_split_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,37 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DERIVED t2 index NULL PRIMARY 4 NULL 3
drop view v1;
drop table t1,t2;
#
# MDEV-23723: Crash when test_if_skip_sort_order() is checked for derived table subject to split
#
CREATE TABLE t1 (a INT, b INT, KEY (a), KEY (a,b)) ENGINE=InnoDB;
CREATE TABLE t2 (c INT, KEY (c)) ENGINE=InnoDB;
SELECT * FROM t1 t1a JOIN t1 t1b;
a b a b
INSERT INTO t2 VALUES (1),(2);
INSERT INTO t1 VALUES (1,2),(3,4),(5,6),(7,8),(9,10),(11,12);
set statement optimizer_switch='split_materialized=off' for EXPLAIN
SELECT *
FROM
t1 JOIN
(SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
WHERE
t1.a = dt.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a,a_2 a_2 10 NULL 6 Using where; Using index
1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2
3 DERIVED t1 index NULL a_2 10 NULL 6 Using where; Using index
3 DERIVED t2 ref c c 5 test.t1.b 1 Using index
set statement optimizer_switch='split_materialized=on' for EXPLAIN
SELECT *
FROM
t1 JOIN
(SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
WHERE
t1.a = dt.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a,a_2 a_2 10 NULL 6 Using where; Using index
1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2
3 LATERAL DERIVED t1 ref a,a_2 a 5 test.t1.a 1 Using where; Using temporary; Using filesort
3 LATERAL DERIVED t2 ref c c 5 test.t1.b 1 Using index
DROP TABLE t1, t2;
26 changes: 26 additions & 0 deletions mysql-test/main/derived_split_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,29 @@ eval set statement optimizer_switch='split_materialized=off' for explain $q;
drop view v1;

drop table t1,t2;

--echo #
--echo # MDEV-23723: Crash when test_if_skip_sort_order() is checked for derived table subject to split
--echo #
CREATE TABLE t1 (a INT, b INT, KEY (a), KEY (a,b)) ENGINE=InnoDB;
CREATE TABLE t2 (c INT, KEY (c)) ENGINE=InnoDB;

SELECT * FROM t1 t1a JOIN t1 t1b;

INSERT INTO t2 VALUES (1),(2);
INSERT INTO t1 VALUES (1,2),(3,4),(5,6),(7,8),(9,10),(11,12);

let $query=
EXPLAIN
SELECT *
FROM
t1 JOIN
(SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
WHERE
t1.a = dt.a;

eval set statement optimizer_switch='split_materialized=off' for $query;
eval set statement optimizer_switch='split_materialized=on' for $query;

DROP TABLE t1, t2;

47 changes: 40 additions & 7 deletions mysql-test/main/lowercase_table.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
drop table if exists t1,t2,t3,t4;
drop table if exists t0,t5,t6,t7,t8,t9;
drop database if exists mysqltest;
drop view if exists v0, v1, v2, v3, v4;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
Expand Down Expand Up @@ -79,13 +75,21 @@ ERROR 42000: Not unique table/alias: 'C'
select C.a, c.a from t1 c, t2 C;
ERROR 42000: Not unique table/alias: 'C'
drop table t1, t2;
#
# Bug #9761: CREATE TABLE ... LIKE ... not handled correctly when lower_case_table_names is set
#
create table t1 (a int);
create table t2 like T1;
drop table t1, t2;
show tables;
Tables_in_test
#
# End of 4.1 tests
#
#
# Bug#20404: SHOW CREATE TABLE fails with Turkish I
#
set names utf8;
drop table if exists İ,İİ;
create table İ (s1 int);
show create table İ;
Table Create Table
Expand All @@ -107,7 +111,12 @@ Tables_in_test
ii
drop table İİ;
set names latin1;
End of 5.0 tests
#
# End of 5.0 tests
#
#
# Bug#21317: SHOW CREATE DATABASE does not obey to lower_case_table_names
#
create database mysql_TEST character set latin2;
create table mysql_TEST.T1 (a int);
show create database mysql_TEST;
Expand All @@ -126,8 +135,32 @@ show databases like "mysql_TE%";
Database (mysql_TE%)
mysql_test
drop database mysql_TEST;
End of 10.0 tests
#
# End of 10.0 tests
#
#
# MDEV-17148 DROP DATABASE throw "Directory not empty" after changed lower_case_table_names.
#
create database db1;
create table t1 (a int);
drop database db1;
drop table t1;
#
# End of 10.2 tests
#
#
# MDEV-25109 Server crashes in sp_name::sp_name upon invalid data in mysql.proc
#
call mtr.add_suppression("Stored routine ''.'': invalid value in column");
insert ignore into mysql.proc () values ();
Warnings:
Warning 1364 Field 'param_list' doesn't have a default value
Warning 1364 Field 'returns' doesn't have a default value
Warning 1364 Field 'body' doesn't have a default value
Warning 1364 Field 'comment' doesn't have a default value
show function status;
ERROR 42000: Incorrect routine name ''
delete from mysql.proc where name = '';
#
# End of 10.3 tests
#
69 changes: 39 additions & 30 deletions mysql-test/main/lowercase_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
# Test of --lower-case-table-names
#

--disable_warnings
drop table if exists t1,t2,t3,t4;
# Clear up from other tests (to ensure that SHOW TABLES below is right)
drop table if exists t0,t5,t6,t7,t8,t9;
drop database if exists mysqltest;
drop view if exists v0, v1, v2, v3, v4;
--enable_warnings

create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
Expand Down Expand Up @@ -68,32 +60,29 @@ drop table t1,t2;
#
create table t1 (a int);
create table t2 (a int);
-- error 1066
--error ER_NONUNIQ_TABLE
select * from t1 c, t2 C;
-- error 1066
--error ER_NONUNIQ_TABLE
select C.a, c.a from t1 c, t2 C;
drop table t1, t2;

#
# Bug #9761: CREATE TABLE ... LIKE ... not handled correctly when
# lower_case_table_names is set
--echo #
--echo # Bug #9761: CREATE TABLE ... LIKE ... not handled correctly when lower_case_table_names is set
--echo #

create table t1 (a int);
create table t2 like T1;
drop table t1, t2;

show tables;
--echo #
--echo # End of 4.1 tests
--echo #

# End of 4.1 tests


#
# Bug#20404: SHOW CREATE TABLE fails with Turkish I
#
--echo #
--echo # Bug#20404: SHOW CREATE TABLE fails with Turkish I
--echo #
set names utf8;
--disable_warnings
drop table if exists İ,İİ;
--enable_warnings
create table İ (s1 int);
show create table İ;
show tables;
Expand All @@ -104,11 +93,13 @@ show tables;
drop table İİ;
set names latin1;

--echo End of 5.0 tests
--echo #
--echo # End of 5.0 tests
--echo #

#
# Bug#21317: SHOW CREATE DATABASE does not obey to lower_case_table_names
#
--echo #
--echo # Bug#21317: SHOW CREATE DATABASE does not obey to lower_case_table_names
--echo #
create database mysql_TEST character set latin2;
create table mysql_TEST.T1 (a int);
show create database mysql_TEST;
Expand All @@ -117,11 +108,13 @@ show databases like "mysql%";
show databases like "mysql_TE%";
drop database mysql_TEST;

--echo End of 10.0 tests
--echo #
--echo # End of 10.0 tests
--echo #

#
# MDEV-17148 DROP DATABASE throw "Directory not empty" after changed lower_case_table_names.
#
--echo #
--echo # MDEV-17148 DROP DATABASE throw "Directory not empty" after changed lower_case_table_names.
--echo #

let $datadir=`select @@datadir`;
create database db1;
Expand All @@ -130,3 +123,19 @@ copy_file $datadir/test/t1.frm $datadir/db1/T1.frm;
drop database db1;
drop table t1;

--echo #
--echo # End of 10.2 tests
--echo #

--echo #
--echo # MDEV-25109 Server crashes in sp_name::sp_name upon invalid data in mysql.proc
--echo #
call mtr.add_suppression("Stored routine ''.'': invalid value in column");
insert ignore into mysql.proc () values ();
--error ER_SP_WRONG_NAME
show function status;
delete from mysql.proc where name = '';

--echo #
--echo # End of 10.3 tests
--echo #
15 changes: 15 additions & 0 deletions mysql-test/main/mdev19198.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE t1 (c INT);
CREATE TABLE t2 (c INT);
LOCK TABLES t1 WRITE, t2 READ;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
Warnings:
Note 1050 Table 't1' already exists
UNLOCK TABLES;
LOCK TABLES t1 READ , t2 READ;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
Warnings:
Note 1050 Table 't1' already exists
DROP TABLES t1,t2;
15 changes: 15 additions & 0 deletions mysql-test/main/mdev19198.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE t1 (c INT);
CREATE TABLE t2 (c INT);

LOCK TABLES t1 WRITE, t2 READ;
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
UNLOCK TABLES;

LOCK TABLES t1 READ , t2 READ;
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
UNLOCK TABLES;

CREATE TABLE IF NOT EXISTS t1 LIKE t2;

DROP TABLES t1,t2;
Loading

0 comments on commit 35977e8

Please sign in to comment.