]> granicus.if.org Git - php/log
php
4 years agoStop on fake frame
Dmitry Stogov [Wed, 11 Nov 2020 11:54:54 +0000 (14:54 +0300)]
Stop on fake frame

4 years agoFixed reference-counting propagation
Dmitry Stogov [Wed, 11 Nov 2020 11:54:00 +0000 (14:54 +0300)]
Fixed reference-counting propagation

4 years agoFix double free when socket_accept fails
Nikita Popov [Wed, 11 Nov 2020 11:48:25 +0000 (12:48 +0100)]
Fix double free when socket_accept fails

4 years agoRetain reference to share handle from curl handle
Nikita Popov [Wed, 11 Nov 2020 10:51:20 +0000 (11:51 +0100)]
Retain reference to share handle from curl handle

Not keeping a reference will not result in use after free, because
curl protects against it, but it will result in a memory leak,
because curl_share_cleanup() will fail. We should make sure that
the share handle object stays alive as long as the curl handles
use it.

4 years ago[Observer+JIT] Save opline before calling begin/end handlers
Dmitry Stogov [Wed, 11 Nov 2020 10:50:53 +0000 (13:50 +0300)]
[Observer+JIT] Save opline before calling begin/end handlers

4 years ago[Observer] Save opline before calling begin/end handlers
Dmitry Stogov [Wed, 11 Nov 2020 10:06:55 +0000 (13:06 +0300)]
[Observer] Save opline before calling begin/end handlers

4 years agoFix community job
Nikita Popov [Wed, 11 Nov 2020 08:28:20 +0000 (09:28 +0100)]
Fix community job

