[MDEV-9357] Identical queries but LIMIT 100 returns 0 rows, LIMIT 99 returns what you would expect. Created: 2016-01-04  Updated: 2016-02-10  Resolved: 2016-02-10

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Marcus Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

Centos 6.7



 Description   

With the query attached (not a pretty query, but that doesn't matter) with limit set to 100 on 10.1.10 I am returned 0 rows, but if I change 100 to 99, it returns the rows I'd expect. This issue does not exist on MySQL 5.5.36 or 10.0.23.

Let me know if I can provide any more information.

SELECT `a`.*,`a`.`content` AS `date`,`lawyer`.`content` AS `lawyer`,`lawyer_name`.`title` AS `lawyer_name`,`locationName`.`content` AS `locationName`,`name`.`content` AS `name`,`email`.`content` AS `email`,`phone`.`content` AS `phone`,`best_contact_time`.`content` AS `best_contact_time`,`legal_issue`.`content` AS `legal_issue` FROM `contact` AS `a`LEFT JOIN `contact` AS `lawyer` ON (`lawyer`.`object` = `a`.`id` AND `lawyer`.`type` = "lawyer") LEFT JOIN `content` AS `lawyer_name` ON (`lawyer`.`content` = `lawyer_name`.`id` AND `lawyer_name`.`type` = "lawyer") LEFT JOIN `contact` AS `locationName` ON (`locationName`.`object` = `a`.`id` AND `locationName`.`type` = "locationName") LEFT JOIN `contact` AS `name` ON (`name`.`object` = `a`.`id` AND `name`.`type` = "name") LEFT JOIN `contact` AS `email` ON (`email`.`object` = `a`.`id` AND `email`.`type` = "email") LEFT JOIN `contact` AS `phone` ON (`phone`.`object` = `a`.`id` AND `phone`.`type` = "phone") LEFT JOIN `contact` AS `best_contact_time` ON (`best_contact_time`.`object` = `a`.`id` AND `best_contact_time`.`type` = "best_contact_time") LEFT JOIN `contact` AS `legal_issue` ON (`legal_issue`.`object` = `a`.`id` AND `legal_issue`.`type` = "legal_issue") WHERE `a`.`content` >= CONVERT_TZ("2016-01-01 00:00", "America/Vancouver", "UTC") AND `a`.`content` <= CONVERT_TZ("2016-01-04 23:59", "America/Vancouver", "UTC") AND `a`.`object` = "1712" AND `a`.`type` = "contact" ORDER BY `date` DESC LIMIT 100



 Comments   
Comment by Elena Stepanova [ 2016-01-10 ]

marcusds,

It would be very helpful if you were able to provide a data dump of the involved tables (I think there are two of them, `contact` and `content`). You can upload the dump file to ftp.askmonty.org/private, this way only MariaDB developers will have access to them.

If you cannot do that, please at least paste the output of

SHOW CREATE TABLE contact;
SHOW CREATE TABLE content;
SHOW INDEX IN contact;
SHOW INDEX IN content;

In either case, please also attach your my.cnf file(s) and run

EXPLAIN EXTENDED SELECT ... 
SHOW WARNINGS;

for both 'good' and 'bad' query, and paste the output of them.

Thank you.

Generated at Thu Feb 08 07:34:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.