Commit Graph

57802 Commits

Author SHA1 Message Date
Nikita Popov
57d69b5137 Don't use explicitly nullable column in bug_73234.phpt
Firebird doesn't support this. It is nullable by default.

The test still fails, but now for a legitimate reason...
2020-12-22 10:34:54 +01:00
Nikita Popov
b4ffe54174 Add CONFLICTS file for PDO firebird tests 2020-12-22 10:31:35 +01:00
Nikita Popov
381624818b Fix bug_69356.phpt for firebird
Firebird does not support selecting without a table. Use the same
code we use elsewhere, which adds "FROM DUAL" or "FROM RDS$DATABASE"
as necessary.
2020-12-22 10:26:07 +01:00
Nikita Popov
9294074c09 PDO Firebird: Use recreate table
Firebird does not have "if exists", and the switch to exception
error mode broke the suppressed exec calls.

Firebird does have a "recreate table" command that effective
perform a "drop table if exists" beforehand.
2020-12-22 10:20:41 +01:00
Nikita Popov
a9253b0e22 Suppress zend_signals warnings if pdo_firebird loaded 2020-12-22 10:20:41 +01:00
George Peter Banyard
383779e502 Convert IMAP resource to object
Closes GH-6418
2020-12-22 03:06:35 +01:00
Nikita Popov
cc23fcfca6 PDO Firebird: Fix uninitialized var warning 2020-12-21 21:47:00 +01:00
Nikita Popov
737195c3ae PDO: Honor ATTR_STRINGIFY_FETCHES for booleans
Of the important PDO drivers, this affects only PDO PgSQL, as
both MySQL and SQLite do not return native boolean types.
2020-12-21 15:32:32 +01:00
Derick Rethans
5a3c1f61d4 Merge branch 'PHP-8.0' into master 2020-12-21 10:32:17 +00:00
Derick Rethans
288332077f Fixed bug #80376 (last day of the month causes runway cpu usage) 2020-12-21 10:31:41 +00:00
Derick Rethans
b043759cb4 Fixed bug #80376 (last day of the month causes runway cpu usage) 2020-12-21 10:30:40 +00:00
Nikita Popov
442fa318a0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #80537
2020-12-21 10:23:42 +01:00
Nikita Popov
27e250880b Fix bug #80537
This is an unavoidable breaking change to both the type and
parameter name.

The assertion that was supposed to prevent this was overly lax
and accepted any object type for string parameters.
2020-12-21 10:21:50 +01:00
Christopher Jones
4c5e47d113 Merge branch 'PHP-8.0'
* PHP-8.0:
  Description typo
2020-12-21 15:47:06 +11:00
Christopher Jones
d6731d69bd Description typo 2020-12-21 15:46:26 +11:00
Christopher Jones
9af1ad7a95 Merge branch 'PHP-8.0'
* PHP-8.0:
  Bundle PECL OCI8 3.0.1
2020-12-21 15:38:35 +11:00
Christopher Jones
74959b47cd Bundle PECL OCI8 3.0.1 2020-12-21 15:15:16 +11:00
Christoph M. Becker
78bdbfc24a Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"
2020-12-20 23:07:34 +01:00
Christoph M. Becker
32c6c29d79 Revert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"
This reverts commit b67c232189.
2020-12-20 23:07:02 +01:00
Christoph M. Becker
dccaaa956a Merge branch 'PHP-8.0'
* PHP-8.0:
  DateTime:: and DateTimeImmutable::getTimestamp() may return false
2020-12-20 19:32:36 +01:00
Christoph M. Becker
b67c232189 DateTime:: and DateTimeImmutable::getTimestamp() may return false 2020-12-20 19:32:12 +01:00
Christoph M. Becker
b85f0d1cd0 Convert file_info resources to objects
Besides our general desire to get rid of the legacy resource types,
this is particularly appealing for fileinfo, because there are already
respective objects.

