]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 13:19:53 +0000 (14:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix variance checks on resolved union types

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 10:51:29 +0000 (11:51 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't ignore internal classes during preloading

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 10:31:58 +0000 (11:31 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix persisting property info table with internal parent

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 09:57:01 +0000 (10:57 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Preserve trait method alias name during preloading

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 agoModernize IMAP tests
George Peter Banyard [Tue, 3 Nov 2020 09:49:18 +0000 (09:49 +0000)]
Modernize IMAP tests

Use constants when appropriate, drop some ouputs which depends on env vars

Enable parallel testing.

Closes GH-6380

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

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

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 3 Nov 2020 08:35:20 +0000 (09:35 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix typo in UPGRADING
  Improved error message for typed class properties with null as default value

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 agoAdd test suite for ARMSCII-8 encoding
Alex Dowad [Sun, 18 Oct 2020 15:51:59 +0000 (17:51 +0200)]
Add test suite for ARMSCII-8 encoding

4 years agoFix mbstring support for ARMSCII-8
Alex Dowad [Sun, 18 Oct 2020 15:49:57 +0000 (17:49 +0200)]
Fix mbstring support for ARMSCII-8

- Identify filter was completely wrong.
- Respect `mb_substitute_character` rather than converting invalid bytes to
  Unicode 0xFFFD (generic replacement character).
- Don't convert Unicode 0xFFFD to a valid ARMSCII-8 character.
- When converting ARMSCII-8 to ARMSCII-8, don't pass invalid bytes through
  silently.

4 years agoOptimize (AND FIX) mb_check_encoding (cut execution time by 50%+)
Alex Dowad [Sat, 29 Aug 2020 17:12:28 +0000 (19:12 +0200)]
Optimize (AND FIX) mb_check_encoding (cut execution time by 50%+)

Previously, `mb_check_encoding` did an awful lot of unneeded work. In order to
determine whether a string was valid or not, it would convert the whole string
into wchar (code points), which required dynamically allocating a (potentially
large) buffer. Then it would turn right around and convert that big 'ol buffer
of code points back to the original encoding again. Finally, it would check
whether any invalid bytes were detected during that long and onerous process.

The thing is, mbstring _already_ has machinery for detecting whether a string
is valid in a certain encoding or not, and it doesn't require copying any data
around or allocating buffers. Better yet, it can fail fast when an invalid byte
is found. Why not use it? It's sure a lot faster!

Further, the legacy code was also badly broken. Why? Because aside from
checking whether illegal characters were detected, it would also check whether
the conversion to and from wchars was lossless. But, some encodings have
more than one valid encoding for the same character. In such cases, it is
not possible to make the conversion to and from wchars lossless for every
valid character. So `mb_check_encoding` would actually reject good strings
in a lot of encodings!

4 years agoAdd test suite for KOI8-U encoding
Alex Dowad [Sun, 18 Oct 2020 15:12:19 +0000 (17:12 +0200)]
Add test suite for KOI8-U encoding

4 years agoRemove dead code from mbfilter_koi8u.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 15:11:17 +0000 (17:11 +0200)]
Remove dead code from mbfilter_koi8u.c (and do general code cleanup)

4 years agoAll bytes are valid in KOI8-U encoding
Alex Dowad [Sun, 18 Oct 2020 15:10:22 +0000 (17:10 +0200)]
All bytes are valid in KOI8-U encoding

4 years agoAdd test suite for KOI8-R encoding
Alex Dowad [Sun, 18 Oct 2020 15:09:06 +0000 (17:09 +0200)]
Add test suite for KOI8-R encoding

4 years agoRemove dead code from mbfilter_iso8859_{2,4,5,9,10,13,14,15,16}.c
Alex Dowad [Sun, 18 Oct 2020 14:47:08 +0000 (16:47 +0200)]
Remove dead code from mbfilter_iso8859_{2,4,5,9,10,13,14,15,16}.c

...Plus some dead code related to ISO-8859-1.

4 years agoRemove dead code from mbfilter_koi8r.c
Alex Dowad [Sun, 18 Oct 2020 14:39:09 +0000 (16:39 +0200)]
Remove dead code from mbfilter_koi8r.c

4 years agoAll bytes are valid in KOI8-R encoding
Alex Dowad [Sun, 18 Oct 2020 14:38:27 +0000 (16:38 +0200)]
All bytes are valid in KOI8-R encoding

4 years agoAdd test suite for CP850 encoding
Alex Dowad [Sun, 18 Oct 2020 14:36:21 +0000 (16:36 +0200)]
Add test suite for CP850 encoding

4 years agoRemove dead code from mbfilter_cp850.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 14:35:20 +0000 (16:35 +0200)]
Remove dead code from mbfilter_cp850.c (and do general code cleanup)

Since there are no invalid bytes in CP850, these `if` conditions will never
be true.

4 years agoAll bytes are valid in CP850 encoding
Alex Dowad [Sun, 18 Oct 2020 14:35:00 +0000 (16:35 +0200)]
All bytes are valid in CP850 encoding

4 years agoAdd test suite for CP866 encoding
Alex Dowad [Sun, 18 Oct 2020 14:27:56 +0000 (16:27 +0200)]
Add test suite for CP866 encoding

4 years agoRemove dead code from mbfilter_cp866.c (and do general code cleanup)
Alex Dowad [Sun, 18 Oct 2020 14:26:59 +0000 (16:26 +0200)]
Remove dead code from mbfilter_cp866.c (and do general code cleanup)

Since there are no invalid bytes in CP866, these `if` conditions will never
be true.

4 years agoAll bytes are valid in CP866 encoding
Alex Dowad [Sun, 18 Oct 2020 14:25:55 +0000 (16:25 +0200)]
All bytes are valid in CP866 encoding

4 years agoAdd test suite for CP1254 encoding
Alex Dowad [Sun, 18 Oct 2020 13:23:17 +0000 (15:23 +0200)]
Add test suite for CP1254 encoding

4 years agoFix mbstring support for CP1254 encoding
Alex Dowad [Sun, 18 Oct 2020 13:30:03 +0000 (15:30 +0200)]
Fix mbstring support for CP1254 encoding

One funny thing: while the original author used Unicode 0xFFFD (generic
replacement character) for invalid bytes in CP1251 and CP1252, for CP1254
they used 0xFFFE, which is not a valid Unicode codepoint at all, but is a
reversed byte-order mark. Probably this was by mistake.

Anyways,

- Fixed identify filter, which was completely wrong.
- Don't convert Unicode 0xFFFE to a random (but valid) CP1254 byte.
- When converting CP1254 to CP1254, don't pass invalid bytes through silently.

4 years agoAdd test suite for CP1251 encoding
Alex Dowad [Sun, 18 Oct 2020 13:03:08 +0000 (15:03 +0200)]
Add test suite for CP1251 encoding

4 years agoFix mbstring support for CP1251 encoding
Alex Dowad [Sun, 18 Oct 2020 13:12:11 +0000 (15:12 +0200)]
Fix mbstring support for CP1251 encoding

- Identify filter was as wrong as wrong can be.
- Invalid CP1251 byte 0x98 was converted to Unicode 0xFFFD (generic
  replacement character), rather than respecting `mb_substitute_character`.
- Unicode 0xFFFD was converted to some random CP1251 byte.
- When converting CP1251 to CP1251, don't pass invalid bytes through silently.

4 years agoTest cases for mbstring encodings are less repetitive
Alex Dowad [Mon, 2 Nov 2020 11:11:16 +0000 (13:11 +0200)]
Test cases for mbstring encodings are less repetitive

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 2 Nov 2020 17:11:52 +0000 (18:11 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  [ci skip] Fix small typo

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 2 Nov 2020 11:25:28 +0000 (12:25 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Rename opcache.jit_max_loops_unroll to opcache.jit_max_loop_unrolls

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-8.0'
Christoph M. Becker [Mon, 2 Nov 2020 10:42:26 +0000 (11:42 +0100)]
Merge branch 'PHP-8.0'

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

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 2 Nov 2020 08:59:45 +0000 (09:59 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix tests for MariaDB

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 agohash: murmur: Fix GCC support version for no_sanitize
Anatol Belski [Sun, 1 Nov 2020 20:46:36 +0000 (21:46 +0100)]
hash: murmur: Fix GCC support version for no_sanitize

While AddressSanitizer is supported as of 4.8, the no_sanitize attribute
appears in 8.0.

Signed-off-by: Anatol Belski <ab@php.net>
4 years agohash: murmur: Suppress sanitize warnings under GCC
Anatol Belski [Sun, 1 Nov 2020 20:20:55 +0000 (21:20 +0100)]
hash: murmur: Suppress sanitize warnings under GCC

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoBump minimal OpenSSL version to 1.0.2
Jakub Zelenka [Sat, 10 Oct 2020 20:02:26 +0000 (21:02 +0100)]
Bump minimal OpenSSL version to 1.0.2

4 years agoUPGRADING: Add murmurhash note [ci skip]
Anatol Belski [Sat, 31 Oct 2020 18:19:00 +0000 (19:19 +0100)]
UPGRADING: Add murmurhash note [ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoNEWS: Add murmurhash info [ci skip]
Anatol Belski [Sat, 31 Oct 2020 17:50:30 +0000 (18:50 +0100)]
NEWS: Add murmurhash info [ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
4 years agohash: Add MurmurHash3 with streaming support
Anatol Belski [Sun, 30 Aug 2020 12:14:04 +0000 (14:14 +0200)]
hash: Add MurmurHash3 with streaming support

The implementation is based on the upstream PMurHash. The following
variants are implemented

- murmur3a, 32-bit hash
- murmur3c, 128-bit hash for x86
- murmur3f, 128-bit hash for x64

The custom seed support is not targeted by this implementation. It will
need a major change to the API, so then custom arguments can be passed
through `hash_init`. For now, the starting hash is always zero.

Fixes bug #68109, closes #6059

Signed-off-by: Anatol Belski <ab@php.net>
Co-Developed-by: Michael Wallner <mike@php.net>
Signed-off-by: Michael Wallner <mike@php.net>
4 years agoAdd test suite for CP1252 encoding
Alex Dowad [Sun, 18 Oct 2020 12:41:40 +0000 (14:41 +0200)]
Add test suite for CP1252 encoding

Also remove a bogus test (bug62545.phpt) which wrongly assumed that all invalid
characters in CP1251 and CP1252 should map to Unicode 0xFFFD (REPLACEMENT
CHARACTER).

mbstring has an interface to specify what invalid characters should be
replaced with; it's called `mb_substitute_character`. If a user wants to see
the Unicode 'replacement character', they can specify that using
`mb_substitute_character`. But if they specify something else, we should
follow that.

4 years agoFix mbstring support for CP1252 encoding
Alex Dowad [Sun, 18 Oct 2020 12:56:32 +0000 (14:56 +0200)]
Fix mbstring support for CP1252 encoding

It's a bit surprising how much was broken here.

- Identify filter was utterly and completely wrong.
- Instead of handling invalid CP1252 bytes as specified by
  `mb_substitute_character`, it would convert them to Unicode 0xFFFD
  (generic replacement character).
- When converting ISO-8859-1 to CP1252, invalid ISO-8859-1 bytes would
  be passed through silently.
- Unicode codepoints from 0x80-0x9F were converted to CP1252 bytes 0x80-0x9F,
  which is wrong.
- Unicode codepoint 0xFFFD was converted to CP1252 0x9F, which is very wrong.

Also clean up some unneeded code, and make the conversion table consistent with
others by using zero as a 'invalid' marker, rather than 0xFFFD.

4 years agoMerge branch 'PHP-8.0'
Alex Dowad [Fri, 30 Oct 2020 20:12:00 +0000 (22:12 +0200)]
Merge branch 'PHP-8.0'

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 agoMerge branch 'PHP-8.0'
Alex Dowad [Fri, 30 Oct 2020 20:07:41 +0000 (22:07 +0200)]
Merge branch 'PHP-8.0'

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 agoAdd --repeat testing mode
Nikita Popov [Wed, 21 Oct 2020 13:01:47 +0000 (15:01 +0200)]
Add --repeat testing mode

This testing mode executes the test multiple times in the same
process (but in different requests). It is primarily intended to
catch tracing JIT bugs, but also catches state leaks across
requests.

Closes GH-6365.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 30 Oct 2020 16:24:02 +0000 (17:24 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  FIxed bug #80299

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-8.0'
Nikita Popov [Fri, 30 Oct 2020 14:52:59 +0000 (15:52 +0100)]
Merge branch 'PHP-8.0'

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

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-8.0'
Christoph M. Becker [Fri, 30 Oct 2020 14:50:17 +0000 (15:50 +0100)]
Merge branch 'PHP-8.0'

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

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 30 Oct 2020 11:39:47 +0000 (12:39 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix signed integer overflow

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 agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 30 Oct 2020 10:13:44 +0000 (11:13 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80290

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 agoMerge branch 'PHP-8.0'
Dmitry Stogov [Fri, 30 Oct 2020 10:10:08 +0000 (13:10 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Create TSSA loops for recursive call/return traces and move invariant type guards out of loops.

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 agoUse constant size string in hash bench.php
divinity76 [Tue, 27 Oct 2020 15:19:58 +0000 (16:19 +0100)]
Use constant size string in hash bench.php

I don't like the previous behaviour where the bytes to hash change
every time the code changes, that may make it difficult to compare
hash() performance changes over time.

Use a fixed number instead, and allow passing an override for a
different length.

Closes GH-6386.

[ci skip]

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

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

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-8.0'
Nikita Popov [Thu, 29 Oct 2020 13:18:22 +0000 (14:18 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Handle errors during PDO row fetch

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-8.0'
Christoph M. Becker [Thu, 29 Oct 2020 12:11:00 +0000 (13:11 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix format specifier

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-8.0'
Nikita Popov [Thu, 29 Oct 2020 11:47:32 +0000 (12:47 +0100)]
Merge branch 'PHP-8.0'

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

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-8.0'
Christoph M. Becker [Thu, 29 Oct 2020 11:16:41 +0000 (12:16 +0100)]
Merge branch 'PHP-8.0'

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

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-8.0'
Christoph M. Becker [Thu, 29 Oct 2020 11:04:21 +0000 (12:04 +0100)]
Merge branch 'PHP-8.0'

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

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-8.0'
Nikita Popov [Thu, 29 Oct 2020 09:40:10 +0000 (10:40 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Retain QUIT_SEND connection state

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-8.0'
Nikita Popov [Wed, 28 Oct 2020 16:15:51 +0000 (17:15 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #65825

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