Skip to content

Commit efb8485

Browse files
committed
Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f45 introduces DBUG_ASSERT(right_op == r_tbl) in st_select_lex::add_cross_joined_table(), and that assertion would fail in several tests that exercise joins. That commit was skipped in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
2 parents 235cf96 + b96e442 commit efb8485

Some content is hidden

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

66 files changed

+691
-319
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
2-
# Copyright (c) 2008, 2018, MariaDB Corporation
2+
# Copyright (c) 2008, 2019, MariaDB Corporation.
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -231,6 +231,11 @@ IF (WITH_UBSAN)
231231
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=undefined -fno-sanitize=alignment -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
232232
ENDIF()
233233

234+
OPTION(WITH_MSAN "Enable memory sanitizer" OFF)
235+
IF (WITH_MSAN)
236+
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
237+
ENDIF()
238+
234239
IF(NOT WITH_TSAN)
235240
# enable security hardening features, like most distributions do
236241
# in our benchmarks that costs about ~1% of performance, depending on the load

client/mysqltest.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
2-
Copyright (c) 2009, 2017, MariaDB
2+
Copyright (c) 2009, 2019, MariaDB
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1687,6 +1687,7 @@ void abort_not_supported_test(const char *fmt, ...)
16871687
cur_file->file_name, cur_file->lineno);
16881688

16891689
char buff[DIE_BUFF_SIZE];
1690+
buff[0] = '\0';
16901691
print_file_stack(buff, buff + sizeof(buff));
16911692
fprintf(stderr, "%s", buff);
16921693

cmake/build_depends.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ IF(RPM)
3939
SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP})
4040
ENDIF()
4141
ENDFOREACH()
42-
LIST(REMOVE_DUPLICATES BUILD_DEPS)
43-
STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}")
42+
IF (BUILD_DEPS)
43+
LIST(REMOVE_DUPLICATES BUILD_DEPS)
44+
STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}")
45+
ENDIF()
4446
ENDIF(RPM)

cmake/plugin.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) 2009, 2018, Oracle and/or its affiliates.
2-
# Copyright (c) 2011, 2019, MariaDB Corporation
3-
#
2+
# Copyright (c) 2011, 2019, MariaDB Corporation.
3+
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
66
# the Free Software Foundation; version 2 of the License.
@@ -12,7 +12,7 @@
1212
#
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program; if not, write to the Free Software
15-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
1616

1717

1818
INCLUDE(CMakeParseArguments)
@@ -209,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
209209
ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
210210
TARGET_LINK_LIBRARIES (${target} mysqld)
211211
ENDIF()
212-
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN)
212+
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN AND NOT WITH_MSAN)
213213
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
214214
ENDIF()
215215

libmariadb

mysql-test/lib/My/SafeProcess/safe_process.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Copyright (c) 2008, 2012, Oracle and/or its affiliates
2+
Copyright (c) 2019, MariaDB Corporation.
23
34
This program is free software; you can redistribute it and/or modify
45
it under the terms of the GNU General Public License as published by
@@ -219,6 +220,7 @@ int main(int argc, char* const argv[] )
219220
sigemptyset(&sa.sa_mask);
220221

221222
sa_abort.sa_handler= handle_abort;
223+
sa_abort.sa_flags= 0;
222224
sigemptyset(&sa_abort.sa_mask);
223225
/* Install signal handlers */
224226
sigaction(SIGTERM, &sa,NULL);

mysql-test/main/invisible_field_debug.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,15 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
385385
CREATE TABLE t2 LIKE t1;
386386
SET debug_dbug= DEFAULT;
387387
DROP TABLE t1, t2;
388+
#
389+
# MDEV-20210
390+
# If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE
391+
#
392+
CREATE TABLE t1 (i INT, v int GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE);
393+
SHOW CREATE TABLE t1;
394+
Table Create Table
395+
t1 CREATE TABLE `t1` (
396+
`i` int(11) DEFAULT NULL,
397+
`v` int(11) GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE
398+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
399+
DROP TABLE t1;

mysql-test/main/invisible_field_debug.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,12 @@ SET debug_dbug="+d,test_completely_invisible,test_invisible_index";
281281
CREATE TABLE t2 LIKE t1;
282282
SET debug_dbug= DEFAULT;
283283
DROP TABLE t1, t2;
284+
285+
--echo #
286+
--echo # MDEV-20210
287+
--echo # If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE
288+
--echo #
289+
290+
CREATE TABLE t1 (i INT, v int GENERATED ALWAYS AS (1) VIRTUAL INVISIBLE);
291+
SHOW CREATE TABLE t1;
292+
DROP TABLE t1;

mysql-test/main/rowid_filter_innodb.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,7 +2179,7 @@ count(*)
21792179
6
21802180
explain extended select count(*) from t1 where a in (22,83,11) and b=2;
21812181
id select_type table type possible_keys key key_len ref rows filtered Extra
2182-
1 SIMPLE t1 ref b,a b 5 const 59 55.93 Using where
2182+
1 SIMPLE t1 ref b,a b 5 const 59 3.30 Using where
21832183
Warnings:
21842184
Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (22,83,11)
21852185
select * from t1 where a in (22,83,11) and b=2;
@@ -2196,7 +2196,7 @@ count(*)
21962196
6
21972197
explain extended select count(*) from t1 where a in (22,83,11) and b=2;
21982198
id select_type table type possible_keys key key_len ref rows filtered Extra
2199-
1 SIMPLE t1 ref|filter b,a b|a 5|5 const 59 (3%) 55.93 Using where; Using rowid filter
2199+
1 SIMPLE t1 ref|filter b,a b|a 5|5 const 59 (3%) 3.30 Using where; Using rowid filter
22002200
Warnings:
22012201
Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (22,83,11)
22022202
select * from t1 where a in (22,83,11) and b=2;

mysql-test/main/selectivity.result

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,3 +1637,37 @@ set @@use_stat_tables= @save_use_stat_tables;
16371637
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
16381638
drop table t1;
16391639
drop function f1;
1640+
#
1641+
# MDEV-19834 Selectivity of an equality condition discounted twice
1642+
#
1643+
set @@optimizer_use_condition_selectivity=4;
1644+
set @@use_stat_tables='preferably';
1645+
create table t1 (a int, b int, key (b), key (a));
1646+
insert into t1
1647+
select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000;
1648+
analyze table t1 ;
1649+
Table Op Msg_type Msg_text
1650+
test.t1 analyze status Engine-independent statistics collected
1651+
test.t1 analyze status Table is already up to date
1652+
# Check what info the optimizer has about selectivities
1653+
explain extended select * from t1 use index () where a in (17,51,5);
1654+
id select_type table type possible_keys key key_len ref rows filtered Extra
1655+
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 3.90 Using where
1656+
Warnings:
1657+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5)
1658+
explain extended select * from t1 use index () where b=2;
1659+
id select_type table type possible_keys key key_len ref rows filtered Extra
1660+
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 5.47 Using where
1661+
Warnings:
1662+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2
1663+
# Now, the equality is used for ref access, while the range condition
1664+
# gives selectivity data
1665+
explain extended select * from t1 where a in (17,51,5) and b=2;
1666+
id select_type table type possible_keys key key_len ref rows filtered Extra
1667+
1 SIMPLE t1 ref|filter b,a b|a 5|5 const 58 (3%) 2.90 Using where; Using rowid filter
1668+
Warnings:
1669+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
1670+
drop table t1;
1671+
set use_stat_tables= @save_use_stat_tables;
1672+
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
1673+
# End of 10.1 tests

0 commit comments

Comments
 (0)