Skip to content

Commit 186c1fa

Browse files
committed
Merge branch '10.5' into 10.6
2 parents 6deaff5 + 62ea1b4 commit 186c1fa

File tree

18 files changed

+391
-81
lines changed

18 files changed

+391
-81
lines changed

cmake/Internal/CPack/CPackRPM.cmake

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

2525
foreach (WHAT SUMMARY DESCRIPTION)
26-
if(NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
26+
if(CPACK_RPM_PACKAGE_COMPONENT AND
27+
NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
2728
message(FATAL_ERROR "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT} is not defined")
2829
endif()
2930
endforeach()

cmake/build_configurations/mysql_release.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ ELSEIF(RPM)
105105
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "")
106106
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
107107
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
108-
# not yet, SLES 12.3 doesn't provide pcre2
109-
#SET(WITH_PCRE system CACHE STRING "")
108+
SET(WITH_PCRE system CACHE STRING "")
110109
IF(RPM MATCHES "fedora|centos|rhel")
111110
SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
112111
SET(WITH_INNODB_LZO OFF CACHE STRING "")
@@ -136,7 +135,6 @@ ELSE()
136135
SET(WITH_JEMALLOC static CACHE STRING "")
137136
SET(PLUGIN_AUTH_SOCKET STATIC CACHE STRING "")
138137
SET(WITH_STRIPPED_CLIENT ON CACHE BOOL "Strip all client binaries")
139-
SET(WITH_PCRE bundled CACHE STRING "")
140138
SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
141139
SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
142140
SET(WITH_INNODB_LZO OFF CACHE STRING "")

mysql-test/main/range.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,6 +3280,30 @@ pk i v a b
32803280
2 2 4 2 4
32813281
drop table t1, t2;
32823282
#
3283+
# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
3284+
#
3285+
create table t1 (a int, b int, index idx(a,b));
3286+
insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
3287+
create table t2 (c int);
3288+
insert into t2 values (5), (2), (3), (4);
3289+
select 1 from t1 s1
3290+
where 1 not in (select 1 from t1
3291+
where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
3292+
1
3293+
select 1 from t1 s1
3294+
where 1 not in (select 1 from t1
3295+
where ((a = 1 or a = 2) and b = 1) or b = NULL);
3296+
1
3297+
select c from t2
3298+
where 2 not in (select 1 from t1
3299+
where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
3300+
c
3301+
5
3302+
2
3303+
3
3304+
4
3305+
drop table t1,t2;
3306+
#
32833307
# End of 10.2 tests
32843308
#
32853309
#

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/mariadb-test-run.pl

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

50865086
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
5087-
my $rc= $oldexe eq $exe ||
5087+
my $rc= $oldexe eq ($exe || '') ||
50885088
sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
50895089
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
50905090
if (!$rc)
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
CREATE TABLE test.v1 (a int, b int);
2+
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
3+
CREATE TABLE test.t1 (a int, b int);
4+
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
5+
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
6+
EXPLAIN EXTENDED SELECT * from test.v1;
7+
id select_type table type possible_keys key key_len ref rows filtered Extra
8+
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
9+
Warnings:
10+
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
11+
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
12+
id select_type table type possible_keys key key_len ref rows filtered Extra
13+
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
14+
Warnings:
15+
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`a` = 1
16+
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
17+
id select_type table type possible_keys key key_len ref rows filtered Extra
18+
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
19+
Warnings:
20+
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`b` > 100
21+
EXPLAIN EXTENDED SELECT a, b from test.v1;
22+
id select_type table type possible_keys key key_len ref rows filtered Extra
23+
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
24+
Warnings:
25+
Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
26+
EXPLAIN EXTENDED SELECT b, a from test.v1;
27+
id select_type table type possible_keys key key_len ref rows filtered Extra
28+
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
29+
Warnings:
30+
Note 1003 select `test`.`v1`.`b` AS `b`,`test`.`v1`.`a` AS `a` from `test`.`v1`
31+
SELECT * from test.v1;
32+
a b
33+
1 100
34+
2 200
35+
3 300
36+
SELECT * from test.v1 where a = 1;
37+
a b
38+
1 100
39+
SELECT * from test.v1 where b > 100;
40+
a b
41+
2 200
42+
3 300
43+
SELECT a, b from test.v1;
44+
a b
45+
1 100
46+
2 200
47+
3 300
48+
SELECT b, a from test.v1;
49+
b a
50+
100 1
51+
200 2
52+
300 3
53+
#
54+
# DIGESTS SEEN ON TABLE
55+
#
56+
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
57+
FROM performance_schema.events_statements_summary_by_digest
58+
ORDER BY DIGEST_TEXT;
59+
SCHEMA_NAME DIGEST_TEXT COUNT_STAR
60+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 1
61+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 1
62+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 1
63+
test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 1
64+
test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 1
65+
test SELECT * FROM `test` . `v1` 1
66+
test SELECT * FROM `test` . `v1` WHERE `a` = ? 1
67+
test SELECT * FROM `test` . `v1` WHERE `b` > ? 1
68+
test SELECT `a` , `b` FROM `test` . `v1` 1
69+
test SELECT `b` , `a` FROM `test` . `v1` 1
70+
test SHOW WARNINGS 5
71+
test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
72+
DROP TABLE test.v1;
73+
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
74+
EXPLAIN EXTENDED SELECT * from test.v1;
75+
id select_type table type possible_keys key key_len ref rows filtered Extra
76+
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
77+
Warnings:
78+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
79+
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
80+
id select_type table type possible_keys key key_len ref rows filtered Extra
81+
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
82+
Warnings:
83+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 1
84+
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
85+
id select_type table type possible_keys key key_len ref rows filtered Extra
86+
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
87+
Warnings:
88+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` > 100
89+
EXPLAIN EXTENDED SELECT a, b from test.v1;
90+
id select_type table type possible_keys key key_len ref rows filtered Extra
91+
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
92+
Warnings:
93+
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
94+
EXPLAIN EXTENDED SELECT b, a from test.v1;
95+
id select_type table type possible_keys key key_len ref rows filtered Extra
96+
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
97+
Warnings:
98+
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1`
99+
SELECT * from test.v1;
100+
a b
101+
1 100
102+
2 200
103+
3 300
104+
SELECT * from test.v1 where a = 1;
105+
a b
106+
1 100
107+
SELECT * from test.v1 where b > 100;
108+
a b
109+
2 200
110+
3 300
111+
SELECT a, b from test.v1;
112+
a b
113+
1 100
114+
2 200
115+
3 300
116+
SELECT b, a from test.v1;
117+
b a
118+
100 1
119+
200 2
120+
300 3
121+
#
122+
# DIGESTS SEEN ON VIEW
123+
#
124+
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
125+
FROM performance_schema.events_statements_summary_by_digest
126+
ORDER BY DIGEST_TEXT;
127+
SCHEMA_NAME DIGEST_TEXT COUNT_STAR
128+
test CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
129+
test DROP TABLE `test` . `v1` 1
130+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 2
131+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 2
132+
test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 2
133+
test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 2
134+
test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 2
135+
test SELECT * FROM `test` . `v1` 2
136+
test SELECT * FROM `test` . `v1` WHERE `a` = ? 2
137+
test SELECT * FROM `test` . `v1` WHERE `b` > ? 2
138+
test SELECT SCHEMA_NAME , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
139+
test SELECT `a` , `b` FROM `test` . `v1` 2
140+
test SELECT `b` , `a` FROM `test` . `v1` 2
141+
test SHOW WARNINGS 10
142+
test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
143+
DROP VIEW test.v1;
144+
DROP TABLE test.t1;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# ----------------------------------------------------
2+
# Tests for the performance schema statement Digests.
3+
# ----------------------------------------------------
4+
5+
# Test case to show behavior of statements digest when
6+
# using a view
7+
8+
# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled
9+
--source include/no_protocol.inc
10+
--source include/not_embedded.inc
11+
12+
CREATE TABLE test.v1 (a int, b int);
13+
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
14+
15+
CREATE TABLE test.t1 (a int, b int);
16+
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
17+
18+
19+
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
20+
21+
#
22+
# test.v1 is a table.
23+
# Every query here is different, and should have a different digest.
24+
#
25+
26+
EXPLAIN EXTENDED SELECT * from test.v1;
27+
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
28+
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
29+
EXPLAIN EXTENDED SELECT a, b from test.v1;
30+
EXPLAIN EXTENDED SELECT b, a from test.v1;
31+
32+
SELECT * from test.v1;
33+
SELECT * from test.v1 where a = 1;
34+
SELECT * from test.v1 where b > 100;
35+
SELECT a, b from test.v1;
36+
SELECT b, a from test.v1;
37+
38+
--echo #
39+
--echo # DIGESTS SEEN ON TABLE
40+
--echo #
41+
42+
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
43+
FROM performance_schema.events_statements_summary_by_digest
44+
ORDER BY DIGEST_TEXT;
45+
46+
DROP TABLE test.v1;
47+
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
48+
49+
#
50+
# test.v1 is now a view.
51+
# the query digests should be unchanged.
52+
#
53+
54+
EXPLAIN EXTENDED SELECT * from test.v1;
55+
EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
56+
EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
57+
EXPLAIN EXTENDED SELECT a, b from test.v1;
58+
EXPLAIN EXTENDED SELECT b, a from test.v1;
59+
60+
SELECT * from test.v1;
61+
SELECT * from test.v1 where a = 1;
62+
SELECT * from test.v1 where b > 100;
63+
SELECT a, b from test.v1;
64+
SELECT b, a from test.v1;
65+
66+
--echo #
67+
--echo # DIGESTS SEEN ON VIEW
68+
--echo #
69+
70+
SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
71+
FROM performance_schema.events_statements_summary_by_digest
72+
ORDER BY DIGEST_TEXT;
73+
74+
DROP VIEW test.v1;
75+
DROP TABLE test.t1;
76+

sql/sql_select.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5754,6 +5754,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
57545754
if (!s->const_keys.is_clear_all())
57555755
{
57565756
sargable_cond= get_sargable_cond(join, s->table);
5757+
bool is_sargable_cond_of_where= sargable_cond == &join->conds;
57575758

57585759
select= make_select(s->table, found_const_table_map,
57595760
found_const_table_map,
@@ -5770,6 +5771,12 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
57705771
*/
57715772
*sargable_cond= select->cond;
57725773

5774+
if (is_sargable_cond_of_where &&
5775+
join->conds && join->conds->type() == Item::COND_ITEM &&
5776+
((Item_cond*) (join->conds))->functype() ==
5777+
Item_func::COND_AND_FUNC)
5778+
join->cond_equal= &((Item_cond_and*) (join->conds))->m_cond_equal;
5779+
57735780
s->quick=select->quick;
57745781
s->needed_reg=select->needed_reg;
57755782
select->quick=0;

storage/columnstore/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
3131
SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/columnstore/build/postInstall_storage_engine.sh PARENT_SCOPE)
3232
SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/columnstore/build/preUn_storage_engine.sh PARENT_SCOPE)
3333
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_VERSION "")
34+
SET(CPACK_RPM_columnstore-engine_PACKAGE_SUMMARY "MariaDB ColumnStore storage engine" PARENT_SCOPE)
35+
SET(CPACK_RPM_columnstore-engine_PACKAGE_DESCRIPTION "The MariaDB ColumnStore storage engine is a high-performance columnar analytical engine, aimed at rapid processing of analytical queries on very large amounts of data." PARENT_SCOPE)
3436
ENDIF()
3537
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/columnstore")
3638
ENDIF()

0 commit comments

Comments
 (0)