Fossil SCM

Update the built-in Fossil to a newer 3.44.0 alpha that fixes the 8-byte alignment problem with duplicated Expr objects, as well as other minor fixes.

drh 2023-10-22 23:46 trunk
Commit 128e503031db9c4692090b0428bed84526946494bedc573f9bbdf8a870b09551
2 files changed +12 -9 +1 -1
+12 -9
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** 23a9dbe83c0042e9d500e3ae6c0592a4689.
21
+** 78a9728dc6b88d8ef924c86603056df1820.
2222
*/
2323
#define SQLITE_CORE 1
2424
#define SQLITE_AMALGAMATION 1
2525
#ifndef SQLITE_PRIVATE
2626
# define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459459
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460460
** [sqlite_version()] and [sqlite_source_id()].
461461
*/
462462
#define SQLITE_VERSION "3.44.0"
463463
#define SQLITE_VERSION_NUMBER 3044000
464
-#define SQLITE_SOURCE_ID "2023-10-21 20:34:57 023a9dbe83c0042e9d500e3ae6c0592a468982e4ac278d08c9201967506c7555"
464
+#define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
465465
466466
/*
467467
** CAPI3REF: Run-Time Library Version Numbers
468468
** KEYWORDS: sqlite3_version sqlite3_sourceid
469469
**
@@ -109403,10 +109403,11 @@
109403109403
int nByte;
109404109404
assert( p!=0 );
109405109405
nByte = dupedExprNodeSize(p, EXPRDUP_REDUCE);
109406109406
if( p->pLeft ) nByte += dupedExprSize(p->pLeft);
109407109407
if( p->pRight ) nByte += dupedExprSize(p->pRight);
109408
+ assert( nByte==ROUND8(nByte) );
109408109409
return nByte;
109409109410
}
109410109411
109411109412
/*
109412109413
** An EdupBuf is a memory allocation used to stored multiple Expr objects
@@ -109459,32 +109460,34 @@
109459109460
int nAlloc;
109460109461
if( dupFlags ){
109461109462
nAlloc = dupedExprSize(p);
109462109463
}else if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109463109464
nToken = sqlite3Strlen30NN(p->u.zToken)+1;
109464
- nAlloc = EXPR_FULLSIZE + nToken;
109465
+ nAlloc = EXPR_FULLSIZE + ROUND8(nToken);
109465109466
}else{
109466109467
nToken = 0;
109467109468
nAlloc = EXPR_FULLSIZE;
109468109469
}
109470
+ assert( nAlloc==ROUND8(nAlloc) );
109469109471
sEdupBuf.zAlloc = sqlite3DbMallocRawNN(db, nAlloc);
109470109472
#ifdef SQLITE_DEBUG
109471109473
sEdupBuf.zEnd = sEdupBuf.zAlloc ? sEdupBuf.zAlloc+nAlloc : 0;
109472109474
#endif
109473109475
109474109476
staticFlag = 0;
109475109477
}
109476109478
pNew = (Expr *)sEdupBuf.zAlloc;
109479
+ assert( EIGHT_BYTE_ALIGNMENT(pNew) );
109477109480
109478109481
if( pNew ){
109479109482
/* Set nNewSize to the size allocated for the structure pointed to
109480109483
** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or
109481109484
** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed
109482109485
** by the copy of the p->u.zToken string (if any).
109483109486
*/
109484109487
const unsigned nStructSize = dupedExprStructSize(p, dupFlags);
109485
- const int nNewSize = nStructSize & 0xfff;
109488
+ int nNewSize = nStructSize & 0xfff;
109486109489
if( nToken<0 ){
109487109490
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109488109491
nToken = sqlite3Strlen30(p->u.zToken) + 1;
109489109492
}else{
109490109493
nToken = 0;
@@ -109492,19 +109495,18 @@
109492109495
}
109493109496
if( dupFlags ){
109494109497
assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= nNewSize+nToken );
109495109498
assert( ExprHasProperty(p, EP_Reduced)==0 );
109496109499
memcpy(sEdupBuf.zAlloc, p, nNewSize);
109497
- sEdupBuf.zAlloc += nNewSize;
109498109500
}else{
109499109501
u32 nSize = (u32)exprStructSize(p);
109500109502
assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= EXPR_FULLSIZE+nToken );
109501109503
memcpy(sEdupBuf.zAlloc, p, nSize);
109502109504
if( nSize<EXPR_FULLSIZE ){
109503109505
memset(&sEdupBuf.zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
109504109506
}
109505
- sEdupBuf.zAlloc += EXPR_FULLSIZE;
109507
+ nNewSize = EXPR_FULLSIZE;
109506109508
}
109507109509
109508109510
/* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */
109509109511
pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static);
109510109512
pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
@@ -109515,14 +109517,15 @@
109515109517
}
109516109518
109517109519
/* Copy the p->u.zToken string, if any. */
109518109520
assert( nToken>=0 );
109519109521
if( nToken>0 ){
109520
- char *zToken = pNew->u.zToken = (char*)sEdupBuf.zAlloc;
109522
+ char *zToken = pNew->u.zToken = (char*)&sEdupBuf.zAlloc[nNewSize];
109521109523
memcpy(zToken, p->u.zToken, nToken);
109522
- sEdupBuf.zAlloc += nToken;
109524
+ nNewSize += nToken;
109523109525
}
109526
+ sEdupBuf.zAlloc += ROUND8(nNewSize);
109524109527
109525109528
if( ((p->flags|pNew->flags)&(EP_TokenOnly|EP_Leaf))==0 ){
109526109529
109527109530
/* Fill in the pNew->x.pSelect or pNew->x.pList member. */
109528109531
if( ExprUseXSelect(p) ){
@@ -247417,11 +247420,11 @@
247417247420
int nArg, /* Number of args */
247418247421
sqlite3_value **apUnused /* Function arguments */
247419247422
){
247420247423
assert( nArg==0 );
247421247424
UNUSED_PARAM2(nArg, apUnused);
247422
- sqlite3_result_text(pCtx, "fts5: 2023-10-21 18:12:07 7f41d7006db4225cf9b3d197d3a76842778669ac079e76361214a8023c9976e6", -1, SQLITE_TRANSIENT);
247425
+ sqlite3_result_text(pCtx, "fts5: 2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2", -1, SQLITE_TRANSIENT);
247423247426
}
247424247427
247425247428
/*
247426247429
** Return true if zName is the extension on one of the shadow tables used
247427247430
** by this module.
247428247431
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** 23a9dbe83c0042e9d500e3ae6c0592a4689.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.44.0"
463 #define SQLITE_VERSION_NUMBER 3044000
464 #define SQLITE_SOURCE_ID "2023-10-21 20:34:57 023a9dbe83c0042e9d500e3ae6c0592a468982e4ac278d08c9201967506c7555"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -109403,10 +109403,11 @@
109403 int nByte;
109404 assert( p!=0 );
109405 nByte = dupedExprNodeSize(p, EXPRDUP_REDUCE);
109406 if( p->pLeft ) nByte += dupedExprSize(p->pLeft);
109407 if( p->pRight ) nByte += dupedExprSize(p->pRight);
 
109408 return nByte;
109409 }
109410
109411 /*
109412 ** An EdupBuf is a memory allocation used to stored multiple Expr objects
@@ -109459,32 +109460,34 @@
109459 int nAlloc;
109460 if( dupFlags ){
109461 nAlloc = dupedExprSize(p);
109462 }else if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109463 nToken = sqlite3Strlen30NN(p->u.zToken)+1;
109464 nAlloc = EXPR_FULLSIZE + nToken;
109465 }else{
109466 nToken = 0;
109467 nAlloc = EXPR_FULLSIZE;
109468 }
 
109469 sEdupBuf.zAlloc = sqlite3DbMallocRawNN(db, nAlloc);
109470 #ifdef SQLITE_DEBUG
109471 sEdupBuf.zEnd = sEdupBuf.zAlloc ? sEdupBuf.zAlloc+nAlloc : 0;
109472 #endif
109473
109474 staticFlag = 0;
109475 }
109476 pNew = (Expr *)sEdupBuf.zAlloc;
 
109477
109478 if( pNew ){
109479 /* Set nNewSize to the size allocated for the structure pointed to
109480 ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or
109481 ** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed
109482 ** by the copy of the p->u.zToken string (if any).
109483 */
109484 const unsigned nStructSize = dupedExprStructSize(p, dupFlags);
109485 const int nNewSize = nStructSize & 0xfff;
109486 if( nToken<0 ){
109487 if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109488 nToken = sqlite3Strlen30(p->u.zToken) + 1;
109489 }else{
109490 nToken = 0;
@@ -109492,19 +109495,18 @@
109492 }
109493 if( dupFlags ){
109494 assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= nNewSize+nToken );
109495 assert( ExprHasProperty(p, EP_Reduced)==0 );
109496 memcpy(sEdupBuf.zAlloc, p, nNewSize);
109497 sEdupBuf.zAlloc += nNewSize;
109498 }else{
109499 u32 nSize = (u32)exprStructSize(p);
109500 assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= EXPR_FULLSIZE+nToken );
109501 memcpy(sEdupBuf.zAlloc, p, nSize);
109502 if( nSize<EXPR_FULLSIZE ){
109503 memset(&sEdupBuf.zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
109504 }
109505 sEdupBuf.zAlloc += EXPR_FULLSIZE;
109506 }
109507
109508 /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */
109509 pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static);
109510 pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
@@ -109515,14 +109517,15 @@
109515 }
109516
109517 /* Copy the p->u.zToken string, if any. */
109518 assert( nToken>=0 );
109519 if( nToken>0 ){
109520 char *zToken = pNew->u.zToken = (char*)sEdupBuf.zAlloc;
109521 memcpy(zToken, p->u.zToken, nToken);
109522 sEdupBuf.zAlloc += nToken;
109523 }
 
109524
109525 if( ((p->flags|pNew->flags)&(EP_TokenOnly|EP_Leaf))==0 ){
109526
109527 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
109528 if( ExprUseXSelect(p) ){
@@ -247417,11 +247420,11 @@
247417 int nArg, /* Number of args */
247418 sqlite3_value **apUnused /* Function arguments */
247419 ){
247420 assert( nArg==0 );
247421 UNUSED_PARAM2(nArg, apUnused);
247422 sqlite3_result_text(pCtx, "fts5: 2023-10-21 18:12:07 7f41d7006db4225cf9b3d197d3a76842778669ac079e76361214a8023c9976e6", -1, SQLITE_TRANSIENT);
247423 }
247424
247425 /*
247426 ** Return true if zName is the extension on one of the shadow tables used
247427 ** by this module.
247428
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** 78a9728dc6b88d8ef924c86603056df1820.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.44.0"
463 #define SQLITE_VERSION_NUMBER 3044000
464 #define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -109403,10 +109403,11 @@
109403 int nByte;
109404 assert( p!=0 );
109405 nByte = dupedExprNodeSize(p, EXPRDUP_REDUCE);
109406 if( p->pLeft ) nByte += dupedExprSize(p->pLeft);
109407 if( p->pRight ) nByte += dupedExprSize(p->pRight);
109408 assert( nByte==ROUND8(nByte) );
109409 return nByte;
109410 }
109411
109412 /*
109413 ** An EdupBuf is a memory allocation used to stored multiple Expr objects
@@ -109459,32 +109460,34 @@
109460 int nAlloc;
109461 if( dupFlags ){
109462 nAlloc = dupedExprSize(p);
109463 }else if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109464 nToken = sqlite3Strlen30NN(p->u.zToken)+1;
109465 nAlloc = EXPR_FULLSIZE + ROUND8(nToken);
109466 }else{
109467 nToken = 0;
109468 nAlloc = EXPR_FULLSIZE;
109469 }
109470 assert( nAlloc==ROUND8(nAlloc) );
109471 sEdupBuf.zAlloc = sqlite3DbMallocRawNN(db, nAlloc);
109472 #ifdef SQLITE_DEBUG
109473 sEdupBuf.zEnd = sEdupBuf.zAlloc ? sEdupBuf.zAlloc+nAlloc : 0;
109474 #endif
109475
109476 staticFlag = 0;
109477 }
109478 pNew = (Expr *)sEdupBuf.zAlloc;
109479 assert( EIGHT_BYTE_ALIGNMENT(pNew) );
109480
109481 if( pNew ){
109482 /* Set nNewSize to the size allocated for the structure pointed to
109483 ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or
109484 ** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed
109485 ** by the copy of the p->u.zToken string (if any).
109486 */
109487 const unsigned nStructSize = dupedExprStructSize(p, dupFlags);
109488 int nNewSize = nStructSize & 0xfff;
109489 if( nToken<0 ){
109490 if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
109491 nToken = sqlite3Strlen30(p->u.zToken) + 1;
109492 }else{
109493 nToken = 0;
@@ -109492,19 +109495,18 @@
109495 }
109496 if( dupFlags ){
109497 assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= nNewSize+nToken );
109498 assert( ExprHasProperty(p, EP_Reduced)==0 );
109499 memcpy(sEdupBuf.zAlloc, p, nNewSize);
 
109500 }else{
109501 u32 nSize = (u32)exprStructSize(p);
109502 assert( (int)(sEdupBuf.zEnd - sEdupBuf.zAlloc) >= EXPR_FULLSIZE+nToken );
109503 memcpy(sEdupBuf.zAlloc, p, nSize);
109504 if( nSize<EXPR_FULLSIZE ){
109505 memset(&sEdupBuf.zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
109506 }
109507 nNewSize = EXPR_FULLSIZE;
109508 }
109509
109510 /* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */
109511 pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static);
109512 pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
@@ -109515,14 +109517,15 @@
109517 }
109518
109519 /* Copy the p->u.zToken string, if any. */
109520 assert( nToken>=0 );
109521 if( nToken>0 ){
109522 char *zToken = pNew->u.zToken = (char*)&sEdupBuf.zAlloc[nNewSize];
109523 memcpy(zToken, p->u.zToken, nToken);
109524 nNewSize += nToken;
109525 }
109526 sEdupBuf.zAlloc += ROUND8(nNewSize);
109527
109528 if( ((p->flags|pNew->flags)&(EP_TokenOnly|EP_Leaf))==0 ){
109529
109530 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
109531 if( ExprUseXSelect(p) ){
@@ -247417,11 +247420,11 @@
247420 int nArg, /* Number of args */
247421 sqlite3_value **apUnused /* Function arguments */
247422 ){
247423 assert( nArg==0 );
247424 UNUSED_PARAM2(nArg, apUnused);
247425 sqlite3_result_text(pCtx, "fts5: 2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2", -1, SQLITE_TRANSIENT);
247426 }
247427
247428 /*
247429 ** Return true if zName is the extension on one of the shadow tables used
247430 ** by this module.
247431
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.44.0"
150150
#define SQLITE_VERSION_NUMBER 3044000
151
-#define SQLITE_SOURCE_ID "2023-10-21 20:34:57 023a9dbe83c0042e9d500e3ae6c0592a468982e4ac278d08c9201967506c7555"
151
+#define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.44.0"
150 #define SQLITE_VERSION_NUMBER 3044000
151 #define SQLITE_SOURCE_ID "2023-10-21 20:34:57 023a9dbe83c0042e9d500e3ae6c0592a468982e4ac278d08c9201967506c7555"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.44.0"
150 #define SQLITE_VERSION_NUMBER 3044000
151 #define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

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