summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin <sachin.setiya@mariadb.com>2019-01-29 02:36:49 +0530
committerSachin <sachin.setiya@mariadb.com>2019-01-29 02:36:49 +0530
commitf9bf086f562e472075f4cd341bf093cac256a428 (patch)
tree7ef6fb654e62b39239909ee25a8b7fd5dc498ec7
parent5a34634317c218a5210944d1383366b0534efdbe (diff)
downloadmariadb-git-10.4-blob-index-optimizer-serg.tar.gz
-rw-r--r--mysql-test/main/long_unique_where.result6
-rw-r--r--mysql-test/main/long_unique_where_debug.result15
-rw-r--r--mysql-test/main/long_unique_where_debug.test9
-rw-r--r--sql/sql_select.cc2
4 files changed, 24 insertions, 8 deletions
diff --git a/mysql-test/main/long_unique_where.result b/mysql-test/main/long_unique_where.result
index da524395d47..20411dbef62 100644
--- a/mysql-test/main/long_unique_where.result
+++ b/mysql-test/main/long_unique_where.result
@@ -15,7 +15,7 @@ key a
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where b="34" and c = "34";;
id 1
select_type SIMPLE
@@ -26,7 +26,7 @@ key b
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where c="34" and b="34";;
id 1
select_type SIMPLE
@@ -37,7 +37,7 @@ key b
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where c="34";;
id 1
select_type SIMPLE
diff --git a/mysql-test/main/long_unique_where_debug.result b/mysql-test/main/long_unique_where_debug.result
index d770a175836..000e9e12b6b 100644
--- a/mysql-test/main/long_unique_where_debug.result
+++ b/mysql-test/main/long_unique_where_debug.result
@@ -1,8 +1,15 @@
#In this test case we will check what will happen in the case of hash collusion
-SET debug_dbug="d,same_long_unique_hash";
+SET debug_dbug="d,same_long_unique_hash,test_completely_invisible";
create table t1(a blob unique , b blob , c blob, unique(b,c));
insert into t1 values(1,1,1);
insert into t1 values(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1;
+DB_ROW_HASH_1 DB_ROW_HASH_2
+9 9
+9 9
+9 9
+9 9
+9 9
insert into t1 select a+5, b+5, c+5 from t1;
insert into t1 select a+10, b+10, c+10 from t1;
insert into t1 select a+20, b+20, c+20 from t1;
@@ -17,7 +24,7 @@ key a
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where b="34" and c = "34";;
id 1
select_type SIMPLE
@@ -28,7 +35,7 @@ key b
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where c="34" and b="34";;
id 1
select_type SIMPLE
@@ -39,7 +46,7 @@ key b
key_len 9
ref const
rows 8
-Extra Using where; Full scan on NULL key
+Extra Using where
explain select * from t1 where c="34";;
id 1
select_type SIMPLE
diff --git a/mysql-test/main/long_unique_where_debug.test b/mysql-test/main/long_unique_where_debug.test
index bc8c97ee194..2ede34c1f6f 100644
--- a/mysql-test/main/long_unique_where_debug.test
+++ b/mysql-test/main/long_unique_where_debug.test
@@ -1,10 +1,11 @@
--source include/have_debug.inc
--echo #In this test case we will check what will happen in the case of hash collusion
-SET debug_dbug="d,same_long_unique_hash";
+SET debug_dbug="d,same_long_unique_hash,test_completely_invisible";
create table t1(a blob unique , b blob , c blob, unique(b,c));
insert into t1 values(1,1,1);
insert into t1 values(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1;
insert into t1 select a+5, b+5, c+5 from t1;
insert into t1 select a+10, b+10, c+10 from t1;
insert into t1 select a+20, b+20, c+20 from t1;
@@ -14,6 +15,12 @@ insert into t1 select a+40, b+40, c+40 from t1;
--query_vertical explain select * from t1 where c="34" and b="34";
--query_vertical explain select * from t1 where c="34";
--query_vertical explain select * from t1 where b="34";
+--query_vertical analyze select * from t1 where a="34";
+--query_vertical analyze select * from t1 where b="34" and c = "34";
+--query_vertical analyze select * from t1 where c="34" and b="34";
+--query_vertical analyze select * from t1 where c="34";
+--query_vertical analyze select * from t1 where b="34";
+--query_vertical explain extended select * from t1 where a="34";
select * from t1 where a="34";
select * from t1 where b="34" and c = "34";
select * from t1 where c="34" and b="34";
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 631333d1567..2496b5cf958 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6482,6 +6482,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
hash_item, hash_field, true);
eq_item->set_context_field(hash_field);
kf->cond= eq_item;
+ kf->cond_guard= NULL;
+ kf->sj_pred_no= UINT_MAX;
if (add_keyuse(keyuse, kf, key, 0))
return TRUE;
}