Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.4.10
Description
Under semantic-equivalent rewriting, extracting a grouped aggregate into a view causes a stable row-count mismatch on MariaDB.
The source and mutated queries are logically equivalent, but produce different results.
CREATE TABLE t1 (c4 INT NULL); |
INSERT INTO t1 (c4) VALUES (1); |
INSERT INTO t1 (c4) VALUES (2); |
|
|
-- Source Original SQL
|
SELECT DISTINCT VARIANCE(fqd39.c4) AS col_2 FROM t1 AS fqd39 GROUP BY fqd39.c4; |
|
|
-- View SQL
|
CREATE VIEW v AS SELECT VARIANCE(fqd39.c4) AS col_2 FROM t1 AS fqd39 GROUP BY fqd39.c4; |
|
|
-- Mutated SQL
|
SELECT DISTINCT v.col_2 AS col_2 FROM v; |
Observed result - Query A (original):
| col_2 |
|---|
| 0.0 |
| 0.0 |
Observed result - Query B (mutated):
| col_2 |
|---|
| 0.0 |
Attachments
Issue Links
- is duplicated by
-
MDEV-39726 CREATE VIEW extraction changes COUNT(*) result for ordered grouped VAR_SAMP(... ) IS NULL query
-
- Closed
-
-
MDEV-39734 Replacing a base table with an equivalent passthrough view makes a valid grouped expression query fail under `ONLY_FULL_GROUP_BY`
-
- Closed
-
-
MDEV-39737 CREATE VIEW with `ALGORITHM=MERGE` and `ALGORITHM=TEMPTABLE` return different grouped `VAR_SAMP(...)` results under `HAVING ... IS NULL`
-
- Closed
-