Skip to content

Commit e8a91c1

Browse files
committed
Merge branch '10.3' into 10.4
2 parents f458acc + 153b75b commit e8a91c1

File tree

11 files changed

+98
-10
lines changed

11 files changed

+98
-10
lines changed

cmake/Internal/CPack/CPackRPM.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ macro(restore WHAT)
1818
endmacro()
1919

2020
foreach (WHAT SUMMARY DESCRIPTION)
21-
if(NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
21+
if(CPACK_RPM_PACKAGE_COMPONENT AND
22+
NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
2223
message(FATAL_ERROR "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT} is not defined")
2324
endif()
2425
endforeach()

mysql-test/main/range.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,6 +3272,30 @@ pk i v a b
32723272
2 2 4 2 4
32733273
drop table t1, t2;
32743274
#
3275+
# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
3276+
#
3277+
create table t1 (a int, b int, index idx(a,b));
3278+
insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
3279+
create table t2 (c int);
3280+
insert into t2 values (5), (2), (3), (4);
3281+
select 1 from t1 s1
3282+
where 1 not in (select 1 from t1
3283+
where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
3284+
1
3285+
select 1 from t1 s1
3286+
where 1 not in (select 1 from t1
3287+
where ((a = 1 or a = 2) and b = 1) or b = NULL);
3288+
1
3289+
select c from t2
3290+
where 2 not in (select 1 from t1
3291+
where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
3292+
c
3293+
5
3294+
2
3295+
3
3296+
4
3297+
drop table t1,t2;
3298+
#
32753299
# End of 10.2 tests
32763300
#
32773301
#

mysql-test/main/range.test

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,30 @@ select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk);
22392239
select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk);
22402240
drop table t1, t2;
22412241

2242+
--echo #
2243+
--echo # MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
2244+
--echo #
2245+
2246+
create table t1 (a int, b int, index idx(a,b));
2247+
insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
2248+
2249+
create table t2 (c int);
2250+
insert into t2 values (5), (2), (3), (4);
2251+
2252+
select 1 from t1 s1
2253+
where 1 not in (select 1 from t1
2254+
where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
2255+
2256+
select 1 from t1 s1
2257+
where 1 not in (select 1 from t1
2258+
where ((a = 1 or a = 2) and b = 1) or b = NULL);
2259+
2260+
select c from t2
2261+
where 2 not in (select 1 from t1
2262+
where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
2263+
2264+
drop table t1,t2;
2265+
22422266
--echo #
22432267
--echo # End of 10.2 tests
22442268
--echo #

mysql-test/main/range_mrr_icp.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,30 @@ pk i v a b
32693269
2 2 4 2 4
32703270
drop table t1, t2;
32713271
#
3272+
# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
3273+
#
3274+
create table t1 (a int, b int, index idx(a,b));
3275+
insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
3276+
create table t2 (c int);
3277+
insert into t2 values (5), (2), (3), (4);
3278+
select 1 from t1 s1
3279+
where 1 not in (select 1 from t1
3280+
where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
3281+
1
3282+
select 1 from t1 s1
3283+
where 1 not in (select 1 from t1
3284+
where ((a = 1 or a = 2) and b = 1) or b = NULL);
3285+
1
3286+
select c from t2
3287+
where 2 not in (select 1 from t1
3288+
where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
3289+
c
3290+
5
3291+
2
3292+
3
3293+
4
3294+
drop table t1,t2;
3295+
#
32723296
# End of 10.2 tests
32733297
#
32743298
#

mysql-test/mysql-test-run.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5026,7 +5026,7 @@ ($$)
50265026
$mysqld->{'started_opts'}= $extra_opts;
50275027

50285028
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
5029-
return $oldexe eq $exe ||
5029+
return $oldexe eq ($exe || '') ||
50305030
sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
50315031
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
50325032
}

mysys/lf_alloc-pin.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ static int ptr_cmp(void **a, void **b)
251251
#define add_to_purgatory(PINS, ADDR) \
252252
do \
253253
{ \
254-
*(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset)= \
255-
(PINS)->purgatory; \
254+
my_atomic_storeptr_explicit( \
255+
(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset), \
256+
(PINS)->purgatory, MY_MEMORY_ORDER_RELEASE); \
256257
(PINS)->purgatory= (ADDR); \
257258
(PINS)->purgatory_count++; \
258259
} while (0)

mysys/lf_hash.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@ static int l_find(LF_SLIST **head, CHARSET_INFO *cs, uint32 hashnr,
112112

113113
cur_hashnr= cursor->curr->hashnr;
114114
cur_keylen= cursor->curr->keylen;
115-
cur_key= cursor->curr->key;
115+
cur_key= my_atomic_loadptr_explicit((void **) &cursor->curr->key,
116+
MY_MEMORY_ORDER_ACQUIRE);
116117

117118
do {
118-
link= cursor->curr->link;
119+
link= (intptr) my_atomic_loadptr_explicit((void **) &cursor->curr->link,
120+
MY_MEMORY_ORDER_RELAXED);
119121
cursor->next= PTR(link);
120122
lf_pin(pins, 0, cursor->next);
121-
} while (link != cursor->curr->link && LF_BACKOFF());
123+
} while (link != (intptr) my_atomic_loadptr((void **) &cursor->curr->link)
124+
&& LF_BACKOFF());
122125

123126
if (!DELETED(link))
124127
{

sql/sql_select.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5506,6 +5506,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
55065506
if (!s->const_keys.is_clear_all())
55075507
{
55085508
sargable_cond= get_sargable_cond(join, s->table);
5509+
bool is_sargable_cond_of_where= sargable_cond == &join->conds;
55095510

55105511
select= make_select(s->table, found_const_table_map,
55115512
found_const_table_map,
@@ -5522,6 +5523,12 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
55225523
*/
55235524
*sargable_cond= select->cond;
55245525

5526+
if (is_sargable_cond_of_where &&
5527+
join->conds && join->conds->type() == Item::COND_ITEM &&
5528+
((Item_cond*) (join->conds))->functype() ==
5529+
Item_func::COND_AND_FUNC)
5530+
join->cond_equal= &((Item_cond_and*) (join->conds))->m_cond_equal;
5531+
55255532
s->quick=select->quick;
55265533
s->needed_reg=select->needed_reg;
55275534
select->quick=0;

storage/mroonga/vendor/groonga/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ set(LIB_DIR "lib")
8686
set(INCLUDE_DIR "include")
8787
set(GRN_INCLUDE_DIR "include/groonga")
8888
set(DATA_DIR "share")
89-
set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}")
89+
if(NOT DEFINED GRN_DATA_DIR)
90+
set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}")
91+
endif()
9092
set(CONFIG_DIR "etc")
9193
set(GRN_CONFIG_DIR "${CONFIG_DIR}/${GRN_PROJECT_NAME}")
9294
set(GRN_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GRN_CONFIG_DIR}/groonga.conf")

storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
# MA 02110-1335 USA
1717

1818
cmake_minimum_required(VERSION 2.6)
19-
set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
19+
if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME)
20+
set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
21+
endif()
2022
project("${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}")
2123

2224
if(DEFINED GROONGA_NORMALIZER_MYSQL_EMBED)

0 commit comments

Comments
 (0)