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
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.#2
Well, OK but I would love to see then the normal range queries use this construct too -- in another isuse of course.
#3
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
Committed to CVS HEAD. Thanks!
#5
Re-opening to tweak the comment. (I should have set it CNW before, sorry.)
#6
Comment tweaks as mentioned.
#7
The documentation in the patch is good and should be committed.
#8
Committed to HEAD. Thanks!
#9
Automatically closed -- issue fixed for 2 weeks with no activity.