Commiting changes into HEAD = synching with 5_3

This commit is contained in:
Ulf Wendel 2007-10-10 10:49:00 +00:00
parent 2df3cea685
commit 2dd1b35a85
12 changed files with 173 additions and 131 deletions

View File

@ -39,13 +39,13 @@ require_once('skipifconnectfailure.inc');
for ($i=0; $i < 3; $i++) {
if (($result = $foo[$i]->query("SELECT DATABASE()"))) {
$row = $result->fetch_row();
if ($row[0] != $db)
printf("%d: %s\n", $i, $row[0]);
$result->close();
}
$foo[$i]->close();
}
print "done!";
?>
--EXPECTF--
0: test
1: test
2: test
done!

View File

@ -23,13 +23,16 @@ require_once('skipifconnectfailure.inc');
$stmt = $mysql->prepare("SELECT DATABASE()");
$stmt->execute();
$stmt->bind_result($db);
$stmt->bind_result($database);
$stmt->fetch();
$stmt->close();
var_dump($db);
if ($database != $db)
printf("[001] Expecting '%s' got %s/'%s'.\n",
gettype($database), $database);
$mysql->close();
print "done!";
?>
--EXPECTF--
%s(4) "test"
done!

View File

@ -10,6 +10,10 @@ mysqli->affected_rows
<?php
include "connect.inc";
$mysqli = new mysqli();
if (NULL !== ($tmp = @$mysqli->affected_rows))
printf("[000a] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
if (!$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);

View File

@ -2,28 +2,26 @@
mysqli_autocommit()
--SKIPIF--
<?php
require_once('connect.inc');
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("skip Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
exit(1);
die(sprintf("skip Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket));
}
if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'")) {
printf("skip Cannot fetch have_innodb variable\n");
exit(1);
if (!$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'")) {
die("skip Cannot check for required InnoDB suppot");
}
if (!$row = mysqli_fetch_row($result))
die("skip Cannot check for required InnoDB suppot");
$row = mysqli_fetch_row($res);
mysqli_free_result($res);
mysqli_free_result($result);
mysqli_close($link);
if ($row[1] == "DISABLED" || $row[1] == "NO") {
printf ("skip Innodb support is not installed or enabled.");
exit(1);
die(sprintf ("skip innodb support is not installed or enabled."));
}
?>
--FILE--

View File

@ -5,6 +5,7 @@ mysqli->autocommit()
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket)) {
printf("skip Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",

View File

@ -48,8 +48,6 @@ require_once('skipifconnectfailure.inc');
'rollback' => true,
'select_db' => true,
'set_charset' => true,
'set_local_infile_default' => true,
'set_local_infile_handler' => true,
'set_opt' => true,
'stat' => true,
'stmt_init' => true,
@ -93,6 +91,8 @@ require_once('skipifconnectfailure.inc');
if (function_exists('mysqli_ssl_set'))
$expected_methods['ssl_set'] = true;
$expected_methods['set_local_infile_default'] = true;
$expected_methods['set_local_infile_handler'] = true;
}
/* we should add ruled when to expect them */

View File

@ -551,38 +551,6 @@ Modifiers: 256
Number of Parameters: 0
Number of Required Parameters: 0
Inspecting method 'set_local_infile_default'
isFinal: no
isAbstract: no
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isConstructor: no
isDestructor: no
isInternal: yes
isUserDefined: no
returnsReference: no
Modifiers: 256
Number of Parameters: 0
Number of Required Parameters: 0
Inspecting method 'set_local_infile_handler'
isFinal: no
isAbstract: no
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isConstructor: no
isDestructor: no
isInternal: yes
isUserDefined: no
returnsReference: no
Modifiers: 256
Number of Parameters: 0
Number of Required Parameters: 0
Inspecting method 'set_opt'
isFinal: no
isAbstract: no

View File

@ -135,6 +135,12 @@ mysqli_connect()
mysqli_free_result($res);
mysqli_close($link);
}
ini_set('mysqli.default_host', 'p:');
if (is_object($link = @mysqli_connect())) {
printf("[024] Usage of mysqli.default_host=p: did not fail\n") ;
mysqli_close($link);
}
}
print "done!";

View File

