Bug #72668 [Opn->Csd]: Spurious warning when exception is thrown in user defined function
| From: | laruence@php.net | Date: | Mon, 25 Jul 2016 12:29:47 +0000 |
| Subject: | Bug #72668 [Opn->Csd]: Spurious warning when exception is thrown in user defined function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202576@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72668&edit=1
ID: 72668
Updated by: laruence@php.net
Reported by: cmb@php.net
Summary: Spurious warning when exception is thrown in user
defined function
-Status: Open
+Status: Closed
Type: Bug
Package: SQLite related
Operating System: *
PHP Version: 7.1.0beta1
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f5e56cf9707a1be547cc29f568d6f60dbdbb1e4c
Log: Fixed bug #72668 (Spurious warning when exception is thrown in user defined function)
Previous Comments:
------------------------------------------------------------------------
[2016-07-25 12:10:37] cmb@php.net
Description:
------------
This has been originally reported by @danack in bug #55416, which
is related, but not a duplicate.
When an exception is thrown inside a user-defined SQL function, a
spurious warning is additionally shown when a query using this
function is executed, even though the exception is caught.
For reference: <https://3v4l.org/I4TpT>.
Test script:
---------------
<?php
function my_udf_md5($string) {
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);
}
catch(\Exception $e) {
echo "Exception: ".$e->getMessage();
}
Expected result:
----------------
Exception: test exception
Actual result:
--------------
Warning: SQLite3::querySingle(): Unable to execute statement: in %s on line 10
Exception: test exception
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72668&edit=1