diff options
author | drh <drh@noemail.net> | 2009-06-19 16:44:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-06-19 16:44:41 +0000 |
commit | 8bfd719065bfa66e5447cc290ab0d4a6cb936460 (patch) | |
tree | a643e0c356fc1bb4e9ae47bebfd946ea622939e0 /src/func.c | |
parent | 8bfdf72136a8cb1b8033bcd016da8b63e0fb2e22 (diff) | |
download | sqlite-8bfd719065bfa66e5447cc290ab0d4a6cb936460.tar.gz sqlite-8bfd719065bfa66e5447cc290ab0d4a6cb936460.zip |
Make sure group_concat() ignores initial NULL values. (CVS 6787)
FossilOrigin-Name: 90c3b23ccac8a9e7fc1cc831e43888e4e43badc9
Diffstat (limited to 'src/func.c')
-rw-r--r-- | src/func.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/func.c b/src/func.c index c48896d4e..6243536cb 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.238 2009/06/19 14:06:03 drh Exp $ +** $Id: func.c,v 1.239 2009/06/19 16:44:41 drh Exp $ */ #include "sqliteInt.h" #include <stdlib.h> @@ -1265,15 +1265,10 @@ static void groupConcatStep( if( pAccum ){ sqlite3 *db = sqlite3_context_db_handle(context); - int n; + int firstTerm = pAccum->useMalloc==0; pAccum->useMalloc = 1; pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH]; -#ifdef SQLITE_OMIT_DEPRECATED - n = context->pMem->n; -#else - n = sqlite3_aggregate_count(context); -#endif - if( n>1 ){ + if( !firstTerm ){ if( argc==2 ){ zSep = (char*)sqlite3_value_text(argv[1]); nSep = sqlite3_value_bytes(argv[1]); |