summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in fetch_all error messageKamil Tekiela2021-03-282-2/+2
|
* Deprecate OO style mysqli::get_client_info methodDharman2021-03-172-2/+33
| | | | | | Deprecate passing connection object to mysqli_get_client_info() Closes GH-6777.
* Change the default error mode of mysqliDharman2021-03-152-0/+2
| | | | | | | | | | Make MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT the new mysqli error reporting default. Explicitly call mysqli_report(MYSQLI_REPORT_OFF) to preserve previous behavior. RFC: https://wiki.php.net/rfc/mysqli_default_errmode Closes GH-6629.
* Merge branch 'PHP-8.0'Nikita Popov2021-03-151-0/+38
|\ | | | | | | | | * PHP-8.0: Fix bug #80837
| * Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-03-151-0/+38
| |\ | | | | | | | | | | | | * PHP-7.4: Fix bug #80837
| | * Fix bug #80837Dharman2021-03-151-0/+38
| | | | | | | | | | | | The error needs to be reported on the statement, not the connection.
* | | Use typed properties in ext/mysqliMáté Kocsis2021-03-155-58/+4
| | | | | | | | | | | | Closes GH-6739
* | | Add CLEAN sections to mysqli and PDO mysql testsDharman2021-03-159-16/+57
| | | | | | | | | | | | Closes GH-6756.
* | | Deprecate mysqli driver_version propertyDharman2021-03-152-6/+2
| | | | | | | | | | | | | | | The driver version hasn't been updated in 13 years, so this number is essentially meaningless. Check PHP_VERSION_ID instead.
* | | Clean up mysqli_driver test casesDharman2021-03-153-171/+170
| | | | | | | | | | | | | | | And remove an unnecessary test case that is already covered by the other two.
* | | client_info is a constant and doesn't need a connectionDharman2021-03-152-11/+9
| | | | | | | | | | | | Closes GH-6767.
* | | Update mysqli tests to work with newer MySQL serverMax Semenik2021-03-044-23/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * @@session.old_passwords is present only in 5.6 and 5.7. Newer versions already behave as if they have old_passwords=2. * SET PASSWORD FOR ... = PASSWORD(...) syntax was removed in 8.0. For all affected tests, versions that don't support newer SQL are already explicitly excluded with version checks. Closes GH-6729.
* | | Add mechanism to skip the skipif cacheNikita Popov2021-03-044-0/+4
| | | | | | | | | | | | | | | | | | If the SKIPIF section return nocache, don't cache the result. This is used by tests that perform complex test set in conjunction with skip checks, and need to be evaluated every time.
* | | Explicitly print reference wrappers in debug_zval_dump()Nikita Popov2021-03-042-19/+51
| | | | | | | | | | | | Closes GH-6750.
* | | Fixed bug #80808Nikita Popov2021-03-022-2/+2
| | | | | | | | | | | | | | | | | | If the ZEROFILL flag is set for a field, do not convert it into an integer (text protocol) or convert it explicitly into a padded string (binary protocol).
* | | Change the order of properties used for var_dump(), serialize(), comparison, ↵Dmitry Stogov2021-03-011-6/+6
| | | | | | | | | | | | | | | | | | etc. Now properties are ordered according to their layout in zend_object structure.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-251-2/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: mysqlnd pam fix test error message
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-251-2/+2
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: mysqlnd pam fix test error message
| | * mysqlnd pam fix test error messageDaniel Black2021-02-251-2/+2
| | | | | | | | | | | | Closes GH-6727.
* | | Fix #80329: Add option to specify LOAD DATA LOCAL white list folderDarek Slusarczyk2021-02-2311-8/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allow the user to specify a folder where files that can be sent via LOAD DATA LOCAL can exist * add mysqli.local_infile_directory for mysqli (ignored if mysqli.allow_local_infile is enabled) * add PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY for pdo_mysql (ignored if PDO::MYSQL_ATTR_LOCAL_INFILE is enabled) * add related tests * fixes for building with libmysql 8.x * small improvement in existing tests * update php.ini-[development|production] files Closes GH-6448. Co-authored-by: Nikita Popov <nikic@php.net>
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-151-6/+46
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #78680: mysqlnd pam plugin missing terminating null
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-151-6/+46
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #78680: mysqlnd pam plugin missing terminating null
| | * Fix #78680: mysqlnd pam plugin missing terminating nullDaniel Black2021-02-151-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PAM service requires the terminating null to be part of the communication. Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat). Also changed MySQL Enterprise test to the server side plugin, authentication_pam as opposed to the client plugin mysql_clear_password. Add additional check for pamtest user and pam service file as all are required for the test. More importantly, test result should actually succeed. Thanks Geoff Montee for bug report. Closes GH-78680.
* | | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-114-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-051-3/+3
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: Fix test expectation for PHP 8.0 Use ST_Y() instead of the deprecated/removed Y() in test
| * | Fix test expectation for PHP 8.0Christoph M. Becker2021-02-051-1/+1
| | | | | | | | | | | | | | | Since float to string conversion is no longer locale dependent, we have to expect a dot as decimal separator.
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-051-2/+2
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Use ST_Y() instead of the deprecated/removed Y() in test
| | * Use ST_Y() instead of the deprecated/removed Y() in testChristoph M. Becker2021-02-051-2/+2
| | |
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-051-0/+42
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #74779: x() and y() truncating floats to integers
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-051-0/+42
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #74779: x() and y() truncating floats to integers
| | * Fix #74779: x() and y() truncating floats to integersChristoph M. Becker2021-02-051-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | We must not use the locale dependent `atof()`, but instead use the (hopefully) locale independent `zend_strtod()`, when converting string representations of floating point numbers which are sent by the server. Closes GH-6665.
* | | Fix #80330: Replace language in APIs and source code/docsDarek Slusarczyk2021-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rename MYSQLI_REFRESH_SLAVE to MYSQLI_REFRESH_REPLICA in line with upstream change in MySQL. The old name is retained for backwards-compatibility reasons, and may be deprecated/removed in the future. Closes GH-6632.
* | | Print "interned" instead of fake refcount in debug_zval_dump()Nikita Popov2021-01-152-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | debug_zval_dump() currently prints refcount 1 for interned strings and arrays, which does not really reflect the truth. These values are not refcounted, so the refcount is misleading. Instead print an "interned" tag. Closes GH-6598.
* | | Move fetch_all implementation out of mysqlndNikita Popov2020-12-184-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | There doesn't seem to be any compelling reason to implement this in mysqlnd rather than mysqli. It's just a loop over fetch_into. This makes the function available under libmysqlclient as well, and thus fixes bug #79372.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-183-19/+153
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: MySQLnd: Support cursors in store/get result
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-183-19/+153
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: MySQLnd: Support cursors in store/get result
| | * MySQLnd: Support cursors in store/get resultNikita Popov2020-12-183-33/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Drop support for max_length in mysqli_fetch_fields()Nikita Popov2020-12-174-21/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retain the field, but always populate it with zero. This was already the case for PS without length updating. max_length has nothing lost in the field metadata -- it is a property of the specific result set, and requires scanning the whole result set to compute. PHP itself never uses max_length with mysqlnd, it is only exposed in the raw mysqli API. Keeping it for just that purpose is not worthwhile given the costs involved. People who actually need this for some reason can easily calculate it themselves, while making it obvious that the calculation requires a full result set scan.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-161-0/+35
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #67983
| * Fixed bug #67983Nikita Popov2020-12-161-0/+35
| | | | | | | | | | We need to check the BIT case first, otherwise it will get skipped in INT_AND_FLOAT_NATIVE mode.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-031-13/+26
|\ \ | |/ | | | | | | * PHP-7.4: Fix mysqli_expire_password test for mariadb
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-12-031-13/+26
| |\ | | | | | | | | | | | | * PHP-7.3: Fix mysqli_expire_password test for mariadb
| | * Fix mysqli_expire_password test for mariadbDaniel Black2020-12-031-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MariaDB-10.4.3 EXPIRE passwords where supported for MariaDB. This only behaves like MySQL when the system variable disconnect_on_expired_passwords=1. MariaDB if there was no password it could not be considered expired. So the test is adjusted to use actual passwords. (MariaDB commit a94b20a8e0d9e64eeaabdaaa7a3e03fcdb8a686e) The error codes produced my MariaDB are different however still conforming to the SQL specification. Closes GH-6480.
| | * Fix mysqli_get_client_stats testDaniel Black2020-11-271-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0 (Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it. It also breaks when testing against MariaDB. As the alternate path in this test covers all supported MySQL and MariaDB versions and a signifant portion of unsupported versions lets keep it simple. Closes GH-6459.
* | | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-031-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: fix mysqli_stmt_get_result_metadata_fetch_field test for mariadb
| * | fix mysqli_stmt_get_result_metadata_fetch_field test for mariadbDaniel Black2020-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB extended the default decimal field to 39 characters instead of MySQL's 31 characters. This small change allows the test to pass on MySQL and MariaDB. Closes GH-6484.
* | | Remove PHP 5 mysqli testsDharman2020-12-034-223/+0
| | | | | | | | | | | | These tests all require functions that no longer exist.
* | | Fix typos in mysql testsDharman2020-12-032-4/+4
| | | | | | | | | | | | %d because of line endings on Windows
* | | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-11-251-2/+11
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed error reporting in mysqli_stmt::__construct
| * | Fixed error reporting in mysqli_stmt::__constructDharman2020-11-251-2/+11
| | | | | | | | | | | | | | | | | | | | | For the sake of simplicity, I've synchronized the implementation with PHP 8, which means null values are also accepted. Closes GH-6454.