mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away. During optimization stage the WHERE conditions can be changed or even be removed at all if they know for sure to be true of false. Thus they aren't showed in the EXPLAIN EXTENDED which prints conditions after optimization. Now if all elements of an Item_cond were removed this Item_cond is substituted for an Item_int with the int value of the Item_cond. If there were conditions that were totally optimized away then values of the saved cond_value and having_value will be printed instead.
This commit is contained in:
@@ -51,4 +51,18 @@ set names latin1;
|
||||
select 3 into @v1;
|
||||
explain select 3 into @v1;
|
||||
|
||||
#
|
||||
# Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were
|
||||
# optimized away.
|
||||
#
|
||||
create table t1(f1 int, f2 int);
|
||||
insert into t1 values (1,1);
|
||||
create view v1 as select * from t1 where f1=1;
|
||||
explain extended select * from v1 where f2=1;
|
||||
explain extended select * from t1 where 0;
|
||||
explain extended select * from t1 where 1;
|
||||
explain extended select * from t1 having 0;
|
||||
explain extended select * from t1 having 1;
|
||||
drop table t1;
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
||||
Reference in New Issue
Block a user