Browse Source

merge from 5.2

migration/RELEASE_1_0_0
Georg Richter 21 years ago
parent
commit
4508ae73f7
  1. 47
      ext/mysqli/tests/bug34785.phpt
  2. 23
      ext/mysqli/tests/bug36745.phpt
  3. 42
      ext/mysqli/tests/bug36802.phpt

47
ext/mysqli/tests/bug34785.phpt

@ -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"

23
ext/mysqli/tests/bug36745.phpt

@ -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

42
ext/mysqli/tests/bug36802.phpt

@ -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)
}
Loading…
Cancel
Save