Re: problem with memory table used twice in select
Hello,
I think there is a bug in MySQL 5.0.27
When I tried to select data from
MEMORY table defined with few indexes, by select * from table where
indexcolumn1 = 'something' or indexcolumn2 = 'something2' or
indexcolumn3 = 'something3' the result will have doubled rows .. rows are physicaly unique in the table..
machine AMD64 3200, 1,5GB RAM, Freebsd 5.5 (9.12.2006) mysql 5.0.27
amd64
To reproduce:
create table:
CREATE TABLE `sklo` (
`uid` int(11) NOT NULL default '0',
`nick` char(12) NOT NULL default '0',
`uidKomu` int(11) NOT NULL default '0',
`komu` char(12) NOT NULL default '0',
`text` char(255) NOT NULL default '0',
`time` int(11) NOT NULL default '0',
`tajne` tinyint(4) default '0',
`miestnost` int(11) NOT NULL default '1',
`visible` tinyint(4) NOT NULL default '0',
KEY `time` (`time`),
KEY `uid` (`uid`),
KEY `uidKomu` (`uidKomu`),
KEY `miestnost` (`miestnost`)
) ENGINE=MEMOTY DEFAULT CHARSET=cp1250;
try put some data in it.. try to put some row with identical value in text field..
then run a select to some existing data.. like this:
SELECT *
FROM sklo
WHERE (
(
uid = '2'
OR uidKomu = '2'
)
AND visible = '1'
)
OR uid = '2'
OR (
miestnost = '1227479158'
AND tajne =0
AND visible = '1'
)
ORDER BY time DESC
LIMIT 30
there will be doubled rows in the result..
I tried this with the same table on MyISAM engine and the result was not doubled..
Best regards, Andrej Potocky