SQLite

Check-in [ff49a5f00b]
Login

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

Overview
Comment:Tweaks to help facilitate structural test coverage.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-b351d95f9c
Files: files | file ages | folders
SHA1: ff49a5f00b3aa83bdacc95a32d60527c740a6c09
User & Date: drh 2010-09-28 06:00:48.000
Context
2010-09-28
07:11
Replace some unreachable branch instructions with assert() statements. (Closed-Leaf check-in: 88b84bf18a user: drh tags: bug-b351d95f9c)
06:00
Tweaks to help facilitate structural test coverage. (check-in: ff49a5f00b user: drh tags: bug-b351d95f9c)
04:14
Test case and fix for the specific failure of ticket [b351d95f9cd5ef17e9d9dbae]. (check-in: 57789cfe67 user: drh tags: bug-b351d95f9c)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/expr.c.
3048
3049
3050
3051
3052
3053
3054


3055
3056
3057
3058
3059
3060

3061
3062
3063
3064
3065
3066
3067
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060


3061
3062
3063
3064
3065
3066
3067
3068







+
+




-
-
+







  int target,        /* Where to write results */
  int doHardCopy     /* Make a hard copy of every element */
){
  struct ExprList_item *pItem;
  int i, n;
  assert( pList!=0 );
  assert( target>0 );
  assert( pParse->pVdbe || pParse->db->mallocFailed );
  if( pParse->pVdbe==0 ) return 0;
  n = pList->nExpr;
  for(pItem=pList->a, i=0; i<n; i++, pItem++){
    Expr *pExpr = pItem->pExpr;
    int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i);
    assert( pParse->pVdbe || pParse->db->mallocFailed );
    if( inReg!=target+i && pParse->pVdbe ){
    if( inReg!=target+i ){
      sqlite3VdbeAddOp2(pParse->pVdbe, doHardCopy ? OP_Copy : OP_SCopy,
                        inReg, target+i);
    }
  }
  return n;
}

Changes to src/vdbe.c.
1139
1140
1141
1142
1143
1144
1145


1146
1147
1148
1149
1150
1151
1152
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154







+
+







  ** and have an assigned type.  The results are de-ephemeralized as
  ** as side effect.
  */
  pMem = p->pResultSet = &aMem[pOp->p1];
  for(i=0; i<pOp->p2; i++){
    assert( memIsValid(&pMem[i]) );
    Deephemeralize(&pMem[i]);
    assert( (pMem[i].flags & MEM_Ephem)==0
            || (pMem[i].flags & (MEM_Str|MEM_Blob))==0 );
    sqlite3VdbeMemNulTerminate(&pMem[i]);
    sqlite3VdbeMemStoreType(&pMem[i]);
    REGISTER_TRACE(pOp->p1+i, &pMem[i]);
  }
  if( db->mallocFailed ) goto no_mem;

  /* Return SQLITE_ROW