/ Check-in [f804336f08]
Login

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

Overview
Comment:Fix some test script errors. And an incorrect assert() in fts5.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | alter-table-rename-column
Files: files | file ages | folders
SHA3-256: f804336f083d8d26314bb1ba34cec427675065a67cbe2bf00bb42e40752aeb33
User & Date: dan 2018-09-05 17:45:17
Context
2018-09-05
17:52
Merge latest trunk changes into this branch. check-in: 6f4f707f9c user: dan tags: alter-table-rename-column
17:45
Fix some test script errors. And an incorrect assert() in fts5. check-in: f804336f08 user: dan tags: alter-table-rename-column
14:36
Avoid comparing pointer values after the object that they point to has been deleted. check-in: 2ec7e50cbc user: dan tags: alter-table-rename-column
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_main.c.

   276    276         assert( p->ts.eState==1 || p->ts.eState==2 || p->ts.eState==0 );
   277    277         p->ts.eState = 0;
   278    278         break;
   279    279   
   280    280       case FTS5_SAVEPOINT:
   281    281         assert( p->ts.eState==1 );
   282    282         assert( iSavepoint>=0 );
   283         -      assert( iSavepoint>p->ts.iSavepoint );
          283  +      assert( iSavepoint>=p->ts.iSavepoint );
   284    284         p->ts.iSavepoint = iSavepoint;
   285    285         break;
   286    286         
   287    287       case FTS5_RELEASE:
   288    288         assert( p->ts.eState==1 );
   289    289         assert( iSavepoint>=0 );
   290    290         assert( iSavepoint<=p->ts.iSavepoint );

Changes to test/altertab.test.

   301    301   do_execsql_test 9.6 {
   302    302     SELECT sql FROM sqlite_temp_master;
   303    303     SELECT sql FROM sqlite_master WHERE type='trigger';
   304    304   } {
   305    305     {CREATE TRIGGER tr AFTER INSERT ON aux.t1 BEGIN SELECT 1, 2, 3; END}
   306    306     {CREATE TRIGGER tr AFTER INSERT ON "t3" BEGIN SELECT 1, 2, 3; END}
   307    307   }
          308  +
          309  +#-------------------------------------------------------------------------
          310  +reset_db
          311  +ifcapable fts5 {
          312  +  do_execsql_test 10.0 {
          313  +    CREATE VIRTUAL TABLE fff USING fts5(x, y, z);
          314  +  }
          315  +
          316  +  do_execsql_test 10.1 {
          317  +    BEGIN;
          318  +      INSERT INTO fff VALUES('a', 'b', 'c');
          319  +      ALTER TABLE fff RENAME TO ggg;
          320  +    COMMIT;
          321  +  }
          322  +
          323  +  do_execsql_test 10.2 {
          324  +    SELECT * FROM ggg;
          325  +  } {a b c}
          326  +}
   308    327   
   309    328   finish_test
   310    329   
   311    330   

Changes to test/fkey2.test.

   979    979       }
   980    980     } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
   981    981     
   982    982     
   983    983     # Test the sqlite_rename_parent() function directly.
   984    984     #
   985    985     proc test_rename_parent {zCreate zOld zNew} {
   986         -    db eval {SELECT sqlite_rename_table('main', $zCreate, $zOld, $zNew, 0)}
          986  +    db eval {SELECT sqlite_rename_table(
          987  +        'main', 'table', 't1', $zCreate, $zOld, $zNew, 0
          988  +    )}
   987    989     }
   988    990     do_test fkey2-14.2.1.1 {
   989    991       test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t2 t3
   990    992     } {{CREATE TABLE t1(a REFERENCES "t3")}}
   991    993     do_test fkey2-14.2.1.2 {
   992    994       test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t4 t3
   993    995     } {{CREATE TABLE t1(a REFERENCES t2)}}

Changes to test/without_rowid3.test.

   945    945       }
   946    946     } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
   947    947     
   948    948     
   949    949     # Test the sqlite_rename_parent() function directly.
   950    950     #
   951    951     proc test_rename_parent {zCreate zOld zNew} {
   952         -    db eval {SELECT sqlite_rename_table('main', $zCreate, $zOld, $zNew, 0)}
          952  +    db eval {SELECT sqlite_rename_table(
          953  +        'main', 'table', 't1', $zCreate, $zOld, $zNew, 0
          954  +    )}
   953    955     }
   954    956     do_test without_rowid3-14.2.1.1 {
   955    957       test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t2 t3
   956    958     } {{CREATE TABLE t1(a REFERENCES "t3")}}
   957    959     do_test without_rowid3-14.2.1.2 {
   958    960       test_rename_parent {CREATE TABLE t1(a REFERENCES t2)} t4 t3
   959    961     } {{CREATE TABLE t1(a REFERENCES t2)}}