summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-22 23:35:50 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-22 23:35:50 +0200
commit6e449d1ef0c79864d150090505d5b4e555ae6ab6 (patch)
treeb6119b2e18f56b79629b789cf96d665d907a95a9 /mysql-test/t/union.test
parent431607237d0d1438cdc69f5bf5a188253d7549cf (diff)
parentb20c3dc664314a3045fa31e2245d4613e9efa508 (diff)
downloadmariadb-git-6e449d1ef0c79864d150090505d5b4e555ae6ab6.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 4a3c19b49ab..55d09a7d5ac 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1384,4 +1384,41 @@ select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from
select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-14715 Assertion `!table || (!table->read_set ||
+--echo # bitmap_is_set(table->read_set, field_index))'
+--echo # failed in Field_num::val_decimal
+--echo #
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1, NULL),(3, 4);
+
+--error ER_INVALID_GROUP_FUNC_USE
+(SELECT a, sum(a) AS f FROM v1 group by a ORDER BY b + sum(a))
+UNION
+(SELECT 2, 2);
+
+(SELECT a, sum(a) AS f FROM v1 group by a ORDER BY b + 1)
+UNION
+(SELECT 2, 2);
+
+SELECT a, b FROM t1
+UNION
+(SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/a );
+
+DROP TABLE t1;
+
+--error ER_VIEW_INVALID
+(SELECT a, sum(a) AS f FROM v1 group by a ORDER BY b + 1)
+UNION
+(SELECT 2, 2);
+
+DROP VIEW v1;
+
+--error ER_NO_SUCH_TABLE
+(SELECT a, sum(a) AS f FROM v1 group by a ORDER BY b + 1)
+UNION
+(SELECT 2, 2);
+
--echo End of 5.5 tests