Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.4, 11.8, 12.3, 11.4.10
-
Not for Release Notes
Description
Under semantic-equivalent rewriting, extracting the grouped subquery into a view causes a stable byte-value drift in the GROUP_CONCAT result. The source and mutated queries are logically equivalent, but produce different results.
How to repeat:
|
|
CREATE TABLE t2 (c12 BIT(8)); |
INSERT INTO t2 VALUES (b'10101101'); |
|
|
-- Source Original SQL
|
SELECT GROUP_CONCAT(col1 ORDER BY col1 SEPARATOR ',') AS col_1 |
FROM (SELECT c12 AS col1 FROM t2 GROUP BY c12) x; |
|
|
-- View SQL
|
CREATE VIEW v AS SELECT c12 AS col1 FROM t2 GROUP BY c12; |
|
|
-- Mutated SQL
|
SELECT GROUP_CONCAT(col1 ORDER BY col1 SEPARATOR ',') AS col_1 |
FROM (SELECT col1 FROM v) x; |
Observed result - Query A (original):
| col_1 |
|---|
| 173 |
Observed result - Query B (mutated):
| col_1 |
|---|
| \xad |
Attachments
Issue Links
- is duplicated by
-
MDEV-39579 CREATE VIEW materialization changes byte-valued rows in UNION query
-
- Closed
-
- relates to
-
MDEV-9331 Inconsistency between ALTER from BIT to VARCHAR and from BIT to TEXT
-
- Confirmed
-
-
MDEV-39397 Wrong result after view extraction for GROUP_CONCAT(BIT(8)) in a window function query
-
- In Review
-
- has action item
-
MSQA-96 Loading...