/ Check-in [46069393]
Login

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

Overview
Comment:Extra tests for the ota_rowid column.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: 46069393b3141ab198f0fcc4f6c05229f06bf1e8
User & Date: dan 2014-12-08 07:22:34
Context
2014-12-08
07:28
Update comments in sqlite3ota.h to remove the "must have PRIMARY KEY" restriction. check-in: 088a41eb user: dan tags: ota-update
07:22
Extra tests for the ota_rowid column. check-in: 46069393 user: dan tags: ota-update
2014-12-06
19:30
Allow the ota extension to write to tables with no PRIMARY KEY declaration. check-in: ba59a7e2 user: dan tags: ota-update
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/ota/ota1.test.

358
359
360
361
362
363
364
365















































366
367
      2 5 10 5
      3 11 9 10
    }
  
    do_execsql_test 5.$tn2.$tn.3 { PRAGMA integrity_check } ok
  }
}
















































finish_test









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


358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
      2 5 10 5
      3 11 9 10
    }
  
    do_execsql_test 5.$tn2.$tn.3 { PRAGMA integrity_check } ok
  }
}

#-------------------------------------------------------------------------
# Test some error cases:
# 
#   * A virtual table with no ota_rowid column.
#   * A no-PK table with no ota_rowid column.
#   * A PK table with an ota_rowid column.
#
ifcapable fts3 {
  foreach {tn schema error} {
     1 {
       CREATE TABLE t1(a, b);
       CREATE TABLE ota.data_t1(a, b, ota_control);
     } {SQLITE_ERROR - table data_t1 requires ota_rowid column}
  
     2 {
       CREATE VIRTUAL TABLE t1 USING fts4(a, b);
       CREATE TABLE ota.data_t1(a, b, ota_control);
     } {SQLITE_ERROR - table data_t1 requires ota_rowid column}
  
     3 {
       CREATE TABLE t1(a PRIMARY KEY, b);
       CREATE TABLE ota.data_t1(a, b, ota_rowid, ota_control);
     } {SQLITE_ERROR - table data_t1 may not have ota_rowid column}
  
     4 {
       CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
       CREATE TABLE ota.data_t1(a, b, ota_rowid, ota_control);
     } {SQLITE_ERROR - table data_t1 may not have ota_rowid column}
  
     5 {
       CREATE TABLE t1(a, b PRIMARY KEY) WITHOUT ROWID;
       CREATE TABLE ota.data_t1(a, b, ota_rowid, ota_control);
     } {SQLITE_ERROR - table data_t1 may not have ota_rowid column}
  
  } {
    reset_db
    forcedelete ota.db
    execsql { ATTACH 'ota.db' AS ota }
    execsql $schema

    do_test 6.$tn {
      list [catch { run_ota test.db ota.db } msg] $msg
    } [list 1 $error]
  }
}


finish_test