aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-02-09 13:19:28 +0000
committerdrh <drh@noemail.net>2009-02-09 13:19:28 +0000
commit0daa002c7c2936a29aecea8672fbd61251e09636 (patch)
tree8e825df3f8747acb617c9544d802f324ea783bfe /src
parent09480a9dc206161e15dba034db01bfbd97025e19 (diff)
downloadsqlite-0daa002c7c2936a29aecea8672fbd61251e09636.tar.gz
sqlite-0daa002c7c2936a29aecea8672fbd61251e09636.zip
Better error message when DISTINCT is used on an aggregate function that
takes two or more arguments. Ticket #3641. (CVS 6269) FossilOrigin-Name: e20bf384668bcde7c2f2152ca88e28cf65a02679
Diffstat (limited to 'src')
-rw-r--r--src/select.c6
-rw-r--r--src/vdbe.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/select.c b/src/select.c
index 432e55083..943f0ef4e 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.498 2009/01/09 02:49:32 drh Exp $
+** $Id: select.c,v 1.499 2009/02/09 13:19:28 drh Exp $
*/
#include "sqliteInt.h"
@@ -3365,8 +3365,8 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){
if( pFunc->iDistinct>=0 ){
Expr *pE = pFunc->pExpr;
if( pE->pList==0 || pE->pList->nExpr!=1 ){
- sqlite3ErrorMsg(pParse, "DISTINCT in aggregate must be followed "
- "by an expression");
+ sqlite3ErrorMsg(pParse, "DISTINCT aggregates must have exactly one "
+ "argument");
pFunc->iDistinct = -1;
}else{
KeyInfo *pKeyInfo = keyInfoFromExprList(pParse, pE->pList);
diff --git a/src/vdbe.c b/src/vdbe.c
index 1028e8163..715fcdffa 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.814 2009/02/04 03:59:25 shane Exp $
+** $Id: vdbe.c,v 1.815 2009/02/09 13:19:28 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -482,6 +482,9 @@ static void registerTrace(FILE *out, int iReg, Mem *p){
if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
#ifdef SQLITE_DEBUG
+# define fileExists(A,B) 0
+#endif
+#if 0
static int fileExists(sqlite3 *db, const char *zFile){
int res = 0;
int rc = SQLITE_OK;