--FILE--
<?php
-$sql=<<<EOSQL
-CREATE TABLE blobby (
- a1 MEDIUMBLOB NOT NULL,
-
-
-EOSQL;
require_once("connect.inc");
$col_num= 1000;
$mysql = new mysqli($host, $user, $passwd, $db, $port, $socket);
- $mysql->query("DROP TABLE IF EXISTS blobby");
- $create = "CREATE TABLE blobby (a0 MEDIUMBLOB NOT NULL DEFAULT ''";
+ $mysql->query("DROP TABLE IF EXISTS test");
+ $create = "CREATE TABLE test (a0 MEDIUMBLOB NOT NULL DEFAULT ''";
$i= 0;
while (++$i < $col_num) {
$create .= ", a$i MEDIUMBLOB NOT NULL DEFAULT ''";
}
- $create .= ")";
+ $create .= ")";
+
+ if (!$mysql->query($create)) {
+ if (1101 == $mysql->errno) {
+ /* SQL strict mode - [1101] BLOB/TEXT column 'a0' can't have a default value */
+ print "done!";
+ exit(0);
+ }
+ printf("[001] [%d] %s\n", $mysql->errno, $mysql->error);
+ }
- $mysql->query($create);
- $mysql->query("INSERT INTO blobby (a0) VALUES ('')");
+ if (!$mysql->query("INSERT INTO test (a0) VALUES ('')"))
+ printf("[002] [%d] %s\n", $mysql->errno, $mysql->error);
- $stmt = $mysql->prepare("SELECT * FROM blobby");
- $stmt->execute();
- $stmt->store_result();
- for ($i = 0; $i < $col_num; $i++) {
- $params[] = &$col_num;
- }
- call_user_func_array(array($stmt, "bind_result"), $params);
- $stmt->fetch();
+ $stmt = $mysql->prepare("SELECT * FROM test");
+ if ($stmt) {
- $stmt->close();
+ $stmt->execute();
+ $stmt->store_result();
+ for ($i = 0; $i < $col_num; $i++) {
+ $params[] = &$col_num;
+ }
+ call_user_func_array(array($stmt, "bind_result"), $params);
+ $stmt->fetch();
- $mysql->query("DROP TABLE blobby");
+ $stmt->close();
+ } else {
+ printf("[003] [%d] %s\n", $mysql->errno, $mysql->error);
+ }
$mysql->close();
- echo "OK\n";
-?>
---CLEAN--
-<?php
-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 blobby"))
- printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
-mysqli_close($link);
+ echo "done!";
?>
+--CLEAN--
+<?php require("clean_table.inc"); ?>
--EXPECT--
-OK
+done!
\ No newline at end of file
<?php
include ("connect.inc");
- $link = mysqli_init();
- $link->ssl_set("client-key.pem", "client-cert.pem", "cacert.pem","","");
+ if (!is_object($link = mysqli_init()))
+ printf("[001] Cannot create link\n");
+
+ if (!$link->ssl_set("client-key.pem", "client-cert.pem", "cacert.pem","",""))
+ printf("[002] [%d] %s\n", $link->errno, $link->error);
+
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
- printf("[002] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ printf("[003] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ }
+
+ if (!$res = $link->query('SHOW STATUS like "Ssl_cipher"')) {
+ if (1064 == $link->errno) {
+ /* ERROR 1064 (42000): You have an error in your SQL syntax; = sql strict mode */
+ if ($res = $link->query("SHOW STATUS")) {
+ while ($row = $res->fetch_assoc())
+ if ($row['Variable_name'] == 'Ssl_cipher')
+ break;
+ } else {
+ printf("[005] [%d] %s\n", $link->errno, $link->error);
+ }
+ } else {
+ printf("[004] [%d] %s\n", $link->errno, $link->error);
+ }
+ } else {
+ if (!$row = $res->fetch_assoc())
+ printf("[006] [%d] %s\n", $link->errno, $link->error);
}
- var_dump($link->query("show status like \"Ssl_cipher\"")->fetch_assoc());
+
+
+
+ var_dump($row);
print "done!";
?>
}
if (!mysqli_query($link, $sql = sprintf("CREATE TABLE test(id INT NOT NULL, label %s, PRIMARY KEY(id)) ENGINE = %s", $sql_type, $engine))) {
- print $sql;
// don't bail, engine might not support the datatype
return false;
}
- if (is_null($php_value) && !mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
+ if (is_null($php_value)) {
+ if (!mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
return false;
- }
-
- if (!is_null($php_value)) {
- if (is_int($sql_value) && !mysqli_query($link, sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
- printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
- return false;
- } else if (!is_int($sql_value) && !mysqli_query($link, sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $sql_value))) {
- printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
- return false;
+ }
+ } else {
+ if (is_string($sql_value)) {
+ if (!mysqli_query($link, $sql = "INSERT INTO test(id, label) VALUES (1, '" . $sql_value . "')")) {
+ printf("[%04ds] [%d] %s - %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link), $sql);
+ return false;
}
+ } else {
+ if (!mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
+ printf("[%04di] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
+ return false;
+ }
+ }
}
if (!$res = mysqli_query($link, "SELECT id, label FROM test")) {
func_mysqli_fetch_all($link, $engine, "INTEGER UNSIGNED", 4294967295, "4294967295", 230);
func_mysqli_fetch_all($link, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
- func_mysqli_fetch_all($link, $engine, "BIGINT", -9223372036854775808, "-9223372036854775808", 250);
+ func_mysqli_fetch_all($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
+
func_mysqli_fetch_all($link, $engine, "BIGINT", NULL, NULL, 260);
- func_mysqli_fetch_all($link, $engine, "BIGINT UNSIGNED", 18446744073709551615, "18446744073709551615", 270);
+ func_mysqli_fetch_all($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270);
func_mysqli_fetch_all($link, $engine, "BIGINT UNSIGNED", NULL, NULL, 280);
- func_mysqli_fetch_all($link, $engine, "FLOAT", -9223372036854775808 - 1.1, "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
+ func_mysqli_fetch_all($link, $engine, "FLOAT", (string)(-9223372036854775808 - 1.1), "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
func_mysqli_fetch_all($link, $engine, "FLOAT", NULL, NULL, 300);
- func_mysqli_fetch_all($link, $engine, "FLOAT UNSIGNED", 18446744073709551615 + 1.1, "1.84467e+19", 310, "/1\.84467e\+?[0]?19/iu");
+ func_mysqli_fetch_all($link, $engine, "FLOAT UNSIGNED", (string)(18446744073709551615 + 1.1), "1.84467e+19", 310, "/1\.84467e\+?[0]?19/iu");
func_mysqli_fetch_all($link, $engine, "FLOAT UNSIGNED ", NULL, NULL, 320);
- func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2)", -99999999.99, "-99999999.99", 330);
+ func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2)", "-99999999.99", "-99999999.99", 330);
func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2)", NULL, NULL, 340);
- func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2) UNSIGNED", 99999999.99, "99999999.99", 350);
+ func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2) UNSIGNED", "99999999.99", "99999999.99", 350);
func_mysqli_fetch_all($link, $engine, "DOUBLE(10,2) UNSIGNED", NULL, NULL, 360);
- func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", -99999999.99, "-99999999.99", 370);
+ func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", "-99999999.99", "-99999999.99", 370);
func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", NULL, NULL, 380);
- func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", 99999999.99, "99999999.99", 390);
+ func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", "99999999.99", "99999999.99", 390);
func_mysqli_fetch_all($link, $engine, "DECIMAL(10,2)", NULL, NULL, 400);
// don't care about date() strict TZ warnings...
func_mysqli_fetch_all($link, $engine, "CHAR(1) NOT NULL", "a", "a", 560);
func_mysqli_fetch_all($link, $engine, "CHAR(1)", NULL, NULL, 570);
- $string65k = func_mysqli_fetch_array_make_string(65535);
+ $string65k = func_mysqli_fetch_array_make_string(65400);
func_mysqli_fetch_all($link, $engine, "VARCHAR(1)", "a", "a", 580);
func_mysqli_fetch_all($link, $engine, "VARCHAR(255)", $string255, $string255, 590);
- func_mysqli_fetch_all($link, $engine, "VARCHAR(65635)", $string65k, $string65k, 600);
+ func_mysqli_fetch_all($link, $engine, "VARCHAR(65400)", $string65k, $string65k, 600);
func_mysqli_fetch_all($link, $engine, "VARCHAR(1) NOT NULL", "a", "a", 610);
func_mysqli_fetch_all($link, $engine, "VARCHAR(1)", NULL, NULL, 620);
?>
--CLEAN--
<?php
- require_once("clean_table.inc");
+ // require_once("clean_table.inc");
?>
--EXPECTF--
[005]
}
if (!$link->query($sql = sprintf("CREATE TABLE test(id INT NOT NULL, label %s, PRIMARY KEY(id)) ENGINE = %s", $sql_type, $engine))) {
- print $sql;
- // don't bail, engine might not support the datatype
- return false;
- }
-
- if (is_null($php_value) && !$link->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
- printf("[%04d] [%d] %s\n", $offset + 1, $link->errno, $link->error);
- return false;
+ // don't bail, engine might not support the datatype
+ return false;
}
- if (!is_null($php_value)) {
- if (is_int($sql_value) && !$link->query(sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
- printf("[%04d] [%d] %s\n", $offset + 1, $link->errno, $link->error);
- return false;
- } else if (!is_int($sql_value) && !$link->query(sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $sql_value))) {
+ if (is_null($php_value)) {
+ if (!$link->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
printf("[%04d] [%d] %s\n", $offset + 1, $link->errno, $link->error);
return false;
}
+ } else {
+ if (is_string($sql_value)) {
+ if (!$link->query($sql = "INSERT INTO test(id, label) VALUES (1, '" . $sql_value . "')")) {
+ printf("[%04ds] [%d] %s - %s\n", $offset + 1, $link->errno, $link->error, $sql);
+ return false;
+ }
+ } else {
+ if (!$link->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
+ printf("[%04di] [%d] %s\n", $offset + 1, $link->errno, $link->error);
+ return false;
+ }
+ }
}
if (!$res = $link->query("SELECT id, label FROM test")) {
func_mysqli_fetch_all_oo($link, $engine, "SMALLINT", -32768, "-32768", 100);
func_mysqli_fetch_all_oo($link, $engine, "SMALLINT", 32767, "32767", 110);
func_mysqli_fetch_all_oo($link, $engine, "SMALLINT", NULL, NULL, 120);
- func_mysqli_fetch_all_oo($link, $engine, "SMALLINT UNSIGNED", 65535, "65535", 130);
+ func_mysqli_fetch_all_oo($link, $engine, "SMALLINT UNSIGNED", 65400, "65400", 130);
func_mysqli_fetch_all_oo($link, $engine, "SMALLINT UNSIGNED", NULL, NULL, 140);
func_mysqli_fetch_all_oo($link, $engine, "MEDIUMINT", -8388608, "-8388608", 150);
func_mysqli_fetch_all_oo($link, $engine, "INTEGER UNSIGNED", 4294967295, "4294967295", 230);
func_mysqli_fetch_all_oo($link, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
- func_mysqli_fetch_all_oo($link, $engine, "BIGINT", -9223372036854775808, "-9223372036854775808", 250);
+ func_mysqli_fetch_all_oo($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
func_mysqli_fetch_all_oo($link, $engine, "BIGINT", NULL, NULL, 260);
- func_mysqli_fetch_all_oo($link, $engine, "BIGINT UNSIGNED", 18446744073709551615, "18446744073709551615", 270);
+ func_mysqli_fetch_all_oo($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270);
func_mysqli_fetch_all_oo($link, $engine, "BIGINT UNSIGNED", NULL, NULL, 280);
- func_mysqli_fetch_all_oo($link, $engine, "FLOAT", -9223372036854775808 - 1.1, "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
+ func_mysqli_fetch_all_oo($link, $engine, "FLOAT", (string)(-9223372036854775808 - 1.1), "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
func_mysqli_fetch_all_oo($link, $engine, "FLOAT", NULL, NULL, 300);
- func_mysqli_fetch_all_oo($link, $engine, "FLOAT UNSIGNED", 18446744073709551615 + 1.1, "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
+ func_mysqli_fetch_all_oo($link, $engine, "FLOAT UNSIGNED", (string)(18446744073709551615 + 1.1), "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
func_mysqli_fetch_all_oo($link, $engine, "FLOAT UNSIGNED ", NULL, NULL, 320);
- func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2)", -99999999.99, "-99999999.99", 330);
+ func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2)", "-99999999.99", "-99999999.99", 330);
func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2)", NULL, NULL, 340);
- func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2) UNSIGNED", 99999999.99, "99999999.99", 350);
+ func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2) UNSIGNED", "99999999.99", "99999999.99", 350);
func_mysqli_fetch_all_oo($link, $engine, "DOUBLE(10,2) UNSIGNED", NULL, NULL, 360);
- func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", -99999999.99, "-99999999.99", 370);
+ func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", "-99999999.99", "-99999999.99", 370);
func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", NULL, NULL, 380);
- func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", 99999999.99, "99999999.99", 390);
+ func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", "99999999.99", "99999999.99", 390);
func_mysqli_fetch_all_oo($link, $engine, "DECIMAL(10,2)", NULL, NULL, 400);
// don't care about date() strict TZ warnings...
func_mysqli_fetch_all_oo($link, $engine, "CHAR(1) NOT NULL", "a", "a", 560);
func_mysqli_fetch_all_oo($link, $engine, "CHAR(1)", NULL, NULL, 570);
- $string65k = func_mysqli_fetch_array_oo_make_string(65535);
+ $string65k = func_mysqli_fetch_array_oo_make_string(65400);
func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(1)", "a", "a", 580);
func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(255)", $string255, $string255, 590);
- func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(65635)", $string65k, $string65k, 600);
+ func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(65400)", $string65k, $string65k, 600);
func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(1) NOT NULL", "a", "a", 610);
func_mysqli_fetch_all_oo($link, $engine, "VARCHAR(1)", NULL, NULL, 620);
}
if (!mysqli_query($link, $sql = sprintf("CREATE TABLE test(id INT NOT NULL, label %s, PRIMARY KEY(id)) ENGINE = %s", $sql_type, $engine))) {
- print $sql;
- // don't bail, engine might not support the datatype
- return false;
- }
-
- if (is_null($php_value) && !mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
- printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
- return false;
+ // don't bail, engine might not support the datatype
+ return false;
}
- if (!is_null($php_value)) {
- if (is_int($sql_value) && !mysqli_query($link, sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
- printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
- return false;
- } else if (!is_int($sql_value) && !mysqli_query($link, sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $sql_value))) {
+ if (is_null($php_value)) {
+ if (!mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
printf("[%04d] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
return false;
}
+ } else {
+ if (is_string($sql_value)) {
+ if (!mysqli_query($link, $sql = "INSERT INTO test(id, label) VALUES (1, '" . $sql_value . "')")) {
+ printf("[%04ds] [%d] %s - %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link), $sql);
+ return false;
+ }
+ } else {
+ if (!mysqli_query($link, $sql = sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
+ printf("[%04di] [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
+ return false;
+ }
+ }
}
-
if (!$res = mysqli_query($link, "SELECT id, label FROM test")) {
printf("[%04d] [%d] %s\n", $offset + 2, mysqli_errno($link), mysqli_error($link));
return false;
return false;
}
-
-
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,
if ($IS_MYSQLND ||
((mysqli_get_server_version($link) >= 51000) &&
(mysqli_get_client_version($link) >= 51000))) {
- func_mysqli_fetch_array($link, $engine, "BIGINT", -9223372036854775808, "-9223372036854775808", 250);
+ func_mysqli_fetch_array($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
func_mysqli_fetch_array($link, $engine, "BIGINT", NULL, NULL, 260);
- func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", 18446744073709551615, "18446744073709551615", 260);
+ func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 260);
func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", NULL, NULL, 280);
}
- func_mysqli_fetch_array($link, $engine, "FLOAT", -9223372036854775808 - 1.1, "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
+ func_mysqli_fetch_array($link, $engine, "FLOAT", (string)(-9223372036854775808 - 1.1), "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
func_mysqli_fetch_array($link, $engine, "FLOAT", NULL, NULL, 300);
- func_mysqli_fetch_array($link, $engine, "FLOAT UNSIGNED", 18446744073709551615 + 1.1, "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
+ func_mysqli_fetch_array($link, $engine, "FLOAT UNSIGNED", (string)(18446744073709551615 + 1.1), "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
func_mysqli_fetch_array($link, $engine, "FLOAT UNSIGNED ", NULL, NULL, 320);
- func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2)", -99999999.99, "-99999999.99", 330);
+ func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2)", "-99999999.99", "-99999999.99", 330);
func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2)", NULL, NULL, 340);
- func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2) UNSIGNED", 99999999.99, "99999999.99", 350);
+ func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2) UNSIGNED", "99999999.99", "99999999.99", 350);
func_mysqli_fetch_array($link, $engine, "DOUBLE(10,2) UNSIGNED", NULL, NULL, 360);
- func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", -99999999.99, "-99999999.99", 370);
+ func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", "-99999999.99", "-99999999.99", 370);
func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", NULL, NULL, 380);
- func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", 99999999.99, "99999999.99", 390);
+ func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", "99999999.99", "99999999.99", 390);
func_mysqli_fetch_array($link, $engine, "DECIMAL(10,2)", NULL, NULL, 400);
// don't care about date() strict TZ warnings...
func_mysqli_fetch_array($link, $engine, "CHAR(1) NOT NULL", "a", "a", 560);
func_mysqli_fetch_array($link, $engine, "CHAR(1)", NULL, NULL, 570);
- $string65k = func_mysqli_fetch_array_make_string(65535);
+ $string65k = func_mysqli_fetch_array_make_string(65400);
func_mysqli_fetch_array($link, $engine, "VARCHAR(1)", "a", "a", 580);
func_mysqli_fetch_array($link, $engine, "VARCHAR(255)", $string255, $string255, 590);
- func_mysqli_fetch_array($link, $engine, "VARCHAR(65635)", $string65k, $string65k, 600);
+ func_mysqli_fetch_array($link, $engine, "VARCHAR(65400)", $string65k, $string65k, 600);
func_mysqli_fetch_array($link, $engine, "VARCHAR(1) NOT NULL", "a", "a", 610);
func_mysqli_fetch_array($link, $engine, "VARCHAR(1)", NULL, NULL, 620);
}
if (!$mysqli->query($sql = sprintf("CREATE TABLE test(id INT NOT NULL, label %s, PRIMARY KEY(id)) ENGINE = %s", $sql_type, $engine))) {
- print $sql;
- // don't bail, engine might not support the datatype
- return false;
- }
-
- if (is_null($php_value) && !$mysqli->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
- printf("[%04d] [%d] %s\n", $offset + 1, $mysqli->errno, $mysqli->error);
- return false;
+ // don't bail, engine might not support the datatype
+ return false;
}
- if (!is_null($php_value)) {
- if (is_int($sql_value) && !$mysqli->query(sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
- printf("[%04d] [%d] %s\n", $offset + 1, $mysqli->errno, $mysqli->error);
- return false;
- } else if (!is_int($sql_value) && !$mysqli->query(sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $sql_value))) {
+ if (is_null($php_value)) {
+ if (!$mysqli->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, NULL)"))) {
printf("[%04d] [%d] %s\n", $offset + 1, $mysqli->errno, $mysqli->error);
return false;
}
+ } else {
+ if (is_string($sql_value)) {
+ if (!$mysqli->query($sql = "INSERT INTO test(id, label) VALUES (1, '" . $sql_value . "')")) {
+ printf("[%04ds] [%d] %s - %s\n", $offset + 1, $mysqli->errno, $mysqli->error, $sql);
+ return false;
+ }
+ } else {
+ if (!$mysqli->query($sql = sprintf("INSERT INTO test(id, label) VALUES (1, '%d')", $sql_value))) {
+ printf("[%04di] [%d] %s\n", $offset + 1, $mysqli->errno, $mysqli->error);
+ return false;
+ }
+ }
}
if (!$res = $mysqli->query("SELECT id, label FROM test")) {
if ($IS_MYSQLND ||
((mysqli_get_server_version($link) >= 51000) &&
(mysqli_get_client_version($link) >= 51000))) {
- func_mysqli_fetch_array($mysqli, $engine, "BIGINT", -9223372036854775808, "-9223372036854775808", 250);
+ func_mysqli_fetch_array($mysqli, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
func_mysqli_fetch_array($mysqli, $engine, "BIGINT", NULL, NULL, 260);
- func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", 18446744073709551615, "18446744073709551615", 270);
+ func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270);
func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", NULL, NULL, 280);
}
- func_mysqli_fetch_array($mysqli, $engine, "FLOAT", -9223372036854775808 - 1.1, "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
+ func_mysqli_fetch_array($mysqli, $engine, "FLOAT", (string)(-9223372036854775808 - 1.1), "-9.22337e+18", 290, "/-9\.22337e\+?[0]?18/iu");
func_mysqli_fetch_array($mysqli, $engine, "FLOAT", NULL, NULL, 300);
- func_mysqli_fetch_array($mysqli, $engine, "FLOAT UNSIGNED", 18446744073709551615 + 1.1, "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
+ func_mysqli_fetch_array($mysqli, $engine, "FLOAT UNSIGNED", (string)(18446744073709551615 + 1.1), "1.84467e+?19", 310, "/1\.84467e\+?[0]?19/iu");
func_mysqli_fetch_array($mysqli, $engine, "FLOAT UNSIGNED ", NULL, NULL, 320);
- func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2)", -99999999.99, "-99999999.99", 330);
+ func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2)", "-99999999.99", "-99999999.99", 330);
func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2)", NULL, NULL, 340);
- func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2) UNSIGNED", 99999999.99, "99999999.99", 350);
+ func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2) UNSIGNED", "99999999.99", "99999999.99", 350);
func_mysqli_fetch_array($mysqli, $engine, "DOUBLE(10,2) UNSIGNED", NULL, NULL, 360);
- func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", -99999999.99, "-99999999.99", 370);
+ func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", "-99999999.99", "-99999999.99", 370);
func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", NULL, NULL, 380);
- func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", 99999999.99, "99999999.99", 390);
+ func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", "99999999.99", "99999999.99", 390);
func_mysqli_fetch_array($mysqli, $engine, "DECIMAL(10,2)", NULL, NULL, 400);
// don't care about date() strict TZ warnings...
func_mysqli_fetch_array($mysqli, $engine, "CHAR(1) NOT NULL", "a", "a", 560);
func_mysqli_fetch_array($mysqli, $engine, "CHAR(1)", NULL, NULL, 570);
- $string65k = func_mysqli_fetch_array_make_string(65535);
+ $string65k = func_mysqli_fetch_array_make_string(65400);
func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(1)", "a", "a", 580);
func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(255)", $string255, $string255, 590);
- func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(65635)", $string65k, $string65k, 600);
+ func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(65400)", $string65k, $string65k, 600);
func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(1) NOT NULL", "a", "a", 610);
func_mysqli_fetch_array($mysqli, $engine, "VARCHAR(1)", NULL, NULL, 620);