summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'PHP-8.0'Nikita Popov2020-11-121-29/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Don't assume libmysqlclient library name
| * | Don't assume libmysqlclient library nameNikita Popov2020-11-121-29/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | By simply dropping the additional checks, in line with the general guideline of trusting the output of config scripts (this should be migrated to pkg-config though). Also drop the code for manually adding -z if mysql_config does not -- that's not our problem.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-11-023-5/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix tests for MariaDB
| * | Fix tests for MariaDBDharman2020-11-023-5/+5
| | | | | | | | | | | | Closes GH-6390.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-10-291-5/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Handle errors during PDO row fetch
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-291-5/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Handle errors during PDO row fetch
| | * Handle errors during PDO row fetchNikita Popov2020-10-291-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The EOF flag also gets set on error, so we always end up ignoring errors here. However, we should only check errors for unbuffered results. For buffered results, this function is guaranteed not to error, and querying the errno may return an unrelated error.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-10-282-4/+69
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #66528
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-282-4/+69
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fixed bug #66528
| | * Fixed bug #66528Nikita Popov2020-10-282-4/+69
| | | | | | | | | | | | Report errors in commit, rollback and autocommit handlers.
* | | Merge branch 'PHP-8.0'Nikita Popov2020-10-283-3/+124
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix bug #79375
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-283-3/+124
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix bug #79375
| | * Fix bug #79375Dharman2020-10-283-3/+124
| | | | | | | | | | | | | | | | | | | | | | | | 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-8.0'Nikita Popov2020-10-263-13/+66
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix inconsistency in PDO transaction state
| * | Fix inconsistency in PDO transaction stateNikita Popov2020-10-263-13/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses an issue introduced by #4996 and reported in https://bugs.php.net/bug.php?id=80260. Now that PDO::inTransaction() reports the real transaction state of the connection, there may be a mismatch with PDOs internal transaction state (in_tcx). This is compounded by the fact that MySQL performs implicit commits for DDL queries. This patch fixes the issue by making beginTransaction/commit/rollBack work on the real transaction state provided by the driver as well (or falling back to in_tcx if the driver does not support it). This does mean that writing something like $pdo->beginTransaction(); $pdo->exec('CREATE DATABASE ...'); $pdo->rollBack(); // <- illegal will now result in an error, because the CREATE DATABASE already committed the transaction. I believe this behavior is both correct and desired -- otherwise, there is no indication that the code did not behave correctly and the rollBack() was effectively ignored. However, this is also a BC break. Closes GH-6355.
* | | Add GC support for PDO driver dataNikita Popov2020-10-121-1/+2
|/ / | | | | | | | | | | | | | | | | Add a get_gc method that can be implemented by drivers, which can be used to add additional zvals to the GC buffer. Implement GC support for PDO SQLite callbacks in particular. Closes GH-6262.
* | Update PDO parameter namesNikita Popov2020-10-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | Followup to previous changes: * Use camel case, as PDO uses a camel case OO API. * Use &$var instead of &$bind_var or &$param. * Use $column instead of $index. We have cases (both inside PDO and in other DB exts) where columns can also be represented as strings, so $column is the safer generic name. Closes GH-6272.
* | Update PDO parameters for named arguments.Larry Garfield2020-09-284-4/+4
| | | | | | | | Closes GH-6220
* | Another pass making some failure states unconditional erros in PDOGeorge Peter Banyard2020-09-281-11/+8
| | | | | | | | Also make internal function return type more accurate to inform usage
* | Make various failure conditions in PDO unconditional errorsGeorge Peter Banyard2020-09-286-68/+93
| | | | | | | | | | | | | | This includes TypeErrors, ValueErrors, Error for uninitialized objects and invalid user classes/callable instanciation Closes GH-6212
* | Drop ZPP check in PDO MySQLi testGeorge Peter Banyard2020-09-281-4/+0
| | | | | | | | | | | | This test is marked as XFAIL so it doesn't get looked at. It checks that the method is called without arguments which is a ZPP concern
* | Improve PDO::inTransaction() support for MySQLtwosee2020-09-232-1/+83
| | | | | | | | Closes GH-4996.
* | Fix some tests for libmysqlNikita Popov2020-09-182-1/+2
| |
* | Merge branch 'PHP-7.4'Nikita Popov2020-09-181-2/+7
|\ \ | |/ | | | | | | * PHP-7.4: Support NO_BACKSLASH_ESCAPES with newer libmysqlclient
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-2/+7
| |\ | | | | | | | | | | | | * PHP-7.3: Support NO_BACKSLASH_ESCAPES with newer libmysqlclient
| | * Support NO_BACKSLASH_ESCAPES with newer libmysqlclientNikita Popov2020-09-181-2/+7
| | | | | | | | | | | | Requires the use of mysql_real_escape_string_quote().
* | | Run tidyNikita Popov2020-09-1828-66/+66
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Fix some tests for libmysqlNikita Popov2020-09-171-2/+2
| | |
* | | Fix warnings when building against libmysqlclientNikita Popov2020-09-172-9/+9
| | | | | | | | | | | | At least for version 8.0 this is warning free now.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-09-172-7/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-7.4: pdo_mysql/mysqli (native) libmysqlclient_r no-longer used mysql: native mysql-8.0 uses _Bool mysqli: use native api
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-172-7/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | * 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-7/+2
| | | | | | | | | | | | | | | | | | 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-171-0/+3
| | | | | | | | | | | | MySQL-8.0 removes option MYSQLI_OPT_SSL_VERIFY_SERVER_CERT
| * | Merge branch 'PHP-7.3' into PHP-7.4Matteo Beccati2020-08-311-0/+7
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
| | * Fix #80027 Terrible performance using $query->fetch on queries with many ↵Matteo Beccati2020-08-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bind parameters Added new flags that allow skipping param_evt(s) that are not used by drivers, in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite and oci drivers to properly use the new flags. I've left out pdo_dblib, which doesn't have a param_hook, and pdo_firebird, which seems to be using PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
* | | Convert warning to assetion in MySQL PDO driverGeorge Peter Banyard2020-09-151-4/+1
| | | | | | | | | | | | Closes GH-6120
* | | Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-091-1/+1
| | | | | | | | | | | | Closes GH-5999
* | | Fix #80027 Terrible performance using $query->fetch on queries with many ↵Matteo Beccati2020-08-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bind parameters Added new flags that allow skipping param_evt(s) that are not used by drivers, in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite and oci drivers to properly use the new flags. I've left out pdo_dblib, which doesn't have a param_hook, and pdo_firebird, which seems to be using PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
* | | Use variadic signature for PDOStatement::fetchAll()Nikita Popov2020-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current signature is incorrect, because the $ctor_args parameter is not required to be an array (it can at least also be null, and isn't enforced by an exception anyway). I'm going for the variadic signature here, because we already use the same variadic signature in PDO::query() and PDOStatement::setFetchMode(), all of them accepting essentially the same arguments.
* | | Use Z_PARAM_CLASS in PDOStatement::fetchObject()Nikita Popov2020-08-131-0/+6
| | | | | | | | | | | | Instead of implementing custom logic.
* | | Add all the missing parameter types to stubsMáté Kocsis2020-08-131-8/+9
| | | | | | | | | | | | Closes GH-5955
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-112-2/+18
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-112-2/+18
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
| | * Fix #64705 errorInfo property of PDOException is null when ↵Ahmed Abdou2020-08-112-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | PDO::__construct() fails PDO driver constructors are throwing PdoException without setting errorInfo, so create a new reusable function that throws exceptions for PDO and will also set the errorInfo. Use this function in pdo_mysql, pdo_sqlite, and pdo_pgsql.
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-099-0/+8
| | | | | | | | | | | | Closes GH-5958
* | | Get rid of empty function entriesMáté Kocsis2020-08-011-7/+1
| | | | | | | | | | | | Closes GH-5917
* | | Update method signature in testNikita Popov2020-07-201-2/+2
| | |
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-1/+1
| | | | | | | | | | | | Closes GH-5590
* | | Remove proto comments from C filesMax Semenik2020-07-061-14/+7
| | | | | | | | | | | | Closes GH-5758
* | | Fix [-Wundef] warning in PDO MySQL extensionGeorge Peter Banyard2020-05-204-24/+24
| | |