Inside the core file install.pgsql.inc there are 3 calls to a pg_result_error function without any arguments. However, according to official PHP documentation there must be always a required argument $result.

I've spent hard time searching the web for the explanation of an argless usage of aforementioned function, but the only sensible result all over the Net seems to be in this install.pgsql.inc file alone.

Could anyone, please, explain the semantics of calling pg_result_error function without a (supposedly) required argument? Is this an undocumented feature of PHP's pgsql support? What is the purpose in ommiting always available $result variable from a preceding statement in some function calls, while still passing it in other cases?

Thanks in advance!

Comments

damien tournoud’s picture

Category: support » bug
Priority: Minor » Normal

Looks like a bug. I can confirm from the PHP source code that the form without an argument doesn't exists. Sadly, this function is poorly designed and fails silently when called with no arguments.

Care to submit a patch to fix this glaring hole?

esteewhy’s picture

Thank You, Damien, I was struggling to understand what's going on there, now it gets clearer.

dddave’s picture

Status: Active » Needs review
thedavidmeister’s picture

Status: Needs review » Needs work

patch in #2 no longer applies:

error: install.pgsql.inc Locally Modified (Based On 1.6): No such file or directory

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.