# Need someone to confirm a bug with sqlite3 and mental

**URL:** <https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853>\
**Category:** Radiant CMS\
**Created:** [February 8, 2007, 4:41am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853 "2007-02-08T04:41:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 8, 2007, 4:41am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/1 "2007-02-08T04:41:19Z")

</div>

I’ve been trying to get this working for two days now. If I get myself  
a copy of mental (both from the Gem and from SVN) and try to use  
sqlite3 as my database, the rake db:bootstrap script doesn’t seem to  
create a user.

It doesn’t report any errors, or problems, it just says it’s complete  
and then won’t log in. A look at the database contents reveals that  
the admin user simply wasn’t created. This happens when I accept the  
default settings and when I specify a username and password.

When using MySQL, the user is in the database and I can log in without  
error.

Can anyone reproduce this?

Ben J…

SQLite3 version = 3.3.12

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 8, 2007, 5:05am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/2 "2007-02-08T05:05:20Z")

</div>

> I’ve been trying to get this working for two days now. If I get myself  
> a copy of mental (both from the Gem and from SVN) and try to use  
> sqlite3 as my database, the rake db:bootstrap script doesn’t seem to  
> create a user.

I experience your problem on my windows box, but there’s a deeper  
underlying problem on windows with rename\_table screwing up column  
defaults after rename\_column, add\_column, drop\_column or any other  
command that will do a recreate/drop to execute, so I don’t trust  
sqlite3 on windows at all. I raised a rails bug  
([http://dev.rubyonrails.org/ticket/6768](http://dev.rubyonrails.org/ticket/6768)) and mentioned it on the ruby  
mailing list, but got nowhere.

You’ll probably see this in your db:

sqlite\> .schema users  
CREATE TABLE users (“id” INTEGER PRIMARY KEY NOT NULL, “name”  
varchar(100) DEFAULT ‘’‘’‘’‘’‘’‘’‘’‘NULL’‘’‘’‘’‘’‘’‘’‘’, “email”  
varchar(255) DEFAULT ‘’‘’‘’‘’‘’‘’‘’‘NULL’‘’‘’‘’‘’‘’‘’‘’, “login”  
varchar(40) DEFAULT  
‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’ NOT NULL,  
“password” varchar(40) DEFAULT ‘’‘’‘’‘’‘’‘’‘’‘NULL’‘’‘’‘’‘’‘’‘’‘’,  
“created\_at” datetime DEFAULT NULL, “updated\_at” datetime DEFAULT NULL,  
“created\_by” integer DEFAULT 0, “updated\_by” integer DEFAULT 0, “admin”  
boolean DEFAULT ‘f’ NOT NULL, “developer” boolean DEFAULT ‘f’ NOT NULL,  
“notes” text);

My sqlite3 under linux works fine.

Dan.

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 9, 2007, 12:35am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/3 "2007-02-09T00:35:30Z")

</div>

Ben J. wrote:

> When using MySQL, the user is in the database and I can log in without error.
> 
> Can anyone reproduce this?

Same issue here too.  
L

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 9, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/4 "2007-02-09T14:13:34Z")

</div>

We will probably re-freeze the mental branch to 1.2.2 if this issue  
persists.

Sean

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 9, 2007, 5:09am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/5 "2007-02-09T05:09:48Z")

</div>

On 2/8/07, Ben J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When using MySQL, the user is in the database and I can log in without error.
> 
> Can anyone reproduce this?

