Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add test and fixes for SQLITE_OPEN_SHARED_SCHEMA mode. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | reuse-schema |
Files: | files | file ages | folders |
SHA3-256: |
9a78d89c8427ae737d4798cc146e41ad |
User & Date: | dan 2019-02-20 17:36:10.699 |
Context
2019-02-20
| ||
18:44 | Further test cases and fixes for SQLITE_OPEN_SHARED_SCHEMA. (check-in: ba0ab042f4 user: dan tags: reuse-schema) | |
17:36 | Add test and fixes for SQLITE_OPEN_SHARED_SCHEMA mode. (check-in: 9a78d89c84 user: dan tags: reuse-schema) | |
2019-02-19
| ||
18:00 | Improve error messages caused by corrupt database schemas in OPEN_SHARED_SCHEMA mode. (check-in: 8ac75b8a88 user: dan tags: reuse-schema) | |
Changes
Changes to doc/shared_schema.md.
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - - - - - - | Connections opened with the SQLITE_OPEN_SHARED_SCHEMA flag specified may not modify any database schema except that belonging to the temp database in anyway. This includes creating or dropping database objects, vacuuming the database, or running ANALYZE when the sqlite_stat\[14\] tables do not exist. |
︙ |
Changes to src/attach.c.
︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | + | goto detach_error; } if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){ sqlite3_snprintf(sizeof(zErr),zErr, "database %s is locked", zName); goto detach_error; } sqlite3SchemaDisconnect(db, i, 0); sqlite3BtreeClose(pDb->pBt); pDb->pBt = 0; pDb->pSchema = 0; sqlite3CollapseDatabaseArray(db); return; detach_error: |
︙ |
Changes to src/test_schemapool.c.
︙ | |||
70 71 72 73 74 75 76 77 78 79 80 81 82 83 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + | char **pzErr ){ int rc = SQLITE_NOMEM; schemapool_vtab *pVtab = sqlite3_malloc(sizeof(schemapool_vtab)); if( pVtab ){ memset(pVtab, 0, sizeof(schemapool_vtab)); rc = sqlite3_declare_vtab(db, SCHEMAPOOL_SCHEMA); if( rc!=SQLITE_OK ){ sqlite3_free(pVtab); pVtab = 0; } } *ppVtab = (sqlite3_vtab *)pVtab; return rc; } /* ** Open a new cursor on the schema table. |
︙ |
Changes to test/reuse3.test.
︙ | |||
255 256 257 258 259 260 261 262 263 264 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | + + + + + + + + + + + + + | PRAGMA writable_schema = 1; UPDATE sqlite_master SET sql='CREATE TABLE t3 a,b' WHERE name = 't3'; } do_test 5.2 { catchsql { SELECT * FROM t1 } db2 } {1 {malformed database schema (t3) - near "a": syntax error}} do_test 5.3 { catchsql { SELECT nref,nschema FROM schemapool } db2 } {1 {vtable constructor failed: schemapool}} do_execsql_test 5.4 { PRAGMA writable_schema = 1; UPDATE sqlite_master SET sql='CREATE TABLE t3(a,b)' WHERE name = 't3'; } do_test 5.5 { catchsql { SELECT nref,nschema FROM schemapool } db2 } {0 {1 1}} finish_test |
Added test/reuse4.test.