SQLite

Check-in [a508059305]
Login

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

Overview
Comment:Fix a bug in test script fts5fault4.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | fts5
Files: files | file ages | folders
SHA1: a508059305641c2cb53197b0f6e93d7b723697e2
User & Date: dan 2015-05-18 18:24:41.367
Context
2015-05-18
20:34
Improve test coverage of fts5_storage.c. (check-in: 4dfe2e5871 user: dan tags: fts5)
18:24
Fix a bug in test script fts5fault4.test. (check-in: a508059305 user: dan tags: fts5)
18:03
Add a test for an untested branch in fts5_expr.c. (check-in: ce08206b5c user: dan tags: fts5)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/fts5/test/fts5fault4.test.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

# If SQLITE_ENABLE_FTS3 is defined, omit this file.
ifcapable !fts5 {
  finish_test
  return
}

if 1 {

#-------------------------------------------------------------------------
# An OOM while dropping an fts5 table.
#
db func rnddoc fts5_rnddoc 
do_test 1.0 {
  execsql { CREATE VIRTUAL TABLE xx USING fts5(x) }
} {}







<
<







18
19
20
21
22
23
24


25
26
27
28
29
30
31

# If SQLITE_ENABLE_FTS3 is defined, omit this file.
ifcapable !fts5 {
  finish_test
  return
}



#-------------------------------------------------------------------------
# An OOM while dropping an fts5 table.
#
db func rnddoc fts5_rnddoc 
do_test 1.0 {
  execsql { CREATE VIRTUAL TABLE xx USING fts5(x) }
} {}
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

do_faultsim_test 9.1 -faults oom-* -body {
  db eval { SELECT rowid FROM tt WHERE tt MATCH 'a NOT x' }
} -test {
  faultsim_test_result {0 {50 100 150 200}} {1 SQLITE_NOMEM}
}

}

#-------------------------------------------------------------------------
# OOM in fts5_expr() SQL function.
#
do_faultsim_test 10.1 -faults oom-t* -body {
  db one { SELECT fts5_expr('a AND b NEAR(a b)') }
} -test {
  faultsim_test_result {0 {"a" AND ("b" AND NEAR("a" "b", 10))}} 







<
<







296
297
298
299
300
301
302


303
304
305
306
307
308
309

do_faultsim_test 9.1 -faults oom-* -body {
  db eval { SELECT rowid FROM tt WHERE tt MATCH 'a NOT x' }
} -test {
  faultsim_test_result {0 {50 100 150 200}} {1 SQLITE_NOMEM}
}



#-------------------------------------------------------------------------
# OOM in fts5_expr() SQL function.
#
do_faultsim_test 10.1 -faults oom-t* -body {
  db one { SELECT fts5_expr('a AND b NEAR(a b)') }
} -test {
  faultsim_test_result {0 {"a" AND ("b" AND NEAR("a" "b", 10))}} 
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
#-------------------------------------------------------------------------
# OOM while configuring 'rank' option.
#
reset_db
do_execsql_test 11.0 {
  CREATE VIRTUAL TABLE ft USING fts5(x);
}
do_faultsim_test 11.1 -faults oom-* -body {
  db eval { 
    INSERT INTO ft(ft, rank) VALUES('rank', 'bm25(10.0, 5.0)');
  }
} -test {
  faultsim_test_result {0 {}}
}

finish_test








|
<
|
<

|




325
326
327
328
329
330
331
332

333

334
335
336
337
338
339
#-------------------------------------------------------------------------
# OOM while configuring 'rank' option.
#
reset_db
do_execsql_test 11.0 {
  CREATE VIRTUAL TABLE ft USING fts5(x);
}
do_faultsim_test 11.1 -faults oom-t* -body {

  db eval { INSERT INTO ft(ft, rank) VALUES('rank', 'bm25(10.0, 5.0)') }

} -test {
  faultsim_test_result {0 {}} {1 {disk I/O error}}
}

finish_test