Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/vec1/test/vec1alter.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / vec1 / test / vec1alter.test` 80 lines ยท 1723 bytes Raw Blame History 1 # 2026-08-04 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # 12 # 13 14 source [file join [file dirname [info script]] vec1_common.tcl] 15 set testprefix vec1alter 16 vec1_load db 17 18 do_execsql_test 1.0 { 19 CREATE VIRTUAL TABLE v1 USING vec1(v); 20 INSERT INTO v1(rowid, v) VALUES(11, random_vector(8)); 21 INSERT INTO v1(rowid, v) VALUES(12, random_vector(8)); 22 } 23 24 do_execsql_test 1.1 { 25 ALTER TABLE v1 RENAME TO v2; 26 } 27 28 do_execsql_test 1.2 { 29 SELECT rowid FROM v2 30 } {11 12} 31 32 do_execsql_test 1.3 { 33 PRAGMA integrity_check 34 } {ok} 35 36 do_execsql_test 1.4 { 37 PRAGMA writable_schema; 38 } {0} 39 40 do_execsql_test 1.5 { 41 PRAGMA writable_schema = 1; 42 PRAGMA writable_schema; 43 } {1} 44 45 do_execsql_test 1.6 { 46 ALTER TABLE v2 RENAME TO v3; 47 } 48 49 do_execsql_test 1.7 { 50 PRAGMA writable_schema; 51 } {1} 52 53 do_execsql_test 1.8 { 54 CREATE VIRTUAL TABLE v1 USING vec1(v); 55 INSERT INTO v1(rowid, v) VALUES(-14, random_vector(18)); 56 INSERT INTO v1(rowid, v) VALUES(-15, random_vector(18)); 57 } 58 59 do_execsql_test 1.9 { 60 SELECT rowid FROM v1 61 } {-15 -14} 62 63 do_test 1.10 { sqlite3_db_config db DEFENSIVE } {0} 64 do_test 1.11 { sqlite3_db_config db DEFENSIVE 1 } {1} 65 66 do_execsql_test 1.12 { 67 ALTER TABLE v3 RENAME TO v4; 68 } 69 70 do_test 1.13 { sqlite3_db_config db DEFENSIVE } {1} 71 72 do_execsql_test 1.14 { 73 SELECT tbl_name, name, sql FROM sqlite_schema WHERE name='v4_idx_idx' 74 } { 75 v4_idx v4_idx_idx 76 {CREATE INDEX 'v4_idx_idx' ON 'v4_idx'(bucket, first, last)} 77 } 78 79 finish_test 80