Under SQL-equivalent rewriting, the source and mutated queries differ only in extracting the grouped aggregate into a view. The aggregate output changes from NULL to 1.
Version: 8.0.44-alisql-dev
How to repeat:
DROP VIEW IF EXISTS v;
DROP TABLE IF EXISTS t;
CREATE TABLE t (
c1 TINYINT NOT NULL,
c6 VARCHAR(1) NOT NULL
);
CREATE UNIQUE INDEX idx_t_c1 ON t (c1);
CREATE INDEX idx_t_c6 ON t (c6);
INSERT INTO t VALUES (1, 'x');
-- Original SQL
SELECT SUM(DISTINCT c1) AS s,
ROW_NUMBER() OVER () AS r
FROM t
GROUP BY c6;
-- View SQL
CREATE VIEW v AS
SELECT SUM(DISTINCT c1) AS s,
c6
FROM t
GROUP BY c6;
-- Mutated SQL
SELECT s,
ROW_NUMBER() OVER () AS r
FROM v;
Observed mismatch:
Under SQL-equivalent rewriting, the source and mutated queries differ only in extracting the grouped aggregate into a view. The aggregate output changes from
NULLto1.Version:
8.0.44-alisql-devHow to repeat:
Observed mismatch: