File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -660,8 +660,10 @@ PHP_METHOD(sqlite3, querySingle)
660
660
break ;
661
661
}
662
662
default :
663
+ if (!EG (exception )) {
663
664
php_sqlite3_error (db_obj , "Unable to execute statement: %s" , sqlite3_errmsg (db_obj -> db ));
664
- RETVAL_FALSE ;
665
+ }
666
+ RETVAL_FALSE ;
665
667
}
666
668
sqlite3_finalize (stmt );
667
669
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #72668 (Spurious warning when exception is thrown in user defined function)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('sqlite3 ' )) die ('skip ' ); ?>
6
+ --FILE--
7
+ <?php
8
+ function my_udf_md5 ($ string ) {
9
+ throw new \Exception ("test exception \n" );
10
+ }
11
+
12
+ $ db = new SQLite3 (':memory: ' );
13
+ $ db ->createFunction ('my_udf_md5 ' , 'my_udf_md5 ' );
14
+
15
+ try {
16
+ $ result = $ db ->querySingle ('SELECT my_udf_md5("test") ' );
17
+ var_dump ($ result );
18
+ }
19
+ catch (\Exception $ e ) {
20
+ echo "Exception: " .$ e ->getMessage ();
21
+ }
22
+ ?>
23
+ --EXPECT--
24
+ Exception: test exception
You can’t perform that action at this time.
0 commit comments