Commit 0f0bced8 authored by Alexander Barkov's avatar Alexander Barkov

Adding tests for MDEV-9410 VIEW over a ROLLUP query reports too large columns

The fix for MDEV-12866 fixed this problem as well. Adding tests only.
parent a9b79bf7
......@@ -792,3 +792,27 @@ LENGTH(a) int(10) YES NULL
COUNT(*) bigint(21) NO 0
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-9410 VIEW over a ROLLUP query reports too large columns
#
CREATE TABLE t1 (a int(10) NOT NULL, b int(20) NOT NULL);
INSERT INTO t1 VALUES (1,1),(2,2);
CREATE VIEW v1 AS SELECT a,b FROM t1;
DESC v1;
Field Type Null Key Default Extra
a int(10) NO NULL
b int(20) NO NULL
DROP VIEW v1;
CREATE VIEW v1 AS SELECT a, b FROM t1 GROUP BY a,b;
DESC v1;
Field Type Null Key Default Extra
a int(10) NO NULL
b int(20) NO NULL
DROP VIEW v1;
CREATE VIEW v1 AS SELECT a, b FROM t1 GROUP BY a,b WITH ROLLUP;
DESC v1;
Field Type Null Key Default Extra
a int(11) YES 0
b int(20) YES 0
DROP VIEW v1;
DROP TABLE t1;
......@@ -426,3 +426,24 @@ CREATE OR REPLACE VIEW v1 AS SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WI
DESCRIBE v1;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-9410 VIEW over a ROLLUP query reports too large columns
--echo #
CREATE TABLE t1 (a int(10) NOT NULL, b int(20) NOT NULL);
INSERT INTO t1 VALUES (1,1),(2,2);
CREATE VIEW v1 AS SELECT a,b FROM t1;
DESC v1;
DROP VIEW v1;
CREATE VIEW v1 AS SELECT a, b FROM t1 GROUP BY a,b;
DESC v1;
DROP VIEW v1;
CREATE VIEW v1 AS SELECT a, b FROM t1 GROUP BY a,b WITH ROLLUP;
DESC v1;
DROP VIEW v1;
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment