Merge from head: do not use deprecated function aliases. The test logic is unchanged.

This commit is contained in:
Ulf Wendel 2010-09-23 14:59:13 +00:00
parent 107f916322
commit 389965f1de
45 changed files with 157 additions and 159 deletions

View File

@ -32,10 +32,10 @@ require_once('skipifconnectfailure.inc');
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
mysqli_execute($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
mysqli_stmt_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);

View File

@ -59,9 +59,9 @@ require_once('skipifconnectfailure.inc');
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -33,11 +33,11 @@ require_once('skipifconnectfailure.inc');
printf("[006] [%d] string\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1");
mysqli_bind_result($stmt, $c1, $c2);
mysqli_execute($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_execute($stmt);
$i = 4;
while ($i--) {
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1, $c2);
var_dump($test);
}

View File

@ -23,9 +23,9 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')");
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test[] = $c1;
$test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
@ -33,7 +33,7 @@ require_once('skipifconnectfailure.inc');
var_dump($test);
/* this will crash with libmysql from PHP 5.0.6 (or earlier) to 5.3.0 */
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");

View File

@ -32,9 +32,9 @@ require_once('skipifconnectfailure.inc');
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -32,9 +32,9 @@ require_once('skipifconnectfailure.inc');
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -32,9 +32,9 @@ require_once('skipifconnectfailure.inc');
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -39,9 +39,9 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_execute($stmt);
$rc = mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_stmt_execute($stmt);
$rc = mysqli_stmt_fetch($stmt);
if (mysqli_get_server_version($link) < 50000) {
// 4.1 is faulty and will return big number for $c6
@ -66,9 +66,9 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
mysqli_bind_result($stmt, $c1, $c2);
mysqli_execute($stmt);
$rc = mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_execute($stmt);
$rc = mysqli_stmt_fetch($stmt);
echo $c1, "\n", $c2, "\n";

View File

@ -35,9 +35,9 @@ require_once('skipifconnectfailure.inc');
sin(0.6), 1.00000000000001, 888888888888888)");
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -32,9 +32,9 @@ require_once('skipifconnectfailure.inc');
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);

View File

@ -31,9 +31,9 @@ require_once('skipifconnectfailure.inc');
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);

View File

@ -31,10 +31,10 @@ require_once('skipifconnectfailure.inc');
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
$c = array(0,0,0,0,0,0,0,0);
$b_res= mysqli_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_fetch($stmt);
$b_res= mysqli_stmt_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "select * from test_bind_result");

View File

@ -18,9 +18,9 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_prepare($link, "SELECT @dummy"))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_bind_result($stmt, $dummy);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $dummy);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
var_dump($dummy);

View File

@ -16,10 +16,10 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_bind_result($stmt, $c0, $c1, $c2);
mysqli_execute($stmt);
mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
mysqli_stmt_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
$test = array($c0, $c1, $c2);

View File

@ -18,10 +18,10 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_prepare($link, "SELECT @@autocommit"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_bind_result($stmt, $c0);
mysqli_execute($stmt);
mysqli_stmt_bind_result($stmt, $c0);
mysqli_stmt_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
var_dump($c0);

View File

@ -28,23 +28,23 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_prepare($link, "INSERT INTO insert_read(col1,col10, col11, col6) VALUES (?,?,?,?)"))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
mysqli_stmt_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
$c1 = 1;
$c2 = "foo";
$c3 = "foobar";
$c4 = 3.14;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
if (!$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 FROM insert_read"))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
mysqli_execute($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
mysqli_stmt_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);

View File

@ -37,7 +37,7 @@ require_once('skipifconnectfailure.inc');
c7 timestamp)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)");
mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
mysqli_stmt_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
$d1 = "2002-01-02";
$d2 = "12:49:00";
@ -47,15 +47,15 @@ require_once('skipifconnectfailure.inc');
$d6 = "2020";
$d7 = "1999-12-29";
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -18,16 +18,16 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
mysqli_bind_param($stmt, "ss", $q1, $q2);
mysqli_stmt_bind_param($stmt, "ss", $q1, $q2);
$q1 = "1234567890";
$q2 = "this is a test";
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2);

View File

