1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00
Commit Graph

122282 Commits

Author SHA1 Message Date
Nikita Popov
09cc096357 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #62889
2020-12-11 11:25:56 +01:00
Nikita Popov
43741a3f26 Fixed bug #62889
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().
2020-12-11 11:25:36 +01:00
Nikita Popov
b4ff7d4e2b Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
2020-12-11 10:53:04 +01:00
Nikita Popov
c927c831e6 PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
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...
2020-12-11 10:51:14 +01:00
Nikita Popov
2d6330dd5e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test cases for MariaDB
2020-12-11 09:53:50 +01:00
Dharman
54a63d91b8 Fix test cases for MariaDB
And remove unnecessary try-catch.

Closes GH-6505.
2020-12-11 09:53:20 +01:00
Nikita Popov
1af2edd105 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #72368
2020-12-10 16:54:52 +01:00
Nikita Popov
9e3ba775b7 Fixed bug #72368
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.
2020-12-10 16:53:08 +01:00
Nikita Popov
d6c3b8baab Merge branch 'PHP-8.0'
* PHP-8.0:
  Allow drivers to omit error code
2020-12-10 16:04:48 +01:00
Nikita Popov
a5527577e7 Allow drivers to omit error code
And thus generate error messages that match what PDO emulation
would generate.

This fixes the error message regression from the previous commit.
2020-12-10 16:04:33 +01:00
Nikita Popov
786cb68221 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #79131
2020-12-10 15:53:30 +01:00
Nikita Popov
15b51a215a Fixed bug #79131
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.
2020-12-10 15:53:23 +01:00
Dmitry Stogov
6ec7d4c406 Merge branch 'PHP-8.0'
* PHP-8.0:
  Eliminate some repeatable IS_REFERENCE checks
2020-12-10 14:46:03 +03:00
Dmitry Stogov
dde5572937 Eliminate some repeatable IS_REFERENCE checks 2020-12-10 14:45:54 +03:00
Nikita Popov
16e8c1af68 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #79872 by improving error message
2020-12-10 11:48:49 +01:00
Nikita Popov
288581fade Fixed bug #79872 by improving error message
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().
2020-12-10 11:46:29 +01:00
Nikita Popov
207fcb0523 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #76815
2020-12-10 11:24:27 +01:00
Nikita Popov
d63aedd173 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #76815
2020-12-10 11:24:19 +01:00
Nikita Popov
e450621f5e Fixed bug #76815
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.
2020-12-10 11:23:41 +01:00
Nikita Popov
030845eb68 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #71145
2020-12-10 10:31:43 +01:00
Nikita Popov
9b678bc4d5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #71145
2020-12-10 10:31:36 +01:00
Nikita Popov
4922049213 Fixed bug #71145
Consume any additional result sets when running INIT_COMMAND.
2020-12-10 10:28:10 +01:00
twosee
a38aaf6cbd Merge branch 'PHP-8.0'
* PHP-8.0:
  EXTERN_C wrapping for GC buffer APIs
2020-12-10 17:16:08 +08:00
twosee
26c7b9402d EXTERN_C wrapping for GC buffer APIs
Closes GH-6502.
2020-12-10 17:15:19 +08:00
Nikita Popov
bbd65c1ac7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Backport fix for bug #70066
2020-12-10 10:05:48 +01:00
Nikita Popov
c95680d4b7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Backport fix for bug #70066
2020-12-10 10:05:38 +01:00
Nikita Popov
f3d5877845 Backport fix for bug #70066
Given the number of duplicates this bug report had, it seems
worthwhile to fix this on PHP-7.4 as well.

Cherry-pick of 106e7e4bca.
2020-12-10 09:58:47 +01:00
Dmitry Stogov
d92b001d50 Merge branch 'PHP-8.0'
* PHP-8.0:
  Perform early guard type check for result of FETCH_CONSTANT
2020-12-09 22:25:04 +03:00
Dmitry Stogov
e9f9e9f863 Perform early guard type check for result of FETCH_CONSTANT 2020-12-09 22:24:03 +03:00
hgsgtk
6992c38ecc Fix typo 'variabled' in named_params/undef_var.phpt
Closes GH-6499.
2020-12-09 19:29:07 +01:00
Nikita Popov
e268709400 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #70066
2020-12-09 17:25:18 +01:00
Nikita Popov
106e7e4bca Fixed bug #70066
If we fall back to emulated prepared statements, destroy S->stmt,
so the code doesn't get confused about which mode we're in.
2020-12-09 17:24:30 +01:00
Nikita Popov
6b2d28b034 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #66878
2020-12-09 16:38:35 +01:00
Nikita Popov
fcfa7fd06b Fixed bug #66878
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.
2020-12-09 16:38:22 +01:00
Nikita Popov
77a06ccadd Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove unnecessary more_results() checks
  Add ifdef for mysqlnd only function
2020-12-09 16:19:58 +01:00
Nikita Popov
ef342b0730 Remove unnecessary more_results() checks
Just calling next_result() is sufficient.
2020-12-09 16:16:17 +01:00
Nikita Popov
a073b0218c Add ifdef for mysqlnd only function 2020-12-09 16:16:17 +01:00
Nikita Popov
f6b22da490 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Extract common code for handling PS results
  PDO MySQL: Use set_row_count() helper
2020-12-09 15:29:03 +01:00
Nikita Popov
b9ea8d6b96 PDO MySQL: Extract common code for handling PS results 2020-12-09 15:28:16 +01:00
Nikita Popov
fb69c7752d PDO MySQL: Use set_row_count() helper 2020-12-09 15:21:12 +01:00
Dmitry Stogov
974b4429cd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed IS_32BIT/IS_SIGNED_32BIT mess
2020-12-09 17:17:25 +03:00
Dmitry Stogov
8d268e8443 Fixed IS_32BIT/IS_SIGNED_32BIT mess 2020-12-09 17:16:54 +03:00
Nikita Popov
bd096f33b8 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Make sure nextRowset() works with partially consumed result
2020-12-09 14:51:11 +01:00
Nikita Popov
186b766368 PDO MySQL: Make sure nextRowset() works with partially consumed result
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.
2020-12-09 14:46:49 +01:00
Nikita Popov
39d20b474d Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Handle error during closeCursor()
2020-12-09 14:05:54 +01:00
Nikita Popov
23193e89e4 PDO MySQL: Handle error during closeCursor() 2020-12-09 14:04:30 +01:00
Nikita Popov
7eae14690f Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #78154
2020-12-09 12:47:48 +01:00
Nikita Popov
71b5f1446e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #78154
2020-12-09 12:47:34 +01:00
Nikita Popov
44b234a9bc Fixed bug #78154
Handle errors during next_result in exec.
2020-12-09 12:46:47 +01:00
Nikita Popov
de22980ac8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix stmt_free_result implementation and usage
  Make XFAILED test less broken
2020-12-09 11:24:48 +01:00