summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect4.test
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-03-14 17:31:29 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-03-14 17:31:29 +0530
commitadbe1c5fe986392e5a6159e4711b99d2275be81b (patch)
tree2be2ddc94e2e34f30fe6a05e24417fc037ae74bf /mysql-test/t/subselect4.test
parent3990e55fef0053e2e30f0d09d20daf2d96bdadc7 (diff)
downloadmariadb-git-adbe1c5fe986392e5a6159e4711b99d2275be81b.tar.gz
MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))'
failed with SELECT SQ, TEXT field The functon find_all_keys does call Item_subselect::walk, which calls walk() for the subquery The issue is that when a field is represented by Item_outer_ref(Item_direct_ref(Item_copy_string( ...))). Item_copy_string does have a pointer to an Item_field in Item_copy::item but does not implement Item::walk method, so we are not able to set the bitmap for that field. This is the reason why the assert fails. Fixed by adding the walk method to Item_copy class.
Diffstat (limited to 'mysql-test/t/subselect4.test')
-rw-r--r--mysql-test/t/subselect4.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index 056152cc706..f051c8eaaf2 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -2019,5 +2019,21 @@ select 1 from dual where null not in (select 1 from t1);
select 1 from dual where null not in (select 1 from t2);
drop table t1,t2;
+
+--echo #
+--echo # MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))'
+--echo # failed with SELECT SQ, TEXT field
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(8), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo'),( 'bar');
+
+CREATE TABLE t2 (b VARCHAR(8), c TINYTEXT, KEY(b)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('baz','baz'),('qux', 'qux');
+
+SELECT ( SELECT COUNT(*) FROM t1 WHERE a = c ) AS field, COUNT(DISTINCT c)
+FROM t2 WHERE b <= 'quux' GROUP BY field;
+drop table t1,t2;
+
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;