summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2023-05-05 11:31:35 +0300
committerMonty <monty@mariadb.org>2023-05-05 13:15:14 +0300
commit84b9fc25a29b94a37eb9d5ac2e2c0f75c0efafda (patch)
tree91c19299e7e399849ce639f473dc9d67fff0dd24
parentc874d5c68d24fb78bb6d59db1927ea5794891e38 (diff)
downloadmariadb-git-bb-10.4-monty.tar.gz
Fixed wrong test cases (embedded and ASAN)bb-10.4-monty
- main.selectivity failed because one test produced different result with embedded (missing feature). Fixed by moving the failing part to selectivity_notembedded. - Disabled maria.encrypt-no-key for embedded as embedded does not support encryption - Moved test from join_cache to join_cache_notasan that tried to alloc() a buffer bigger than available memory.
-rw-r--r--mysql-test/main/join_cache.result27
-rw-r--r--mysql-test/main/join_cache.test28
-rw-r--r--mysql-test/main/join_cache_notasan.result27
-rw-r--r--mysql-test/main/join_cache_notasan.test35
-rw-r--r--mysql-test/main/selectivity.result69
-rw-r--r--mysql-test/main/selectivity.test79
-rw-r--r--mysql-test/main/selectivity_innodb.result67
-rw-r--r--mysql-test/main/selectivity_notembedded.result83
-rw-r--r--mysql-test/main/selectivity_notembedded.test102
-rw-r--r--mysql-test/suite/maria/encrypt-no-key.test1
10 files changed, 248 insertions, 270 deletions
diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result
index f5ddbfea733..6b39f936628 100644
--- a/mysql-test/main/join_cache.result
+++ b/mysql-test/main/join_cache.result
@@ -6229,33 +6229,6 @@ EXPLAIN
}
drop table t1,t2,t3;
# End of 10.3 tests
-#
-# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size
-#
-CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb;
-INSERT INTO t1 VALUES (1332945389);
-CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb;
-INSERT INTO t2 VALUES (1180244875), (1951338178);
-SET SESSION join_buffer_size= X;
-Warnings:
-Warning X Truncated incorrect join_buffer_size value: 'X'
-SET SESSION join_cache_level = 4;
-SET optimizer_switch='optimize_join_buffer_size=on';
-SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-i
-SET optimizer_switch='optimize_join_buffer_size=off';
-SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)'
-SET SESSION join_buffer_size= 10000000;
-SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-i i
-SET SESSION optimizer_switch= default;
-SET SESSION join_buffer_size= default;
-SET SESSION join_cache_level= default;
-drop table t1,t2;
-#
-# End of 10.4 tests
-#
set @@optimizer_switch=@save_optimizer_switch;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test
index 500fd9e1049..07ac0b760cf 100644
--- a/mysql-test/main/join_cache.test
+++ b/mysql-test/main/join_cache.test
@@ -4201,34 +4201,6 @@ drop table t1,t2,t3;
--echo # End of 10.3 tests
---echo #
---echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size
---echo #
-
-CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb;
-INSERT INTO t1 VALUES (1332945389);
-CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb;
-INSERT INTO t2 VALUES (1180244875), (1951338178);
---replace_regex /[0-9][0-9]+/X/
-SET SESSION join_buffer_size= 5250229460064350213;
-SET SESSION join_cache_level = 4;
-SET optimizer_switch='optimize_join_buffer_size=on';
-SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-SET optimizer_switch='optimize_join_buffer_size=off';
---replace_regex /[0-9][0-9]+/X/
---error ER_OUTOFMEMORY
-SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-SET SESSION join_buffer_size= 10000000;
-SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
-SET SESSION optimizer_switch= default;
-SET SESSION join_buffer_size= default;
-SET SESSION join_cache_level= default;
-drop table t1,t2;
-
---echo #
---echo # End of 10.4 tests
---echo #
-
# The following command must be the last one in the file
set @@optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/main/join_cache_notasan.result b/mysql-test/main/join_cache_notasan.result
new file mode 100644
index 00000000000..3cec949f5c6
--- /dev/null
+++ b/mysql-test/main/join_cache_notasan.result
@@ -0,0 +1,27 @@
+#
+# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size
+#
+CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb;
+INSERT INTO t1 VALUES (1332945389);
+CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb;
+INSERT INTO t2 VALUES (1180244875), (1951338178);
+SET SESSION join_buffer_size= X;
+Warnings:
+Warning X Truncated incorrect join_buffer_size value: 'X'
+SET SESSION join_cache_level = 4;
+SET optimizer_switch='optimize_join_buffer_size=on';
+SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+i
+SET optimizer_switch='optimize_join_buffer_size=off';
+SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)'
+SET SESSION join_buffer_size= 10000000;
+SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+i i
+SET SESSION optimizer_switch= default;
+SET SESSION join_buffer_size= default;
+SET SESSION join_cache_level= default;
+drop table t1,t2;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/join_cache_notasan.test b/mysql-test/main/join_cache_notasan.test
new file mode 100644
index 00000000000..7fd5e4e80b1
--- /dev/null
+++ b/mysql-test/main/join_cache_notasan.test
@@ -0,0 +1,35 @@
+#
+# Tests that should be in join_cache but cannot be run with ASAN
+
+--source include/not_asan.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size
+--echo #
+
+# This test tries to allocate a too big bufffer, for which ASAN gives an error
+
+CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb;
+INSERT INTO t1 VALUES (1332945389);
+CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb;
+INSERT INTO t2 VALUES (1180244875), (1951338178);
+--replace_regex /[0-9][0-9]+/X/
+SET SESSION join_buffer_size= 5250229460064350213;
+SET SESSION join_cache_level = 4;
+SET optimizer_switch='optimize_join_buffer_size=on';
+SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+SET optimizer_switch='optimize_join_buffer_size=off';
+--replace_regex /[0-9][0-9]+/X/
+--error ER_OUTOFMEMORY
+SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+SET SESSION join_buffer_size= 10000000;
+SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i;
+SET SESSION optimizer_switch= default;
+SET SESSION join_buffer_size= default;
+SET SESSION join_cache_level= default;
+drop table t1,t2;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index 7d7343847cd..a6866e55b13 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -1937,75 +1937,6 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2
DROP TABLE t1;
# End of 10.2 tests
-#
-# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
-#
-create table t0(a int);
-insert into t0 select 1 from seq_1_to_78;
-create table t1(a int);
-insert into t1 select 1 from seq_1_to_26;
-create table t10 (a int);
-insert into t10 select 0 from t0, seq_1_to_4;
-insert into t10 select 8693 from t1;
-insert into t10 select 8694 from t1;
-insert into t10 select 8695 from t1;
-insert into t10 select 34783 from t1;
-insert into t10 select 34784 from t1;
-insert into t10 select 34785 from t1;
-insert into t10 select 34785 from t0, seq_1_to_8;
-insert into t10 select 65214 from t1;
-insert into t10 select 65215 from t1;
-insert into t10 select 65216 from t1;
-insert into t10 select 65216 from t0, seq_1_to_52;
-insert into t10 select 65217 from t1;
-insert into t10 select 65218 from t1;
-insert into t10 select 65219 from t1;
-insert into t10 select 65219 from t0;
-insert into t10 select 73913 from t1;
-insert into t10 select 73914 from t1;
-insert into t10 select 73915 from t1;
-insert into t10 select 73915 from t0, seq_1_to_40;
-insert into t10 select 78257 from t1;
-insert into t10 select 78258 from t1;
-insert into t10 select 78259 from t1;
-insert into t10 select 91300 from t1;
-insert into t10 select 91301 from t1;
-insert into t10 select 91302 from t1;
-insert into t10 select 91302 from t0, seq_1_to_6;
-insert into t10 select 91303 from t1;
-insert into t10 select 91304 from t1;
-insert into t10 select 91305 from t1;
-insert into t10 select 91305 from t0, seq_1_to_8;
-insert into t10 select 99998 from t1;
-insert into t10 select 99999 from t1;
-insert into t10 select 100000 from t1;
-set use_stat_tables=preferably;
-analyze table t10 persistent for all;
-Table Op Msg_type Msg_text
-test.t10 analyze status Engine-independent statistics collected
-test.t10 analyze status OK
-flush tables;
-set @tmp=@@optimizer_trace;
-set optimizer_trace=1;
-explain select * from t10 where a in (91303);
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where
-# Must have selectivity_from_histogram <= 1.0:
-select json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
-from information_schema.optimizer_trace;
-json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
-[
- [
- {
- "column_name": "a",
- "ranges":
- ["91303 <= a <= 91303"],
- "selectivity_from_histogram": 0.0357
- }
- ]
-]
-set optimizer_trace=@tmp;
-drop table t0,t1,t10;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index 06a3e32da95..def74394ec5 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -1324,85 +1324,6 @@ DROP TABLE t1;
--echo # End of 10.2 tests
---echo #
---echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
---echo #
-create table t0(a int); # This holds how many rows we hold in a bucket.
-insert into t0 select 1 from seq_1_to_78;
-
-create table t1(a int); # one-third of a bucket
-insert into t1 select 1 from seq_1_to_26;
-
-create table t10 (a int);
-insert into t10 select 0 from t0, seq_1_to_4;
-
-insert into t10 select 8693 from t1;
-insert into t10 select 8694 from t1;
-insert into t10 select 8695 from t1;
-
-
-insert into t10 select 34783 from t1;
-insert into t10 select 34784 from t1;
-insert into t10 select 34785 from t1;
-
-
-insert into t10 select 34785 from t0, seq_1_to_8;
-
-insert into t10 select 65214 from t1;
-insert into t10 select 65215 from t1;
-insert into t10 select 65216 from t1;
-
-insert into t10 select 65216 from t0, seq_1_to_52;
-
-insert into t10 select 65217 from t1;
-insert into t10 select 65218 from t1;
-insert into t10 select 65219 from t1;
-
-insert into t10 select 65219 from t0;
-
-
-insert into t10 select 73913 from t1;
-insert into t10 select 73914 from t1;
-insert into t10 select 73915 from t1;
-
-insert into t10 select 73915 from t0, seq_1_to_40;
-
-
-insert into t10 select 78257 from t1;
-insert into t10 select 78258 from t1;
-insert into t10 select 78259 from t1;
-
-insert into t10 select 91300 from t1;
-insert into t10 select 91301 from t1;
-insert into t10 select 91302 from t1;
-
-insert into t10 select 91302 from t0, seq_1_to_6;
-
-insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple
-insert into t10 select 91304 from t1;
-insert into t10 select 91305 from t1;
-
-insert into t10 select 91305 from t0, seq_1_to_8;
-
-insert into t10 select 99998 from t1;
-insert into t10 select 99999 from t1;
-insert into t10 select 100000 from t1;
-
-set use_stat_tables=preferably;
-analyze table t10 persistent for all;
-flush tables;
-
-set @tmp=@@optimizer_trace;
-set optimizer_trace=1;
-explain select * from t10 where a in (91303);
-
---echo # Must have selectivity_from_histogram <= 1.0:
-select json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
-from information_schema.optimizer_trace;
-
-set optimizer_trace=@tmp;
-drop table t0,t1,t10;
-
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result
index dfba12f2b05..13816f8185c 100644
--- a/mysql-test/main/selectivity_innodb.result
+++ b/mysql-test/main/selectivity_innodb.result
@@ -1947,73 +1947,6 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2
DROP TABLE t1;
# End of 10.2 tests
-#
-# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
-#
-create table t0(a int);
-insert into t0 select 1 from seq_1_to_78;
-create table t1(a int);
-insert into t1 select 1 from seq_1_to_26;
-create table t10 (a int);
-insert into t10 select 0 from t0, seq_1_to_4;
-insert into t10 select 8693 from t1;
-insert into t10 select 8694 from t1;
-insert into t10 select 8695 from t1;
-insert into t10 select 34783 from t1;
-insert into t10 select 34784 from t1;
-insert into t10 select 34785 from t1;
-insert into t10 select 34785 from t0, seq_1_to_8;
-insert into t10 select 65214 from t1;
-insert into t10 select 65215 from t1;
-insert into t10 select 65216 from t1;
-insert into t10 select 65216 from t0, seq_1_to_52;
-insert into t10 select 65217 from t1;
-insert into t10 select 65218 from t1;
-insert into t10 select 65219 from t1;
-insert into t10 select 65219 from t0;
-insert into t10 select 73913 from t1;
-insert into t10 select 73914 from t1;
-insert into t10 select 73915 from t1;
-insert into t10 select 73915 from t0, seq_1_to_40;
-insert into t10 select 78257 from t1;
-insert into t10 select 78258 from t1;
-insert into t10 select 78259 from t1;
-insert into t10 select 91300 from t1;
-insert into t10 select 91301 from t1;
-insert into t10 select 91302 from t1;
-insert into t10 select 91302 from t0, seq_1_to_6;
-insert into t10 select 91303 from t1;
-insert into t10 select 91304 from t1;
-insert into t10 select 91305 from t1;
-insert into t10 select 91305 from t0, seq_1_to_8;
-insert into t10 select 99998 from t1;
-insert into t10 select 99999 from t1;
-insert into t10 select 100000 from t1;
-set use_stat_tables=preferably;
-analyze table t10 persistent for all;
-Table Op Msg_type Msg_text
-test.t10 analyze status Engine-independent statistics collected
-test.t10 analyze status OK
-flush tables;
-set statement optimizer_trace=1 for
-explain select * from t10 where a in (91303);
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where
-# Must have selectivity_from_histogram <= 1.0:
-select json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
-from information_schema.optimizer_trace;
-json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
-[
- [
- {
- "column_name": "a",
- "ranges":
- ["91303 <= a <= 91303"],
- "selectivity_from_histogram": 0.035714283
- }
- ]
-]
-drop table t0,t1,t10;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result
new file mode 100644
index 00000000000..8b298a95801
--- /dev/null
+++ b/mysql-test/main/selectivity_notembedded.result
@@ -0,0 +1,83 @@
+#
+# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
+#
+set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
+set @save_use_stat_tables=@@use_stat_tables;
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+SET histogram_size= 255;
+set histogram_type='DOUBLE_PREC_HB';
+set use_stat_tables=preferably;
+SET optimizer_use_condition_selectivity=3;
+create table t0(a int);
+insert into t0 select 1 from seq_1_to_78;
+create table t1(a int);
+insert into t1 select 1 from seq_1_to_26;
+create table t10 (a int);
+insert into t10 select 0 from t0, seq_1_to_4;
+insert into t10 select 8693 from t1;
+insert into t10 select 8694 from t1;
+insert into t10 select 8695 from t1;
+insert into t10 select 34783 from t1;
+insert into t10 select 34784 from t1;
+insert into t10 select 34785 from t1;
+insert into t10 select 34785 from t0, seq_1_to_8;
+insert into t10 select 65214 from t1;
+insert into t10 select 65215 from t1;
+insert into t10 select 65216 from t1;
+insert into t10 select 65216 from t0, seq_1_to_52;
+insert into t10 select 65217 from t1;
+insert into t10 select 65218 from t1;
+insert into t10 select 65219 from t1;
+insert into t10 select 65219 from t0;
+insert into t10 select 73913 from t1;
+insert into t10 select 73914 from t1;
+insert into t10 select 73915 from t1;
+insert into t10 select 73915 from t0, seq_1_to_40;
+insert into t10 select 78257 from t1;
+insert into t10 select 78258 from t1;
+insert into t10 select 78259 from t1;
+insert into t10 select 91300 from t1;
+insert into t10 select 91301 from t1;
+insert into t10 select 91302 from t1;
+insert into t10 select 91302 from t0, seq_1_to_6;
+insert into t10 select 91303 from t1;
+insert into t10 select 91304 from t1;
+insert into t10 select 91305 from t1;
+insert into t10 select 91305 from t0, seq_1_to_8;
+insert into t10 select 99998 from t1;
+insert into t10 select 99999 from t1;
+insert into t10 select 100000 from t1;
+analyze table t10 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status OK
+flush tables;
+set @tmp=@@optimizer_trace;
+set optimizer_trace=1;
+explain select * from t10 where a in (91303);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where
+# Must have selectivity_from_histogram <= 1.0:
+select json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
+from information_schema.optimizer_trace;
+json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
+[
+ [
+ {
+ "column_name": "a",
+ "ranges":
+ ["91303 <= a <= 91303"],
+ "selectivity_from_histogram": 0.0357
+ }
+ ]
+]
+drop table t0,t1,t10;
+set optimizer_trace=@tmp;
+set @@histogram_size=@save_histogram_size;
+set @histogram_type=@save_histogram_type;
+set @use_stat_tables=@save_use_stat_tables;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/selectivity_notembedded.test b/mysql-test/main/selectivity_notembedded.test
new file mode 100644
index 00000000000..f79c370186f
--- /dev/null
+++ b/mysql-test/main/selectivity_notembedded.test
@@ -0,0 +1,102 @@
+--source include/have_stat_tables.inc
+--source include/have_sequence.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
+--echo #
+
+set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
+set @save_use_stat_tables=@@use_stat_tables;
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+
+SET histogram_size= 255;
+set histogram_type='DOUBLE_PREC_HB';
+set use_stat_tables=preferably;
+SET optimizer_use_condition_selectivity=3;
+
+create table t0(a int); # This holds how many rows we hold in a bucket.
+insert into t0 select 1 from seq_1_to_78;
+
+create table t1(a int); # one-third of a bucket
+insert into t1 select 1 from seq_1_to_26;
+
+create table t10 (a int);
+insert into t10 select 0 from t0, seq_1_to_4;
+
+insert into t10 select 8693 from t1;
+insert into t10 select 8694 from t1;
+insert into t10 select 8695 from t1;
+
+
+insert into t10 select 34783 from t1;
+insert into t10 select 34784 from t1;
+insert into t10 select 34785 from t1;
+
+
+insert into t10 select 34785 from t0, seq_1_to_8;
+
+insert into t10 select 65214 from t1;
+insert into t10 select 65215 from t1;
+insert into t10 select 65216 from t1;
+
+insert into t10 select 65216 from t0, seq_1_to_52;
+
+insert into t10 select 65217 from t1;
+insert into t10 select 65218 from t1;
+insert into t10 select 65219 from t1;
+
+insert into t10 select 65219 from t0;
+
+
+insert into t10 select 73913 from t1;
+insert into t10 select 73914 from t1;
+insert into t10 select 73915 from t1;
+
+insert into t10 select 73915 from t0, seq_1_to_40;
+
+
+insert into t10 select 78257 from t1;
+insert into t10 select 78258 from t1;
+insert into t10 select 78259 from t1;
+
+insert into t10 select 91300 from t1;
+insert into t10 select 91301 from t1;
+insert into t10 select 91302 from t1;
+
+insert into t10 select 91302 from t0, seq_1_to_6;
+
+insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple
+insert into t10 select 91304 from t1;
+insert into t10 select 91305 from t1;
+
+insert into t10 select 91305 from t0, seq_1_to_8;
+
+insert into t10 select 99998 from t1;
+insert into t10 select 99999 from t1;
+insert into t10 select 100000 from t1;
+
+analyze table t10 persistent for all;
+flush tables;
+
+set @tmp=@@optimizer_trace;
+set optimizer_trace=1;
+explain select * from t10 where a in (91303);
+
+--echo # Must have selectivity_from_histogram <= 1.0:
+--replace_result 0.035714283 0.0357
+select json_detailed(json_extract(trace, '$**.selectivity_for_columns'))
+from information_schema.optimizer_trace;
+
+drop table t0,t1,t10;
+
+set optimizer_trace=@tmp;
+set @@histogram_size=@save_histogram_size;
+set @histogram_type=@save_histogram_type;
+set @use_stat_tables=@save_use_stat_tables;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test
index b3f2f4b4bf3..89c50d79a54 100644
--- a/mysql-test/suite/maria/encrypt-no-key.test
+++ b/mysql-test/suite/maria/encrypt-no-key.test
@@ -1,3 +1,4 @@
+--source include/not_embedded.inc
#
# MDEV-18496 Crash when Aria encryption is enabled but plugin not available
#