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

@ -1,5 +1,5 @@
C Fix\sfor\sticket\s#59:\sAdd\sdocumentation\sfor\sthe\s||\soperator.\s\sAlso\sadded\ndocumentation\sfor\sthe\snew\sSQL92\sjoin\ssyntax.\s(CVS\s608) C Bug\sfix:\sdo\snot\ssegfault\sif\sa\sSELECT\swithout\sa\sFROM\sclause\sincludes\nthe\s*\swildcard\sin\sthe\sresult\scolumn\slist.\s(CVS\s609)
D 2002-06-06T23:30:59 D 2002-06-06T23:42:28
F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c
F Makefile.template 4e11752e0b5c7a043ca50af4296ec562857ba495 F Makefile.template 4e11752e0b5c7a043ca50af4296ec562857ba495
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@ -37,7 +37,7 @@ F src/pager.h 6fddfddd3b73aa8abc081b973886320e3c614f0e
F src/parse.y 3b4989cb81ab2f441ef6c7cbb203829838eb299e F src/parse.y 3b4989cb81ab2f441ef6c7cbb203829838eb299e
F src/printf.c d8032ee18b860c812eeff596c9bebfdacb7930fd F src/printf.c d8032ee18b860c812eeff596c9bebfdacb7930fd
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
F src/select.c 0293ec0190d9a991725579a5e9c3af2fb6c1b592 F src/select.c 1d5cb1ae0bb3376bedfde7ae22e6e927e4d0b5e2
F src/shell.c 1d22fe870ee852cfb975fd000dbe3973713d0a15 F src/shell.c 1d22fe870ee852cfb975fd000dbe3973713d0a15
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in 0038faa6d642de06b91143ee65a131bd831d020b F src/sqlite.h.in 0038faa6d642de06b91143ee65a131bd831d020b
@ -77,7 +77,7 @@ F test/lock.test 3fcfd46a73119f6a18094673328a32c7b3047a8f
F test/main.test c66b564554b770ee7fdbf6a66c0cd90329bc2c85 F test/main.test c66b564554b770ee7fdbf6a66c0cd90329bc2c85
F test/malloc.test 7ba32a9ebd3aeed52ae4aaa6d42ca37e444536fd F test/malloc.test 7ba32a9ebd3aeed52ae4aaa6d42ca37e444536fd
F test/minmax.test 29bc5727c3e4c792d5c4745833dd4b505905819e F test/minmax.test 29bc5727c3e4c792d5c4745833dd4b505905819e
F test/misc1.test df281e9b26cd1db5808939c7cf2703072d555be0 F test/misc1.test 87490d33b36022610d1e56d1bd5c5b1edfebe753
F test/misuse.test a3aa2b18a97e4c409a1fcaff5151a4dd804a0162 F test/misuse.test a3aa2b18a97e4c409a1fcaff5151a4dd804a0162
F test/notnull.test b1f3e42fc475b0b5827b27b2e9b562081995ff30 F test/notnull.test b1f3e42fc475b0b5827b27b2e9b562081995ff30
F test/null.test 5c2b57307e4b6178aae825eb65ddbee01e76b0fd F test/null.test 5c2b57307e4b6178aae825eb65ddbee01e76b0fd
@ -136,7 +136,7 @@ F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f
F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P 9ef795d1d756a404d2123ebc19df1985b19c9888 P a0abef62bfe1b0f8c6249ba520dd2735190783a5
R 9e3230f38c2b70333bfdfd540e33cb8b R 5d70f1605b7b9ff2e858e45ab5b5947d
U drh U drh
Z 3a7eccbffd2310063ce5e8c10d603c5d Z 6eb753fe6a2122abae187660dd07b07e

View File

@ -1 +1 @@
a0abef62bfe1b0f8c6249ba520dd2735190783a5 d939294994e5f6c7862b66573301e111e56a2681

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite. ** 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" #include "sqliteInt.h"
@ -728,9 +728,12 @@ static int fillInColumnList(Parse *pParse, Select *p){
} }
} }
if( !tableSeen ){ if( !tableSeen ){
assert( pName!=0 ); if( pName ){
sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1, sqliteSetNString(&pParse->zErrMsg, "no such table: ", -1,
pName->z, pName->n, 0); pName->z, pName->n, 0);
}else{
sqliteSetString(&pParse->zErrMsg, "no tables specified", 0);
}
rc = 1; rc = 1;
} }
} }

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were # This file implements tests for miscellanous features that were
# left out of other test files. # left out of other test files.
# #
# $Id: misc1.test,v 1.6 2002/05/24 02:14:50 drh Exp $ # $Id: misc1.test,v 1.7 2002/06/06 23:42:28 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -227,5 +227,16 @@ do_test misc1-7.6 {
} }
} {0 2 4 1 2 3} } {0 2 4 1 2 3}
do_test misc1-8.1 {
catchsql {
SELECT *;
}
} {1 {no tables specified}}
do_test misc1-8.2 {
catchsql {
SELECT t1.*;
}
} {1 {no such table: t1}}
finish_test finish_test