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

Fix for tickets #3378 and #3381 that preserves the aliasing optimization.

And yet, this fix feels uncomfortable.  Seeking an alternative... (CVS 5712)

FossilOrigin-Name: f8b759f1977915c314be874840ebf18e6bc69b57
This commit is contained in:
drh
2008-09-17 00:13:12 +00:00
parent f44ed02790
commit d176611b44
5 changed files with 90 additions and 72 deletions

View File

@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.393 2008/09/16 18:02:47 drh Exp $
** $Id: expr.c,v 1.394 2008/09/17 00:13:12 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2456,7 +2456,7 @@ int sqlite3ExprCodeExprList(
Parse *pParse, /* Parsing context */
ExprList *pList, /* The expression list to be coded */
int target, /* Where to write results */
int doHardCopy /* Call sqlite3ExprHardCopy on each element if true */
int doHardCopy /* Make a hard copy of every element */
){
struct ExprList_item *pItem;
int i, n;
@@ -2464,17 +2464,16 @@ int sqlite3ExprCodeExprList(
assert( target>0 );
n = pList->nExpr;
for(pItem=pList->a, i=0; i<n; i++, pItem++){
#if 0 /* Remove temporarily for tickets #3378 and #3381 */
if( pItem->iAlias ){
int iReg = codeAlias(pParse, pItem->iAlias, pItem->pExpr);
Vdbe *v = sqlite3GetVdbe(pParse);
sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target+i);
}else
#endif
{
}else{
sqlite3ExprCode(pParse, pItem->pExpr, target+i);
}
if( doHardCopy ) sqlite3ExprHardCopy(pParse, target, n);
if( doHardCopy ){
sqlite3ExprHardCopy(pParse, target, n);
}
}
return n;
}