Commit Graph

1709 Commits

Author SHA1 Message Date
Christoph M. Becker
0ab53f1636 Bring back test case support for older MySQL versions
These test cases have recently been adjusted to work with MySQL 8[1],
but some older, but still supported database versions, such as MySQL
5.6, still need the password to be sent hashed, so we fall back to
using `PASSWORD()`, if the `SET PASSWORD` query fails without it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b0efd18f7844da29931737b8a1cf461c7493e168>.
2020-01-11 11:21:26 +01:00
Nikita Popov
b0efd18f78 Don't use PASSWORD() function in test
Doesn't exist anymore in MySQL 8.
2019-12-27 17:26:15 +01:00
Nikita Popov
23d4659635 Skip bug77956.phpt if local_infile disabled on server 2019-12-27 17:25:53 +01:00
Nikita Popov
6572d9149d Don't check TIMESTAMP NOT NULL in fetch_field_flags test
The behavior of this is very dependent on the MySQL vendor, MySQL
version and MySQL configuration, in particular the
explicit_defaults_for_timestamp variable.

I don't think it's worthwhile to try and model this exactly, so
drop the test.
2019-12-27 17:25:23 +01:00
Nikita Popov
c4cbdfa99c Don't test the RENAME DATABASE query
Apparently this only existed for a short time, because it was
found to be insecure. Don't try to test it.
2019-12-27 17:25:12 +01:00
Nikita Popov
f97806726f Make GeomFromText tests compatible with MySQL 8
The function has been renamed to ST_GeomFromText.
2019-12-27 17:25:01 +01:00
Nikita Popov
6b7cb4a8d7 Fix mysqli ssl tests
First, make sure the tests are skipped if we connect via unix
socket, as we can't use SSL in that case.

Second, use a cipher that is not blacklisted in current MySQL
versions.
2019-12-05 08:38:40 +01:00
Christoph M. Becker
60081ca20d Fix test cases which fail on Windows debug builds
We use the portable {TMP} instead of the hard-coded /tmp, and skip
mysqli_debug_append.phpt on Windows, because unlinking the trace file
while the connection is still open won't work there.
2019-11-11 12:14:38 +01:00
Nikita Popov
f085bddb51 Fix number of required arguments in arginfo
* pack() only requires one argument
* stream_context_set_option() only requires two arguments
* ReflectionMethod::getClosure() accepts no args for static methods
* DOMDocument::createProcessingInstruction() only requires one arg
* DOMImplementation::createDocument() only requires two arguments
* DOMDocument::importNode() only requires one arg
* mysql_get_client_version() doesn't accept any args,
  despite what the docs say...
