aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-10-16 20:53:57 +0000
committerdrh <drh@noemail.net>2015-10-16 20:53:57 +0000
commit0030aaad673e399e75ac6f1a0d38d9f189458949 (patch)
tree0077a4ea57c46d58c6d8f04cb720fe2ce7cc41d8 /src/expr.c
parent99f4647ef50b1fe95697c48a753847efd4780fd1 (diff)
parentf170ea44d4f26fef41a9f57ae4886f4208cd52bc (diff)
downloadsqlite-0030aaad673e399e75ac6f1a0d38d9f189458949.tar.gz
sqlite-0030aaad673e399e75ac6f1a0d38d9f189458949.zip
Merge recent enhancements from trunk. Version now 3.9.1.
FossilOrigin-Name: 26fa091d68e89a0b6af61ba706d23a9f37e8025a
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c
index 7d80c361e..88d002641 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -2497,9 +2497,12 @@ void sqlite3ExprCodeGetColumnOfTable(
/*
** Generate code that will extract the iColumn-th column from
-** table pTab and store the column value in a register. An effort
-** is made to store the column value in register iReg, but this is
-** not guaranteed. The location of the column value is returned.
+** table pTab and store the column value in a register.
+**
+** An effort is made to store the column value in register iReg. This
+** is not garanteeed for GetColumn() - the result can be stored in
+** any register. But the result is guaranteed to land in register iReg
+** for GetColumnToReg().
**
** There must be an open cursor to pTab in iTable when this routine
** is called. If iColumn<0 then code is generated that extracts the rowid.
@@ -2510,7 +2513,7 @@ int sqlite3ExprCodeGetColumn(
int iColumn, /* Index of the table column */
int iTable, /* The cursor pointing to the table */
int iReg, /* Store results here */
- u8 p5 /* P5 value for OP_Column */
+ u8 p5 /* P5 value for OP_Column + FLAGS */
){
Vdbe *v = pParse->pVdbe;
int i;
@@ -2532,6 +2535,17 @@ int sqlite3ExprCodeGetColumn(
}
return iReg;
}
+void sqlite3ExprCodeGetColumnToReg(
+ Parse *pParse, /* Parsing and code generating context */
+ Table *pTab, /* Description of the table we are reading from */
+ int iColumn, /* Index of the table column */
+ int iTable, /* The cursor pointing to the table */
+ int iReg /* Store results here */
+){
+ int r1 = sqlite3ExprCodeGetColumn(pParse, pTab, iColumn, iTable, iReg, 0);
+ if( r1!=iReg ) sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, r1, iReg);
+}
+
/*
** Clear all column cache entries.