Bug #64592 Select integer query with limit returns 0 results w/ 2 conds but not w/ 3
Submitted: 8 Mar 2012 12:42 Modified: 9 Mar 2012 8:56
Reporter: Kevan Essmyer Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:5.1.52 OS:Linux (Scientific Linux 6.1)
Assigned to: CPU Architecture:Any
Tags: inconsistent, INTEGER, query, ResultSet, SELECT

[8 Mar 2012 12:42] Kevan Essmyer
Description:
The following query returns a resultset with 1 and 3 conditions but not with only 2 conditions from an innodb table.  Workbench will retrieve a result with a 1 in the column header but with a 0 results message.

Select 1 from x_data where project=1 and event=1 and rec="20" LIMIT 1;

The correct result set is returned for all conditions if the select is changed to a wildcard, or a non PK field.

Inconsistent performance endangers legacy queries reliability.

How to repeat:
Select 1 from x_data where project=1 and event=1 and rec="20" LIMIT 1;
with conditions set on PK fields.
[8 Mar 2012 14:49] Valeriy Kravchuk
Please, check if this problem still happens with a newer version, 5.1.61. If it does, please, send a dump of the table that demonstrates the problem.
[8 Mar 2012 18:23] Kevan Essmyer
Queries run on upgraded test servers (5.1.61) are working correctly.

Thanks for your assistance.
[9 Mar 2012 8:56] Valeriy Kravchuk
Not repeatable with 5.1.61.