diff options
Diffstat (limited to 'mysql-test/main/group_by.result')
-rw-r--r-- | mysql-test/main/group_by.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result index 47f399ecd3d..db75287c61c 100644 --- a/mysql-test/main/group_by.result +++ b/mysql-test/main/group_by.result @@ -2941,5 +2941,34 @@ f COUNT(*) NULL 1 DROP TABLE t1; # +# MDEV-24710 Uninitialized value upon CREATE .. SELECT ... VALUE +# +CREATE TABLE t1 (a VARCHAR(8) NOT NULL DEFAULT ''); +INSERT INTO t1 (a) VALUES ('foo'); +CREATE TABLE t2 AS SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +SELECT * from t2; +f1 f2 +NULL NULL +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +f1 f2 +NULL NULL +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE 1=0; +f1 f2 +NULL NULL +drop table t1,t2; +# Extra test by to check the fix for MDEV-24710 +create table t20 (pk int primary key, a int); +insert into t20 values (1,1); +create table t21 (pk int primary key, b int not null); +insert into t21 values (1,1); +create table t22 (a int); +insert into t22 values (1),(2); +select a, (select max(t21.b) from t20 left join t21 on t21.pk=t20.a+10 +where t20.pk=1 and rand(123) < 0.5) as SUBQ from t22; +a SUBQ +1 NULL +2 NULL +drop table t20, t21, t22; +# # End of 10.3 tests # |