mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Merge branch 'PHP-7.0' into PHP-7.1
This commit is contained in:
commit
ac0bbea3a8
@ -555,7 +555,9 @@ PHP_METHOD(sqlite3, query)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db));
|
||||
if (!EG(exception)) {
|
||||
php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db));
|
||||
}
|
||||
sqlite3_finalize(stmt_obj->stmt);
|
||||
stmt_obj->initialised = 0;
|
||||
zval_dtor(return_value);
|
||||
@ -1611,7 +1613,9 @@ PHP_METHOD(sqlite3stmt, execute)
|
||||
sqlite3_reset(stmt_obj->stmt);
|
||||
|
||||
default:
|
||||
php_sqlite3_error(stmt_obj->db_obj, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt)));
|
||||
if (!EG(exception)) {
|
||||
php_sqlite3_error(stmt_obj->db_obj, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt)));
|
||||
}
|
||||
zval_dtor(return_value);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -6,19 +6,36 @@ if (!extension_loaded('sqlite3')) die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function my_udf_md5($string) {
|
||||
throw new \Exception("test exception\n");
|
||||
throw new \Exception("test exception\n");
|
||||
}
|
||||
|
||||
$db = new SQLite3(':memory:');
|
||||
$db->createFunction('my_udf_md5', 'my_udf_md5');
|
||||
|
||||
try {
|
||||
$result = $db->querySingle('SELECT my_udf_md5("test")');
|
||||
var_dump($result);
|
||||
$result = $db->query('SELECT my_udf_md5("test")');
|
||||
var_dump($result);
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
echo "Exception: ".$e->getMessage();
|
||||
echo "Exception: ".$e->getMessage();
|
||||
}
|
||||
try {
|
||||
$result = $db->querySingle('SELECT my_udf_md5("test")');
|
||||
var_dump($result);
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
echo "Exception: ".$e->getMessage();
|
||||
}
|
||||
$statement = $db->prepare('SELECT my_udf_md5("test")');
|
||||
try {
|
||||
$result = $statement->execute();
|
||||
var_dump($result);
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
echo "Exception: ".$e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Exception: test exception
|
||||
Exception: test exception
|
||||
Exception: test exception
|
||||
|
Loading…
Reference in New Issue
Block a user