File tree 3 files changed +29
-1
lines changed
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ PHP NEWS
75
75
character). (cmb)
76
76
77
77
- SQLite3:
78
+ . Fixed bug #72668 (Spurious warning when exception is thrown in user defined
79
+ function). (Laruence)
78
80
. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
79
81
80
82
- Standard:
Original file line number Diff line number Diff line change @@ -672,8 +672,10 @@ PHP_METHOD(sqlite3, querySingle)
672
672
break ;
673
673
}
674
674
default :
675
+ if (!EG (exception )) {
675
676
php_sqlite3_error (db_obj , "Unable to execute statement: %s" , sqlite3_errmsg (db_obj -> db ));
676
- RETVAL_FALSE ;
677
+ }
678
+ RETVAL_FALSE ;
677
679
}
678
680
sqlite3_finalize (stmt );
679
681
}
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