I was just looking at the ticket, and was wondering if that actually is the
right answer?

Does REPLACE do an actual INSERT regardless if the PK exists?  Doesn't it
search and and update?  If NULL is the key, wouldn't it do a search for PK
of NULL (Doesn't exist) and replace that, essentially becoming a NO-OP?  I
can see how "generates row 1" becomes "replaces row 1" but, I wouldn't
expect the REPLACE keyword to do an insert.  Might be just a linguistic
meaning thing to me, but if thats as it operates, looks fine to me then.

On Mon, May 1, 2017 at 2:50 PM, Richard Hipp <d...@sqlite.org> wrote:

> On 5/1/17, E.Pasma <pasm...@concepts.nl> wrote:
> > Hello, I have a duplicate rowid in a 3.16.2 database and this is
> > essentially produced as follows:
> >
> > CREATE TABLE t(i INTEGER PRIMARY KEY, a TEXT)
> > ;
> > INSERT INTO t VALUES
> >      (NULL, 'generates row 1')
> > ;
> > REPLACE INTO t VALUES
> >      (NULL, 'generates row 2'),
> >      (1, 'replaces row 1')
> > ;
> >
>
> Thanks for the bug report.  This should now be fixed on trunk.  The
> ticket is https://www.sqlite.org/src/info/f68dc596c4
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to