2009-09-18 22:32:01 +08:00
|
|
|
--TEST--
|
|
|
|
Bug #48909 (Segmentation fault in mysqli_stmt_execute)
|
|
|
|
--SKIPIF--
|
2009-09-21 16:36:14 +08:00
|
|
|
<?php
|
|
|
|
require_once('skipif.inc');
|
2009-09-18 22:32:01 +08:00
|
|
|
require_once('skipifconnectfailure.inc');
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2009-10-20 04:07:25 +08:00
|
|
|
require_once("connect.inc");
|
2009-09-18 22:32:01 +08:00
|
|
|
|
2009-09-24 20:51:03 +08:00
|
|
|
if (!($link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
|
2009-09-21 16:36:14 +08:00
|
|
|
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
|
|
|
$host, $user, $db, $port, $socket);
|
|
|
|
|
|
|
|
if (!$link->query("DROP TABLE IF EXISTS test") ||
|
|
|
|
!$link->query(sprintf("CREATE TABLE test(id INT, label varchar(255)) ENGINE = %s", $engine)))
|
|
|
|
printf("[002] [%d] %s\n", $link->errno, $link->error);
|
|
|
|
|
|
|
|
if (!$stmt = $link->prepare("INSERT INTO test(id, label) VALUES (?, ?)"))
|
|
|
|
printf("[003] [%d] %s\n", $link->errno, $link->error);
|
|
|
|
|
|
|
|
if (!$stmt->bind_param("bb",$bvar, $bvar))
|
|
|
|
printf("[004] [%d] %s\n", $stmt->errno, $stmt->error);
|
|
|
|
|
2010-06-08 22:57:10 +08:00
|
|
|
if (!$stmt->execute()) {
|
|
|
|
if ($stmt->errno != 1366) {
|
|
|
|
/*
|
|
|
|
$bvar is null, b is for BLOB - any error like this should be OK:
|
|
|
|
1366 - Incorrect integer value: '' for column 'id' at row 1
|
|
|
|
*/
|
|
|
|
printf("[005] [%d] %s\n", $stmt->errno, $stmt->error);
|
|
|
|
}
|
|
|
|
}
|
2009-09-21 16:36:14 +08:00
|
|
|
|
2009-09-18 22:32:01 +08:00
|
|
|
$stmt->close();
|
|
|
|
$link->close();
|
2009-09-21 16:36:14 +08:00
|
|
|
|
|
|
|
echo "done";
|
|
|
|
?>
|
|
|
|
--CLEAN--
|
|
|
|
<?php
|
|
|
|
require_once("clean_table.inc");
|
2009-09-18 22:32:01 +08:00
|
|
|
?>
|
2018-02-19 16:59:41 +08:00
|
|
|
--EXPECT--
|
2018-10-15 10:33:09 +08:00
|
|
|
done
|