2019-10-07 16:32:11 +02:00
Joe Watkins
5a8e7b95a1
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #76809 (SSL settings aren't respected when persistent connection is reused)
2019-10-03 07:13:15 +02:00
Joe Watkins
f4d078b1c7
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #76809 (SSL settings aren't respected when persistent connection is reused)
2019-10-03 06:57:05 +02:00
Fábio Souto
9a2b42a5c1
Fix bug #76809 (SSL settings aren't respected when persistent connection is reused) 2019-10-03 06:56:21 +02:00
Dmitry Stogov
3709c03cda Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed test that "fails" from time to time
2019-10-02 00:57:26 +03:00
Dmitry Stogov
f7596d1b5b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed test that "fails" from time to time
2019-10-02 00:57:16 +03:00
Dmitry Stogov
3124129ca8 Fixed test that "fails" from time to time 2019-10-02 00:54:59 +03:00
Dmitry Stogov
5fb2f15824 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed test that "fails" from time to time
2019-10-02 00:49:37 +03:00
Dmitry Stogov
848bc776ea Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed test that "fails" from time to time
2019-10-02 00:49:27 +03:00
Dmitry Stogov
2fcb5eadbb Fixed test that "fails" from time to time 2019-10-02 00:48:42 +03:00
Fabien Villepinte
0aa3acc6c4 Fix borked SKIPIFs 2019-09-30 17:51:41 +02:00
Christoph M. Becker
d90711138b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix SKIPIF in ext/mysqli
2019-09-27 16:04:35 +02:00
Christoph M. Becker
66c48e8694 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix SKIPIF in ext/mysqli
2019-09-27 16:04:00 +02:00
Fabien Villepinte
37d27e666a Fix SKIPIF in ext/mysqli 2019-09-27 16:03:20 +02:00
George Peter Banyard
e895e96286 Drop E_STRICT notice in mysqli extension 2019-08-31 23:14:10 +02:00
Fabien Villepinte
e1afd9b213 Modernize some connectors in tests to remove env key duplication 2019-08-30 10:33:01 +02:00
Christoph M. Becker
a18f53ec2c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix the problem for connect_attr, set db condition, and add a new attribute _server_host
2019-08-20 13:35:17 +02:00
Christoph M. Becker
3771d66142 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix the problem for connect_attr, set db condition, and add a new attribute _server_host
2019-08-20 13:33:45 +02:00
Qianqian Bu
cdf16c010a fix the problem for connect_attr, set db condition, and add a new attribute _server_host 2019-08-20 13:31:58 +02:00
Christoph M. Becker
053df4ac3b Fix tests
Apparently, nobody is testing with MySQL < 5.6 for quite a while.  We
should consider dropping support for these very old versions.
2019-07-30 16:32:49 +02:00
George Peter Banyard
1a031a242c Renamed MySQLi test to remove duplicate 'mysqli_'
Closes GH-4441
2019-07-21 01:10:31 +02:00
George Peter Banyard
548d1ec27c Small typo and proto name fix
Closes GH-4415
2019-07-15 18:15:17 +02:00
Christoph M. Becker
a6fa097ceb No more need to cater to pre-PHP-5.3 or PHP-6 versions 2019-07-12 18:55:34 +02:00
Nikita Popov
852e35317d Additional fix for mysqli_fork test 2019-07-10 12:42:17 +02:00
Nikita Popov
a63422029e Fix invalid array access in mysqli_fork test 2019-07-10 11:59:27 +02:00
Pieter Hordijk
6ab04a6eef
Removed mysqlnd stats from phpinfo page
All information can already be retrieved using the APIs at https://www.php.net/manual/en/mysqlnd.stats.php. Closes https://bugs.php.net/bug.php?id=60594
2019-07-03 08:20:54 +02:00
Nikita Popov
c0bf3bc50c Update error message in libmysql test 2019-06-28 14:46:30 +02:00
Sebastian Pop
70ef87539d Fix compilation errors when building against libmysql
Closes GH-4316.
2019-06-28 14:46:12 +02:00
Nikita Popov
2f0f895284 Fix persistent connection leak in mysqli 2019-06-27 09:45:32 +02:00
Derick Rethans
579562176b Fixed bug #67348: Reading $dbc->stat modifies $dbc->affected_rows 2019-06-21 16:51:52 +01:00
Andrey Hristov
65915d44cb Merge branch 'PHP-7.3' into PHP-7.4 2019-06-19 16:43:15 +03:00
Andrey Hristov
7ba1e6b34d Merge branch 'PHP-7.2' into PHP-7.3 2019-06-19 16:43:06 +03:00
Andrey Hristov
82021ad9df Fix version comparison 2019-06-19 16:42:43 +03:00
Nikita Popov
83e0bfb50c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-11 15:41:05 +02:00
Tyson Andre
5d3e3a62a2 Be more precise about possible types for mysqli methods
mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms to a string.
This is documented at
https://www.php.net/manual/en/mysqli-stmt.affected-rows.php#refsect1-mysqli-stmt.affected-rows-returnvalues

So if there's a query to a remote mysqli server that affects
more than 2.2 billion rows, then the opcache inference might be
incorrect.

(It's possible to add a MAY_BE_STRING_ON_32_BIT_PLATFORM bitflag macro to
account for this, but I don't think there's a need or want to?)

Patches 3162285b86

This is based on the list of php 7.4 functions using
MYSQLI_RETURN_LONG_INT in mysqli_api.c
2019-06-11 15:40:33 +02:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
9cf6a5413a Make mysqli_connect arguments explicitly nullable
It should be possible to skip any of these (and use the ini configured
defaults) by passing null, independently of strict_types settings.

Noticed while working on GH-4227.
2019-06-05 11:30:13 +02:00
Nikita Popov
2856afc70e Make "MySQL server has gone away" errors more consistent
Don't generate explicit warnings for these in two places, use usual
error handling mechanism. Additionally suppress a number of warnings
if the server has gone away.
2019-06-03 14:27:47 +02:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Nikita Popov
7f68d5b7d8 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-22 12:45:25 +02:00
Nikita Popov
f308aa4e1e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-22 12:45:16 +02:00