Mailinglist Archive: zypp-devel (68 mails)
| < Previous | Next > |
Re: [zypp-devel] I try to like SQLite, but it does not like me ,(
- From: Klaus Kaempf <kkaempf@xxxxxxx>
- Date: Fri, 4 May 2007 11:09:47 +0200
- Message-id: <20070504090947.GA4231@xxxxxxxxxxxxx>
* Michael Andres <ma@xxxxxxx> [May 04. 2007 01:03]:
> The 1st call to cache::CacheStore to create the db succeeds.
>
> But if the db exists I get
>
> [DEFINE_LOGGROUP] CacheInitializer.cpp(createTables):104 Initializing cache schema...
> [DEFINE_LOGGROUP] CacheInitializer.cpp(createTables):126 Schema size: 9380
>
> [zypp] Exception.cc(log):94 CacheInitializer.cpp(CacheInitializer):77
> RETHROW: ():0: table db_info already exists
> terminate called after throwing an instance of 'sqlite3x::database_error'
> what(): table db_info already exists
> ./ma_test: line 44: 12413 Aborted $SUDO ./$PRG "$@"
>
>
> Why?
It looks like the 'createTables' just runs "CREATE TABLE db_info ..." which fails
if the table already exists.
The usual way to prevent this is to run "DROP TABLE IF EXISTS db_info" immediately
before the "CREATE TABLE ..." call.
See http://www.sqlite.org/lang_droptable.html
Klaus
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
> The 1st call to cache::CacheStore to create the db succeeds.
>
> But if the db exists I get
>
> [DEFINE_LOGGROUP] CacheInitializer.cpp(createTables):104 Initializing cache schema...
> [DEFINE_LOGGROUP] CacheInitializer.cpp(createTables):126 Schema size: 9380
>
> [zypp] Exception.cc(log):94 CacheInitializer.cpp(CacheInitializer):77
> RETHROW: ():0: table db_info already exists
> terminate called after throwing an instance of 'sqlite3x::database_error'
> what(): table db_info already exists
> ./ma_test: line 44: 12413 Aborted $SUDO ./$PRG "$@"
>
>
> Why?
It looks like the 'createTables' just runs "CREATE TABLE db_info ..." which fails
if the table already exists.
The usual way to prevent this is to run "DROP TABLE IF EXISTS db_info" immediately
before the "CREATE TABLE ..." call.
See http://www.sqlite.org/lang_droptable.html
Klaus
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |