Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
Note: see also MDEV-12406
MariaDB [test]> SELECT DISTINCT b FROM v1; |
+------+ |
| b |
|
+------+ |
| 113 |
|
| NULL | |
+------+ |
2 rows in set (0.01 sec) |
|
MariaDB [test]> SELECT * FROM ( SELECT DISTINCT b FROM v1 ) cte; |
+-------+ |
| b |
|
+-------+ |
| q |
|
| NULL | |
+-------+ |
2 rows in set (0.00 sec) |
Consequently, CTEs in 10.2 are also affected:
MariaDB [test]> SELECT DISTINCT b FROM v1; |
+------+ |
| b |
|
+------+ |
| 113 |
|
| NULL | |
+------+ |
2 rows in set (0.00 sec) |
|
MariaDB [test]> WITH cte AS ( SELECT DISTINCT b FROM v1 ) SELECT * FROM cte; |
+-------+ |
| b |
|
+-------+ |
| q |
|
| NULL | |
+-------+ |
2 rows in set (0.00 sec) |
Test case |
DROP VIEW IF EXISTS v1; |
DROP TABLE IF EXISTS t1; |
|
CREATE TABLE t1 (b BIT(35)); |
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; |
INSERT INTO t1 VALUES (b'01110001'),(NULL); |
|
SELECT DISTINCT b FROM v1; |
SELECT * FROM ( SELECT DISTINCT b FROM v1 ) cte; |
WITH cte AS ( SELECT DISTINCT b FROM v1 ) SELECT * FROM cte; |
Attachments
Issue Links
- relates to
-
MDEV-12406 Aggregate function on zerofill column returns padded value from inside a derived table
- Open