-C Reorganize\sand\scleanup\sthe\sprepared\sstatement\sobject.\s\sRemove\scode\sthat\shas\nbeen\scommented\sout\sfor\sages\sand\sis\sno\slonger\srelevant\sto\sanything.\s(CVS\s6786)
-D 2009-06-19T14:06:03
+C Make\ssure\sgroup_concat()\signores\sinitial\sNULL\svalues.\s(CVS\s6787)
+D 2009-06-19T16:44:41
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 8b8fb7823264331210cddf103831816c286ba446
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/delete.c cb791855c7948cecc96def9d97989879ca26f257
F src/expr.c 1d580a7b2e51092785cbbc1fb8d2ff84e93c76dc
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
-F src/func.c d108b0028050ecd0fd9508268995892937d577ae
+F src/func.c 9856373f5315f6b8690d7f07f7191aa9f279ca87
F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
F src/hash.c ebcaa921ffd9d86f7ea5ae16a0a29d1c871130a7
F src/hash.h 35b216c13343d0b4f87d9f21969ac55ad72174e1
F test/fts3expr.test 9764961c3f4ac818dacda01ed35d8bfcef42338b
F test/fts3expr2.test 18da930352e5693eaa163a3eacf96233b7290d1a
F test/fts3near.test dc196dd17b4606f440c580d45b3d23aa975fd077
-F test/func.test d4a8590511cdc68a136afd00bd989c2584454932
+F test/func.test 004caa157b91986bed8c85d7c7d0a86d6e10528d
F test/fuzz.test a4174c3009a3e2c2e14b31b364ebf7ddb49de2c9
F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb
F test/fuzz3.test aec64345184d1662bd30e6a17851ff659d596dc5
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 7d8f178c8145b90da31f6557f7cd99d154eb676e
-R b3e036533bac5a29d77c23602f39da64
+P 37ae5f5e8feb34a8e6e8b34aa18df1e9a1ce55cb
+R bbe11c7b362a2c517acbc2d78fa4631d
U drh
-Z f2670ca2615f8f31d0717b2c5d58ef64
+Z 1470050dd5090450f94c26db6cf0c170
-37ae5f5e8feb34a8e6e8b34aa18df1e9a1ce55cb
\ No newline at end of file
+90c3b23ccac8a9e7fc1cc831e43888e4e43badc9
\ No newline at end of file
** 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>
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]);
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
-# $Id: func.test,v 1.92 2009/04/15 15:16:53 drh Exp $
+# $Id: func.test,v 1.93 2009/06/19 16:44:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
}
# Ticket #3806. If the initial string in a group_concat is an empty
-# string, the separate that follows should still be present.
+# string, the separator that follows should still be present.
#
do_test func-24.8 {
execsql {
}
} {,,,,software}
+# Ticket #3923. Initial empty strings have a separator. But initial
+# NULLs do not.
+#
+do_test func-24.10 {
+ execsql {
+ SELECT group_concat(CASE t1 WHEN 'this' THEN null ELSE t1 END) FROM tbl1
+ }
+} {program,is,free,software}
+do_test func-24.11 {
+ execsql {
+ SELECT group_concat(CASE WHEN t1!='software' THEN null ELSE t1 END) FROM tbl1
+ }
+} {software}
+do_test func-24.12 {
+ execsql {
+ SELECT group_concat(CASE t1 WHEN 'this' THEN ''
+ WHEN 'program' THEN null ELSE t1 END) FROM tbl1
+ }
+} {,is,free,software}
+
+
# Use the test_isolation function to make sure that type conversions
# on function arguments do not effect subsequent arguments.
#