RDBI / rdbi-driver-sqlite3

SQLite DBD for RDBI
MIT License
7 stars 3 forks source link

SELECT COUNT(*) fails #1

Closed Pistos closed 14 years ago

Pistos commented 14 years ago

http://github.com/Pistos/rdbi-driver-sqlite3/commit/c9df38e737bcc8e88c2c218a03709d520c2c7022

1) Error: test_03_execute(TestDatabase): NoMethodError: undefined method `to_sym' for nil:NilClass
/misc/git/rdbi-driver-sqlite3/lib/rdbi/driver/sqlite3.rb:152:in `block in new_execution'
/misc/git/rdbi-driver-sqlite3/lib/rdbi/driver/sqlite3.rb:148:in `collect!'
/misc/git/rdbi-driver-sqlite3/lib/rdbi/driver/sqlite3.rb:148:in `new_execution'
/opt/rvm/gems/ruby-1.9.1-p378/gems/rdbi-0.0.0/lib/rdbi/statement.rb:34:in `block in execute'
<internal:prelude>:8:in `synchronize'
/opt/rvm/gems/ruby-1.9.1-p378/gems/rdbi-0.0.0/lib/rdbi/statement.rb:33:in `execute'
/opt/rvm/gems/ruby-1.9.1-p378/gems/rdbi-0.0.0/lib/rdbi/database.rb:203:in `block in execute'
<internal:prelude>:8:in `synchronize'
/opt/rvm/gems/ruby-1.9.1-p378/gems/rdbi-0.0.0/lib/rdbi/database.rb:200:in `execute'
/misc/git/rdbi-driver-sqlite3/test/test_database.rb:46:in `test_03_execute'

The issue is that the SQLite3 driver returns a nil data type for COUNT(*) instead of integer.

erikh commented 14 years ago

Solved in commit ea84ae558587efda8957b2b63cb580bce91ab180 - enjoy!