summaryrefslogtreecommitdiff
path: root/ext/pgsql
Commit message (Collapse)AuthorAgeFilesLines
* Use zend_string_equals() API instead of strcmp() in PGSQL extensionGeorge Peter Banyard2021-03-171-50/+50
| | | | And tiny drive by refactor at the same time for more usages
* Improve class entry generationMáté Kocsis2021-02-161-1/+0
| | | | Related to GH-6701
* Generate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsqlMáté Kocsis2021-02-142-2/+3
| | | | Closes GH-6691
* Merge branch 'PHP-8.0'Christoph M. Becker2021-02-081-3/+6
|\ | | | | | | | | * PHP-8.0: Fix locale dependent parsing of PostgreSQL version number
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-081-3/+6
| |\ | | | | | | | | | | | | * PHP-7.4: Fix locale dependent parsing of PostgreSQL version number
| | * Fix locale dependent parsing of PostgreSQL version numberChristoph M. Becker2021-02-081-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Version numbers are not supposed to be localized, so we must not apply locale dependent parsing with `atof()`. Using `php_version_compare()` might even be better. Closes GH-6668.
* | | Replace zend_bool uses with boolNikita Popov2021-01-152-6/+6
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* | | Add --repeat testing modeNikita Popov2020-10-301-0/+5
|/ / | | | | | | | | | | | | | | | | This testing mode executes the test multiple times in the same process (but in different requests). It is primarily intended to catch tracing JIT bugs, but also catches state leaks across requests. Closes GH-6365.
* | Fix default value handling of mysqli_fetch_object()Máté Kocsis2020-10-203-14/+10
| | | | | | | | | | | | | | Make [] acceptable both for classes without constructors and classes with a constructor that takes no arguments. Closes GH-6336.
* | Verify parameter names of function aliasesMáté Kocsis2020-10-162-7/+5
| | | | | | | | Closes GH-6335
* | Fix default value for some pgsql functionsNikita Popov2020-10-132-9/+9
| | | | | | | | These set the PGSQL_DML_EXEC flag by default.
* | Don't accept null in pg_unescape_bytea()Nikita Popov2020-10-133-6/+5
| | | | | | | | | | | | | | This is an error that slipped in via 8d37c37bcdbf6fa99cd275413342457eeb2c664e. pg_unescape_bytea() did not accept null in PHP 7.4, and it is not meaningful for it to accept null now -- it will always fail, and now with a misleading OOM message.
* | Update ext/pgsql parameter namesNikita Popov2020-10-136-160/+162
| | | | | | | | Closes GH-6294.
* | Use a subrountine to check for valid OID stringsGeorge Peter Banyard2020-10-021-40/+27
| | | | | | | | Closes 6260
* | Promote E_NOTICE to Value/TypeError in PostgreSQL extensionGeorge Peter Banyard2020-09-296-46/+234
| | | | | | | | | | | | | | | | | | Add some tests to cover related codepaths. With the small caveat that the ones in build_assignment_string() still don't seem to be tested as it looks the condtions are checked beforehand, might need some more investigation. Closes GH-6226
* | Return empty array for no rows in pg_fetch_all()Nikita Popov2020-09-215-15/+16
| | | | | | | | | | This makes it line up with pg_fetch_all_columns(), as well as similar functions in other exts, such as mysqli_fetch_all().
* | Promote invalid field to ValueError in pgsqlNikita Popov2020-09-214-49/+124
| | | | | | | | | | | | | | | | The same error condition is a ValueError in mysqli, be consistent. Additionally, do not display the argument name for these errors. As the signatures are overloaded, the argument name may not match the meaning at all.
* | Remove redundant checkNikita Popov2020-09-211-5/+0
| | | | | | | | This was already checked directly above.
* | pg_unescape_bytea() can only fail on OOMNikita Popov2020-09-213-11/+10
| | | | | | | | | | | | | | | | | | | | | | The implementation did not check for PQunescapeBytea failure correctly, because it checked for a null pointer after estrndup, which certainly cannot happen. Inspection of the PGunescapeBytea implementation has shown that this function can only fail on OOM, so let's check for that explicitly and remove false as a possible return type. While we're here, avoid an unnecessary copy of the result.
* | Deprecate pgsql function aliasesNikita Popov2020-09-214-27/+74
| | | | | | | | | | These have been documentation-deprecated for a very long time, make it official.
* | Fix a few UNKNOWN default values in ext/pgsqlMáté Kocsis2020-09-173-73/+63
| | | | | | | | Closes GH-6149
* | Promote warnings to Errors in PostgreSQL extensionGeorge Peter Banyard2020-09-147-96/+183
| | | | | | | | | | | | | | Do some drive by indentation fixes Also fix pg_select() in regards to the $result_type arg which was missing from ZPP Closes GH-6129
* | Use string|int union types in pgsqlNikita Popov2020-09-113-75/+64
| | | | | | | | | | | | For "field name or field offset" parameters. Also make $ctor_params an ?array parameter.
* | Use proper int type for parameterNikita Popov2020-09-093-39/+25
| |
* | Fix default valueNikita Popov2020-09-092-3/+3
| |
* | Use PGSQL_RETURN_OID() in more placesNikita Popov2020-09-091-20/+2
| |
* | Add stub for pgsql extensionNikita Popov2020-09-093-607/+1167
| |
* | Remove deprecated pgsql signaturesNikita Popov2020-09-092-28/+2
| | | | | | | | As the comment indicates, these are deprecated in PHP 4.2...
* | Promote pgsql no link to Error exceptionNikita Popov2020-09-092-1/+19
| |
* | Remove deprecated multi-parameter form of pg_connect()Nikita Popov2020-09-092-93/+26
| |
* | Drop various unused macros/APIsGeorge Peter Banyard2020-08-261-2/+2
| | | | | | | | | | | | Also convert_libmagic_pattern() to return a zend_string* Closes GH-6029
* | Use zpp C in pg_fetch_objectNikita Popov2020-08-132-10/+9
| |
* | Add many missing closing PHP tags to testsMáté Kocsis2020-08-091-0/+1
| | | | | | | | Closes GH-5958
* | Implement named parametersNikita Popov2020-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | Fix some pgsql arginfosNikita Popov2020-07-171-11/+12
| | | | | | | | | | And make sure too few/many arguments throws, to satisfy the function signature.
* | Some zpp cleanup in pgsqlNikita Popov2020-07-171-13/+14
| |
* | Remove some zpp quiet uses in pgsqlNikita Popov2020-07-171-29/+20
| | | | | | | | These functions don't do anything special, just use normal zpp.
* | Remove no_separation flagNikita Popov2020-07-071-1/+0
| |
* | Remove proto comments from C filesMax Semenik2020-07-061-238/+119
| | | | | | | | Closes GH-5758
* | PGSQL and POD_SQL: don't include pg_config.hChristoph M. Becker2020-05-254-167/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Raise ext/pgsql requirements to PostGreSQL 7.4Christoph M. Becker2020-05-224-411/+23
| | | | | | | | | | | | | | We can safely assume that users have at the very least libpq 7.4, for which official support ended on 2010-10-01; even CentOS 6 has 8.4 now. It is also noteworthy that PDO_PGSQL already requires libpq 7.4 or later.
* | Fix [-Wundef] warning in PostgreSQL extensionGeorge Peter Banyard2020-05-202-88/+88
| |
* | Make float to string casts locale-independentMáté Kocsis2020-05-081-1/+1
| | | | | | | | | | | | | | | | From now on, float to string casting will always behave locale-independently. RFC: https://wiki.php.net/rfc/locale_independent_float_to_string Closes GH-5224 Co-authored-by: George Peter Banyard <girgias@php.net>
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-291-0/+1
|\ \ | |/ | | | | | | * PHP-7.4: Fix #79532: sizeof off_t can be wrong
| * Fix #79532: sizeof off_t can be wrongChristoph M. Becker2020-04-291-0/+1
| | | | | | | | | | | | | | | | | | 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-0335-457/+457
| |
* | Eliminate uses of ZVAL_ZVAL and friendsNikita Popov2020-01-201-2/+2
| | | | | | | | | | | | | | | | Instead add RETURN_COPY(_VALUE) macros will the expected behavior. RETURN_ZVAL doesn't make any sense since PHP 7, but has stuck around, probably because the alternative was to write directly to the return_value variable.
* | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-171-6/+6
| | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | Use RETURN_THROWS() after zend_fetch_resource*()Máté Kocsis2020-01-031-69/+69
| |