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

Fix for #2445. A bug in the lookupName() logic that could cause a crash when a WHERE clause used an alias to refer to an expression in the result-set of the SELECT, and that expression was itself a reference to a table column. (CVS 4122)

FossilOrigin-Name: 044ca1c72a8f4632dc2e6a94690d164d3560ee38
This commit is contained in:
danielk1977
2007-06-25 16:29:33 +00:00
parent 576d3db541
commit c9cf6e3d31
5 changed files with 27 additions and 12 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.137 2007/03/29 05:51:49 drh Exp $
** $Id: update.c,v 1.138 2007/06/25 16:29:34 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -59,6 +59,7 @@ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
sqlite3_value *pValue;
u8 enc = ENC(sqlite3VdbeDb(v));
Column *pCol = &pTab->aCol[i];
assert( i<pTab->nCol );
sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue);
if( pValue ){
sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM);