Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 40383
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: janus [...] errornet.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.14
Fixed in: (no value)



Subject: Patch to fix "closing dbh with active statement handles"
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1224970202-13510-11"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 1489
Download (untitled) / with headers
text/plain 1.4k
Hi, i've seen those warnings numerous times, just like many other people: closing dbh with active statement handles at test.pl line 24. Now a friend proposed a workaround for another module where those warnings were seen and i was fed up and started to investigate. I found the solution in the SQLite documentation <http://sqlite.org/c3ref/close.html> where a function is used that occurred in version 3.6.0 of sqlite. The fix itself is pretty small: --- dbdimp.c.orig Fri Aug 24 04:51:25 2007 +++ dbdimp.c Sat Oct 25 22:31:04 2008 @@ -151,8 +151,13 @@ sqlite_db_disconnect (SV *dbh, imp_dbh_t *imp_dbh) } if (sqlite3_close(imp_dbh->db) == SQLITE_BUSY) { + sqlite3_stmt *pStmt; /* active statements! */ - warn("closing dbh with active statement handles"); + + while ((pStmt = sqlite3_next_stmt(imp_dbh->db, NULL)) != NULL) + sqlite3_finalize(pStmt); + + sqlite3_close(imp_dbh->db); } imp_dbh->db = NULL; A greater problem was to get it working with a system-wide installed sqlite library as the local header files get picked up instead of the system-wide installed headers. Besides that the local version wouldn't work anymore just with the above patch. So i also had to update the local version of sqlite. The resulting patch is obviously pretty big as it updates the whole sqlite distribution coming with DBD::SQLite. I really hope this can finally close this long standing bug. Kind regards, Simon
Subject: DBD-SQLite-1.14.diff.gz
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1224970050-10654-25"
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/gzip; name="DBD-SQLite-1.14.diff.gz"
Content-Disposition: inline; filename="DBD-SQLite-1.14.diff.gz"
Content-Transfer-Encoding: base64
Content-Length: 733306
Download DBD-SQLite-1.14.diff.gz
application/gzip 716.1k

Message body not shown because it is not plain text.

Subject: patch-dbdimp_c.diff
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1224970202-13510-10"
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/octet-stream; name="patch-dbdimp_c.diff"
Content-Disposition: inline; filename="patch-dbdimp_c.diff"
Content-Transfer-Encoding: base64
Content-Length: 525
Download patch-dbdimp_c.diff
text/x-diff 525b
--- dbdimp.c.orig Fri Aug 24 04:51:25 2007 +++ dbdimp.c Sat Oct 25 22:31:04 2008 @@ -151,8 +151,13 @@ sqlite_db_disconnect (SV *dbh, imp_dbh_t *imp_dbh) } if (sqlite3_close(imp_dbh->db) == SQLITE_BUSY) { + sqlite3_stmt *pStmt; /* active statements! */ - warn("closing dbh with active statement handles"); + + while ((pStmt = sqlite3_next_stmt(imp_dbh->db, NULL)) != NULL) + sqlite3_finalize(pStmt); + + sqlite3_close(imp_dbh->db); } imp_dbh->db = NULL;
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-2224-1238813597-818.40383-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 58
This appears to have been resolved by a different patch.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.