silverstripe / silverstripe-sqlite3

SQLite3 DB Adapter for Silverstripe
BSD 3-Clause "New" or "Revised" License
8 stars 19 forks source link

Fatal error: Uncaught Error: The SQLite3Result object has not been correctly initialised or is already closed #77

Closed lekoala closed 2 months ago

lekoala commented 3 months ago

Module version(s) affected

3

Description

I get this very odd error in my unit tests

Fatal error: Uncaught Error: The SQLite3Result object has not been correctly initialised or is already closed

Full stack

PHP Fatal error: Uncaught Error: The SQLite3Result object has not been correctly initialised or is already closed in ...\vendor\silverstripe\sqlite3\code\SQLite3Query.php:43 Stack trace:

0 ...\vendor\silverstripe\sqlite3\code\SQLite3Query.php(43): SQLite3Result->finalize()

1 [internal function]: SilverStripe\SQLite\SQLite3Query->__destruct()

2 {main}

thrown in...\vendor\silverstripe\sqlite3\code\SQLite3Query.php on line 43

This seem due to ->finalize being called but the db is already closed

How to reproduce

I didn't manage to get an easily reproducible example, but i can assure the issue is real :)

Possible Solution

No response

Additional Context

No response

Validations

lekoala commented 3 months ago

i've managed to fix the issue by doing this https://github.com/silverstripe/silverstripe-sqlite3/pull/78 i don't see any downside in doing so