summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Christoph M. Becker2021-03-183-5/+80
|\ | | | | | | | | * PHP-8.0: Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-183-2/+77
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
| | * Fix #80783: PDO ODBC truncates BLOB records at every 256th byteChristoph M. Becker2021-03-183-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not guaranteed, that the driver inserts only a single NUL byte at the end of the buffer. Apparently, there is no way to find out the actual data length in the buffer after calling `SQLGetData()`, so we adjust after the next `SQLGetData()` call. We also prevent PDO::ODBC_ATTR_ASSUME_UTF8 from fetching garbage, by fetching all chunks with the same C type. Closes GH-6716.
| * | Fix signed/unsigned warnings in PDO ODBCNikita Popov2021-03-173-13/+15
| | | | | | | | | | | | | | | | | | Add add skipif to test. (cherry picked from commit aa58db723221ec891d4432621003bfa55dc15edf)
* | | Initalize return_value before useChristoph M. Becker2021-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we likely segfault[1]. We fix the same issue for PDO_Firebird as well. [1] <https://ci.appveyor.com/project/php/php-src/builds/38267250/job/6y3ngn1k6ryxx6j3?fullLog=true#L9783> Closes GH-6785.
* | | Add API to fetch bool value for PDO attribute valuesGeorge Peter Banyard2021-03-171-1/+6
| | | | | | | | | | | | Closes GH-6766
* | | Refactor PDO doer handler to use zend_stringGeorge Peter Banyard2021-01-191-2/+2
| | |
* | | Voidify PDO's fetch_error handlerGeorge Peter Banyard2021-01-061-3/+1
| | |
* | | Boolify PDO's preparer handlerGeorge Peter Banyard2021-01-061-6/+6
| | |
* | | Voidify PDO's closer handlerGeorge Peter Banyard2021-01-061-3/+1
| | |
* | | Boolify PDO's set_attribute driver functionGeorge Peter Banyard2021-01-061-3/+3
| | |
* | | Boolify PDO's transaction handlersGeorge Peter Banyard2021-01-061-12/+12
| | | | | | | | | | | | This includes begin(), commit(), rollBack(), and inTransaction()
* | | Rewrite PDO result bindingNikita Popov2020-12-221-67/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ;)
* | | PDO: Store/pass query_string as zend_stringNikita Popov2020-12-141-8/+7
| | | | | | | | | | | | | | | Rather than storing char* + size_t, use a zend_string*. Also avoid various copies of the query string.
* | | Fix signed/unsigned warnings in PDO ODBCNikita Popov2020-12-143-13/+15
| | | | | | | | | | | | Add add skipif to test.
* | | Add GC support for PDO driver dataNikita Popov2020-10-121-1/+5
|/ / | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-282-1/+19
|\ \ | |/ | | | | | | * PHP-7.4: Fix #67465: NULL Pointer dereference in odbc_handle_preparer
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-282-1/+19
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #67465: NULL Pointer dereference in odbc_handle_preparer
| | * Fix #67465: NULL Pointer dereference in odbc_handle_preparerChristoph M. Becker2020-09-282-1/+19
| | | | | | | | | | | | | | | | | | We have to initialize `stmt->driver_data` before we use it. Closes GH-6225.
* | | Do not register quoter handler in ODBCGeorge Peter Banyard2020-09-281-3/+5
| | | | | | | | | | | | This functionallity is not (yet) implemented and therefore gives a bogus error while using PDO
* | | Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-201-1/+1
| | | | | | | | | | | | Closes GH-6173
* | | Run tidyNikita Popov2020-09-181-4/+4
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-092-0/+2
| | | | | | | | | | | | Closes GH-5958
* | | Get rid of empty function entriesMáté Kocsis2020-08-011-7/+1
| | | | | | | | | | | | Closes GH-5917
* | | Remove proto comments from C filesMax Semenik2020-07-061-4/+2
| | | | | | | | | | | | Closes GH-5758
* | | Properly initialize displaysizeChristoph M. Becker2020-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Microsoft's `SQLColAttribute()` documentation[1]: | Please note that some drivers may only write the lower 32-bit or | 16-bit of a buffer and leave the higher-order bit unchanged. | Therefore, applications should initialize the value to 0 before | calling this function. [1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function>
* | | Fix MSVC level 1 (severe) warningsChristoph M. Becker2020-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We fix (hopefully) all instances of: * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312> `zend_llist_add_element()` and `zend_llist_prepend_element()` now explicitly expect a *const* pointer. We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress C4090; this should prevent accidential removal of the cast by clarifying the intention, and makes it easier to remove the casts if the issue[1] will be resolved sometime. [1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
* | | Fix [-Wundef] warning in PDO ODBC extensionGeorge Peter Banyard2020-05-201-17/+17
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-02-172-6/+21
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79038: PDOStatement::nextRowset() leaks column values
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-172-6/+21
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79038: PDOStatement::nextRowset() leaks column values
| | * Fix #79038: PDOStatement::nextRowset() leaks column valuesChristoph M. Becker2020-02-172-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firstly, we must not rely on `stmt->column_count` when freeing the driver specific column values, but rather store the column count in the driver data. Since the column count is a `short`, 16 bit are sufficient, so we can store it in reserved bits of `pdo_odbc_stmt`. Furthermore, we must not allocate new column value storage when the statement is not executed, but rather when the column value storage has not been allocated. Finally, we have to introduce a driver specific `cursor_closer` to avoid that `::closeCursor()` calls `odbc_stmt_next_rowset()` which then frees the column value storage, because it may be still needed for bound columns.
| | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-152-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-1/+1
| | |
| | * Sync leading and final newlines in source code filesPeter Kokot2018-10-141-2/+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
* | | Reindent phpt filesNikita Popov2020-02-032-35/+35
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-255-10/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Merge branch 'PHP-7.4'Peter Kokot2019-07-141-4/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Remove conditional calls of always available macros
| * | 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
* | | Merge branch 'PHP-7.4'Peter Kokot2019-07-081-16/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Simplify PHP_CHECK_PDO_INCLUDES calls
| * | 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
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-05-141-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Prevent further potential test conflicts
| * | Prevent further potential test conflictsChristoph M. Becker2019-05-141-0/+1
| | |
* | | Merge branch 'PHP-7.4'Peter Kokot2019-05-121-4/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Normalize comments in *nix build system m4 files
| * | Normalize comments in *nix build system m4 filesPeter Kokot2019-05-121-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'PHP-7.4'Peter Kokot2019-03-151-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Replace dirname(__FILE__) by __DIR__ in tests
| * | Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-151-1/+1
| | |
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-03-121-16/+0
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Cleanup unused module globals
| * | Cleanup unused module globalsDmitry Stogov2019-03-121-16/+0
| | |
* | | Merge branch 'PHP-7.4'Peter Kokot2019-03-071-20/+12
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Add AS_HELP_STRING to *nix build configure options
| * | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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