Skip to content

T17004 phql params#17023

Merged
niden merged 10 commits into
5.0.xfrom
T17004-phql-params
May 15, 2026
Merged

T17004 phql params#17023
niden merged 10 commits into
5.0.xfrom
T17004-phql-params

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented May 15, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Fixed Phalcon\Db\Dialect::getSqlExpression() not propagating the outer bindCounts map into the recursive select() call rendered for nested sub-SELECTs, so an array placeholder ({name:array}) inside a sub-SELECT kept the parse-time times count baked into the cached PHQL intermediate; a second execution of the same outer PHQL with the same bind name but a different bind-array size fell back to the stale count and PDO raised "Invalid parameter number: number of bound variables does not match number of tokens" (workaround was Phalcon\Mvc\Model\Query::clean() between calls). The select branch now seeds the nested definition's bindCounts from the outer bindCounts on a local copy of the nested intermediate so the runtime placeholder-count override fires at every nesting level without mutating the cached intermediate

Thanks

@niden niden requested a review from Jeckerson May 15, 2026 11:53
@niden niden self-assigned this May 15, 2026
@niden niden added bug A bug report status: medium Medium 5.0 The issues we want to solve in the 5.0 release labels May 15, 2026
@niden niden merged commit 9b13a44 into 5.0.x May 15, 2026
192 checks passed
@niden niden deleted the T17004-phql-params branch May 15, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant