#At file:///home/marko/innobase/dev/mysql2a/5.6-innodb/ based on revid:vasil.dimov@stripped40im6s15lhz
3382 Marko Mäkelä 2010-12-13
Bug#58015 Assert in row_sel_field_store_in_mysql_format when running ICP test
row_sel_field_store_in_mysql_format_func(): Replace the parameter
dict_field_t* field with dict_index_t* index, ulint field_no. Relax
the debug assertion so that a column prefix can be returned during
index condition pushdown (field_no == templ->icp_rec_field_no).
Add a test case to mysql-test/include/icp_tests.inc and adjust the
results for MyISAM and InnoDB.
modified:
mysql-test/include/icp_tests.inc
mysql-test/r/innodb_icp.result
mysql-test/r/innodb_icp_all.result
mysql-test/r/innodb_icp_none.result
mysql-test/r/myisam_icp.result
mysql-test/r/myisam_icp_all.result
mysql-test/r/myisam_icp_none.result
storage/innobase/row/row0sel.c
=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc revid:vasil.dimov@stripped
+++ b/mysql-test/include/icp_tests.inc revid:marko.makela@oracle.com-20101213152245-7i8915q3ffv31liy
@@ -643,3 +643,13 @@ eval EXPLAIN $query;
eval $query;
DROP TABLE t1,t2,t3;
+
+--echo #
+--echo # Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+--echo # when running innodb_mrr_icp test"
+--echo #
+
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+drop table t1;
=== modified file 'mysql-test/r/innodb_icp.result'
--- a/mysql-test/r/innodb_icp.result revid:vasil.dimov@stripped841-8rtst40im6s15lhz
+++ b/mysql-test/r/innodb_icp.result revid:marko.makela@stripped31liy
@@ -589,5 +589,14 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set default_storage_engine= @save_storage_engine;
set optimizer_switch=default;
=== modified file 'mysql-test/r/innodb_icp_all.result'
--- a/mysql-test/r/innodb_icp_all.result revid:vasil.dimov@stripped3131841-8rtst40im6s15lhz
+++ b/mysql-test/r/innodb_icp_all.result revid:marko.makela@stripped915q3ffv31liy
@@ -589,5 +589,14 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set default_storage_engine= @save_storage_engine;
set optimizer_switch=default;
=== modified file 'mysql-test/r/innodb_icp_none.result'
--- a/mysql-test/r/innodb_icp_none.result revid:vasil.dimov@strippedom-20101213131841-8rtst40im6s15lhz
+++ b/mysql-test/r/innodb_icp_none.result revid:marko.makela@stripped3152245-7i8915q3ffv31liy
@@ -588,5 +588,14 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set default_storage_engine= @save_storage_engine;
set optimizer_switch=default;
=== modified file 'mysql-test/r/myisam_icp.result'
--- a/mysql-test/r/myisam_icp.result revid:vasil.dimov@oracle.com-20101213131841-8rtst40im6s15lhz
+++ b/mysql-test/r/myisam_icp.result revid:marko.makela@stripped245-7i8915q3ffv31liy
@@ -587,4 +587,13 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set optimizer_switch=default;
=== modified file 'mysql-test/r/myisam_icp_all.result'
--- a/mysql-test/r/myisam_icp_all.result revid:vasil.dimov@stripped
+++ b/mysql-test/r/myisam_icp_all.result revid:marko.makela@strippedom-20101213152245-7i8915q3ffv31liy
@@ -587,4 +587,13 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set optimizer_switch=default;
=== modified file 'mysql-test/r/myisam_icp_none.result'
--- a/mysql-test/r/myisam_icp_none.result revid:vasil.dimov@stripped5lhz
+++ b/mysql-test/r/myisam_icp_none.result revid:marko.makela@stripped
@@ -586,4 +586,13 @@ FROM t3));
i1
2
DROP TABLE t1,t2,t3;
+#
+# Bug#58015 "Assert in row_sel_field_store_in_mysql_format
+# when running innodb_mrr_icp test"
+#
+create table t1 (a char(2) charset utf8,b double, primary key (a(1)),key (b));
+insert into t1 values ('',1);
+select 1 from t1 where b <= 1 and a <> '';
+1
+drop table t1;
set optimizer_switch=default;
=== modified file 'storage/innobase/row/row0sel.c'
--- a/storage/innobase/row/row0sel.c revid:vasil.dimov@stripped40im6s15lhz
+++ b/storage/innobase/row/row0sel.c revid:marko.makela@stripped
@@ -2528,11 +2528,11 @@ row_sel_store_row_id_to_prebuilt(
#ifdef UNIV_DEBUG
/** Convert a non-SQL-NULL field from Innobase format to MySQL format. */
-# define row_sel_field_store_in_mysql_format(dest,templ,field,src,len) \
- row_sel_field_store_in_mysql_format_func(dest,templ,field,src,len)
+# define row_sel_field_store_in_mysql_format(dest,templ,idx,field,src,len) \
+ row_sel_field_store_in_mysql_format_func(dest,templ,idx,field,src,len)
#else /* UNIV_DEBUG */
/** Convert a non-SQL-NULL field from Innobase format to MySQL format. */
-# define row_sel_field_store_in_mysql_format(dest,templ,field,src,len) \
+# define row_sel_field_store_in_mysql_format(dest,templ,idx,field,src,len) \
row_sel_field_store_in_mysql_format_func(dest,templ,src,len)
#endif /* UNIV_DEBUG */
@@ -2555,13 +2555,21 @@ row_sel_field_store_in_mysql_format_func
type, is_unsigned, mysql_col_len,
mbminlen, mbmaxlen */
#ifdef UNIV_DEBUG
- const dict_field_t* field,
- /*!< in: InnoDB index field */
+ const dict_index_t* index,
+ /*!< in: InnoDB index */
+ ulint field_no,
+ /*!< in: templ->rec_field_no or
+ templ->clust_rec_field_no or
+ templ->icp_rec_field_no */
#endif /* UNIV_DEBUG */
const byte* data, /*!< in: data to store */
ulint len) /*!< in: length of the data */
{
- byte* ptr;
+ byte* ptr;
+#ifdef UNIV_DEBUG
+ const dict_field_t* field
+ = dict_index_get_nth_field(index, field_no);
+#endif /* UNIV_DEBUG */
ut_ad(len != UNIV_SQL_NULL);
UNIV_MEM_ASSERT_RW(data, len);
@@ -2660,7 +2668,10 @@ row_sel_field_store_in_mysql_format_func
containing UTF-8 ENUM columns due to Bug #9526. */
ut_ad(!templ->mbmaxlen
|| !(templ->mysql_col_len % templ->mbmaxlen));
- ut_ad(len * templ->mbmaxlen >= templ->mysql_col_len);
+ ut_ad(len * templ->mbmaxlen >= templ->mysql_col_len
+ || (field_no == templ->icp_rec_field_no
+ && field->prefix_len > 0));
+ ut_ad(!(field->prefix_len % templ->mbmaxlen));
if (templ->mbminlen == 1 && templ->mbmaxlen != 1) {
/* Pad with spaces. This undoes the stripping
@@ -2782,8 +2793,7 @@ row_sel_store_mysql_field_func(
row_sel_field_store_in_mysql_format(
mysql_rec + templ->mysql_col_offset,
- templ, dict_index_get_nth_field(index, field_no),
- data, len);
+ templ, index, field_no, data, len);
if (heap != prebuilt->blob_heap) {
mem_heap_free(heap);
@@ -2832,8 +2842,7 @@ row_sel_store_mysql_field_func(
row_sel_field_store_in_mysql_format(
mysql_rec + templ->mysql_col_offset,
- templ, dict_index_get_nth_field(index, field_no),
- data, len);
+ templ, index, field_no, data, len);
}
ut_ad(len != UNIV_SQL_NULL);
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20101213152245-7i8915q3ffv31liy.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk-innodb branch (marko.makela:3382) Bug#58015 | marko.makela | 13 Dec |