Made a mistake while merging...

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Tue, 10 Nov 2020 17:58:38 +0000 (17:58 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoPHP-7.4 is now for 7.4.14
Derick Rethans [Tue, 10 Nov 2020 17:58:21 +0000 (17:58 +0000)]
PHP-7.4 is now for 7.4.14

4 years agoUpdate NEWS for 8.0.0
Gabriel Caruso [Tue, 10 Nov 2020 11:02:35 +0000 (11:02 +0000)]
Update NEWS for 8.0.0

4 years agoUpdate NEWS for PHP 8.0.0RC4
Gabriel Caruso [Tue, 10 Nov 2020 10:52:13 +0000 (10:52 +0000)]
Update NEWS for PHP 8.0.0RC4

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 10 Nov 2020 10:45:59 +0000 (11:45 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Add integration test for symfony preloading

4 years agoAdd integration test for symfony preloading
Nikita Popov [Mon, 9 Nov 2020 14:13:33 +0000 (15:13 +0100)]
Add integration test for symfony preloading

To help catch regressions like the one that occurred in PHP 7.4.12.

Closes GH-6414.

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

* PHP-7.4:
  7.3.26 is next

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

* PHP-7.3:
  7.3.26 is next

4 years ago7.3.26 is next
Christoph M. Becker [Tue, 10 Nov 2020 10:08:16 +0000 (11:08 +0100)]
7.3.26 is next

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 9 Nov 2020 16:08:38 +0000 (17:08 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix phi use chain management when renaming variable

4 years agoFix phi use chain management when renaming variable
Nikita Popov [Mon, 9 Nov 2020 16:06:41 +0000 (17:06 +0100)]
Fix phi use chain management when renaming variable

If there is a previous use of the new variable in the phi, we need
to NULL out the use chain of the new source we're adding.

Test case is reduced from an assertion failure in the Symfony Demo.

4 years agoUse true/false instead of TRUE/FALSE in intl
Nikita Popov [Mon, 9 Nov 2020 13:44:11 +0000 (14:44 +0100)]
Use true/false instead of TRUE/FALSE in intl

And drop the U_DEFINE_TRUE_AND_FALSE flag.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 9 Nov 2020 13:35:40 +0000 (14:35 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80310: Support for icu4c 68.1.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 9 Nov 2020 13:34:24 +0000 (14:34 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #80310: Support for icu4c 68.1.

4 years agoFixed bug #80310: Support for icu4c 68.1.
Alexander M. Turek [Tue, 3 Nov 2020 18:14:41 +0000 (19:14 +0100)]
Fixed bug #80310: Support for icu4c 68.1.

On stable versions, bring back the TRUE/FALSE defines by defining
_U_DEFINE_TRUE_AND_FALSE.

Closes GH-6397.

4 years agoRemove embedded property from mysqli_driver
Dharman [Fri, 6 Nov 2020 23:00:33 +0000 (23:00 +0000)]
Remove embedded property from mysqli_driver

All other leftovers of this feature have been dropped in PHP 8,
so we should remove the property as well.

Closes GH-6407.

4 years agoFixed bug #80334
Nikita Popov [Mon, 9 Nov 2020 09:18:43 +0000 (10:18 +0100)]
Fixed bug #80334

If assert() was called with named args, add description as named
arg as well.

4 years agoFixed missaligned access
Dmitry Stogov [Mon, 9 Nov 2020 08:50:26 +0000 (11:50 +0300)]
Fixed missaligned access

4 years agoSkip preload test under asan
Nikita Popov [Mon, 9 Nov 2020 08:46:48 +0000 (09:46 +0100)]
Skip preload test under asan

Just like the other preload tests with startup failures, this may
cause leaks.

4 years agoRename PhpToken::getAll() to PhpToken::tokenize()
Nikita Popov [Mon, 9 Nov 2020 08:40:31 +0000 (09:40 +0100)]
Rename PhpToken::getAll() to PhpToken::tokenize()

See https://externals.io/message/112189.
Fixes bug #80328.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Sat, 7 Nov 2020 18:49:00 +0000 (18:49 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoUpdate version in 7.4 branch
Derick Rethans [Sat, 7 Nov 2020 18:48:13 +0000 (18:48 +0000)]
Update version in 7.4 branch

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 6 Nov 2020 16:44:51 +0000 (17:44 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Split tests for compatibility with ICU 68.1

4 years agoSplit tests for compatibility with ICU 68.1
Christoph M. Becker [Fri, 6 Nov 2020 16:11:26 +0000 (17:11 +0100)]
Split tests for compatibility with ICU 68.1

4 years agoRaise E_WARNING on PHP related errors
Christoph M. Becker [Tue, 20 Oct 2020 10:31:58 +0000 (12:31 +0200)]
Raise E_WARNING on PHP related errors

If Zip operations fails due to PHP error conditions before libzip even
has been called, there is no meaningful indication what failed; the
functions just return false, and the Zip status indicated that no error
did occur.  Therefore we raise `E_WARNING` in these cases.

Closes GH-6356.

4 years agoMove stack overflow checks out of the loops
Dmitry Stogov [Fri, 6 Nov 2020 09:09:56 +0000 (12:09 +0300)]
Move stack overflow checks out of the loops

4 years agoreport about ZSTD compression availability
Remi Collet [Thu, 5 Nov 2020 16:18:22 +0000 (17:18 +0100)]
report about ZSTD compression availability

4 years agoonly display libzip both headers/library versions if they differ
Remi Collet [Thu, 5 Nov 2020 16:13:39 +0000 (17:13 +0100)]
only display libzip both headers/library versions if they differ

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 5 Nov 2020 15:37:45 +0000 (16:37 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Backport preloading trait fixup fixes

4 years agoBackport preloading trait fixup fixes
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Backport preloading trait fixup fixes

This cherry-picks 33969c2252b2c33a72c9039072af8862fd347a5f and
2effbfd8713936742ef46e6e85ce193b320ac005 from PHP-8.0.

The issues these commits fix could also manifest in PHP 7.4, and
a commenter on bug #80307 reports this this might indeed be
happening.

4 years agoFixed incorrect invariant guard motion
Dmitry Stogov [Thu, 5 Nov 2020 15:32:00 +0000 (18:32 +0300)]
Fixed incorrect invariant guard motion

4 years agoFixup trait methods even if no traits are used
Nikita Popov [Thu, 5 Nov 2020 12:15:32 +0000 (13:15 +0100)]
Fixup trait methods even if no traits are used

Trait methods might be non-trivially inherited, in which case we
may have to perform fixup in classes that do not directly use any
traits.

4 years agoFix multiple trait fixup
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Fix multiple trait fixup

If a trait method is inherited, preloading trait fixup might be
performed on it multiple times. Usually this is fine, because
the opcodes pointer will have already been updated, and will thus
not be found in the xlat table.

However, it can happen that the new opcodes pointer is the same
as one of the old opcodes pointers, if the pointer has been reused
by the allocator. In this case we will look up the wrong op array
and overwrite the trait method with an unrelated trait method.

We fix this by indexing the xlat table not by the opcodes pointer,
but by the refcount pointer. The refcount pointer is not changed
during optimization, and accurately represents which op arrays
should use the same opcodes.

Fixes bug #80307. The test case does not reproduce the bug, because
this depends on a lot of "luck" with the allocator. The test case
merely illustrates a case where orig_op_array would have been NULL
in the original code.

4 years agoEnd output handlers in preload shutdown
Nikita Popov [Wed, 4 Nov 2020 15:03:39 +0000 (16:03 +0100)]
End output handlers in preload shutdown

Same as in php_request_shutdown(), we need to end any active
output handlers, as these may no longer be safe to execute
lateron.

4 years agogetlastmod() can return false
Nikita Popov [Wed, 4 Nov 2020 14:49:12 +0000 (15:49 +0100)]
getlastmod() can return false

At least this can happen during preloading.

4 years agoFix static variable in methods inheritance during preloading
Nikita Popov [Wed, 4 Nov 2020 14:33:11 +0000 (15:33 +0100)]
Fix static variable in methods inheritance during preloading

This is now "bug compatible" with the normal behavior, and more
imporantly, does not crash :)

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 4 Nov 2020 13:56:54 +0000 (14:56 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80266: parse_url silently drops port number 0

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 4 Nov 2020 13:54:14 +0000 (14:54 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80266: parse_url silently drops port number 0

4 years agoFix #80266: parse_url silently drops port number 0
Christoph M. Becker [Wed, 4 Nov 2020 10:34:10 +0000 (11:34 +0100)]
Fix #80266: parse_url silently drops port number 0

As of commit 81b2f3e[1], `parse_url()` accepts URLs with a zero port,
but does not report that port, what is wrong in hindsight.

Since the port number is stored as `unsigned short` there is no way to
distinguish between port zero and no port.  For BC reasons, we thus
introduce `parse_url_ex2()` which accepts an output parameter that
allows that distinction, and use the new function to fix the behavior.

The introduction of `parse_url_ex2()` has been suggested by Nikita.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=81b2f3e5d9fcdffd87a4fcd12bd8c708a97091e1>

Closes GH-6399.

4 years agoAssert that references are not persisted
Nikita Popov [Wed, 4 Nov 2020 13:51:44 +0000 (14:51 +0100)]
Assert that references are not persisted

There should not be any need to persist references, and it's unlikely
that persisting a reference will behave correctly at runtime, because
we don't have a concept of an immutable reference.

4 years agoDon't xfail method_static_var.phpt
Nikita Popov [Wed, 4 Nov 2020 11:30:41 +0000 (12:30 +0100)]
Don't xfail method_static_var.phpt

Let's test the current behavior here. It might not be right, but
it's long-standing behavior.

Nearly missed an assertion failure here because the test was
XFAILed...

4 years agoDon't disable opcache for generic tests
Nikita Popov [Wed, 4 Nov 2020 10:11:14 +0000 (11:11 +0100)]
Don't disable opcache for generic tests

Even if the original issue only reproduces without opcache, we
should still allow running them with and without opcache.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 4 Nov 2020 09:55:59 +0000 (10:55 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix dynamic function definition in preload script

4 years agoFix dynamic function definition in preload script
Nikita Popov [Wed, 4 Nov 2020 09:54:08 +0000 (10:54 +0100)]
Fix dynamic function definition in preload script

We should use normal function renaming if the function is declared
during preloading itself, rather than afterwards.

This fixes a regression introduced by
68f80be9d1380de731930187250a7ed6b55ae196.

4 years agoDon't disable early binding during preloading script
Nikita Popov [Tue, 3 Nov 2020 15:45:13 +0000 (16:45 +0100)]
Don't disable early binding during preloading script

We should only disable early binding during the opcache_compile_file()
calls, not inside the preloading script or anything it includes.
The right condition to check for is whether we compile the file
without execution, as declaring classes is "execution".

4 years agoReport parse errors during preloading
Nikita Popov [Tue, 3 Nov 2020 15:24:54 +0000 (16:24 +0100)]
Report parse errors during preloading

4 years agoFix use of type copy ctor when importing trait properties
Nikita Popov [Tue, 3 Nov 2020 14:29:18 +0000 (15:29 +0100)]
Fix use of type copy ctor when importing trait properties

We shouldn't call the copy constructor inside the original type,
duh.

4 years agoAllow unlinked classes when performing in_compilation variance check
Nikita Popov [Tue, 3 Nov 2020 13:49:10 +0000 (14:49 +0100)]
Allow unlinked classes when performing in_compilation variance check

As preloading runs in in_compilation mode, we also need to allow
use of unlinked classes in lookup_class().

4 years agoFix variance checks on resolved union types
Nikita Popov [Tue, 3 Nov 2020 13:15:05 +0000 (14:15 +0100)]
Fix variance checks on resolved union types

This is a bit annoying: When preloading is used, types might be
resolved during inheritance checks, so we need to deal with CE
types rather than just NAME types everywhere.

4 years agoDon't ignore internal classes during preloading
Nikita Popov [Tue, 3 Nov 2020 10:50:14 +0000 (11:50 +0100)]
Don't ignore internal classes during preloading

When preloading, it's fine to make use of internal class information,
as we do not support Windows. It is also necessary to allow proper
variance checks against internal classes.

4 years agoFix persisting property info table with internal parent
Nikita Popov [Tue, 3 Nov 2020 10:26:52 +0000 (11:26 +0100)]
Fix persisting property info table with internal parent

If the property info comes from an internal parent, we won't have
an xlat entry for it. Leave it alone in that case.

4 years agoPreserve trait method alias name during preloading
Nikita Popov [Tue, 3 Nov 2020 09:55:59 +0000 (10:55 +0100)]
Preserve trait method alias name during preloading

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 3 Nov 2020 09:39:26 +0000 (10:39 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix another implicit function declaration in configure

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 3 Nov 2020 09:39:13 +0000 (10:39 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix another implicit function declaration in configure

4 years agoFix another implicit function declaration in configure
Nikita Popov [Tue, 3 Nov 2020 09:38:16 +0000 (10:38 +0100)]
Fix another implicit function declaration in configure

As mentioned on bug #80171. This one is in libtool.m4, might get
lost on libtool updates.

4 years agoFix typo in UPGRADING
Chris Brown [Mon, 2 Nov 2020 17:15:04 +0000 (12:15 -0500)]
Fix typo in UPGRADING

Closes GH-6395.

4 years agoImproved error message for typed class properties with null as default value
Bogdan Ungureanu [Mon, 2 Nov 2020 22:18:12 +0000 (00:18 +0200)]
Improved error message for typed class properties with null as default value

Closes GH-6396.

4 years ago[ci skip] Fix small typo
Chris Brown [Mon, 2 Nov 2020 16:34:10 +0000 (11:34 -0500)]
[ci skip] Fix small typo

`as` -> `was`

Closes GH-6394.

4 years agoRename opcache.jit_max_loops_unroll to opcache.jit_max_loop_unrolls
Nikita Popov [Mon, 2 Nov 2020 11:23:28 +0000 (12:23 +0100)]
Rename opcache.jit_max_loops_unroll to opcache.jit_max_loop_unrolls

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 2 Nov 2020 10:41:12 +0000 (11:41 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #70461: disable md5 code when it is not supported in net-snmp

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 2 Nov 2020 10:39:16 +0000 (11:39 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #70461: disable md5 code when it is not supported in net-snmp

4 years agoFix #70461: disable md5 code when it is not supported in net-snmp
Christoph M. Becker [Wed, 28 Oct 2020 14:30:49 +0000 (15:30 +0100)]
Fix #70461: disable md5 code when it is not supported in net-snmp

Patch contributed by Alexander Bergmann.

Closes GH-6389.

4 years agoFix tests for MariaDB
Dharman [Wed, 28 Oct 2020 14:15:07 +0000 (14:15 +0000)]
Fix tests for MariaDB

Closes GH-6390.

4 years agoFix test added in d44235acaeb4
Alex Dowad [Fri, 30 Oct 2020 20:11:27 +0000 (22:11 +0200)]
Fix test added in d44235acaeb4

4 years agoConvert numeric string array keys to integers correctly in JITted code
Alex Dowad [Thu, 29 Oct 2020 21:10:04 +0000 (23:10 +0200)]
Convert numeric string array keys to integers correctly in JITted code

While fixing bugs in mbstring, one of my new test cases failed with a strange
error message stating: 'Warning: Undefined array key 1...', when clearly the
array key had been set properly.

GDB'd that sucker and found that JIT'd PHP code was calling directly into
`zend_hash_add_new` (which was not converting the numeric string key to an
integer properly). But where was that code coming from? I examined the disasm,
looked up symbols to figure out where call instructions were going, then grepped
the codebase for those function names. It soon became clear that the disasm I
was looking at was compiled from `zend_jit_fetch_dim_w_helper`.

4 years agoFIxed bug #80299
Nikita Popov [Fri, 30 Oct 2020 16:23:18 +0000 (17:23 +0100)]
FIxed bug #80299

The must_wrap was leaking across iterations.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Fri, 30 Oct 2020 14:52:24 +0000 (15:52 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix SSA integrity violation for type inference in dead code

4 years agoFix SSA integrity violation for type inference in dead code
Nikita Popov [Fri, 30 Oct 2020 14:48:03 +0000 (15:48 +0100)]
Fix SSA integrity violation for type inference in dead code

The foreach body can never be executed and thus may contain empty
types. We should still uphold our SSA integrity invariants in that
case.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 30 Oct 2020 14:49:48 +0000 (15:49 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix bug79177.phpt wrt. JIT

4 years agoFix bug79177.phpt wrt. JIT
Christoph M. Becker [Fri, 30 Oct 2020 11:44:37 +0000 (12:44 +0100)]
Fix bug79177.phpt wrt. JIT

JIT ignores that the `zend_write` callback is overwritten, so we define
our own callback and caller.

We also fix the "inconsistent DLL binding" warnings on Windows, by
introducing `PHP_ZEND_TEST_API`.

Closes GH-6391.

4 years agoFix signed integer overflow
Nikita Popov [Fri, 30 Oct 2020 11:37:22 +0000 (12:37 +0100)]
Fix signed integer overflow

Fixes oss-fuzz #26763.

4 years agoFixed bug #80290
Nikita Popov [Fri, 30 Oct 2020 10:11:16 +0000 (11:11 +0100)]
Fixed bug #80290

Dropping the dtor arg args[3] rather than using STR_COPY: Since
PHP 8, we no longer support separation in call_user_function(),
so we also don't need to worry about things like arguments being
replaced with references.

4 years agoCreate TSSA loops for recursive call/return traces and move invariant type guards...
Dmitry Stogov [Fri, 30 Oct 2020 10:08:31 +0000 (13:08 +0300)]
Create TSSA loops for recursive call/return traces and move invariant type guards out of loops.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 29 Oct 2020 15:35:06 +0000 (16:35 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix bug #72413: Segfault with get_result and PS cursors

4 years agoFix bug #72413: Segfault with get_result and PS cursors
Dharman [Thu, 17 Sep 2020 11:35:26 +0000 (12:35 +0100)]
Fix bug #72413: Segfault with get_result and PS cursors

We cannot simply switch to use_result here, because the fetch_row
methods in get_result mode and in use_result/store_result mode
are different: In one case it accepts a statement, in the other
a return value zval. Thus, doing a switch to use_result results
in a segfault when trying to fetch a row.

Actually supporting get_result with cursors would require adding
cursor support in mysqlnd_result, not just mysqlnd_ps. That would
be a significant amount of effort and, given the age of the issue,
does not appear to be particularly likely to happen soon.

As such, we simply generate an error when using get_result()
with cursors, which is much better than causing a segfault.
Instead, parameter binding needs to be used.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 29 Oct 2020 13:18:04 +0000 (14:18 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Handle errors during PDO row fetch

4 years agoHandle errors during PDO row fetch
Nikita Popov [Thu, 29 Oct 2020 13:07:08 +0000 (14:07 +0100)]
Handle errors during PDO row fetch

The EOF flag also gets set on error, so we always end up ignoring
errors here.

However, we should only check errors for unbuffered results. For
buffered results, this function is guaranteed not to error, and
querying the errno may return an unrelated error.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Thu, 29 Oct 2020 12:10:32 +0000 (13:10 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix format specifier

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 29 Oct 2020 12:09:19 +0000 (13:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix format specifier

4 years agoFix format specifier
Christoph M. Becker [Thu, 29 Oct 2020 11:58:45 +0000 (12:58 +0100)]
Fix format specifier

In this function, `i` is of type `size_t`.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 29 Oct 2020 11:47:22 +0000 (12:47 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Report gone away error in one more place

4 years agoReport gone away error in one more place
Nikita Popov [Thu, 29 Oct 2020 10:43:17 +0000 (11:43 +0100)]
Report gone away error in one more place

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Thu, 29 Oct 2020 11:16:20 +0000 (12:16 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  [ci skip] Fix NEWS order

4 years ago[ci skip] Fix NEWS order
Christoph M. Becker [Thu, 29 Oct 2020 11:15:31 +0000 (12:15 +0100)]
[ci skip] Fix NEWS order

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Thu, 29 Oct 2020 11:02:54 +0000 (12:02 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #44618: Fetching may rely on uninitialized data

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 29 Oct 2020 11:00:07 +0000 (12:00 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #44618: Fetching may rely on uninitialized data

4 years agoFix #44618: Fetching may rely on uninitialized data
Christoph M. Becker [Thu, 29 Oct 2020 10:52:10 +0000 (11:52 +0100)]
Fix #44618: Fetching may rely on uninitialized data

Unless `SQLGetData()` returns `SQL_SUCCESS` or `SQL_SUCCESS_WITH_INFO`,
the `StrLen_or_IndPtr` output argument is not guaranteed to be properly
set.  Thus we handle retrieval failure other than `SQL_ERROR` by
yielding `false` for those column values and raising a warning.

Closes GH-6281.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 29 Oct 2020 09:39:58 +0000 (10:39 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Retain QUIT_SEND connection state

4 years agoRetain QUIT_SEND connection state
Nikita Popov [Thu, 29 Oct 2020 09:17:35 +0000 (10:17 +0100)]
Retain QUIT_SEND connection state

If the server goes away while reading a packet, don't go back into
the READY state. This will just cause broken pipe errors down the
line.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 28 Oct 2020 16:15:42 +0000 (17:15 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #65825

4 years agoFixed bug #65825
Nikita Popov [Wed, 28 Oct 2020 16:12:35 +0000 (17:12 +0100)]
Fixed bug #65825

Set error_info when we fail to read a packet, instead of throwing
a warning. Additionally we also need to populate the right
error_info in rowp_read -- we'll later take the error from the
packet, not the connection.

No test case, as this is hard to reliably test. I'm using the
test case from:
https://github.com/php/php-src/pull/2131#issuecomment-538374838

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 28 Oct 2020 12:49:09 +0000 (13:49 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #79177: FFI doesn't handle well PHP exceptions within callback

4 years agoFix #79177: FFI doesn't handle well PHP exceptions within callback
Christoph M. Becker [Wed, 28 Oct 2020 11:01:28 +0000 (12:01 +0100)]
Fix #79177: FFI doesn't handle well PHP exceptions within callback

We have to error on unhandled exceptions in FFI callbacks, to avoid
passing back undefined values.

This has been discussed and agreed upon in a previous PR[1].

[1] <https://github.com/php/php-src/pull/5120>

Closes GH-6366.