MySQL Forums
Forum List  »  Optimizer & Parser

Re: optimizer seems to skip stored function call in where clause?
Posted by: John LeSueur
Date: January 08, 2020 11:21AM

Here is the simplest reproduce script we have found, and this still exists as of 8.0.18.

drop table if exists t1;
create table t1 (id int PRIMARY KEY);
insert into t1 VALUES(1234);
drop function if exists returnzero;
create function returnzero() returns int(11)
begin
return 0;
end;
select 1 from t1 where t1.id = '1234' and 1=returnzero();
select 1 from t1 where t1.id = 1234 and 1=returnzero();

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: optimizer seems to skip stored function call in where clause?
83
January 08, 2020 11:21AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.