summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-11-17 15:47:27 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-12 20:35:50 +0100
commit6eaa5fd21081c23f3d4da5be71a32886d98de5e9 (patch)
tree51a6073ce2cff09e4635f3d98be0bd3ad10b10ed
parent44ca4993b85461a4bdc5f53fd6fdedcc116f2e8b (diff)
downloadmariadb-git-6eaa5fd21081c23f3d4da5be71a32886d98de5e9.tar.gz
bugfix: InnoDB doesn't support ICP on vcols
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_basic.result2
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_basic.test2
-rw-r--r--storage/innobase/handler/ha_innodb.cc3
3 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
index bcd969c84fb..1d40e93cd09 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
@@ -1504,6 +1504,8 @@ NULL
NULL
NULL
0
+SELECT * FROM t WHERE d > 0;
+a b d
SELECT * FROM t;
a b d
0 0 0
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
index 342d9e42976..d0df2dc9762 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
@@ -1415,6 +1415,8 @@ ALTER TABLE t DROP COLUMN c, ADD INDEX vidx(d), ALGORITHM=INPLACE;
SELECT d FROM t;
+SELECT * FROM t WHERE d > 0;
+
SELECT * FROM t;
DROP TABLE t;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 492e1a70602..d4446aaa960 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8455,6 +8455,8 @@ ha_innobase::build_template(
if (innobase_is_v_fld(table->field[i])) {
index_contains = dict_index_contains_col_or_prefix(
index, num_v, true);
+ if (index_contains)
+ goto no_icp;
} else {
index_contains = dict_index_contains_col_or_prefix(
index, i - num_v, false);
@@ -8637,6 +8639,7 @@ ha_innobase::build_template(
m_prebuilt->idx_cond = this;
} else {
+no_icp:
mysql_row_templ_t* templ;
ulint num_v = 0;
/* No index condition pushdown */