summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
Commit message (Collapse)AuthorAgeFilesLines
* Fix PDO test under libmysqlclientNikita Popov2021-03-171-2/+6
|
* Add API to fetch bool value for PDO attribute valuesGeorge Peter Banyard2021-03-171-2/+13
| | | | Closes GH-6766
* Use standard PDO way for fetching integer attribute valuesGeorge Peter Banyard2021-03-171-2/+10
|
* Validate string is numeric for integer PDO attribute valueGeorge Peter Banyard2021-03-172-2/+2
|
* Add CLEAN sections to mysqli and PDO mysql testsDharman2021-03-155-1/+31
| | | | Closes GH-6756.
* Fixed bug #80808Nikita Popov2021-03-021-0/+27
| | | | | | 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).
* Fix #80329: Add option to specify LOAD DATA LOCAL white list folderDarek Slusarczyk2021-02-2314-12/+325
| | | | | | | | | | | | | | | | | * 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>
* Refactor PDO's last inserted ID handler to use and return zend_stringGeorge Peter Banyard2021-01-191-4/+2
| | | | Closes GH-6617
* Refactor PDO doer handler to use zend_stringGeorge Peter Banyard2021-01-191-4/+11
|
* Replace zend_bool uses with boolNikita Popov2021-01-153-4/+4
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Refactor PDO's quoter handler to return a zend_stringGeorge Peter Banyard2021-01-071-13/+19
| | | | Closes GH-6547
* Voidify PDO's fetch_error handlerGeorge Peter Banyard2021-01-061-2/+2
|
* Boolify PDO's preparer handlerGeorge Peter Banyard2021-01-061-6/+6
|
* Voidify PDO's closer handlerGeorge Peter Banyard2021-01-061-2/+1
|
* Boolify PDO's quoter handlerGeorge Peter Banyard2021-01-061-2/+2
|
* Boolify PDO's set_attribute driver functionGeorge Peter Banyard2021-01-061-9/+9
|
* Boolify PDO's transaction handlersGeorge Peter Banyard2021-01-061-8/+8
| | | | This includes begin(), commit(), rollBack(), and inTransaction()
* Formalize pdo_dbh_check_liveness_func() return type to zend_resultGeorge Peter Banyard2021-01-061-1/+1
|
* Rewrite PDO result bindingNikita Popov2020-12-223-42/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring the type to be determined in advance by the describer function and then requiring get_col to return a buffer of appropriate type, allow get_col to return an arbitrary zval. See UPGRADING.INTERNALS for a more detailed description of the change. This makes the result fetching simpler, more efficient and more flexible. The general possibility already existed via the special PDO_PARAM_ZVAL type, but the usage was very inconvenient and/or inefficient. Now it's possible to easily implement behavior like "return int if it fits, otherwise string" and to avoid any kind of complex management of temporary buffers. This also fixes bug #40913 (our second highest voted bug of all time, for some reason). PARAM_LOB result bindings will now consistently return a stream resource, independently of the used database driver. I've tried my best to update all PDO drivers for this change, but some of the changes may be broken, as I cannot test or even build some of these drivers (in particular PDO dblib and PDO oci). Fixes are appreciated -- a working CI setup would be even more appreciated ;)
* Add basic libmysqlclient CI jobNikita Popov2020-12-181-4/+11
| | | | | | | This tests that mysqli and pdo_mysql build against libmysqlclient, and that tests pass for pdo_mysql. mysqli has too many test failures. This is not an officially supported configuration.
* PDO MySQL: Make test libmysql compatibleNikita Popov2020-12-181-1/+2
|
* Merge branch 'PHP-8.0'Nikita Popov2020-12-181-0/+14
|\ | | | | | | | | * PHP-8.0: PDO MySQL: Handle boolean parameter binding with libmysql
| * PDO MySQL: Handle boolean parameter binding with libmysqlNikita Popov2020-12-181-0/+14
| | | | | | | | Previously boolean parameters were simply silently ignored...
* | PDO MySQL: Use correct type when setting INT_AND_FLOAT_NATIVENikita Popov2020-12-171-1/+1
| | | | | | | | mysqlnd expects this to be an unsigned int, not a bool.
* | PDO MySQL: Use native types for resultsNikita Popov2020-12-1726-61/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, PDO MySQL only fetched data as native int/float if native prepared statements were used. This patch updates PDO to have the same behavior for emulated prepared statements, and thus removes the largest remaining discrepancy between these two modes. Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control whether native types are desired or not. The previous output can be restored by enabling this option. Most of the tests make use of that option, because this allows the tests to work under libmysqlclient as well, which currently always returns string results (independently of whether native or emulated PS are used).
* | Merge branch 'PHP-8.0'Nikita Popov2020-12-161-0/+4
|\ \ | |/ | | | | | | * PHP-8.0: PDO MySQL: Use mysqlnd column names
| * PDO MySQL: Use mysqlnd column namesNikita Popov2020-12-161-0/+4
| | | | | | | | | | | | | | | | | | mysqlnd already creates interned zend_strings for us, so let's make use of them. This also required updating the PDO case changing code to work with potentially shared strings. For the lowercasing, use the optimized zend_string_tolower() implementation.
* | Fix ATTR_ORACLE_NULLS with PARAM_ZVALNikita Popov2020-12-151-4/+4
| | | | | | | | | | PARAM_ZVAL with a STR result should be treated the same way as PARAM_STR in this regard.
* | Merge branch 'PHP-8.0'Christoph M. Becker2020-12-141-108/+0
|\ \ | |/ | | | | | | * PHP-8.0: Drop pdo_mysql_prepare_load_data.phpt
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-12-141-108/+0
| |\ | | | | | | | | | | | | * PHP-7.4: Drop pdo_mysql_prepare_load_data.phpt
| | * Drop pdo_mysql_prepare_load_data.phptChristoph M. Becker2020-12-141-129/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the test title and some comments in this test describe, this test was supposed to have `::prepare()` failing because `LOAD DATA INFILE` would not be supported as prepared statement, and then the test checks whether follow-up queries would succeed. However, `LOAD DATA INFILE` is supported for prepared statements at least on Windows with mysqlnd, so the test does no longer test what it is supposed to do. Therefore, we drop it. Closes GH-6509.
* | | Use zmm for row_c dataNikita Popov2020-12-141-2/+2
| | | | | | | | | | | | | | | This API already doesn't match libmysqlclient, so we may as well use the zmm.
* | | PDO: Store/pass query_string as zend_stringNikita Popov2020-12-142-11/+9
| | | | | | | | | | | | | | | Rather than storing char* + size_t, use a zend_string*. Also avoid various copies of the query string.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-114-4/+67
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #79132
| * | Fixed bug #79132Nikita Popov2020-12-114-4/+67
| | | | | | | | | | | | | | | | | | Following cmb's suggestion and replacing the counter with a check against the bound_params HT, which ensures that both cannot go out of sync.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-114-97/+79
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: PDO MySQL: Fix nextRowset() on libmysqlclient with native PS PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient
| * | PDO MySQL: Fix nextRowset() on libmysqlclient with native PSNikita Popov2020-12-112-93/+79
| | | | | | | | | | | | | | | | | | The logic after next_result should match the one after execute. This was the case for mysqlnd but not libmysqlclient, which used the non-PS logic.
| * | PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclientNikita Popov2020-12-112-4/+0
| | |
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-111-7/+30
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: PDO MySQL: Unskip bug_41125.phpt
| * | PDO MySQL: Unskip bug_41125.phptNikita Popov2020-12-111-7/+30
| | | | | | | | | | | | | | | | | | | | | This test was always skipped (leftover debug statement?) Contrary to the comments in the test and the test expectation, this actually works fine.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-112-4/+37
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #67004
| * | Fixed bug #67004Nikita Popov2020-12-112-4/+37
| | | | | | | | | | | | | | | | | | | | | Repeated execute() with native PS failed to release the previous result set on libmysqlclient. Move freeing the result set into a common location.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-112-50/+44
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: PDO MySQL: Use stmt_next_result with libmysqlclient as well PDO MySQL: Fix libmysql option test
| * | PDO MySQL: Use stmt_next_result with libmysqlclient as wellNikita Popov2020-12-111-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | libmysqlclient added this function in version 5.5, which happens to be the minimum we support. If we have a prepared statement, we should use it on both mysqlnd and libmysqlclient, even if the handling afterwards is different. This fixes error handling with native prepared statements.
| * | PDO MySQL: Fix libmysql option testNikita Popov2020-12-111-37/+32
| | | | | | | | | | | | | | | | | | | | | The fact that getAttribute() fails for various libmysqlclient-only options is a known issue, and the test was taking that into account. However, the change of the default error mode broke the handling. We need to handle the exceptions now.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-112-25/+19
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #62889
| * | Fixed bug #62889Nikita Popov2020-12-112-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our minimum libmysqlclient version requirement is high enough that we don't need to check for MYSQL_OPT_LOCAL_INFILE support. However, the mysql_get_option() function seems to only be available since 5.7 (though it's really hard to find any definitie information on when MySQL introduced certain functions or changes...) so we need to store the value of the flag locally to make it available through getAttribute().
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-111-46/+29
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
| * | PDO MySQL: Fix leak with libmysqlclient and multiple rowsetsNikita Popov2020-12-111-46/+29
| | | | | | | | | | | | | | | | | | | | | | | | stmt->column_count gets reset before the next_rowset handler is invoked, so we need to fetch the value from the result set instead. Arguably PDO should be separating the destruction of the previous result set and the switch to the next result set more cleanly...
* | | Merge branch 'PHP-8.0'Nikita Popov2020-12-113-85/+57
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix test cases for MariaDB