[Commits] Rev 3771: MDEV-5446: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails on EXPLAIN EXTENDED with VALUES function in file:///home/bell/maria/bzr/work-maria-5.3-MDEV-5446/

sanja at montyprogram.com sanja at montyprogram.com
Fri Mar 14 11:38:17 EET 2014


At file:///home/bell/maria/bzr/work-maria-5.3-MDEV-5446/

------------------------------------------------------------
revno: 3771
revision-id: sanja at montyprogram.com-20140314093817-uy7afpq3odwnt83s
parent: sergii at pisem.net-20140313173652-kyptzm7fukb7jb28
committer: sanja at montyprogram.com
branch nick: work-maria-5.3-MDEV-5446
timestamp: Fri 2014-03-14 11:38:17 +0200
message:
  MDEV-5446: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails on EXPLAIN EXTENDED with VALUES function
  
  field_index should be set correctly for null field created by Item_insert_value::fix_fields().
-------------- next part --------------
=== modified file 'mysql-test/r/func_misc.result'
--- a/mysql-test/r/func_misc.result	2014-02-12 20:17:28 +0000
+++ b/mysql-test/r/func_misc.result	2014-03-14 09:38:17 +0000
@@ -272,3 +272,19 @@ ERROR HY000: Incorrect arguments to NAME
 SELECT NAME_CONST('a', -(1)) OR 1;
 NAME_CONST('a', -(1)) OR 1
 1
+#
+#MDEV-5446: Assertion `!table || (!table->read_set ||
+#bitmap_is_set(table->read_set, field_index))' fails on
+#EXPLAIN EXTENDED with VALUES function
+#
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10);
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT VALUES(b) FROM v1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	100.00	
+Warnings:
+Note	1003	select values(10) AS `VALUES(b)` from `test`.`t1`
+drop view v1;
+drop table t1;
+End of 5.3 tests

=== modified file 'mysql-test/t/func_misc.test'
--- a/mysql-test/t/func_misc.test	2014-02-12 20:17:28 +0000
+++ b/mysql-test/t/func_misc.test	2014-03-14 09:38:17 +0000
@@ -310,3 +310,18 @@ SELECT NAME_CONST('a', -(1 OR 2)) OR 1;
 SELECT NAME_CONST('a', -(1 AND 2)) AND 1;
 SELECT NAME_CONST('a', -(1)) OR 1;
 
+--echo #
+--echo #MDEV-5446: Assertion `!table || (!table->read_set ||
+--echo #bitmap_is_set(table->read_set, field_index))' fails on
+--echo #EXPLAIN EXTENDED with VALUES function
+--echo #
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+EXPLAIN EXTENDED SELECT VALUES(b) FROM v1;
+
+drop view v1;
+drop table t1;
+
+--echo End of 5.3 tests

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2014-02-13 09:15:03 +0000
+++ b/sql/item.cc	2014-03-14 09:38:17 +0000
@@ -7897,6 +7897,8 @@ bool Item_insert_value::fix_fields(THD *
     {
       tmp_field->init(field_arg->field->table);
       set_field(tmp_field);
+      // the index is important when read bits set
+      tmp_field->field_index= field_arg->field->field_index;
     }
   }
   return FALSE;



More information about the commits mailing list