|
28 | 28 | ** README.md |
29 | 29 | ** configure |
30 | 30 | ** configure.ac |
| 31 | +** doc/compile-for-windows.md |
| 32 | +** doc/jsonb.md |
| 33 | +** doc/testrunner.md |
| 34 | +** doc/trusted-schema.md |
| 35 | +** doc/vdbesort-memory.md |
| 36 | +** doc/wal-lock.md |
31 | 37 | ** ext/fts5/fts5_tokenize.c |
| 38 | +** ext/jni/README.md |
32 | 39 | ** ext/jni/src/org/sqlite/jni/capi/CollationNeededCallback.java |
33 | 40 | ** ext/jni/src/org/sqlite/jni/capi/CommitHookCallback.java |
34 | 41 | ** ext/jni/src/org/sqlite/jni/capi/PreupdateHookCallback.java |
|
81 | 88 | ** src/where.c |
82 | 89 | ** src/wherecode.c |
83 | 90 | ** test/all.test |
84 | | -** test/dbdata.test |
85 | | -** test/dbfuzz.c |
86 | | -** test/dbfuzz001.test |
87 | | -** test/dbfuzz2-seed1.db |
88 | | -** test/dbfuzz2.c |
89 | | -** test/dbpage.test |
90 | | -** test/dbpagefault.test |
91 | | -** test/dbstatus.test |
92 | | -** test/dbstatus2.test |
93 | | -** test/delete_db.test |
94 | | -** test/fuzzdata1.db |
95 | | -** test/fuzzdata2.db |
96 | | -** test/fuzzdata3.db |
97 | | -** test/fuzzdata4.db |
98 | | -** test/fuzzdata5.db |
99 | | -** test/fuzzdata6.db |
100 | | -** test/fuzzdata7.db |
101 | | -** test/fuzzdata8.db |
102 | | -** test/indexedby.test |
103 | | -** test/manydb.test |
104 | | -** test/memdb.test |
105 | | -** test/memdb1.test |
106 | | -** test/memdb2.test |
107 | | -** test/optfuzz-db01.c |
108 | | -** test/optfuzz-db01.txt |
| 91 | +** test/json/README.md |
109 | 92 | ** test/permutations.test |
110 | | -** test/resetdb.test |
111 | 93 | ** test/rowvaluevtab.test |
112 | | -** test/sessionfuzz-data1.db |
113 | | -** test/tempdb.test |
114 | | -** test/tempdb2.test |
115 | | -** test/tkt-94c04eaadb.test |
116 | 94 | ** tool/mkkeywordhash.c |
117 | 95 | ** tool/mksqlite3c-noext.tcl |
118 | 96 | ** tool/mksqlite3c.tcl |
@@ -65386,18 +65364,25 @@ SQLITE_PRIVATE int sqlite3PagerWalInsert(Pager *pPager, unsigned int iFrame, voi |
65386 | 65364 | } |
65387 | 65365 | if (iFrame <= mxFrame) { |
65388 | 65366 | unsigned long frame_len = nBuf-24; |
65389 | | - unsigned char current[frame_len]; |
| 65367 | + unsigned char *current; |
| 65368 | + |
| 65369 | + current = (unsigned char *)sqlite3MallocZero(frame_len); |
| 65370 | + if (current == NULL) { |
| 65371 | + return SQLITE_NOMEM; |
| 65372 | + } |
65390 | 65373 | rc = pPager->wal->methods.xReadFrame(pPager->wal->pData, iFrame, frame_len, current); |
65391 | 65374 | if (rc != SQLITE_OK) { |
| 65375 | + sqlite3_free(current); |
65392 | 65376 | return rc; |
65393 | 65377 | } |
65394 | 65378 | int conflict = 0; |
65395 | | - if (memcmp(pBuf+24, current, frame_len) != 0) { |
| 65379 | + if (memcmp((unsigned char*)pBuf+24, current, frame_len) != 0) { |
65396 | 65380 | conflict = 1; |
65397 | 65381 | } |
65398 | 65382 | if (pConflict) { |
65399 | 65383 | *pConflict = conflict; |
65400 | 65384 | } |
| 65385 | + sqlite3_free(current); |
65401 | 65386 | if (conflict) { |
65402 | 65387 | return SQLITE_ERROR; |
65403 | 65388 | } |
@@ -67628,6 +67613,15 @@ static int walCheckpoint( |
67628 | 67613 | } |
67629 | 67614 | } |
67630 | 67615 |
|
| 67616 | + |
| 67617 | +#ifdef LIBSQL_CHECKPOINT_ONLY_FULL |
| 67618 | + // in case of LIBSQL_CHECKPOINT_ONLY_FULL option we want to either checkpoint whole WAL or quickly abort the checkpoint |
| 67619 | + if( mxSafeFrame!=walIndexHdr(pWal)->mxFrame ){ |
| 67620 | + rc = SQLITE_BUSY; |
| 67621 | + goto walcheckpoint_out; |
| 67622 | + } |
| 67623 | +#endif |
| 67624 | + |
67631 | 67625 | /* Allocate the iterator */ |
67632 | 67626 | if( pInfo->nBackfill<mxSafeFrame ){ |
67633 | 67627 | rc = walIteratorRevInit(pWal, pInfo->nBackfill, &pIter, mxSafeFrame, xCb == NULL); |
@@ -121878,6 +121872,10 @@ SQLITE_PRIVATE int sqlite3DbIsNamed(sqlite3 *db, int iDb, const char *zName){ |
121878 | 121872 | int libsql_handle_extra_attach_params(sqlite3* db, const char* zName, const char* zPath, sqlite3_value* pKey, char** zErrDyn); |
121879 | 121873 | #endif |
121880 | 121874 |
|
| 121875 | +#ifdef LIBSQL_ENCRYPTION |
| 121876 | +SQLITE_PRIVATE int sqlite3mcHandleAttachKey(sqlite3*, const char*, const char*, sqlite3_value*, char**); |
| 121877 | +#endif |
| 121878 | + |
121881 | 121879 | /* |
121882 | 121880 | ** An SQL user-function registered to do the work of an ATTACH statement. The |
121883 | 121881 | ** three arguments to the function come directly from an attach statement: |
@@ -122037,6 +122035,16 @@ static void attachFunc( |
122037 | 122035 | rc = libsql_handle_extra_attach_params(db, zName, zPath, argv, &zErrDyn); |
122038 | 122036 | } |
122039 | 122037 | #endif |
| 122038 | + |
| 122039 | +#ifdef LIBSQL_ENCRYPTION |
| 122040 | + /* If the ATTACH statement came with key parameter, then lets handle it here. */ |
| 122041 | + if( rc==SQLITE_OK ){ |
| 122042 | + if( argv != NULL && argv[0] != NULL && argv[1] != NULL && argv[2] != NULL ){ |
| 122043 | + rc = sqlite3mcHandleAttachKey(db, zName, zPath, argv[2], &zErrDyn); |
| 122044 | + } |
| 122045 | + } |
| 122046 | +#endif |
| 122047 | + |
122040 | 122048 | sqlite3_free_filename( zPath ); |
122041 | 122049 |
|
122042 | 122050 | /* If the file was opened successfully, read the schema for the new database. |
|
0 commit comments