summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug #79132Nikita Popov2020-12-114-4/+67
| | | | | | Following cmb's suggestion and replacing the counter with a check against the bound_params HT, which ensures that both cannot go out of sync.
* PDO MySQL: Fix nextRowset() on libmysqlclient with native PSNikita Popov2020-12-112-93/+79
| | | | | | The logic after next_result should match the one after execute. This was the case for mysqlnd but not libmysqlclient, which used the non-PS logic.
* PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclientNikita Popov2020-12-112-4/+0
|
* PDO MySQL: Unskip bug_41125.phptNikita Popov2020-12-111-7/+30
| | | | | | | This test was always skipped (leftover debug statement?) Contrary to the comments in the test and the test expectation, this actually works fine.
* Fixed bug #67004Nikita Popov2020-12-112-4/+37
| | | | | | | Repeated execute() with native PS failed to release the previous result set on libmysqlclient. Move freeing the result set into a common location.
* PDO MySQL: Use stmt_next_result with libmysqlclient as wellNikita Popov2020-12-111-13/+12
| | | | | | | | | libmysqlclient added this function in version 5.5, which happens to be the minimum we support. If we have a prepared statement, we should use it on both mysqlnd and libmysqlclient, even if the handling afterwards is different. This fixes error handling with native prepared statements.
* PDO MySQL: Fix libmysql option testNikita Popov2020-12-111-37/+32
| | | | | | | The fact that getAttribute() fails for various libmysqlclient-only options is a known issue, and the test was taking that into account. However, the change of the default error mode broke the handling. We need to handle the exceptions now.
* Fixed bug #62889Nikita Popov2020-12-112-25/+19
| | | | | | | | | | | Our minimum libmysqlclient version requirement is high enough that we don't need to check for MYSQL_OPT_LOCAL_INFILE support. However, the mysql_get_option() function seems to only be available since 5.7 (though it's really hard to find any definitie information on when MySQL introduced certain functions or changes...) so we need to store the value of the flag locally to make it available through getAttribute().
* PDO MySQL: Fix leak with libmysqlclient and multiple rowsetsNikita Popov2020-12-111-46/+29
| | | | | | | | stmt->column_count gets reset before the next_rowset handler is invoked, so we need to fetch the value from the result set instead. Arguably PDO should be separating the destruction of the previous result set and the switch to the next result set more cleanly...
* Fix test cases for MariaDBDharman2020-12-113-85/+57
| | | | | | And remove unnecessary try-catch. Closes GH-6505.
* Fixed bug #72368Nikita Popov2020-12-1010-69/+111
| | | | | | | | | 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-106-9/+14
| | | | | | | 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-108-12/+19
| | | | | | | | | | | | 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.
* Eliminate some repeatable IS_REFERENCE checksDmitry Stogov2020-12-101-15/+47
|
* Fixed bug #79872 by improving error messageNikita Popov2020-12-102-6/+40
| | | | | | | | The actual behavior here is correct, but the previous error message was misleading, as neither fetchAll() nor buffered queries would help in this situation. Instead it is necessary to consume all rowsets, which can be done by either unsetting the statement or calling closeCursor().
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-102-0/+40
|\ | | | | | | | | * PHP-7.4: Fixed bug #76815
| * Fixed bug #76815Nikita Popov2020-12-102-0/+40
| | | | | | | | | | | | When we receive an error while reading a result set, we should assume that no more result sets are available. libmysqlclient implements the same behavior.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-102-5/+32
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #71145
| * Fixed bug #71145Nikita Popov2020-12-102-5/+32
| | | | | | | | Consume any additional result sets when running INIT_COMMAND.
| * Backport fix for bug #70066Nikita Popov2020-12-104-11/+35
| | | | | | | | | | | | | | Given the number of duplicates this bug report had, it seems worthwhile to fix this on PHP-7.4 as well. Cherry-pick of 106e7e4bca7c0fd975eb219b18e3c34957ba8657.
* | Perform early guard type check for result of FETCH_CONSTANTDmitry Stogov2020-12-095-26/+65
| |
* | Fixed bug #70066Nikita Popov2020-12-094-11/+35
| | | | | | | | | | If we fall back to emulated prepared statements, destroy S->stmt, so the code doesn't get confused about which mode we're in.
* | Fixed bug #66878Nikita Popov2020-12-093-1/+45
| | | | | | | | | | | | | | | | | | | | Keep track of whether we have fully consumed all result sets, either using nextRowset() calls or closeCursor() and skip the attempt to consume remaining results sets during destruction in that case. Especiall if closeCursor() has been used, we really shouldn't have this sort of cross-statement inference.
* | Remove unnecessary more_results() checksNikita Popov2020-12-091-17/+1
| | | | | | | | Just calling next_result() is sufficient.
* | Add ifdef for mysqlnd only functionNikita Popov2020-12-091-0/+2
| |
* | PDO MySQL: Extract common code for handling PS resultsNikita Popov2020-12-091-46/+28
| |
* | PDO MySQL: Use set_row_count() helperNikita Popov2020-12-091-9/+2
| |
* | Fixed IS_32BIT/IS_SIGNED_32BIT messDmitry Stogov2020-12-091-17/+17
| |
* | PDO MySQL: Make sure nextRowset() works with partially consumed resultNikita Popov2020-12-092-16/+18
| | | | | | | | | | | | This was already working in all cases apart from native prepared statements with unbuffered queries. In that case invoking stmt_free_result() addresses the issue.
* | PDO MySQL: Handle error during closeCursor()Nikita Popov2020-12-092-1/+32
| |
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-092-1/+35
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #78154
| * Fixed bug #78154Nikita Popov2020-12-092-1/+35
| | | | | | | | Handle errors during next_result in exec.
* | Fix stmt_free_result implementation and usageNikita Popov2020-12-093-9/+1
| | | | | | | | | | | | | | | | | | | | | | Two bugs both affecting the bug_pecl_7976.phpt test ("works with mysqlnd" haha): * We should not change the connection state in stmt_free_result. This makes mysql_stmt_free_result usable under mysqlnd and not just libmysqlclient. * If we call mysql_stmt_free_result, we still need to consume any outstanding result sets.
* | Make XFAILED test less brokenNikita Popov2020-12-091-2/+0
| | | | | | | | | | At least allow it to print some output rather than throw right away...
* | Handle changing column count in mysqlnd result bindingNikita Popov2020-12-092-50/+25
| | | | | | | | | | | | | | | | | | | | If the count changes from prepare to execute and result_bind is alreadly allocated, reallocate it there. This is something of a hack. It would be cleaner to require that result bindings are registered only after execute, when the final result set fields are known. But mysqli at least directly exposes this to the user, so we have no guarantee.
* | PDO MySQL: Normalize handling of empty stored procedure result setNikita Popov2020-12-086-36/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL always returns a trailing empty result set for stored procedure calls, which is used to convey status information. The PDO MySQL implementation is presently confused about what to do with it: If mysqlnd is used and native prepared statements are used, this result set is skipped. In all other cases it is not skipped. We also have quite a few XFAILed tests relating to this. This patch normalizes (for PHP-8.0 only) the behavior towards always retaining the empty result set. This is simply how MySQL stored procedures work (some expletives omitted here) and we can't distinguish this "useless" result set from an empty result of a multi query. Multi queries are not a concern for native prepared statements, as PDO does not allow them in that case, but they are a concern for emulated prepared statements. Closes GH-6497.
* | Handle column count change in PDO MySQLNikita Popov2020-12-085-77/+108
| | | | | | | | | | | | | | | | This has been fixed for PDO SQlite by GH-4313, however the same issue also applied to PDO MySQL. Move the column count setting function into the main PDO layer (and export it) and then use it in both PDO SQLite and PDO MySQL.
* | Enable XFAILed testNikita Popov2020-12-081-4/+1
| | | | | | | | | | This one had a rather scary XFAIL message, but seems to work just fine...
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-12-082-4/+34
|\ \ | |/ | | | | | | * PHP-7.4: Fix #48725: Support for flushing in zlib stream
| * Fix #48725: Support for flushing in zlib streamChristoph M. Becker2020-12-082-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `php_zlib_deflate_filter()` is called with `PSFS_FLAG_FLUSH_INC` but without new buckets being available (e.g. because a user calls `rewind()` after writing to the stream), we have to make sure that any pending data are flushed. This could basically be done like in the attached patch[1], but that could cause unnessary flushes, which can be harmful for compression, and adds unnecessary flush markers to the stream. Thus, we use the `php_zlib_filter_data.finished` field, which has not been used for `zlib.deflate` filters, and properly keep track of the need to flush. [1] <https://bugs.php.net/patch-display.php?bug_id=48725&patch=zlib-filter-flush-fix.patch&revision=latest> Closes GH-6019.
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-12-085-1/+146
|\ \ | |/ | | | | | | * PHP-7.4: Fix #77069: stream filter loses final block of data
| * Fix #77069: stream filter loses final block of dataChristoph M. Becker2020-12-085-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading from a stream may return greater than zero, but nonetheless the stream's EOF flag may have been set. We have to cater to this condition by setting the close flag for filters. We also have to cater to that change in the zlib.inflate filter: If `inflate()` is called with flush mode `Z_FINISH`, but the output buffer is not large enough to inflate all available data, it fails with `Z_BUF_ERROR`. However, `Z_BUF_ERROR` is not fatal; in fact, the zlib manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error." Hence, we do so. Closes GH-6001.
* | ldap_exop_whoami() does not return TRUEChristoph M. Becker2020-12-082-3/+3
| | | | | | | | Closes GH-6496.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-082-0/+68
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #63185
| * Fixed bug #63185Nikita Popov2020-12-082-0/+68
| |
* | Avoid unnecessary checksDmitry Stogov2020-12-081-2/+6
| |
* | Fix another typed resource issue in unserializationNikita Popov2020-12-072-3/+33
| | | | | | | | | | | | | | | | | | | | | | We also need to discard old entries in the ref_props HT when values are overwritten. We should really forbid these kinds of overwrites. I believe they can only occur in manually crafted serialization strings, and cause so many problems... Fixes oss-fuzz #28257.
* | Fixed bug #80480 (Segmentation fault with JIT enabled)Dmitry Stogov2020-12-071-21/+37
| |
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-042-10/+195
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #80458
| * Fixed bug #80458Dharman2020-12-042-11/+196
| | | | | | | | | | | | | | | | | | If there is no result set (e.g. for upsert queries), still allow fetching to occur without error, i.e. treat it the same way as an empty result set. This normalizes behavior between native and emulated prepared statements and addresses a regression in PHP 7.4.13.