]> granicus.if.org Git - php/commitdiff
fixed some tests
authorGeorg Richter <georg@php.net>
Mon, 16 Feb 2004 15:32:46 +0000 (15:32 +0000)
committerGeorg Richter <georg@php.net>
Mon, 16 Feb 2004 15:32:46 +0000 (15:32 +0000)
added skip section for prepared statements when using SHOW command

ext/mysqli/tests/017.phpt
ext/mysqli/tests/026.phpt
ext/mysqli/tests/035.phpt
ext/mysqli/tests/045.phpt

index 58d40609d341232d948269a19b6509a0feebc30b..3447614428fc95c17acae3b753f1519151da24a1 100644 (file)
@@ -22,9 +22,11 @@ mysqli fetch functions
        mysqli_close($link);
 ?>
 --EXPECT--
-array(2) {
+array(3) {
   [0]=>
   string(14) "root@localhost"
   [1]=>
   string(4) "test"
+  [2]=>
+  string(3) "foo"
 }
index 63f97233deca4419de7907d382bed1b2d625ed14..2c7f9f02bdce30a6a33e428eee343095607fb5d6 100644 (file)
@@ -19,9 +19,9 @@ mysqli bind_param/bind_result with send_long_data
 
        $c1 = "Hello World";
 
-       mysqli_send_long_data($stmt, 2, "This is the first sentence.");
-       mysqli_send_long_data($stmt, 2, " And this is the second sentence.");
-       mysqli_send_long_data($stmt, 2, " And finally this is the last sentence.");
+       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_execute($stmt);
        mysqli_stmt_close($stmt);
index 34af7c0a56bc8a9f6fd9bedca3ea80b027760143..a02af059d8feb6fc6a3c5aa67e0fe04d615660fc 100644 (file)
@@ -11,9 +11,9 @@ function test: mysqli_get_server_info
 
        $sinfo = substr(mysqli_get_server_info($link),0,1);
 
-       var_dump($sinfo);
+       var_dump(strlen($sinfo));
 
        mysqli_close($link);
 ?>
 --EXPECT--
-string(1) "4"
+int(1)
index ab98535d541ae0fa36054c748acc843fd294cd49..dc58bcfb089882939f9ae2c6799fb84c0847692f 100644 (file)
@@ -1,5 +1,20 @@
 --TEST--
 mysqli_bind_result (SHOW)
+--SKIPIF--
+<?php  
+       include "connect.inc";
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+
+       $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
+       mysqli_execute($stmt);
+
+       if (!$stmt->field_count) {
+               printf("skip SHOW command is not supported in prepared statements.");
+       }
+       $stmt->close();
+       mysqli_close($link);
+?>
 --FILE--
 <?php
        include "connect.inc";
@@ -8,8 +23,8 @@ mysqli_bind_result (SHOW)
        $link = mysqli_connect("localhost", $user, $passwd);
 
        $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
-
        mysqli_execute($stmt);
+
        mysqli_bind_result($stmt, $c1, $c2);    
        mysqli_fetch($stmt);
        mysqli_stmt_close($stmt);