Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.9
-
None
Description
There is an inconsistency in the results when using the IFNULL function.
1. Set up table t0:
CREATE TABLE t0 (c0 BIT, c1 BIT); |
INSERT INTO t0 VALUES (0, 1); |
2. Use IFNULL in a SELECT query:
SELECT (IFNULL(t0.c0, t0.c1)) FROM t0; |
--Result: 48 |
3. Store the result of COALESCE in another table t1 and SELECT FROM t1:
CREATE TABLE t1 AS (SELECT (IFNULL(t0.c0, t0.c1)) AS c0 FROM t0); |
SELECT * FROM t1; |
--Result: 0 |
See: https://dbfiddle.uk/Mf6xPcJK
The result should be consistent regardless of whether the result is directly selected or stored in another table.