georg           Tue May  9 13:53:39 2006 UTC

  Modified files:              
    /php-src/ext/mysqli/tests   bug34785.phpt bug36745.phpt bug36802.phpt 
  Log:
  merge from 5.2
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug34785.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug34785.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug34785.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug34785.phpt      Tue May  9 13:53:39 2006
@@ -0,0 +1,47 @@
+--TEST--
+Bug #32405
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+       include ("connect.inc");
+
+       class my_stmt extends mysqli_stmt
+       {
+               public function __construct($link, $query) {
+                       parent::__construct($link, $query);
+               }
+       }
+
+       class my_result extends mysqli_result
+       {
+               public function __construct($link, $query) {
+                       parent::__construct($link, $query);
+               }
+       }
+
+       /*** test mysqli_connect 127.0.0.1 ***/
+       $link = mysqli_connect($host, $user, $passwd);
+       mysqli_query($link, "SET sql_mode=''");
+
+       $stmt = new my_stmt($link, "SELECT 'foo' FROM DUAL");
+
+       $stmt->execute();
+       $stmt->bind_result($var);
+       $stmt->fetch();
+
+       $stmt->close();
+       var_dump($var);
+
+       mysqli_real_query($link, "SELECT 'bar' FROM DUAL");
+       $result = new my_result($link, MYSQLI_STORE_RESULT);
+       $row = $result->fetch_row();
+       $result->close();
+
+       var_dump($row[0]);
+
+       mysqli_close($link);
+?>
+--EXPECT--
+string(3) "foo"
+string(3) "bar"
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug36745.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug36745.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug36745.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug36745.phpt      Tue May  9 13:53:39 2006
@@ -0,0 +1,23 @@
+--TEST--
+bug #36745 : LOAD DATA LOCAL INFILE doesn't return correct error message       
                                     
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+       include ("connect.inc");
+
+       /*** test mysqli_connect 127.0.0.1 ***/
+       $mysql = mysqli_connect($host, $user, $passwd, "test");
+
+       $mysql->query("DROP TABLE IF EXISTS litest");
+       $mysql->query("CREATE TABLE litest (a VARCHAR(20))");
+
+       $mysql->query("LOAD DATA LOCAL INFILE 'filenotfound' INTO TABLE 
litest");
+       var_dump($mysql->error);
+
+       $mysql->close();
+       printf("Done");
+?>
+--EXPECT--
+string(31) "Can't find file 'filenotfound'."
+Done
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug36802.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug36802.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug36802.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug36802.phpt      Tue May  9 13:53:39 2006
@@ -0,0 +1,42 @@
+--TEST--
+bug #36802 : crashes with mysql_init                                           
 
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+       class my_mysqli extends mysqli {
+               function __construct() 
+               {
+               }
+       }
+
+       include "connect.inc";
+
+
+       $mysql = mysqli_init();
+
+       /* following operations should not work */
+       $x[0] = @$mysql->set_charset('utf8');
+       $x[1] = @$mysql->query("SELECT 'foo' FROM DUAL");
+
+       /* following operations should work */ 
+       $x[2] = ($mysql->client_version > 0);
+       $x[3] = $mysql->errno;
+       $mysql->close();
+       
+
+
+       var_dump($x);
+?>
+--EXPECT--
+array(4) {
+  [0]=>
+  NULL
+  [1]=>
+  NULL
+  [2]=>
+  bool(true)
+  [3]=>
+  int(0)
+}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to