1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Bug fix: do not segfault if a SELECT without a FROM clause includes

the * wildcard in the result column list. (CVS 609)

FossilOrigin-Name: d939294994e5f6c7862b66573301e111e56a2681
This commit is contained in:
drh
2002-06-06 23:42:27 +00:00
parent d5c644c0b1
commit f5db2d3ea2
4 changed files with 27 additions and 13 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.91 2002/06/06 18:54:40 drh Exp $
** $Id: select.c,v 1.92 2002/06/06 23:42:28 drh Exp $
*/
#include "sqliteInt.h"
@ -728,9 +728,12 @@ static int fillInColumnList(Parse *pParse, Select *p){
}
}
if( !tableSeen ){
assert( pName!=0 );
sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1,
pName->z, pName->n, 0);
if( pName ){
sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1,
pName->z, pName->n, 0);
}else{
sqliteSetString(&pParse->zErrMsg, "no tables specified", 0);
}
rc = 1;
}
}