Range of sub-queries are not honored

Damien Tournoud - December 8, 2009 - 00:45
Project:Drupal
Version:7.x-dev
Component:database system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Range directives of sub-queries are not honored, because we add the LIMIT directive at query time, not when building the query.

This bug is blocking proper fix of #314349: PDO Exception when having too much comments.

#1

Damien Tournoud - December 8, 2009 - 00:47
Status:active» needs review

The good news is that all our supported database engines actually support the same syntax LIMIT $number OFFSET $offset. Let's simply use that. This patch does that, and adds an additional test for range on sub-queries.

AttachmentSizeStatusTest resultOperations
653926-range-on-subqueries.patch2.86 KBIdlePassed on all environments.View details

#2

chx - December 8, 2009 - 15:47
Status:needs review» reviewed & tested by the community

Well, OK but I would love to see then the normal range queries use this construct too -- in another isuse of course.

#3

Crell - December 8, 2009 - 17:52

Makes sense, especially since drivers that need to do it differently can just override that method if they need to build the string differently. (Oracle, MS SQL, etc.) Might we want to document that the LIMIT method is not standard SQL but happens to be the method supported by most OSS databases? Just for completeness? Should be a simple comment addition.

#4

Dries - December 9, 2009 - 17:33
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#5

Crell - December 9, 2009 - 18:49
Status:fixed» needs work

Re-opening to tweak the comment. (I should have set it CNW before, sorry.)

#6

Crell - December 10, 2009 - 05:49
Status:needs work» needs review

Comment tweaks as mentioned.

AttachmentSizeStatusTest resultOperations
range-comment.patch669 bytesIdlePassed on all environments.View details

#7

ceardach - December 13, 2009 - 16:20
Status:needs review» reviewed & tested by the community

The documentation in the patch is good and should be committed.

#8

webchick - December 13, 2009 - 18:06
Status:reviewed & tested by the community» fixed

Committed to HEAD. Thanks!

#9

System Message - December 27, 2009 - 18:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.