Hello,

I want to report a bug, I checked https://www.sqlite.org/src/rptview?rn=8
and did not find the same?

Let schema be:

sqlite> .schema
CREATE TABLE albums (id int primary key, title text, score int);
CREATE TABLE rates (album_id references albums(id) on delete cascade,
comment text, score int);
CREATE TRIGGER test after insert on rates begin update albums set
score=new.score where id=new.album_id; end;

And I want to make albums.title not null.
This falls into https://www.sqlite.org/lang_altertable.html#otheralter.

sqlite> BEGIN;
sqlite> CREATE TABLE new_albums (id int primary key, title text not null,
score int);
sqlite> INSERT INTO new_albums (id, title, score) SELECT id, title, score
FROM albums;
sqlite> DROP TABLE albums;
sqlite> ALTER TABLE new_albums RENAME TO albums;
Error: error in trigger test: no such table: main.albums

Expected behavior is last alter is ok.

This is in 3.25.2

sqlite> select sqlite_version();
3.25.2

Cheers, Thierry
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to