Skip to content

ext/pgsql: fix wrong names and values in three diagnostics - #24217

Open
lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/pgsql-error-message-text
Open

lacatoire wants to merge 2 commits into
php:masterfrom
lacatoire:fix/pgsql-error-message-text

Conversation

@lacatoire

@lacatoire lacatoire commented Oct 9, 2026 •

Copy link
Copy Markdown
Member
  • The "Unable to jump to row" warning of pg_fetch_result(), pg_fetch_row()/assoc()/array()/object(), pg_field_prtlen() and pg_field_is_null() printed Z_LVAL_P() of a PgSql\Result object as a "result index". the object address. The operand is dropped.
  • pg_lo_write() referred to a nonexistent $buf parameter; it is $data.
  • pg_lo_read() is the only check worded "greater or equal than"; use "greater than or equal to" like the rest of the file.

Before:

Warning: pg_fetch_row(): Unable to jump to row 99 on PostgreSQL result index 133586556570360 in ...
pg_lo_write(): Argument #3 ($length) must be less than or equal to the length of argument #2 ($buf)
pg_lo_read(): Argument #2 ($length) must be greater or equal than 0

After:

Warning: pg_fetch_row(): Unable to jump to row 99 in ...
pg_lo_write(): Argument #3 ($length) must be less than or equal to the length of argument #2 ($data)
pg_lo_read(): Argument #2 ($length) must be greater than or equal to 0

The out of range row warnings appended Z_LVAL_P() of a PgSql\Result
object zval as a "result index", which is an address; pg_lo_write()
pointed at a $buf parameter it does not have; and pg_lo_read() was the
only place in the file wording the bound as "greater or equal than".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant