Bug #30927 no key is used when using stored function
Submitted: 10 Sep 2007 9:24 Modified: 10 Oct 2007 14:43
Reporter: Christian Trummer Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:5.0.45 OS:Windows (Prof)
Assigned to: CPU Architecture:Any
Tags: primary key, stored function, using where

[10 Sep 2007 9:24] Christian Trummer
Description:
when i make a select query using where primary key = stored function the primary index isn't used
but when i try select where primray key = CONST the primary index is used

i tried the same in version 5.0.41 and there all is working fine

How to repeat:
make a table with `id` as primary key

select * from table where id = 3 -> works fine
select * from table where id = myFunction() -> isn't using a index

myFunction is a stored function which returns a integer value

Suggested fix:
don't know
[10 Sep 2007 11:27] Christian Trummer
ok my information is not correct. i have no tried the same server version
at one machine everythings works fine with keys on the other net

when i try
select * from table -> doesn't work
select `id` from table -> works with keys

but on the first server the query 
select * from table also works with keys.. whats wrong?
[10 Sep 2007 14:43] Hartmut Holzgraefe
Can you add the CREATE statements for the table and function you are using and the EXPLAIN output for the different queries you've been trying?
[10 Oct 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".