1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

1026 Commits

Author SHA1 Message Date
Matteo Beccati d411ea26f1 Fixed test for MySQL < 5.6
Refs GH-6172.
2020-09-28 08:52:21 +02:00
Nikita Popov 8138ed73d7 Make mysqli_warning constructor private
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.
2020-09-27 22:08:24 +02:00
Larry Garfield 02dc9ce6e5 Rename mysqli parameters to be more logical
Closes GH-6172.
2020-09-27 21:28:29 +02:00
Máté Kocsis 41b096b392 Promote a few forgotten warnings to exceptions
Closes GH-6211
2020-09-25 12:08:15 +02:00
Máté Kocsis e950ca13ea Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Nikita Popov 19314ff887 Fix some tests for libmysql 2020-09-18 18:01:04 +02:00
Nikita Popov 2d002258b8 Drop skipifemb.inc
And drop the last remaining uses of it.
2020-09-18 15:49:35 +02:00
Dharman 74d16999fc mysqli_set_charset now throws an mysqli_sql_exception when incorrect charset is provided
Closes GH-6142.
2020-09-18 14:57:59 +02:00
Nikita Popov 2abea9c3bb Merge branch 'PHP-7.4'
* PHP-7.4:
  Use MyISAM engine for new test
2020-09-18 14:50:11 +02:00
Nikita Popov d87c393a18 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Use MyISAM engine for new test
2020-09-18 14:50:02 +02:00
Nikita Popov 77f43e48ff Use MyISAM engine for new test
Travis on 7.3 is showing this error:

> The size of BLOB/TEXT data inserted in one transaction is greater
> than 10% of redo log size. Increase the redo log size using
> innodb_log_file_size.

Force MyISAM engine to avoid this.
2020-09-18 14:49:43 +02:00
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Nikita Popov 0582c40907 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #80107: Handling of large compressed packets
  Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled
2020-09-18 12:59:10 +02:00
Nikita Popov 5e7c5a82a5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #80107: Handling of large compressed packets
  Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled
2020-09-18 12:57:50 +02:00
Nikita Popov ecd9c42f9e Fix bug #80107: Handling of large compressed packets
There's two layers of packet splitting going on. First, packets
need to be split into having a payload of exactly 2^24-1 bytes or
being the last packet. If the split packet has size between 2^24-5
and 2^24-1 bytes, the compressed packets also needs to be split,
though the choice of split doesn't matter here. I'm splitting off
the first 8192 bytes, as that's what I observe libmysqlclient to be
doing.
2020-09-18 12:55:44 +02:00
Máté Kocsis c7ceebc42c Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled 2020-09-18 12:42:08 +02:00
Nikita Popov a03c1ed7aa Remove vestiges of embedded mysql from tests 2020-09-17 19:02:20 +02:00
Nikita Popov e9ac7d27ba Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix mysqli_release_savepoint() on mysqlnd
2020-09-17 16:09:41 +02:00
Nikita Popov 33069575d5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli_release_savepoint() on mysqlnd
2020-09-17 16:03:26 +02:00
Nikita Popov c3944c4c4f Fix mysqli_release_savepoint() on mysqlnd
mysqli_release_savepoint() was not actually releasing a savepoint...
2020-09-17 15:59:09 +02:00
Nikita Popov 86e002729f Fix some tests for libmysql 2020-09-17 15:27:02 +02:00
Nikita Popov e2b3c0e291 Remove checks for old libmysqlclient versions in tests 2020-09-17 15:02:35 +02:00
Dharman 8f56b7a755 mysqli: Promote warning in field_seek
Aligning the behaviour of fetch_field and field_seek.
2020-09-17 09:42:42 +02:00
Dharman 0d99a5618f Changed the wording of the error message
"cannot be used in MYSQLI_USE_RESULT mode" sounds more correct than "cannot be used with MYSQLI_USE_RESULT"

