Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.4, 11.4.10
-
Unexpected results
Description
Under semantic-equivalent rewriting, extracting the subquery into a view causes a stable byte-value drift in the UNION result.
The source and mutated queries are logically equivalent, but produce different results.
How to repeat:
CREATE TABLE t1 (c4 INT); |
CREATE TABLE t2 (c12 BIT(8)); |
INSERT INTO t1 VALUES (1); |
INSERT INTO t2 (c12) VALUES (b'01111110'); |
|
|
-- Source Original SQL
|
SELECT (SELECT c12 FROM t2) AS col_1 FROM t1 GROUP BY 1 UNION SELECT 24; |
|
|
-- View SQL
|
CREATE VIEW v AS |
SELECT (SELECT c12 FROM t2) AS col_1 AS col_2 |
FROM t1 |
GROUP BY 1; |
|
|
-- Mutated SQL
|
SELECT col_1 FROM v UNION SELECT 24; |
}
|
Observed result - Query A (original):
| col_1 |
|---|
| 126 |
| 24 |
Observed result - Query B (mutated):
| col_1 |
|---|
| 255 |
| 24 |
Attachments
Issue Links
- duplicates
-
MDEV-39578 CREATE VIEW materialization changes byte-valued rows in non-set-operation query
-
- Closed
-
- has action item
-
MSQA-96 Loading...