summaryrefslogtreecommitdiff
path: root/ext/pgsql
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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.
* Report errors from stream read and write operationsNikita Popov2019-07-222-6/+6
| | | | | | | | | | | | | | | | | | 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 HAVE_PQPUTCOPYENDPeter Kokot2019-07-222-2/+1
| | | | | | | Symbol is not used anywhere in the code and also Postgresql 7.x is EOL anyway. Closes GH-4453
* add comment about pg_config/pkgconfigRemi Collet2019-06-121-0/+3
|
* Revert "ext/pgsql: Use PKG_CHECK_MODULES to detect the pq library"Joe Watkins2019-06-121-9/+62
| | | | This reverts commit 1e265174ed8b361c2d8b9c050f9e3b1f7034acc9.
* ext/pgsql: Use PKG_CHECK_MODULES to detect the pq libraryHugh McMaster2019-06-111-62/+9
|
* Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-6/+6
|
* Allow exceptions in __toString()Nikita Popov2019-06-051-32/+32
| | | | | | | | | | 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.
* Try to make 17result.php more robustNikita Popov2019-06-042-4/+4
| | | | | | This is our most common intermittent failure. I don't understand why it happens and can't reproduce it, but defining an explicit sort order seems worth a shot...
* Remove example file for pgsql extensionPeter Kokot2019-05-131-82/+0
| | | | | | | | This removes the example script in favour of the manual: https://www.php.net/manual/en/book.pgsql.php Patch for integrating these functions as an example has been submitted also to PHP manual via edit.php.net.
* [ci skip] Migrate tests READMEs to MarkdownPeter Kokot2019-05-122-16/+18
|
* 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-131-6/+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.
* Don't use php_strtok_r in build_tablenameNikita Popov2019-04-121-19/+13
| | | | | | | This is unnecessary convoluted... we just want to find the position of the dot. Using php_strtok_r requires a copy of the string, and the implementation also relied on the specific semantics of the scratch space that strtok_r uses.
* Include libpq-fs.h on Windows, tooChristoph M. Becker2019-04-121-3/+1
| | | | That's more future proof than defining hard-coded macros.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-101-3/+5
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-04-101-3/+5
| |\
| | * Fix 29nb_async_connect.phptNikita Popov2019-04-101-3/+5
| | | | | | | | | | | | | | | Intermediate states are unreliable across versions (I think), make sure we go through the whole connect procedure.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-103-8/+46
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-04-103-8/+46
| |\ \ | | |/
| | * Fix pgsql use after free trying to reuse closed connectionNikita Popov2019-04-103-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a connection is closed, we also need to remove the hash entry from the regular_list, as it now points to freed memory. To do this store a reverse mapping from the connection to the hash string. It would be nicer to introduce a wrapping structure for the pgsql link resource that could store the hash (and notices), but that would require large changes to the extension, so I'm going for a more minimal fix here.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-102-5/+22
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-04-102-5/+22
| |\ \ | | |/
| | * Fix use after free on pg_close() of default connectionNikita Popov2019-04-102-5/+22
| | |
| | * Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2018-11-182-1/+41
| | |\ | | | | | | | | | | | | | | | | * PHP-7.1: Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
| | | * Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT ↵Anatol Belski2018-11-182-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | TIMEZONE' data type Backport 369c991d and 282a63da to 7.1, closes #3634
| | | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1513-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | | * Trim trailing whitespace in *.phptPeter Kokot2018-10-1420-67/+67
| | | |
| | | * Sync leading and final newlines in source code filesPeter Kokot2018-10-143-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | | * Trim trailing whitespace in source code filesPeter Kokot2018-10-134-49/+49
| | | |
| | | * Convert CRLF line endings to LFPeter Kokot2018-10-131-78/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch simplifies line endings tracked in the Git repository and syncs them to all include the LF style instead of the CRLF files. Newline characters: - LF (\n) (*nix and Mac) - CRLF (\r\n) (Windows) - CR (\r) (old Mac, obsolete) To see which line endings are in the index and in the working copy the following command can be used: `git ls-files --eol` Git additionally provides `.gitattributes` file to specify if some files need to have specific line endings on all platforms (either CRLF or LF). Changed files shouldn't cause issues on modern Windows platforms because also Git can do output conversion is core.autocrlf=true is set on Windows and use CRLF newlines in all files in the working tree. Unless CRLF files are tracked specifically, Git by default tracks all files in the index using LF newlines.
| | * | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1513-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | * | Trim trailing whitespace in *.phptPeter Kokot2018-10-1420-67/+67
| | | |
| | * | Sync leading and final newlines in source code filesPeter Kokot2018-10-143-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | * | Trim trailing whitespace in source code filesPeter Kokot2018-10-134-49/+49
| | | |
* | | | Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-158-11/+11
| | | |
* | | | Use EXPECT when possibleGabriel Caruso2019-03-111-1/+1
| | | | | | | | | | | | | | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* | | | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Autoconf's default AS_HELP_STRING macro can properly format help strings [1] so watching out if columns are aligned manually is not anymore. [1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
* | | | Implement fine-grained conflict handlingNikita Popov2019-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Tests can specify conflict keys, either in --CONFLICTS-- or a per-directory CONFLICTS file. Non-conflicting tests may be run in parallel.
* | | | Remove outdated pgsql READMEFabien Villepinte2019-02-141-234/+0
| | | | | | | | | | | | | | | | [ci skip]
* | | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | | Remove yearly range from copyright noticeZeev Suraski2019-01-302-2/+2
| | | |
* | | | Remove unnecessary uses of object_and_properties_initNikita Popov2019-01-071-1/+1
| | | | | | | | | | | | | | | | Use object_init_ex instead if the properties are NULL.
* | | | Fix typo in testsFabien Villepinte2018-11-192-2/+2
| | | |
* | | | Merge branch 'PHP-7.3'Anatol Belski2018-11-182-1/+41
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | * PHP-7.3: Add test for bug #77047 FIX #77047: fixes regex for "time" data type
| * | | Add test for bug #77047Anatol Belski2018-11-181-0/+40
| | | |
| * | | FIX #77047: fixes regex for "time" data typeandy2018-11-181-1/+1
| | | |
| * | | Future-proof email addressesZeev Suraski2018-11-012-2/+2
| | | |
| * | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1513-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2