@ -19,18 +19,18 @@ require_once('skipifconnectfailure.inc');
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
mysqli_bind_param($stmt, "ss", $a1, $a2);
mysqli_stmt_bind_param($stmt, "ss", $a1, $a2);
$a1 = "1234567890";
$a2 = str_repeat("A1", 32000);
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test[] = $c1;
$test[] = ($a2 == $c2) ? "32K String ok" : "32K String failed";

View File

@ -25,7 +25,7 @@ require_once('skipifconnectfailure.inc');
c7 int)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
$c3 = NULL;
@ -34,13 +34,13 @@ require_once('skipifconnectfailure.inc');
$c6 = -0;
$c7 = 0;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -25,7 +25,7 @@ require_once('skipifconnectfailure.inc');
c7 smallint)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
@ -35,13 +35,13 @@ require_once('skipifconnectfailure.inc');
$c6 = -0;
$c7 = 0;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -25,7 +25,7 @@ require_once('skipifconnectfailure.inc');
c7 tinyint)");
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)");
mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 300;
@ -35,7 +35,7 @@ require_once('skipifconnectfailure.inc');
$c6 = 30;
$c7 = 0;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)");
@ -43,9 +43,9 @@ require_once('skipifconnectfailure.inc');
$c1 = $c2 = $c3 = $c4 = $c5 = $c6 = $c7 = NULL;
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);

View File

@ -19,21 +19,21 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)");
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
mysqli_bind_param($stmt, "sb", $c1, $c2);
mysqli_stmt_bind_param($stmt, "sb", $c1, $c2);
$c1 = "Hello World";
mysqli_send_long_data($stmt, 1, "This is the first sentence.");
mysqli_send_long_data($stmt, 1, " And this is the second sentence.");
mysqli_send_long_data($stmt, 1, " And finally this is the last sentence.");
mysqli_stmt_send_long_data($stmt, 1, "This is the first sentence.");
mysqli_stmt_send_long_data($stmt, 1, " And this is the second sentence.");
mysqli_stmt_send_long_data($stmt, 1, " And finally this is the last sentence.");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $d1, $d2);
mysqli_execute($stmt);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $d1, $d2);
mysqli_stmt_execute($stmt);
mysqli_stmt_fetch($stmt);
$test = array($d1,$d2);

View File

@ -25,7 +25,7 @@ require_once('skipifconnectfailure.inc');
c7 smallint) ENGINE=" . $engine);
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
@ -35,7 +35,7 @@ require_once('skipifconnectfailure.inc');
$c6 = -0;
$c7 = 0;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "SELECT * FROM test_bind_fetch");

View File

@ -1,5 +1,5 @@
--TEST--
mysqli_bind_param (UPDATE)
mysqli_stmt_bind_param (UPDATE)
--SKIPIF--
<?php
require_once('skipif.inc');
@ -21,13 +21,13 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
$stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?");
mysqli_bind_param($stmt, "sii", $c1, $c2, $c3);
mysqli_stmt_bind_param($stmt, "sii", $c1, $c2, $c3);
$c1 = "Rasmus";
$c2 = 1;
$c3 = 2;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update");

View File

@ -1,5 +1,5 @@
--TEST--
mysqli_bind_result (SHOW)
mysqli_stmt_bind_result (SHOW)
--SKIPIF--
<?php
require_once('skipif.inc');
@ -10,7 +10,7 @@ mysqli_bind_result (SHOW)
$link = my_mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
if (!$stmt->field_count) {
printf("skip SHOW command is not supported in prepared statements.");
@ -26,10 +26,10 @@ mysqli_bind_result (SHOW)
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_bind_result($stmt, $c1, $c2);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $c1, $c2);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) {
/* variables are binary */

View File

@ -20,11 +20,11 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)");
$stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?");
mysqli_bind_param($stmt, "i", $c1);
mysqli_stmt_bind_param($stmt, "i", $c1);
$c1 = 2;
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
$x = mysqli_stmt_affected_rows($stmt);
mysqli_stmt_close($stmt);

View File

@ -1,5 +1,5 @@
--TEST--
mysqli_get_metadata
mysqli_stmt_result_metadata
--SKIPIF--
<?php
require_once('skipif.inc');
@ -20,8 +20,8 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')");
$stmt = mysqli_prepare($link, "SELECT * FROM test_affected");
mysqli_execute($stmt);
$result = mysqli_get_metadata($stmt);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_result_metadata($stmt);
echo "\n=== fetch_fields ===\n";
var_dump(mysqli_fetch_fields($result));

View File

