Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5
-
None
-
None
Description
This query seems to return a correct result:
CREATE OR REPLACE TABLE t1 (a int) ENGINE=MyISAM; |
INSERT INTO t1 VALUES (NULL); |
SELECT 1,min(1) FROM t1 WHERE if(uuid_short(), a,1); |
+---+--------+ |
| 1 | min(1) | |
+---+--------+ |
| 1 | NULL | |
+---+--------+ |
Notice, the WHERE condition returns NULL in this statement and all statements below.
This query on a table with a single record erroneously returns 0 instead of 1
CREATE OR REPLACE TABLE t1 (a int) ENGINE=MyISAM; |
INSERT INTO t1 VALUES (NULL); |
SELECT 1+0,min(1) FROM t1 WHERE if(uuid_short(), a,1); |
+-----+--------+ |
| 1+0 | min(1) | |
+-----+--------+ |
| 0 | NULL | |
+-----+--------+ |
But if the table if empty, the result is correct:
CREATE OR REPLACE TABLE t1 (a int) ENGINE=MyISAM; |
SELECT 1+0,min(1) FROM t1 WHERE if(uuid_short(), a,1); |
+-----+--------+ |
| 1+0 | min(1) | |
+-----+--------+ |
| 1 | NULL | |
+-----+--------+ |
And if the table has more than one records, the result is also correct:
CREATE OR REPLACE TABLE t1 (a int) ENGINE=MyISAM; |
INSERT INTO t1 VALUES (NULL),(NULL); |
SELECT 1+0,min(1) FROM t1 WHERE if(uuid_short(), a,1); |
+-----+--------+ |
| 1+0 | min(1) | |
+-----+--------+ |
| 1 | NULL | |
+-----+--------+ |
Attachments
Issue Links
- relates to
-
MDEV-34922 Assertion `value.length() == FbtImpl::binary_length()' failed in Type_handler_fbt<FbtImpl, TypeCollectionImpl>::Field_fbt::store_native, Assertion `item->null_value' failed in Type_handler::Item_send_str
- Stalled