SQLite

Check-in [5a22d8695b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove the SYNC_BARRIER flag. (CVS 4337)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5a22d8695b49cf7bc2eee382b66a98d29adb9e6e
User & Date: danielk1977 2007-08-30 14:49:58.000
Context
2007-08-30
14:58
Fix a ref-count problem in the TCL bindings. Ticket #2597. (CVS 4338) (check-in: 18a5babb72 user: drh tags: trunk)
14:49
Remove the SYNC_BARRIER flag. (CVS 4337) (check-in: 5a22d8695b user: danielk1977 tags: trunk)
14:41
Fixes to malloc3.test so that it can run in transient or persistent failure mode. (CVS 4336) (check-in: e14e3688eb user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
static int unixSync(sqlite3_file *id, int flags){
  int rc;
  unixFile *pFile = (unixFile*)id;

  int isDataOnly = (flags&SQLITE_SYNC_DATAONLY);
  int isFullsync = (flags&0x0F)==SQLITE_SYNC_FULL;

  /* Check that one of SQLITE_SYNC_NORMAL, FULL or BARRIER was passed */
  assert((flags&0x0F)==SQLITE_SYNC_NORMAL
      || (flags&0x0F)==SQLITE_SYNC_FULL
      || (flags&0x0F)==SQLITE_SYNC_BARRIER
  );

  assert( pFile );
  OSTRACE2("SYNC    %-3d\n", pFile->h);
  rc = full_fsync(pFile->h, isFullsync, isDataOnly);
  SimulateIOError( rc=1 );
  if( rc ){







|


<







981
982
983
984
985
986
987
988
989
990

991
992
993
994
995
996
997
static int unixSync(sqlite3_file *id, int flags){
  int rc;
  unixFile *pFile = (unixFile*)id;

  int isDataOnly = (flags&SQLITE_SYNC_DATAONLY);
  int isFullsync = (flags&0x0F)==SQLITE_SYNC_FULL;

  /* Check that one of SQLITE_SYNC_NORMAL or FULL was passed */
  assert((flags&0x0F)==SQLITE_SYNC_NORMAL
      || (flags&0x0F)==SQLITE_SYNC_FULL

  );

  assert( pFile );
  OSTRACE2("SYNC    %-3d\n", pFile->h);
  rc = full_fsync(pFile->h, isFullsync, isDataOnly);
  SimulateIOError( rc=1 );
  if( rc ){
Changes to src/sqlite.h.in.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
**
** @(#) $Id: sqlite.h.in,v 1.248 2007/08/30 14:10:30 drh Exp $
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
#include <stdarg.h>     /* Needed for the definition of va_list */

/*
** Make sure we can call this stuff from C++.







|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
**
** @(#) $Id: sqlite.h.in,v 1.249 2007/08/30 14:49:58 danielk1977 Exp $
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
#include <stdarg.h>     /* Needed for the definition of va_list */

/*
** Make sure we can call this stuff from C++.
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
**
** When SQLite invokes the xSync() method of an [sqlite3_io_methods]
** object it uses a combination of the following integer values as
** the second argument.
**
** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
** sync operation only needs to flush data to mass storage.  Inode
** information need not be flushed.  The SQLITE_SYNC_BARRIER flag
** means that the nothing actually needs to be synched to mass storage,
** but all write operations that occur before the barrier must complete
** before any write operations that occur after the barrier begin.
** The SQLITE_SYNC_NORMAL means to use normal fsync() semantics.
** The SQLITE_SYNC_FULL flag means to use Mac OS-X style fullsync
** instead of fsync().
*/
#define SQLITE_SYNC_BARRIER       0x00001
#define SQLITE_SYNC_NORMAL        0x00002
#define SQLITE_SYNC_FULL          0x00003
#define SQLITE_SYNC_DATAONLY      0x00010


/*
** CAPI3REF: OS Interface Open File Handle







|
<
<
<
|
|
<

<







394
395
396
397
398
399
400
401



402
403

404

405
406
407
408
409
410
411
**
** When SQLite invokes the xSync() method of an [sqlite3_io_methods]
** object it uses a combination of the following integer values as
** the second argument.
**
** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
** sync operation only needs to flush data to mass storage.  Inode
** information need not be flushed.  The SQLITE_SYNC_NORMAL means 



** to use normal fsync() semantics.  The SQLITE_SYNC_FULL flag means 
** to use Mac OS-X style fullsync instead of fsync().

*/

#define SQLITE_SYNC_NORMAL        0x00002
#define SQLITE_SYNC_FULL          0x00003
#define SQLITE_SYNC_DATAONLY      0x00010


/*
** CAPI3REF: OS Interface Open File Handle
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444

445
446
447
448
449
450
451
/*
** CAPI3REF: OS Interface File Virtual Methods Object
**
** Every open file in the [sqlite3_vfs] xOpen method contains a pointer to
** an instance of the following object.  This object defines the
** methods used to perform various operations against the open file.
**
** The flags argument to xSync may be one of SQLITE_SYNC_BARRIER,
** SQLITE_SYNC_NORMAL, SQLITE_SYNC_FULL.  The first choice means that
** data is not necessarily synced to disk completely, only that
** all writes that occur before the sync complete before any
** writes that occur after the sync.  The second flag is the
** normal fsync().  The third flag is a OS-X style fullsync.
** The SQLITE_SYNC_DATA flag may be ORed in to indicate that only
** the data of the file and not its inode needs to be synced.

** 
** The integer values to xLock() and xUnlock() are one of
** SQLITE_LOCK_NONE, SQLITE_LOCK_READ, SQLITE_LOCK_RESERVED,
** SQLITE_LOCK_PENDING, or SQLITE_LOCK_EXCLUSIVE.  xLock()
** increases the lock. xUnlock() decreases the lock.  
** The xCheckReservedLock() method looks
** to see if any database connection, either in this







|
|
|
|
<
|
|
|
>







425
426
427
428
429
430
431
432
433
434
435

436
437
438
439
440
441
442
443
444
445
446
/*
** CAPI3REF: OS Interface File Virtual Methods Object
**
** Every open file in the [sqlite3_vfs] xOpen method contains a pointer to
** an instance of the following object.  This object defines the
** methods used to perform various operations against the open file.
**
** The flags argument to xSync may be one of SQLITE_SYNC_NORMAL or
** SQLITE_SYNC_FULL.  The first choice means that data is not
** necessarily synced to disk completely, only that all writes that
** occur before the sync complete before any writes that occur after the

** sync.  The second flag is the normal fsync().  The third flag is a
** OS-X style fullsync.  The SQLITE_SYNC_DATA flag may be ORed in to
** indicate that only the data of the file and not its inode needs to be
** synced.
** 
** The integer values to xLock() and xUnlock() are one of
** SQLITE_LOCK_NONE, SQLITE_LOCK_READ, SQLITE_LOCK_RESERVED,
** SQLITE_LOCK_PENDING, or SQLITE_LOCK_EXCLUSIVE.  xLock()
** increases the lock. xUnlock() decreases the lock.  
** The xCheckReservedLock() method looks
** to see if any database connection, either in this