diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-09-22 17:52:05 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2016-09-28 21:12:48 +0200 |
commit | 9ff9acb3079b1c48f5be0f0a689cbbdda82b4c0e (patch) | |
tree | bcc314b7cd1db32f6d61a400bcea8d81c409d4f0 /mysql-test/t/having.test | |
parent | d5dfa0f1c20614ca083a0c4f841534f2f68808dd (diff) | |
download | mariadb-git-9ff9acb3079b1c48f5be0f0a689cbbdda82b4c0e.tar.gz |
MDEV-10716: Assertion `real_type() != FIELD_ITEM' failed in Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)
Degenerated condition in AND should be treated in the same
way as in WHERE/HAVING alone (i.e reference should be
processed as well as fields)
Diffstat (limited to 'mysql-test/t/having.test')
-rw-r--r-- | mysql-test/t/having.test | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 0f6be0b0ec6..f826feff5c0 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -743,3 +743,18 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; DROP TABLE t1,t2; --echo End of 10.0 tests + +--echo # +--echo # MDEV-10716: Assertion `real_type() != FIELD_ITEM' failed in +--echo # Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**) +--echo # +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i<>0 AND 1; +SELECT i-1 A, COUNT(*) FROM t1 GROUP BY i HAVING A AND 1; +CREATE VIEW v1 as select i, i-1 as A from t1; +SELECT A, COUNT(*) FROM v1 GROUP BY i HAVING A AND 1; +DROP VIEW v1; +DROP TABLE t1; + +--echo End of 10.1 tests |