1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Add asserts to detect if a transaction commits without first incrementing

the transaction counter.  These asserts are intended to prevent future
problems similar to ticket #3584. (CVS 6179)

FossilOrigin-Name: b676ccfd9019e65b52251332d94de1b3018ec823
This commit is contained in:
drh
2009-01-14 23:03:40 +00:00
parent d162988b47
commit 8f941bc7a1
6 changed files with 116 additions and 18 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.823 2009/01/10 16:15:22 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.824 2009/01/14 23:03:41 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -200,16 +200,22 @@
** where multiple cases go to the same block of code, testcase()
** can insure that all cases are evaluated.
**
** The TESTONLY macro is used to enclose variable declarations or
** other bits of code that are needed to support the arguments
** within testcase() macros.
*/
#ifdef SQLITE_COVERAGE_TEST
void sqlite3Coverage(int);
# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); }
# define TESTONLY(X) X
#else
# define testcase(X)
#endif
/*
** The TESTONLY macro is used to enclose variable declarations or
** other bits of code that are needed to support the arguments
** within testcase() and assert() macros.
*/
#if !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST)
# define TESTONLY(X) X
#else
# define TESTONLY(X)
#endif