Hi,

if the transfer optimization needs to check if the destination table is
empty, and if the optimization is actually used, and if the destination
table uses AUTOINCREMENT, then the generated code does not update the
sqlite_sequence table.

After these statements, the row in dst should have rowid 2, but the
rowid 1 got reused:

create table src(a integer primary key autoincrement, b unique);
create table dst(a integer primary key autoincrement, b unique);
insert into src default values;
insert into dst select * from src;
-- select * from sqlite_sequence where name = 'dst'; is empty
delete from dst;
insert into dst default values;
select a from dst;
1

(reported by Matthew Moisen on <http://stackoverflow.com/q/39820552/11654>)


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to