Skip to content

Commit

Permalink
Merge branch 'bb-10.3-release' into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed May 7, 2021
2 parents 625e44a + 4f143a8 commit 72753d2
Show file tree
Hide file tree
Showing 96 changed files with 1,764 additions and 492 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)

IF(POLICY CMP0022)
CMAKE_POLICY(SET CMP0022 NEW)
Expand All @@ -41,8 +42,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
IF (NOT MAX_INDEXES)
Expand Down Expand Up @@ -71,18 +80,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})

SET(CPACK_PACKAGE_NAME "MariaDB")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB: a very fast and robust SQL database server")
Expand Down
2 changes: 1 addition & 1 deletion cmake/libutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
ENDFOREACH()
IF(OSLIBS)
LIST(REMOVE_DUPLICATES 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
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 @@ -446,9 +446,9 @@ IF(NOT DISABLE_SHARED)
# Clean direct output flags, as 2 targets have the same base name
# libmysqld
SET_TARGET_PROPERTIES(libmysqld PROPERTIES CLEAN_DIRECT_OUTPUT 1)
TARGET_LINK_LIBRARIES(libmysqld ${CRC32_LIBRARY})
TARGET_LINK_LIBRARIES(libmysqld LINK_PRIVATE ${CRC32_LIBRARY})
SET_TARGET_PROPERTIES(mysqlserver PROPERTIES CLEAN_DIRECT_OUTPUT 1)
TARGET_LINK_LIBRARIES(mysqlserver ${CRC32_LIBRARY})
TARGET_LINK_LIBRARIES(mysqlserver LINK_PRIVATE ${CRC32_LIBRARY})
IF(LIBMYSQLD_SO_EXTRA_LIBS)
TARGET_LINK_LIBRARIES(libmysqld ${LIBMYSQLD_SO_EXTRA_LIBS})
ENDIF()
Expand Down
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;
35 changes: 35 additions & 0 deletions mysql-test/main/plugin_vars.result
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,38 @@ disconnect con2;
USE test;
DROP PROCEDURE p_install;
DROP PROCEDURE p_show_vars;
#
# Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
#
## prepared SET with a plugin variable prevents uninstall
install plugin query_response_time soname 'query_response_time';
prepare s from 'set global query_response_time_range_base=16';
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
plugin_status
ACTIVE
uninstall plugin query_response_time;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
execute s;
execute s;
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
plugin_status
DELETED
deallocate prepare s;
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
plugin_status
## prepared SET mentioning a plugin otherwise does not prevent uninstall
install plugin archive soname 'ha_archive';
create table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
flush tables;
select plugin_status from information_schema.plugins where plugin_name='archive';
plugin_status
ACTIVE
uninstall plugin archive;
select plugin_status from information_schema.plugins where plugin_name='archive';
plugin_status
execute s;
ERROR 42000: Unknown storage engine 'ARCHIVE'
drop table t1;
35 changes: 35 additions & 0 deletions mysql-test/main/plugin_vars.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
if (!$QUERY_RESPONSE_TIME_SO) {
skip Needs query_response_time loadable plugin;
}
if (!$HA_ARCHIVE_SO) {
skip Needs Archive loadable plugin;
}

--echo #
--echo # MDEV-5345 - Deadlock between mysql_change_user(), SHOW VARIABLES and
--echo # INSTALL PLUGIN
Expand Down Expand Up @@ -54,3 +61,31 @@ disconnect con2;
USE test;
DROP PROCEDURE p_install;
DROP PROCEDURE p_show_vars;

--echo #
--echo # Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
--echo #

--echo ## prepared SET with a plugin variable prevents uninstall
install plugin query_response_time soname 'query_response_time';
prepare s from 'set global query_response_time_range_base=16';
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
uninstall plugin query_response_time;
execute s;
execute s;
select plugin_status from information_schema.plugins where plugin_name='query_response_time';
deallocate prepare s;
select plugin_status from information_schema.plugins where plugin_name='query_response_time';

--echo ## prepared SET mentioning a plugin otherwise does not prevent uninstall
install plugin archive soname 'ha_archive';
create table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
flush tables;
select plugin_status from information_schema.plugins where plugin_name='archive';
uninstall plugin archive;
select plugin_status from information_schema.plugins where plugin_name='archive';
--error ER_UNKNOWN_STORAGE_ENGINE
execute s;
drop table t1;
32 changes: 32 additions & 0 deletions mysql-test/main/show.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
#
show statistics;
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
show spatial_ref_sys
Expand All @@ -10,3 +15,30 @@ show geometry_columns;
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
show nonexistent;
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
#
# MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
#
create table t1 (nm varchar(32), a int);
insert t1 values ('1',1),('2',2),('3',3);
show tables
where tables_in_test in (select *
from (select nm from test.t1 group by nm) dt);
Tables_in_test
show fields from test.t1
where field in (select * from (select nm from test.t1 group by nm) dt);
Field Type Null Key Default Extra
insert t1 values ('nm',0);
show fields from test.t1
where field in (select * from (select nm from test.t1 group by nm) dt);
Field Type Null Key Default Extra
nm varchar(32) YES NULL
show fields from test.t1 where field in
(select * from (select column_name from information_schema.columns
where table_name='t1' group by column_name) dt);
Field Type Null Key Default Extra
nm varchar(32) YES NULL
a int(11) YES NULL
drop table t1;
#
# End of 10.2 tests
#
34 changes: 29 additions & 5 deletions mysql-test/main/show.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
#
--echo #
--echo # MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
--echo # MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
--echo # MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
--echo #
--error ER_PARSE_ERROR
show statistics;
--error ER_PARSE_ERROR
Expand All @@ -13,3 +13,27 @@ show system_variables;
show geometry_columns;
--error ER_PARSE_ERROR
show nonexistent;

--echo #
--echo # MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
--echo #
create table t1 (nm varchar(32), a int);
insert t1 values ('1',1),('2',2),('3',3);

show tables
where tables_in_test in (select *
from (select nm from test.t1 group by nm) dt);
show fields from test.t1
where field in (select * from (select nm from test.t1 group by nm) dt);
insert t1 values ('nm',0);
show fields from test.t1
where field in (select * from (select nm from test.t1 group by nm) dt);

show fields from test.t1 where field in
(select * from (select column_name from information_schema.columns
where table_name='t1' group by column_name) dt);
drop table t1;

--echo #
--echo # End of 10.2 tests
--echo #
1 change: 1 addition & 0 deletions mysql-test/main/show_explain.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--enable-plugin-innodb-lock-waits --enable-plugin-innodb-trx
9 changes: 8 additions & 1 deletion mysql-test/main/show_explain.test
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,14 @@ select * from t1 where pk between 10 and 20 for update;
# run SHOW EXPLAIN on a frozen thread
connection default;
let $save_wait_condition= $wait_condition;
let $wait_condition= select State='Sending data' from information_schema.processlist where id=$thr2;
let $wait_condition=
select 1
from information_schema.INNODB_LOCK_WAITS
where
requesting_trx_id=(select trx_id
from information_schema.INNODB_TRX
where trx_mysql_thread_id=$thr2);

let $thr_default=`select connection_id()`;
--source include/wait_condition.inc
--echo # do: send_eval show explain for thr2;
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/main/sp.result
Original file line number Diff line number Diff line change
Expand Up @@ -8487,6 +8487,21 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
#
# BUG#30366310: USING A FUNCTION TO ASSIGN DEFAULT VALUES TO
# 2 OR MORE VARIABLES CRASHES SERVER
#
create function f1() returns bigint return now()-1|
create procedure p1()
begin
declare b, c bigint default f1();
select b-c;
end|
call p1()|
b-c
0
drop procedure p1|
drop function f1|
#End of 10.2 tests
#
# MDEV-12007 Allow ROW variables as a cursor FETCH target
Expand Down
19 changes: 19 additions & 0 deletions mysql-test/main/sp.test
Original file line number Diff line number Diff line change
Expand Up @@ -10026,6 +10026,25 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;


--echo #
--echo # BUG#30366310: USING A FUNCTION TO ASSIGN DEFAULT VALUES TO
--echo # 2 OR MORE VARIABLES CRASHES SERVER
--echo #

delimiter |;
create function f1() returns bigint return now()-1|
create procedure p1()
begin
declare b, c bigint default f1();
select b-c;
end|
call p1()|
drop procedure p1|
drop function f1|
delimiter ;|


--echo #End of 10.2 tests

--echo #
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/main/udf.result
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,12 @@ select * from mysql.plugin WHERE name='unexisting_udf';
name dl
DROP FUNCTION unexisting_udf;
ERROR 42000: FUNCTION test.unexisting_udf does not exist
#
# Bug #31674599: THE UDF_INIT() FUNCTION CAUSE SERVER CRASH
#
call mtr.add_suppression('Invalid row in mysql.func table');
insert mysql.func () values ();
delete from mysql.func where name = '';
#
# End of 10.2 tests
#
10 changes: 10 additions & 0 deletions mysql-test/main/udf.test
Original file line number Diff line number Diff line change
Expand Up @@ -562,4 +562,14 @@ select * from mysql.plugin WHERE name='unexisting_udf';
--error ER_SP_DOES_NOT_EXIST
DROP FUNCTION unexisting_udf;

--echo #
--echo # Bug #31674599: THE UDF_INIT() FUNCTION CAUSE SERVER CRASH
--echo #
call mtr.add_suppression('Invalid row in mysql.func table');
insert mysql.func () values ();
source include/restart_mysqld.inc;
delete from mysql.func where name = '';

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

0 comments on commit 72753d2

Please sign in to comment.