1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change the name of the sanity_check PRAGMA to "integrity_check" and make

it available on all compiles. (CVS 381)

FossilOrigin-Name: c6e9048e66c8d8e2d5f6c62aa724eef3e9d9f572
This commit is contained in:
drh
2002-02-19 13:39:21 +00:00
parent a80a1e6ae4
commit aaab5725db
20 changed files with 90 additions and 90 deletions

View File

@@ -30,7 +30,7 @@
** But other routines are also provided to help in building up
** a program instruction by instruction.
**
** $Id: vdbe.c,v 1.117 2002/02/03 19:06:03 drh Exp $
** $Id: vdbe.c,v 1.118 2002/02/19 13:39:23 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -868,7 +868,7 @@ static char *zOpName[] = { 0,
"IsUnique", "NotExists", "Delete", "Column",
"KeyAsData", "Recno", "FullKey", "Rewind",
"Next", "Destroy", "Clear", "CreateIndex",
"CreateTable", "SanityCheck", "IdxPut", "IdxDelete",
"CreateTable", "IntegrityCk", "IdxPut", "IdxDelete",
"IdxRecno", "IdxGT", "IdxGE", "MemLoad",
"MemStore", "ListWrite", "ListRewind", "ListRead",
"ListReset", "SortPut", "SortMakeRec", "SortMakeKey",
@@ -3481,7 +3481,7 @@ case OP_CreateTable: {
break;
}
/* Opcode: SanityCheck P1 * *
/* Opcode: IntegrityCk P1 * *
**
** Do an analysis of the currently open database. Push onto the
** stack the text of an error message describing any problems.
@@ -3492,8 +3492,7 @@ case OP_CreateTable: {
**
** This opcode is used for testing purposes only.
*/
case OP_SanityCheck: {
#ifndef NDEBUG /* This opcode used for testing only */
case OP_IntegrityCk: {
int nRoot;
int *aRoot;
int tos = ++p->tos;
@@ -3503,8 +3502,8 @@ case OP_SanityCheck: {
HashElem *i;
char *z;
if( iSet<0 || iSet>=p->nSet ) goto bad_instruction;
if( NeedStack(p, p->tos) ) goto no_mem;
VERIFY( if( iSet<0 || iSet>=p->nSet ) goto bad_instruction; )
VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
pSet = &p->aSet[iSet];
nRoot = sqliteHashCount(&pSet->hash);
aRoot = sqliteMalloc( sizeof(int)*(nRoot+1) );
@@ -3512,7 +3511,7 @@ case OP_SanityCheck: {
aRoot[j] = atoi((char*)sqliteHashKey(i));
}
aRoot[j] = 0;
z = sqliteBtreeSanityCheck(pBt, aRoot, nRoot);
z = sqliteBtreeIntegrityCheck(pBt, aRoot, nRoot);
if( z==0 || z[0]==0 ){
zStack[tos] = "ok";
aStack[tos].n = 3;
@@ -3524,7 +3523,6 @@ case OP_SanityCheck: {
aStack[tos].flags = STK_Str | STK_Dyn;
}
sqliteFree(aRoot);
#endif /* !define(NDEBUG) */
break;
}