Browse Source
bring tests up-to-date with 5_1 branch
bring tests up-to-date with 5_1 branch
#few are failing and will stop failing when bugfixes are upmerged from 5_1migration/RELEASE_1_0_0
20 changed files with 218 additions and 16 deletions
-
4ext/mysqli/tests/003.phpt
-
37ext/mysqli/tests/004.phpt
-
1ext/mysqli/tests/006.phpt
-
1ext/mysqli/tests/007.phpt
-
1ext/mysqli/tests/008.phpt
-
24ext/mysqli/tests/009.phpt
-
1ext/mysqli/tests/010.phpt
-
15ext/mysqli/tests/013.phpt
-
1ext/mysqli/tests/020.phpt
-
1ext/mysqli/tests/023.phpt
-
1ext/mysqli/tests/024.phpt
-
1ext/mysqli/tests/025.phpt
-
1ext/mysqli/tests/026.phpt
-
1ext/mysqli/tests/042.phpt
-
1ext/mysqli/tests/060.phpt
-
1ext/mysqli/tests/065.phpt
-
1ext/mysqli/tests/bug32405.phpt
-
68ext/mysqli/tests/bug35103.phpt
-
29ext/mysqli/tests/bug35517.phpt
-
44ext/mysqli/tests/bug35759.phpt
@ -0,0 +1,68 @@ |
|||
--TEST-- |
|||
bug #35103 Bad handling of unsigned bigint |
|||
--SKIPIF-- |
|||
<?php require_once('skipif.inc'); ?> |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$drop = <<<EOSQL |
|||
DROP TABLE test_bint; |
|||
DROP TABLE test_buint; |
|||
EOSQL; |
|||
include "connect.inc"; |
|||
|
|||
$mysql = new mysqli($host, $user, $passwd, "test"); |
|||
$mysql->query("DROP TABLE IF EXISTS test_bint"); |
|||
$mysql->query("CREATE TABLE test_bint (a bigint(20) default NULL) ENGINE=MYISAM"); |
|||
$mysql->query("INSERT INTO test_bint VALUES (9223372036854775807),(-9223372036854775808),(-2147483648),(-2147483649),(-2147483647),(2147483647),(2147483648),(2147483649)"); |
|||
|
|||
$mysql->query("DROP TABLE IF EXISTS test_buint"); |
|||
$mysql->query("CREATE TABLE test_buint (a bigint(20) unsigned default NULL)"); |
|||
$mysql->query("INSERT INTO test_buint VALUES (18446744073709551615),(9223372036854775807),(9223372036854775808),(2147483647),(2147483649),(4294967295)"); |
|||
|
|||
$stmt = $mysql->prepare("SELECT a FROM test_bint ORDER BY a"); |
|||
$stmt->bind_result($v); |
|||
$stmt->execute(); |
|||
$i=0; |
|||
echo "BIG INT SIGNED, TEST\n"; |
|||
while ($i++ < 8) { |
|||
$stmt->fetch(); |
|||
echo $v, "\n"; |
|||
} |
|||
$stmt->close(); |
|||
|
|||
echo str_repeat("-", 20), "\n"; |
|||
|
|||
$stmt = $mysql->prepare("SELECT a FROM test_buint ORDER BY a"); |
|||
$stmt->bind_result($v2); |
|||
$stmt->execute(); |
|||
$j=0; |
|||
echo "BIG INT UNSIGNED TEST\n"; |
|||
while ($j++ < 6) { |
|||
$stmt->fetch(); |
|||
echo $v2, "\n"; |
|||
} |
|||
$stmt->close(); |
|||
|
|||
$mysql->multi_query($drop); |
|||
|
|||
$mysql->close(); |
|||
?> |
|||
--EXPECT-- |
|||
BIG INT SIGNED, TEST |
|||
-9223372036854775808 |
|||
-2147483649 |
|||
-2147483648 |
|||
-2147483647 |
|||
2147483647 |
|||
2147483648 |
|||
2147483649 |
|||
9223372036854775807 |
|||
-------------------- |
|||
BIG INT UNSIGNED TEST |
|||
2147483647 |
|||
2147483649 |
|||
4294967295 |
|||
9223372036854775807 |
|||
9223372036854775808 |
|||
18446744073709551615 |
|||
@ -0,0 +1,29 @@ |
|||
--TEST-- |
|||
Bug #35517 mysqli_stmt_fetch returns NULL |
|||
--SKIPIF-- |
|||
<?php require_once('skipif.inc'); ?> |
|||
--FILE-- |
|||
<?php |
|||
include "connect.inc"; |
|||
|
|||
$mysql = new mysqli($host, $user, $passwd, "test"); |
|||
|
|||
$mysql->query("CREATE TABLE temp (id INT UNSIGNED NOT NULL)"); |
|||
$mysql->query("INSERT INTO temp (id) VALUES (3000000897),(3800001532),(3900002281),(3100059612)"); |
|||
|
|||
$stmt = $mysql->prepare("SELECT id FROM temp"); |
|||
$stmt->execute(); |
|||
$stmt->bind_result($id); |
|||
while ($stmt->fetch()) { |
|||
var_dump($id); |
|||
} |
|||
$stmt->close(); |
|||
|
|||
$mysql->query("DROP TABLE temp"); |
|||
$mysql->close(); |
|||
?> |
|||
--EXPECTF-- |
|||
string(10) "3000000897" |
|||
string(10) "3800001532" |
|||
string(10) "3900002281" |
|||
string(10) "3100059612" |
|||
@ -0,0 +1,44 @@ |
|||
--TEST-- |
|||
bug #35759 : mysqli_stmt_bind_result() makes huge allocation when column empty |
|||
--SKIPIF-- |
|||
<?php require_once('skipif.inc'); ?> |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$sql=<<<EOSQL |
|||
CREATE TABLE blobby ( |
|||
a1 MEDIUMBLOB NOT NULL, |
|||
|
|||
|
|||
EOSQL; |
|||
include "connect.inc"; |
|||
$col_num= 1000; |
|||
|
|||
$mysql = new mysqli($host, $user, $passwd, "test"); |
|||
$mysql->query("DROP TABLE IF EXISTS blobby"); |
|||
$create = "CREATE TABLE blobby (a0 MEDIUMBLOB NOT NULL DEFAULT ''"; |
|||
$i= 0; |
|||
while (++$i < $col_num) { |
|||
$create .= ", a$i MEDIUMBLOB NOT NULL DEFAULT ''"; |
|||
} |
|||
$create .= ")"; |
|||
|
|||
$mysql->query($create); |
|||
$mysql->query("INSERT INTO blobby (a0) VALUES ('')"); |
|||
|
|||
$stmt = $mysql->prepare("SELECT * FROM blobby"); |
|||
$stmt->execute(); |
|||
$stmt->store_result(); |
|||
$params= array_pad(array(), $col_num, ""); |
|||
call_user_func_array(array($stmt, "bind_result"), $params); |
|||
$stmt->fetch(); |
|||
|
|||
$stmt->close(); |
|||
|
|||
$mysql->query("DROP TABLE blobby"); |
|||
|
|||
$mysql->close(); |
|||
echo "OK\n"; |
|||
?> |
|||
--EXPECT-- |
|||
OK |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue