cvs: php-src(PHP_5_3) /ext/mysqli/tests 040.phpt 041.phpt 042.phpt 043.phpt 044.phpt 045.phpt 046.phpt 047.phpt 048.phpt 049.phpt 050.phpt 051.phpt
052.phpt 053.phpt 054.phpt 055.phpt 056.phpt 057.phpt 058.phpt 059.phpt

From: Date: Wed, 10 Oct 2007 10:08:29 +0000
Subject: cvs: php-src(PHP_5_3) /ext/mysqli/tests 040.phpt 041.phpt 042.phpt 043.phpt 044.phpt 045.phpt 046.phpt 047.phpt 048.phpt 049.phpt 050.phpt 051.phpt
052.phpt 053.phpt 054.phpt 055.phpt 056.phpt 057.phpt 058.phpt 059.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-46596@lists.php.net to get a copy of this message
uw Wed Oct 10 10:08:29 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mysqli/tests 040.phpt 041.phpt 042.phpt 043.phpt 044.phpt 045.phpt 046.phpt 047.phpt 048.phpt 049.phpt 050.phpt 051.phpt 052.phpt 053.phpt 054.phpt 055.phpt 056.phpt 057.phpt 058.phpt 059.phpt Log: Changes to 04*.phpt, 05*.phpt.

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/040.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/040.phpt diff -u php-src/ext/mysqli/tests/040.phpt:1.3 php-src/ext/mysqli/tests/040.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/040.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/040.phpt Wed Oct 10 10:08:29 2007 @@ -1,16 +1,19 @@ --TEST-- function test: mysqli_num_rows() --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); mysqli_query($link, "DROP TABLE IF EXISTS test_result"); @@ -28,6 +31,8 @@ var_dump($num); mysqli_close($link); + print "done!"; ?> --EXPECT-- int(1) +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/041.phpt?r1=1.5&r2=1.5.6.1&diff_format=u Index: php-src/ext/mysqli/tests/041.phpt diff -u php-src/ext/mysqli/tests/041.phpt:1.5 php-src/ext/mysqli/tests/041.phpt:1.5.6.1 --- php-src/ext/mysqli/tests/041.phpt:1.5 Fri Jul 8 08:53:25 2005 +++ php-src/ext/mysqli/tests/041.phpt Wed Oct 10 10:08:29 2007 @@ -1,15 +1,18 @@ --TEST-- function test: mysqli_warning_count() --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); - mysqli_select_db($link, "test"); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); + mysqli_select_db($link, $db); mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"); mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"); @@ -17,6 +20,8 @@ var_dump(mysqli_warning_count($link)); mysqli_close($link); + print "done!"; ?> --EXPECT-- int(1) +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/042.phpt?r1=1.7.2.1&r2=1.7.2.1.4.1&diff_format=u Index: php-src/ext/mysqli/tests/042.phpt diff -u php-src/ext/mysqli/tests/042.phpt:1.7.2.1 php-src/ext/mysqli/tests/042.phpt:1.7.2.1.4.1 --- php-src/ext/mysqli/tests/042.phpt:1.7.2.1 Sat Oct 8 15:08:07 2005 +++ php-src/ext/mysqli/tests/042.phpt Wed Oct 10 10:08:29 2007 @@ -1,25 +1,28 @@ --TEST-- mysqli_fetch_object --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); mysqli_query($link, "SET sql_mode=''"); - mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); - mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, - c2 smallint unsigned, - c3 smallint, - c4 smallint, - c5 smallint, - c6 smallint unsigned, - c7 smallint)"); + mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"); + mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned, + c2 smallint unsigned, + c3 smallint, + c4 smallint, + c5 smallint, + c6 smallint unsigned, + c7 smallint)"); $stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)"); mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7); @@ -42,6 +45,7 @@ var_dump($test); mysqli_close($link); + print "done!" ?> --EXPECTF-- object(stdClass)#%d (7) { @@ -60,3 +64,22 @@ ["c7"]=> string(1) "0" } +done! +--UEXPECTF-- +object(stdClass)#%d (7) { + [u"c1"]=> + unicode(1) "0" + [u"c2"]=> + unicode(5) "35999" + [u"c3"]=> + NULL + [u"c4"]=> + unicode(4) "-500" + [u"c5"]=> + unicode(6) "-32768" + [u"c6"]=> + unicode(1) "0" + [u"c7"]=> + unicode(1) "0" +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/043.phpt?r1=1.5&r2=1.5.6.1&diff_format=u Index: php-src/ext/mysqli/tests/043.phpt diff -u php-src/ext/mysqli/tests/043.phpt:1.5 php-src/ext/mysqli/tests/043.phpt:1.5.6.1 --- php-src/ext/mysqli/tests/043.phpt:1.5 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/043.phpt Wed Oct 10 10:08:29 2007 @@ -1,18 +1,21 @@ --TEST-- mysqli_bind_param (UPDATE) --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); - mysqli_query($link,"DROP TABLE IF EXISTS test_update"); - mysqli_query($link,"CREATE TABLE test_update(a varchar(10), + mysqli_query($link,"DROP TABLE IF EXISTS test_update"); + mysqli_query($link,"CREATE TABLE test_update(a varchar(10), b int)"); mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)"); @@ -34,9 +37,17 @@ var_dump($test); mysqli_close($link); + print "done!"; ?> ---EXPECT-- +--EXPECTF-- array(1) { [0]=> string(15) "Rasmus is No. 1" } +done! +--UEXPECF-- +array(1) { + [0]=> + unicode(15) "Rasmus is No. 1" +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/044.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/044.phpt diff -u php-src/ext/mysqli/tests/044.phpt:1.3 php-src/ext/mysqli/tests/044.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/044.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/044.phpt Wed Oct 10 10:08:29 2007 @@ -1,13 +1,16 @@ --TEST-- mysqli_get_server_version --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $i = mysqli_get_server_version($link); @@ -16,6 +19,8 @@ var_dump($test); mysqli_close($link); + print "done!"; ?> --EXPECT-- int(1) +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/045.phpt?r1=1.6.2.1&r2=1.6.2.1.4.1&diff_format=u Index: php-src/ext/mysqli/tests/045.phpt diff -u php-src/ext/mysqli/tests/045.phpt:1.6.2.1 php-src/ext/mysqli/tests/045.phpt:1.6.2.1.4.1 --- php-src/ext/mysqli/tests/045.phpt:1.6.2.1 Thu Mar 30 20:43:39 2006 +++ php-src/ext/mysqli/tests/045.phpt Wed Oct 10 10:08:29 2007 @@ -1,14 +1,14 @@ --TEST-- mysqli_bind_result (SHOW) --SKIPIF-- -<?php +<?php require_once('skipif.inc'); - require_once('skipifemb.inc'); - + require_once('skipifemb.inc'); + require_once('skipifconnectfailure.inc'); + include "connect.inc"; $link = mysqli_connect($host, $user, $passwd); - $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); mysqli_execute($stmt); @@ -21,26 +21,41 @@ --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); mysqli_execute($stmt); - mysqli_bind_result($stmt, $c1, $c2); + mysqli_bind_result($stmt, $c1, $c2); mysqli_fetch($stmt); - mysqli_stmt_close($stmt); + mysqli_stmt_close($stmt); + if (ini_get("unicode.semantics") && mysqli_get_server_version($link) < 50000) { + /* variables are binary */ + settype($c1, "unicode"); + settype($c2, "unicode"); + } $test = array ($c1,$c2); var_dump($test); mysqli_close($link); + print "done!"; ?> ---EXPECT-- +--EXPECTF-- array(2) { [0]=> string(4) "port" [1]=> - string(4) "3306" + string(%d) "%s" +} +done! +--UEXPECTF-- +array(2) { + [0]=> + unicode(4) "port" + [1]=> + unicode(%d) "%s" } +done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/046.phpt?r1=1.5&r2=1.5.6.1&diff_format=u Index: php-src/ext/mysqli/tests/046.phpt diff -u php-src/ext/mysqli/tests/046.phpt:1.5 php-src/ext/mysqli/tests/046.phpt:1.5.6.1 --- php-src/ext/mysqli/tests/046.phpt:1.5 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/046.phpt Wed Oct 10 10:08:29 2007 @@ -1,15 +1,18 @@ --TEST-- mysqli_stmt_affected_rows (delete) --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); mysqli_query($link, "DROP TABLE IF EXISTS test_affected"); mysqli_query($link, "CREATE TABLE test_affected (foo int)"); @@ -24,10 +27,12 @@ mysqli_execute($stmt); $x = mysqli_stmt_affected_rows($stmt); - mysqli_stmt_close($stmt); + mysqli_stmt_close($stmt); var_dump($x==1); mysqli_close($link); + print "done!"; ?> --EXPECT-- bool(true) +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/047.phpt?r1=1.8.4.1&r2=1.8.4.1.2.1&diff_format=u Index: php-src/ext/mysqli/tests/047.phpt diff -u php-src/ext/mysqli/tests/047.phpt:1.8.4.1 php-src/ext/mysqli/tests/047.phpt:1.8.4.1.2.1 --- php-src/ext/mysqli/tests/047.phpt:1.8.4.1 Tue Jul 11 23:45:28 2006 +++ php-src/ext/mysqli/tests/047.phpt Wed Oct 10 10:08:29 2007 @@ -1,15 +1,18 @@ --TEST-- mysqli_get_metadata --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); mysqli_query($link, "DROP TABLE IF EXISTS test_affected"); mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1)"); @@ -31,14 +34,15 @@ while ($field = mysqli_fetch_field($result)) { var_dump($field); } - + print_r(mysqli_fetch_lengths($result)); - + mysqli_free_result($result); - mysqli_stmt_close($stmt); + mysqli_stmt_close($stmt); mysqli_close($link); + print "done!"; ?> --EXPECTF-- === fetch_fields === @@ -193,4 +197,160 @@ int(253) ["decimals"]=> int(0) -} \ No newline at end of file +} +done! +--UEXPECTF-- +=== fetch_fields === +array(2) { + [0]=> + object(stdClass)#5 (11) { + [u"name"]=> + unicode(3) "foo" + [u"orgname"]=> + unicode(3) "foo" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(11) + [u"charsetnr"]=> + int(63) + [u"flags"]=> + int(32768) + [u"type"]=> + int(3) + [u"decimals"]=> + int(0) + } + [1]=> + object(stdClass)#6 (11) { + [u"name"]=> + unicode(3) "bar" + [u"orgname"]=> + unicode(3) "bar" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(%d) + [u"charsetnr"]=> + int(%d) + [u"flags"]=> + int(0) + [u"type"]=> + int(253) + [u"decimals"]=> + int(0) + } +} + +=== fetch_field_direct === +object(stdClass)#6 (11) { + [u"name"]=> + unicode(3) "foo" + [u"orgname"]=> + unicode(3) "foo" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(%d) + [u"charsetnr"]=> + int(%d) + [u"flags"]=> + int(32768) + [u"type"]=> + int(3) + [u"decimals"]=> + int(0) +} +object(stdClass)#6 (11) { + [u"name"]=> + unicode(3) "bar" + [u"orgname"]=> + unicode(3) "bar" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(%d) + [u"charsetnr"]=> + int(%d) + [u"flags"]=> + int(0) + [u"type"]=> + int(253) + [u"decimals"]=> + int(0) +} + +=== fetch_field === +object(stdClass)#6 (11) { + [u"name"]=> + unicode(3) "foo" + [u"orgname"]=> + unicode(3) "foo" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(%d) + [u"charsetnr"]=> + int(%d) + [u"flags"]=> + int(32768) + [u"type"]=> + int(3) + [u"decimals"]=> + int(0) +} +object(stdClass)#5 (11) { + [u"name"]=> + unicode(3) "bar" + [u"orgname"]=> + unicode(3) "bar" + [u"table"]=> + unicode(13) "test_affected" + [u"orgtable"]=> + unicode(13) "test_affected" + [u"def"]=> + unicode(0) "" + [u"max_length"]=> + int(0) + [u"length"]=> + int(%d) + [u"charsetnr"]=> + int(%d) + [u"flags"]=> + int(0) + [u"type"]=> + int(253) + [u"decimals"]=> + int(0) +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/048.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/048.phpt diff -u php-src/ext/mysqli/tests/048.phpt:1.4 php-src/ext/mysqli/tests/048.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/048.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/048.phpt Wed Oct 10 10:08:29 2007 @@ -1,29 +1,32 @@ --TEST-- -mysqli bind_result (OO-Style) +mysqli bind_result (OO-Style) --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = mysqli_connect($host, $user, $passwd); + $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - $mysql->select_db("test"); + $mysql->select_db($db); $mysql->query("DROP TABLE IF EXISTS test_fetch_null"); - $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, - col3 int, col4 bigint, - col5 float, col6 double, - col7 date, col8 time, - col9 varbinary(10), - col10 varchar(50), - col11 char(20))"); - + $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, + col3 int, col4 bigint, + col5 float, col6 double, + col7 date, col8 time, + col9 varbinary(10), + col10 varchar(50), + col11 char(20))"); + $mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)"); $stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null"); - $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); + $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); $stmt->execute(); $stmt->fetch(); @@ -34,8 +37,9 @@ $stmt->close(); $mysql->close(); + print "done!"; ?> ---EXPECT-- +--EXPECTF-- array(11) { [0]=> int(1) @@ -60,3 +64,30 @@ [10]=> string(4) "1000" } +done! +--UEXPECTF-- +array(11) { + [0]=> + int(1) + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL + [5]=> + NULL + [6]=> + NULL + [7]=> + NULL + [8]=> + NULL + [9]=> + unicode(4) "foo1" + [10]=> + unicode(4) "1000" +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/049.phpt?r1=1.4.2.1&r2=1.4.2.1.4.1&diff_format=u Index: php-src/ext/mysqli/tests/049.phpt diff -u php-src/ext/mysqli/tests/049.phpt:1.4.2.1 php-src/ext/mysqli/tests/049.phpt:1.4.2.1.4.1 --- php-src/ext/mysqli/tests/049.phpt:1.4.2.1 Fri Mar 24 10:58:52 2006 +++ php-src/ext/mysqli/tests/049.phpt Wed Oct 10 10:08:29 2007 @@ -1,16 +1,19 @@ --TEST-- -mysql_fetch_row (OO-Style) +mysql_fetch_row (OO-Style) --SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifemb.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifemb.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $mysql = mysqli_connect($host, $user, $passwd); + $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - $mysql->select_db("test"); + $mysql->select_db($db); $result = $mysql->query("SELECT DATABASE()"); $row = $result->fetch_row(); $result->close(); @@ -18,9 +21,17 @@ var_dump($row); $mysql->close(); + print "done!"; ?> ---EXPECT-- +--EXPECTF-- +array(1) { + [0]=> + string(%d) "%s" +} +done! +--UEXPECTF-- array(1) { [0]=> - string(4) "test" + unicode(%d) "%s" } +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/050.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/050.phpt diff -u php-src/ext/mysqli/tests/050.phpt:1.3 php-src/ext/mysqli/tests/050.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/050.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/050.phpt Wed Oct 10 10:08:29 2007 @@ -1,15 +1,18 @@ --TEST-- -non freed statement test +non freed statement test --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /************************ * non freed stamement ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $stmt = mysqli_prepare($link, "SELECT CURRENT_USER()"); mysqli_execute($stmt); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/051.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/051.phpt diff -u php-src/ext/mysqli/tests/051.phpt:1.4 php-src/ext/mysqli/tests/051.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/051.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/051.phpt Wed Oct 10 10:08:29 2007 @@ -1,15 +1,18 @@ --TEST-- -free statement after close +free statement after close --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /************************ - * free statement after close + * free statement after close ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()"); mysqli_execute($stmt1); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/052.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/052.phpt diff -u php-src/ext/mysqli/tests/052.phpt:1.4 php-src/ext/mysqli/tests/052.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/052.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/052.phpt Wed Oct 10 10:08:29 2007 @@ -1,7 +1,10 @@ --TEST-- call statement after close --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; @@ -9,7 +12,7 @@ /************************ * statement call after close ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()"); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/053.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/053.phpt diff -u php-src/ext/mysqli/tests/053.phpt:1.3 php-src/ext/mysqli/tests/053.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/053.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/053.phpt Wed Oct 10 10:08:29 2007 @@ -1,7 +1,10 @@ --TEST-- not freed resultset --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; @@ -9,7 +12,7 @@ /************************ * non freed resultset ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $result = mysqli_query($link, "SELECT CURRENT_USER()"); mysqli_close($link); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/054.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/054.phpt diff -u php-src/ext/mysqli/tests/054.phpt:1.3 php-src/ext/mysqli/tests/054.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/054.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/054.phpt Wed Oct 10 10:08:29 2007 @@ -1,7 +1,10 @@ --TEST-- free resultset after close --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; @@ -9,7 +12,7 @@ /************************ * free resultset after close ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $result1 = mysqli_query($link, "SELECT CURRENT_USER()"); mysqli_close($link); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/055.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/055.phpt diff -u php-src/ext/mysqli/tests/055.phpt:1.3 php-src/ext/mysqli/tests/055.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/055.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/055.phpt Wed Oct 10 10:08:29 2007 @@ -1,7 +1,10 @@ --TEST-- free nothing --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; @@ -9,7 +12,7 @@ /************************ * don't free anything ************************/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); $result2 = mysqli_query($link, "SELECT CURRENT_USER()"); $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()"); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/056.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: php-src/ext/mysqli/tests/056.phpt diff -u php-src/ext/mysqli/tests/056.phpt:1.3 php-src/ext/mysqli/tests/056.phpt:1.3.6.1 --- php-src/ext/mysqli/tests/056.phpt:1.3 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/056.phpt Wed Oct 10 10:08:29 2007 @@ -1,7 +1,10 @@ --TEST-- extend mysqli --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; @@ -13,7 +16,7 @@ } $foo = new foobar(); - $foo->connect($host, $user, $passwd); + $foo->connect($host, $user, $passwd, $db, $port, $socket); $foo->close(); printf("%s\n", $foo->test()); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/057.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/057.phpt diff -u php-src/ext/mysqli/tests/057.phpt:1.4 php-src/ext/mysqli/tests/057.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/057.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/057.phpt Wed Oct 10 10:08:29 2007 @@ -1,18 +1,21 @@ --TEST-- mysqli_get_metadata --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); - mysqli_query($link,"DROP TABLE IF EXISTS test_store_result"); - mysqli_query($link,"CREATE TABLE test_store_result (a int)"); + mysqli_query($link,"DROP TABLE IF EXISTS test_store_result"); + mysqli_query($link,"CREATE TABLE test_store_result (a int)"); mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)"); @@ -26,6 +29,15 @@ } mysqli_stmt_close($stmt); + /* 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_reset($stmt)); + var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result")); + var_dump(mysqli_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); @@ -37,18 +49,46 @@ if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) { $row = mysqli_fetch_row($result); mysqli_free_result($result); - } - + } - var_dump($row); + var_dump($row); mysqli_free_result($result1); mysqli_stmt_close($stmt); mysqli_close($link); + echo "done!"; ?> ---EXPECT-- +--EXPECTF-- +bool(true) +bool(true) +object(mysqli_stmt)#%d (%d) { +} +bool(true) +bool(false) +string(0) "" + +Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, boolean given in %s on line %d +NULL Rows: 3 array(1) { [0]=> string(1) "1" } +done! +--UEXPECTF-- +bool(true) +bool(true) +object(mysqli_stmt)#%d (%d) { +} +bool(true) +bool(false) +unicode(0) "" + +Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, boolean given in %s on line %d +NULL +Rows: 3 +array(1) { + [0]=> + unicode(1) "1" +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/058.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/058.phpt diff -u php-src/ext/mysqli/tests/058.phpt:1.4 php-src/ext/mysqli/tests/058.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/058.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/058.phpt Wed Oct 10 10:08:29 2007 @@ -1,21 +1,24 @@ --TEST-- multiple binds --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); - mysqli_query($link,"DROP TABLE IF EXISTS mbind"); - mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))"); + mysqli_query($link,"DROP TABLE IF EXISTS mbind"); + mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))"); $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)"); - + mysqli_bind_param($stmt, "is", $a, $b); $a = 1; @@ -43,8 +46,9 @@ var_dump((array($e,$f,$g,$h))); mysqli_close($link); + print "done!"; ?> ---EXPECT-- +--EXPECTF-- array(4) { [0]=> int(1) @@ -55,3 +59,16 @@ [3]=> string(3) "bar" } +done! +--UEXPECTF-- +array(4) { + [0]=> + int(1) + [1]=> + unicode(3) "foo" + [2]=> + int(2) + [3]=> + unicode(3) "bar" +} +done! \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/059.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: php-src/ext/mysqli/tests/059.phpt diff -u php-src/ext/mysqli/tests/059.phpt:1.4 php-src/ext/mysqli/tests/059.phpt:1.4.6.1 --- php-src/ext/mysqli/tests/059.phpt:1.4 Sat Dec 4 08:50:33 2004 +++ php-src/ext/mysqli/tests/059.phpt Wed Oct 10 10:08:29 2007 @@ -1,23 +1,26 @@ --TEST-- sqlmode + bind --SKIPIF-- -<?php require_once('skipif.inc'); ?> +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> --FILE-- <?php include "connect.inc"; - + /*** test mysqli_connect 127.0.0.1 ***/ - $link = mysqli_connect($host, $user, $passwd); + $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket); - mysqli_select_db($link, "test"); + mysqli_select_db($link, $db); mysqli_query($link, "SET SQL_MODE='PIPES_AS_CONCAT'"); - mysqli_query($link,"DROP TABLE IF EXISTS mbind"); - mysqli_query($link,"CREATE TABLE mbind (b varchar(25))"); + mysqli_query($link,"DROP TABLE IF EXISTS mbind"); + mysqli_query($link,"CREATE TABLE mbind (b varchar(25))"); $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)"); - + mysqli_bind_param($stmt, "ss", $a, $b); $a = "foo"; @@ -36,6 +39,11 @@ var_dump($e); mysqli_close($link); + print "done!"; ?> --EXPECT-- string(6) "foobar" +done! +--UEXPECT-- +unicode(6) "foobar" +done! \ No newline at end of file
« previous php.cvs (#46596) next »