Bug #70221 [NEW]: persistent sqlite connection + custom function silently forces exit code 1
From: shish+phpwtf at shishnet dot org
Operating system: linux
PHP version: 7.0Git-2015-08-09 (Git)
Package: PDO SQLite
Bug Type: Bug
Bug description:persistent sqlite connection + custom function silently forces exit code 1
Description:
------------
When using PDO with the sqlite engine and persistent connections, and
adding a custom sqlite function, the process exits with status code 1
(which makes my unit tests fail) whether it is successful (should exit
with 0) or not (should exit with 2)
- in php5.[456] the exit code is 0
- with persistent connections turned off, the exit is 0
- with no custom function, the exit is 0
- no exceptions are thrown, the script proceeds as though nothing is
wrong
- if you add "exit(2)" to the end of the test script, you can see that
even this "explicitly exit with code 2" exits with code 1 if an sqlite
function has been added to a persistent connection.
I guess maybe there is some sort of "if using persistent connections,
then add a register_shutdown_function() function which cleans up custom
functions so that custom functions added to this connection won't affect
following requests", and that code is calling exit(1)?
Test script:
---------------
<?php
$db = new PDO('sqlite:test.sqlite', null, null,
array(PDO::ATTR_PERSISTENT => true));
function _test() { return 42; }
$db->sqliteCreateFunction('test', '_test', 0);
print("Everything is fine, no exceptions here\n");
Expected result:
----------------
the script should exit with code 0 (or code 2 if you add "exit(2);" at
the end)
Actual result:
--------------
the script exits with code 1
--
Edit bug report at https://bugs.php.net/bug.php?id=70221&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70221&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70221&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70221&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70221&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70221&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70221&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70221&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70221&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70221&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70221&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70221&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70221&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70221&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70221&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70221&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70221&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70221&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70221&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70221&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70221&r=mysqlcfg
Thread (3 messages)
- shish+phpwtf at shishnet dot org