Description
I just try the 0.8.2 version with a Crystal 0.23.1 [e2a1389e8] LLVM 3.8.
There is a bug that doesn't allow sqlite to run in a spawned Fiber (which is annoying if you try to run Kemal e.g.)
The bug is easy to reproduce:
require "sqlite3"
spawn do
DB.open "sqlite3://%3Amemory%3A" do |db|
db.exec "CREATE TABLE IF NOT EXISTS contacts (name string, age integer)"
puts "=== count is #{db.scalar "select count(*) from contacts"}"
end
end
sleep 1.seconds
The execution gives:
---inside #step : #SQLite3::Statement:0x412d20 sql select count(*) from contacts
Unhandled exception in spawn:
database disk image is malformed (SQLite3::Exception)
0x72eb4: *CallStack::unwind:Array(Pointer(Void)) at /home/pi/Projects/crystal/src/float/printer/cached_powers.cr 1:1
0xd7cf0: move_next at /home/pi/Projects/CrystalThinking/lib/sqlite3/src/sqlite3/result_set.cr 20:7
0xce484: scalar at /home/pi/Projects/CrystalThinking/lib/db/src/db/statement.cr 39:13
0xcec04: scalar at /home/pi/Projects/CrystalThinking/lib/db/src/db/pool_statement.cr 44:30
0xc5268: scalar at /home/pi/Projects/CrystalThinking/lib/db/src/db/query_methods.cr 223:7
0x6e584: ~procProc(Nil) at /home/pi/Projects/crystal/src/time/format/pattern.cr 1:1
0x83260: run at /home/pi/Projects/crystal/src/fiber.cr 255:3
0x6d834: ~proc2Proc(Fiber, (IO::FileDescriptor | Nil)) at /home/pi/Projects/crystal/src/concurrent.cr 61:3