diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-06-10 10:14:20 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-06-10 10:14:20 +0200 |
commit | 10fedf675a1de161aec4ee09026db35400344507 (patch) | |
tree | c7487c3764bc9e7c96dd7b8cda101d197c4f3fc7 /mysql-test/t/distinct.test | |
parent | fdfeb4bea389f32fdc5fb493e3d003f9ed9d4713 (diff) | |
download | mariadb-git-10fedf675a1de161aec4ee09026db35400344507.tar.gz |
change test_if_equality_guarantees_uniqueness()
from an ad hoc set of limitations
to a correct rule
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r-- | mysql-test/t/distinct.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 89d3f85a38d..796732fa097 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -622,6 +622,25 @@ create table t1 (a varchar(100)); insert t1 values ('2010-10-10'), ('20101010'); select * from t1 where a = DATE('2010-10-10'); select distinct a from t1 where a = DATE('2010-10-10'); +explain select distinct a from t1 where a = DATE('2010-10-10'); +drop table t1; +# +# test_if_equality_guarantees_uniqueness() and different type combinations +# +--echo # date = string +create table t1 (a date); +insert t1 values ('2010-10-10'), ('20101010'); +explain select distinct a from t1 where a = '2010-10-10'; +drop table t1; +--echo # double = string +create table t1 (a double); +insert t1 values (2), (2); +explain select distinct a from t1 where a = '2'; +--echo # double = int +explain select distinct a from t1 where a = 2; +--echo # string = double +alter table t1 modify a varchar(100); +explain select distinct a from t1 where a = 2e0; drop table t1; # |