Skip to content

ext/pgsql: fix the wrong names in the pg_lo_write() and pg_lo_read() errors - #25409

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

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

Conversation

@lacatoire

Copy link
Copy Markdown
Member
  • 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:

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:

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

…errors

pg_lo_write() referred to a nonexistent $buf parameter; it is $data.
pg_lo_read() was the only check worded "greater or equal than".

@iliaal iliaal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The pg_lo_write() case is already covered by pg_lo_write_null_bytes.phpt; the pg_lo_read() check could move there instead of a new file.

@kocsismate kocsismate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved once Ilia's comment is addressed

@devnexen devnexen closed this in d68cd18 Nov 12, 2026
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.

4 participants