]> granicus.if.org Git - php/commitdiff
Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression...
authorMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 15 Sep 2020 17:14:57 +0000 (19:14 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 18 Sep 2020 10:42:08 +0000 (12:42 +0200)
ext/mysqli/tests/mysqli_real_connect_compression_error.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt
new file mode 100644 (file)
index 0000000..114f819
--- /dev/null
@@ -0,0 +1,51 @@
+--TEST--
+Bug #80107 mysqli_query() fails for ~16 MB long query when compression is enabled
+--XFAIL--
+The second INSERT query fails with MySQL server has gone away
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--INI--
+mysqli.allow_local_infile=1
+--FILE--
+<?php
+
+include("connect.inc");
+
+// Insert with compression disabled:
+
+$mysqli = mysqli_init();
+$result = my_mysqli_real_connect($mysqli, $host, $user, $passwd, $db, $port, $socket);
+$mysqli->query("DROP TABLE IF EXISTS test");
+$mysqli->query("CREATE TABLE test (`blob` LONGBLOB NOT NULL)");
+
+$data = str_repeat("x", 16777174);
+$mysqli->query("INSERT INTO $db.test(`blob`) VALUE ('$data')");
+
+var_dump(mysqli_error_list($mysqli));
+$mysqli->close();
+
+// Insert with compression enabled:
+
+$mysqli = mysqli_init();
+$result = my_mysqli_real_connect($mysqli, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS);
+
+$data = str_repeat("x", 16777174);
+$mysqli->query("INSERT INTO $db.test(`blob`) VALUE ('$data')");
+
+var_dump(mysqli_error_list($mysqli));
+$mysqli->close();
+
+?>
+--CLEAN--
+<?php
+require_once("clean_table.inc");
+?>
+--EXPECT--
+array(0) {
+}
+array(0) {
+}