diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-12-07 21:30:27 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-12-07 21:30:27 +0100 |
commit | de70f921ceb27144a4b3cac8ffd0f46d3d177150 (patch) | |
tree | 62749c09d1c4579aa2a3aa5f526b50ff84c9ea9f | |
parent | cfcfdc65dfa0ae5e59df1f1c42ee574b8bdc60a4 (diff) | |
parent | e8a91c18ea136f54a53ae19c6f41482a1b855cff (diff) | |
download | mariadb-git-de70f921ceb27144a4b3cac8ffd0f46d3d177150.tar.gz |
Merge branch '10.4' into 10.5
-rw-r--r-- | cmake/Internal/CPack/CPackRPM.cmake | 3 | ||||
-rw-r--r-- | mysql-test/main/range.result | 24 | ||||
-rw-r--r-- | mysql-test/main/range.test | 24 | ||||
-rw-r--r-- | mysql-test/main/range_mrr_icp.result | 24 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 7 | ||||
-rw-r--r-- | storage/mroonga/vendor/groonga/CMakeLists.txt | 4 | ||||
-rw-r--r-- | storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt | 4 | ||||
-rw-r--r-- | unittest/mysys/thr_template.c | 2 |
9 files changed, 89 insertions, 5 deletions
diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake index 1ca95670cfb..cd1d3e22a52 100644 --- a/cmake/Internal/CPack/CPackRPM.cmake +++ b/cmake/Internal/CPack/CPackRPM.cmake @@ -23,7 +23,8 @@ macro(restore WHAT) endmacro() foreach (WHAT SUMMARY DESCRIPTION) - if(NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT}) + if(CPACK_RPM_PACKAGE_COMPONENT AND + NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT}) message(FATAL_ERROR "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT} is not defined") endif() endforeach() diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index d97cfb2b587..aca500bf038 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -3280,6 +3280,30 @@ pk i v a b 2 2 4 2 4 drop table t1, t2; # +# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed +# +create table t1 (a int, b int, index idx(a,b)); +insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3); +create table t2 (c int); +insert into t2 values (5), (2), (3), (4); +select 1 from t1 s1 +where 1 not in (select 1 from t1 +where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1)); +1 +select 1 from t1 s1 +where 1 not in (select 1 from t1 +where ((a = 1 or a = 2) and b = 1) or b = NULL); +1 +select c from t2 +where 2 not in (select 1 from t1 +where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1)); +c +5 +2 +3 +4 +drop table t1,t2; +# # End of 10.2 tests # # diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 6d43ad9090d..6a2e318e732 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -2240,6 +2240,30 @@ select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); drop table t1, t2; --echo # +--echo # MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed +--echo # + +create table t1 (a int, b int, index idx(a,b)); +insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3); + +create table t2 (c int); +insert into t2 values (5), (2), (3), (4); + +select 1 from t1 s1 + where 1 not in (select 1 from t1 + where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1)); + +select 1 from t1 s1 + where 1 not in (select 1 from t1 + where ((a = 1 or a = 2) and b = 1) or b = NULL); + +select c from t2 + where 2 not in (select 1 from t1 + where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1)); + +drop table t1,t2; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index 9fa7bd29851..eb4daf7fbc8 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -3269,6 +3269,30 @@ pk i v a b 2 2 4 2 4 drop table t1, t2; # +# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed +# +create table t1 (a int, b int, index idx(a,b)); +insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3); +create table t2 (c int); +insert into t2 values (5), (2), (3), (4); +select 1 from t1 s1 +where 1 not in (select 1 from t1 +where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1)); +1 +select 1 from t1 s1 +where 1 not in (select 1 from t1 +where ((a = 1 or a = 2) and b = 1) or b = NULL); +1 +select c from t2 +where 2 not in (select 1 from t1 +where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1)); +c +5 +2 +3 +4 +drop table t1,t2; +# # End of 10.2 tests # # diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index db19e40903f..53128052777 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5060,7 +5060,7 @@ sub mysqld_start ($$) { $mysqld->{'started_opts'}= $extra_opts; my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect"; - return $oldexe eq $exe || + return $oldexe eq ($exe || '') || sleep_until_file_created($mysqld->value('pid-file'), $expect_file, $opt_start_timeout, $mysqld->{'proc'}, $warn_seconds); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3a20e9de210..f3ccf56c204 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5533,6 +5533,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, if (!s->const_keys.is_clear_all()) { sargable_cond= get_sargable_cond(join, s->table); + bool is_sargable_cond_of_where= sargable_cond == &join->conds; select= make_select(s->table, found_const_table_map, found_const_table_map, @@ -5549,6 +5550,12 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, */ *sargable_cond= select->cond; + if (is_sargable_cond_of_where && + join->conds && join->conds->type() == Item::COND_ITEM && + ((Item_cond*) (join->conds))->functype() == + Item_func::COND_AND_FUNC) + join->cond_equal= &((Item_cond_and*) (join->conds))->m_cond_equal; + s->quick=select->quick; s->needed_reg=select->needed_reg; select->quick=0; diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index b6ad3a9e50d..27afb935467 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -86,7 +86,9 @@ set(LIB_DIR "lib") set(INCLUDE_DIR "include") set(GRN_INCLUDE_DIR "include/groonga") set(DATA_DIR "share") -set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}") +if(NOT DEFINED GRN_DATA_DIR) + set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}") +endif() set(CONFIG_DIR "etc") set(GRN_CONFIG_DIR "${CONFIG_DIR}/${GRN_PROJECT_NAME}") set(GRN_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GRN_CONFIG_DIR}/groonga.conf") diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt index ae083028038..4c2aa343089 100644 --- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt @@ -16,7 +16,9 @@ # MA 02110-1335 USA cmake_minimum_required(VERSION 2.6) -set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") +if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME) + set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") +endif() project("${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}") if(DEFINED GROONGA_NORMALIZER_MYSQL_EMBED) diff --git a/unittest/mysys/thr_template.c b/unittest/mysys/thr_template.c index 42e035d911c..1e715484687 100644 --- a/unittest/mysys/thr_template.c +++ b/unittest/mysys/thr_template.c @@ -59,7 +59,7 @@ int main(int argc __attribute__((unused)), char **argv) pthread_mutex_init(&mutex, 0); -#define CYCLES 3000 +#define CYCLES 30000 #define THREADS 30 diag("N CPUs: %d", my_getncpus()); |