SQLite

Check-in [1c72cecc6b]
Login

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

Overview
Comment:Add a test to verify that sqlite3_total_changes() works with incr-merge operations.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | fts4-incr-merge
Files: files | file ages | folders
SHA1: 1c72cecc6bf5be2a5c04ad6214a6bac22a29f860
User & Date: dan 2012-03-23 15:38:43.298
Context
2012-03-23
18:26
Fix a spurious SQLITE_CONSTRAINT error that may be returned by an incr-merge operation. (check-in: ed7c17ea16 user: dan tags: fts4-incr-merge)
15:38
Add a test to verify that sqlite3_total_changes() works with incr-merge operations. (check-in: 1c72cecc6b user: dan tags: fts4-incr-merge)
14:38
Remove an incorrect assert() statement. Fix a const-related warning. (check-in: 96ed47493b user: dan tags: fts4-incr-merge)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/fts4merge.test.
282
283
284
285
286
287
288








































289
290
  }

  execsql {
    INSERT INTO t1(t1) VALUES('merge=1,2');
    INSERT INTO t1(t1) VALUES('merge=1,2');
  }
} {}









































finish_test







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


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
  }

  execsql {
    INSERT INTO t1(t1) VALUES('merge=1,2');
    INSERT INTO t1(t1) VALUES('merge=1,2');
  }
} {}

#-------------------------------------------------------------------------
# Test cases 7.*
#
# Test that the value returned by sqlite3_total_changes() increases by
# 1 following a no-op "merge=A,B", or by more than 1 if actual work is
# performed.
#
do_test 7.0 {
  reset_db
  fts3_build_db_1 1000
} {}

do_execsql_test 7.1 {
  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level
} {
  0 {0 1 2 3 4 5 6 7} 
  1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 
  2 {0 1 2}
}
do_test 7.2 {
  set x [db total_changes]
  execsql { INSERT INTO t1(t1) VALUES('merge=2,10') }
  expr { ([db total_changes] - $x)>1 }
} {1}
do_test 7.3 {
  set x [db total_changes]
  execsql { INSERT INTO t1(t1) VALUES('merge=200,10') }
  expr { ([db total_changes] - $x)>1 }
} {1}
do_test 7.4 {
  set x [db total_changes]
  execsql { INSERT INTO t1(t1) VALUES('merge=200,10') }
  expr { ([db total_changes] - $x)>1 }
} {0}
do_test 7.5 {
  set x [db total_changes]
  execsql { INSERT INTO t1(t1) VALUES('merge=200,10') }
  expr { ([db total_changes] - $x)>1 }
} {0}

finish_test