From e57a5c0e9d7938bd03fa369ac5b9bfa802bbf732 Mon Sep 17 00:00:00 2001 From: Sachin Date: Mon, 31 Dec 2018 20:23:15 +0530 Subject: add_key_part modified --- mysql-test/main/xyz.test | 10 +++++++ mysql-test/main/xyz_blob.result | 62 +++++++++++++++++++++++++++++++++++++++++ mysql-test/main/xyz_blob.test | 12 ++++++++ 3 files changed, 84 insertions(+) create mode 100644 mysql-test/main/xyz.test create mode 100644 mysql-test/main/xyz_blob.result create mode 100644 mysql-test/main/xyz_blob.test (limited to 'mysql-test') 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; -- cgit v1.2.1