-C Make\ssure\sthe\sVACUUM\sstatement\slocks\sdown\sthe\spage_size\sand\sauto_vacuum\nmodes\safter\sit\sruns.\s\sOtherwise,\spragmas\smight\schange\sthese\ssettings\son\na\spopulated\sdatabase,\sresulting\sin\sproblems.\s(CVS\s6442)
-D 2009-04-02T20:16:59
+C Make\ssure\scount(*)\sworks\son\sthe\ssqlite_master\stable\sof\san\sempty\sdatabase.\nTicket\s#3774.\s(CVS\s6443)
+D 2009-04-02T20:27:28
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff
F src/util.c 469d74f5bf09ed6398702c7da2ef8a34e979a1c1
F src/vacuum.c 07121a727beeee88f27d704a00313ad6a7c9bef0
-F src/vdbe.c 624922027b8b5fe203bd89e204aaed447e8b7ce7
+F src/vdbe.c bddddefc5c7ec1c9cd3e4f9220eb813b43668605
F src/vdbe.h d70a68bee196ab228914a3902c79dbd24342a0f2
F src/vdbeInt.h 53a2f4696871712646c77351904576cca6ad9752
F src/vdbeapi.c 950986b0f765b5b91aab1acb2b405d9450b749d1
F test/corruptA.test 99e95620b980161cb3e79f06a884a4bb8ae265ff
F test/corruptB.test 505331779fe7a96fe38ecbb817f19c63bc27d171
F test/corruptC.test c798aa395a8d052fba88bd1be8e1945309e3f94a
-F test/count.test 89df9e4cf33caa060be12607462caaf47df6c435
+F test/count.test 276b32260ecfa1f3c50799818fd1aea99888eea8
F test/crash.test 1b6ac8410689ff78028887f445062dc897c9ac89
F test/crash2.test 5b14d4eb58b880e231361d3b609b216acda86651
F test/crash3.test 776f9363554c029fcce71d9e6600fa0ba6359ce7
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 23bf9f266559603e37b2703715eaf8ef5af6bb17
-R e0d218115c45629c5885d4b4b4658168
+P 85e6a4740d6db731c8c35a331031c346e9189c27
+R bd78ffb4482bff31a318e650753900a9
U drh
-Z 1702788136b089e50c945192dcad3cc4
+Z 65e49db46664fd71c4cc25be1e95b592
** 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.828 2009/03/23 17:11:27 danielk1977 Exp $
+** $Id: vdbe.c,v 1.829 2009/04/02 20:27:28 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
case OP_Count: { /* out2-prerelease */
i64 nEntry;
BtCursor *pCrsr = p->apCsr[pOp->p1]->pCursor;
- rc = sqlite3BtreeCount(pCrsr, &nEntry);
+ if( pCrsr ){
+ rc = sqlite3BtreeCount(pCrsr, &nEntry);
+ }else{
+ nEntry = 0;
+ }
pOut->flags = MEM_Int;
pOut->u.i = nEntry;
break;
# This file implements regression tests for SQLite library. The
# focus of this file is testing "SELECT count(*)" statements.
#
-# $Id: count.test,v 1.3 2009/02/25 08:56:47 danielk1977 Exp $
+# $Id: count.test,v 1.4 2009/04/02 20:27:28 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Test plan:
#
+# count-0.*: Make sure count(*) works on an empty database. (Ticket #3774)
+#
# count-1.*: Test that the OP_Count instruction appears to work on both
# tables and indexes. Test both when they contain 0 entries,
# when all entries are on the root page, and when the b-tree
#
#
+do_test count-0.1 {
+ db eval {
+ SELECT count(*) FROM sqlite_master;
+ }
+} {0}
+
set iTest 0
foreach zIndex [list {
/* no-op */
finish_test
-