summaryrefslogtreecommitdiff
path: root/ext/mysqli
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug #80837Dharman2021-03-151-0/+38
| | | | The error needs to be reported on the statement, not the connection.
* mysqlnd pam fix test error messageDaniel Black2021-02-251-2/+2
| | | | Closes GH-6727.
* 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.
* Use ST_Y() instead of the deprecated/removed Y() in testChristoph M. Becker2021-02-051-2/+2
|
* 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.
* 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.
* 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.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.
* | 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.
* | Fixed error reporting in mysqli_stmt::__constructDharman2020-11-252-32/+28
| | | | | | | | | | | | | | For the sake of simplicity, I've synchronized the implementation with PHP 8, which means null values are also accepted. Closes GH-6454.
* | Reindent more mysqli testsNikita Popov2020-11-25374-17809/+17809
| | | | | | | | | | Due to a bug in the tidy script, most tests did not actually get reindented...
* | Reindent ext/mysqli testsNikita Popov2020-11-25290-4857/+4857
| | | | | | | | | | | | Reindent ext/mysqli tests on PHP-7.4, so they match with the indentation on PHP-8.0. Otherwise merging test changes across branches is very unpleasant.
* | Fix #80312: change default engine from MyISAM to InnoDB in testsDarek Slusarczyk2020-11-171-1/+1
| | | | | | | | | | | | | | Change mysqli and pdo_mysql tests configuration to use by default InnoDB instead of MyISAM. Closes GH-6405.
* | Handle errors during next_result()Nikita Popov2020-11-113-2/+83
| |
* | Fix bug #72413: Segfault with get_result and PS cursorsDharman2020-10-291-20/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Handle mysqli errors in more casesDharman2020-10-282-0/+45
| | | | | | | | | | | | | | | | | | Report errors autocommit, commit, rollback and mysqli_stmt_attr_set. Additionally, copy the error from conn to stmt when preparing fails, so these errors are also handled by mysqli_stmt_prepare. Closes GH-6157.
* | Sync test with masterNikita Popov2020-10-281-258/+258
| | | | | | | | | | Sync ext/mysqli/tests/mysqli_report.phpt with PHP-8.0/master, as the current difference in indentation makes it hard to merge.
* | Fix bug #79375Dharman2020-10-282-1/+174
| | | | | | | | | | | | | | | | Make sure deadlock errors are properly propagated and reports in a number of places in mysqli and PDO MySQL. This also fixes a memory and a segfault that can occur under these conditions.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-201-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix mysqli build with mysqlnd and without PDO
| * Fix mysqli build with mysqlnd and without PDOBob Weinand2020-09-201-1/+1
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-26/+24
|\ \ | |/ | | | | | | * PHP-7.3: Fix #78179: mysqli/mysqlnd transaction extensions
| * Fix #78179: mysqli/mysqlnd transaction extensionsDaniel Black2020-09-181-26/+24
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-1/+6
|\ \ | |/ | | | | | | * PHP-7.3: Support NO_BACKSLASH_ESCAPES with newer libmysqlclient
| * Support NO_BACKSLASH_ESCAPES with newer libmysqlclientNikita Popov2020-09-181-1/+6
| | | | | | | | Requires the use of mysql_real_escape_string_quote().
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Use MyISAM engine for new test
| * Use MyISAM engine for new testNikita Popov2020-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-0/+57
|\ \ | |/ | | | | | | | | * 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
| * Fix bug #80107: Handling of large compressed packetsNikita Popov2020-09-181-8/+14
| | | | | | | | | | | | | | | | | | | | 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.
| * Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when ↵Máté Kocsis2020-09-181-0/+51
| | | | | | | | compression is enabled
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-172-2/+2
|\ \ | |/ | | | | | | * PHP-7.3: Fix mysqli_release_savepoint() on mysqlnd
| * Fix mysqli_release_savepoint() on mysqlndNikita Popov2020-09-172-2/+2
| | | | | | | | mysqli_release_savepoint() was not actually releasing a savepoint...
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-175-25/+12
|\ \ | |/ | | | | | | | | | | * PHP-7.3: pdo_mysql/mysqli (native) libmysqlclient_r no-longer used mysql: native mysql-8.0 uses _Bool mysqli: use native api
| * pdo_mysql/mysqli (native) libmysqlclient_r no-longer usedDaniel Black2020-09-171-3/+0
| | | | | | | | | | | | The mysqlclient_r library exists in mysql-5.6 for compatibility only. Later versions have it removed.
| * mysql: native mysql-8.0 uses _BoolDaniel Black2020-09-172-3/+3
| | | | | | | | MySQL-8.0 removes option MYSQLI_OPT_SSL_VERIFY_SERVER_CERT
| * mysqli: use native apiDaniel Black2020-09-173-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested with: * mysql-5.6.49-linux-glibc2.12-x86_64 * mysql-5.7.31-linux-glibc2.12-x86_64 * mysql-8.0.21-linux-glibc2.17-x86_64 * mariadb-10.5.6 configure --with-mysqli=/usr/local/$version/bin/mysql_config --with-pdo-mysql=/usr/local/$version MySQL-8.0 removed my_bool Some options where deprecated in mysql-8.0 MY_CHARSET_INFO used with exposed api mysql_get_character_set_info rather than internal structures.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-251-4/+1
|\ \ | |/ | | | | | | * PHP-7.3: Remove bogus REGISTER_LONG_CONSTANT
| * Remove bogus REGISTER_LONG_CONSTANTNikita Popov2020-08-251-4/+1
| | | | | | | | This shouldn't be in this function, probably a copy/paste mistake...
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-04-162-5/+5
|\ \ | |/ | | | | | | * PHP-7.3: Fix MySQL local infile / attr handling on big endian systems
| * Fix MySQL local infile / attr handling on big endian systemsguirish2020-04-162-5/+5
| | | | | | | | | | | | Make sure pointer types match what is used by libmysql everywhere. Closes GH-5380.
* | Make mysqli_poll test more deterministicNikita Popov2020-04-081-5/+7
| | | | | | | | Handle errors appearing in different order.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-231-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix test for Windows
| * Fix test for WindowsChristoph M. Becker2020-03-231-1/+1
| | | | | | | | | | Windows filenames may very well contain a colon, so we adjust the test accordingly.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-092-2/+2
|\ \ | |/ | | | | | | * PHP-7.3: Enclose INI values containing {TMP} in quotes
| * Enclose INI values containing {TMP} in quotesChristoph M. Becker2020-03-092-2/+2
| | | | | | | | | | At least on Windows, the temporary directory may contain tilde signs, which would result in an INI parse error.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-271-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #64032: mysqli reports different client_version
| * Fix #64032: mysqli reports different client_versionChristoph M. Becker2020-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | While `mysqli_get_client_version()` calls `mysql_get_client_version()` to retrieve the client version, `mysql::$client_version` is initialized to `MYSQL_VERSION_ID`. Both should match though, and since the former is the more useful information, we fix `mysql::$client_version`. We do not add a regression test, because it would usually succeed anyway, and we already have several tests with respective `assert()`s.
* | Fix #78666 mysqli_options generates Warning on var_dump()Máté Kocsis2020-01-289-157/+135
| | | | | | | | Closes GH-5121
* | Fix mysqli_get_warnings() with multi queriesNikita Popov2020-01-282-5/+6
| | | | | | | | | | | | In this case warning_count may be non-zero, but php_get_warnings() may still return no warnings. In this case we should return false rather than returning a corrupted mysqli_warning object.