t = Thread.new do
sleep 0.5
@db.interrupt
end
n = 2**31
# extralite::error: query was interrupted
assert_raises(Extralite::Error) {
@db.query <<-SQL
WITH RECURSIVE
fibo (curr, next)
AS
( SELECT 1,1
UNION ALL
SELECT next, curr+next FROM fibo
LIMIT #{n} )
SELECT curr, next FROM fibo LIMIT 1 OFFSET #{n}-1;
SQL
}
t.join
add
db.interrupt
support for long-running queries