diff options
Diffstat (limited to 'mysql-test/t/analyse.test')
-rw-r--r-- | mysql-test/t/analyse.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 6aca345b282..47f3473584b 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -15,3 +15,26 @@ select * from t2; drop table t1,t2; EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); + +# +# Test with impossible where +# +create table t1 (a int not null); +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +select * from t1 where 0=1 procedure analyse(); +insert into t1 values(1); +drop table t2; +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +select * from t2; +insert into t2 select * from t1 procedure analyse(); +select * from t2; +insert into t1 values(2); +drop table t2; +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +select * from t2; +insert into t2 select * from t1 procedure analyse(); +select * from t2; +drop table t1,t2; |