1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add a test to check that the incrblob API cannot be used to write to an IPK column. Also a comment to explain why the incrblob code does not need to check if a column is part of a parent key before writing to it.

FossilOrigin-Name: dca2a7f608d9237039541707846c76cd460f5805
This commit is contained in:
dan
2009-10-02 06:35:06 +00:00
parent 3d7b046996
commit 1316700e54
4 changed files with 29 additions and 9 deletions

View File

@ -309,7 +309,7 @@ do_test incrblob-4.7 {
list $rc $msg
} {1 {cannot open value of type null}}
do_test incrblob-4.8 {
do_test incrblob-4.8.1 {
execsql {
INSERT INTO blobs(k, v, i) VALUES(X'010203040506070809', 'hello', 'world');
}
@ -318,6 +318,22 @@ do_test incrblob-4.8 {
} msg ]
list $rc $msg
} {1 {cannot open indexed column for writing}}
do_test incrblob-4.8.2 {
execsql {
CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
INSERT INTO t3 VALUES(1, 2);
}
set rc [catch {
set ::blob [db incrblob -readonly t3 a 1]
} msg ]
list $rc $msg
} {1 {cannot open value of type null}}
do_test incrblob-4.8.3 {
set rc [catch {
set ::blob [db incrblob -readonly t3 rowid 1]
} msg ]
list $rc $msg
} {1 {no such column: "rowid"}}
do_test incrblob-4.9.1 {
set rc [catch {