Fossil SCM

Update the built-in SQLite to version 3.8.9.

drh 2015-04-08 12:49 trunk
Commit 15e669399f29eac457e6222c78c3bed133ca5283
2 files changed +24 -10 +1 -1
+24 -10
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -317,11 +317,11 @@
317317
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
318318
** [sqlite_version()] and [sqlite_source_id()].
319319
*/
320320
#define SQLITE_VERSION "3.8.9"
321321
#define SQLITE_VERSION_NUMBER 3008009
322
-#define SQLITE_SOURCE_ID "2015-04-06 11:04:51 3ad829e50faca538db3abb2afb898b5521550c5c"
322
+#define SQLITE_SOURCE_ID "2015-04-08 12:16:33 8a8ffc862e96f57aa698f93de10dee28e69f6e09"
323323
324324
/*
325325
** CAPI3REF: Run-Time Library Version Numbers
326326
** KEYWORDS: sqlite3_version, sqlite3_sourceid
327327
**
@@ -21524,19 +21524,23 @@
2152421524
}else{
2152521525
width = va_arg(ap,int);
2152621526
}
2152721527
if( width<0 ){
2152821528
flag_leftjustify = 1;
21529
- width = -width;
21529
+ width = width >= -2147483647 ? -width : 0;
2153021530
}
2153121531
c = *++fmt;
2153221532
}else{
21533
+ unsigned wx = 0;
2153321534
while( c>='0' && c<='9' ){
21534
- width = width*10 + c - '0';
21535
+ wx = wx*10 + c - '0';
2153521536
c = *++fmt;
2153621537
}
21538
+ testcase( wx>0x7fffffff );
21539
+ width = wx & 0x7fffffff;
2153721540
}
21541
+
2153821542
/* Get the precision */
2153921543
if( c=='.' ){
2154021544
precision = 0;
2154121545
c = *++fmt;
2154221546
if( c=='*' ){
@@ -21543,17 +21547,22 @@
2154321547
if( bArgList ){
2154421548
precision = (int)getIntArg(pArgList);
2154521549
}else{
2154621550
precision = va_arg(ap,int);
2154721551
}
21548
- if( precision<0 ) precision = -precision;
2154921552
c = *++fmt;
21553
+ if( precision<0 ){
21554
+ precision = precision >= -2147483647 ? -precision : -1;
21555
+ }
2155021556
}else{
21557
+ unsigned px = 0;
2155121558
while( c>='0' && c<='9' ){
21552
- precision = precision*10 + c - '0';
21559
+ px = px*10 + c - '0';
2155321560
c = *++fmt;
2155421561
}
21562
+ testcase( px>0x7fffffff );
21563
+ precision = px & 0x7fffffff;
2155521564
}
2155621565
}else{
2155721566
precision = -1;
2155821567
}
2155921568
/* Get the conversion type modifier */
@@ -21713,11 +21722,12 @@
2171321722
if( flag_plussign ) prefix = '+';
2171421723
else if( flag_blanksign ) prefix = ' ';
2171521724
else prefix = 0;
2171621725
}
2171721726
if( xtype==etGENERIC && precision>0 ) precision--;
21718
- for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}
21727
+ testcase( precision>0xfff );
21728
+ for(idx=precision&0xfff, rounder=0.5; idx>0; idx--, rounder*=0.1){}
2171921729
if( xtype==etFLOAT ) realvalue += rounder;
2172021730
/* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
2172121731
exp = 0;
2172221732
if( sqlite3IsNaN((double)realvalue) ){
2172321733
bufpt = "NaN";
@@ -21768,12 +21778,13 @@
2176821778
if( xtype==etEXP ){
2176921779
e2 = 0;
2177021780
}else{
2177121781
e2 = exp;
2177221782
}
21773
- if( MAX(e2,0)+precision+width > etBUFSIZE - 15 ){
21774
- bufpt = zExtra = sqlite3Malloc( MAX(e2,0)+precision+width+15 );
21783
+ if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){
21784
+ bufpt = zExtra
21785
+ = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 );
2177521786
if( bufpt==0 ){
2177621787
setStrAccumError(pAccum, STRACCUM_NOMEM);
2177721788
return;
2177821789
}
2177921790
}
@@ -22001,11 +22012,11 @@
2200122012
** Return the number of bytes of text that StrAccum is able to accept
2200222013
** after the attempted enlargement. The value returned might be zero.
2200322014
*/
2200422015
static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
2200522016
char *zNew;
22006
- assert( p->nChar+N >= p->nAlloc ); /* Only called if really needed */
22017
+ assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
2200722018
if( p->accError ){
2200822019
testcase(p->accError==STRACCUM_TOOBIG);
2200922020
testcase(p->accError==STRACCUM_NOMEM);
2201022021
return 0;
2201122022
}
@@ -22050,11 +22061,14 @@
2205022061
2205122062
/*
2205222063
** Append N copies of character c to the given string buffer.
2205322064
*/
2205422065
SQLITE_PRIVATE void sqlite3AppendChar(StrAccum *p, int N, char c){
22055
- if( p->nChar+N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ) return;
22066
+ testcase( p->nChar + (i64)N > 0x7fffffff );
22067
+ if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
22068
+ return;
22069
+ }
2205622070
while( (N--)>0 ) p->zText[p->nChar++] = c;
2205722071
}
2205822072
2205922073
/*
2206022074
** The StrAccum "p" is not large enough to accept N new bytes of z[].
2206122075
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -317,11 +317,11 @@
317 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
318 ** [sqlite_version()] and [sqlite_source_id()].
319 */
320 #define SQLITE_VERSION "3.8.9"
321 #define SQLITE_VERSION_NUMBER 3008009
322 #define SQLITE_SOURCE_ID "2015-04-06 11:04:51 3ad829e50faca538db3abb2afb898b5521550c5c"
323
324 /*
325 ** CAPI3REF: Run-Time Library Version Numbers
326 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
327 **
@@ -21524,19 +21524,23 @@
21524 }else{
21525 width = va_arg(ap,int);
21526 }
21527 if( width<0 ){
21528 flag_leftjustify = 1;
21529 width = -width;
21530 }
21531 c = *++fmt;
21532 }else{
 
21533 while( c>='0' && c<='9' ){
21534 width = width*10 + c - '0';
21535 c = *++fmt;
21536 }
 
 
21537 }
 
21538 /* Get the precision */
21539 if( c=='.' ){
21540 precision = 0;
21541 c = *++fmt;
21542 if( c=='*' ){
@@ -21543,17 +21547,22 @@
21543 if( bArgList ){
21544 precision = (int)getIntArg(pArgList);
21545 }else{
21546 precision = va_arg(ap,int);
21547 }
21548 if( precision<0 ) precision = -precision;
21549 c = *++fmt;
 
 
 
21550 }else{
 
21551 while( c>='0' && c<='9' ){
21552 precision = precision*10 + c - '0';
21553 c = *++fmt;
21554 }
 
 
21555 }
21556 }else{
21557 precision = -1;
21558 }
21559 /* Get the conversion type modifier */
@@ -21713,11 +21722,12 @@
21713 if( flag_plussign ) prefix = '+';
21714 else if( flag_blanksign ) prefix = ' ';
21715 else prefix = 0;
21716 }
21717 if( xtype==etGENERIC && precision>0 ) precision--;
21718 for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}
 
