]> granicus.if.org Git - php/log
php
4 years agoHandle out-of-bounds offset consistently in grapheme_* API
Nikita Popov [Tue, 22 Sep 2020 15:01:06 +0000 (17:01 +0200)]
Handle out-of-bounds offset consistently in grapheme_* API

Make sure we throw the same kind of error regardless of whether
the offset is out-of-bounds in the fast path or in the slow
path.

4 years agoFix grapheme out of bounds check
Nikita Popov [Tue, 22 Sep 2020 14:35:53 +0000 (16:35 +0200)]
Fix grapheme out of bounds check

An offset equal to the string length is not out of bounds.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Tue, 22 Sep 2020 14:14:03 +0000 (16:14 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #76943: Inconsistent stream_wrapper_restore() errors

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 22 Sep 2020 14:11:56 +0000 (16:11 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #76943: Inconsistent stream_wrapper_restore() errors

4 years agoFix #76943: Inconsistent stream_wrapper_restore() errors
Christoph M. Becker [Tue, 22 Sep 2020 11:01:32 +0000 (13:01 +0200)]
Fix #76943: Inconsistent stream_wrapper_restore() errors

If restoring of any not registered built-in wrapper is requested, the
function is supposed to fail with a warning, so we have to check this
condition first.

Furthermore, to be able to detect whether a built-in wrapper has been
changed, it is not sufficient to check whether *any* userland wrapper
has been registered, but rather whether the specific wrapper has been
modified.

Closes GH-6183.

4 years agoSkip IMAP test which chokes on ASAN build
George Peter Banyard [Tue, 22 Sep 2020 13:43:31 +0000 (14:43 +0100)]
Skip IMAP test which chokes on ASAN build

4 years agoPromote pack/unpack format errors
Nikita Popov [Tue, 22 Sep 2020 12:08:13 +0000 (14:08 +0200)]
Promote pack/unpack format errors

Errors related to invalid format strings (unlike data mismatch
errors) should throw ValueError.

Closes GH-6185.

4 years agoConvert unpack offset warning to ValueError
Nikita Popov [Tue, 22 Sep 2020 12:00:48 +0000 (14:00 +0200)]
Convert unpack offset warning to ValueError

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Tue, 22 Sep 2020 11:19:06 +0000 (13:19 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #79423: copy command is limited to size of file it can copy

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 22 Sep 2020 11:16:42 +0000 (13:16 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79423: copy command is limited to size of file it can copy

4 years agoFix #79423: copy command is limited to size of file it can copy
Christoph M. Becker [Wed, 9 Sep 2020 17:21:41 +0000 (19:21 +0200)]
Fix #79423: copy command is limited to size of file it can copy

Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong
results for files larger than 0xFFFFFFFF bytes.  We fix this by using
`GetFileSizeEx()`, and let the mapping fail, if the file size is too
large for the architecture.

Closes GH-5319.

4 years agoUse C zpp for get_class_vars()
Nikita Popov [Tue, 22 Sep 2020 11:05:05 +0000 (13:05 +0200)]
Use C zpp for get_class_vars()

4 years agoSupport uuencoding empty string
Nikita Popov [Tue, 22 Sep 2020 10:39:39 +0000 (12:39 +0200)]
Support uuencoding empty string

Cross checking implementations from other languages, empty strings
are always allowed. PHP's output is peculiar due to it's insistence
to encode a trailing \0, but otherwise sensible and does round-trip
as expected.

4 years agostream_bucket_new() cannot return false
Nikita Popov [Tue, 22 Sep 2020 10:07:53 +0000 (12:07 +0200)]
stream_bucket_new() cannot return false

php_stream_bucket_new() is infallible.

4 years agostream_get_transports/wrappers cannot return false
Nikita Popov [Tue, 22 Sep 2020 10:02:39 +0000 (12:02 +0200)]
stream_get_transports/wrappers cannot return false

These may return an empty array, but not false.

4 years agoDon't return false for empty string in soundex()
Nikita Popov [Tue, 22 Sep 2020 09:42:50 +0000 (11:42 +0200)]
Don't return false for empty string in soundex()

Return "0000" instead of false to have a consistent return type.
"0000" is already a possible return value if the string doesn't
contain any letters, such as with soundex(" "). We can treat the
case of soundex("") exactly the same.

4 years agoSkip if https wrapper isn't present
Levi Morrison [Tue, 22 Sep 2020 09:36:32 +0000 (03:36 -0600)]
Skip if https wrapper isn't present

4 years agohttp_build_query() cannot fail
Nikita Popov [Tue, 22 Sep 2020 09:30:02 +0000 (11:30 +0200)]
http_build_query() cannot fail

Assert that ht is not null and make php_url_encode_hash_ex() return
void to clarify that this is an infallible function.

4 years agohtml_entity_decode() cannot fail
Nikita Popov [Tue, 22 Sep 2020 09:23:01 +0000 (11:23 +0200)]
html_entity_decode() cannot fail

php_unescape_html_entities() never returns null, so this function
can never return false.

php_unescape_html_entities() probably should be failing with OOM
for the "overflow" case, but even if it did, it would not be
signalled through a false return value.

4 years agoValidate phonemes parameter of metaphone()
Nikita Popov [Tue, 22 Sep 2020 09:19:02 +0000 (11:19 +0200)]
Validate phonemes parameter of metaphone()

And thus avoid the false return value.

4 years agosubstr_compare() cannot return false
Nikita Popov [Tue, 22 Sep 2020 08:54:44 +0000 (10:54 +0200)]
substr_compare() cannot return false

4 years agoCheck string bounds in strspn/strcspn
Nikita Popov [Tue, 22 Sep 2020 08:42:24 +0000 (10:42 +0200)]
Check string bounds in strspn/strcspn

strspn/strcspn are string search functions, and as such should throw
ValueError on out-of-bounds offsets, just like strpos etc do.

4 years agoPromote substr_replace warnings
Nikita Popov [Tue, 22 Sep 2020 08:22:43 +0000 (10:22 +0200)]
Promote substr_replace warnings

The implementation here was pretty confused. In reality the only
error condition it has right now is that for a string input,
from & length cannot be arrays.

The fact that the array lengths are the same was probably supposed
to be checked for the case of array input, as it wouldn't matter
otherwise.

4 years agosubstr_replace() cannot return false
Nikita Popov [Tue, 22 Sep 2020 07:59:25 +0000 (09:59 +0200)]
substr_replace() cannot return false

4 years agoFixed minor typo in comment
Ikko Ashimine [Tue, 22 Sep 2020 01:49:59 +0000 (10:49 +0900)]
Fixed minor typo in comment

Initiailize -> Initialize

Closes GH-6181.

4 years agoFixed INIT_METHOD_CALL + IS_VAR + reference in tracing JIT
Dmitry Stogov [Mon, 21 Sep 2020 21:47:23 +0000 (00:47 +0300)]
Fixed INIT_METHOD_CALL + IS_VAR + reference in tracing JIT

4 years agoFixed incorrect assumption about sizeof(zend_reference)
Dmitry Stogov [Mon, 21 Sep 2020 20:58:18 +0000 (23:58 +0300)]
Fixed incorrect assumption about sizeof(zend_reference)

4 years agoFiced 32-bit JIT (inconsistent CPU stack state)
Dmitry Stogov [Mon, 21 Sep 2020 20:43:31 +0000 (23:43 +0300)]
Ficed 32-bit JIT (inconsistent CPU stack state)

4 years agoPromote count() warning to TypeError
George Peter Banyard [Mon, 21 Sep 2020 16:01:40 +0000 (17:01 +0100)]
Promote count() warning to TypeError

Closes GH-6180

4 years agoFixed incorrect JIT for FETCH_THIS+SEND_REF
Dmitry Stogov [Mon, 21 Sep 2020 18:53:03 +0000 (21:53 +0300)]
Fixed incorrect JIT for FETCH_THIS+SEND_REF

4 years agoDrop -1 mode for collator_is_numeric()
George Peter Banyard [Mon, 21 Sep 2020 14:38:26 +0000 (15:38 +0100)]
Drop -1 mode for collator_is_numeric()

It is used only once with allow_errors enabled

4 years agoDrop Hex support in numeric strings for Intl collator
George Peter Banyard [Mon, 21 Sep 2020 14:33:23 +0000 (15:33 +0100)]
Drop Hex support in numeric strings for Intl collator

Support for this was removed in PHP 7.0.

See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings

4 years agoReturn empty array for no rows in pg_fetch_all()
Nikita Popov [Mon, 21 Sep 2020 15:20:28 +0000 (17:20 +0200)]
Return empty array for no rows in pg_fetch_all()

This makes it line up with pg_fetch_all_columns(), as well as
similar functions in other exts, such as mysqli_fetch_all().

4 years agoThrow warning for failed object to int/float conversion
Nikita Popov [Mon, 21 Sep 2020 09:07:42 +0000 (11:07 +0200)]
Throw warning for failed object to int/float conversion

We previously couldn't increase the error level here because it
was coupled to comparison handling. This is no longer the case
in PHP 8.

4 years agoConvert exception instanceof checks to assertions
Nikita Popov [Mon, 21 Sep 2020 09:05:19 +0000 (11:05 +0200)]
Convert exception instanceof checks to assertions

4 years agoMake constant redeclaration a warning
Nikita Popov [Mon, 21 Sep 2020 09:02:09 +0000 (11:02 +0200)]
Make constant redeclaration a warning

We missed the change to make this an Error exception in PHP 8,
but at least elevate it to a warning, to avoid a notice -> exception
jump at a later time.

4 years agoPromote invalid field to ValueError in pgsql
Nikita Popov [Mon, 21 Sep 2020 14:11:50 +0000 (16:11 +0200)]
Promote invalid field to ValueError in pgsql

The same error condition is a ValueError in mysqli, be consistent.

Additionally, do not display the argument name for these errors.
As the signatures are overloaded, the argument name may not match
the meaning at all.

4 years agoRemove redundant check
Nikita Popov [Mon, 21 Sep 2020 13:59:44 +0000 (15:59 +0200)]
Remove redundant check

This was already checked directly above.

4 years agoCheck linker compatibility directly from HMODULE
Christoph M. Becker [Wed, 5 Aug 2020 06:59:41 +0000 (08:59 +0200)]
Check linker compatibility directly from HMODULE

Checking the linker compatibility with extranous `ImageLoad()` calls is
possible, but unnecessary, since the modules are either already loaded
or loaded shortly afterwards, so that we can get the required
information directly from the module handles.  And actually, doing
`ImageLoad()` as well as `LoadLibrary()` leaves a tiny room for a race
condition, because both functions will lookup the module in the search
path, so there is no *guarantee* that both are dealing with the same
module.  Dropping the `ImageLoad()` calls also has the advantage to no
longer face the issue reported in bug #79557.  A very minor additional
advantage is that we no longer have to link against Imagehlp.dll.

Furthermore, there is no need to check for CRT compatibility multiple
times, so we can simplify the signature of `php_win32_crt_compatible`,
and at the same time clean up main.c a bit.

These changes require to change the signature of the exported
`php_win32_image_compatible` and `php_win32_crt_compatible` functions,
which now expect a `HMODULE` and nothing, respectively, instead of the
module name.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Mon, 21 Sep 2020 14:09:17 +0000 (16:09 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix mmap copying

4 years agoFix mmap copying
Christoph M. Becker [Mon, 21 Sep 2020 11:57:05 +0000 (13:57 +0200)]
Fix mmap copying

Instead of attempting to map large files into memory at once, we map
chunks of at most `PHP_STREAM_MMAP_MAX` bytes, and repeat that until we
hit the point where `php_stream_seek()` fails (see bug 54902), and copy
the rest of the file by reading and writing small chunks.

We also fix the mapping behavior for zero bytes on Windows, which did
not error (as with `mmap()`), but would have mapped the remaining file.

4 years agoFix a few Iterator signatures
Máté Kocsis [Mon, 21 Sep 2020 12:47:54 +0000 (14:47 +0200)]
Fix a few Iterator signatures

Closes GH-6176

4 years agoDrop some connection retries in IMAP test
George Peter Banyard [Mon, 21 Sep 2020 13:48:02 +0000 (14:48 +0100)]
Drop some connection retries in IMAP test

They are unnecessary and just take time for no good reason

4 years agopg_unescape_bytea() can only fail on OOM
Nikita Popov [Mon, 21 Sep 2020 13:46:55 +0000 (15:46 +0200)]
pg_unescape_bytea() can only fail on OOM

The implementation did not check for PQunescapeBytea failure
correctly, because it checked for a null pointer after estrndup,
which certainly cannot happen. Inspection of the PGunescapeBytea
implementation has shown that this function can only fail on OOM,
so let's check for that explicitly and remove false as a possible
return type.

While we're here, avoid an unnecessary copy of the result.

4 years agoPromote PDORow property write to Error
Nikita Popov [Mon, 21 Sep 2020 13:29:10 +0000 (15:29 +0200)]
Promote PDORow property write to Error

4 years agoRemove dead code
Nikita Popov [Mon, 21 Sep 2020 13:22:47 +0000 (15:22 +0200)]
Remove dead code

The "if ever" here is the relevant bit...

4 years agoPromote warnings to Error in COM extension
George Peter Banyard [Wed, 16 Sep 2020 00:03:46 +0000 (02:03 +0200)]
Promote warnings to Error in COM extension

Closes GH-6141

4 years agoSynchronize GET_CLASS/GET_CALLED_CLASS opcodes with functions
Nikita Popov [Mon, 21 Sep 2020 13:05:03 +0000 (15:05 +0200)]
Synchronize GET_CLASS/GET_CALLED_CLASS opcodes with functions

These error conditions throw in the function implementations,
make the opcodes match.

4 years agoAssert on unknown list entry type
Nikita Popov [Mon, 21 Sep 2020 12:58:23 +0000 (14:58 +0200)]
Assert on unknown list entry type

4 years agoRemove unnecessary check
Nikita Popov [Mon, 21 Sep 2020 12:56:14 +0000 (14:56 +0200)]
Remove unnecessary check

We should only produce IS_UNDEF if an exception is thrown, this
check is not needed.

4 years agoUse proper parameter type in Closure::bindTo() signature
Nikita Popov [Mon, 21 Sep 2020 12:45:31 +0000 (14:45 +0200)]
Use proper parameter type in Closure::bindTo() signature

4 years agoImprove default value handling of Exception constructors
Máté Kocsis [Sat, 19 Sep 2020 12:13:42 +0000 (14:13 +0200)]
Improve default value handling of Exception constructors

Closes GH-6166

4 years agoMove arm64 job to cron
Nikita Popov [Mon, 21 Sep 2020 10:42:48 +0000 (12:42 +0200)]
Move arm64 job to cron

As we're branching soon, reduce the number of jobs we run on each
commit, so that Travis can keep up with its role as the fast
feedback build.

4 years agoFix detection of code outside namespace
Nikita Popov [Mon, 21 Sep 2020 10:37:44 +0000 (12:37 +0200)]
Fix detection of code outside namespace

Due to improvements to early binding, the opcode based check is
no longer accurate. Reuse the syntactic check we're already using
for declares instead.

4 years agoUse assertion for null-termination string
Nikita Popov [Mon, 21 Sep 2020 10:12:51 +0000 (12:12 +0200)]
Use assertion for null-termination string

Indicates an implementation bug, make sure we can automatically
detect it.

4 years agoStandardize mbstring and string on using 'string' as a parameter name.
Larry Garfield [Sun, 20 Sep 2020 00:04:49 +0000 (19:04 -0500)]
Standardize mbstring and string on using 'string' as a parameter name.

Closes GH-6171.

4 years agoDeprecate pgsql function aliases
Nikita Popov [Mon, 21 Sep 2020 09:32:00 +0000 (11:32 +0200)]
Deprecate pgsql function aliases

These have been documentation-deprecated for a very long time,
make it official.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Mon, 21 Sep 2020 09:27:51 +0000 (11:27 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix memory leak in php_imap_mutf7()

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 21 Sep 2020 09:26:41 +0000 (11:26 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix memory leak in php_imap_mutf7()

4 years agoFix memory leak in php_imap_mutf7()
Christoph M. Becker [Mon, 21 Sep 2020 09:21:46 +0000 (11:21 +0200)]
Fix memory leak in php_imap_mutf7()

We have to free the string which has been allocated by libc-client.

4 years agoInitialize attributes for internal functions
Nikita Popov [Mon, 21 Sep 2020 08:50:29 +0000 (10:50 +0200)]
Initialize attributes for internal functions

Fixes a crash in Symfony SecurityBundle tests.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Mon, 21 Sep 2020 08:29:36 +0000 (10:29 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #80118: Erroneous whitespace match with JIT only

4 years agoFix #80118: Erroneous whitespace match with JIT only
Christoph M. Becker [Sat, 19 Sep 2020 10:37:57 +0000 (12:37 +0200)]
Fix #80118: Erroneous whitespace match with JIT only

We backport r1273[1] from PCRE2.

[1] <https://vcs.pcre.org/pcre2?revision=1273&view=revision>

Closes GH-6165.

4 years agoAdd support for `@implementation-alias` in stubs
Máté Kocsis [Sat, 19 Sep 2020 18:13:08 +0000 (20:13 +0200)]
Add support for `@implementation-alias` in stubs

Closes GH-6170

4 years agoUpdate README for how to setup IMAP tests
George Peter Banyard [Sun, 20 Sep 2020 21:20:28 +0000 (22:20 +0100)]
Update README for how to setup IMAP tests

This details which packages needs to be installed on Ubuntun 18.04,
which configure flags are necessary and what the setup.sh shell script does.

4 years agoConsolidate the usage of "either" and "one of" in error messages
Máté Kocsis [Sun, 20 Sep 2020 08:41:10 +0000 (10:41 +0200)]
Consolidate the usage of "either" and "one of" in error messages

Closes GH-6173

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Sun, 20 Sep 2020 13:38:18 +0000 (15:38 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #80114: parse_url does not accept URLs with port 0

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Sun, 20 Sep 2020 13:36:30 +0000 (15:36 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80114: parse_url does not accept URLs with port 0

4 years agoFix #80114: parse_url does not accept URLs with port 0
Christoph M. Becker [Sun, 20 Sep 2020 11:45:09 +0000 (13:45 +0200)]
Fix #80114: parse_url does not accept URLs with port 0

URIs with a 0 port are generally valid, so `parse_url()` should
recognize such URIs, but still report the port as missing.

Co-authored-by: twosee <twose@qq.com>
Closes GH-6152.

4 years agoOnly check linking in PHP_TEST_BUILD
Nikita Popov [Sun, 20 Sep 2020 08:24:54 +0000 (10:24 +0200)]
Only check linking in PHP_TEST_BUILD

Given that this executes a random function with zero parameters,
actually executing the code doesn't make sense.

This should fix the imap + asan build.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Sun, 20 Sep 2020 08:03:10 +0000 (10:03 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix mysqli build with mysqlnd and without PDO

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Sun, 20 Sep 2020 08:02:32 +0000 (10:02 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix mysqli build with mysqlnd and without PDO

4 years agoFix mysqli build with mysqlnd and without PDO
Bob Weinand [Sun, 20 Sep 2020 00:57:39 +0000 (02:57 +0200)]
Fix mysqli build with mysqlnd and without PDO

4 years agoFix mysqli build with mysqlnd and without PDO
Bob Weinand [Sun, 20 Sep 2020 00:57:39 +0000 (02:57 +0200)]
Fix mysqli build with mysqlnd and without PDO

4 years agoSeparate Closure::bind() implementations
Máté Kocsis [Sat, 19 Sep 2020 17:04:35 +0000 (19:04 +0200)]
Separate Closure::bind() implementations

Closure::bind() and Closure::bindTo() are currently reported as aliases in stubs because they have a single implementation. They are not aliases in fact though, they just use zend_parse_method_parameters() cleverly.

Thus, let's separate their implementation so that we don't have to alias Closure::bindTo() anymore. This will also have the advantage that the two ZPP implementations become more clear.

Closes GH-6169

4 years agoFix UNKNOWN default value of apache_note()
Máté Kocsis [Sat, 19 Sep 2020 12:35:37 +0000 (14:35 +0200)]
Fix UNKNOWN default value of apache_note()

Closes GH-6167

4 years agoAdjust the order of method modifiers in stub
Máté Kocsis [Sat, 19 Sep 2020 10:31:36 +0000 (12:31 +0200)]
Adjust the order of method modifiers in stub

All the other method modifiers in stubs follow the guidelines of PSR-12, so let's use it in case of PhpToken::__construct() as well.

4 years agoAdd system ID entropy API
Sammy Kaye Powers [Thu, 16 Jul 2020 23:31:10 +0000 (16:31 -0700)]
Add system ID entropy API

The `zend_system_id` is a (true global) system ID that fingerprints a process state. When extensions add engine hooks during MINIT/startup, entropy is added the system ID for each hook. This allows extensions to identify that changes have been made to the engine since the last PHP process restart.

Closes GH-5871

4 years agoFix IMAP tests
George Peter Banyard [Fri, 18 Sep 2020 13:34:37 +0000 (15:34 +0200)]
Fix IMAP tests

Drop various ZPP checks and make them PASS
Add CONFLICT file as the tests all hit the same mailbox

4 years agoSet-up IMAP in Azure
George Peter Banyard [Thu, 17 Sep 2020 15:22:01 +0000 (17:22 +0200)]
Set-up IMAP in Azure

Closes GH-6162

4 years agoFix some tests for libmysql
Nikita Popov [Thu, 17 Sep 2020 13:55:44 +0000 (15:55 +0200)]
Fix some tests for libmysql

4 years agoDrop skipifemb.inc
Nikita Popov [Fri, 18 Sep 2020 13:49:35 +0000 (15:49 +0200)]
Drop skipifemb.inc

And drop the last remaining uses of it.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 18 Sep 2020 13:30:13 +0000 (15:30 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78179: mysqli/mysqlnd transaction extensions

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 18 Sep 2020 13:30:06 +0000 (15:30 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78179: mysqli/mysqlnd transaction extensions

4 years agoFix #78179: mysqli/mysqlnd transaction extensions
Daniel Black [Tue, 21 Jul 2020 06:23:14 +0000 (16:23 +1000)]
Fix #78179: mysqli/mysqlnd transaction extensions

MariaDB versioning created a mess with regarding testing
features based on version. We sidestep the problem here
by assuming the extensions are present, and if a syntax
error occurs with a SQL mode TRANS_START_READ_WRITE |
TRANS_START_READ_ONLY enabled, then output the same
warning as before.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 18 Sep 2020 13:26:04 +0000 (15:26 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Support NO_BACKSLASH_ESCAPES with newer libmysqlclient

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 18 Sep 2020 13:25:35 +0000 (15:25 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Support NO_BACKSLASH_ESCAPES with newer libmysqlclient

4 years agoSupport NO_BACKSLASH_ESCAPES with newer libmysqlclient
Nikita Popov [Fri, 18 Sep 2020 08:29:28 +0000 (10:29 +0200)]
Support NO_BACKSLASH_ESCAPES with newer libmysqlclient

Requires the use of mysql_real_escape_string_quote().

4 years agomysqli_set_charset now throws an mysqli_sql_exception when incorrect charset is provided
Dharman [Wed, 16 Sep 2020 13:20:03 +0000 (14:20 +0100)]
mysqli_set_charset now throws an mysqli_sql_exception when incorrect charset is provided

Closes GH-6142.

4 years agoAssert that all switch cases are covered
Nikita Popov [Fri, 18 Sep 2020 10:25:29 +0000 (12:25 +0200)]
Assert that all switch cases are covered

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 18 Sep 2020 12:50:11 +0000 (14:50 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Use MyISAM engine for new test

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 18 Sep 2020 12:50:02 +0000 (14:50 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Use MyISAM engine for new test

4 years agoUse MyISAM engine for new test
Nikita Popov [Fri, 18 Sep 2020 12:26:34 +0000 (14:26 +0200)]
Use MyISAM engine for new test

Travis on 7.3 is showing this error:

> The size of BLOB/TEXT data inserted in one transaction is greater
> than 10% of redo log size. Increase the redo log size using
> innodb_log_file_size.

Force MyISAM engine to avoid this.

4 years agoRun tidy
Nikita Popov [Fri, 18 Sep 2020 12:28:32 +0000 (14:28 +0200)]
Run tidy

This should fix most of the remaining issues with tabs and spaces
being mixed in tests.

4 years agoApply tidy to SKIPIF and CLEAN section as well
Nikita Popov [Fri, 18 Sep 2020 10:17:07 +0000 (12:17 +0200)]
Apply tidy to SKIPIF and CLEAN section as well

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 18 Sep 2020 10:59:10 +0000 (12:59 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #80107: Handling of large compressed packets
  Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 18 Sep 2020 10:56:11 +0000 (12:56 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #80107: Handling of large compressed packets
  Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled

4 years agoFix bug #80107: Handling of large compressed packets
Nikita Popov [Wed, 16 Sep 2020 14:18:29 +0000 (16:18 +0200)]
Fix bug #80107: Handling of large compressed packets

There's two layers of packet splitting going on. First, packets
need to be split into having a payload of exactly 2^24-1 bytes or
being the last packet. If the split packet has size between 2^24-5
and 2^24-1 bytes, the compressed packets also needs to be split,
though the choice of split doesn't matter here. I'm splitting off
the first 8192 bytes, as that's what I observe libmysqlclient to be
doing.

4 years agoBug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression...
Máté Kocsis [Tue, 15 Sep 2020 17:14:57 +0000 (19:14 +0200)]
Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled

4 years agoCleanup observer API and add JIT support
Dmitry Stogov [Fri, 18 Sep 2020 09:55:58 +0000 (12:55 +0300)]
Cleanup observer API and add JIT support