]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 4 Jan 2021 09:55:50 +0000 (10:55 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Disable non-cron travis jobs

4 years agoFix test name
Stanislav Malyshev [Mon, 4 Jan 2021 09:52:59 +0000 (01:52 -0800)]
Fix test name

4 years agoDisable non-cron travis jobs
Nikita Popov [Mon, 4 Jan 2021 09:52:37 +0000 (10:52 +0100)]
Disable non-cron travis jobs

This was already done for PHP-8.0 and master, do it for PHP-7.4
as well.

4 years ago[ci skip] Update NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:47:47 +0000 (01:47 -0800)]
[ci skip] Update NEWS

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Stanislav Malyshev [Mon, 4 Jan 2021 09:47:09 +0000 (01:47 -0800)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  [ci skip] Update NEWS
  [ci skip] Fix order
  [ci skip] Unpdate NEWS
  Fix #77423: parse_url() will deliver a wrong host to user

4 years ago[ci skip] Update NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:46:32 +0000 (01:46 -0800)]
[ci skip] Update NEWS

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 4 Jan 2021 09:46:11 +0000 (01:46 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Fix order

4 years ago[ci skip] Fix order
Stanislav Malyshev [Mon, 4 Jan 2021 09:45:04 +0000 (01:45 -0800)]
[ci skip] Fix order

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 4 Jan 2021 09:44:18 +0000 (01:44 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Unpdate NEWS

4 years ago[ci skip] Unpdate NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:43:45 +0000 (01:43 -0800)]
[ci skip] Unpdate NEWS

4 years agoFix bug #79405 - gethostbyname() silently truncates after a null byte
Stanislav Malyshev [Sun, 3 Jan 2021 02:55:29 +0000 (18:55 -0800)]
Fix bug #79405 - gethostbyname() silently truncates after a null byte

4 years agoFix #77423: parse_url() will deliver a wrong host to user
Christoph M. Becker [Wed, 13 May 2020 07:36:52 +0000 (09:36 +0200)]
Fix #77423: parse_url() will deliver a wrong host to user

To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.

4 years agoFix imap stubs
Christoph M. Becker [Thu, 31 Dec 2020 18:30:11 +0000 (19:30 +0100)]
Fix imap stubs

Closes GH-6559.

4 years agoZipArchive methods do not return NULL
Christoph M. Becker [Sat, 2 Jan 2021 11:18:46 +0000 (12:18 +0100)]
ZipArchive methods do not return NULL

Closes GH-6563.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Sat, 2 Jan 2021 05:07:15 +0000 (21:07 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77423: parse_url() will deliver a wrong host to user

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Sat, 2 Jan 2021 05:06:07 +0000 (21:06 -0800)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77423: parse_url() will deliver a wrong host to user

4 years agoFix #77423: parse_url() will deliver a wrong host to user PHP-7.2
Christoph M. Becker [Wed, 13 May 2020 07:36:52 +0000 (09:36 +0200)]
Fix #77423: parse_url() will deliver a wrong host to user

To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.

4 years agoFix parameter name
Christoph M. Becker [Fri, 1 Jan 2021 16:46:40 +0000 (17:46 +0100)]
Fix parameter name

Levenshtein is about insertion, replacement and deletion.

Closes GH-6560.

4 years agoFix build
Christoph M. Becker [Fri, 1 Jan 2021 16:40:25 +0000 (17:40 +0100)]
Fix build

We cannot `RETURN_THROWS()` here, since `return_value` is not defined.

4 years agoUse RETURN_THROWS() in a few places
Máté Kocsis [Fri, 1 Jan 2021 15:52:48 +0000 (16:52 +0100)]
Use RETURN_THROWS() in a few places

4 years agoFix ReflectionClass::getConstants() stub
Christoph M. Becker [Thu, 31 Dec 2020 18:36:27 +0000 (19:36 +0100)]
Fix ReflectionClass::getConstants() stub

If `zval_update_constant_ex()` fails, an exception has already been
thrown, so we clarify that in the implementation as well.

Closes GH-6557.

4 years ago[ci skip] Fix pgsql constant names in UPGRADING
Christoph M. Becker [Wed, 30 Dec 2020 23:30:16 +0000 (00:30 +0100)]
[ci skip] Fix pgsql constant names in UPGRADING

4 years agoFix refentry attribute replacing
Máté Kocsis [Wed, 30 Dec 2020 17:26:24 +0000 (18:26 +0100)]
Fix refentry attribute replacing

4 years agoFix #80560: Strings containing only a base prefix return 0 object
George Peter Banyard [Tue, 29 Dec 2020 01:31:15 +0000 (02:31 +0100)]
Fix #80560: Strings containing only a base prefix return 0 object

Closes GH-6549.

4 years agoInitialize EX(call)->func by single instruction
Dmitry Stogov [Tue, 29 Dec 2020 10:20:10 +0000 (13:20 +0300)]
Initialize EX(call)->func by single instruction

4 years agoReuse value stored in %r0 instead of immediate operand
Dmitry Stogov [Tue, 29 Dec 2020 10:18:56 +0000 (13:18 +0300)]
Reuse value stored in %r0 instead of immediate operand

4 years agoFix ffi stubs
Christoph M. Becker [Sun, 27 Dec 2020 19:29:00 +0000 (20:29 +0100)]
Fix ffi stubs

Closes GH-6543.

4 years agoFix return type of DateTimeImmutable::__set_state()
Máté Kocsis [Sun, 15 Nov 2020 23:23:47 +0000 (00:23 +0100)]
Fix return type of DateTimeImmutable::__set_state()

4 years agoAdd support for generating methodsynopses from stubs
Máté Kocsis [Thu, 22 Oct 2020 08:39:18 +0000 (10:39 +0200)]
Add support for generating methodsynopses from stubs

Closes GH-6367

4 years agoBump minimum re2c version to 0.13.7
Christoph M. Becker [Tue, 15 Dec 2020 23:02:39 +0000 (00:02 +0100)]
Bump minimum re2c version to 0.13.7

Closes GH-6516.

4 years agophp_formatted_print() throws on failure
Christoph M. Becker [Sun, 27 Dec 2020 18:25:23 +0000 (19:25 +0100)]
php_formatted_print() throws on failure

Closes GH-6542.

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

* PHP-7.4:
  Replace sort() function calls with ksort() in basic ksort test

4 years agoReplace sort() function calls with ksort() in basic ksort test
haszi [Sun, 27 Dec 2020 16:03:41 +0000 (17:03 +0100)]
Replace sort() function calls with ksort() in basic ksort test

Closes GH-6541.

4 years agoDateTime*::getOffset() no longer returns false as of PHP 8.0.0
Christoph M. Becker [Sat, 26 Dec 2020 11:21:02 +0000 (12:21 +0100)]
DateTime*::getOffset() no longer returns false as of PHP 8.0.0

Cf. <https://github.com/php/doc-en/pull/282>.

Closes GH-6539.

4 years agoEliminate redundand comparison insructions
Dmitry Stogov [Thu, 24 Dec 2020 13:58:54 +0000 (16:58 +0300)]
Eliminate redundand comparison insructions

4 years agoFix the signature of FFI::typeof() and FFI::memcmp()
Máté Kocsis [Thu, 24 Dec 2020 10:45:32 +0000 (11:45 +0100)]
Fix the signature of FFI::typeof() and FFI::memcmp()

4 years agoAdd a few other RETURN_THROWS()
Máté Kocsis [Thu, 24 Dec 2020 10:44:15 +0000 (11:44 +0100)]
Add a few other RETURN_THROWS()

4 years agoFix the signature of FFI::sizeof() and FFI::alignof()
Máté Kocsis [Wed, 23 Dec 2020 22:27:12 +0000 (23:27 +0100)]
Fix the signature of FFI::sizeof() and FFI::alignof()

4 years agoFix PDO_OCI test
Christopher Jones [Thu, 24 Dec 2020 06:48:39 +0000 (17:48 +1100)]
Fix PDO_OCI test

4 years agoAdd regression test for bug #76770
Semen Dubina [Mon, 10 Sep 2018 22:26:02 +0000 (01:26 +0300)]
Add regression test for bug #76770

Closes GH-3514.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 23 Dec 2020 12:52:24 +0000 (13:52 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80384: limit read buffer size

4 years agoFix #80384: limit read buffer size
Adam Seitz [Tue, 1 Dec 2020 23:40:16 +0000 (00:40 +0100)]
Fix #80384: limit read buffer size

In the case of a stream with no filters, php_stream_fill_read_buffer
only reads stream->chunk_size into the read buffer. If the stream has
filters attached, it could unnecessarily buffer a large amount of data.

With this change, php_stream_fill_read_buffer only proceeds until either
the requested size or stream->chunk_size is available in the read buffer.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Closes GH-6444.

4 years agoFixed bug #80376 (last day of the month causes runway cpu usage)
Derick Rethans [Mon, 21 Dec 2020 10:31:41 +0000 (10:31 +0000)]
Fixed bug #80376 (last day of the month causes runway cpu usage)

4 years agoFixed bug #80376 (last day of the month causes runway cpu usage)
Derick Rethans [Mon, 21 Dec 2020 10:30:40 +0000 (10:30 +0000)]
Fixed bug #80376 (last day of the month causes runway cpu usage)

4 years agoFix bug #80537
Nikita Popov [Mon, 21 Dec 2020 09:21:08 +0000 (10:21 +0100)]
Fix bug #80537

This is an unavoidable breaking change to both the type and
parameter name.

The assertion that was supposed to prevent this was overly lax
and accepted any object type for string parameters.

4 years agoDescription typo
Christopher Jones [Mon, 21 Dec 2020 04:46:26 +0000 (15:46 +1100)]
Description typo

4 years agoBundle PECL OCI8 3.0.1
Christopher Jones [Mon, 21 Dec 2020 04:15:16 +0000 (15:15 +1100)]
Bundle PECL OCI8 3.0.1

4 years agoRetrofit NEWS
Christopher Jones [Mon, 21 Dec 2020 04:07:40 +0000 (15:07 +1100)]
Retrofit NEWS

4 years agoRevert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"
Christoph M. Becker [Sun, 20 Dec 2020 22:07:02 +0000 (23:07 +0100)]
Revert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"

This reverts commit b67c23218950eae0a153b093dcefbe14b3b40901.

4 years agoDateTime:: and DateTimeImmutable::getTimestamp() may return false
Christoph M. Becker [Sun, 20 Dec 2020 18:32:12 +0000 (19:32 +0100)]
DateTime:: and DateTimeImmutable::getTimestamp() may return false

4 years agoFix ext/date stubs
Christoph M. Becker [Wed, 9 Dec 2020 15:51:53 +0000 (16:51 +0100)]
Fix ext/date stubs

Closes GH-6523.

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-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 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 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 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-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-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 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 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 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 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 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-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 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-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 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 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-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 agoRemove unused flag
Dmitry Stogov [Mon, 14 Dec 2020 12:29:21 +0000 (15:29 +0300)]
Remove unused flag

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 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 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 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 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 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 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 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.

4 years agoFixed bug #62889
Nikita Popov [Fri, 11 Dec 2020 10:20:33 +0000 (11:20 +0100)]
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().

4 years agoPDO MySQL: Fix leak with libmysqlclient and multiple rowsets
Nikita Popov [Fri, 11 Dec 2020 09:47:16 +0000 (10:47 +0100)]
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...

4 years agoFix test cases for MariaDB
Dharman [Thu, 10 Dec 2020 23:50:02 +0000 (23:50 +0000)]
Fix test cases for MariaDB

And remove unnecessary try-catch.

Closes GH-6505.

4 years agoFixed bug #72368
Nikita Popov [Thu, 10 Dec 2020 15:52:17 +0000 (16:52 +0100)]
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.

4 years agoAllow drivers to omit error code
Nikita Popov [Thu, 10 Dec 2020 15:03:22 +0000 (16:03 +0100)]
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.

4 years agoFixed bug #79131
Nikita Popov [Thu, 10 Dec 2020 14:51:17 +0000 (15:51 +0100)]
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.

4 years agoEliminate some repeatable IS_REFERENCE checks
Dmitry Stogov [Thu, 10 Dec 2020 11:45:54 +0000 (14:45 +0300)]
Eliminate some repeatable IS_REFERENCE checks

4 years agoFixed bug #79872 by improving error message
Nikita Popov [Thu, 10 Dec 2020 10:46:29 +0000 (11:46 +0100)]
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().

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 10 Dec 2020 10:24:08 +0000 (11:24 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #76815