21719 if( xtype==etFLOAT ) realvalue += rounder;
21720 /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
21721 exp = 0;
21722 if( sqlite3IsNaN((double)realvalue) ){
21723 bufpt = "NaN";
@@ -21768,12 +21778,13 @@
21768 if( xtype==etEXP ){
21769 e2 = 0;
21770 }else{
21771 e2 = exp;
21772 }
21773 if( MAX(e2,0)+precision+width > etBUFSIZE - 15 ){
21774 bufpt = zExtra = sqlite3Malloc( MAX(e2,0)+precision+width+15 );
 
21775 if( bufpt==0 ){
21776 setStrAccumError(pAccum, STRACCUM_NOMEM);
21777 return;
21778 }
21779 }
@@ -22001,11 +22012,11 @@
22001 ** Return the number of bytes of text that StrAccum is able to accept
22002 ** after the attempted enlargement. The value returned might be zero.
22003 */
22004 static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
22005 char *zNew;
22006 assert( p->nChar+N >= p->nAlloc ); /* Only called if really needed */
22007 if( p->accError ){
22008 testcase(p->accError==STRACCUM_TOOBIG);
22009 testcase(p->accError==STRACCUM_NOMEM);
22010 return 0;
22011 }
@@ -22050,11 +22061,14 @@
22050
22051 /*
22052 ** Append N copies of character c to the given string buffer.
22053 */
22054 SQLITE_PRIVATE void sqlite3AppendChar(StrAccum *p, int N, char c){
22055 if( p->nChar+N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ) return;
 
 
 
22056 while( (N--)>0 ) p->zText[p->nChar++] = c;
22057 }
22058
22059 /*
22060 ** The StrAccum "p" is not large enough to accept N new bytes of z[].
22061
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -317,11 +317,11 @@
317 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
318 ** [sqlite_version()] and [sqlite_source_id()].
319 */
320 #define SQLITE_VERSION "3.8.9"
321 #define SQLITE_VERSION_NUMBER 3008009
322 #define SQLITE_SOURCE_ID "2015-04-08 12:16:33 8a8ffc862e96f57aa698f93de10dee28e69f6e09"
323
324 /*
325 ** CAPI3REF: Run-Time Library Version Numbers
326 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
327 **
@@ -21524,19 +21524,23 @@
21524 }else{
21525 width = va_arg(ap,int);
21526 }
21527 if( width<0 ){
21528 flag_leftjustify = 1;
21529 width = width >= -2147483647 ? -width : 0;
21530 }
21531 c = *++fmt;
21532 }else{
21533 unsigned wx = 0;
21534 while( c>='0' && c<='9' ){
21535 wx = wx*10 + c - '0';
21536 c = *++fmt;
21537 }
21538 testcase( wx>0x7fffffff );
21539 width = wx & 0x7fffffff;
21540 }
21541
21542 /* Get the precision */
21543 if( c=='.' ){
21544 precision = 0;
21545 c = *++fmt;
21546 if( c=='*' ){
@@ -21543,17 +21547,22 @@
21547 if( bArgList ){
21548 precision = (int)getIntArg(pArgList);
21549 }else{
21550 precision = va_arg(ap,int);
21551 }
 
21552 c = *++fmt;
21553 if( precision<0 ){
21554 precision = precision >= -2147483647 ? -precision : -1;
21555 }
21556 }else{
21557 unsigned px = 0;
21558 while( c>='0' && c<='9' ){
21559 px = px*10 + c - '0';
21560 c = *++fmt;
21561 }
21562 testcase( px>0x7fffffff );
21563 precision = px & 0x7fffffff;
21564 }
21565 }else{
21566 precision = -1;
21567 }
21568 /* Get the conversion type modifier */
@@ -21713,11 +21722,12 @@
21722 if( flag_plussign ) prefix = '+';
21723 else if( flag_blanksign ) prefix = ' ';
21724 else prefix = 0;
21725 }
21726 if( xtype==etGENERIC && precision>0 ) precision--;
21727 testcase( precision>0xfff );
21728 for(idx=precision&0xfff, rounder=0.5; idx>0; idx--, rounder*=0.1){}
21729 if( xtype==etFLOAT ) realvalue += rounder;
21730 /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
21731 exp = 0;
21732 if( sqlite3IsNaN((double)realvalue) ){
21733 bufpt = "NaN";
@@ -21768,12 +21778,13 @@
21778 if( xtype==etEXP ){
21779 e2 = 0;
21780 }else{
21781 e2 = exp;
21782 }
21783 if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){
21784 bufpt = zExtra
21785 = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 );
21786 if( bufpt==0 ){
21787 setStrAccumError(pAccum, STRACCUM_NOMEM);
21788 return;
21789 }
21790 }
@@ -22001,11 +22012,11 @@
22012 ** Return the number of bytes of text that StrAccum is able to accept
22013 ** after the attempted enlargement. The value returned might be zero.
22014 */
22015 static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
22016 char *zNew;
22017 assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
22018 if( p->accError ){
22019 testcase(p->accError==STRACCUM_TOOBIG);
22020 testcase(p->accError==STRACCUM_NOMEM);
22021 return 0;
22022 }
@@ -22050,11 +22061,14 @@
22061
22062 /*
22063 ** Append N copies of character c to the given string buffer.
22064 */
22065 SQLITE_PRIVATE void sqlite3AppendChar(StrAccum *p, int N, char c){
22066 testcase( p->nChar + (i64)N > 0x7fffffff );
22067 if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
22068 return;
22069 }
22070 while( (N--)>0 ) p->zText[p->nChar++] = c;
22071 }
22072
22073 /*
22074 ** The StrAccum "p" is not large enough to accept N new bytes of z[].
22075
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -111,11 +111,11 @@
111111
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112112
** [sqlite_version()] and [sqlite_source_id()].
113113
*/
114114
#define SQLITE_VERSION "3.8.9"
115115
#define SQLITE_VERSION_NUMBER 3008009
116
-#define SQLITE_SOURCE_ID "2015-04-06 11:04:51 3ad829e50faca538db3abb2afb898b5521550c5c"
116
+#define SQLITE_SOURCE_ID "2015-04-08 12:16:33 8a8ffc862e96f57aa698f93de10dee28e69f6e09"
117117
118118
/*
119119
** CAPI3REF: Run-Time Library Version Numbers
120120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121121
**
122122
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -111,11 +111,11 @@
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.8.9"
115 #define SQLITE_VERSION_NUMBER 3008009
116 #define SQLITE_SOURCE_ID "2015-04-06 11:04:51 3ad829e50faca538db3abb2afb898b5521550c5c"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -111,11 +111,11 @@
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.8.9"
115 #define SQLITE_VERSION_NUMBER 3008009
116 #define SQLITE_SOURCE_ID "2015-04-08 12:16:33 8a8ffc862e96f57aa698f93de10dee28e69f6e09"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button