summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_group_innodb.result
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2022-12-22 15:49:10 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-01-04 16:50:12 +0300
commit0bef50e50b59ea1d85fea027f45cc51ca74e4074 (patch)
treeb358f442e3e4a48a443a7cf732ab2a37bbac04d6 /mysql-test/main/func_group_innodb.result
parent5db970fc760d4cfebdff236ba5bb382f0419b9f1 (diff)
downloadmariadb-git-0bef50e50b59ea1d85fea027f45cc51ca74e4074.tar.gz
MDEV-20501: Assertion `maybe_null || !null_value' failed in Item_func_round::date_opbb-10.4-mdev20501-v2
When the optimizer finds a constant (or system) table $TBL which is empty or has no matching row, it would set table->null_row=true. This is done even for tables with table->maybe_null==0. Then, it would proceed to perform query optimization phases (what for?) which will attempt to evaluate Item expressions referring to $TBL. Eventually some Item expression will get the value of $TBL.not_null_field, get SQL NULL and fail an assertion. Fixed by not performing any query optimization steps after we've got constant/empty tables with no matching rows. Test result changes contain a lot of changes like - ... Impossible WHERE noticed after reading const tables + ... no matching row in const table as well as other changes caused by slightly-different processing of the special case of empty constant tables.
Diffstat (limited to 'mysql-test/main/func_group_innodb.result')
-rw-r--r--mysql-test/main/func_group_innodb.result6
1 files changed, 2 insertions, 4 deletions
diff --git a/mysql-test/main/func_group_innodb.result b/mysql-test/main/func_group_innodb.result
index a4c9b574585..f00c0cad995 100644
--- a/mysql-test/main/func_group_innodb.result
+++ b/mysql-test/main/func_group_innodb.result
@@ -130,15 +130,13 @@ select 1, max(1) from t1i where 1=99;
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found
-1 SIMPLE t1i ALL NULL NULL NULL NULL 1
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
0 NULL NULL