1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix a segfault that can be caused by an INSTEAD OF trigger on a view that includes an expression of the form "table.column" in the select list. (CVS 5940)

FossilOrigin-Name: 88a09dbb4b54be4010aae767157a1e2002237909
This commit is contained in:
danielk1977
2008-11-21 16:22:18 +00:00
parent 956f4319be
commit f730075312
4 changed files with 23 additions and 10 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.487 2008/11/21 09:43:20 danielk1977 Exp $
** $Id: select.c,v 1.488 2008/11/21 16:22:18 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -1181,7 +1181,8 @@ static int selectColumnsFromExprList(
iCol>=0 ? pTab->aCol[iCol].zName : "rowid");
}else{
/* Use the original text of the column expression as its name */
zName = sqlite3MPrintf(db, "%T", &pCol->span);
Token *pToken = (pCol->span.z?&pCol->span:&pCol->token);
zName = sqlite3MPrintf(db, "%T", pToken);
}
}
if( db->mallocFailed ){