Under SQL-equivalent rewriting, the source and mutated queries differ only in replacing base table t with projection view v(c1, c9). The result changes from two rows to one row.
Version: 8.0.44-alisql-dev
How to repeat:
DROP VIEW IF EXISTS v;
DROP TABLE IF EXISTS t;
CREATE TABLE t (
c1 TINYINT,
c9 TINYINT
);
INSERT INTO t VALUES (0, 0), (0, 1);
-- Original SQL
SELECT DISTINCT -c9 AS col_1, c1
FROM t
GROUP BY -c9, c1
ORDER BY c1, -c9;
-- View SQL
CREATE VIEW v AS
SELECT c1, c9
FROM t;
-- Mutated SQL
SELECT DISTINCT -v.c9 AS col_1, v.c1
FROM v
GROUP BY -v.c9, v.c1
ORDER BY v.c1, -v.c9;
Observed mismatch:
Under SQL-equivalent rewriting, the source and mutated queries differ only in replacing base table
twith projection viewv(c1, c9). The result changes from two rows to one row.Version:
8.0.44-alisql-devHow to repeat:
Observed mismatch: