1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Experimental changes that allow a WITHOUT ROWID virtual table to be writable

as long as it has only a single-column PRIMARY KEY.

FossilOrigin-Name: ab9ee4c1e64c09c7130e385a23d043d78bad95dff5509c7adc9b992350a4a537
This commit is contained in:
drh
2017-08-10 15:19:39 +00:00
parent 6fa9375c01
commit e3740f272b
6 changed files with 61 additions and 21 deletions

View File

@ -93,6 +93,7 @@ do_catchsql_test 3.2 {
SELECT rowid, a FROM t3;
} {1 {no such column: rowid}}
# Multi-column WITHOUT ROWID virtual tables may not be writable.
do_catchsql_test 4.0 {
DROP TABLE t3;
CREATE VIRTUAL TABLE temp.t4 USING csv_wr(
@ -100,13 +101,28 @@ do_catchsql_test 4.0 {
'1,2,3,4
5,6,7,8
9,10,11,12
13,14,15,16
',
13,14,15,16',
columns=4,
schema=
'CREATE TABLE t3(a PRIMARY KEY,b TEXT,c TEXT,d TEXT) WITHOUT ROWID',
'CREATE TABLE t3(a,b,c,d,PRIMARY KEY(a,b)) WITHOUT ROWID',
testflags=1
);
} {1 {vtable constructor failed: t4}}
# WITHOUT ROWID tables with a single-column PRIMARY KEY may be writable.
do_catchsql_test 4.1 {
DROP TABLE IF EXISTS t4;
CREATE VIRTUAL TABLE temp.t4 USING csv_wr(
data=
'1,2,3,4
5,6,7,8
9,10,11,12
13,14,15,16',
columns=4,
schema=
'CREATE TABLE t3(a,b,c,d,PRIMARY KEY(b)) WITHOUT ROWID',
testflags=1
);
} {0 {}}
finish_test