Commit Graph

13 Commits

Author SHA1 Message Date
Nikita Popov
a7e84e2e02 Fix default value for some pgsql functions
These set the PGSQL_DML_EXEC flag by default.
2020-10-13 17:29:05 +02:00
Nikita Popov
7b0f5f424d Don't accept null in pg_unescape_bytea()
This is an error that slipped in via 8d37c37bcd.
pg_unescape_bytea() did not accept null in PHP 7.4, and it is not
meaningful for it to accept null now -- it will always fail, and now
with a misleading OOM message.
2020-10-13 15:37:13 +02:00
Nikita Popov
3171fec6da Update ext/pgsql parameter names
Closes GH-6294.
2020-10-13 12:30:44 +02:00
Nikita Popov
8ff2f2f84b Return empty array for no rows in pg_fetch_all()
This makes it line up with pg_fetch_all_columns(), as well as
similar functions in other exts, such as mysqli_fetch_all().
2020-09-21 17:22:02 +02:00
Nikita Popov
54f03d31e0 Promote invalid field to ValueError in pgsql
The same error condition is a ValueError in mysqli, be consistent.

Additionally, do not display the argument name for these errors.
As the signatures are overloaded, the argument name may not match
the meaning at all.
2020-09-21 17:00:23 +02:00
Nikita Popov
d1bbc39e4c pg_unescape_bytea() can only fail on OOM
The implementation did not check for PQunescapeBytea failure
correctly, because it checked for a null pointer after estrndup,
which certainly cannot happen. Inspection of the PGunescapeBytea
implementation has shown that this function can only fail on OOM,
so let's check for that explicitly and remove false as a possible
return type.

While we're here, avoid an unnecessary copy of the result.
2020-09-21 15:46:55 +02:00
Nikita Popov
7300f6fc17 Deprecate pgsql function aliases
These have been documentation-deprecated for a very long time,
make it official.
2020-09-21 11:33:05 +02:00
Máté Kocsis
8d37c37bcd
Fix a few UNKNOWN default values in ext/pgsql
Closes GH-6149
2020-09-17 11:00:59 +02:00
George Peter Banyard
d0111d785d Promote warnings to Errors in PostgreSQL extension
Do some drive by indentation fixes
Also fix pg_select() in regards to the $result_type arg which was missing from ZPP

Closes GH-6129
2020-09-14 17:01:35 +02:00
Nikita Popov
f29bfc0bd8 Use string|int union types in pgsql
For "field name or field offset" parameters.

Also make $ctor_params an ?array parameter.
2020-09-11 17:33:09 +02:00
Nikita Popov
68b21939ec Use proper int type for parameter 2020-09-09 17:18:58 +02:00
Nikita Popov
6145cac1af Fix default value 2020-09-09 17:14:14 +02:00
Nikita Popov
47688ab6d9 Add stub for pgsql extension 2020-09-09 16:47:10 +02:00