diff options
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index ee15c7216..f64645a8c 100644 --- a/src/select.c +++ b/src/select.c @@ -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.244 2005/04/22 02:38:38 drh Exp $ +** $Id: select.c,v 1.245 2005/04/29 02:10:00 drh Exp $ */ #include "sqliteInt.h" @@ -689,6 +689,20 @@ static const char *columnType(NameContext *pNC, Expr *pExpr){ pNC = pNC->pNext; } } + if( pTab==0 ){ + /* FIX ME: + ** This can occurs if you have something like "SELECT new.x;" inside + ** a trigger. In other words, if you reference the special "new" + ** table in the result set of a select. We do not have a good way + ** to find the actual table type, so call it "TEXT". This is really + ** something of a bug, but I do not know how to fix it. + ** + ** This code does not produce the correct answer - it just prevents + ** a segfault. See ticket #1229. + */ + zType = "TEXT"; + break; + } assert( pTab ); if( iCol<0 ) iCol = pTab->iPKey; assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); |