# Sqlite3.3.7 gives "SQL logic error or missing database"

**URL:** <https://www.ruby-forum.com/t/sqlite3-3-7-gives-sql-logic-error-or-missing-database/108587>\
**Category:** Rails\
**Created:** [July 5, 2007, 4:48am UTC](https://www.ruby-forum.com/t/sqlite3-3-7-gives-sql-logic-error-or-missing-database/108587 "2007-07-05T04:48:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [July 5, 2007, 4:48am UTC](https://www.ruby-forum.com/t/sqlite3-3-7-gives-sql-logic-error-or-missing-database/108587/1 "2007-07-05T04:48:21Z")

</div>

Railsters:

I ported a working project to a new hard drive, and had such a pleasant  
afternoon with this issue:

```
http://www.railsweenie.com/forums/5/topics/1496

```

The bug report says the problem is pilot error.

However, I get the bug before querying anything. I get it especially  
annoyingly from test\_dummy with nothing in it. The bug refers to the  
calls  
below setup():

SQLite3::SQLException: SQL logic error or missing database  
/var/lib/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/errors.rb:94:in  
`check' /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:76:in `check’  
/var/lib/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:68:in  
`commence' /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:61:in `initialize’  
/var/lib/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in  
`new’

I think I have this bug:

```
http://www.railsweenie.com/forums/5/topics/1496

```

Here’s the potential cause:

"I got the same message. The problem was there were files in test/unit  
for  
models that had been deleted. You’ll get the same message if you run a  
single test, e.g. if you have a file test/unit/foo\_test.rb but no table  
for  
foos typing the shell command

% ruby test/unit/foo\_test.rb

will give the same error."

So when I move all my non-Model unit tests out of the unit test folder,  
and  
put them into the functional folder, and everything works.

So that doesn’t appear to be pilot error, huh, if all these tests work  
fine  
with MySQL for the test database, and if all these tests worked fine  
with  
slightly older version ticks.

Some version dumps:

rails (1.2.3)  
sqlite3-ruby (1.1.0.1) (This is \_why’s sensibility repack.)  
ZenTest (3.6.0)

Using the latest sqlite3-ruby, and the one that came with my Fiesty  
Fawn,  
also didn’t help.

Should we open a bug ticket for this?

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax
