]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 18 Dec 2020 10:02:36 +0000 (11:02 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  PDO MySQL: Handle boolean parameter binding with libmysql

4 years agoPDO MySQL: Handle boolean parameter binding with libmysql
Nikita Popov [Fri, 18 Sep 2020 15:46:42 +0000 (17:46 +0200)]
PDO MySQL: Handle boolean parameter binding with libmysql

Previously boolean parameters were simply silently ignored...

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 18 Dec 2020 09:20:55 +0000 (10:20 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  MySQLnd: Support cursors in store/get result

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Fri, 18 Dec 2020 09:20:13 +0000 (10:20 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  MySQLnd: Support cursors in store/get result

4 years agoMySQLnd: Support cursors in store/get result
Nikita Popov [Wed, 16 Dec 2020 11:12:06 +0000 (12:12 +0100)]
MySQLnd: Support cursors in store/get result

This fixes two related issues:

1. When a PS with cursor is used in store_result/get_result,
   perform a COM_FETCH with maximum number of rows rather than
   silently switching to an unbuffered result set (in the case of
   store_result) or erroring (in the case of get_result).
   In the future, we might want to make get_result unbuffered for
   PS with cursors, as using cursors with buffered result sets
   doesn't really make sense. Unlike store_result, get_result
   isn't very explicit about what kind of result set is desired.
2. If the client did not request a cursor, but the server reports
   that a cursor exists, ignore this and treat the PS as if it
   has no cursor (i.e. to not use COM_FETCH). It appears to be a
   server side bug that a cursor used inside an SP will be reported
   to the client, even though the client cannot use the cursor.

Fixes bug #64638, bug #72862, bug #77935.

Closes GH-6518.

4 years agoPDO MySQL: Use correct type when setting INT_AND_FLOAT_NATIVE
Nikita Popov [Thu, 17 Dec 2020 17:49:44 +0000 (18:49 +0100)]
PDO MySQL: Use correct type when setting INT_AND_FLOAT_NATIVE

mysqlnd expects this to be an unsigned int, not a bool.

4 years agoSkip invalid file descriptor test on Mac
Levi Morrison [Thu, 17 Dec 2020 16:10:35 +0000 (09:10 -0700)]
Skip invalid file descriptor test on Mac

4 years agoMySQLnd: Remove mnd_malloc/free etc.
Nikita Popov [Thu, 17 Dec 2020 16:01:09 +0000 (17:01 +0100)]
MySQLnd: Remove mnd_malloc/free etc.

There were only two uses of non-zmm allocation functions left,
which really did not need to use the system allocator. Remove
them, and remove the system allocator based APIs.

4 years agoMySQLnd: Fix potential leak when reading cursor
Nikita Popov [Thu, 17 Dec 2020 15:13:36 +0000 (16:13 +0100)]
MySQLnd: Fix potential leak when reading cursor

Perform the same checkpointing twe do in other row reading
functions.

4 years agoMySQLnd: Avoid some reallocations in PS decoder
Nikita Popov [Thu, 17 Dec 2020 13:41:47 +0000 (14:41 +0100)]
MySQLnd: Avoid some reallocations in PS decoder

4 years agoFix typo 'pices' in strings/join_basic.phpt
hgsgtk [Thu, 17 Dec 2020 04:24:32 +0000 (13:24 +0900)]
Fix typo 'pices' in strings/join_basic.phpt

Closes GH-6519.

4 years agoPDO MySQL: Use native types for results
Nikita Popov [Tue, 15 Dec 2020 16:07:27 +0000 (17:07 +0100)]
PDO MySQL: Use native types for results

Previously, PDO MySQL only fetched data as native int/float if
native prepared statements were used. This patch updates PDO to
have the same behavior for emulated prepared statements, and thus
removes the largest remaining discrepancy between these two modes.

Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control
whether native types are desired or not. The previous output can
be restored by enabling this option.

Most of the tests make use of that option, because this allows the
tests to work under libmysqlclient as well, which currently always
returns string results (independently of whether native or emulated
PS are used).

4 years agoMySQLnd: Clean up and optimize mysqlnd result set handling
Nikita Popov [Mon, 14 Dec 2020 14:05:23 +0000 (15:05 +0100)]
MySQLnd: Clean up and optimize mysqlnd result set handling

This is a larger overhaul of the mysqlnd result set infrastructure:

 * Drop support for two different types of buffered results sets
   ("c" and "zval"). Possibly these made sense at some earlier
   time, but now (with minor adjustments) one option is strictly
   worse than the other. Buffered result sets already buffer the
   full row packets, from which zvals can be decoded. The "zval"
   style additionally also buffered the decoded zvals. As result
   sets, even buffered ones, are generally only traversed once,
   this just ends up wasting memory. Now, a potentially useful
   variation here would be to buffer the decoded zvals instead of
   the row packets, but that's not what the code was doing.
 * To make it really strictly better, pre-allocate the zval row
   buffer and reuse it for all rows. Previously the "c" style always
   allocated a new buffer for each row.
 * The fetch_row API now provides a populated zval[]. The task of
   populating an array is deferred to fetch_row_into, which also
   avoids duplicating this code in multiple places. The fetch_row_c
   API is also implemented on top of fetch_row now, rather than
   duplicating large parts of the code.
 * The row fetching code for prepared statements and normal result
   sets has been mostly merged. These already used the same
   infrastructure, but prepared statements used separate row
   fetching functions that were nearly the same as the normal ones.
   This requires passing the stmt into the result set, rather than
   just a flag. The only part that remains separate is reading of
   unbuffered results in the presence of PS cursors.

4 years agoDrop support for max_length in mysqli_fetch_fields()
Nikita Popov [Mon, 14 Dec 2020 14:41:56 +0000 (15:41 +0100)]
Drop support for max_length in mysqli_fetch_fields()

Retain the field, but always populate it with zero. This was
already the case for PS without length updating.

max_length has nothing lost in the field metadata -- it is a
property of the specific result set, and requires scanning the
whole result set to compute. PHP itself never uses max_length
with mysqlnd, it is only exposed in the raw mysqli API.

Keeping it for just that purpose is not worthwhile given the costs
involved. People who actually need this for some reason can easily
calculate it themselves, while making it obvious that the
calculation requires a full result set scan.

4 years agoFix ubsan error on Mac
Levi Morrison [Thu, 17 Dec 2020 04:24:31 +0000 (21:24 -0700)]
Fix ubsan error on Mac

Fixes this error:
> Zend/zend_alloc.c:473:73: runtime error: left shift of 250 by 24 places cannot be represented in type 'int'

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 16 Dec 2020 19:06:01 +0000 (20:06 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80521: Parameters with underscores no longer recognized

4 years agoFix #80521: Parameters with underscores no longer recognized
Christoph M. Becker [Wed, 16 Dec 2020 19:02:45 +0000 (20:02 +0100)]
Fix #80521: Parameters with underscores no longer recognized

We have to use the proper value for the bitmask.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 16 Dec 2020 16:02:20 +0000 (17:02 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Detect overlarge step for character range()

4 years agoDetect overlarge step for character range()
Nikita Popov [Wed, 16 Dec 2020 16:01:15 +0000 (17:01 +0100)]
Detect overlarge step for character range()

This was done for int and float ranges, but not char ranges.

Fixes oss-fuzz #28666.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 16 Dec 2020 14:18:43 +0000 (15:18 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  PDO MySQL: Use mysqlnd column names

4 years agoPDO MySQL: Use mysqlnd column names
Nikita Popov [Wed, 16 Dec 2020 14:17:13 +0000 (15:17 +0100)]
PDO MySQL: Use mysqlnd column names

mysqlnd already creates interned zend_strings for us, so let's
make use of them.

This also required updating the PDO case changing code to work
with potentially shared strings. For the lowercasing, use the
optimized zend_string_tolower() implementation.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 16 Dec 2020 09:54:36 +0000 (10:54 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #67983

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 16 Dec 2020 09:53:48 +0000 (10:53 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #67983

4 years agoFixed bug #67983
Nikita Popov [Wed, 16 Dec 2020 09:52:27 +0000 (10:52 +0100)]
Fixed bug #67983

We need to check the BIT case first, otherwise it will get skipped
in INT_AND_FLOAT_NATIVE mode.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 16 Dec 2020 09:20:57 +0000 (10:20 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix bug #80523

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 16 Dec 2020 09:20:35 +0000 (10:20 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix bug #80523

4 years agoFix bug #80523
Nikita Popov [Wed, 16 Dec 2020 09:16:50 +0000 (10:16 +0100)]
Fix bug #80523

Don't truncate the file length to unsigned int...

I have no idea whether that fully fixes the problem because the
process gets OOM killed before finishing, but at least the
immediate parse error is gone now.

4 years agoFix ATTR_ORACLE_NULLS with PARAM_ZVAL
Nikita Popov [Tue, 15 Dec 2020 16:11:51 +0000 (17:11 +0100)]
Fix ATTR_ORACLE_NULLS with PARAM_ZVAL

PARAM_ZVAL with a STR result should be treated the same way as
PARAM_STR in this regard.

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Tue, 15 Dec 2020 14:13:55 +0000 (14:13 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Tue, 15 Dec 2020 14:13:43 +0000 (14:13 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoPrepare for 7.4.15
Derick Rethans [Tue, 15 Dec 2020 14:13:29 +0000 (14:13 +0000)]
Prepare for 7.4.15

4 years agoMerge branch 'PHP-8.0'
Gabriel Caruso [Tue, 15 Dec 2020 14:05:19 +0000 (11:05 -0300)]
Merge branch 'PHP-8.0'

4 years agoPrepare for PHP 8.0.2
Gabriel Caruso [Tue, 15 Dec 2020 14:03:21 +0000 (11:03 -0300)]
Prepare for PHP 8.0.2

This was missing from f1f78ac875fcfbf1347eb81eac06c11343c4a664.

4 years agoMerge branch 'PHP-8.0'
Gabriel Caruso [Tue, 15 Dec 2020 13:33:28 +0000 (10:33 -0300)]
Merge branch 'PHP-8.0'

4 years agoNext is 8.0.2
Gabriel Caruso [Tue, 15 Dec 2020 13:30:55 +0000 (10:30 -0300)]
Next is 8.0.2

4 years agoMySQLnd: Drop free_result_internal
Nikita Popov [Tue, 15 Dec 2020 11:29:15 +0000 (12:29 +0100)]
MySQLnd: Drop free_result_internal

Merge it into free_result. There is a large number of different
free_* functions for result sets, let's avoid having one more.
Only difference is that it does not increment stats, and that
seems like a bug as free_stmt_result is still freeing a result.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Tue, 15 Dec 2020 11:34:21 +0000 (14:34 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Optimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible.

4 years agoOptimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible.
Dmitry Stogov [Tue, 15 Dec 2020 11:30:58 +0000 (14:30 +0300)]
Optimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible.

4 years agoMySQLnd: Simplify management of zval row buffer
Nikita Popov [Tue, 15 Dec 2020 10:50:30 +0000 (11:50 +0100)]
MySQLnd: Simplify management of zval row buffer

Something odd was being done here, with the row packet having a
flag for whether it should allocate the zval buffer, which would
then get moved into the result set.

Keep the management of this buffer purely at the result set level.
This also allows us to easily reuse the same buffer for all results,
rather than allocating a new one for each fetch.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 15 Dec 2020 10:46:46 +0000 (11:46 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #77322: PharData::addEmptyDir('/') Possible integer overflow

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 15 Dec 2020 10:45:35 +0000 (11:45 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #77322: PharData::addEmptyDir('/') Possible integer overflow

4 years agoFix #77322: PharData::addEmptyDir('/') Possible integer overflow
Christoph M. Becker [Fri, 11 Dec 2020 15:47:42 +0000 (16:47 +0100)]
Fix #77322: PharData::addEmptyDir('/') Possible integer overflow

`phar_path_check()` already strips a leading slash, so we must not
attempt to strip the trailing slash from an now empty directory name.

Closes GH-6508.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 15 Dec 2020 10:32:43 +0000 (11:32 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  7.3.27 is next

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 15 Dec 2020 10:32:10 +0000 (11:32 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  7.3.27 is next

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 15 Dec 2020 10:30:46 +0000 (11:30 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.27 is next

4 years ago7.3.27 is next
Christoph M. Becker [Tue, 15 Dec 2020 10:28:01 +0000 (11:28 +0100)]
7.3.27 is next

4 years agoRemove mysqlnd_extension enum
Nikita Popov [Tue, 15 Dec 2020 09:55:53 +0000 (10:55 +0100)]
Remove mysqlnd_extension enum

ext/mysql is no longer supported, drop handling for it from
mysqlnd.

4 years agoMySQLnd: Remove unused fetch_field_data method
Nikita Popov [Tue, 15 Dec 2020 09:47:39 +0000 (10:47 +0100)]
MySQLnd: Remove unused fetch_field_data method

This method is not used, and is implemented in a very dubious
way.

4 years agoRemove very old -no-cpp-precomp compatibility flag on Mac
Levi Morrison [Wed, 9 Dec 2020 15:59:45 +0000 (08:59 -0700)]
Remove very old -no-cpp-precomp compatibility flag on Mac

Closes GH-6501.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 15 Dec 2020 09:18:54 +0000 (10:18 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  JIT: Update invalid opcache.jit INI value message to include "tracing" and "function" values

4 years agoJIT: Update invalid opcache.jit INI value message to include "tracing" and "function...
Ayesh Karunaratne [Wed, 2 Dec 2020 21:07:47 +0000 (04:07 +0700)]
JIT: Update invalid opcache.jit INI value message to include "tracing" and "function" values

`opcache.jit` accepts `tracing` and `function` as aliases, but they were not mentioned in the start-up INI warning message.
This updates the error message to include all possible values.

Closes GH-6490.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 15 Dec 2020 09:15:52 +0000 (10:15 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  IBM i PASE doesn't support ITIMER_PROF

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 15 Dec 2020 09:15:47 +0000 (10:15 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  IBM i PASE doesn't support ITIMER_PROF

4 years agoIBM i PASE doesn't support ITIMER_PROF
Calvin Buckley [Thu, 10 Dec 2020 18:25:32 +0000 (14:25 -0400)]
IBM i PASE doesn't support ITIMER_PROF

Like Cygwin, this platform needs to use a real-time timer.

This was based on a patch by @kadler, but it didn't handle unsetting
the timer, so the timeout would continue to be active, triggering
`hard_timeout` unexpectedly. The patch is fixed to handle unsetting.

Closes GH-6503.

4 years agoAdd more tests that document late static binding
jellyNoone [Mon, 14 Dec 2020 22:03:12 +0000 (23:03 +0100)]
Add more tests that document late static binding

Closes GH-6515.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 15 Dec 2020 08:51:51 +0000 (09:51 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  JIT disabled build fix.

4 years agoJIT disabled build fix.
David Carlier [Mon, 14 Dec 2020 18:42:52 +0000 (18:42 +0000)]
JIT disabled build fix.

Closes GH-6514.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 14 Dec 2020 22:14:31 +0000 (23:14 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Add Windows support for OCI 19

4 years agoAdd Windows support for OCI 19
Christoph M. Becker [Mon, 14 Dec 2020 21:42:54 +0000 (22:42 +0100)]
Add Windows support for OCI 19

As requested by Christopher Jones.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 14 Dec 2020 17:28:29 +0000 (18:28 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Drop pdo_mysql_prepare_load_data.phpt

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 14 Dec 2020 17:27:53 +0000 (18:27 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Drop pdo_mysql_prepare_load_data.phpt

4 years agoDrop pdo_mysql_prepare_load_data.phpt
Christoph M. Becker [Fri, 11 Dec 2020 18:20:16 +0000 (19:20 +0100)]
Drop pdo_mysql_prepare_load_data.phpt

Like the test title and some comments in this test describe, this test
was supposed to have `::prepare()` failing because `LOAD DATA INFILE`
would not be supported as prepared statement, and then the test checks
whether follow-up queries would succeed.  However, `LOAD DATA INFILE`
is supported for prepared statements at least on Windows with mysqlnd,
so the test does no longer test what it is supposed to do.  Therefore,
we drop it.

Closes GH-6509.

4 years agoUse zmm for row_c data
Nikita Popov [Mon, 14 Dec 2020 12:42:38 +0000 (13:42 +0100)]
Use zmm for row_c data

This API already doesn't match libmysqlclient, so we may as well
use the zmm.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 14 Dec 2020 12:29:34 +0000 (15:29 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove unused flag

4 years agoRemove unused flag
Dmitry Stogov [Mon, 14 Dec 2020 12:29:21 +0000 (15:29 +0300)]
Remove unused flag

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 14 Dec 2020 12:28:27 +0000 (15:28 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))

4 years agoFixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))
Dmitry Stogov [Mon, 14 Dec 2020 12:28:03 +0000 (15:28 +0300)]
Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))

4 years agoFixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))
Dmitry Stogov [Mon, 14 Dec 2020 12:26:11 +0000 (15:26 +0300)]
Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))

4 years agomysqlnd_error_info_init() cannot fail
Nikita Popov [Mon, 14 Dec 2020 11:31:45 +0000 (12:31 +0100)]
mysqlnd_error_info_init() cannot fail

4 years agoRemove more OOM checks
Nikita Popov [Mon, 14 Dec 2020 11:28:26 +0000 (12:28 +0100)]
Remove more OOM checks

4 years agoRemove MYSQLND_STRING_TO_INT_CONVERSION define
Nikita Popov [Mon, 14 Dec 2020 11:03:43 +0000 (12:03 +0100)]
Remove MYSQLND_STRING_TO_INT_CONVERSION define

This has been unconditionally enabled for a long time already
(the actual conversion is behind an additional runtime flag).

4 years agoMySQLnd: Remove some unnecessary allocator failure checks
Nikita Popov [Mon, 14 Dec 2020 10:58:43 +0000 (11:58 +0100)]
MySQLnd: Remove some unnecessary allocator failure checks

emalloc/pemalloc are infallible.

4 years agoMySQLnd: Remove fail thresholds from infallible allocators
Nikita Popov [Mon, 14 Dec 2020 10:51:30 +0000 (11:51 +0100)]
MySQLnd: Remove fail thresholds from infallible allocators

emalloc() etc are infallibe by design. Having a failure threshold
for them is a violation of the API contract.

4 years agoPDO: Store/pass query_string as zend_string
Nikita Popov [Fri, 11 Dec 2020 16:13:38 +0000 (17:13 +0100)]
PDO: Store/pass query_string as zend_string

Rather than storing char* + size_t, use a zend_string*. Also
avoid various copies of the query string.

4 years agoFix compile warnings in PDO Firebird
Nikita Popov [Mon, 14 Dec 2020 09:36:36 +0000 (10:36 +0100)]
Fix compile warnings in PDO Firebird

4 years agoFix MHANDLEFUNC signature
Nikita Popov [Mon, 14 Dec 2020 09:23:28 +0000 (10:23 +0100)]
Fix MHANDLEFUNC signature

The last parameter is int, not short int.

4 years agoAllow building dblib with machine-dependent libdir
Nikita Popov [Mon, 14 Dec 2020 09:17:57 +0000 (10:17 +0100)]
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.

4 years agoFix signed/unsigned warnings in PDO ODBC
Nikita Popov [Mon, 14 Dec 2020 09:02:25 +0000 (10:02 +0100)]
Fix signed/unsigned warnings in PDO ODBC

Add add skipif to test.

4 years agoDisallow version_compare() $operator abbreviations
Christoph M. Becker [Sun, 13 Dec 2020 18:00:51 +0000 (19:00 +0100)]
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.

4 years agohash: Fix signatures in the final callback defs
Anatol Belski [Sun, 13 Dec 2020 20:17:17 +0000 (21:17 +0100)]
hash: Fix signatures in the final callback defs

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoMerge branch 'PHP-8.0'
Jakub Zelenka [Sun, 13 Dec 2020 18:43:04 +0000 (18:43 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Jakub Zelenka [Sun, 13 Dec 2020 18:42:11 +0000 (18:42 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoFix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME
Jakub Zelenka [Sat, 28 Nov 2020 21:27:53 +0000 (21:27 +0000)]
Fix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME

4 years agoUPGRADING.INTERNALS: Document hash init signature changes [ci skip]
Anatol Belski [Sun, 13 Dec 2020 15:50:22 +0000 (16:50 +0100)]
UPGRADING.INTERNALS: Document hash init signature changes [ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoUPGRADING: Document algorithm specific hash options [ci skip]
Anatol Belski [Sun, 13 Dec 2020 15:36:57 +0000 (16:36 +0100)]
UPGRADING: Document algorithm specific hash options [ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
4 years agohash: Support custom algo parameters
Anatol Belski [Mon, 2 Nov 2020 19:00:28 +0000 (20:00 +0100)]
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>
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 15:47:54 +0000 (16:47 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove bug41347.phpt as the error cases are already tested

4 years agoRemove bug41347.phpt as the error cases are already tested
ekinhbayar [Fri, 11 Dec 2020 10:07:07 +0000 (13:07 +0300)]
Remove bug41347.phpt as the error cases are already tested

Closes GH-6506.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 15:36:07 +0000 (16:36 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #79132

4 years agoFixed bug #79132
Nikita Popov [Fri, 11 Dec 2020 15:35:03 +0000 (16:35 +0100)]
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.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 13:49:58 +0000 (14:49 +0100)]
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

4 years agoPDO MySQL: Fix nextRowset() on libmysqlclient with native PS
Nikita Popov [Fri, 11 Dec 2020 13:47:38 +0000 (14:47 +0100)]
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.

4 years agoPDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient
Nikita Popov [Fri, 11 Dec 2020 13:19:57 +0000 (14:19 +0100)]
PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 13:12:35 +0000 (14:12 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  PDO MySQL: Unskip bug_41125.phpt

4 years agoPDO MySQL: Unskip bug_41125.phpt
Nikita Popov [Fri, 11 Dec 2020 12:03:22 +0000 (13:03 +0100)]
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.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 11:56:10 +0000 (12:56 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #67004

4 years agoFixed bug #67004
Nikita Popov [Fri, 11 Dec 2020 11:43:19 +0000 (12:43 +0100)]
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.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 11 Dec 2020 11:21:11 +0000 (12:21 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  PDO MySQL: Use stmt_next_result with libmysqlclient as well
  PDO MySQL: Fix libmysql option test

4 years agoPDO MySQL: Use stmt_next_result with libmysqlclient as well
Nikita Popov [Fri, 11 Dec 2020 11:13:52 +0000 (12:13 +0100)]
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.

4 years agoPDO MySQL: Fix libmysql option test
Nikita Popov [Fri, 11 Dec 2020 11:04:44 +0000 (12:04 +0100)]
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.