Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | In sqlite3changeset_apply(), ensure that DELETE and UPDATE changes are always executed on main database tables, not similarly named temp tables, as documented. INSERT statements are already being handled correctly. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f71a13d072398c9fc3556f42d75159cc |
User & Date: | dan 2020-02-27 17:16:45.085 |
Context
2020-02-28
| ||
16:04 | The RTREE extension behaves as if data columns have type REAL, so we should actually declare them as REAL so that automatic indexes handle them correctly. Ticket [e63b4d1a65546532] (check-in: 85a9b6a92f user: drh tags: trunk) | |
2020-02-27
| ||
17:16 | In sqlite3changeset_apply(), ensure that DELETE and UPDATE changes are always executed on main database tables, not similarly named temp tables, as documented. INSERT statements are already being handled correctly. (check-in: f71a13d072 user: dan tags: trunk) | |
16:21 | Fix harmless compiler warnings from MSVC. (check-in: 951b39ca74 user: drh tags: trunk) | |
Changes
Changes to ext/session/sessionH.test.
︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 | WITH s(i) AS ( VALUES(1) UNION ALL SELECT i+1 FROM s WHERe i<10000 ) INSERT INTO t1 SELECT 'abcde', randomblob(16), i FROM s; } compare_db db db2 } {} finish_test | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | WITH s(i) AS ( VALUES(1) UNION ALL SELECT i+1 FROM s WHERe i<10000 ) INSERT INTO t1 SELECT 'abcde', randomblob(16), i FROM s; } compare_db db db2 } {} #------------------------------------------------------------------------ db2 close reset_db do_execsql_test 2.0 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); INSERT INTO main.t1 VALUES(1, 2, 3), (4, 5, 6), (7, 8, 9); } do_test 2.1 { sqlite3session S db main S attach * db eval { BEGIN; INSERT INTO t1 VALUES(10, 11, 12); DELETE FROM t1 WHERE a=1; UPDATE t1 SET b='five', c='six' WHERE a=4; } set C [S changeset] db eval ROLLBACK S delete set {} {} } {} do_execsql_test 2.2 { CREATE TEMP TABLE t1(a INTEGER PRIMARY KEY, b, c); INSERT INTO temp.t1 VALUES(1, 2, 3), (4, 5, 6), (7, 8, 9); } set ::conflict [list] proc xConflict {args} { lappend ::conflict $args ; return "" } do_test 2.3 { sqlite3changeset_apply db $C xConflict set ::conflict } {} do_execsql_test 2.4 { SELECT * FROM main.t1; SELECT '****'; SELECT * FROM temp.t1; } { 4 five six 7 8 9 10 11 12 **** 1 2 3 4 5 6 7 8 9 } finish_test |
Changes to ext/session/sqlite3session.c.
︙ | ︙ | |||
3509 3510 3511 3512 3513 3514 3515 | ){ int i; const char *zSep = ""; int rc = SQLITE_OK; SessionBuffer buf = {0, 0, 0}; int nPk = 0; | | | 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 | ){ int i; const char *zSep = ""; int rc = SQLITE_OK; SessionBuffer buf = {0, 0, 0}; int nPk = 0; sessionAppendStr(&buf, "DELETE FROM main.", &rc); sessionAppendIdent(&buf, zTab, &rc); sessionAppendStr(&buf, " WHERE ", &rc); for(i=0; i<p->nCol; i++){ if( p->abPK[i] ){ nPk++; sessionAppendStr(&buf, zSep, &rc); |
︙ | ︙ | |||
3592 3593 3594 3595 3596 3597 3598 | ){ int rc = SQLITE_OK; int i; const char *zSep = ""; SessionBuffer buf = {0, 0, 0}; /* Append "UPDATE tbl SET " */ | | | 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 | ){ int rc = SQLITE_OK; int i; const char *zSep = ""; SessionBuffer buf = {0, 0, 0}; /* Append "UPDATE tbl SET " */ sessionAppendStr(&buf, "UPDATE main.", &rc); sessionAppendIdent(&buf, zTab, &rc); sessionAppendStr(&buf, " SET ", &rc); /* Append the assignments */ for(i=0; i<p->nCol; i++){ sessionAppendStr(&buf, zSep, &rc); sessionAppendIdent(&buf, p->azCol[i], &rc); |
︙ | ︙ |