aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pragma.c5
-rw-r--r--src/random.c8
-rw-r--r--src/sqlite.h.in1
-rw-r--r--src/test2.c8
4 files changed, 18 insertions, 4 deletions
diff --git a/src/pragma.c b/src/pragma.c
index 7aea3dd2c..a0aa123fc 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -2170,6 +2170,11 @@ void sqlite3Pragma(
aOp[1].p2 = iCookie;
aOp[1].p3 = sqlite3Atoi(zRight);
aOp[1].p5 = 1;
+ if( iCookie==BTREE_SCHEMA_VERSION && (db->flags & SQLITE_Defensive)!=0 ){
+ /* Do not allow the use of PRAGMA schema_version=VALUE in defensive
+ ** mode. Change the OP_SetCookie opcode into a no-op. */
+ aOp[1].opcode = OP_Noop;
+ }
}else{
/* Read the specified cookie value */
static const VdbeOpList readCookie[] = {
diff --git a/src/random.c b/src/random.c
index 9335fc49d..ea8431ba9 100644
--- a/src/random.c
+++ b/src/random.c
@@ -31,10 +31,10 @@ static SQLITE_WSD struct sqlite3PrngType {
/* The RFC-7539 ChaCha20 block function
*/
#define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b))))
-#define QR(a, b, c, d) ( \
- a += b, d ^= a, d = ROTL(d,16), \
- c += d, b ^= c, b = ROTL(b,12), \
- a += b, d ^= a, d = ROTL(d, 8), \
+#define QR(a, b, c, d) ( \
+ a += b, d ^= a, d = ROTL(d,16), \
+ c += d, b ^= c, b = ROTL(b,12), \
+ a += b, d ^= a, d = ROTL(d, 8), \
c += d, b ^= c, b = ROTL(b, 7))
static void chacha_block(u32 *out, const u32 *in){
int i;
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 8bcd64322..c2bbc8ee3 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -2339,6 +2339,7 @@ struct sqlite3_mem_methods {
** <ul>
** <li> The [PRAGMA writable_schema=ON] statement.
** <li> The [PRAGMA journal_mode=OFF] statement.
+** <li> The [PRAGMA schema_version=N] statement.
** <li> Writes to the [sqlite_dbpage] virtual table.
** <li> Direct writes to [shadow tables].
** </ul>
diff --git a/src/test2.c b/src/test2.c
index 850e1e1a0..d5db3867b 100644
--- a/src/test2.c
+++ b/src/test2.c
@@ -521,6 +521,14 @@ static int SQLITE_TCLAPI fake_big_file(
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
+#if defined(_WIN32)
+ if( n>2 ){
+ Tcl_AppendResult(interp, "cannot create ", argv[1],
+ "MB file because Windows "
+ "does not support sparse files", (void*)0);
+ return TCL_ERROR;
+ }
+#endif
pVfs = sqlite3_vfs_find(0);
nFile = (int)strlen(argv[2]);