Skip to content

fix: preserve Postgre casts when converting named placeholders in prepared queries#9960

Open
michalsn wants to merge 3 commits intocodeigniter4:developfrom
michalsn:fix/prepared-query-prepare
Open

fix: preserve Postgre casts when converting named placeholders in prepared queries#9960
michalsn wants to merge 3 commits intocodeigniter4:developfrom
michalsn:fix/prepared-query-prepare

Conversation

@michalsn
Copy link
Member

Description
This PR fixes a bug where named placeholder conversion in BasePreparedQuery::prepare() was too broad and could interfere with SQL using colon syntax (i.e., PostgreSQL casts like ::timestamp).

The conversion now targets only valid named placeholders (:name / :name:) and leaves dialect syntax like ::type untouched.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer labels Feb 18, 2026
@michalsn michalsn force-pushed the fix/prepared-query-prepare branch from 4d042a5 to 2bbeece Compare February 18, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments