summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug #72368Nikita Popov2020-12-101-5/+5
| | | | | | | | | Generate a param count mismatch error even if the query contains no placeholders. Additionally we shouldn't HANDLE errors from pdo_parse_params, which are always reported via raise_impl_error. Doing so results in duplicate error messages.
* Allow drivers to omit error codeNikita Popov2020-12-105-7/+9
| | | | | | | And thus generate error messages that match what PDO emulation would generate. This fixes the error message regression from the previous commit.
* Fixed bug #79131Nikita Popov2020-12-105-6/+9
| | | | | | | | | | | | When a driver reports an error during EVT_ALLOC (and some over EVTs), make sure we handle it as usual, i.e. warn or throw. This requires some adjustments in PDO PgSQL to stop manually doing this through an impl error. Unfortunately the PDO PgSQL error messages regress because of this, as they now include a completely arbitrary error code. There doesn't seem to be an ability to skip it right now.
* Update ext/pdo_pgsql parameter namesNikita Popov2020-10-132-17/+17
| | | | Closes GH-6329.
* Run tidyNikita Popov2020-09-183-11/+11
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Fix UNKNOWN default values in ext/pdo_pgsqlMáté Kocsis2020-09-183-12/+12
| | | | Closes GH-6159
* Promote Warnings to Error in PostgreSQL PDO driverGeorge Peter Banyard2020-09-141-6/+6
| | | | Closes GH-6119
* Fix #80027 Terrible performance using $query->fetch on queries with many ↵Matteo Beccati2020-08-312-1/+6
| | | | | | | | | | 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).
* 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-093-0/+3
| | | | | | | | | | | | Closes GH-5958
* | | Get rid of empty function entriesMáté Kocsis2020-08-011-7/+1
| | | | | | | | | | | | Closes GH-5917
* | | Add stubs for PDO PGSql extension methodsNikita Popov2020-07-213-24/+115
| | |
* | | Remove proto comments from C filesMax Semenik2020-07-062-26/+13
| | | | | | | | | | | | Closes GH-5758
* | | Clean up calls to extension_loaded('json') in testsTyson Andre2020-05-282-2/+0
| | | | | | | | | | | | | | | | | | These are no longer needed after https://wiki.php.net/rfc/always_enable_json Closes GH-5637
* | | PGSQL and POD_SQL: don't include pg_config.hChristoph M. Becker2020-05-255-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even if that header file is available, we better consider it private, and don't include it. The information about whether SSL support is enabled is now missing (`USE_(OPEN)SSL`), and it seems there is no alternative way to get it (`PQinitSSL()` is always defined), so we remove it from the PHP info. Furthermore, the `PG_VERSION` and `PG_VERSION_STR` macros are no longer available, but as of libpq 9.1 there is `PQlibVersion()` which allows us to construct `PG_VERSION` in a most likely backwards compatible manner. The additional information available through `PG_VERSION_STR` is lost, though, so we define `PGSQL_LIBPQ_VERSION_STR` basically as alias of `PGSQL_LIBPQ_VERSION`, and deprecate it right away. Since we are now requiring at least libpq 9.1, we can remove some further compatibility code and additional checks. Regarding the raised requirements: official support for PostGreSQL 9.0 ended on 2015-10-08, and even CentOS 7 already has PostGreSQL 9.2, so this is not supposed to be too much of an issue.
* | | Fix [-Wundef] warning in PDO PostgreSQL extensionGeorge Peter Banyard2020-05-202-3/+3
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-292-0/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79532: sizeof off_t can be wrong
| * | Fix #79532: sizeof off_t can be wrongChristoph M. Becker2020-04-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have to actually determine the proper `SIZEOF_OFF_T`. Interestingly, it is `4` on Windows x64. We also have to prevent the redefinition in pg_config.h. The clean solution would likely be to not include pg_config.h at all, but that's out of scope for BC reasons for now.
* | | Reindent phpt filesNikita Popov2020-02-0321-227/+227
| | |
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-171-1/+1
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-1/+1
| | |
* | | Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-7/+7
| | | | | | | | | | | | Except for some bigger ones: reflection, sodium, spl
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-201-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78982: pdo_pgsql returns dead persistent connection
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-12-201-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78982: pdo_pgsql returns dead persistent connection
| | * Fix #78982: pdo_pgsql returns dead persistent connectionSATO Kentaro2019-12-201-1/+1
| | | | | | | | | | | | Call PQconsumeInput() before PQstatus() to update the status.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-201-2/+10
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78980: pgsqlGetNotify() overlooks dead connection
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-12-201-2/+10
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78980: pgsqlGetNotify() overlooks dead connection
| | * Fix #78980: pgsqlGetNotify() overlooks dead connectionSATO Kentaro2019-12-201-2/+10
| | | | | | | | | | | | pgsqlGetNotify() didn't check result of PQconsumeInput().
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-12-191-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-191-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h
| | * Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.hSATO Kentaro2019-12-191-1/+1
| | | | | | | | | | | | When configured with a path specified.
* | | Add missing ZPP checksMáté Kocsis2019-11-011-0/+4
| | | | | | | | | | | | Closes GH-4878.
* | | Cleanup return values when parameter parsing is unsuccessfulMáté Kocsis2019-10-301-3/+3
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-255-10/+0
|/ / | | | | | | Closes GH-4732.
* | Fix PDO pgsql memory leak with scrollable cursorsNikita Popov2019-09-091-1/+1
| |
* | Fix detection of pg_config.hChristoph M. Becker2019-08-071-1/+1
| | | | | | | | | | pg_config.h is supposed to be placed right besides libpq-fe.h, so we should check the same paths.
* | Skip test if ext/json is not availableChristoph M. Becker2019-08-071-0/+1
| | | | | | | | Otherwise the test fails.
* | Cleanup of remaining E_STRICT in testsGeorge Peter Banyard2019-07-231-1/+1
| |
* | Fix FR #71885 (Allow escaping question mark placeholders)Matteo Beccati2019-07-223-23/+126
| |
* | Report errors from stream read and write operationsNikita Popov2019-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* | Remove conditional calls of always available macrosPeter Kokot2019-07-141-4/+1
| | | | | | | | | | | | | | These checks were once relevant for these extensions in PECL and PHP versions without availability of the checked macros. Closes GH-4405
* | Simplify PHP_CHECK_PDO_INCLUDES callsPeter Kokot2019-07-081-16/+1
| | | | | | | | | | | | | | Conditional checks were once used for backwards compatibility with phpize from PHP versions that didn't have this macro call yet. Closes GH-4376
* | Fix type mismatch in two get_col callbacksNikita Popov2019-06-121-1/+1
| |
* | Allow exceptions in __toString()Nikita Popov2019-06-051-1/+4
| | | | | | | | | | | | | | | | | | | | 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.
* | Normalize comments in *nix build system m4 filesPeter Kokot2019-05-121-2/+0
| | | | | | | | | | | | | | | | | | Normalization include: - Use dnl for everything that can be ommitted when configure is built in favor of the shell comment character # which is visible in the output. - Line length normalized to 80 columns - Dots for most of the one line sentences - Macro definitions include similar pattern header comments now
* | Disable PACKAGE_* preprocessor symbolsPeter Kokot2019-04-132-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autoconf defines PACKAGE_* symbols: - PACKAGE_NAME - PACKAGE_VERSION - PACKAGE_TARNAME - PACKAGE_STRING - PACKAGE_BUGREPORT - PACKAGE_URL and appends them to the generated config.h.in files. With AC_INIT change via afd52f9d9986d92dd0c63832a07ab1a16bf11d53 where package version, URL, bug report location and similar meta data are defined, these preprocessor macros are then non empty strings in the generated configuration header file. When using phpize, PHP shares the config files in extensions, warnings of redefined macros appear, such as: - `warning: 'PACKAGE_NAME' macro redefined` This patch now disables these non utilized symbols in the generated config header files. Better practice would be to include only API specific headers where needed but this would require even more refactorings. Some extensions such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some of these symbols before including the library configuration headers in the code also. Because these symbols can be defined by any library which uses Autotools. Additionally, the unused PACKAGE_* symbols were cleaned for the bundled libmbfl library and with this patch not needed undef code removed.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-04-123-7/+7
|\ \ | |/ | | | | | | * PHP-7.3: Fix tests wrt. internationalization