summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSachin <sachin.setiya@mariadb.com>2018-12-31 20:23:15 +0530
committerSachin <sachin.setiya@mariadb.com>2019-01-09 14:13:50 +0530
commite57a5c0e9d7938bd03fa369ac5b9bfa802bbf732 (patch)
tree7533b3ccf5187af0c5673f5a014a2bbec7b12c5e /mysql-test
parentacaf169f08e63231868dfa7be2d620461b73a84e (diff)
downloadmariadb-git-e57a5c0e9d7938bd03fa369ac5b9bfa802bbf732.tar.gz
add_key_part modified
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/xyz.test10
-rw-r--r--mysql-test/main/xyz_blob.result62
-rw-r--r--mysql-test/main/xyz_blob.test12
3 files changed, 84 insertions, 0 deletions
diff --git a/mysql-test/main/xyz.test b/mysql-test/main/xyz.test
new file mode 100644
index 00000000000..ef98394568f
--- /dev/null
+++ b/mysql-test/main/xyz.test
@@ -0,0 +1,10 @@
+create table t1(a int primary key , b int , c int, unique(b,c));
+insert into t1 values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+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;
+insert into t1 select a+40, b+40, c+40 from t1;
+ --query_vertical explain select * from t1 where a=34;
+ --query_vertical explain select * from t1 where b=34;
+ --query_vertical explain select * from t1 where c=34;
+drop table t1;
diff --git a/mysql-test/main/xyz_blob.result b/mysql-test/main/xyz_blob.result
new file mode 100644
index 00000000000..e4403b0e169
--- /dev/null
+++ b/mysql-test/main/xyz_blob.result
@@ -0,0 +1,62 @@
+create table t1(a blob unique , b blob , c blob, unique(b,c));
+insert into t1 values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+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;
+insert into t1 select a+40, b+40, c+40 from t1;
+explain select * from t1 where a="34";;
+id 1
+select_type SIMPLE
+table NULL
+type NULL
+possible_keys NULL
+key NULL
+key_len NULL
+ref NULL
+rows NULL
+Extra Impossible WHERE noticed after reading const tables
+explain select * from t1 where b="34" and c = "34";;
+id 1
+select_type SIMPLE
+table t1
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 80
+Extra Using where
+explain select * from t1 where c="34" and b="34";;
+id 1
+select_type SIMPLE
+table t1
+type ALL
+possible_keys b
+key NULL
+key_len NULL
+ref NULL
+rows 80
+Extra Using where
+explain select * from t1 where c="34";;
+id 1
+select_type SIMPLE
+table t1
+type ALL
+possible_keys NULL
+key NULL
+key_len NULL
+ref NULL
+rows 80
+Extra Using where
+explain select * from t1 where b="34";;
+id 1
+select_type SIMPLE
+table NULL
+type NULL
+possible_keys NULL
+key NULL
+key_len NULL
+ref NULL
+rows NULL
+Extra Impossible WHERE noticed after reading const tables
+drop table t1;
diff --git a/mysql-test/main/xyz_blob.test b/mysql-test/main/xyz_blob.test
new file mode 100644
index 00000000000..05c5f635ff3
--- /dev/null
+++ b/mysql-test/main/xyz_blob.test
@@ -0,0 +1,12 @@
+create table t1(a blob unique , b blob , c blob, unique(b,c));
+insert into t1 values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+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;
+insert into t1 select a+40, b+40, c+40 from t1;
+--query_vertical explain select * from t1 where a="34";
+--query_vertical explain select * from t1 where b="34" and c = "34";
+--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";
+drop table t1;