On Tue, Oct 5, 2010 at 3:56 PM, Paweł Salawa <pawelsal...@gmail.com> wrote:
> Hi, > > My SQLite is 3.7.2. > > I have a table like this: > > CREATE TABLE [newsd] ( > [id] INTEGER PRIMARY KEY AUTOINCREMENT, > [date] INTEGER NOT NULL, [title] TEXT NOT NULL, > [yhfgdfhd] NONE, > CONSTRAINT "fg" UNIQUE ([yhfgdfhd]) ON CONFLICT IGNORE > ) > > so column [yhfgdfhd] is UNIQUE, and [title] is NOT NULL. > Now follow the log of 'sqlite3' calls: > > $ sqlite3 "data.db" > SQLite version 3.7.2 > Enter ".help" for instructions > sqlite> select * from newsd where ROWID = 16; > 16|12.2.12||e > sqlite> select * from newsd where ROWID = 21; > 21|||x > sqlite> UPDATE [newsd] SET [yhfgdfhd] = 'e' WHERE ROWID = 21; > sqlite> select * from newsd where ROWID = 21; > 21|||x > sqlite> UPDATE [newsd] SET [title] = NULL WHERE ROWID = 21; > SQL error: newsd.title may not be NULL > > So I'm indeed unable to set duplicate on UNIQUE column, but SQLite doesn't > raise error, thus my application doesn't call ROLLBACK for that case. > > Last call at the end is to ensure that other constraint violation raises > error > correctly. > Maybe you should remove the "ON CONFLICT IGNORE" clause at the end of the uniqueness constraint... > > Same behaviour takes place for tclsqlite extension. > > Regards, > -- > Paweł Salawa > pawelsal...@gmail.com > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users