Skip to content

Commit 94dffc5

Browse files
committed
bring tests up-to-date with 5_1 branch
#few are failing and will stop failing when bugfixes are upmerged from 5_1
1 parent 9be53ac commit 94dffc5

20 files changed

+218
-16
lines changed

ext/mysqli/tests/003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ mysqli connect
77
include "connect.inc";
88

99
/*** test mysqli_connect 127.0.0.1 ***/
10-
$link = mysqli_connect($host, $user, $passwd);
10+
$link = mysqli_connect($host, $user, $passwd, "test");
1111

12-
mysqli_select_db($link, "test");
12+
mysqli_query($link, "SET sql_mode=''");
1313

1414
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
1515
mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time,

ext/mysqli/tests/004.phpt

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@ mysqli fetch char/text
1414
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1515
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
1616

17-
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test')");
17+
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test0')");
18+
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891', 'this is a test1')");
19+
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892', 'this is a test2')");
20+
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893', 'this is a test3')");
1821

19-
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
22+
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1");
2023
mysqli_bind_result($stmt, $c1, $c2);
2124
mysqli_execute($stmt);
22-
mysqli_fetch($stmt);
25+
$i=4;
26+
while ($i--) {
27+
mysqli_fetch($stmt);
28+
$test = array($c1,$c2);
29+
var_dump($test);
30+
}
2331

24-
$test = array($c1,$c2);
25-
26-
var_dump($test);
2732

2833
mysqli_stmt_close($stmt);
2934
mysqli_close($link);
@@ -33,5 +38,23 @@ array(2) {
3338
[0]=>
3439
string(10) "1234567890"
3540
[1]=>
36-
string(14) "this is a test"
41+
string(15) "this is a test0"
42+
}
43+
array(2) {
44+
[0]=>
45+
string(10) "1234567891"
46+
[1]=>
47+
string(15) "this is a test1"
48+
}
49+
array(2) {
50+
[0]=>
51+
string(10) "1234567892"
52+
[1]=>
53+
string(15) "this is a test2"
54+
}
55+
array(2) {
56+
[0]=>
57+
string(10) "1234567893"
58+
[1]=>
59+
string(15) "this is a test3"
3760
}

ext/mysqli/tests/006.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mysqli fetch long values
1010
$link = mysqli_connect($host, $user, $passwd);
1111

1212
mysqli_select_db($link, "test");
13+
mysqli_query($link, "SET sql_mode=''");
1314

1415
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1516
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,

ext/mysqli/tests/007.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mysqli fetch short values
1010
$link = mysqli_connect($host, $user, $passwd);
1111

1212
mysqli_select_db($link, "test");
13+
mysqli_query($link, "SET sql_mode=''");
1314

1415
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1516
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,

ext/mysqli/tests/008.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mysqli fetch tinyint values
1010
$link = mysqli_connect($host, $user, $passwd);
1111

1212
mysqli_select_db($link, "test");
13+
mysqli_query($link, "SET sql_mode=''");
1314

1415
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1516
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,

ext/mysqli/tests/009.phpt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
mysqli fetch bigint values
2+
mysqli fetch bigint values (ok to fail with 4.1.x)
33
--SKIPIF--
44
<?php
55
if (PHP_INT_SIZE == 8) {
@@ -16,6 +16,7 @@ mysqli fetch bigint values
1616
$link = mysqli_connect($host, $user, $passwd);
1717

1818
mysqli_select_db($link, "test");
19+
mysqli_query($link, "SET sql_mode=''");
1920

2021
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
2122
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5,
@@ -38,8 +39,25 @@ mysqli fetch bigint values
3839
var_dump($test);
3940

4041
mysqli_stmt_close($stmt);
42+
43+
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch_uint");
44+
mysqli_query($link,"CREATE TABLE test_bind_fetch_uint(c1 integer unsigned, c2 integer unsigned)");
45+
46+
mysqli_query($link, "INSERT INTO test_bind_fetch_uint (c1,c2) VALUES (20123456, 3123456789)");
47+
48+
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
49+
mysqli_bind_result($stmt, $c1, $c2);
50+
mysqli_execute($stmt);
51+
$rc = mysqli_fetch($stmt);
52+
53+
echo $c1, "\n", $c2, "\n";
54+
55+
mysqli_stmt_close($stmt);
56+
57+
4158
mysqli_close($link);
4259
?>
60+
4361
--EXPECT--
4462
array(7) {
4563
[0]=>
@@ -53,7 +71,9 @@ array(7) {
5371
[4]=>
5472
int(0)
5573
[5]=>
56-
string(13) "-333333333333"
74+
int(0)
5775
[6]=>
5876
int(100)
5977
}
78+
20123456
79+
3123456789

ext/mysqli/tests/010.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ precision=12
1212
$link = mysqli_connect($host, $user, $passwd);
1313

1414
mysqli_select_db($link, "test");
15+
mysqli_query($link, "SET sql_mode=''");
1516

1617
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1718

ext/mysqli/tests/013.phpt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mysqli fetch mixed / mysql_query
2525
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
2626

2727
$c = array(0,0,0,0,0,0,0,0);
28-
mysqli_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
28+
$b_res= mysqli_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
2929
mysqli_execute($stmt);
3030
mysqli_fetch($stmt);
3131
mysqli_fetch($stmt);
@@ -38,10 +38,15 @@ mysqli fetch mixed / mysql_query
3838
$test = "";
3939
for ($i=0; $i < count($c); $i++)
4040
$test .= ($c[0] == $d[0]) ? "1" : "0";
41-
42-
var_dump($test);
41+
if ($test == "11111111")
42+
echo "ok";
43+
else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 &&
44+
mysqli_get_server_version($link) > 50000)
45+
echo "error (4.1 library with 5.x server)";
46+
else
47+
echo "error";
4348

4449
mysqli_close($link);
4550
?>
46-
--EXPECT--
47-
string(8) "11111111"
51+
--EXPECTF--
52+
ok

ext/mysqli/tests/020.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mysqli bind_param/bind_result date
1010
$link = mysqli_connect($host, $user, $passwd);
1111

1212
mysqli_select_db($link, "test");
13+
mysqli_query($link, "SET sql_mode=''");
1314

1415
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
1516
mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time,

ext/mysqli/tests/023.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mysqli bind_param/bind_prepare fetch long values
1010
$link = mysqli_connect($host, $user, $passwd);
1111

1212
mysqli_select_db($link, "test");
13+
mysqli_query($link, "SET sql_mode=''");
1314

1415
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
1516
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,

0 commit comments

Comments
 (0)