@ -134,7 +134,7 @@ if (!function_exists('mysqli_fetch_all'))
if (!(gettype($php_value)=="unicode" && ($fields[1]->flags & 128))) {
if ($regexp_comparison && !$skip) {
if ($regexp_comparison) {
if (!preg_match($regexp_comparison, (string)$row['label']) || !preg_match($regexp_comparison, (string)$row[1])) {
printf("[%04d] Expecting %s/%s [reg exp = %s], got %s/%s resp. %s/%s. [%d] %s\n", $offset + 4,
gettype($php_value), $php_value, $regexp_comparison,

View File

@ -214,12 +214,12 @@ if (!function_exists('mysqli_fetch_all'))
func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", NULL, NULL, 400);
// don't care about date() strict TZ warnings...
$date = date('Y-m-d');
$date = @date('Y-m-d');
func_mysqli_fetch_all_oo($link, $engine, "DATE", $date, $date, 410);
func_mysqli_fetch_all_oo($link, $engine, "DATE NOT NULL", $date, $date, 420);
func_mysqli_fetch_all_oo($link, $engine, "DATE", NULL, NULL, 430);
$datetime = date('Y-m-d H:i:s');
$datetime = @date('Y-m-d H:i:s');
func_mysqli_fetch_all_oo($link, $engine, "DATETIME", $datetime, $datetime, 440);
func_mysqli_fetch_all_oo($link, $engine, "DATETIME NOT NULL", $datetime, $datetime, 450);
func_mysqli_fetch_all_oo($link, $engine, "DATETIME", NULL, NULL, 460);

View File

@ -34,7 +34,25 @@ require_once('skipifconnectfailure.inc');
mysqli_free_result($res);
if (!$res = mysqli_query($link, "SELECT 1 AS a, 2 AS a, 3 AS c, 4 AS C, NULL AS d, true AS e")) {
if (!$res = mysqli_query($link, "SELECT
1 AS a,
2 AS a,
3 AS c,
4 AS C,
NULL AS d,
true AS e,
5 AS '-1',
6 AS '-10',
7 AS '-100',
8 AS '-1000',
9 AS '10000',
'a' AS '100000',
'b' AS '1000000',
'c' AS '9',
'd' AS '9',
'e' AS '01',
'f' AS '-02'
")) {
printf("[007] Cannot run query, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
print "[008]\n";
@ -60,7 +78,7 @@ array(2) {
[006]
NULL
[008]
array(5) {
array(15) {
["a"]=>
string(1) "2"
["c"]=>
@ -71,6 +89,26 @@ array(5) {
NULL
["e"]=>
string(1) "1"
[-1]=>
string(1) "5"
[-10]=>
string(1) "6"
[-100]=>
string(1) "7"
[-1000]=>
string(1) "8"
[10000]=>
string(1) "9"
[100000]=>
string(1) "a"
[1000000]=>
string(1) "b"
[9]=>
string(1) "d"
["01"]=>
string(1) "e"
["-02"]=>
string(1) "f"
}
Warning: mysqli_fetch_assoc(): Couldn't fetch mysqli_result in %s on line %d
@ -86,7 +124,7 @@ array(2) {
[006]
NULL
[008]
array(5) {
array(15) {
[u"a"]=>
unicode(1) "2"
[u"c"]=>
@ -97,6 +135,26 @@ array(5) {
NULL
[u"e"]=>
unicode(1) "1"
[-1]=>
unicode(1) "5"
[-10]=>
unicode(1) "6"
[-100]=>
unicode(1) "7"
[-1000]=>
unicode(1) "8"
[10000]=>
unicode(1) "9"
[100000]=>
unicode(1) "a"
[1000000]=>
unicode(1) "b"
[9]=>
unicode(1) "d"
[u"01"]=>
unicode(1) "e"
[u"-02"]=>
unicode(1) "f"
}
Warning: mysqli_fetch_assoc(): Couldn't fetch mysqli_result in %s on line %d

View File

@ -96,9 +96,12 @@ require_once('skipifconnectfailure.inc');
I'm using the procedural interface, this should not throw an exception.
Also, I did not ask to get exceptions using the mysqli_options()
*/
if ($TEST_EXPERIMENTAL)
try {
if (false !== ($obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', 'a')))
printf("[011] Should have failed\n");
} catch (Exception $e) {
printf("%s\n", $e->getMessage());
}
mysqli_free_result($res);
@ -145,5 +148,6 @@ NULL
Warning: mysqli_fetch_object(): Couldn't fetch mysqli_result in %s on line %d
NULL
Parameter ctor_params must be an array
Fatal error: Class 'this_class_does_not_exist' not found in %s on line %d