Ben, any version of sqlite3 over 3.3.7 will show this issue, until you  
update sqlite3-ruby to 1.2.1 and re-freeze rails to 1.2.2 (the bundled  
rails into Radiant shows the bug as listed in the Riding Rails blog:

> **[Rails 1.2.2: SQLite3, gems, singular resources](https://rubyonrails.org/2007/2/6/rails-1-2-2-sqlite3-gems-singular-resources)**
>
> It’s time for another minor update to Rails 1.2. This was primarily prompted by a change in the API for SQLite between version 3.3.7 and 3.3.8+, which left the Rails database adapter for dead by the road side. But with this release and Jamis Buck’s...

This is shown on Win32 and Linux as well, after update, you could use  
sqlite3 3.3.12 if you want without these issues.

HTH,

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 9, 2007, 2:21pm UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/6 "2007-02-09T14:21:35Z")

</div>

On 2/9/07, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> We will probably re-freeze the mental branch to 1.2.2 if this issue  
> persists.

Sean,

Its confirmed, will persist… AFAIK, 1.2.x prior 1.2.2 will show  
this, didn’t test with 1.1.x branch, but the sqlite adapter inside AR  
changed just in the 1.2.x branch (and will not be backported).

> It doesn’t report any errors, or problems, it just says it’s complete  
> Ben, any version of sqlite3 over 3.3.7 will show this issue, until you
> 
> * * *
> 
> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site:  
> [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [February 9, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/7 "2007-02-09T16:34:50Z")

</div>

Sean C. wrote:

> We will probably re-freeze the mental branch to 1.2.2 if this issue  
> persists.

Let’s do that.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 27, 2007, 1:30am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/8 "2007-04-27T01:30:50Z")

</div>

> I have the same issue here. Even with sqlite3-ruby 1.2.1. Any  
> solutions  
> yet?
> 
> radiant (0.6.0)  
> sqlite3-ruby (1.2.1)  
> sqlite 3.3.13

It’s a rails issue - the version of rails that you’re using is the most  
important one. You should be running 1.2.3 (that’s what  
radiant ships with) but you could be using something else (do you have a  
vendor/rails dir? If so, is it a 1.2.3 rails?).

Dan.

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 27, 2007, 1:53am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/9 "2007-04-27T01:53:57Z")

</div>

Thanks for your reply. Rails::VERSION::STRING from script/console says  
“1.2.3”. I’m using the rails version radiant ships with (no  
vendor/rails).

Robert

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 27, 2007, 2:01am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/10 "2007-04-27T02:01:51Z")

</div>

> Thanks for your reply. Rails::VERSION::STRING from  
> script/console says  
> “1.2.3”. I’m using the rails version radiant ships with (no  
> vendor/rails).

In that case are you sure you’re seeing the same problem?

What do you get when you run .schema in sqlite?

Dan.

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 27, 2007, 3:35am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/11 "2007-04-27T03:35:43Z")

</div>

> In that case are you sure you’re seeing the same problem?  
> What do you get when you run .schema in sqlite?

[http://paste-bin.com/11503](http://paste-bin.com/11503)

I’m feeling pretty clueless here.

Robert

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 27, 2007, 3:57am UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/12 "2007-04-27T03:57:58Z")

</div>

> > In that case are you sure you’re seeing the same problem?  
> > What do you get when you run .schema in sqlite?
> 
> [http://paste-bin.com/11503](http://paste-bin.com/11503)
> 
> I’m feeling pretty clueless here.

Looks like you’re not running windows. The original bug was only (afaik)  
experienced in windows. Maybe the bug still exists in  
whatever os you’re running under (BSD?).

I’ve got the same versions of rails, radiant and sqlite3-ruby on both my  
windows and gentoo linux boxes, and can’t reproduce your  
problem.

I posted a bug about this ([http://dev.rubyonrails.org/ticket/6768](http://dev.rubyonrails.org/ticket/6768)) to  
the rails list, you can probably reproduce the bug with the  
same test and submit your own ticket detailing your environment.

Dan.

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [April 26, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/need-someone-to-confirm-a-bug-with-sqlite3-and-mental/84853/13 "2007-04-26T21:39:58Z")

</div>

I have the same issue here. Even with sqlite3-ruby 1.2.1. Any solutions  
yet?

radiant (0.6.0)  
sqlite3-ruby (1.2.1)  
sqlite 3.3.13

–  
Robert Klein
