Ticket #455 (fixed bug)
Add field error using SQLite
- Created: 2011-06-06 04:54:42
- Reported by: daris
- Assigned to: Reines
- Milestone: 1.4.6
- Component: database
- Priority: normal
File: .../file.php
Line: 8
FluxBB reported: Unable to add column "notify_pm" to table "users"
Database reported: SQL logic error or missing database (Errno: 1)
Failed query: SELECT 1 FROM sqlite_master WHERE name = 'users_t1305812474' AND type='table'
I'm creating ticket as it looks that topic was forgotten
http://fluxbb.org/forums/viewtopic.php?id=5506
History
Reines 2011-06-06 09:12:33

- Status changed from open to fixed.
Hopefully fixed, could you please test the commit I just made and let me know? I've got to leave for work so don't have time to set up a SQLite install at the moment...
Reines 2011-06-06 09:13:03

- Status changed from fixed to open.
Actually I'll leave this open until it's been tested.
daris 2011-06-06 18:59:31

Your fix produces another syntax error - missing comma before UNIQUE
CREATE TABLE users (
id INTEGER NOT NULL
group_id INTEGER NOT NULL DEFAULT 3
username VARCHAR(200) NOT NULL DEFAULT ''
password VARCHAR(40) NOT NULL DEFAULT ''
email VARCHAR(80) NOT NULL DEFAULT ''
title VARCHAR(50)
realname VARCHAR(40)
url VARCHAR(100)
jabber VARCHAR(80)
icq VARCHAR(12)
msn VARCHAR(80)
aim VARCHAR(30)
yahoo VARCHAR(30)
location VARCHAR(30)
signature TEXT
disp_topics INTEGER
disp_posts INTEGER
email_setting INTEGER NOT NULL DEFAULT 1
notify_with_post INTEGER NOT NULL DEFAULT 0
auto_notify INTEGER NOT NULL DEFAULT 0
show_smilies INTEGER NOT NULL DEFAULT 1
show_img INTEGER NOT NULL DEFAULT 1
show_img_sig INTEGER NOT NULL DEFAULT 1
show_avatars INTEGER NOT NULL DEFAULT 1
show_sig INTEGER NOT NULL DEFAULT 1
timezone FLOAT NOT NULL DEFAULT 0
dst INTEGER NOT NULL DEFAULT 0
time_format INTEGER NOT NULL DEFAULT 0
date_format INTEGER NOT NULL DEFAULT 0
language VARCHAR(25) NOT NULL DEFAULT 'English'
style VARCHAR(25) NOT NULL DEFAULT 'Air'
num_posts INTEGER NOT NULL DEFAULT 0
last_post INTEGER
last_search INTEGER
last_email_sent INTEGER
registered INTEGER NOT NULL DEFAULT 0
registration_ip VARCHAR(39) NOT NULL DEFAULT '0.0.0.0'
last_visit INTEGER NOT NULL DEFAULT 0
admin_note VARCHAR(30)
activate_string VARCHAR(80)
use_pm INTEGER NOT NULL DEFAULT 1,
activate_key VARCHAR(8)
UNIQUE (username),
PRIMARY KEY (id)
);
Only UNIQUE should be stripped from commas.
I think that rewriting add_field and drop_field to use implode rather than manual comma adding would be a best solution.
daris 2011-06-06 19:01:24

I forgot to mention that in above query there is missing comma in almost each line
Reines 2011-06-06 19:50:12

- Status changed from open to fixed.
This seems to fix it now - I've done a quick test and it worked okay, though if you could give it a check that'd be great.