SQLite

Check-in [3b2dd417f9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix SQLITE_OMIT_AUTOVACUUM so that it works again. Ticket #3228. (CVS 5439)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b2dd417f9dab3cae3ab3693629a65a2c90f00e9
User & Date: drh 2008-07-18 17:16:26.000
Context
2008-07-18
18:56
Use the actual size of memory allocations to update the memory status counters. Fix the roundup() function of mem3 to be much closer to the actual allocation size. Ticket #3226. (CVS 5440) (check-in: 5c22132eb1 user: drh tags: trunk)
17:16
Fix SQLITE_OMIT_AUTOVACUUM so that it works again. Ticket #3228. (CVS 5439) (check-in: 3b2dd417f9 user: drh tags: trunk)
17:03
Make sure expression spans are set correctly for "x.*" expressions in the result set of a SELECT. Ticket #3229. (CVS 5438) (check-in: 17a9984e76 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
** 2004 April 6
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.488 2008/07/18 09:34:57 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
** 2004 April 6
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.489 2008/07/18 17:16:26 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

2010
2011
2012
2013
2014
2015
2016












2017
2018
2019
2020
2021
2022
2023


trans_begun:
  btreeIntegrity(p);
  sqlite3BtreeLeave(p);
  return rc;
}













#ifndef SQLITE_OMIT_AUTOVACUUM

/*
** Set the pointer-map entries for all children of page pPage. Also, if
** pPage contains cells that point to overflow pages, set the pointer
** map entries for the overflow pages as well.







>
>
>
>
>
>
>
>
>
>
>
>







2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035


trans_begun:
  btreeIntegrity(p);
  sqlite3BtreeLeave(p);
  return rc;
}

/*
** Return the size of the database file in pages.  Or return -1 if
** there is any kind of error.
*/
static int pagerPagecount(Pager *pPager){
  int rc;
  int nPage;
  rc = sqlite3PagerPagecount(pPager, &nPage);
  return (rc==SQLITE_OK?nPage:-1);
}


#ifndef SQLITE_OMIT_AUTOVACUUM

/*
** Set the pointer-map entries for all children of page pPage. Also, if
** pPage contains cells that point to overflow pages, set the pointer
** map entries for the overflow pages as well.
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
    if( rc==SQLITE_OK ){
      rc = ptrmapPut(pBt, iFreePage, eType, iPtrPage);
    }
  }
  return rc;
}

static int pagerPagecount(Pager *pPager){
  int rc;
  int nPage;
  rc = sqlite3PagerPagecount(pPager, &nPage);
  return (rc==SQLITE_OK?nPage:-1);
}

/* Forward declaration required by incrVacuumStep(). */
static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);

/*
** Perform a single step of an incremental-vacuum. If successful,
** return SQLITE_OK. If there is no work to do (and therefore no
** point in calling this function again), return SQLITE_DONE.







<
<
<
<
<
<
<







2211
2212
2213
2214
2215
2216
2217







2218
2219
2220
2221
2222
2223
2224
    if( rc==SQLITE_OK ){
      rc = ptrmapPut(pBt, iFreePage, eType, iPtrPage);
    }
  }
  return rc;
}








/* Forward declaration required by incrVacuumStep(). */
static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);

/*
** Perform a single step of an incremental-vacuum. If successful,
** return SQLITE_OK. If there is no work to do (and therefore no
** point in calling this function again), return SQLITE_DONE.
Changes to test/incrblob_err.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2007 May 1
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: incrblob_err.test,v 1.13 2008/07/16 18:35:46 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable {!incrblob  || !memdebug || !tclvar} {
  finish_test











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2007 May 1
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: incrblob_err.test,v 1.14 2008/07/18 17:16:27 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable {!incrblob  || !memdebug || !tclvar} {
  finish_test
128
129
130
131
132
133
134
135
136
137
  #
  sqlite3 db2 test.db
  set ::blob [db2 incrblob blobs v 1]
  sqlite3_blob_write $::blob [expr 500*1020-20] 12345678900987654321
  close $::blob
}

db2 close

finish_test







|


128
129
130
131
132
133
134
135
136
137
  #
  sqlite3 db2 test.db
  set ::blob [db2 incrblob blobs v 1]
  sqlite3_blob_write $::blob [expr 500*1020-20] 12345678900987654321
  close $::blob
}

catch {db2 close}

finish_test