SQLite

Check-in [b91fcb3b1b]
Login

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

Overview
Comment:Merge the 3.8.6 changes into the apple-osx branch.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: b91fcb3b1b6d383e023bd0818a2075018fd33b98
User & Date: drh 2014-08-15 16:10:41.678
Context
2014-08-26
02:02
Merge recent performance enhancements and the CAST operator enhancements into the apple-osx branch. (check-in: 5c27311105 user: drh tags: apple-osx)
2014-08-15
16:10
Merge the 3.8.6 changes into the apple-osx branch. (check-in: b91fcb3b1b user: drh tags: apple-osx)
11:46
Version 3.8.6 (check-in: 9491ba7d73 user: drh tags: trunk, release, version-3.8.6)
2014-08-14
13:39
Merge the pre-3.8.6 changes from trunk into the apple-osx branch. (check-in: 08058df3af user: drh tags: apple-osx)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
5764
5765
5766
5767
5768
5769
5770

5771
5772
5773
5774
5775
5776
5777
5778
  int cellOffset;   /* Address of first cell pointer in data[] */
  u8 *data;         /* The content of the whole page */
  int nSkip = (iChild ? 4 : 0);

  if( *pRC ) return;

  assert( i>=0 && i<=pPage->nCell+pPage->nOverflow );

  assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 );
  assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) );
  assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) );
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  /* The cell should normally be sized correctly.  However, when moving a
  ** malformed cell from a leaf page to an interior page, if the cell size
  ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size
  ** might be less than 8 (leaf-size + pointer) on the interior node.  Hence







>
|







5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
  int cellOffset;   /* Address of first cell pointer in data[] */
  u8 *data;         /* The content of the whole page */
  int nSkip = (iChild ? 4 : 0);

  if( *pRC ) return;

  assert( i>=0 && i<=pPage->nCell+pPage->nOverflow );
  assert( MX_CELL(pPage->pBt)<=10921 );
  assert( pPage->nCell<=MX_CELL(pPage->pBt) || CORRUPT_DB );
  assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) );
  assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) );
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  /* The cell should normally be sized correctly.  However, when moving a
  ** malformed cell from a leaf page to an interior page, if the cell size
  ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size
  ** might be less than 8 (leaf-size + pointer) on the interior node.  Hence
Changes to test/corruptI.test.
71
72
73
74
75
76
77


























78
79
  catchsql { SELECT * FROM r WHERE x >= 10.0 }
} {1 {database disk image is malformed}}

do_test 2.2 {
  catchsql { SELECT * FROM r WHERE x >= 10 }
} {1 {database disk image is malformed}}




























finish_test







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


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  catchsql { SELECT * FROM r WHERE x >= 10.0 }
} {1 {database disk image is malformed}}

do_test 2.2 {
  catchsql { SELECT * FROM r WHERE x >= 10 }
} {1 {database disk image is malformed}}

reset_db

do_execsql_test 3.1 {
  PRAGMA page_size = 512;
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
  WITH s(a, b) AS (
    SELECT 2, 'abcdefghij'
    UNION ALL
    SELECT a+2, b FROM s WHERe a < 40
  )
  INSERT INTO t1 SELECT * FROM s;
} {}

do_test 3.2 {
  hexio_write test.db [expr 512+3] 0054
  db close
  sqlite3 db test.db
  execsql { INSERT INTO t1 VALUES(5, 'klmnopqrst') }
  execsql { INSERT INTO t1 VALUES(7, 'klmnopqrst') }
} {}

db close
sqlite3 db test.db
do_catchsql_test 3.2 {
  INSERT INTO t1 VALUES(9, 'klmnopqrst');
} {1 {database disk image is malformed}}

finish_test