SQLite

Check-in [74ef6f2b]
Login

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

Overview
Comment:Omit the omit flag from eq constraints on column "aggregate" of dbstat virtual tables. Fix for [727074e2].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 74ef6f2b6d9f50ff1d455e2263ba77707c1e8394b25b3f8a3a2a7b6e7f2c481e
User & Date: dan 2020-01-04 14:00:56
Context
2020-01-04
14:50
Back out another NEVER added by check-in [7b62555e285f32d3] - the test case was already in test/fuzzdata3.db, but it only occurs if compiled without SQLITE_ENABLE_PREUPDATE_HOOK. (check-in: 61f873b1 user: drh tags: trunk)
14:00
Omit the omit flag from eq constraints on column "aggregate" of dbstat virtual tables. Fix for [727074e2]. (check-in: 74ef6f2b user: dan tags: trunk)
12:34
Restore a NEVER and an assert in btree that was removed by check-in [7b62555e285f32d3]. Dbsqlfuzz found test cases. (check-in: 04a05c83 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/dbstat.c.

243
244
245
246
247
248
249

250
251
252
253
254
255
256
257
  if( iName>=0 ){
    pIdxInfo->aConstraintUsage[iName].argvIndex = ++i;
    pIdxInfo->aConstraintUsage[iName].omit = 1;
    pIdxInfo->idxNum |= 0x02;
  }
  if( iAgg>=0 ){
    pIdxInfo->aConstraintUsage[iAgg].argvIndex = ++i;

    pIdxInfo->aConstraintUsage[iAgg].omit = 1;
    pIdxInfo->idxNum |= 0x04;
  }
  pIdxInfo->estimatedCost = 1.0;

  /* Records are always returned in ascending order of (name, path). 
  ** If this will satisfy the client, set the orderByConsumed flag so that 
  ** SQLite does not do an external sort.







>
|







243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
  if( iName>=0 ){
    pIdxInfo->aConstraintUsage[iName].argvIndex = ++i;
    pIdxInfo->aConstraintUsage[iName].omit = 1;
    pIdxInfo->idxNum |= 0x02;
  }
  if( iAgg>=0 ){
    pIdxInfo->aConstraintUsage[iAgg].argvIndex = ++i;
    /* As of ticket [727074e2], this constraint is not omitted. */
    /* pIdxInfo->aConstraintUsage[iAgg].omit = 1; */
    pIdxInfo->idxNum |= 0x04;
  }
  pIdxInfo->estimatedCost = 1.0;

  /* Records are always returned in ascending order of (name, path). 
  ** If this will satisfy the client, set the orderByConsumed flag so that 
  ** SQLite does not do an external sort.

Changes to test/stat.test.

293
294
295
296
297
298
299










300
301
  sqlite_master / 1 leaf 1 37 875 37 0 1024 
  x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_catchsql_test 7.2.4 {
  CREATE VIRTUAL TABLE x3 USING dbstat(123corp);
  SELECT * FROM x3;
} {1 {unrecognized token: "123corp"}}











finish_test







>
>
>
>
>
>
>
>
>
>


293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
  sqlite_master / 1 leaf 1 37 875 37 0 1024 
  x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_catchsql_test 7.2.4 {
  CREATE VIRTUAL TABLE x3 USING dbstat(123corp);
  SELECT * FROM x3;
} {1 {unrecognized token: "123corp"}}

do_execsql_test 8.1 {
  CREATE VIRTUAL TABLE st4 USING dbstat;
}
do_execsql_test 8.2 {
  SELECT * FROM st4 WHERE st4.aggregate = NULL
}
do_execsql_test 8.3 {
  SELECT aggregate=1 FROM st4 WHERE aggregate = 5
}

finish_test