| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ;)
|
|\
| |
| |
| |
| | |
* PHP-8.0:
PDO MySQL: Handle boolean parameter binding with libmysql
|
| |
| |
| |
| | |
Previously boolean parameters were simply silently ignored...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, PDO MySQL only fetched data as native int/float if
native prepared statements were used. This patch updates PDO to
have the same behavior for emulated prepared statements, and thus
removes the largest remaining discrepancy between these two modes.
Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control
whether native types are desired or not. The previous output can
be restored by enabling this option.
Most of the tests make use of that option, because this allows the
tests to work under libmysqlclient as well, which currently always
returns string results (independently of whether native or emulated
PS are used).
|
|\ \
| |/
| |
| |
| | |
* PHP-8.0:
PDO MySQL: Use mysqlnd column names
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mysqlnd already creates interned zend_strings for us, so let's
make use of them.
This also required updating the PDO case changing code to work
with potentially shared strings. For the lowercasing, use the
optimized zend_string_tolower() implementation.
|
| |
| |
| |
| |
| | |
This API already doesn't match libmysqlclient, so we may as well
use the zmm.
|
|/
|
|
|
| |
Rather than storing char* + size_t, use a zend_string*. Also
avoid various copies of the query string.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Repeated execute() with native PS failed to release the previous
result set on libmysqlclient.
Move freeing the result set into a common location.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
| |
If we fall back to emulated prepared statements, destroy S->stmt,
so the code doesn't get confused about which mode we're in.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Just calling next_result() is sufficient.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| | |
* PHP-7.4:
Fixed bug #63185
|
| | |
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fixed bug #80458
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Handle errors during PDO row fetch
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The EOF flag also gets set on error, so we always end up ignoring
errors here.
However, we should only check errors for unbuffered results. For
buffered results, this function is guaranteed not to error, and
querying the errno may return an unrelated error.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix bug #79375
|
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure deadlock errors are properly propagated and reports in
a number of places in mysqli and PDO MySQL.
This also fixes a memory and a segfault that can occur under these
conditions.
|
| | |
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix #78623: Regression caused by "SP call yields additional empty result set"
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fix #78623: Regression caused by "SP call yields additional empty result set"
|
| | |\
| | | |
| | | |
| | | |
| | | | |
* PHP-7.2:
Fix #78623: Regression caused by "SP call yields additional empty result set"
|
| | | |
| | | |
| | | |
| | | | |
This reverts commit 41a4379cb45419a376043ca5f8c5a2bca82cea7c.
|
|/ / /
| | |
| | |
| | | |
Closes GH-4732.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.3:
Fix #41997: SP call yields additional empty result set
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.2:
Fix #41997: SP call yields additional empty result set
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When stored procedures are called, the "final result set is a status
result that includes no result set". Calling `::nextRowset()` on the
actual last result set should return FALSE, since there is actually no
further result set to be processed.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Properly support binding boolean parameters with emulated prepared
statements disabled. Also add the necessary mysqlnd support for
MYSQL_TYPE_TINY.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.3:
Fix #77944: Wrong meta pdo_type for bigint on LLP64
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.2:
Fix #77944: Wrong meta pdo_type for bigint on LLP64
|
| | |
| | |
| | |
| | |
| | |
| | | |
When actually fetching the data, bigint (unsigned) column values are
returned as integers on LLP64 architectures, so their pdo_type has to
be PDO::PARAM_INT accordingly.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|