SQLite

Check-in [77443ef2cd]
Login

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

Overview
Comment:Simulate OOM errors in the sqlite3OsFetch() function. Run malloc.test as part of the "mmap" permutation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | experimental-mmap
Files: files | file ages | folders
SHA1: 77443ef2cd0b29b7822eea544ab8c6c4a93cb67b
User & Date: dan 2013-03-25 18:25:49.003
Context
2013-03-25
19:05
Add a test that simulates an error in mmap(). (check-in: 6ec7367d8e user: dan tags: experimental-mmap)
18:25
Simulate OOM errors in the sqlite3OsFetch() function. Run malloc.test as part of the "mmap" permutation. (check-in: 77443ef2cd user: dan tags: experimental-mmap)
17:00
Change the signature of the xUnfetch method to "int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p)". (check-in: 115b830509 user: dan tags: experimental-mmap)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os.c.
138
139
140
141
142
143
144

145
146
147
148
149
150
151
  void volatile **pp              /* OUT: Pointer to mapping */
){
  DO_OS_MALLOC_TEST(id);
  return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
}

int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){

  return id->pMethods->xFetch(id, iOff, iAmt, pp);
}
int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
  return id->pMethods->xUnfetch(id, iOff, p);
}

/*







>







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
  void volatile **pp              /* OUT: Pointer to mapping */
){
  DO_OS_MALLOC_TEST(id);
  return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
}

int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
  DO_OS_MALLOC_TEST(id);
  return id->pMethods->xFetch(id, iOff, iAmt, pp);
}
int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
  return id->pMethods->xUnfetch(id, iOff, p);
}

/*
Changes to test/permutations.test.
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
]

test_suite "mmap" -prefix "mm-" -description {
  Similar to veryquick. Except with memory mapping enabled.
} -presql {
  pragma mmap_size = -65536;
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault*
]

test_suite "valgrind" -prefix "" -description {
  Run the "veryquick" test suite with a couple of multi-process tests (that
  fail under valgrind) omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* wal.test atof1.test







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
]

test_suite "mmap" -prefix "mm-" -description {
  Similar to veryquick. Except with memory mapping enabled.
} -presql {
  pragma mmap_size = -65536;
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test
]

test_suite "valgrind" -prefix "" -description {
  Run the "veryquick" test suite with a couple of multi-process tests (that
  fail under valgrind) omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* wal.test atof1.test
Changes to test/speed1p.test.
61
62
63
64
65
66
67

68
69
70
71
72
73
74
  return $txt
}

# Create a database schema.
#
do_test speed1p-1.0 {
  execsql {

    PRAGMA page_size=1024;
    PRAGMA cache_size=500;
    PRAGMA locking_mode=EXCLUSIVE;
    CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT);
    CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT);
    CREATE INDEX i2a ON t2(a);
    CREATE INDEX i2b ON t2(b);







>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  return $txt
}

# Create a database schema.
#
do_test speed1p-1.0 {
  execsql {
    PRAGMA mmap_size=1000000;
    PRAGMA page_size=1024;
    PRAGMA cache_size=500;
    PRAGMA locking_mode=EXCLUSIVE;
    CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT);
    CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT);
    CREATE INDEX i2a ON t2(a);
    CREATE INDEX i2b ON t2(b);