SQLite

Check-in [c25dd2dec5]
Login

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

Overview
Comment:Run tests with SQLITE_TESTCTRL_SCHEMACOPY for mdevtest and sdevtest on this branch.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | schema-copy
Files: files | file ages | folders
SHA3-256: c25dd2dec58f92c4c6686ed374facc64a6847232b47ecc95bc602babeb08f4e8
User & Date: dan 2025-01-09 20:41:18.825
Context
2025-01-10
11:34
Update test script wal2big2.test to be less sensitive to PRNG output. (check-in: 2a5e7c5cd6 user: dan tags: schema-copy)
2025-01-09
20:41
Run tests with SQLITE_TESTCTRL_SCHEMACOPY for mdevtest and sdevtest on this branch. (check-in: c25dd2dec5 user: dan tags: schema-copy)
19:18
Rationalize and add comments to new code on this branch. (check-in: e1603c9cda user: dan tags: schema-copy)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/fts5/fts5_index.c.
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
      i64 nEntry = 0;
      i64 nTomb = 0;
      int iSeg;
      for(iSeg=0; iSeg<pLvl->nSeg; iSeg++){
        nEntry += pLvl->aSeg[iSeg].nEntry;
        nTomb += pLvl->aSeg[iSeg].nEntryTombstone;
      }
      assert_nc( nEntry>0 || pLvl->nSeg==0 );
      if( nEntry>0 ){
        int nPercent = (nTomb * 100) / nEntry;
        if( nPercent>=pConfig->nDeleteMerge && nPercent>nBest ){
          iRet = ii;
          nBest = nPercent;
        }
      }







<







4877
4878
4879
4880
4881
4882
4883

4884
4885
4886
4887
4888
4889
4890
      i64 nEntry = 0;
      i64 nTomb = 0;
      int iSeg;
      for(iSeg=0; iSeg<pLvl->nSeg; iSeg++){
        nEntry += pLvl->aSeg[iSeg].nEntry;
        nTomb += pLvl->aSeg[iSeg].nEntryTombstone;
      }

      if( nEntry>0 ){
        int nPercent = (nTomb * 100) / nEntry;
        if( nPercent>=pConfig->nDeleteMerge && nPercent>nBest ){
          iRet = ii;
          nBest = nPercent;
        }
      }
Changes to src/build.c.
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
    }

    pNew->pTrigger = schemaCopyTriggerList(db, pNew, pNew->pTrigger);
  }

  if( db->mallocFailed==0 ){
    if( sqlite3HashInsert(&pTo->tblHash, pNew->zName, pNew) ){
      db->mallocFailed = 1;
    }
#ifndef SQLITE_OMIT_AUTOINCREMENT
    if( pTab->pSchema->pSeqTab==pTab ){
      pTo->pSeqTab = pNew;
    }
#endif
  }







|







6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
    }

    pNew->pTrigger = schemaCopyTriggerList(db, pNew, pNew->pTrigger);
  }

  if( db->mallocFailed==0 ){
    if( sqlite3HashInsert(&pTo->tblHash, pNew->zName, pNew) ){
      sqlite3OomFault(db);
    }
#ifndef SQLITE_OMIT_AUTOINCREMENT
    if( pTab->pSchema->pSeqTab==pTab ){
      pTo->pSeqTab = pNew;
    }
#endif
  }
Changes to test/permutations.test.
192
193
194
195
196
197
198











199
200
201
202
203
204
205
  "Very" quick test suite. Runs in minutes on a workstation.
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err* \
      *fts5corrupt* *fts5big* *fts5aj* *rbucrash*
]












test_suite "shell" -prefix "" -description {
  Run tests of the command-line shell
} -files [
  test_set [glob $testdir/shell*.test]
]








>
>
>
>
>
>
>
>
>
>
>







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
  "Very" quick test suite. Runs in minutes on a workstation.
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err* \
      *fts5corrupt* *fts5big* *fts5aj* *rbucrash*
]

test_suite "schemacopytest" -prefix "schemacopytest-" -description {
  "Very" quick test suite. Runs in minutes on a workstation.
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err* \
      *fts5corrupt* *fts5big* *fts5aj* *rbucrash*
] -initialize {
  sqlite3_test_control SQLITE_TESTCTRL_SCHEMACOPY 1
}

test_suite "shell" -prefix "" -description {
  Run tests of the command-line shell
} -files [
  test_set [glob $testdir/shell*.test]
]

Changes to test/tester.tcl.
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# 64KB into the database file instead of the one 1GB in. This means
# the code that handles that special case can be tested without creating
# very large database files.
#
set tcl_precision 15
sqlite3_test_control_pending_byte 0x0010000

sqlite3_test_control SQLITE_TESTCTRL_SCHEMACOPY 1

# If the pager codec is available, create a wrapper for the [sqlite3]
# command that appends "-key {xyzzy}" to the command line. i.e. this:
#
#     sqlite3 db test.db
#
# becomes
#







<
<







97
98
99
100
101
102
103


104
105
106
107
108
109
110
# 64KB into the database file instead of the one 1GB in. This means
# the code that handles that special case can be tested without creating
# very large database files.
#
set tcl_precision 15
sqlite3_test_control_pending_byte 0x0010000



# If the pager codec is available, create a wrapper for the [sqlite3]
# command that appends "-key {xyzzy}" to the command line. i.e. this:
#
#     sqlite3 db test.db
#
# becomes
#
Changes to test/testrunner.tcl.
1126
1127
1128
1129
1130
1131
1132

1133
1134
1135
1136
1137
1138
1139
#
proc add_devtest_jobs {lBld patternlist} {
  global TRG

  foreach b $lBld {
    set bld [add_build_job $b $TRG(testfixture)]
    add_tcl_jobs $bld veryquick $patternlist SHELL

    if {$patternlist==""} {
      add_fuzztest_jobs $b
    }

    if {[trdb one "SELECT EXISTS (SELECT 1 FROM jobs WHERE depid='SHELL')"]} {
      set sbld [add_shell_build_job $b [lindex $bld 1] [lindex $bld 0]]
      set sbldid [lindex $sbld 0]







>







1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
#
proc add_devtest_jobs {lBld patternlist} {
  global TRG

  foreach b $lBld {
    set bld [add_build_job $b $TRG(testfixture)]
    add_tcl_jobs $bld veryquick $patternlist SHELL
    add_tcl_jobs $bld schemacopytest $patternlist
    if {$patternlist==""} {
      add_fuzztest_jobs $b
    }

    if {[trdb one "SELECT EXISTS (SELECT 1 FROM jobs WHERE depid='SHELL')"]} {
      set sbld [add_shell_build_job $b [lindex $bld 1] [lindex $bld 0]]
      set sbldid [lindex $sbld 0]