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.

Comments

damien tournoud’s picture

Status: Active » Needs review
StatusFileSize
new2.86 KB

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.

chx’s picture

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.

Crell’s picture

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.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Crell’s picture

Status: Fixed » Needs work

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

Crell’s picture

Status: Needs work » Needs review
StatusFileSize
new669 bytes

Comment tweaks as mentioned.

ceardach’s picture

Status: Needs review » Reviewed & tested by the community

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

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

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