Skip to content

Commit 72753d2

Browse files
committed
Merge branch 'bb-10.3-release' into 10.3
2 parents 625e44a + 4f143a8 commit 72753d2

File tree

96 files changed

+1764
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1764
-492
lines changed

CMakeLists.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
# along with this program; if not, write to the Free Software
1515
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
1616

17-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
17+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
18+
PROJECT(MySQL)
1819

1920
IF(POLICY CMP0022)
2021
CMAKE_POLICY(SET CMP0022 NEW)
@@ -41,8 +42,16 @@ IF(NOT DEFINED MANUFACTURER)
4142
MARK_AS_ADVANCED(MANUFACTURER)
4243
ENDIF()
4344

44-
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
45-
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
45+
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
46+
# Setting build type to RelWithDebInfo as none was specified.")
47+
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
48+
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
49+
FORCE)
50+
# Set the possible values of build type for cmake-gui
51+
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
52+
"None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
53+
ENDIF()
54+
4655

4756
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
4857
IF (NOT MAX_INDEXES)
@@ -71,18 +80,8 @@ IF(UNIX AND NOT APPLE)
7180
MARK_AS_ADVANCED(WITH_PIC)
7281
ENDIF()
7382

74-
# Optionally set project name, e.g.
75-
# foo.xcodeproj (mac) or foo.sln (windows)
83+
# This is used by TokuDB only
7684
SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
77-
IF(DEFINED MYSQL_PROJECT_NAME)
78-
SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING
79-
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
80-
ELSE()
81-
SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING
82-
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
83-
MARK_AS_ADVANCED(MYSQL_PROJECT_NAME)
84-
ENDIF()
85-
PROJECT(${MYSQL_PROJECT_NAME})
8685

8786
SET(CPACK_PACKAGE_NAME "MariaDB")
8887
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB: a very fast and robust SQL database server")

cmake/libutils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
166166
ENDFOREACH()
167167
IF(OSLIBS)
168168
LIST(REMOVE_DUPLICATES OSLIBS)
169-
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
169+
TARGET_LINK_LIBRARIES(${TARGET} LINK_PRIVATE ${OSLIBS})
170170
ENDIF()
171171

172172
# Make the generated dummy source file depended on all static input

libmariadb

libmysqld/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ IF(NOT DISABLE_SHARED)
446446
# Clean direct output flags, as 2 targets have the same base name
447447
# libmysqld
448448
SET_TARGET_PROPERTIES(libmysqld PROPERTIES CLEAN_DIRECT_OUTPUT 1)
449-
TARGET_LINK_LIBRARIES(libmysqld ${CRC32_LIBRARY})
449+
TARGET_LINK_LIBRARIES(libmysqld LINK_PRIVATE ${CRC32_LIBRARY})
450450
SET_TARGET_PROPERTIES(mysqlserver PROPERTIES CLEAN_DIRECT_OUTPUT 1)
451-
TARGET_LINK_LIBRARIES(mysqlserver ${CRC32_LIBRARY})
451+
TARGET_LINK_LIBRARIES(mysqlserver LINK_PRIVATE ${CRC32_LIBRARY})
452452
IF(LIBMYSQLD_SO_EXTRA_LIBS)
453453
TARGET_LINK_LIBRARIES(libmysqld ${LIBMYSQLD_SO_EXTRA_LIBS})
454454
ENDIF()

mysql-test/main/mdev19198.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TABLE t1 (c INT);
2+
CREATE TABLE t2 (c INT);
3+
LOCK TABLES t1 WRITE, t2 READ;
4+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
5+
Warnings:
6+
Note 1050 Table 't1' already exists
7+
UNLOCK TABLES;
8+
LOCK TABLES t1 READ , t2 READ;
9+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
10+
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
11+
UNLOCK TABLES;
12+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
13+
Warnings:
14+
Note 1050 Table 't1' already exists
15+
DROP TABLES t1,t2;

mysql-test/main/mdev19198.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TABLE t1 (c INT);
2+
CREATE TABLE t2 (c INT);
3+
4+
LOCK TABLES t1 WRITE, t2 READ;
5+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
6+
UNLOCK TABLES;
7+
8+
LOCK TABLES t1 READ , t2 READ;
9+
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
10+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
11+
UNLOCK TABLES;
12+
13+
CREATE TABLE IF NOT EXISTS t1 LIKE t2;
14+
15+
DROP TABLES t1,t2;

