/ Check-in [b4eafde8]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Add tests for fts3 to backcompat.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b4eafde823bf30ebbb9232a88c9ddfa52f3cbabf
User & Date: dan 2010-12-03 15:04:26
Context
2010-12-03
15:41
Version 3.7.4 release candidate 1 check-in: 2e800cb8 user: drh tags: trunk
15:04
Add tests for fts3 to backcompat.test. check-in: b4eafde8 user: dan tags: trunk
10:32
Add the "valgrind" permutation. This is the same as veryquick.test except that it omits the multi-process tests that do not work under valgrind. No changes to production or existing test code. check-in: 49531300 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/backcompat.test.

266
267
268
269
270
271
272
273


































































































274
      SELECT * FROM t1;
    } } {I 1 II 2 III 3}
    do_test backcompat-2.1.4 { sql1 {
      SELECT * FROM t1;
    } } {I 1 II 2 III 3}
  }
}



































































































finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
      SELECT * FROM t1;
    } } {I 1 II 2 III 3}
    do_test backcompat-2.1.4 { sql1 {
      SELECT * FROM t1;
    } } {I 1 II 2 III 3}
  }
}

#-------------------------------------------------------------------------
# Test that FTS3 tables may be read/written by different versions of 
# SQLite. 
#
set contents {
  CREATE VIRTUAL TABLE t1 USING fts3(a, b);
}
foreach {num doc} {
  one "jk zm jk eczkjblu urvysbnykk sk gnl jk ttvgf hmjf"
  two "jk bnhc jjrxpjkb mjpavjuhw fibokdry igju jk zm zm xh"
  three "wxe ogttbykvt uhzq xr iaf zf urvysbnykk aayxpmve oacaxgjoo mjpavjuhw"
  four "gazrt jk ephknonq myjp uenvbm wuvajhwqz jk zm xnxhf nvfasfh"
  five "zm aayxpmve csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm"
  six "sokcyf zm ogyavjvv jk zm fibokdry zm jk igju igju"
  seven "vgsld bvgimjik xuprtlyle jk akmikrqyt jk aayxpmve hkfoudzftq ddjj"
  eight "zm uhzq ovkyevlgv zk uenvbm csjqxhgj jk vgsld pgybs jk"
  nine  "zm agmckuiu zexh fibokdry jk uhzq bu tugflixoex xnxhf sk"
} {
  append contents "INSERT INTO t1 VALUES('$num', '$doc');"
}
do_allbackcompat_test {
  if {[code1 {set ::sqlite_options(fts3)}]
   && [code2 {set ::sqlite_options(fts3)}]
  } {

    do_test backcompat-3.1 { sql1 $contents } {}

    foreach {n q} {
      1    "SELECT * FROM t1 ORDER BY a, b"
      2    "SELECT rowid FROM t1 WHERE a MATCH 'five'"
      3    "SELECT * FROM t1 WHERE a MATCH 'five'"
      4    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'"
      5    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'"
    } {
      do_test backcompat-3.2 [list sql1 $q] [sql2 $q]
    }

    do_test backcompat-3.3 { sql1 {
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
      INSERT INTO t1 SELECT * FROM t1;
    } } {}

    foreach {n q} {
      1    "SELECT * FROM t1 ORDER BY a, b"
      2    "SELECT rowid FROM t1 WHERE a MATCH 'five'"
      3    "SELECT * FROM t1 WHERE a MATCH 'five'"
      4    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'"
      5    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'"
    } {
      do_test backcompat-3.4 [list sql1 $q] [sql2 $q]
    }

    set alphabet "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4"
    for {set i 0} {$i < 900} {incr i} {
      set term "[lindex $alphabet [expr $i/30]][lindex $alphabet [expr $i%30]] "
      sql1 "INSERT INTO t1 VALUES($i, '[string repeat $term 14]')"
    }

    foreach {n q} {
      1    "SELECT * FROM t1 ORDER BY a, b"
      2    "SELECT rowid FROM t1 WHERE a MATCH 'five'"
      3    "SELECT * FROM t1 WHERE a MATCH 'five'"
      4    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'"
      5    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'"

      6    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'aa'"
      7    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH '44'"
      8    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'a*'"
    } {
      do_test backcompat-3.5 [list sql1 $q] [sql2 $q]
    }

    do_test backcompat-3.6 { 
      sql1 "SELECT optimize(t1) FROM t1 LIMIT 1" 
    } {{Index optimized}}

    foreach {n q} {
      1    "SELECT * FROM t1 ORDER BY a, b"
      2    "SELECT rowid FROM t1 WHERE a MATCH 'five'"
      3    "SELECT * FROM t1 WHERE a MATCH 'five'"
      4    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'"
      5    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'"

      6    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'aa'"
      7    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH '44'"
      8    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'a*'"
    } {
      do_test backcompat-3.7 [list sql1 $q] [sql2 $q]
    }
  }
}

finish_test