Closes GH-6137.
2020-09-16 11:10:11 +02:00
Matteo Beccati 3b2410ebf6 Fix test
follow-up to 7a95e94 for MySQL < 5.6
2020-09-16 10:06:19 +02:00
George Peter Banyard 7a95e943d6 Promote warnings to Error in MySQLi extension
Closes GH-5803
2020-09-15 19:12:02 +02:00
Máté Kocsis 2408991fc5 Remove unintendedly committed test 2020-09-15 14:49:30 +02:00
Máté Kocsis c37a1cd650 Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
Máté Kocsis 9975986b7e Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Christoph M. Becker 5072321c55 Improve test portability
We have to ensure that the attempted connection to the MySQL server
fails, and do that by passing an unknown host instead of falling back
to localhost.
2020-08-14 15:33:02 +02:00
Christoph M. Becker 64368f4786 Fix newly introduced test for Windows
The warning message is rather different there, but since that is
irrelevant for this test case, we just suppress the warning.
2020-08-14 14:36:32 +02:00
Nikita Popov ce38d3a919 Don't assert mysql->mysql is non-null
There is an edge case in constructor behavior where we can end up
with mysql->mysql being NULL (rather than mysql itself already being
NULL). I think that ultimately that's a bug in the constructor code,
and we should probably be destroying the outer structure on
construction failure as well. However it's pretty hard to unravel
with when considering all the construction permutations.
2020-08-14 12:44:13 +02:00
Nikita Popov f5e6f9bd27 Avoid fatal error on not found class in mysqli_fetch_object()
Instead use C zpp modifier and throw TypeError.
2020-08-13 16:13:02 +02:00
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
George Peter Banyard c74001997f Drop '#if 0' in mysqlnd_debug() from the MySQLnd extension
Closes GH-5587
2020-08-07 18:17:33 +02:00
Máté Kocsis d30cd7d7e7 Review the usage of apostrophes in error messages
Closes GH-5590
2020-07-10 21:05:28 +02:00
Tiffany 48eb635a0f [skip-ci] Add README for ext/mysqli tests
Closes GH-5804
2020-07-06 14:35:53 +02:00
Fabien Villepinte 0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Ayesh Karunaratne d114812faf [ci skip] Various typo fixes in stub comments and CHANGES file 2020-06-25 23:32:40 +02:00
Nikita Popov ff19ec2df3 Introduce InternalIterator
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.
2020-06-24 15:31:41 +02:00
Máté Kocsis b5c7a83dca Remove unnecessary PHPDoc-alike blocks from tests
Closes GH-5759
2020-06-24 13:13:44 +02:00
Máté Kocsis fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Alex Dowad 7b32d176d2 Avoid spurious failures of MySQL INSERT packet overflow test
This test creates a MySQL table called 'test'. In several cases, I have seen a spurious
test failure (in CI) with an error message saying: "table 'test' already exists".

It may be that another test had used a table with the same name and not cleaned it out
correctly. Or maybe we have multiple tests running in parallel in some CI environments,
or the same test DB being used for multiple runs of the test suite.

In any case, change the table name so it is exclusive to this test case only. Also, if
the test table exists at the beginning of the test, drop it.

Closes GH-5479
2020-05-01 12:25:42 +02:00
Nikita Popov 707cb18276 Revert "Insert one more debug output"
This reverts commit 45cb42166d.
2020-04-30 09:55:25 +02:00
Nikita Popov 45cb42166d Insert one more debug output 2020-04-28 21:06:32 +02:00
Nikita Popov 5293c6d6d4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Make mysqli_poll test more deterministic
2020-04-08 16:38:18 +02:00
Nikita Popov 5317ea6d57 Make mysqli_poll test more deterministic
Handle errors appearing in different order.
2020-04-08 16:36:22 +02:00
Christoph M. Becker d963b78523 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test for Windows
2020-03-23 16:26:19 +01:00
Christoph M. Becker efbc962c92 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test for Windows
2020-03-23 16:23:33 +01:00
Christoph M. Becker ba404f21e4 Fix test for Windows
Windows filenames may very well contain a colon, so we adjust the test
accordingly.
2020-03-23 16:22:45 +01:00