[debian-mysql] Bug#439021: Bug#439021: mysql-server-5.0: 0+string not cast as integer when comparing with indexed enum

Christian Hammers ch at lathspell.de
Wed Aug 22 08:53:43 UTC 2007


Hello

On Tue, 21 Aug 2007 13:38:55 -0400
Frédéric Brière <fbriere at fbriere.net> wrote:

> Package: mysql-server-5.0
> Version: 5.0.45-1
> Severity: normal
> 
>   CREATE TABLE foo (
>   	flavor ENUM('vanilla', 'chocolate') NOT NULL,
> 	number INT UNSIGNED NOT NULL,
> 	INDEX (flavor, number)
>   );
> 
>   EXPLAIN SELECT * FROM foo WHERE flavor = CAST('1' AS UNSIGNED)\G
>   [...]
>   	key: flavor
> 	ref: const
> 
>   EXPLAIN SELECT * FROM foo WHERE flavor = 0+'1'\G
>   [...]
>   	key: flavor
> 	ref: NULL
> 
> 
> Shouldn't 0+'1' be cast as a constant int, thus matching the index? 

Hm, don't know :-)

If you want a quick answer, try filing a bug report on bugs.mysql.com
as this is not Debian specific and you would else have to wait for me
to find free time to do exactly the same.
Please write the MySQL bug number into the Debian bug report if you do so.

bye,

-christian-




More information about the pkg-mysql-maint mailing list