1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Fixes for UPDATE statements on virtual tables. (CVS 3263)

FossilOrigin-Name: 81c5a5b48b05186a1690198092ac92006d9f7020
This commit is contained in:
danielk1977
2006-06-17 03:27:21 +00:00
parent 9c41938ff8
commit 2867fef244
5 changed files with 22 additions and 30 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
** $Id: update.c,v 1.127 2006/06/16 21:13:22 drh Exp $
** $Id: update.c,v 1.128 2006/06/17 03:27:22 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -571,7 +571,7 @@ static void updateVirtualTable(
*/
pEList = sqlite3ExprListAppend(0, sqlite3CreateIdExpr("_rowid_"), 0);
if( pRowid ){
pEList = sqlite3ExprListAppend(pEList, pRowid, 0);
pEList = sqlite3ExprListAppend(pEList, sqlite3ExprDup(pRowid), 0);
}
for(i=0; i<pTab->nCol; i++){
if( i==pTab->iPKey ){
@@ -606,7 +606,7 @@ static void updateVirtualTable(
if( pRowid ){
sqlite3VdbeAddOp(v, OP_Column, ephemTab, 1);
}else{
sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
}
for(i=0; i<pTab->nCol; i++){
sqlite3VdbeAddOp(v, OP_Column, ephemTab, i+1+(pRowid!=0));