From 9695c66b10a47cf3c5d9c0488a38a57252db7027 Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 22:26:55 +0000 Subject: [PATCH 1/6] Add CLEAN to mysqli test --- ext/mysqli/tests/bug66124.phpt | 14 +++++++++----- ext/mysqli/tests/bug75018.phpt | 6 +++++- ext/mysqli/tests/bug77597.phpt | 12 ++++++++---- .../tests/mysqli_insert_packet_overflow.phpt | 7 +++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt index cede635e144b8..d7231cf6fcd05 100644 --- a/ext/mysqli/tests/bug66124.phpt +++ b/ext/mysqli/tests/bug66124.phpt @@ -8,15 +8,15 @@ require_once('skipifconnectfailure.inc'); ?> --FILE-- close(); ?> done +--CLEAN-- + --EXPECT-- Using 'i': insert id:1311200011005001566=>1311200011005001566 diff --git a/ext/mysqli/tests/bug75018.phpt b/ext/mysqli/tests/bug75018.phpt index 28af0bb77c317..d342f836f586a 100644 --- a/ext/mysqli/tests/bug75018.phpt +++ b/ext/mysqli/tests/bug75018.phpt @@ -11,7 +11,7 @@ require_once("connect.inc"); $mysqli = new mysqli("$host:$port", $user, $passwd, $db); -$tbl = "test_bug75018"; +$tbl = "test"; $sql = "DROP TABLE IF EXISTS $tbl"; $mysqli->query($sql); @@ -30,6 +30,10 @@ while ($row = $result->fetch_assoc()) { var_dump($row['bit_column_1']); } +?> +--CLEAN-- + --EXPECT-- string(1) "0" diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt index 52ae874454d55..7dfda4806375f 100644 --- a/ext/mysqli/tests/bug77597.phpt +++ b/ext/mysqli/tests/bug77597.phpt @@ -12,17 +12,21 @@ if (!defined('MYSQLI_STORE_RESULT_COPY_DATA')) die('skip requires mysqlnd'); require_once("connect.inc"); $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); -$mysqli->query('DROP TABLE IF EXISTS a'); -$mysqli->query('CREATE TABLE a (b int)'); -$mysqli->query('INSERT INTO a VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)'); +$mysqli->query('DROP TABLE IF EXISTS test'); +$mysqli->query('CREATE TABLE test (b int)'); +$mysqli->query('INSERT INTO test VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)'); -$mysqli->real_query("SELECT * FROM a"); +$mysqli->real_query("SELECT * FROM test"); $result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA); $field = $result->fetch_field(); var_dump($field->name); +?> +--CLEAN-- + --EXPECT-- string(1) "b" diff --git a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt index 105b3276d3bb4..b111fd05f4c07 100644 --- a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt +++ b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt @@ -113,5 +113,12 @@ memory_limit=256M print "done!"; ?> +--CLEAN-- +query('DROP TABLE test__mysqli_insert_packet_overflow'); +$link->close(); +?> --EXPECT-- done! From abc2939cc8562b34938735d1c0b3d5096e6fe99b Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 22:37:03 +0000 Subject: [PATCH 2/6] Add CLEAN to PDO test --- ext/pdo_mysql/tests/bug75177.phpt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/pdo_mysql/tests/bug75177.phpt b/ext/pdo_mysql/tests/bug75177.phpt index b580c9a929c57..104734f3aca67 100644 --- a/ext/pdo_mysql/tests/bug75177.phpt +++ b/ext/pdo_mysql/tests/bug75177.phpt @@ -12,7 +12,7 @@ if (!MySQLPDOTest::isPDOMySQLnd()) die('skip only for mysqlnd'); require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $pdo = MySQLPDOTest::factory(); -$tbl = "tbl_bug75177"; +$tbl = "test"; $pdo->query("DROP TABLE IF EXISTS $tbl"); $pdo->query("CREATE TABLE $tbl (`bit` bit(8)) ENGINE=InnoDB"); $pdo->query("INSERT INTO $tbl (`bit`) VALUES (1)"); @@ -31,6 +31,11 @@ foreach ($ret as $i) { var_dump($i["bit"]); } +?> +--CLEAN-- + --EXPECT-- int(1) From 141b2a30ee5f65c95270cc4c118ab11ac5d00530 Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 22:54:54 +0000 Subject: [PATCH 3/6] Add CLEAN for SP for PDO --- ext/pdo_mysql/tests/bug63185.phpt | 6 ++++++ ext/pdo_mysql/tests/bug76815.phpt | 7 +++++++ ext/pdo_mysql/tests/bug_41997.phpt | 6 ++++++ .../tests/pdo_mysql_stmt_variable_columncount.phpt | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/ext/pdo_mysql/tests/bug63185.phpt b/ext/pdo_mysql/tests/bug63185.phpt index 4bf6d7e4db657..c3e79401144aa 100644 --- a/ext/pdo_mysql/tests/bug63185.phpt +++ b/ext/pdo_mysql/tests/bug63185.phpt @@ -41,6 +41,12 @@ try { } var_dump($st->fetchAll()); +?> +--CLEAN-- +query('DROP PROCEDURE IF EXISTS test_procedure_error_at_second'); ?> --EXPECTF-- array(1) { diff --git a/ext/pdo_mysql/tests/bug76815.phpt b/ext/pdo_mysql/tests/bug76815.phpt index b5c8577b07c04..91f6416aa7295 100644 --- a/ext/pdo_mysql/tests/bug76815.phpt +++ b/ext/pdo_mysql/tests/bug76815.phpt @@ -27,6 +27,13 @@ try { unset($st); echo "Ok.\n"; +?> +--CLEAN-- +query('DROP FUNCTION IF EXISTS tst'); +$pdo->query('DROP PROCEDURE IF EXISTS tst2'); ?> --EXPECT-- SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'tst()' at row 1 diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt index 8d20ed737e195..7035721d0c8e1 100644 --- a/ext/pdo_mysql/tests/bug_41997.phpt +++ b/ext/pdo_mysql/tests/bug_41997.phpt @@ -37,6 +37,12 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); var_dump($stmt->errorInfo()); print "done!"; ?> +--CLEAN-- +exec("DROP PROCEDURE IF EXISTS p"); +?> --EXPECT-- array(1) { [0]=> diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt index 110710dd118c6..f044672f4a6f6 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt @@ -117,5 +117,11 @@ if ($version < 50000) print "done!"; ?> +--CLEAN-- +query('DROP PROCEDURE IF EXISTS p'); +?> --EXPECT-- done! From 84acff1dcb7bac22413a9d1e203afe161d0b6ea2 Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 22:55:59 +0000 Subject: [PATCH 4/6] Add CLEAN for SP for mysqli --- ext/mysqli/tests/bug77935.phpt | 7 +++++++ ext/mysqli/tests/mysqli_query_unicode.phpt | 8 ++++++++ ext/mysqli/tests/mysqli_stmt_multires.phpt | 8 ++++---- ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt | 7 +++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ext/mysqli/tests/bug77935.phpt b/ext/mysqli/tests/bug77935.phpt index 7a39ac0065398..9b2269f966f98 100644 --- a/ext/mysqli/tests/bug77935.phpt +++ b/ext/mysqli/tests/bug77935.phpt @@ -30,6 +30,13 @@ while ($row = $result->fetch_assoc()) { var_dump($row); } +?> +--CLEAN-- +query('DROP PROCEDURE IF EXISTS testSp'); +$link->close(); ?> --EXPECT-- array(1) { diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index b62418508f106..8773d90f17deb 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -82,6 +82,14 @@ mysqli_close($link); print "done!"; ?> +--CLEAN-- +query('DROP PROCEDURE IF EXISTS процедурка'); +$link->query('DROP FUNCTION IF EXISTS функцийка'); +$link->close(); +?> --EXPECTF-- array(1) { ["правилен"]=> diff --git a/ext/mysqli/tests/mysqli_stmt_multires.phpt b/ext/mysqli/tests/mysqli_stmt_multires.phpt index 73af79e2b166e..a854dcd28842f 100644 --- a/ext/mysqli/tests/mysqli_stmt_multires.phpt +++ b/ext/mysqli/tests/mysqli_stmt_multires.phpt @@ -94,10 +94,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS p123')) { - printf("[001] [%d] %s\n", $link->error, $link->errno); - } +require_once('connect.inc'); +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP PROCEDURE IF EXISTS p123'); +$link->close(); ?> --EXPECT-- string(4) "pre:" diff --git a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt index ed15d10e4a4b3..b82e59af5fb4f 100644 --- a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt +++ b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt @@ -70,6 +70,13 @@ while ($row = $result->fetch_assoc()) { } $stmt->next_result(); +?> +--CLEAN-- +query('DROP PROCEDURE IF EXISTS testPs'); +$link->close(); ?> --EXPECT-- use_result: From a9886aa0a10b6bf95b739715725bf605b0fea0e0 Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 23:17:49 +0000 Subject: [PATCH 5/6] Fix typo --- ext/mysqli/tests/connect.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc index 604ecc97ea344..0fb3cff66c83f 100644 --- a/ext/mysqli/tests/connect.inc +++ b/ext/mysqli/tests/connect.inc @@ -51,7 +51,7 @@ if (!function_exists('my_mysqli_connect')) { /** - * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible + * Whenever possible, please use this wrapper to make testing of MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS)? */ @@ -71,7 +71,7 @@ } /** - * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible + * Whenever possible, please use this wrapper to make testing of MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS) */ From 2f956636e6db3fb62bee74d410ed1d212bc32093 Mon Sep 17 00:00:00 2001 From: Dharman Date: Fri, 5 Mar 2021 23:31:24 +0000 Subject: [PATCH 6/6] Remove redundant parentheses --- ext/mysqli/tests/bug66124.phpt | 2 +- ext/mysqli/tests/bug75018.phpt | 2 +- ext/mysqli/tests/bug77597.phpt | 2 +- ext/mysqli/tests/bug77935.phpt | 2 +- ext/mysqli/tests/mysqli_insert_packet_overflow.phpt | 2 +- ext/mysqli/tests/mysqli_query_unicode.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_multires.phpt | 2 +- ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt | 2 +- ext/pdo_mysql/tests/bug63185.phpt | 2 +- ext/pdo_mysql/tests/bug76815.phpt | 2 +- ext/pdo_mysql/tests/bug_41997.phpt | 2 +- ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt index d7231cf6fcd05..8a2e5a5f73162 100644 --- a/ext/mysqli/tests/bug66124.phpt +++ b/ext/mysqli/tests/bug66124.phpt @@ -93,7 +93,7 @@ $link->close(); done --CLEAN-- --EXPECT-- Using 'i': diff --git a/ext/mysqli/tests/bug75018.phpt b/ext/mysqli/tests/bug75018.phpt index d342f836f586a..ce522aab87078 100644 --- a/ext/mysqli/tests/bug75018.phpt +++ b/ext/mysqli/tests/bug75018.phpt @@ -33,7 +33,7 @@ while ($row = $result->fetch_assoc()) { ?> --CLEAN-- --EXPECT-- string(1) "0" diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt index 7dfda4806375f..cd9055deb7870 100644 --- a/ext/mysqli/tests/bug77597.phpt +++ b/ext/mysqli/tests/bug77597.phpt @@ -26,7 +26,7 @@ var_dump($field->name); ?> --CLEAN-- --EXPECT-- string(1) "b" diff --git a/ext/mysqli/tests/bug77935.phpt b/ext/mysqli/tests/bug77935.phpt index 9b2269f966f98..9917488a25c38 100644 --- a/ext/mysqli/tests/bug77935.phpt +++ b/ext/mysqli/tests/bug77935.phpt @@ -33,7 +33,7 @@ while ($row = $result->fetch_assoc()) { ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS testSp'); $link->close(); diff --git a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt index b111fd05f4c07..1285fe1f5052c 100644 --- a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt +++ b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt @@ -115,7 +115,7 @@ memory_limit=256M ?> --CLEAN-- query('DROP TABLE test__mysqli_insert_packet_overflow'); $link->close(); diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index 8773d90f17deb..6a5e1be912404 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -84,7 +84,7 @@ mysqli_close($link); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS процедурка'); $link->query('DROP FUNCTION IF EXISTS функцийка'); diff --git a/ext/mysqli/tests/mysqli_stmt_multires.phpt b/ext/mysqli/tests/mysqli_stmt_multires.phpt index a854dcd28842f..07abac4dcc028 100644 --- a/ext/mysqli/tests/mysqli_stmt_multires.phpt +++ b/ext/mysqli/tests/mysqli_stmt_multires.phpt @@ -94,7 +94,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS p123'); $link->close(); diff --git a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt index b82e59af5fb4f..c4d80498b14c7 100644 --- a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt +++ b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt @@ -73,7 +73,7 @@ $stmt->next_result(); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS testPs'); $link->close(); diff --git a/ext/pdo_mysql/tests/bug63185.phpt b/ext/pdo_mysql/tests/bug63185.phpt index c3e79401144aa..92221942e26ea 100644 --- a/ext/pdo_mysql/tests/bug63185.phpt +++ b/ext/pdo_mysql/tests/bug63185.phpt @@ -44,7 +44,7 @@ var_dump($st->fetchAll()); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS test_procedure_error_at_second'); ?> diff --git a/ext/pdo_mysql/tests/bug76815.phpt b/ext/pdo_mysql/tests/bug76815.phpt index 91f6416aa7295..4e627e0ff79dd 100644 --- a/ext/pdo_mysql/tests/bug76815.phpt +++ b/ext/pdo_mysql/tests/bug76815.phpt @@ -30,7 +30,7 @@ echo "Ok.\n"; ?> --CLEAN-- query('DROP FUNCTION IF EXISTS tst'); $pdo->query('DROP PROCEDURE IF EXISTS tst2'); diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt index 7035721d0c8e1..270e65398d76d 100644 --- a/ext/pdo_mysql/tests/bug_41997.phpt +++ b/ext/pdo_mysql/tests/bug_41997.phpt @@ -39,7 +39,7 @@ print "done!"; ?> --CLEAN-- exec("DROP PROCEDURE IF EXISTS p"); ?> diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt index f044672f4a6f6..5e70861816c9e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt @@ -119,7 +119,7 @@ if ($version < 50000) ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS p'); ?>