[guest - Fri Jul 9 14:09:11 2004]:
Show quoted text> [guest - Thu Jul 8 17:42:43 2004]:
>
> > I get this error when trying to run Email::Store->setup. The SQLite
> > .db file gets created and is empty. I tried using Postgres
> instead
> > of SQLite, and got essentially the same error.
> >
> > DBD::SQLite::db do failed: near "NOT": syntax error [for Statement
> > "CREATE TABLE IF NOT EXISTS list (
> > id integer NOT NULL auto_increment primary key,
> > name varchar(255),
> > posting_address varchar(255)
> > )"] at /usr/share/perl5/Class/DBI/DATA/Schema.pm line 123.
> >
> > It's on a Debian/testing box, running Email::Store 0.11 (I also got
> > the error in version 0.08).
>
> The problem is that the final semi-colon at the end of the statements
> in
> the data section of any Email::Store plugin isn't being included in
> the
> output of the get_statements call inside
> Class::DBI::DATA::Schema->run_data_sql which, at least in the case of
> Postgres and SQLite, breaks the SQL::Translator parser.
>
> Inside get_statements there's a split on semi-colon, which is why that
> isn't included in the statement passed to SQL::Translator. I don't
> know
> whether the bug then lies in SQL::Translator for not working without a
> semi-colon or with Class::DBI::DATA::Schema for not including the
> semi-colon in the statement.
Alright ... once again, I'm not correct tracking down this bug. The
semi-colon does end up in the right place. In fact, it's not a call to
SQL::Translator that breaks anything. The SQL statement is plain old
not getting translated, apparently because the statement is cached
before it has a chance to be translated (line 85 in
Class::DBI::DATA::Schema), but I'm having an awful time trying to figure
out where the statement is being cached.