SQLite

Check-in [2df2cf4f17]
Login

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

Overview
Comment:Remove an unreachable branch from the index-on-expression optimization.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2df2cf4f179dd88fb2530dfd338f344ac48dd052ef954dc95a136884523f7aee
User & Date: drh 2018-09-16 18:23:48.660
Context
2018-09-17
12:49
Fix missing space in 'configure.ac' reported on the mailing list. (check-in: 96b00a3cd2 user: mistachkin tags: trunk)
2018-09-16
23:27
First proposed fix for the ALTER TABLE problem described by ticket [b41031ea2b5372378cb3d2d] (check-in: 05a9d12925 user: drh tags: tkt-b41031ea)
18:23
Remove an unreachable branch from the index-on-expression optimization. (check-in: 2df2cf4f17 user: drh tags: trunk)
16:34
Fix a memory leak in the explain extension. (check-in: d0c92b047a user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/update.c.
91
92
93
94
95
96
97

98
99
100
101
102
103
104
105
106
107
108
static int indexColumnIsBeingUpdated(
  Index *pIdx,      /* The index to check */
  int iCol,         /* Which column of the index to check */
  int *aXRef,       /* aXRef[j]>=0 if column j is being updated */
  int chngRowid     /* true if the rowid is being updated */
){
  i16 iIdxCol = pIdx->aiColumn[iCol];

  if( iIdxCol>=0 ){
    return aXRef[iIdxCol]>=0;
  }
  if( iIdxCol==XN_ROWID ) return 1;
  assert( iIdxCol==XN_EXPR );
  assert( pIdx->aColExpr!=0 );
  assert( pIdx->aColExpr->a[iCol].pExpr!=0 );
  return sqlite3ExprReferencesUpdatedColumn(pIdx->aColExpr->a[iCol].pExpr,
                                            aXRef,chngRowid);
}








>



<







91
92
93
94
95
96
97
98
99
100
101

102
103
104
105
106
107
108
static int indexColumnIsBeingUpdated(
  Index *pIdx,      /* The index to check */
  int iCol,         /* Which column of the index to check */
  int *aXRef,       /* aXRef[j]>=0 if column j is being updated */
  int chngRowid     /* true if the rowid is being updated */
){
  i16 iIdxCol = pIdx->aiColumn[iCol];
  assert( iIdxCol!=XN_ROWID ); /* Cannot index rowid */
  if( iIdxCol>=0 ){
    return aXRef[iIdxCol]>=0;
  }

  assert( iIdxCol==XN_EXPR );
  assert( pIdx->aColExpr!=0 );
  assert( pIdx->aColExpr->a[iCol].pExpr!=0 );
  return sqlite3ExprReferencesUpdatedColumn(pIdx->aColExpr->a[iCol].pExpr,
                                            aXRef,chngRowid);
}