From:             pcdinh at gmail dot com
Operating system: Windows XP SP3
PHP version:      5.3.0alpha3
PHP Bug Type:     SQLite related
Bug description:  Creating a prepared statement without executing it makes 
database unclosable

Description:
------------
A database connection to SQLite3 can not be closed if I create a prepared
statement without executing it.

Of course, I have already closed that statement explicitly before closing
the database connection handler.

I had this warning: Unable to close due to unfinalised statements. It
means that an invocation to close() on a statement handler does not work.

Reproduce code:
---------------
<?php

// By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE.
$db   = new SQLite3('./test.db');

$sql  = 'SELECT 1';

$stmt = $db->prepare($sql);

// Commenting out the line intentionally
// $rs = $stmt->execute();

if (true === $stmt->close())
{
    echo 'Statement is already closed but in this case it is not. ';
}

if (false === $db->close())
{
    echo 'But database connection can not be closed due to an error:
'.$db->lastErrorMsg();
}
?>

Expected result:
----------------
Database connection should be closed as usual

Actual result:
--------------
The error message:

Statement is already closed but in this case it is not.
Warning: SQLite3::close() [sqlite3.close]: Unable to close database: 5,
Unable to close due to unfinalised statements in
D:\wvbsrc\repos\pone\trunk\tests\Plugin\test2_sqlite3.php on line 18
But database connection can not be closed due to an error: Unable to close
due to unfinalised statements

-- 
Edit bug report at http://bugs.php.net/?id=47159&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47159&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47159&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47159&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47159&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47159&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47159&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47159&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47159&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47159&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47159&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47159&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47159&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47159&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47159&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47159&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47159&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47159&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47159&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47159&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47159&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47159&r=mysqlcfg

Reply via email to