/ Check-in [e1aa48ac]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:New test cases for automatic indices. New testcase() macros associated with column-used bitmasks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e1aa48ace7e43c3805278120b8228ee597e2cee7
User & Date: drh 2010-04-08 15:01:45
Context
2010-04-08
16:30
Additional automatic index tests. check-in: 99d8e325 user: drh tags: trunk
15:01
New test cases for automatic indices. New testcase() macros associated with column-used bitmasks. check-in: e1aa48ac user: drh tags: trunk
15:01
Fix the computation of the number of rows in a table during automatic index generation. check-in: edeab06a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

411
412
413
414
415
416
417


418
419
420
421
422
423
424
    struct SrcList_item *pItem = &pSrc->a[iSrc];
    p->pTab = pItem->pTab;
    p->iTable = pItem->iCursor;
    if( p->pTab->iPKey==iCol ){
      p->iColumn = -1;
    }else{
      p->iColumn = (ynVar)iCol;


      pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
    }
    ExprSetProperty(p, EP_Resolved);
  }
  return p;
}








>
>







411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
    struct SrcList_item *pItem = &pSrc->a[iSrc];
    p->pTab = pItem->pTab;
    p->iTable = pItem->iCursor;
    if( p->pTab->iPKey==iCol ){
      p->iColumn = -1;
    }else{
      p->iColumn = (ynVar)iCol;
      testcase( iCol==BMS );
      testcase( iCol==BMS-1 );
      pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
    }
    ExprSetProperty(p, EP_Resolved);
  }
  return p;
}

Changes to test/autoindex1.test.

85
86
87
88
89
90
91

92












93
  db status step
} {7}
do_test autoindex1-212 {
  db status autoindex
} {7}
















finish_test







>
|
>
>
>
>
>
>
>
>
>
>
>
>

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
  db status step
} {7}
do_test autoindex1-212 {
  db status autoindex
} {7}


# Modify the second table of the join while the join is in progress
#
do_test autoindex1-300 {
  set r {}
  db eval {SELECT b, d FROM t1 JOIN t2 ON (c=a)} {
    lappend r $b $d
    db eval {UPDATE t2 SET d=d+1}
  }
  set r
} {11 911 22 922 33 933 44 944 55 955 66 966 77 977 88 988}
do_test autoindex1-310 {
  db eval {SELECT d FROM t2 ORDER BY d}
} {919 930 941 952 963 974 985 996}

finish_test