1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Commit Graph

338 Commits

Author SHA1 Message Date
Gina Peter Banyard
3afac4c7f1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix include paths for new pgsql tests
2025-11-04 04:42:53 +00:00
Gina Peter Banyard
14ed75e560 Fix include paths for new pgsql tests 2025-11-04 04:42:42 +00:00
Gina Peter Banyard
7c6affd617 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update NEWS for recent pgsql bugfix
  ext/pgsql: Fix segfaults when attempting to fetch row into a non-instantiable class name (#20180)
2025-11-04 00:09:44 +00:00
Gina Peter Banyard
afca514c3b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Update NEWS for recent pgsql bugfix
  ext/pgsql: Fix segfaults when attempting to fetch row into a non-instantiable class name (#20180)
2025-11-04 00:08:42 +00:00
Gina Peter Banyard
94dc6ae871 ext/pgsql: Fix segfaults when attempting to fetch row into a non-instantiable class name (#20180)
Also fix Windows CI with Postgres and CLEAN sections

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2025-11-04 00:04:30 +00:00
Jakub Zelenka
545d1536d8 Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-07-01 09:34:49 -07:00
Ilija Tovilo
49d94cced0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GHSA-453j-q27h-5p8x
  Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
  Fix GHSA-3cr5-j632-f35r: Null byte in hostnames
2025-07-01 17:48:00 +02:00
Jakub Zelenka
66bd809ac9 Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-07-01 23:01:16 +09:00
David Carlier
334d9bbc09 ext/pgsql: adding pg_service() alongside other connection infos.
returns the ongoing name of the service, if there is.
available since postgres 18

close GH-18198
2025-03-30 21:45:16 +01:00
David Carlier
50bffd3284 Merge branch 'PHP-8.4' 2025-03-26 17:46:38 +00:00
David Carlier
9c6fe6b0ff Fix GH-18148: pg_copy_from() wrong \n offset check.
Close GH-18149
2025-03-26 17:44:01 +00:00
David Carlier
f82f602ec8 ext/pgsql: few internal changes.
Z_PARAM_STR*/Z_PARAM_PATH. lo_write checks any null byte.

close GH-17587
2025-01-26 19:15:36 +00:00
David Carlier
fa8c6a552d Merge branch 'PHP-8.4' 2024-12-15 16:05:20 +00:00
David Carlier
171cc5c6e0 fix pgsql config inclusion 2024-12-15 16:05:10 +00:00
David Carlier
36d5a0fdcd Merge branch 'PHP-8.4' 2024-12-15 15:22:47 +00:00
David Carlier
1bb4bd657f fix new pgsql test 2024-12-15 15:22:35 +00:00
David Carlier
9ba2667cf5 Merge branch 'PHP-8.4' 2024-12-15 14:56:29 +00:00
David Carlier
2309cac755 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-15 14:55:36 +00:00
David Carlier
0a3442fbe6 ext/pgsql fixing further calls with flexible arguments number.
continuation of GH-17161

close GH-17165
2024-12-15 14:50:59 +00:00
Niels Dossche
57e9429e73 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
2024-12-14 19:49:12 +01:00
Niels Dossche
e562b8cf8e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
2024-12-14 19:49:04 +01:00
Niels Dossche
388f63c310 Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
Closes GH-17161.
2024-12-14 19:48:40 +01:00
Niels Dossche
21df4a97a3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport GH-14962 to stable versions
2024-11-26 21:25:05 +01:00
Michael Orlitzky
ae84b81bfa Backport GH-14962 to stable versions
Alpine CI regularly fails because of the sorting order of these tests.
See https://github.com/php/php-src/pull/14962#issuecomment-2498799881

Closes GH-16950.
2024-11-26 21:24:48 +01:00
David Carlier
e609a21906 ext/pgsql: pgsql_copy_from to support iterable.
inspired from the Pdo\Pgsql new feature GH-15893.

close GH-16124
2024-10-01 19:53:20 +01:00
David Carlier
1da352c367 ext/pgsql: adding pg_close_stmt.
up to postgresql 17, when done with a prepared statement, we could
release it with DEALLOCATE sql command which is fine ; until we want
to implement a cache solution based on statement ids.

Since PostgreSQL 17, PQclosePrepared uses internally the `close` protocol
allowing to reuse the statement name while still freeing it.
Since the close protocol implementation had been added on libpq within
this release, no way to reimplement it.

close GH-14584
2024-09-29 16:26:35 +01:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Michael Orlitzky
44b0baf705 ext/dba/tests: sort expected test output (#14962)
* ext/dba/tests/setup/setup_dba_tests.inc: sort test output

Iterating through a database with firstkey() and nextkey() is
guaranteed to retrieve all rows, but apparently not in any particular
order. This is causing a test failure for at least one user, so we
steal the sort() approach from GDBM to ensure that the output is
predictable.

* ext/dba/tests/dba_*.phpt: sort expected test output

The actual output is now sorted for consistency, so we need to update
the expected output as well. As a nice side effect, some differences
in the expected outputs for the various engines have been eliminated.

Closes GH-14786

* ext/pgsql/tests/80_bug14383.phpt: sort expected test output

This test uses a routine from ext/dba that now sorts its (actual)
output, so we have to sort the expected output here as well.

* ext/dba/tests/setup/setup_dba_tests.inc: update comment

After doing some more digging, it looks like GDBM isn't the only
engine where the iteration order with firstkey() and nextkey()
might change unexpectedly.
2024-07-26 01:16:52 +01:00
Tim Düsterhus
29f98e7485 Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Peter Kokot
4f450b6264 Bump minimum libpq version to 10.0 (#14628)
This bumps the libpq client-side PostgreSQL library minimum required
version from 9.1 to 10.0.

- Sanity check: PQlibVersion -> PQencryptPasswordConn (available since
  libpq 10.0)
- PQsetErrorContextVisibility (available since libpq 9.6)
- lo_truncate64 (available since libpq 9.3), if 32-bit system doesn't
  support lo_*64 functions, error is returned and functions are always
  available

Additionally, the conditional functions usages in pdo_pgsql and pgsql
extensions that got piled up are cleaned and synced:

- pg_prepare (PQprepare available since libpq 7.4)
- pg_query_params (PQexecParams available since libpq 7.4)
- pg_result_error_field (PQresultErrorField available since libpq 7.4)
- pg_send_prepare (PQsendPrepare available since libpq 7.4)
- pg_send_query_params (PQsendQueryParams available since libpq 7.4)
- pg_set_error_verbosity (PQsetErrorVerbosity available since libpq 7.4)
- pg_transaction_status (PQtransactionStatus available since libpq 7.4)

The Windows libpq version is currently at version 11.4:
https://github.com/winlibs/postgresql

Discussion: https://news-web.php.net/php.internals/123609
Follow-up of GH-14540
2024-06-25 20:50:04 +02:00
David Carlier
564914ac1a ext/pgsql: adding postgresql 17 new libpq wrapper call.
pg_set_chunked_rows_size to allow to fetch results in chunk of max N rows.

close GH-14571
2024-06-15 19:56:15 +01:00
David Carlier
2bb8fbd0a8 ext/pgsql: add pg_jit server info.
since PostgreSQL 11, LLVM JIT feature had been brought thus reporting
the settings to the client connection.

Close GH-14566
2024-06-14 16:27:00 +01:00
David Carlier
e69bccd7c7 ext/pgsql: adding pg_socket_poll.
Using PQSocketPoll to poll on a connection's socket.
Returns immediatly is there no event expected on read and write.
Other than that, it is a thin wrapper on top of poll, thus reflecting
 its return value.

close GH-14366
2024-05-31 20:10:49 +01:00
David Carlier
162a311cc8 ext/pgsql: adding pg_put_copy_data/pg_put_copy_end.
pg_put_copy_data allows to send COPY commands to the server.
pg_put_copy_end signals the end of the n commands.

Both return 3 states ; 1, 0 and -1 when 1 is success, 0 the buffer queue
is full then -1 for errors.

Close GH-14325
2024-05-28 18:35:40 +01:00
David Carlier
9aa3a0d702 ext/pgsql: adding pg_change_password functionality.
handy call to change an user password while taking care transparently
of the password's encryption.

close GH-14262
2024-05-20 12:57:37 +01:00
武田 憲太郎
77fa4c0fce ext/pgsql: add pg_result_memory_size
Close GH-14214
2024-05-13 22:58:02 +01:00
David Carlier
243827b83f Fix GH-13519: another attempt after the faulty fix.
Close GH-14055
2024-04-27 12:15:59 +01:00
Jakub Zelenka
ba401cf8d9 Remove lefted out test from the revert for GH-13519 2024-02-27 23:27:47 +00:00
Jakub Zelenka
0306983fa4 Merge branch 'PHP-8.2' into PHP-8.3 2024-02-27 23:03:52 +00:00
Jakub Zelenka
330b26e04c Revert "Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent connections."
This reverts commit b9a9790be0.
2024-02-27 23:03:28 +00:00
David Carlier
868f1a305e ext/pgsql fix new test 2024-02-27 01:07:10 +00:00
David Carlier
c0ba573c4f Merge branch 'PHP-8.3' 2024-02-27 00:31:54 +00:00
David Carlier
12f52365a5 Merge branch 'PHP-8.2' into PHP-8.3 2024-02-27 00:31:05 +00:00
David Carlier
b9a9790be0 Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent connections.
persistent connections did not take in account this flag, after the
usual link sanity checks, we remove its entry.

Close GH-13519
2024-02-27 00:30:48 +00:00
David Carlier
c5fbcfa7be GH-13355 fix new pgsql test 2024-02-08 22:44:03 +00:00
David Carlier
aa2e921ef7 Merge branch 'PHP-8.3' 2024-02-08 22:42:55 +00:00
David Carlier
a9c01b92b2 Merge branch 'PHP-8.2' into PHP-8.3 2024-02-08 22:42:19 +00:00
George Barbarosie
452e008f4f Fix GH-13354: ext/pgsql: pg_execute, pg_send_query_params and_send_execute null value by reference.
For these, when passing null values by refence, queries return erroneous values unlike
pg_query_params behaving as expected.

close GH-13355.
2024-02-08 22:42:04 +00:00
Máté Kocsis
beaf1e814a Deprecate calling pg_fetch_result(), pg_field_prtlen(), and pg_field_is_null() with 2 arguments 2023-12-04 22:27:59 +01:00
Dmitry Stogov
e2e433a514 Fix test 2023-11-28 02:00:47 +03:00