/ Check-in [1fbd7438]
Login

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

Overview
Comment:Merge the row-value fix from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | generated-columns
Files: files | file ages | folders
SHA3-256: 1fbd7438611174aa594485241c8cc2f4ea6d09c57ef2fc16c8995e8061fdfdd6
User & Date: drh 2019-10-22 20:16:04
Context
2019-10-22
21:01
Take the declared column time into account when computing the values for generated columns, and apply appropriate affinity. check-in: 9e04ba22 user: drh tags: generated-columns
20:16
Merge the row-value fix from trunk. check-in: 1fbd7438 user: drh tags: generated-columns
19:51
Disqualify row-value comparisons for use by an index if the right-hand side has an affinity that does not match the index. Fix for ticket [6ef984af8972c2eb] check-in: 5c118617 user: drh tags: trunk
15:45
Do not allow generated columns in the PRIMARY KEY. check-in: 1a54743a user: drh tags: generated-columns
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

66
67
68
69
70
71
72



73
74
75
76
77
78
79
  }
  if( op==TK_SELECT_COLUMN ){
    assert( pExpr->pLeft->flags&EP_xIsSelect );
    return sqlite3ExprAffinity(
        pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr
    );
  }



  return pExpr->affExpr;
}

/*
** Set the collating sequence for expression pExpr to be the collating
** sequence named by pToken.   Return a pointer to a new Expr node that
** implements the COLLATE operator.







>
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  }
  if( op==TK_SELECT_COLUMN ){
    assert( pExpr->pLeft->flags&EP_xIsSelect );
    return sqlite3ExprAffinity(
        pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr
    );
  }
  if( op==TK_VECTOR ){
    return sqlite3ExprAffinity(pExpr->x.pList->a[0].pExpr);
  }
  return pExpr->affExpr;
}

/*
** Set the collating sequence for expression pExpr to be the collating
** sequence named by pToken.   Return a pointer to a new Expr node that
** implements the COLLATE operator.

Changes to test/rowvalue.test.

581
582
583
584
585
586
587
588









589
  SELECT 3 FROM t0 WHERE (aa,1) <= (+bb,1);
} {0 1 3}
do_execsql_test 23.110 {
  SELECT (SELECT +bb,1) >= (aa, 1), (aa,1)<=(SELECT +bb,1) FROM t0;
  SELECT 2 FROM t0 WHERE (SELECT +bb,1) >= (aa,1);
  SELECT 3 FROM t0 WHERE (aa,1) <= (SELECT +bb,1);
} {0 1 3}










finish_test








>
>
>
>
>
>
>
>
>

581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
  SELECT 3 FROM t0 WHERE (aa,1) <= (+bb,1);
} {0 1 3}
do_execsql_test 23.110 {
  SELECT (SELECT +bb,1) >= (aa, 1), (aa,1)<=(SELECT +bb,1) FROM t0;
  SELECT 2 FROM t0 WHERE (SELECT +bb,1) >= (aa,1);
  SELECT 3 FROM t0 WHERE (aa,1) <= (SELECT +bb,1);
} {0 1 3}

# 2019-10-22 Ticket 6ef984af8972c2eb
do_execsql_test 24.100 {
  DROP TABLE t0;
  CREATE TABLE t0(c0 TEXT PRIMARY KEY);
  INSERT INTO t0(c0) VALUES ('');
  SELECT (t0.c0, TRUE) > (CAST(0 AS REAL), FALSE) FROM t0;
  SELECT 2 FROM t0 WHERE (t0.c0, TRUE) > (CAST('' AS REAL), FALSE);
} {1 2}

finish_test