Skip to content

Commit 13fc1b9

Browse files
committed
Add a bit more test cases (edge cases) to the BIT test case
1 parent a881ea7 commit 13fc1b9

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

ext/mysqli/tests/bug_bits.phpt

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ if (!$link->query("CREATE TABLE `bug_bits` (`inty` bigint(20) unsigned NOT NULL
2121
printf("[003] [%d] %s\n", $link->errno, $link->error);
2222
}
2323

24-
$insertQuery = "INSERT INTO `bug_bits` VALUES (18446744073709551615, 18446744073709551615), (18446744073709551614, 18446744073709551614)";
24+
$insertQuery = "INSERT INTO `bug_bits` VALUES (18446744073709551615, 18446744073709551615)".
25+
",(18446744073709551614, 18446744073709551614)".
26+
",(4294967296, 4294967296)".
27+
",(4294967295, 4294967295)".
28+
",(2147483648, 2147483648)".
29+
",(2147483647, 2147483647)".
30+
",(1, 1)";
2531
if (!$link->query($insertQuery)) {
2632
printf("[004] [%d] %s\n", $link->errno, $link->error);
2733
}
@@ -44,7 +50,7 @@ require_once("connect.inc");
4450
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
4551
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
4652

47-
if (!mysqli_query($link, "DROP TABLE IF EXISTS bug72489"))
53+
if (!mysqli_query($link, "DROP TABLE IF EXISTS bug_bits"))
4854
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
4955

5056
mysqli_close($link);
@@ -62,4 +68,34 @@ array(2) {
6268
["bitty"]=>
6369
string(20) "18446744073709551614"
6470
}
71+
array(2) {
72+
["inty"]=>
73+
string(10) "4294967296"
74+
["bitty"]=>
75+
string(10) "4294967296"
76+
}
77+
array(2) {
78+
["inty"]=>
79+
string(10) "4294967295"
80+
["bitty"]=>
81+
string(10) "4294967295"
82+
}
83+
array(2) {
84+
["inty"]=>
85+
string(10) "2147483648"
86+
["bitty"]=>
87+
string(10) "2147483648"
88+
}
89+
array(2) {
90+
["inty"]=>
91+
string(10) "2147483647"
92+
["bitty"]=>
93+
string(10) "2147483647"
94+
}
95+
array(2) {
96+
["inty"]=>
97+
string(1) "1"
98+
["bitty"]=>
99+
string(1) "1"
100+
}
65101
Done

0 commit comments

Comments
 (0)