1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00
Commit Graph

122308 Commits

Author SHA1 Message Date
Nikita Popov
c288b5294b Fix compile warnings in PDO Firebird 2020-12-14 10:36:36 +01:00
Nikita Popov
f2ddfcc7bb Fix MHANDLEFUNC signature
The last parameter is int, not short int.
2020-12-14 10:25:03 +01:00
Nikita Popov
47fe412518 Allow building dblib with machine-dependent libdir
Use the same approach as for GMP: If no explicit directory is
given, assume it must be on the default include path and libdir.
Otherwise use the provided path. It does not look like libsybdb
has support for pkg-config.
2020-12-14 10:25:03 +01:00
Nikita Popov
aa58db7232 Fix signed/unsigned warnings in PDO ODBC
Add add skipif to test.
2020-12-14 10:03:56 +01:00
Christoph M. Becker
2b7eb0e26a Disallow version_compare() $operator abbreviations
`version_compare()` does a sloppy check for the `$operators` argument
which allows arbitrary abbreviations of the supported operators to be
accepted.  This is both undocumented and unexpected, and could lead to
subtle BC breaks, if the order of the comparisions will be changed.
Therefore we change to strict comparisons.

Closes GH-6510.
2020-12-13 23:55:33 +01:00
Anatol Belski
269a8841ae hash: Fix signatures in the final callback defs
Signed-off-by: Anatol Belski <ab@php.net>
2020-12-13 21:17:46 +01:00
Jakub Zelenka
97d2dd0f90 Merge branch 'PHP-8.0' 2020-12-13 18:43:04 +00:00
Jakub Zelenka
d254078020 Merge branch 'PHP-7.4' into PHP-8.0 2020-12-13 18:42:11 +00:00
Jakub Zelenka
a221e17b41 Fix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME 2020-12-13 18:39:48 +00:00
Anatol Belski
ffcc93e3e5 UPGRADING.INTERNALS: Document hash init signature changes [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2020-12-13 16:52:01 +01:00
Anatol Belski
c6d3c68fb4 UPGRADING: Document algorithm specific hash options [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2020-12-13 16:46:32 +01:00
Anatol Belski
110b4e9094 hash: Support custom algo parameters
The concrete need on this change is to support passing an initial seed
to the murmur hash. Passing a custom seed is important in terms of
randomizing the hash function.

The suggested implementation adds a HashTable parameter to all the
init callbacks. Further on, an array with custom arguments is accepted
from `hash` or `hash_init` from the user land. Currently several things
like `hash_hkdf` are not touched, as they don't need passing custom
args.

Some convenience macros have been added to the SHA/MD families of
functions, so the consuming code doesn't have to be changed widely.

Another way to implement this is to add another type of the init that
would accept a HT with arguments. However, that would still require
touching all the context structs in all the algos. That would also
increase the size of those structs. As an init function is called just
once, the way of modifying the existing init callback has been seen
as more preferrable.

Closes GH-6400.

Signed-off-by: Anatol Belski <ab@php.net>
Co-Developed-by: Nikita Popov <nikita.ppv@googlemail.com>
Signed-off-by: Nikita Popov <nikita.ppv@googlemail.com>
Acked-by: Michael Wallner <mike@php.net>
Reviewed-by: Máté Kocsis <kocsismate@woohoolabs.com>
Reviewed-by: Eddie Kohler <ekohler@gmail.com>
2020-12-13 14:14:07 +01:00
Nikita Popov
70c22dec28 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove bug41347.phpt as the error cases are already tested
2020-12-11 16:47:54 +01:00
ekinhbayar
b0e858da8b Remove bug41347.phpt as the error cases are already tested
Closes GH-6506.
2020-12-11 16:47:40 +01:00
Nikita Popov
154f27a998 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #79132
2020-12-11 16:36:07 +01:00
Nikita Popov
ccb7f1c7d8 Fixed bug #79132
Following cmb's suggestion and replacing the counter with a check
against the bound_params HT, which ensures that both cannot go
out of sync.
2020-12-11 16:35:03 +01:00
Nikita Popov
d5f692296c Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Fix nextRowset() on libmysqlclient with native PS
  PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient
2020-12-11 14:49:58 +01:00
Nikita Popov
7a89157f8c PDO MySQL: Fix nextRowset() on libmysqlclient with native PS
The logic after next_result should match the one after execute.
This was the case for mysqlnd but not libmysqlclient, which used
the non-PS logic.
2020-12-11 14:48:44 +01:00
Nikita Popov
81f012a164 PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient 2020-12-11 14:48:43 +01:00
Nikita Popov
9b5f9084a4 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Unskip bug_41125.phpt
2020-12-11 14:12:35 +01:00
Nikita Popov
e4e88bd7e3 PDO MySQL: Unskip bug_41125.phpt
This test was always skipped (leftover debug statement?)

Contrary to the comments in the test and the test expectation,
this actually works fine.
2020-12-11 13:04:20 +01:00
Nikita Popov
d09d930e48 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #67004
2020-12-11 12:56:10 +01:00
Nikita Popov
ad8eb116d8 Fixed bug #67004
Repeated execute() with native PS failed to release the previous
result set on libmysqlclient.

Move freeing the result set into a common location.
2020-12-11 12:52:59 +01:00
Nikita Popov
96ec26ec71 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Use stmt_next_result with libmysqlclient as well
  PDO MySQL: Fix libmysql option test
2020-12-11 12:21:11 +01:00
Nikita Popov
d6b4b82a38 PDO MySQL: Use stmt_next_result with libmysqlclient as well
libmysqlclient added this function in version 5.5, which happens
to be the minimum we support. If we have a prepared statement,
we should use it on both mysqlnd and libmysqlclient, even if the
handling afterwards is different.

This fixes error handling with native prepared statements.
2020-12-11 12:20:04 +01:00
Nikita Popov
4e51059d52 PDO MySQL: Fix libmysql option test
The fact that getAttribute() fails for various libmysqlclient-only
options is a known issue, and the test was taking that into account.
However, the change of the default error mode broke the handling.
We need to handle the exceptions now.
2020-12-11 12:20:02 +01:00
Nikita Popov
09cc096357 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #62889
2020-12-11 11:25:56 +01:00
Nikita Popov
43741a3f26 Fixed bug #62889
Our minimum libmysqlclient version requirement is high enough
that we don't need to check for MYSQL_OPT_LOCAL_INFILE support.

However, the mysql_get_option() function seems to only be available
since 5.7 (though it's really hard to find any definitie information
on when MySQL introduced certain functions or changes...) so we
need to store the value of the flag locally to make it available
through getAttribute().
2020-12-11 11:25:36 +01:00
Nikita Popov
b4ff7d4e2b Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
2020-12-11 10:53:04 +01:00
Nikita Popov
c927c831e6 PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
stmt->column_count gets reset before the next_rowset handler is
invoked, so we need to fetch the value from the result set instead.

Arguably PDO should be separating the destruction of the previous
result set and the switch to the next result set more cleanly...
2020-12-11 10:51:14 +01:00
Nikita Popov
2d6330dd5e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test cases for MariaDB
2020-12-11 09:53:50 +01:00
Dharman
54a63d91b8 Fix test cases for MariaDB
And remove unnecessary try-catch.

Closes GH-6505.
2020-12-11 09:53:20 +01:00
Nikita Popov
1af2edd105 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #72368
2020-12-10 16:54:52 +01:00
Nikita Popov
9e3ba775b7 Fixed bug #72368
Generate a param count mismatch error even if the query contains
no placeholders.

Additionally we shouldn't HANDLE errors from pdo_parse_params,
which are always reported via raise_impl_error. Doing so results
in duplicate error messages.
2020-12-10 16:53:08 +01:00
Nikita Popov
d6c3b8baab Merge branch 'PHP-8.0'
* PHP-8.0:
  Allow drivers to omit error code
2020-12-10 16:04:48 +01:00
Nikita Popov
a5527577e7 Allow drivers to omit error code
And thus generate error messages that match what PDO emulation
would generate.

This fixes the error message regression from the previous commit.
2020-12-10 16:04:33 +01:00
Nikita Popov
786cb68221 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #79131
2020-12-10 15:53:30 +01:00
Nikita Popov
15b51a215a Fixed bug #79131
When a driver reports an error during EVT_ALLOC (and some over EVTs),
make sure we handle it as usual, i.e. warn or throw.

This requires some adjustments in PDO PgSQL to stop manually doing
this through an impl error.

Unfortunately the PDO PgSQL error messages regress because of this,
as they now include a completely arbitrary error code. There doesn't
seem to be an ability to skip it right now.
2020-12-10 15:53:23 +01:00
Dmitry Stogov
6ec7d4c406 Merge branch 'PHP-8.0'
* PHP-8.0:
  Eliminate some repeatable IS_REFERENCE checks
2020-12-10 14:46:03 +03:00
Dmitry Stogov
dde5572937 Eliminate some repeatable IS_REFERENCE checks 2020-12-10 14:45:54 +03:00
Nikita Popov
16e8c1af68 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #79872 by improving error message
2020-12-10 11:48:49 +01:00
Nikita Popov
288581fade Fixed bug #79872 by improving error message
The actual behavior here is correct, but the previous error
message was misleading, as neither fetchAll() nor buffered queries
would help in this situation. Instead it is necessary to consume
all rowsets, which can be done by either unsetting the statement
or calling closeCursor().
2020-12-10 11:46:29 +01:00
Nikita Popov
207fcb0523 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #76815
2020-12-10 11:24:27 +01:00
Nikita Popov
d63aedd173 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #76815
2020-12-10 11:24:19 +01:00
Nikita Popov
e450621f5e Fixed bug #76815
When we receive an error while reading a result set, we should
assume that no more result sets are available. libmysqlclient
implements the same behavior.
2020-12-10 11:23:41 +01:00
Nikita Popov
030845eb68 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #71145
2020-12-10 10:31:43 +01:00
Nikita Popov
9b678bc4d5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #71145
2020-12-10 10:31:36 +01:00
Nikita Popov
4922049213 Fixed bug #71145
Consume any additional result sets when running INIT_COMMAND.
2020-12-10 10:28:10 +01:00
twosee
a38aaf6cbd Merge branch 'PHP-8.0'
* PHP-8.0:
  EXTERN_C wrapping for GC buffer APIs
2020-12-10 17:16:08 +08:00
twosee
26c7b9402d EXTERN_C wrapping for GC buffer APIs
Closes GH-6502.
2020-12-10 17:15:19 +08:00