summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDharman <tekiela246@gmail.com>2021-03-05 22:26:55 +0000
committerNikita Popov <nikita.ppv@gmail.com>2021-03-15 11:01:12 +0100
commit8573eb9e5cfc75d4aae290928a6b5b985b15166d (patch)
tree7a4a39d21413fbb72c953eb184b846f7f76b4d69 /ext
parent3b9ea4d2893602386a7f900ae2ababfd9c58ce47 (diff)
downloadphp-git-8573eb9e5cfc75d4aae290928a6b5b985b15166d.tar.gz
Add CLEAN sections to mysqli and PDO mysql tests
Closes GH-6756.
Diffstat (limited to 'ext')
-rw-r--r--ext/mysqli/tests/bug66124.phpt14
-rw-r--r--ext/mysqli/tests/bug75018.phpt6
-rw-r--r--ext/mysqli/tests/bug77597.phpt12
-rw-r--r--ext/mysqli/tests/bug77935.phpt7
-rw-r--r--ext/mysqli/tests/connect.inc4
-rw-r--r--ext/mysqli/tests/mysqli_insert_packet_overflow.phpt7
-rw-r--r--ext/mysqli/tests/mysqli_query_unicode.phpt8
-rw-r--r--ext/mysqli/tests/mysqli_stmt_multires.phpt8
-rw-r--r--ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt7
-rw-r--r--ext/pdo_mysql/tests/bug63185.phpt6
-rw-r--r--ext/pdo_mysql/tests/bug75177.phpt7
-rw-r--r--ext/pdo_mysql/tests/bug76815.phpt7
-rw-r--r--ext/pdo_mysql/tests/bug_41997.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt6
14 files changed, 88 insertions, 17 deletions
diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt
index cede635e14..8a2e5a5f73 100644
--- a/ext/mysqli/tests/bug66124.phpt
+++ b/ext/mysqli/tests/bug66124.phpt
@@ -8,15 +8,15 @@ require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
-$table_drop = "DROP TABLE IF EXISTS `bug66124`";
-$table_create = "CREATE TABLE `bug66124` (
+$table_drop = "DROP TABLE IF EXISTS `test`";
+$table_create = "CREATE TABLE `test` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8";
-$table_insert = "INSERT INTO `bug66124` SET `id`=?";
-$table_select = "SELECT * FROM `bug66124`";
-$table_delete = "DELETE FROM `bug66124`";
+$table_insert = "INSERT INTO `test` SET `id`=?";
+$table_select = "SELECT * FROM `test`";
+$table_delete = "DELETE FROM `test`";
$id = '1311200011005001566';
@@ -91,6 +91,10 @@ if ($result){
$link->close();
?>
done
+--CLEAN--
+<?php
+require_once "clean_table.inc";
+?>
--EXPECT--
Using 'i':
insert id:1311200011005001566=>1311200011005001566
diff --git a/ext/mysqli/tests/bug75018.phpt b/ext/mysqli/tests/bug75018.phpt
index 28af0bb77c..ce522aab87 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);
@@ -31,6 +31,10 @@ while ($row = $result->fetch_assoc()) {
}
?>
+--CLEAN--
+<?php
+require_once "clean_table.inc";
+?>
--EXPECT--
string(1) "0"
string(4) "1365"
diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt
index 52ae874454..cd9055deb7 100644
--- a/ext/mysqli/tests/bug77597.phpt
+++ b/ext/mysqli/tests/bug77597.phpt
@@ -12,11 +12,11 @@ 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);
@@ -24,5 +24,9 @@ $field = $result->fetch_field();
var_dump($field->name);
?>
+--CLEAN--
+<?php
+require_once "clean_table.inc";
+?>
--EXPECT--
string(1) "b"
diff --git a/ext/mysqli/tests/bug77935.phpt b/ext/mysqli/tests/bug77935.phpt
index 7a39ac0065..9917488a25 100644
--- a/ext/mysqli/tests/bug77935.phpt
+++ b/ext/mysqli/tests/bug77935.phpt
@@ -31,6 +31,13 @@ while ($row = $result->fetch_assoc()) {
}
?>
+--CLEAN--
+<?php
+require_once 'connect.inc';
+$link = new mysqli($host, $user, $passwd, $db, $port, $socket);
+$link->query('DROP PROCEDURE IF EXISTS testSp');
+$link->close();
+?>
--EXPECT--
array(1) {
[1]=>
diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index 604ecc97ea..0fb3cff66c 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)
*/
diff --git a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt
index 105b3276d3..1285fe1f50 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--
+<?php
+require_once 'connect.inc';
+$link = new mysqli($host, $user, $passwd, $db, $port, $socket);
+$link->query('DROP TABLE test__mysqli_insert_packet_overflow');
+$link->close();
+?>
--EXPECT--
done!
diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt
index b62418508f..6a5e1be912 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--
+<?php
+require_once 'connect.inc';
+$link = new mysqli($host, $user, $passwd, $db, $port, $socket);
+$link->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 73af79e2b1..07abac4dcc 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--
<?php
- require_once("connect.inc");
- if (!$link->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 ed15d10e4a..c4d80498b1 100644
--- a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt
+++ b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt
@@ -71,6 +71,13 @@ while ($row = $result->fetch_assoc()) {
$stmt->next_result();
?>
+--CLEAN--
+<?php
+require_once 'connect.inc';
+$link = new mysqli($host, $user, $passwd, $db, $port, $socket);
+$link->query('DROP PROCEDURE IF EXISTS testPs');
+$link->close();
+?>
--EXPECT--
use_result:
int(1)
diff --git a/ext/pdo_mysql/tests/bug63185.phpt b/ext/pdo_mysql/tests/bug63185.phpt
index 4bf6d7e4db..92221942e2 100644
--- a/ext/pdo_mysql/tests/bug63185.phpt
+++ b/ext/pdo_mysql/tests/bug63185.phpt
@@ -42,6 +42,12 @@ try {
var_dump($st->fetchAll());
?>
+--CLEAN--
+<?php
+require_once __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
+$pdo = MySQLPDOTest::factory();
+$pdo->query('DROP PROCEDURE IF EXISTS test_procedure_error_at_second');
+?>
--EXPECTF--
array(1) {
[0]=>
diff --git a/ext/pdo_mysql/tests/bug75177.phpt b/ext/pdo_mysql/tests/bug75177.phpt
index b580c9a929..104734f3ac 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)");
@@ -32,6 +32,11 @@ foreach ($ret as $i) {
}
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECT--
int(1)
int(3)
diff --git a/ext/pdo_mysql/tests/bug76815.phpt b/ext/pdo_mysql/tests/bug76815.phpt
index b5c8577b07..4e627e0ff7 100644
--- a/ext/pdo_mysql/tests/bug76815.phpt
+++ b/ext/pdo_mysql/tests/bug76815.phpt
@@ -28,6 +28,13 @@ unset($st);
echo "Ok.\n";
?>
+--CLEAN--
+<?php
+require_once __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
+$pdo = MySQLPDOTest::factory();
+$pdo->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
Ok.
diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt
index 8d20ed737e..270e65398d 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--
+<?php
+require_once __DIR__ . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->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 110710dd11..5e70861816 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--
+<?php
+require_once __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
+$pdo = MySQLPDOTest::factory();
+$pdo->query('DROP PROCEDURE IF EXISTS p');
+?>
--EXPECT--
done!