1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Make the pending byte adjustable via sqlite3_test_control() on all builds,

not just on test builds. (CVS 6263)

FossilOrigin-Name: e8f192e2a93350a136d86bd9caceff65f52f3513
This commit is contained in:
drh
2009-02-05 16:31:45 +00:00
parent f5d335f851
commit c7a3bb94c2
13 changed files with 105 additions and 47 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.527 2009/02/04 17:40:58 drh Exp $
** $Id: main.c,v 1.528 2009/02/05 16:31:46 drh Exp $
*/
#include "sqliteInt.h"
@@ -2150,6 +2150,25 @@ int sqlite3_test_control(int op, ...){
sqlite3BenignMallocHooks(xBenignBegin, xBenignEnd);
break;
}
/*
** sqlite3_test_control(PENDING_BYTE, unsigned int X)
**
** Set the PENDING byte to the value in the argument, if X>0.
** Make no changes if X==0. Return the value of the pending byte
** as it existing before this routine was called.
**
** IMPORTANT: Changing the PENDING byte from 0x40000000 results in
** an incompatible database file format. Changing the PENDING byte
** while any database connection is open results in undefined and
** dileterious behavior.
*/
case SQLITE_TESTCTRL_PENDING_BYTE: {
unsigned int newVal = va_arg(ap, unsigned int);
rc = sqlite3PendingByte;
if( newVal ) sqlite3PendingByte = newVal;
break;
}
}
va_end(ap);
#endif /* SQLITE_OMIT_BUILTIN_TEST */