From: drh Date: Mon, 18 May 2009 16:14:25 +0000 (+0000) Subject: Port patches from the trunk into the 3.6.14.1 branch: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c69ff738ab4cd05184d3f96738780a93413f42b5;p=thirdparty%2Fsqlite.git Port patches from the trunk into the 3.6.14.1 branch: the group_concat() fix of check-in (6616), ticket #3841 and the pcache fix of check-in (6619), ticket #3844. (CVS 6652) FossilOrigin-Name: 2a277c55b2f90d53208147423b409bc05e12ebd0 --- diff --git a/manifest b/manifest index c70be5d11e..4fcf0019b6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sversion\snumber\sfor\sthe\s3.6.14.1\sbranch.\s(CVS\s6651) -D 2009-05-18T16:12:08 +C Port\spatches\sfrom\sthe\strunk\sinto\sthe\s3.6.14.1\sbranch:\nthe\sgroup_concat()\sfix\sof\scheck-in\s(6616),\sticket\s#3841\sand\sthe\npcache\sfix\sof\scheck-in\s(6619),\sticket\s#3844.\s(CVS\s6652) +D 2009-05-18T16:14:25 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -151,7 +151,7 @@ F src/pager.h 73f481a308a873ccd626d97331c081db3b53e2e5 F src/parse.y a0e8b8e5d646a6352098fccc9d3325b4234a05b9 F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324 -F src/pcache1.c 35f8601c91c09a1e887a1914ebca07bb5afc7b89 +F src/pcache1.c b08287d2cd208de6d40a6139afb69f3117a35cea F src/pragma.c c26c16c49a80d03c8597f0e6c7daba53f283428f F src/prepare.c 72d74e6d3b9c8eb0663b33ec6438aa718096ac79 F src/printf.c 3f4dca207a88258d37af5a7a03e800a825fe6456 @@ -203,7 +203,7 @@ F src/update.c deb930324dd67b7ad98234e1258a0ebcdd1ca0f9 F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff F src/util.c 71c2d9d6befc0405377744585461246c30a4474b F src/vacuum.c e8d178004377e97500c7ea87c8a3542976e3ea45 -F src/vdbe.c 3cecc2bb87192a0a425623bd530d67cc1b368ce5 +F src/vdbe.c 09e2a26881dad8c3503e6743f549f698e5e7550d F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a F src/vdbeInt.h 43183a2a18654fa570219ab65e53a608057c48ae F src/vdbeapi.c 86aa27a5f3493aaffb8ac051782aa3b22670d7ed @@ -494,7 +494,7 @@ F test/pager2.test d4b7f6b70ff018b9995e622a32526b275f515042 F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4 F test/pageropt.test 3ee6578891baaca967f0bd349e4abfa736229e1a F test/pagesize.test 0d9ff3fedfce6e5ffe8fa7aca9b6d3433a2e843b -F test/pcache.test 70ad1d65cf73f6a0a7501e0236312eb214d93a55 +F test/pcache.test af48f31b75d55b6867dd1fcfb44af361385f53ca F test/pcache2.test 46efd980a89f737847b99327bda19e08fe11e402 F test/permutations.test 386b8e6b8e8e6aec41f6ed59a37353e412bfb00a F test/pragma.test a35b0be36542477183168cdb8b743f5c0d883c4d @@ -612,7 +612,7 @@ F test/tkt2832.test a9b0b74a02dca166a04d9e37739c414b10929caa F test/tkt2854.test b81dc3144901b123fe5674471adf5a47ca48a7c3 F test/tkt2920.test a8737380e4ae6424e00c0273dc12775704efbebf F test/tkt2927.test 4752868b9eeeb07a217f7f19f4cbaac98d6d086d -F test/tkt2942.test c5c87d179799ca6d1fbe83c815510b87cd5ec7ce +F test/tkt2942.test 70855de32e666b5393b65d9ec923c739245181e9 F test/tkt3080.test 1bca7579260920a66b4dd7e196e807c0f25ff804 F test/tkt3093.test fbdbc5b4969244ad11f540759003e361fcaf391f F test/tkt3121.test 536df66a02838c26a12fe98639354ca1290ca68b @@ -728,7 +728,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 469ad1ded35f5ff8ab2f6e8f776d73a9cea73527 -R 3067df14170f73d9e1fcbeadac5f4256 +P f06cae3b5e42e5a2c1a30cd91a7c594e6cd834d0 +R 1c1e6ac7cf542b0855883429017df0a3 U drh -Z 1b9f28348b5974a4a630f8e8705c7fe3 +Z cfce3ac25aea286dd8f950d6ba5467e3 diff --git a/manifest.uuid b/manifest.uuid index 193d47e1bb..795796300c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f06cae3b5e42e5a2c1a30cd91a7c594e6cd834d0 \ No newline at end of file +2a277c55b2f90d53208147423b409bc05e12ebd0 \ No newline at end of file diff --git a/src/pcache1.c b/src/pcache1.c index c77aa23190..7f5e9a8d1c 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -16,7 +16,7 @@ ** If the default page cache implementation is overriden, then neither of ** these two features are available. ** -** @(#) $Id: pcache1.c,v 1.11 2009/04/14 18:44:39 aswift Exp $ +** @(#) $Id: pcache1.c,v 1.11.2.1 2009/05/18 16:14:25 drh Exp $ */ #include "sqliteInt.h" @@ -360,6 +360,7 @@ static void pcache1TruncateUnsafe( PCache1 *pCache, unsigned int iLimit ){ + TESTONLY( int nPage = 0; ) /* Used to assert pCache->nPage is correct */ unsigned int h; assert( sqlite3_mutex_held(pcache1.mutex) ); for(h=0; hnHash; h++){ @@ -367,14 +368,17 @@ static void pcache1TruncateUnsafe( PgHdr1 *pPage; while( (pPage = *pp)!=0 ){ if( pPage->iKey>=iLimit ){ - pcache1PinPage(pPage); + pCache->nPage--; *pp = pPage->pNext; + pcache1PinPage(pPage); pcache1FreePage(pPage); }else{ pp = &pPage->pNext; + TESTONLY( nPage++ ); } } } + assert( pCache->nPage==nPage ); } /******************************************************************************/ diff --git a/src/vdbe.c b/src/vdbe.c index 56667f58c9..0afd45eafb 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.842 2009/05/06 18:57:10 shane Exp $ +** $Id: vdbe.c,v 1.842.2.1 2009/05/18 16:14:25 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -676,6 +676,7 @@ int sqlite3VdbeExec( pOut = &p->aMem[pOp->p2]; sqlite3VdbeMemReleaseExternal(pOut); pOut->flags = MEM_Null; + pOut->n = 0; }else /* Do common setup for opcodes marked with one of the following diff --git a/test/pcache.test b/test/pcache.test index 56e10fdea8..0ea4102a5a 100644 --- a/test/pcache.test +++ b/test/pcache.test @@ -11,7 +11,7 @@ # # This file is focused on testing the pcache module. # -# $Id: pcache.test,v 1.4 2009/03/05 14:59:40 danielk1977 Exp $ +# $Id: pcache.test,v 1.4.2.1 2009/05/18 16:14:26 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -145,4 +145,25 @@ do_test pcache-1.13 { pcache_stats } {current 15 max 15 min 10 recyclable 15} +do_test pcache-1.14 { + hexio_write test.db 24 [hexio_render_int32 1000] + execsql { SELECT * FROM sqlite_master } + pcache_stats +} {current 2 max 15 min 10 recyclable 2} + +do_test pcache-1.15 { + execsql { + SELECT * FROM t1 ORDER BY a; SELECT * FROM t1; + SELECT * FROM t2 ORDER BY a; SELECT * FROM t2; + SELECT * FROM t3 ORDER BY a; SELECT * FROM t3; + SELECT * FROM t4 ORDER BY a; SELECT * FROM t4; + SELECT * FROM t5 ORDER BY a; SELECT * FROM t5; + SELECT * FROM t6 ORDER BY a; SELECT * FROM t6; + SELECT * FROM t7 ORDER BY a; SELECT * FROM t7; + SELECT * FROM t8 ORDER BY a; SELECT * FROM t8; + SELECT * FROM t9 ORDER BY a; SELECT * FROM t9; + } + pcache_stats +} {current 14 max 15 min 10 recyclable 14} + finish_test diff --git a/test/tkt2942.test b/test/tkt2942.test index a7b861c75c..66fc24814e 100644 --- a/test/tkt2942.test +++ b/test/tkt2942.test @@ -21,7 +21,7 @@ # But with the addition of the group_concat() function, suddenly the # order does matter. # -# $Id: tkt2942.test,v 1.1 2008/02/15 14:33:04 drh Exp $ +# $Id: tkt2942.test,v 1.1.4.1 2009/05/18 16:14:26 drh Exp $ # set testdir [file dirname $argv0] @@ -58,5 +58,27 @@ do_test tkt2942.4 { } } {4,3,1,2} +do_test tkt2942-3841.1 { + execsql { + CREATE TABLE table2 (key TEXT, x TEXT); + CREATE TABLE list (key TEXT, value TEXT); + + INSERT INTO table2 VALUES ("a", "alist"); + INSERT INTO table2 VALUES ("b", "blist"); + INSERT INTO list VALUES ("a", 1); + INSERT INTO list VALUES ("a", 2); + INSERT INTO list VALUES ("a", 3); + INSERT INTO list VALUES ("b", 4); + INSERT INTO list VALUES ("b", 5); + INSERT INTO list VALUES ("b", 6); + + SELECT + table2.x, + (SELECT group_concat(list.value) + FROM list + WHERE list.key = table2.key) + FROM table2; + } +} {alist 1,2,3 blist 4,5,6} finish_test