Hello community,
here is the log from the commit of package sqlite
checked in at Fri Apr 27 09:50:13 CEST 2007.
--------
--- sqlite/sqlite.changes 2007-04-19 12:04:55.000000000 +0200
+++ sqlite/sqlite.changes 2007-04-27 09:38:57.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Apr 27 09:38:04 CEST 2007 - adrian@suse.de
+
+- update to version 3.3.17
+ * bug fix in forwards-compatibility logic of SQLite
+
+-------------------------------------------------------------------
@@ -5 +11 @@
- * speed improvements where not enabled in .15 by accident
+ * speed improvements were not enabled in .15 by accident
Old:
----
sqlite-3.3.16.tar.bz2
New:
----
sqlite-3.3.17.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sqlite.spec ++++++
--- /var/tmp/diff_new_pack.vM2043/_old 2007-04-27 09:49:22.000000000 +0200
+++ /var/tmp/diff_new_pack.vM2043/_new 2007-04-27 09:49:22.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package sqlite (Version 3.3.16)
+# spec file for package sqlite (Version 3.3.17)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -19,7 +19,7 @@
Group: Productivity/Databases/Servers
Summary: Embeddable SQL Database Engine
URL: http://www.sqlite.org/
-Version: 3.3.16
+Version: 3.3.17
Release: 1
Source0: http://www.sqlite.org/%name-%version.tar.bz2
Source1: sqlite.desktop
@@ -177,9 +177,12 @@
%_libdir/pkgconfig/sqlite3.pc
%changelog
+* Fri Apr 27 2007 - adrian@suse.de
+- update to version 3.3.17
+ * bug fix in forwards-compatibility logic of SQLite
* Thu Apr 19 2007 - adrian@suse.de
- update to version 3.3.16
- * speed improvements where not enabled in .15 by accident
+ * speed improvements were not enabled in .15 by accident
* Mon Apr 16 2007 - adrian@suse.de
- update to version 3.3.15
* speed improvements
++++++ sqlite-3.3.16.tar.bz2 -> sqlite-3.3.17.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/ext/fts2/fts2.c new/sqlite-3.3.17/ext/fts2/fts2.c
--- old/sqlite-3.3.16/ext/fts2/fts2.c 2007-04-12 23:24:09.000000000 +0200
+++ new/sqlite-3.3.17/ext/fts2/fts2.c 2007-04-21 18:36:56.000000000 +0200
@@ -1374,10 +1374,16 @@
dlwInit(&writer, DL_DOCIDS, pOut);
while( !dlrAtEnd(&left) || !dlrAtEnd(&right) ){
- if( dlrAtEnd(&right) || dlrDocid(&left)0x2f && isIdChar[ch-0x30]))
-#define isDelim(C) (((ch=C)&0x80)==0 && (ch<0x30 || !isIdChar[ch-0x30]))
+#define isDelim(C) (((ch=C)&0x80)==0 && (ch<0x30 || !porterIdChar[ch-0x30]))
/*
** Extract the next token from a tokenization cursor. The cursor must
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/ext/fts2/fts2_tokenizer1.c new/sqlite-3.3.17/ext/fts2/fts2_tokenizer1.c
--- old/sqlite-3.3.16/ext/fts2/fts2_tokenizer1.c 2007-03-16 19:30:55.000000000 +0100
+++ new/sqlite-3.3.17/ext/fts2/fts2_tokenizer1.c 2007-04-21 18:29:36.000000000 +0200
@@ -48,7 +48,7 @@
/* Forward declaration */
static const sqlite3_tokenizer_module simpleTokenizerModule;
-static int isDelim(simple_tokenizer *t, unsigned char c){
+static int simpleDelim(simple_tokenizer *t, unsigned char c){
return c<0x80 && t->delim[c];
}
@@ -164,13 +164,13 @@
int iStartOffset;
/* Scan past delimiter characters */
- while( c->iOffset<c->nBytes && isDelim(t, p[c->iOffset]) ){
+ while( c->iOffset<c->nBytes && simpleDelim(t, p[c->iOffset]) ){
c->iOffset++;
}
/* Count non-delimiter characters. */
iStartOffset = c->iOffset;
- while( c->iOffset<c->nBytes && !isDelim(t, p[c->iOffset]) ){
+ while( c->iOffset<c->nBytes && !simpleDelim(t, p[c->iOffset]) ){
c->iOffset++;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/ext/fts2/mkfts2amal.tcl new/sqlite-3.3.17/ext/fts2/mkfts2amal.tcl
--- old/sqlite-3.3.16/ext/fts2/mkfts2amal.tcl 1970-01-01 01:00:00.000000000 +0100
+++ new/sqlite-3.3.17/ext/fts2/mkfts2amal.tcl 2007-04-21 18:36:43.000000000 +0200
@@ -0,0 +1,114 @@
+#!/usr/bin/tclsh
+#
+# This script builds a single C code file holding all of FTS2 code.
+# The name of the output file is fts2amal.c. To build this file,
+# first do:
+#
+# make target_source
+#
+# The make target above moves all of the source code files into
+# a subdirectory named "tsrc". (This script expects to find the files
+# there and will not work if they are not found.)
+#
+# After the "tsrc" directory has been created and populated, run
+# this script:
+#
+# tclsh mkfts2amal.tcl
+#
+# The amalgamated FTS2 code will be written into fts2amal.c
+#
+
+# Open the output file and write a header comment at the beginning
+# of the file.
+#
+set out [open fts2amal.c w]
+set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
+puts $out [subst \
+{/******************************************************************************
+** This file is an amalgamation of separate C source files from the SQLite
+** Full Text Search extension 2 (fts2). By combining all the individual C
+** code files into this single large file, the entire code can be compiled
+** as a one translation unit. This allows many compilers to do optimizations
+** that would not be possible if the files were compiled separately. It also
+** makes the code easier to import into other projects.
+**
+** This amalgamation was generated on $today.
+*/}]
+
+# These are the header files used by FTS2. The first time any of these
+# files are seen in a #include statement in the C code, include the complete
+# text of the file in-line. The file only needs to be included once.
+#
+foreach hdr {
+ fts2.h
+ fts2_hash.h
+ fts2_tokenizer.h
+ sqlite3.h
+ sqlite3ext.h
+} {
+ set available_hdr($hdr) 1
+}
+
+# 78 stars used for comment formatting.
+set s78 \
+{*****************************************************************************}
+
+# Insert a comment into the code
+#
+proc section_comment {text} {
+ global out s78
+ set n [string length $text]
+ set nstar [expr {60 - $n}]
+ set stars [string range $s78 0 $nstar]
+ puts $out "/************** $text $stars/"
+}
+
+# Read the source file named $filename and write it into the
+# sqlite3.c output file. If any #include statements are seen,
+# process them approprately.
+#
+proc copy_file {filename} {
+ global seen_hdr available_hdr out
+ set tail [file tail $filename]
+ section_comment "Begin file $tail"
+ set in [open $filename r]
+ while {![eof $in]} {
+ set line [gets $in]
+ if {[regexp {^#\s*include\s+["<]([^">]+)[">]} $line all hdr]} {
+ if {[info exists available_hdr($hdr)]} {
+ if {$available_hdr($hdr)} {
+ section_comment "Include $hdr in the middle of $tail"
+ copy_file tsrc/$hdr
+ section_comment "Continuing where we left off in $tail"
+ }
+ } elseif {![info exists seen_hdr($hdr)]} {
+ set seen_hdr($hdr) 1
+ puts $out $line
+ }
+ } elseif {[regexp {^#ifdef __cplusplus} $line]} {
+ puts $out "#if 0"
+ } elseif {[regexp {^#line} $line]} {
+ # Skip #line directives.
+ } else {
+ puts $out $line
+ }
+ }
+ close $in
+ section_comment "End of $tail"
+}
+
+
+# Process the source files. Process files containing commonly
+# used subroutines first in order to help the compiler find
+# inlining opportunities.
+#
+foreach file {
+ fts2.c
+ fts2_hash.c
+ fts2_porter.c
+ fts2_tokenizer1.c
+} {
+ copy_file tsrc/$file
+}
+
+close $out
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/btree.c new/sqlite-3.3.17/src/btree.c
--- old/sqlite-3.3.16/src/btree.c 2007-04-13 05:12:32.000000000 +0200
+++ new/sqlite-3.3.17/src/btree.c 2007-04-24 19:35:59.000000000 +0200
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.355 2007/04/13 02:14:30 drh Exp $
+** $Id: btree.c,v 1.358 2007/04/24 17:35:59 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -1870,7 +1870,10 @@
if( memcmp(page1, zMagicHeader, 16)!=0 ){
goto page1_init_failed;
}
- if( page1[18]>1 || page1[19]>1 ){
+ if( page1[18]>1 ){
+ pBt->readOnly = 1;
+ }
+ if( page1[19]>1 ){
goto page1_init_failed;
}
pageSize = get2byte(&page1[16]);
@@ -2068,11 +2071,15 @@
if( pBt->pPage1==0 ){
rc = lockBtree(pBt);
}
-
+
if( rc==SQLITE_OK && wrflag ){
- rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1);
- if( rc==SQLITE_OK ){
- rc = newDatabase(pBt);
+ if( pBt->readOnly ){
+ rc = SQLITE_READONLY;
+ }else{
+ rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1);
+ if( rc==SQLITE_OK ){
+ rc = newDatabase(pBt);
+ }
}
}
@@ -2782,6 +2789,9 @@
if( rc!=SQLITE_OK ){
return rc;
}
+ if( pBt->readOnly && wrFlag ){
+ return SQLITE_READONLY;
+ }
}
pCur = sqliteMalloc( sizeof(*pCur) );
if( pCur==0 ){
@@ -3519,26 +3529,22 @@
int rc;
MemPage *pPage;
-#ifndef SQLITE_OMIT_SHARED_CACHE
rc = restoreOrClearCursorPosition(pCur);
if( rc!=SQLITE_OK ){
return rc;
}
-#endif
assert( pRes!=0 );
pPage = pCur->pPage;
if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
return SQLITE_OK;
}
-#ifndef SQLITE_OMIT_SHARED_CACHE
if( pCur->skip>0 ){
pCur->skip = 0;
*pRes = 0;
return SQLITE_OK;
}
pCur->skip = 0;
-#endif
assert( pPage->isInit );
assert( pCur->idx<pPage->nCell );
@@ -3589,24 +3595,20 @@
Pgno pgno;
MemPage *pPage;
-#ifndef SQLITE_OMIT_SHARED_CACHE
rc = restoreOrClearCursorPosition(pCur);
if( rc!=SQLITE_OK ){
return rc;
}
-#endif
if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
return SQLITE_OK;
}
-#ifndef SQLITE_OMIT_SHARED_CACHE
if( pCur->skip<0 ){
pCur->skip = 0;
*pRes = 0;
return SQLITE_OK;
}
pCur->skip = 0;
-#endif
pPage = pCur->pPage;
assert( pPage->isInit );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/expr.c new/sqlite-3.3.17/src/expr.c
--- old/sqlite-3.3.16/src/expr.c 2007-04-13 18:06:33.000000000 +0200
+++ new/sqlite-3.3.17/src/expr.c 2007-04-18 19:07:58.000000000 +0200
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.284 2007/04/13 16:06:33 drh Exp $
+** $Id: expr.c,v 1.285 2007/04/18 17:07:58 drh Exp $
*/
#include "sqliteInt.h"
#include
@@ -237,12 +237,12 @@
}else if( pLeft ){
if( pRight ){
sqlite3ExprSpan(pNew, &pLeft->span, &pRight->span);
- if( pRight->flags && EP_ExpCollate ){
+ if( pRight->flags & EP_ExpCollate ){
pNew->flags |= EP_ExpCollate;
pNew->pColl = pRight->pColl;
}
}
- if( pLeft->flags && EP_ExpCollate ){
+ if( pLeft->flags & EP_ExpCollate ){
pNew->flags |= EP_ExpCollate;
pNew->pColl = pLeft->pColl;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/legacy.c new/sqlite-3.3.17/src/legacy.c
--- old/sqlite-3.3.16/src/legacy.c 2007-03-29 20:39:32.000000000 +0200
+++ new/sqlite-3.3.17/src/legacy.c 2007-04-25 13:28:17.000000000 +0200
@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: legacy.c,v 1.16 2006/09/15 07:28:50 drh Exp $
+** $Id: legacy.c,v 1.17 2007/04/25 11:28:17 drh Exp $
*/
#include "sqliteInt.h"
@@ -44,7 +44,6 @@
char **azCols = 0;
int nRetry = 0;
- int nChange = 0;
int nCallback;
if( zSql==0 ) return SQLITE_OK;
@@ -64,7 +63,6 @@
continue;
}
- db->nChange += nChange;
nCallback = 0;
nCol = sqlite3_column_count(pStmt);
@@ -101,9 +99,6 @@
if( rc!=SQLITE_ROW ){
rc = sqlite3_finalize(pStmt);
pStmt = 0;
- if( db->pVdbe==0 ){
- nChange = db->nChange;
- }
if( rc!=SQLITE_SCHEMA ){
nRetry = 0;
zSql = zLeftover;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/loadext.c new/sqlite-3.3.17/src/loadext.c
--- old/sqlite-3.3.16/src/loadext.c 2007-03-29 20:44:44.000000000 +0200
+++ new/sqlite-3.3.17/src/loadext.c 2007-04-24 01:04:23.000000000 +0200
@@ -37,28 +37,32 @@
#endif
#ifdef SQLITE_OMIT_AUTHORIZATION
-# define sqlite3_set_authorizer 0
+# define sqlite3_set_authorizer 0
#endif
#ifdef SQLITE_OMIT_UTF16
-# define sqlite3_bind_text16 0
-# define sqlite3_collation_needed16 0
-# define sqlite3_column_decltype16 0
-# define sqlite3_column_name16 0
-# define sqlite3_column_text16 0
-# define sqlite3_complete16 0
-# define sqlite3_create_collation16 0
-# define sqlite3_create_function16 0
-# define sqlite3_errmsg16 0
-# define sqlite3_open16 0
-# define sqlite3_prepare16 0
-# define sqlite3_result_error16 0
-# define sqlite3_result_text16 0
-# define sqlite3_result_text16be 0
-# define sqlite3_result_text16le 0
-# define sqlite3_value_text16 0
-# define sqlite3_value_text16be 0
-# define sqlite3_value_text16le 0
+# define sqlite3_bind_text16 0
+# define sqlite3_collation_needed16 0
+# define sqlite3_column_decltype16 0
+# define sqlite3_column_name16 0
+# define sqlite3_column_text16 0
+# define sqlite3_complete16 0
+# define sqlite3_create_collation16 0
+# define sqlite3_create_function16 0
+# define sqlite3_errmsg16 0
+# define sqlite3_open16 0
+# define sqlite3_prepare16 0
+# define sqlite3_prepare16_v2 0
+# define sqlite3_result_error16 0
+# define sqlite3_result_text16 0
+# define sqlite3_result_text16be 0
+# define sqlite3_result_text16le 0
+# define sqlite3_value_text16 0
+# define sqlite3_value_text16be 0
+# define sqlite3_value_text16le 0
+# define sqlite3_column_database_name16 0
+# define sqlite3_column_table_name16 0
+# define sqlite3_column_origin_name16 0
#endif
#ifdef SQLITE_OMIT_COMPLETE
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/prepare.c new/sqlite-3.3.17/src/prepare.c
--- old/sqlite-3.3.16/src/prepare.c 2007-03-29 20:39:32.000000000 +0200
+++ new/sqlite-3.3.17/src/prepare.c 2007-04-24 01:07:27.000000000 +0200
@@ -13,7 +13,7 @@
** interface, and routines that contribute to loading the database schema
** from disk.
**
-** $Id: prepare.c,v 1.45 2007/03/26 22:05:02 drh Exp $
+** $Id: prepare.c,v 1.46 2007/04/19 11:09:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -537,13 +537,15 @@
if( sqlite3SafetyOff(db) ){
rc = SQLITE_MISUSE;
}
- if( rc==SQLITE_OK ){
- if( saveSqlFlag ){
- sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql);
- }
- *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
- }else if( sParse.pVdbe ){
+
+ if( saveSqlFlag ){
+ sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql);
+ }
+ if( rc!=SQLITE_OK || sqlite3MallocFailed() ){
sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
+ assert(!(*ppStmt));
+ }else{
+ *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
}
if( zErrMsg ){
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/test1.c new/sqlite-3.3.17/src/test1.c
--- old/sqlite-3.3.16/src/test1.c 2007-04-13 04:14:30.000000000 +0200
+++ new/sqlite-3.3.17/src/test1.c 2007-04-24 01:56:31.000000000 +0200
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.237 2007/04/13 02:14:30 drh Exp $
+** $Id: test1.c,v 1.239 2007/04/23 23:56:31 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -580,6 +580,7 @@
zBuf[i*2] = 0;
sqlite3_result_text(p, (char*)zBuf, -1, SQLITE_TRANSIENT);
}
+#ifndef SQLITE_OMIT_UTF16
static void hex16Func(sqlite3_context *p, int argc, sqlite3_value **argv){
const unsigned short int *z;
int i;
@@ -591,6 +592,7 @@
zBuf[i*4] = 0;
sqlite3_result_text(p, (char*)zBuf, -1, SQLITE_TRANSIENT);
}
+#endif
/*
** A structure into which to accumulate text.
@@ -742,10 +744,12 @@
rc = sqlite3_create_function(db, "hex8", 1, SQLITE_ANY, 0,
hex8Func, 0, 0);
}
+#ifndef SQLITE_OMIT_UTF16
if( rc==SQLITE_OK ){
rc = sqlite3_create_function(db, "hex16", 1, SQLITE_ANY, 0,
hex16Func, 0, 0);
}
+#endif
if( rc==SQLITE_OK ){
rc = sqlite3_create_function(db, "tkt2213func", 1, SQLITE_ANY, 0,
tkt2213Function, 0, 0);
@@ -2748,6 +2752,7 @@
if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR;
rc = sqlite3_prepare_v2(db, zSql, bytes, &pStmt, &zTail);
+ assert(rc==SQLITE_OK || pStmt==0);
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
if( zTail ){
if( bytes>=0 ){
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/test8.c new/sqlite-3.3.17/src/test8.c
--- old/sqlite-3.3.16/src/test8.c 2007-03-30 17:47:07.000000000 +0200
+++ new/sqlite-3.3.17/src/test8.c 2007-04-18 19:40:31.000000000 +0200
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test8.c,v 1.45 2007/03/30 14:56:35 danielk1977 Exp $
+** $Id: test8.c,v 1.46 2007/04/18 17:04:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -269,9 +269,13 @@
-1, &pStmt, 0);
sqlite3_bind_text(pStmt, 1, argv[3], -1, 0);
if( sqlite3_step(pStmt)==SQLITE_ROW ){
+ int rc2;
const char *zCreateTable = (const char *)sqlite3_column_text(pStmt, 0);
- sqlite3_declare_vtab(db, zCreateTable);
- rc = sqlite3_finalize(pStmt);
+ rc = sqlite3_declare_vtab(db, zCreateTable);
+ rc2 = sqlite3_finalize(pStmt);
+ if( rc==SQLITE_OK ){
+ rc = rc2;
+ }
} else {
rc = sqlite3_finalize(pStmt);
if( rc==SQLITE_OK ){
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/test9.c new/sqlite-3.3.17/src/test9.c
--- old/sqlite-3.3.16/src/test9.c 2007-03-29 19:28:15.000000000 +0200
+++ new/sqlite-3.3.17/src/test9.c 2007-04-24 01:56:32.000000000 +0200
@@ -14,7 +14,7 @@
** for completeness. Test code is written in C for these cases
** as there is not much point in binding to Tcl.
**
-** $Id: test9.c,v 1.2 2007/03/29 17:28:15 danielk1977 Exp $
+** $Id: test9.c,v 1.3 2007/04/23 23:56:32 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -132,11 +132,13 @@
}
sqlite3_close(db);
+#ifndef SQLITE_OMIT_UTF16
rc = sqlite3_collation_needed16(db, 0, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_collation_needed16";
goto error_out;
}
+#endif
rc = sqlite3_collation_needed(db, 0, 0);
if( rc!=SQLITE_MISUSE ){
@@ -168,11 +170,13 @@
goto error_out;
}
+#ifndef SQLITE_OMIT_UTF16
rc = sqlite3_prepare16(db, 0, 0, 0, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_prepare16";
goto error_out;
}
+#endif
return TCL_OK;
@@ -202,4 +206,3 @@
}
return TCL_OK;
}
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/vdbe.c new/sqlite-3.3.17/src/vdbe.c
--- old/sqlite-3.3.16/src/vdbe.c 2007-04-17 23:25:30.000000000 +0200
+++ new/sqlite-3.3.17/src/vdbe.c 2007-04-18 18:45:24.000000000 +0200
@@ -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.600 2007/04/17 08:32:34 danielk1977 Exp $
+** $Id: vdbe.c,v 1.601 2007/04/18 16:45:24 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -2369,7 +2369,11 @@
return SQLITE_BUSY;
}
}
- return SQLITE_DONE;
+ if( p->rc==SQLITE_OK ){
+ return SQLITE_DONE;
+ }else{
+ return SQLITE_ERROR;
+ }
}else{
sqlite3SetString(&p->zErrMsg,
(!i)?"cannot start a transaction within a transaction":(
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/vtab.c new/sqlite-3.3.17/src/vtab.c
--- old/sqlite-3.3.16/src/vtab.c 2007-04-18 16:34:25.000000000 +0200
+++ new/sqlite-3.3.17/src/vtab.c 2007-04-24 01:07:30.000000000 +0200
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to help implement virtual tables.
**
-** $Id: vtab.c,v 1.42 2007/04/18 14:24:34 danielk1977 Exp $
+** $Id: vtab.c,v 1.45 2007/04/19 14:48:37 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
#include "sqliteInt.h"
@@ -132,10 +132,12 @@
int iDb; /* The database the table is being created in */
Table *pTable; /* The new virtual table */
+#ifndef SQLITE_OMIT_SHARED_CACHE
if( sqlite3ThreadDataReadOnly()->useSharedData ){
sqlite3ErrorMsg(pParse, "Cannot use virtual tables in shared-cache mode");
return;
}
+#endif
sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
pTable = pParse->pNewTable;
@@ -531,16 +533,18 @@
*/
static void callFinaliser(sqlite3 *db, int offset){
int i;
- for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
- sqlite3_vtab *pVtab = db->aVTrans[i];
- int (*x)(sqlite3_vtab *);
- x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
- if( x ) x(pVtab);
- sqlite3VtabUnlock(db, pVtab);
+ if( db->aVTrans ){
+ for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
+ sqlite3_vtab *pVtab = db->aVTrans[i];
+ int (*x)(sqlite3_vtab *);
+ x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
+ if( x ) x(pVtab);
+ sqlite3VtabUnlock(db, pVtab);
+ }
+ sqliteFree(db->aVTrans);
+ db->nVTrans = 0;
+ db->aVTrans = 0;
}
- sqliteFree(db->aVTrans);
- db->nVTrans = 0;
- db->aVTrans = 0;
}
/*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/src/where.c new/sqlite-3.3.17/src/where.c
--- old/sqlite-3.3.16/src/where.c 2007-04-06 03:04:40.000000000 +0200
+++ new/sqlite-3.3.17/src/where.c 2007-04-20 14:22:02.000000000 +0200
@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.246 2007/04/06 01:04:40 drh Exp $
+** $Id: where.c,v 1.247 2007/04/20 12:22:02 drh Exp $
*/
#include "sqliteInt.h"
@@ -26,11 +26,6 @@
#define BMS (sizeof(Bitmask)*8)
/*
-** Determine the number of elements in an array.
-*/
-#define ARRAYSIZE(X) (sizeof(X)/sizeof(X[0]))
-
-/*
** Trace output macros
*/
#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
@@ -195,7 +190,7 @@
pWC->pParse = pParse;
pWC->pMaskSet = pMaskSet;
pWC->nTerm = 0;
- pWC->nSlot = ARRAYSIZE(pWC->aStatic);
+ pWC->nSlot = ArraySize(pWC->aStatic);
pWC->a = pWC->aStatic;
}
@@ -310,7 +305,7 @@
** array will never overflow.
*/
static void createMask(ExprMaskSet *pMaskSet, int iCursor){
- assert( pMaskSet->n < ARRAYSIZE(pMaskSet->ix) );
+ assert( pMaskSet->n < ArraySize(pMaskSet->ix) );
pMaskSet->ix[pMaskSet->n++] = iCursor;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/exclusive2.test new/sqlite-3.3.17/test/exclusive2.test
--- old/sqlite-3.3.16/test/exclusive2.test 2007-04-16 17:02:20.000000000 +0200
+++ new/sqlite-3.3.17/test/exclusive2.test 2007-04-25 14:06:59.000000000 +0200
@@ -10,7 +10,7 @@
#***********************************************************************
# This file implements regression tests for SQLite library.
#
-# $Id: exclusive2.test,v 1.4 2007/04/16 15:02:20 drh Exp $
+# $Id: exclusive2.test,v 1.5 2007/04/25 12:06:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -161,6 +161,7 @@
seek $fd 1024
puts -nonewline $fd [string repeat [binary format c 0] 10000]
flush $fd
+ close $fd
t1sig
} $::sig
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/fts2g.test new/sqlite-3.3.17/test/fts2g.test
--- old/sqlite-3.3.16/test/fts2g.test 2006-10-25 22:27:40.000000000 +0200
+++ new/sqlite-3.3.17/test/fts2g.test 2007-04-24 01:07:30.000000000 +0200
@@ -7,7 +7,7 @@
# of this script is testing handling of edge cases for various doclist
# merging functions in the FTS2 module query logic.
#
-# $Id: fts2g.test,v 1.1 2006/10/25 20:27:40 shess Exp $
+# $Id: fts2g.test,v 1.2 2007/04/19 18:36:32 shess Exp $
#
set testdir [file dirname $argv0]
@@ -22,6 +22,7 @@
db eval {
CREATE VIRTUAL TABLE t1 USING fts2(content);
INSERT INTO t1 (rowid, content) VALUES(1, 'this is a test');
+ INSERT INTO t1 (rowid, content) VALUES(2, 'also a test');
}
# No hits at all. Returns empty doclists from termSelect().
@@ -74,4 +75,13 @@
catchsql {SELECT rowid FROM t1 WHERE t1 MATCH '-this -something'}
} {1 {SQL logic error or missing database}}
+# Test that docListOrMerge() correctly handles reaching the end of one
+# doclist before it reaches the end of the other.
+do_test fts2g-1.11 {
+ execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'this OR also'}
+} {1 2}
+do_test fts2g-1.12 {
+ execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'also OR this'}
+} {1 2}
+
finish_test
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/laststmtchanges.test new/sqlite-3.3.17/test/laststmtchanges.test
--- old/sqlite-3.3.16/test/laststmtchanges.test 2007-03-27 16:43:05.000000000 +0200
+++ new/sqlite-3.3.17/test/laststmtchanges.test 2007-04-25 13:27:22.000000000 +0200
@@ -50,8 +50,19 @@
}
} {0 {5 13}}
+# There was some goofy change-counting logic in sqlite3_exec() that
+# appears to have been left over from SQLite version 2. This test
+# makes sure it has been removed.
+#
+do_test laststmtchanges-1.2.1 {
+ db cache flush
+ sqlite3_exec_printf db {update t0 set x=4 where x=3; select 1;} {}
+ execsql {select changes()}
+} {5}
+
# changes() unchanged within an update statement
do_test laststmtchanges-1.3 {
+ execsql {update t0 set x=3 where x=4}
catchsql {
update t0 set x=x+changes() where x=3;
select count() from t0 where x=8;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/malloc.test new/sqlite-3.3.17/test/malloc.test
--- old/sqlite-3.3.16/test/malloc.test 2007-03-30 13:11:18.000000000 +0200
+++ new/sqlite-3.3.17/test/malloc.test 2007-04-24 01:07:30.000000000 +0200
@@ -14,7 +14,7 @@
# special feature is used to see what happens in the library if a malloc
# were to really fail due to an out-of-memory situation.
#
-# $Id: malloc.test,v 1.40 2007/03/30 07:10:52 danielk1977 Exp $
+# $Id: malloc.test,v 1.41 2007/04/19 11:09:02 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -552,6 +552,23 @@
CREATE TABLE abc(a, b, c, FOREIGN KEY(a) REFERENCES abc(b))
}
+# Test malloc failure in an sqlite3_prepare_v2() call.
+#
+do_malloc_test 22 -tclbody {
+ set ::STMT ""
+ set r [catch {
+ set ::STMT [
+ sqlite3_prepare_v2 $::DB "SELECT * FROM sqlite_master" -1 DUMMY
+ ]
+ } msg]
+ if {$r} {error [string range $msg 4 end]}
+} -cleanup {
+ if {$::STMT ne ""} {
+ sqlite3_finalize $::STMT
+ set ::STMT ""
+ }
+}
+
# Ensure that no file descriptors were leaked.
do_test malloc-99.X {
catch {db close}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/misc6.test new/sqlite-3.3.17/test/misc6.test
--- old/sqlite-3.3.16/test/misc6.test 2006-09-04 20:54:14.000000000 +0200
+++ new/sqlite-3.3.17/test/misc6.test 2007-04-24 01:56:32.000000000 +0200
@@ -13,7 +13,7 @@
# This file implements tests to make sure sqlite3_value_text()
# always returns a null-terminated string.
#
-# $Id: misc6.test,v 1.2 2006/09/04 18:54:14 drh Exp $
+# $Id: misc6.test,v 1.3 2007/04/23 23:56:32 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -30,17 +30,19 @@
do_test misc6-1.2 {
sqlite3_column_text $STMT 0
} {3031323334}
-do_test misc6-1.3 {
- sqlite3_finalize $STMT
- set STMT [sqlite3_prepare $DB {SELECT hex16(?)} -1 DUMMY]
- set sqlite_static_bind_value {0123456789}
- set sqlite_static_bind_nbyte 5
- sqlite_bind $STMT 1 {} static-nbytes
- sqlite3_step $STMT
-} SQLITE_ROW
-do_test misc6-1.4 {
- sqlite3_column_text $STMT 0
-} {00300031003200330034}
+ifcapable utf16 {
+ do_test misc6-1.3 {
+ sqlite3_finalize $STMT
+ set STMT [sqlite3_prepare $DB {SELECT hex16(?)} -1 DUMMY]
+ set sqlite_static_bind_value {0123456789}
+ set sqlite_static_bind_nbyte 5
+ sqlite_bind $STMT 1 {} static-nbytes
+ sqlite3_step $STMT
+ } SQLITE_ROW
+ do_test misc6-1.4 {
+ sqlite3_column_text $STMT 0
+ } {00300031003200330034}
+}
sqlite3_finalize $STMT
finish_test
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/quote.test new/sqlite-3.3.17/test/quote.test
--- old/sqlite-3.3.16/test/quote.test 2007-03-27 16:43:06.000000000 +0200
+++ new/sqlite-3.3.17/test/quote.test 2007-04-25 13:32:30.000000000 +0200
@@ -12,7 +12,7 @@
# focus of this file is the ability to specify table and column names
# as quoted strings.
#
-# $Id: quote.test,v 1.6 2005/11/01 15:48:25 drh Exp $
+# $Id: quote.test,v 1.7 2007/04/25 11:32:30 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -57,7 +57,7 @@
SELECT [!pqr], `#xyz`+5 FROM '@abc'
}
} {0 {hello 10}}
-do_test quote-1.3 {
+do_test quote-1.3.4 {
set r [catch {
execsql {SELECT '@abc'.'!pqr', '@abc'.'#xyz'+5 FROM '@abc'}
} msg ]
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/rdonly.test new/sqlite-3.3.17/test/rdonly.test
--- old/sqlite-3.3.16/test/rdonly.test 1970-01-01 01:00:00.000000000 +0100
+++ new/sqlite-3.3.17/test/rdonly.test 2007-04-24 19:27:52.000000000 +0200
@@ -0,0 +1,65 @@
+# 2007 April 24
+#
+# 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.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+# This file implements tests to make sure SQLite treats a database
+# as readonly if its write version is set to high.
+#
+# $Id: rdonly.test,v 1.1 2007/04/24 17:27:52 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+
+# Create a database.
+#
+do_test rdonly-1.1 {
+ execsql {
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES(1);
+ SELECT * FROM t1;
+ }
+} {1}
+
+# Changes the write version from 1 to 2. Verify that the database
+# can be read but not written.
+#
+do_test rdonly-1.2 {
+ db close
+ hexio_get_int [hexio_read test.db 18 1]
+} 1
+do_test rdonly-1.3 {
+ hexio_write test.db 18 02
+ sqlite3 db test.db
+ execsql {
+ SELECT * FROM t1;
+ }
+} {1}
+do_test rdonly-1.4 {
+ catchsql {
+ INSERT INTO t1 VALUES(2)
+ }
+} {1 {attempt to write a readonly database}}
+
+# Change the write version back to 1. Verify that the database
+# is read-write again.
+#
+do_test rdonly-1.5 {
+ db close
+ hexio_write test.db 18 01
+ sqlite3 db test.db
+ catchsql {
+ INSERT INTO t1 VALUES(2);
+ SELECT * FROM t1;
+ }
+} {0 {1 2}}
+
+finish_test
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/rowid.test new/sqlite-3.3.17/test/rowid.test
--- old/sqlite-3.3.16/test/rowid.test 2007-03-27 16:43:06.000000000 +0200
+++ new/sqlite-3.3.17/test/rowid.test 2007-04-25 13:32:30.000000000 +0200
@@ -12,7 +12,7 @@
# focus of this file is testing the magic ROWID column that is
# found on all tables.
#
-# $Id: rowid.test,v 1.18 2005/01/21 03:12:16 danielk1977 Exp $
+# $Id: rowid.test,v 1.19 2007/04/25 11:32:30 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -80,7 +80,7 @@
set v2 [list 1 $x2rowid(1) 3 $x2rowid(3)]
expr {$v==$v2}
} {1}
-do_test rowid-1.9 {
+do_test rowid-1.10 {
global x2rowid
set v [execsql {SELECT x, _rowid_ FROM t1 order by x}]
set v2 [list 1 $x2rowid(1) 3 $x2rowid(3)]
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/tester.tcl new/sqlite-3.3.17/test/tester.tcl
--- old/sqlite-3.3.16/test/tester.tcl 2007-04-16 18:34:56.000000000 +0200
+++ new/sqlite-3.3.17/test/tester.tcl 2007-04-19 14:30:54.000000000 +0200
@@ -11,7 +11,7 @@
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
-# $Id: tester.tcl,v 1.78 2007/04/13 03:23:21 drh Exp $
+# $Id: tester.tcl,v 1.79 2007/04/19 12:30:54 drh Exp $
# Make sure tclsqlite3 was compiled correctly. Abort now with an
# error message if not.
@@ -453,26 +453,33 @@
# a result of the script, the Nth will fail.
do_test $testname.$n.3 {
set r [catch $::ioerrorbody msg]
- # puts rc=[sqlite3_errcode $::DB]
set rc [sqlite3_errcode $::DB]
if {$::ioerropts(-erc)} {
- # In extended result mode, all IOERRs are qualified
+ # If we are in extended result code mode, make sure all of the
+ # IOERRs we get back really do have their extended code values.
+ # If an extended result code is returned, the sqlite3_errcode
+ # TCLcommand will return a string of the form: SQLITE_IOERR+nnnn
+ # where nnnn is a number
if {[regexp {^SQLITE_IOERR} $rc] && ![regexp {IOERR\+\d} $rc]} {
return $rc
}
} else {
- # Not in extended result mode, no errors are qualified
+ # If we are not in extended result code mode, make sure no
+ # extended error codes are returned.
if {[regexp {\+\d} $rc]} {
return $rc
}
}
+ # The test repeats as long as $::go is true.
set ::go [expr {$::sqlite_io_error_pending<=0}]
set s [expr $::sqlite_io_error_hit==0]
set ::sqlite_io_error_hit 0
- # puts "$::sqlite_io_error_pending $r $msg"
- # puts "r=$r s=$s go=$::go msg=\"$msg\""
+
+ # One of two things must have happened. either
+ # 1. We never hit the IO error and the SQL returned OK
+ # 2. An IO error was hit and the SQL failed
+ #
expr { ($s && !$r && !$::go) || (!$s && $r && $::go) }
- # expr {$::sqlite_io_error_pending>0 || $r!=0}
} {1}
# If an IO error occured, then the checksum of the database should
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/test/vtab_err.test new/sqlite-3.3.17/test/vtab_err.test
--- old/sqlite-3.3.16/test/vtab_err.test 2007-01-02 19:41:58.000000000 +0100
+++ new/sqlite-3.3.17/test/vtab_err.test 2007-04-24 01:07:30.000000000 +0200
@@ -9,7 +9,7 @@
#
#***********************************************************************
#
-# $Id: vtab_err.test,v 1.4 2007/01/02 18:41:58 drh Exp $
+# $Id: vtab_err.test,v 1.5 2007/04/19 11:09:02 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -146,7 +146,6 @@
COMMIT;
}
-
do_malloc_test vtab_err-2 -tclprep {
register_echo_module [sqlite3_connection_pointer db]
} -sqlbody {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/VERSION new/sqlite-3.3.17/VERSION
--- old/sqlite-3.3.16/VERSION 2007-04-18 15:12:06.000000000 +0200
+++ new/sqlite-3.3.17/VERSION 2007-04-25 13:34:16.000000000 +0200
@@ -1 +1 @@
-3.3.16
+3.3.17
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/www/changes.tcl new/sqlite-3.3.17/www/changes.tcl
--- old/sqlite-3.3.16/www/changes.tcl 2007-04-18 15:19:11.000000000 +0200
+++ new/sqlite-3.3.17/www/changes.tcl 2007-04-25 13:34:05.000000000 +0200
@@ -25,6 +25,13 @@
puts "<DD><P><UL>$desc</UL></P></DD>"
}
+chng {2007 April 25 (3.3.17)} {
+<li>When the "write_version" value of the database header is larger than
+ what the library understands, make the database read-only instead of
+ unreadable.</li>
+<li>Other minor bug fixes</li>
+}
+
chng {2007 April 18 (3.3.16)} {
<li>Fix a bug that caused VACUUM to fail if NULLs appeared in a
UNIQUE column.</li>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sqlite-3.3.16/www/index.tcl new/sqlite-3.3.17/www/index.tcl
--- old/sqlite-3.3.16/www/index.tcl 2007-04-18 15:49:37.000000000 +0200
+++ new/sqlite-3.3.17/www/index.tcl 2007-04-25 13:42:33.000000000 +0200
@@ -73,6 +73,14 @@
puts "
"
}
+newsitem {2007-Apr-25} {Version 3.3.17} {
+ This version fixes a bug in the forwards-compatibility logic of SQLite
+ that was causing a database to become unreadable when it should have
+ been read-only. Upgrade from 3.3.16 only if you plan to deploy into
+ a product that might need to be upgraded in the future. For day to day
+ use, it probably does not matter.
+}
+
newsitem {2007-Apr-18} {Version 3.3.16} {
Performance improvements added in 3.3.14 but mistakenly turned off
in 3.3.15 have been reinstated. A bug has been fixed that prevented
@@ -114,4 +122,4 @@
<p align="right"><a href="oldnews.html">Old news...</a></p>
</td></tr></table>
}
-footer {$Id: index.tcl,v 1.153 2007/04/18 13:49:37 drh Exp $}
+footer {$Id: index.tcl,v 1.154 2007/04/25 11:42:33 drh Exp $}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org