summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2016-12-12 21:52:36 +0200
committerAndrey Hristov <andrey@php.net>2016-12-12 21:52:36 +0200
commit13fc1b92ca0cd15db470bf4478449f51f9886eb5 (patch)
tree17109674bf24b24ff1c8c8d4ab1fd109da038064
parenta881ea7d86fd156adcf7aedb60ccc398583d082b (diff)
downloadphp-git-13fc1b92ca0cd15db470bf4478449f51f9886eb5.tar.gz
Add a bit more test cases (edge cases) to the BIT test case
-rw-r--r--ext/mysqli/tests/bug_bits.phpt40
1 files changed, 38 insertions, 2 deletions
diff --git a/ext/mysqli/tests/bug_bits.phpt b/ext/mysqli/tests/bug_bits.phpt
index d87505f8b6..8a56469772 100644
--- a/ext/mysqli/tests/bug_bits.phpt
+++ b/ext/mysqli/tests/bug_bits.phpt
@@ -21,7 +21,13 @@ if (!$link->query("CREATE TABLE `bug_bits` (`inty` bigint(20) unsigned NOT NULL
printf("[003] [%d] %s\n", $link->errno, $link->error);
}
-$insertQuery = "INSERT INTO `bug_bits` VALUES (18446744073709551615, 18446744073709551615), (18446744073709551614, 18446744073709551614)";
+$insertQuery = "INSERT INTO `bug_bits` VALUES (18446744073709551615, 18446744073709551615)".
+ ",(18446744073709551614, 18446744073709551614)".
+ ",(4294967296, 4294967296)".
+ ",(4294967295, 4294967295)".
+ ",(2147483648, 2147483648)".
+ ",(2147483647, 2147483647)".
+ ",(1, 1)";
if (!$link->query($insertQuery)) {
printf("[004] [%d] %s\n", $link->errno, $link->error);
}
@@ -44,7 +50,7 @@ require_once("connect.inc");
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
-if (!mysqli_query($link, "DROP TABLE IF EXISTS bug72489"))
+if (!mysqli_query($link, "DROP TABLE IF EXISTS bug_bits"))
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_close($link);
@@ -62,4 +68,34 @@ array(2) {
["bitty"]=>
string(20) "18446744073709551614"
}
+array(2) {
+ ["inty"]=>
+ string(10) "4294967296"
+ ["bitty"]=>
+ string(10) "4294967296"
+}
+array(2) {
+ ["inty"]=>
+ string(10) "4294967295"
+ ["bitty"]=>
+ string(10) "4294967295"
+}
+array(2) {
+ ["inty"]=>
+ string(10) "2147483648"
+ ["bitty"]=>
+ string(10) "2147483648"
+}
+array(2) {
+ ["inty"]=>
+ string(10) "2147483647"
+ ["bitty"]=>
+ string(10) "2147483647"
+}
+array(2) {
+ ["inty"]=>
+ string(1) "1"
+ ["bitty"]=>
+ string(1) "1"
+}
Done