@ -15,7 +15,7 @@ require_once('skipifconnectfailure.inc');
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_close($link);
printf("Ok\n");

View File

@ -15,7 +15,7 @@ require_once('skipifconnectfailure.inc');
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt1);
mysqli_stmt_execute($stmt1);
mysqli_close($link);
@mysqli_stmt_close($stmt1);

View File

@ -17,7 +17,7 @@ require_once('skipifconnectfailure.inc');
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_close($link);
@mysqli_execute($stmt2);
@mysqli_stmt_execute($stmt2);
@mysqli_stmt_close($stmt2);
printf("Ok\n");
?>

View File

@ -1,5 +1,5 @@
--TEST--
mysqli_get_metadata
mysqli_stmt_result_metadata
--SKIPIF--
<?php
require_once('skipif.inc');
@ -20,7 +20,7 @@ require_once('skipifconnectfailure.inc');
mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)");
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
/* this should produce an out of sync error */
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
@ -31,20 +31,20 @@ require_once('skipifconnectfailure.inc');
/* now we should try mysqli_stmt_reset() */
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
var_dump(mysqli_execute($stmt));
var_dump(mysqli_stmt_execute($stmt));
var_dump(mysqli_stmt_reset($stmt));
var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"));
if ($IS_MYSQLND && $stmt->affected_rows !== -1)
printf("[001] Expecting -1, got %d\n", $stmt->affected_rows);
var_dump(mysqli_execute($stmt));
var_dump(mysqli_stmt_execute($stmt));
var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link));
var_dump(mysqli_stmt_reset($stmt));
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
mysqli_execute($stmt);
$result1 = mysqli_get_metadata($stmt);
mysqli_stmt_execute($stmt);
$result1 = mysqli_stmt_result_metadata($stmt);
mysqli_stmt_store_result($stmt);
printf ("Rows: %d\n", mysqli_stmt_affected_rows($stmt));

View File

@ -19,29 +19,29 @@ require_once('skipifconnectfailure.inc');
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
mysqli_bind_param($stmt, "is", $a, $b);
mysqli_stmt_bind_param($stmt, "is", $a, $b);
$a = 1;
$b = "foo";
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_bind_param($stmt, "is", $c, $d);
mysqli_stmt_bind_param($stmt, "is", $c, $d);
$c = 2;
$d = "bar";
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_bind_result($stmt, $e, $f);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $e, $f);
mysqli_stmt_fetch($stmt);
mysqli_bind_result($stmt, $g, $h);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $g, $h);
mysqli_stmt_fetch($stmt);
var_dump((array($e,$f,$g,$h)));

View File

@ -21,20 +21,20 @@ require_once('skipifconnectfailure.inc');
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
mysqli_bind_param($stmt, "ss", $a, $b);
mysqli_stmt_bind_param($stmt, "ss", $a, $b);
$a = "foo";
$b = "bar";
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
mysqli_execute($stmt);
mysqli_stmt_execute($stmt);
mysqli_bind_result($stmt, $e);
mysqli_fetch($stmt);
mysqli_stmt_bind_result($stmt, $e);
mysqli_stmt_fetch($stmt);
var_dump($e);

View File

@ -31,7 +31,7 @@ if (version_compare(PHP_VERSION, '5.9.9', '>') == 1) {
if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp);
if ('latin1' !== ($tmp = $mysql->client_encoding()))
if ('latin1' !== ($tmp = $mysql->character_set_name()))
printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp);
}
@ -43,7 +43,7 @@ if (version_compare(PHP_VERSION, '5.9.9', '>') == 1) {
if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp);
if ('gbk' !== ($tmp = $mysql->client_encoding()))
if ('gbk' !== ($tmp = $mysql->character_set_name()))
printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);;
}
}

View File

