jackalope/jackalope-doctrine-dbal — pull request #46 by cryptocompress (2012-07-14 19:44:23+00:00)
Title: initial SQLite support

there are three failures:

# endless-transaction-rollback-loop in test: Transactions\\TransactionMethodsTest::testTransactionRollback
i commented it out. dont know how to fix this for now...

# race condition "Unexpected error talking to the backend: SQLSTATE[HY000]: General error: 17 database schema has changed"
20:52 < datadigger> When the schema changes, the first page of the database file is rewritten, because it contains the schema_version. There's a PRAGMA to read it. I am not aware of a method to find the process that caused the change, except the tracing facilities of the operating system.
20:53 < datadigger> The point is, schema modifications invalidate statements built with sqlite3_prepare(). Use sqlite3_prepare_v2() for automatic rebuild.
20:55 < datadigger> ^^^ cryptocompress
20:56 < cryptocompress> ahh... i will try... thank you
20:57 < datadigger> my pleasure
20:59 < cryptocompress> seems not be available in php :(
21:00 < datadigger> Aw, that's a bummer
21:00 < cryptocompress> have to find root cause of evil ;)
21:00 < datadigger> yep
21:00 < datadigger> truss . dtrace .
21:01 < datadigger> Or code inspection. Anything else than SELECT/UPDATE/DELETE is suspect.

i am on windows. no idea how to trace this. have to install vm first.

# OFFSET clause without LIMIT is not supported by SQLite
PHPCR\Tests\Query\QueryObjectSql2Test::testExecuteOffset
PDOException: SQLSTATE[HY000]: General error: 1 near "OFFSET": syntax error

"The expression attached to the optional OFFSET clause that may follow a LIMIT clause must also evaluate to an integer, or a value that can be losslessly converted to an integer."
"If the LIMIT expression evaluates to a negative value, then there is no upper bound on the number of rows returned."
http://www.sqlite.org/lang_select.html

possible solution 1 (easy):
add "$this->query->setLimit(3);" to test PHPCR\Tests\Query\QueryObjectSql2Test::testExecuteOffset

possible solution 2:
check on SQLite in \Jackalope\Query\Query::setOffset() and add call \Jackalope\Query\Query::setLimit(-1)
don't know how to do check on SQLite in Query class