| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This fixes two related issues:
1. When a PS with cursor is used in store_result/get_result,
perform a COM_FETCH with maximum number of rows rather than
silently switching to an unbuffered result set (in the case of
store_result) or erroring (in the case of get_result).
In the future, we might want to make get_result unbuffered for
PS with cursors, as using cursors with buffered result sets
doesn't really make sense. Unlike store_result, get_result
isn't very explicit about what kind of result set is desired.
2. If the client did not request a cursor, but the server reports
that a cursor exists, ignore this and treat the PS as if it
has no cursor (i.e. to not use COM_FETCH). It appears to be a
server side bug that a cursor used inside an SP will be reported
to the client, even though the client cannot use the cursor.
Fixes bug #64638, bug #72862, bug #77935.
Closes GH-6518.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a larger overhaul of the mysqlnd result set infrastructure:
* Drop support for two different types of buffered results sets
("c" and "zval"). Possibly these made sense at some earlier
time, but now (with minor adjustments) one option is strictly
worse than the other. Buffered result sets already buffer the
full row packets, from which zvals can be decoded. The "zval"
style additionally also buffered the decoded zvals. As result
sets, even buffered ones, are generally only traversed once,
this just ends up wasting memory. Now, a potentially useful
variation here would be to buffer the decoded zvals instead of
the row packets, but that's not what the code was doing.
* To make it really strictly better, pre-allocate the zval row
buffer and reuse it for all rows. Previously the "c" style always
allocated a new buffer for each row.
* The fetch_row API now provides a populated zval[]. The task of
populating an array is deferred to fetch_row_into, which also
avoids duplicating this code in multiple places. The fetch_row_c
API is also implemented on top of fetch_row now, rather than
duplicating large parts of the code.
* The row fetching code for prepared statements and normal result
sets has been mostly merged. These already used the same
infrastructure, but prepared statements used separate row
fetching functions that were nearly the same as the normal ones.
This requires passing the stmt into the result set, rather than
just a flag. The only part that remains separate is reading of
unbuffered results in the presence of PS cursors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Retain the field, but always populate it with zero. This was
already the case for PS without length updating.
max_length has nothing lost in the field metadata -- it is a
property of the specific result set, and requires scanning the
whole result set to compute. PHP itself never uses max_length
with mysqlnd, it is only exposed in the raw mysqli API.
Keeping it for just that purpose is not worthwhile given the costs
involved. People who actually need this for some reason can easily
calculate it themselves, while making it obvious that the
calculation requires a full result set scan.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-8.0:
Fixed bug #67983
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #67983
|
| | |
| | |
| | |
| | |
| | | |
We need to check the BIT case first, otherwise it will get skipped
in INT_AND_FLOAT_NATIVE mode.
|
| | |
| | |
| | |
| | |
| | | |
ext/mysql is no longer supported, drop handling for it from
mysqlnd.
|
|/ /
| |
| |
| |
| | |
This has been unconditionally enabled for a long time already
(the actual conversion is behind an additional runtime flag).
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix mysqli_expire_password test for mariadb
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fix mysqli_expire_password test for mariadb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In MariaDB-10.4.3 EXPIRE passwords where supported for
MariaDB. This only behaves like MySQL when the system
variable disconnect_on_expired_passwords=1.
MariaDB if there was no password it could not be considered
expired. So the test is adjusted to use actual passwords.
(MariaDB commit a94b20a8e0d9e64eeaabdaaa7a3e03fcdb8a686e)
The error codes produced my MariaDB are different
however still conforming to the SQL specification.
Closes GH-6480.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0
(Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it.
It also breaks when testing against MariaDB.
As the alternate path in this test covers all supported MySQL and MariaDB
versions and a signifant portion of unsupported versions lets keep it simple.
Closes GH-6459.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
fix mysqli_stmt_get_result_metadata_fetch_field test for mariadb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
MariaDB extended the default decimal field to 39 characters
instead of MySQL's 31 characters.
This small change allows the test to pass on MySQL and MariaDB.
Closes GH-6484.
|
| | |
| | |
| | |
| | | |
These tests all require functions that no longer exist.
|
| | |
| | |
| | |
| | | |
%d because of line endings on Windows
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fixed error reporting in mysqli_stmt::__construct
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For the sake of simplicity, I've synchronized the implementation
with PHP 8, which means null values are also accepted.
Closes GH-6454.
|
| | |
| | |
| | |
| | |
| | | |
Due to a bug in the tidy script, most tests did not actually get
reindented...
|
| | |
| | |
| | |
| | |
| | |
| | | |
Reindent ext/mysqli tests on PHP-7.4, so they match with the
indentation on PHP-8.0. Otherwise merging test changes across
branches is very unpleasant.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #80312: change default engine from MyISAM to InnoDB in tests
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change mysqli and pdo_mysql tests configuration to use by default
InnoDB instead of MyISAM.
Closes GH-6405.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By simply dropping the additional checks, in line with the general
guideline of trusting the output of config scripts (this should
be migrated to pkg-config though).
Also drop the code for manually adding -z if mysql_config does not
-- that's not our problem.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Handle errors during next_result()
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
All other leftovers of this feature have been dropped in PHP 8,
so we should remove the property as well.
Closes GH-6407.
|
| | |
| | |
| | |
| | | |
Closes GH-6390.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix bug #72413: Segfault with get_result and PS cursors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We cannot simply switch to use_result here, because the fetch_row
methods in get_result mode and in use_result/store_result mode
are different: In one case it accepts a statement, in the other
a return value zval. Thus, doing a switch to use_result results
in a segfault when trying to fetch a row.
Actually supporting get_result with cursors would require adding
cursor support in mysqlnd_result, not just mysqlnd_ps. That would
be a significant amount of effort and, given the age of the issue,
does not appear to be particularly likely to happen soon.
As such, we simply generate an error when using get_result()
with cursors, which is much better than causing a segfault.
Instead, parameter binding needs to be used.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | | |
* PHP-7.4:
Handle mysqli errors in more cases
Sync test with master
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Report errors autocommit, commit, rollback and mysqli_stmt_attr_set.
Additionally, copy the error from conn to stmt when preparing fails,
so these errors are also handled by mysqli_stmt_prepare.
Closes GH-6157.
|
| | |
| | |
| | |
| | |
| | | |
Sync ext/mysqli/tests/mysqli_report.phpt with PHP-8.0/master, as
the current difference in indentation makes it hard to merge.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* 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.3:
Fix mysqli build with mysqlnd and without PDO
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This error condition should not actually be reachable, but change
it to be consistent with the other ones.
Also fix a memory leak.
Closes GH-6340.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make [] acceptable both for classes without constructors and
classes with a constructor that takes no arguments.
Closes GH-6336.
|
| | |
| | |
| | |
| | | |
Closes GH-6335
|
| | |
| | |
| | |
| | | |
We don't want an explicit null name hit the !name_len check.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As we went with $statement rather than $stmts in other places,
let's also use it in mysqli. The discrepancy with mysqli_stmt
is a bit unfortunate, but we can't be consistent with *both*.
Closes GH-6330.
|
| | |
| | |
| | |
| | | |
Refs GH-6172.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The constructor was already effectively inaccessible (protected
on a final class). This just makes it more obvious and removes
the implementation in favor of directly throwing.
Per the removed test, this was an unfinished feature, and I don't
think it makes a lot of sense to finish it -- the
mysqli_stmt::get_warnings() interface makes more sense than
direct construction.
Closes GH-6208.
|
| | |
| | |
| | |
| | | |
Closes GH-6172.
|
| | |
| | |
| | |
| | | |
Closes GH-6211
|
| | |
| | |
| | |
| | |
| | | |
This ctor requires a mysqli object. Possibly there was some
confusion with the mysqli_warning constructor here.
|
| | |
| | |
| | |
| | | |
Closes GH-6173
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
And drop the last remaining uses of it.
|