/ Check-in [e8f105c3]
Login

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

Overview
Comment:Simplified logic to extract a column from a row value.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rowvalue
Files: files | file ages | folders
SHA1: e8f105c3009e9b667db2afc0088b020a2b94d370
User & Date: drh 2016-09-05 22:50:48
Context
2016-09-06
12:04
Fix a typo in a comment in expr.c. check-in: 288e934f user: dan tags: rowvalue
2016-09-05
22:50
Simplified logic to extract a column from a row value. check-in: e8f105c3 user: drh tags: rowvalue
19:57
Fix an assert() so that it does C-compiler does not combine an assert() conditional with a production code conditional and thereby confuse the mutation testing script. check-in: 2fa5288a user: drh tags: rowvalue
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
** just the expression for the i-th term of the result set, and may
** not be ready for evaluation because the table cursor has not yet
** been positioned.
*/
Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){
  assert( i<sqlite3ExprVectorSize(pVector) );
  if( sqlite3ExprIsVector(pVector) ){
    if( pVector->op==TK_SELECT
     || (pVector->op==TK_REGISTER && pVector->op2==TK_SELECT)
    ){
      return pVector->x.pSelect->pEList->a[i].pExpr;
    }else{
      return pVector->x.pList->a[i].pExpr;
    }
  }
  return pVector;
}







|
|
<







367
368
369
370
371
372
373
374
375

376
377
378
379
380
381
382
** just the expression for the i-th term of the result set, and may
** not be ready for evaluation because the table cursor has not yet
** been positioned.
*/
Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){
  assert( i<sqlite3ExprVectorSize(pVector) );
  if( sqlite3ExprIsVector(pVector) ){
    assert( pVector->op2==0 || pVector->op==TK_REGISTER );
    if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){

      return pVector->x.pSelect->pEList->a[i].pExpr;
    }else{
      return pVector->x.pList->a[i].pExpr;
    }
  }
  return pVector;
}