mysql-test/main/plugin_vars.result

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,38 @@ disconnect con2;
3030
USE test;
3131
DROP PROCEDURE p_install;
3232
DROP PROCEDURE p_show_vars;
33+
#
34+
# Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
35+
#
36+
## prepared SET with a plugin variable prevents uninstall
37+
install plugin query_response_time soname 'query_response_time';
38+
prepare s from 'set global query_response_time_range_base=16';
39+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
40+
plugin_status
41+
ACTIVE
42+
uninstall plugin query_response_time;
43+
Warnings:
44+
Warning 1620 Plugin is busy and will be uninstalled on shutdown
45+
execute s;
46+
execute s;
47+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
48+
plugin_status
49+
DELETED
50+
deallocate prepare s;
51+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
52+
plugin_status
53+
## prepared SET mentioning a plugin otherwise does not prevent uninstall
54+
install plugin archive soname 'ha_archive';
55+
create table t1 (a int) engine=archive;
56+
insert t1 values (1),(2),(3);
57+
prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
58+
flush tables;
59+
select plugin_status from information_schema.plugins where plugin_name='archive';
60+
plugin_status
61+
ACTIVE
62+
uninstall plugin archive;
63+
select plugin_status from information_schema.plugins where plugin_name='archive';
64+
plugin_status
65+
execute s;
66+
ERROR 42000: Unknown storage engine 'ARCHIVE'
67+
drop table t1;

mysql-test/main/plugin_vars.test

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
if (!$QUERY_RESPONSE_TIME_SO) {
2+
skip Needs query_response_time loadable plugin;
3+
}
4+
if (!$HA_ARCHIVE_SO) {
5+
skip Needs Archive loadable plugin;
6+
}
7+
18
--echo #
29
--echo # MDEV-5345 - Deadlock between mysql_change_user(), SHOW VARIABLES and
310
--echo # INSTALL PLUGIN
@@ -54,3 +61,31 @@ disconnect con2;
5461
USE test;
5562
DROP PROCEDURE p_install;
5663
DROP PROCEDURE p_show_vars;
64+
65+
--echo #
66+
--echo # Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
67+
--echo #
68+
69+
--echo ## prepared SET with a plugin variable prevents uninstall
70+
install plugin query_response_time soname 'query_response_time';
71+
prepare s from 'set global query_response_time_range_base=16';
72+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
73+
uninstall plugin query_response_time;
74+
execute s;
75+
execute s;
76+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
77+
deallocate prepare s;
78+
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
79+
80+
--echo ## prepared SET mentioning a plugin otherwise does not prevent uninstall
81+
install plugin archive soname 'ha_archive';
82+
create table t1 (a int) engine=archive;
83+
insert t1 values (1),(2),(3);
84+
prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
85+
flush tables;
86+
select plugin_status from information_schema.plugins where plugin_name='archive';
87+
uninstall plugin archive;
88+
select plugin_status from information_schema.plugins where plugin_name='archive';
89+
--error ER_UNKNOWN_STORAGE_ENGINE
90+
execute s;
91+
drop table t1;

mysql-test/main/show.result

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#
2+
# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
3+
# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
4+
# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
5+
#
16
show statistics;
27
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 'statistics' at line 1
38
show spatial_ref_sys
@@ -10,3 +15,30 @@ show geometry_columns;
1015
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 'geometry_columns' at line 1
1116
show nonexistent;
1217
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 'nonexistent' at line 1
18+
#
19+
# MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
20+
#
21+
create table t1 (nm varchar(32), a int);
22+
insert t1 values ('1',1),('2',2),('3',3);
23+
show tables
24+
where tables_in_test in (select *
25+
from (select nm from test.t1 group by nm) dt);
26+
Tables_in_test
27+
show fields from test.t1
28+
where field in (select * from (select nm from test.t1 group by nm) dt);
29+
Field Type Null Key Default Extra
30+
insert t1 values ('nm',0);
31+
show fields from test.t1
32+
where field in (select * from (select nm from test.t1 group by nm) dt);
33+
Field Type Null Key Default Extra
34+
nm varchar(32) YES NULL
35+
show fields from test.t1 where field in
36+
(select * from (select column_name from information_schema.columns
37+
where table_name='t1' group by column_name) dt);
38+
Field Type Null Key Default Extra
39+
nm varchar(32) YES NULL
40+
a int(11) YES NULL
41+
drop table t1;
42+
#
43+
# End of 10.2 tests
44+
#

mysql-test/main/show.test

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#
2-
# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
3-
# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
4-
# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
5-
#
1+
--echo #
2+
--echo # MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
3+
--echo # MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
4+
--echo # MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
5+
--echo #
66
--error ER_PARSE_ERROR
77
show statistics;
88
--error ER_PARSE_ERROR
@@ -13,3 +13,27 @@ show system_variables;
1313
show geometry_columns;
1414
--error ER_PARSE_ERROR
1515
show nonexistent;
16+
17+
--echo #
18+
--echo # MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
19+
--echo #
20+
create table t1 (nm varchar(32), a int);
21+
insert t1 values ('1',1),('2',2),('3',3);
22+
23+
show tables
24+
where tables_in_test in (select *
25+
from (select nm from test.t1 group by nm) dt);
26+
show fields from test.t1
27+
where field in (select * from (select nm from test.t1 group by nm) dt);
28+
insert t1 values ('nm',0);
29+
show fields from test.t1
30+
where field in (select * from (select nm from test.t1 group by nm) dt);
31+
32+
show fields from test.t1 where field in
33+
(select * from (select column_name from information_schema.columns
34+
where table_name='t1' group by column_name) dt);
35+
drop table t1;
36+
37+
--echo #
38+
--echo # End of 10.2 tests
39+
--echo #

0 commit comments

Comments
 (0)