@ -55,9 +55,9 @@ require_once('skipifconnectfailure.inc');
}
}
$charset2 = mysqli_client_encoding($link);
$charset2 = mysqli_character_set_name($link);
if ($charset2 !== $charset) {
printf("[012] Alias mysqli_client_encoding returned %s/%s, expected %s/%s\n", gettype($charset2), $charset2, gettype($charset), $charset);
printf("[012] Alias mysqli_character_set_name returned %s/%s, expected %s/%s\n", gettype($charset2), $charset2, gettype($charset), $charset);
}
mysqli_close($link);
@ -66,7 +66,7 @@ require_once('skipifconnectfailure.inc');
printf("[013] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
/* Make sure that the function alias exists */
if (!is_null($tmp = @mysqli_client_encoding()))
if (!is_null($tmp = @mysqli_character_set_name()))
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";

View File

@ -51,7 +51,7 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias]
$charset2 = $mysqli->character_set_name();
if ($charset2 !== $charset) {
printf("[012] Alias mysqli_client_encoding returned %s/%s, expected %s/%s\n",
printf("[012] Alias mysqli_character_set_name returned %s/%s, expected %s/%s\n",
gettype($charset2), $charset2, gettype($charset), $charset);
}
@ -61,7 +61,7 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias]
printf("[013] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
/* Make sure that the function alias exists */
if (!is_null($tmp = @$mysqli->client_encoding()))
if (!is_null($tmp = @$mysqli->character_set_name()))
printf("[014] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";

View File

@ -15,16 +15,8 @@ mysqlnd.collect_memory_statistics=0
--FILE--
<?php
$before = mysqli_get_client_stats();
/*
NOTE: the function belongs to the mysqnd zval cache. The
mysqlnd zval cache was part of PHP from PHP 5.3.0(-dev) to
PHP 5.3.0RC3 or something. And it was turned off by default.
The function never returned anything meaningful in any released version of PHP.
*/
if (!is_array($before)) {
printf("[001] Expecting array, got %s.\n", gettype($before));
if (!is_array($before) || empty($before)) {
printf("[001] Expecting non-empty array, got %s.\n", gettype($before));
var_dump($before);
}
@ -39,6 +31,12 @@ mysqlnd.collect_memory_statistics=0
var_dump($after);
}
foreach ($after as $k => $v)
if ($v != 0) {
printf("[003] Field %s should not have any other value but 0, got %s.\n",
$k, $v);
}
mysqli_close($link);
print "done!";
?>

View File

@ -49,7 +49,7 @@ require_once('skipifconnectfailure.inc');
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$id = 1;
if (!mysqli_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
if (!mysqli_stmt_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
@ -57,7 +57,7 @@ require_once('skipifconnectfailure.inc');
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$id = 2;
if (!mysqli_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
if (!mysqli_stmt_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
@ -66,7 +66,7 @@ require_once('skipifconnectfailure.inc');
$id = 3;
$where = 2;
if (!mysqli_bind_param($stmt, 'ii', $id, $where) || !mysqli_stmt_execute($stmt))
if (!mysqli_stmt_bind_param($stmt, 'ii', $id, $where) || !mysqli_stmt_execute($stmt))
printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
@ -74,7 +74,7 @@ require_once('skipifconnectfailure.inc');
printf("[015] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$where = 3;
if (!mysqli_bind_param($stmt, 'i', $where) || !mysqli_stmt_execute($stmt))
if (!mysqli_stmt_bind_param($stmt, 'i', $where) || !mysqli_stmt_execute($stmt))
printf("[016] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
@ -82,7 +82,7 @@ require_once('skipifconnectfailure.inc');
printf("[017] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$testvar = 'testvar';
if (!mysqli_bind_param($stmt, 's', $testvar) || !mysqli_stmt_execute($stmt))
if (!mysqli_stmt_bind_param($stmt, 's', $testvar) || !mysqli_stmt_execute($stmt))
printf("[018] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);

View File

@ -379,7 +379,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_bind_param()))
if (!is_null($tmp = @mysqli_stmt_bind_param()))
printf("[021] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
?>

View File

@ -296,7 +296,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_bind_result()))
if (!is_null($tmp = @mysqli_stmt_bind_result()))
printf("[3000] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
$stmt = mysqli_stmt_init($link);

View File

@ -80,7 +80,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_fetch()))
if (!is_null($tmp = @mysqli_stmt_fetch()))
printf("[017] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";

View File

@ -55,7 +55,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_param_count()))
if (!is_null($tmp = @mysqli_stmt_param_count()))
printf("[041] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";

View File

@ -87,7 +87,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_get_metadata()))
if (!is_null($tmp = @mysqli_stmt_result_metadata()))
printf("[018] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);

View File

@ -120,7 +120,7 @@ require_once('skipifconnectfailure.inc');
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
if (!is_null($tmp = @mysqli_send_long_data()))
if (!is_null($tmp = @mysqli_stmt_send_long_data()))
printf("[023] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);