SQLite4
Check-in [49e419f4e8]
Not logged in

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

Overview
Comment:Changes so that things work without SQLITE_ENABLE_LSM.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | primary-keys
Files: files | file ages | folders
SHA1: 49e419f4e897cfad4d4ccbb0d8f2f560f0359e4f
User & Date: dan 2012-04-20 20:38:02
Context
2012-04-20
20:41
Move development back to trunk. check-in: 76ca8d1bee user: drh tags: trunk
20:38
Changes so that things work without SQLITE_ENABLE_LSM. Closed-Leaf check-in: 49e419f4e8 user: dan tags: primary-keys
20:15
Fix the sqlite4RefillIndex() function. This removes the broken (and disabled) merge-sort code. check-in: 9ac54fff5f user: dan tags: primary-keys
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/global.c.

170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
   0,                         /* xLog */
   0,                         /* pLogArg */
   0,                         /* bLocaltimeFault */

#ifdef SQLITE_ENABLE_LSM
   sqlite4KVStoreOpenLsm,     /* xKVFile */
#else
   0,                         /* xKVFile */
#endif
   sqlite4KVStoreOpenMem,     /* xKVTmp */
};


/*
** Hash table for global functions - functions common to all







|







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
   0,                         /* xLog */
   0,                         /* pLogArg */
   0,                         /* bLocaltimeFault */

#ifdef SQLITE_ENABLE_LSM
   sqlite4KVStoreOpenLsm,     /* xKVFile */
#else
   sqlite4KVStoreOpenMem,     /* xKVFile */
#endif
   sqlite4KVStoreOpenMem,     /* xKVTmp */
};


/*
** Hash table for global functions - functions common to all

Changes to src/kvmem.c.

924
925
926
927
928
929
930
931




932
933
934
935
936
937
938
939
940

  kvmemRevert,
  kvmemClose
};

/*
** Create a new in-memory storage engine and return a pointer to it.
*/
int sqlite4KVStoreOpenMem(KVStore **ppKVStore, unsigned openFlags){




  KVMem *pNew = sqlite4_malloc( sizeof(*pNew) );
  if( pNew==0 ) return SQLITE_NOMEM;
  memset(pNew, 0, sizeof(*pNew));
  pNew->base.pStoreVfunc = &kvmemMethods;
  pNew->iMagicKVMemBase = SQLITE_KVMEMBASE_MAGIC;
  pNew->openFlags = openFlags;
  *ppKVStore = (KVStore*)pNew;
  return SQLITE_OK;
}








|
>
>
>
>









>
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
  kvmemRevert,
  kvmemClose
};

/*
** Create a new in-memory storage engine and return a pointer to it.
*/
int sqlite4KVStoreOpenMem(
  KVStore **ppKVStore, 
  const char *zName,
  unsigned openFlags
){
  KVMem *pNew = sqlite4_malloc( sizeof(*pNew) );
  if( pNew==0 ) return SQLITE_NOMEM;
  memset(pNew, 0, sizeof(*pNew));
  pNew->base.pStoreVfunc = &kvmemMethods;
  pNew->iMagicKVMemBase = SQLITE_KVMEMBASE_MAGIC;
  pNew->openFlags = openFlags;
  *ppKVStore = (KVStore*)pNew;
  return SQLITE_OK;
}

Changes to src/sqliteInt.h.

2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
  int isPCacheInit;                 /* True after malloc is initialized */
  sqlite4_mutex *pInitMutex;        /* Mutex used by sqlite4_initialize() */
  int nRefInitMutex;                /* Number of users of pInitMutex */
  void (*xLog)(void*,int,const char*); /* Function for logging */
  void *pLogArg;                       /* First argument to xLog() */
  int bLocaltimeFault;              /* True to fail localtime() calls */
  int (*xKVFile)(KVStore **, const char *, unsigned int);
  int (*xKVTmp)(KVStore **, unsigned int);
};

/*
** Context pointer passed down through the tree-walk.
*/
struct Walker {
  int (*xExprCallback)(Walker*, Expr*);     /* Callback for expressions */







|







2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
  int isPCacheInit;                 /* True after malloc is initialized */
  sqlite4_mutex *pInitMutex;        /* Mutex used by sqlite4_initialize() */
  int nRefInitMutex;                /* Number of users of pInitMutex */
  void (*xLog)(void*,int,const char*); /* Function for logging */
  void *pLogArg;                       /* First argument to xLog() */
  int bLocaltimeFault;              /* True to fail localtime() calls */
  int (*xKVFile)(KVStore **, const char *, unsigned int);
  int (*xKVTmp)(KVStore **, const char *, unsigned int);
};

/*
** Context pointer passed down through the tree-walk.
*/
struct Walker {
  int (*xExprCallback)(Walker*, Expr*);     /* Callback for expressions */

Changes to src/storage.c.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

  if( zUri && zUri[0] 
   && sqlite4GlobalConfig.xKVFile 
   && memcmp(":memory:", zUri, 8)
  ){
    rc = sqlite4GlobalConfig.xKVFile(&pNew, zUri, flags);
  }else{
    rc = sqlite4GlobalConfig.xKVTmp(&pNew, flags);
  }

  *ppKVStore = pNew;
  if( pNew ){
    sqlite4_randomness(sizeof(pNew->kvId), &pNew->kvId);
    sqlite4_snprintf(sizeof(pNew->zKVName), pNew->zKVName,
                     "%s", zName);







|







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

  if( zUri && zUri[0] 
   && sqlite4GlobalConfig.xKVFile 
   && memcmp(":memory:", zUri, 8)
  ){
    rc = sqlite4GlobalConfig.xKVFile(&pNew, zUri, flags);
  }else{
    rc = sqlite4GlobalConfig.xKVTmp(&pNew, zUri, flags);
  }

  *ppKVStore = pNew;
  if( pNew ){
    sqlite4_randomness(sizeof(pNew->kvId), &pNew->kvId);
    sqlite4_snprintf(sizeof(pNew->zKVName), pNew->zKVName,
                     "%s", zName);

Changes to src/storage.h.

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191

/*
** Valid flags for sqlite4KVStorageOpen()
*/
#define SQLITE_KVOPEN_TEMPORARY       0x0001  /* A temporary database */
#define SQLITE_KVOPEN_NO_TRANSACTIONS 0x0002  /* No transactions will be used */

int sqlite4KVStoreOpenMem(KVStore**, unsigned);
int sqlite4KVStoreOpen(
  sqlite4*,
  const char *zLabel, 
  const char *zUri,
  KVStore**,
  unsigned flags
);







|







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191

/*
** Valid flags for sqlite4KVStorageOpen()
*/
#define SQLITE_KVOPEN_TEMPORARY       0x0001  /* A temporary database */
#define SQLITE_KVOPEN_NO_TRANSACTIONS 0x0002  /* No transactions will be used */

int sqlite4KVStoreOpenMem(KVStore**, const char *, unsigned);
int sqlite4KVStoreOpen(
  sqlite4*,
  const char *zLabel, 
  const char *zUri,
  KVStore**,
  unsigned flags
);