Closes GH-5987.
2020-12-20 18:19:22 +01:00
Christoph M. Becker
54c866106e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix ext/date stubs
2020-12-20 18:14:40 +01:00
Christoph M. Becker
3c68f43251 Fix ext/date stubs
Closes GH-6523.
2020-12-20 18:14:20 +01:00
Nikita Popov
c7cccc1c9a Fix leak 2020-12-18 21:48:21 +01:00
Nikita Popov
7904a087ec Back memory stream by a zend_string
This allows reusing an existing zend_string inside a memory stream
without reallocating. For non-readonly streams, the string will
only get separated on write.
2020-12-18 17:07:07 +01:00
Nikita Popov
fd36b089cf Remove unused pdo_pgsql_column member 2020-12-18 15:50:59 +01:00
Nikita Popov
7a5cc7aa67 Add basic libmysqlclient CI job
This tests that mysqli and pdo_mysql build against libmysqlclient,
and that tests pass for pdo_mysql. mysqli has too many test failures.

This is not an officially supported configuration.
2020-12-18 12:52:54 +01:00
Nikita Popov
037512cfce Move fetch_all implementation out of mysqlnd
There doesn't seem to be any compelling reason to implement this
in mysqlnd rather than mysqli. It's just a loop over fetch_into.

This makes the function available under libmysqlclient as well,
and thus fixes bug #79372.
2020-12-18 12:27:30 +01:00
Nikita Popov
be93e5a120 Make mysqli_stmt_next_result available under libmysql
The libmysqlclient version we require supports mysql_stmt_next_result.
2020-12-18 11:32:41 +01:00
Nikita Popov
b88a493aaa PDO MySQL: Make test libmysql compatible 2020-12-18 11:28:15 +01:00
Nikita Popov
9718e5987f Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Handle boolean parameter binding with libmysql
2020-12-18 11:02:36 +01:00
Nikita Popov
51f57e7b81 PDO MySQL: Handle boolean parameter binding with libmysql
Previously boolean parameters were simply silently ignored...
2020-12-18 11:01:26 +01:00
Nikita Popov
4ceea869ee Merge branch 'PHP-8.0'
* PHP-8.0:
  MySQLnd: Support cursors in store/get result
2020-12-18 10:20:55 +01:00
Nikita Popov
ab84623108 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  MySQLnd: Support cursors in store/get result
2020-12-18 10:20:13 +01:00
Nikita Popov
bc166844e3 MySQLnd: Support cursors in store/get result
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.
2020-12-18 10:19:13 +01:00
Nikita Popov
73533c7dc9 PDO MySQL: Use correct type when setting INT_AND_FLOAT_NATIVE
mysqlnd expects this to be an unsigned int, not a bool.
2020-12-17 18:50:24 +01:00
Levi Morrison
710f3985c5 Skip invalid file descriptor test on Mac 2020-12-17 09:11:10 -07:00
Nikita Popov
108d1e9a50 MySQLnd: Remove mnd_malloc/free etc.
There were only two uses of non-zmm allocation functions left,
which really did not need to use the system allocator. Remove
them, and remove the system allocator based APIs.
2020-12-17 17:01:09 +01:00
Nikita Popov
8898c1e75c MySQLnd: Fix potential leak when reading cursor
Perform the same checkpointing twe do in other row reading
functions.
2020-12-17 16:14:17 +01:00
Nikita Popov
1144b85b82 MySQLnd: Avoid some reallocations in PS decoder 2020-12-17 14:41:47 +01:00
hgsgtk
003d9ba125 Fix typo 'pices' in strings/join_basic.phpt
Closes GH-6519.
2020-12-17 14:19:05 +01:00
Nikita Popov
c18b1aea28 PDO MySQL: Use native types for results
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).
2020-12-17 10:54:34 +01:00
Nikita Popov
33e904915e MySQLnd: Clean up and optimize mysqlnd result set handling
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.
2020-12-17 10:15:02 +01:00
Nikita Popov
890e4caf0b Drop support for max_length in mysqli_fetch_fields()
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.
2020-12-17 10:01:02 +01:00
Christoph M. Becker
58d459f1ef Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80521: Parameters with underscores no longer recognized
2020-12-16 20:06:01 +01:00
Christoph M. Becker
1860ef22eb Fix #80521: Parameters with underscores no longer recognized
We have to use the proper value for the bitmask.
2020-12-16 20:04:52 +01:00
Nikita Popov
bc4140d7a8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Detect overlarge step for character range()
2020-12-16 17:02:20 +01:00
Nikita Popov
c56701690a Detect overlarge step for character range()
This was done for int and float ranges, but not char ranges.

Fixes oss-fuzz #28666.
2020-12-16 17:01:15 +01:00
Nikita Popov
52435f94a3 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO MySQL: Use mysqlnd column names
2020-12-16 15:18:43 +01:00