Fossil SCM

Update to a newer SQLite that fixes a bug in the SQLite CLI so that it will once again compile on 32-bit windows.

drh 2025-09-10 14:29 trunk
Commit fb8697872ba335827e71a55aa6c168bd2e2ba330cf032b04f4a019f86e090f34
+24 -2
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -653,18 +653,31 @@
653653
654654
/* Return the current wall-clock time in microseconds since the
655655
** Unix epoch (1970-01-01T00:00:00Z)
656656
*/
657657
static sqlite3_int64 timeOfDay(void){
658
-#if defined(_WIN32)
658
+#if defined(_WIN64)
659659
sqlite3_uint64 t;
660660
FILETIME tm;
661661
GetSystemTimePreciseAsFileTime(&tm);
662662
t = ((u64)tm.dwHighDateTime<<32) | (u64)tm.dwLowDateTime;
663663
t += 116444736000000000LL;
664664
t /= 10;
665665
return t;
666
+#elif defined(_WIN32)
667
+ static sqlite3_vfs *clockVfs = 0;
668
+ sqlite3_int64 t;
669
+ if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0);
670
+ if( clockVfs==0 ) return 0; /* Never actually happens */
671
+ if( clockVfs->iVersion>=2 && clockVfs->xCurrentTimeInt64!=0 ){
672
+ clockVfs->xCurrentTimeInt64(clockVfs, &t);
673
+ }else{
674
+ double r;
675
+ clockVfs->xCurrentTime(clockVfs, &r);
676
+ t = (sqlite3_int64)(r*86400000.0);
677
+ }
678
+ return t*1000;
666679
#else
667680
struct timeval sNow;
668681
(void)gettimeofday(&sNow,0);
669682
return ((i64)sNow.tv_sec)*1000000 + sNow.tv_usec;
670683
#endif
@@ -710,11 +723,11 @@
710723
static void endTimer(FILE *out){
711724
if( enableTimer ){
712725
sqlite3_int64 iEnd = timeOfDay();
713726
struct rusage sEnd;
714727
getrusage(RUSAGE_SELF, &sEnd);
715
- sqlite3_fprintf(out, "Run Time: real %.6f user %f sys %f\n",
728
+ sqlite3_fprintf(out, "Run Time: real %.6f user %.6f sys %.6f\n",
716729
(iEnd - iBegin)*0.000001,
717730
timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
718731
timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
719732
}
720733
}
@@ -789,14 +802,23 @@
789802
static void endTimer(FILE *out){
790803
if( enableTimer && getProcessTimesAddr){
791804
FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd;
792805
sqlite3_int64 ftWallEnd = timeOfDay();
793806
getProcessTimesAddr(hProcess,&ftCreation,&ftExit,&ftKernelEnd,&ftUserEnd);
807
+#ifdef _WIN64
808
+ /* microsecond precision on 64-bit windows */
794809
sqlite3_fprintf(out, "Run Time: real %.6f user %f sys %f\n",
795810
(ftWallEnd - ftWallBegin)*0.000001,
796811
timeDiff(&ftUserBegin, &ftUserEnd),
797812
timeDiff(&ftKernelBegin, &ftKernelEnd));
813
+#else
814
+ /* millisecond precisino on 32-bit windows */
815
+ sqlite3_fprintf(out, "Run Time: real %.3f user %.3f sys %.3f\n",
816
+ (ftWallEnd - ftWallBegin)*0.000001,
817
+ timeDiff(&ftUserBegin, &ftUserEnd),
818
+ timeDiff(&ftKernelBegin, &ftKernelEnd));
819
+#endif
798820
}
799821
}
800822
801823
#define BEGIN_TIMER beginTimer()
802824
#define END_TIMER(X) endTimer(X)
803825
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -653,18 +653,31 @@
653
654 /* Return the current wall-clock time in microseconds since the
655 ** Unix epoch (1970-01-01T00:00:00Z)
656 */
657 static sqlite3_int64 timeOfDay(void){
658 #if defined(_WIN32)
659 sqlite3_uint64 t;
660 FILETIME tm;
661 GetSystemTimePreciseAsFileTime(&tm);
662 t = ((u64)tm.dwHighDateTime<<32) | (u64)tm.dwLowDateTime;
663 t += 116444736000000000LL;
664 t /= 10;
665 return t;
 
 
 
 
 
 
 
 
 
 
 
 
 
666 #else
667 struct timeval sNow;
668 (void)gettimeofday(&sNow,0);
669 return ((i64)sNow.tv_sec)*1000000 + sNow.tv_usec;
670 #endif
@@ -710,11 +723,11 @@
710 static void endTimer(FILE *out){
711 if( enableTimer ){
712 sqlite3_int64 iEnd = timeOfDay();
713 struct rusage sEnd;
714 getrusage(RUSAGE_SELF, &sEnd);
715 sqlite3_fprintf(out, "Run Time: real %.6f user %f sys %f\n",
716 (iEnd - iBegin)*0.000001,
717 timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
718 timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
719 }
720 }
@@ -789,14 +802,23 @@
789 static void endTimer(FILE *out){
790 if( enableTimer && getProcessTimesAddr){
791 FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd;
792 sqlite3_int64 ftWallEnd = timeOfDay();
793 getProcessTimesAddr(hProcess,&ftCreation,&ftExit,&ftKernelEnd,&ftUserEnd);
 
 
794 sqlite3_fprintf(out, "Run Time: real %.6f user %f sys %f\n",
795 (ftWallEnd - ftWallBegin)*0.000001,
796 timeDiff(&ftUserBegin, &ftUserEnd),
797 timeDiff(&ftKernelBegin, &ftKernelEnd));
 
 
 
 
 
 
 
798 }
799 }
800
801 #define BEGIN_TIMER beginTimer()
802 #define END_TIMER(X) endTimer(X)
803
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -653,18 +653,31 @@
653
654 /* Return the current wall-clock time in microseconds since the
655 ** Unix epoch (1970-01-01T00:00:00Z)
656 */
657 static sqlite3_int64 timeOfDay(void){
658 #if defined(_WIN64)
659 sqlite3_uint64 t;
660 FILETIME tm;
661 GetSystemTimePreciseAsFileTime(&tm);
662 t = ((u64)tm.dwHighDateTime<<32) | (u64)tm.dwLowDateTime;
663 t += 116444736000000000LL;
664 t /= 10;
665 return t;
666 #elif defined(_WIN32)
667 static sqlite3_vfs *clockVfs = 0;
668 sqlite3_int64 t;
669 if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0);
670 if( clockVfs==0 ) return 0; /* Never actually happens */
671 if( clockVfs->iVersion>=2 && clockVfs->xCurrentTimeInt64!=0 ){
672 clockVfs->xCurrentTimeInt64(clockVfs, &t);
673 }else{
674 double r;
675 clockVfs->xCurrentTime(clockVfs, &r);
676 t = (sqlite3_int64)(r*86400000.0);
677 }
678 return t*1000;
679 #else
680 struct timeval sNow;
681 (void)gettimeofday(&sNow,0);
682 return ((i64)sNow.tv_sec)*1000000 + sNow.tv_usec;
683 #endif
@@ -710,11 +723,11 @@
723 static void endTimer(FILE *out){
724 if( enableTimer ){
725 sqlite3_int64 iEnd = timeOfDay();
726 struct rusage sEnd;
727 getrusage(RUSAGE_SELF, &sEnd);
728 sqlite3_fprintf(out, "Run Time: real %.6f user %.6f sys %.6f\n",
729 (iEnd - iBegin)*0.000001,
730 timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
731 timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
732 }
733 }
@@ -789,14 +802,23 @@
802 static void endTimer(FILE *out){
803 if( enableTimer && getProcessTimesAddr){
804 FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd;
805 sqlite3_int64 ftWallEnd = timeOfDay();
806 getProcessTimesAddr(hProcess,&ftCreation,&ftExit,&ftKernelEnd,&ftUserEnd);
807 #ifdef _WIN64
808 /* microsecond precision on 64-bit windows */
809 sqlite3_fprintf(out, "Run Time: real %.6f user %f sys %f\n",
810 (ftWallEnd - ftWallBegin)*0.000001,
811 timeDiff(&ftUserBegin, &ftUserEnd),
812 timeDiff(&ftKernelBegin, &ftKernelEnd));
813 #else
814 /* millisecond precisino on 32-bit windows */
815 sqlite3_fprintf(out, "Run Time: real %.3f user %.3f sys %.3f\n",
816 (ftWallEnd - ftWallBegin)*0.000001,
817 timeDiff(&ftUserBegin, &ftUserEnd),
818 timeDiff(&ftKernelBegin, &ftKernelEnd));
819 #endif
820 }
821 }
822
823 #define BEGIN_TIMER beginTimer()
824 #define END_TIMER(X) endTimer(X)
825
--- 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
-** 0f31711591c56f3896fb6f092752fb82c4ea with changes in files:
21
+** 61d9e204c5801a94811fdb0afe2c04f9814e with changes in files:
2222
**
2323
**
2424
*/
2525
#ifndef SQLITE_AMALGAMATION
2626
#define SQLITE_CORE 1
@@ -465,14 +465,14 @@
465465
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
466466
** [sqlite_version()] and [sqlite_source_id()].
467467
*/
468468
#define SQLITE_VERSION "3.51.0"
469469
#define SQLITE_VERSION_NUMBER 3051000
470
-#define SQLITE_SOURCE_ID "2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091"
470
+#define SQLITE_SOURCE_ID "2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70"
471471
#define SQLITE_SCM_BRANCH "trunk"
472472
#define SQLITE_SCM_TAGS ""
473
-#define SQLITE_SCM_DATETIME "2025-09-09T10:28:06.692Z"
473
+#define SQLITE_SCM_DATETIME "2025-09-10T14:28:07.926Z"
474474
475475
/*
476476
** CAPI3REF: Run-Time Library Version Numbers
477477
** KEYWORDS: sqlite3_version sqlite3_sourceid
478478
**
@@ -258472,11 +258472,11 @@
258472258472
int nArg, /* Number of args */
258473258473
sqlite3_value **apUnused /* Function arguments */
258474258474
){
258475258475
assert( nArg==0 );
258476258476
UNUSED_PARAM2(nArg, apUnused);
258477
- sqlite3_result_text(pCtx, "fts5: 2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091", -1, SQLITE_TRANSIENT);
258477
+ sqlite3_result_text(pCtx, "fts5: 2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70", -1, SQLITE_TRANSIENT);
258478258478
}
258479258479
258480258480
/*
258481258481
** Implementation of fts5_locale(LOCALE, TEXT) function.
258482258482
**
258483258483
--- 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 ** 0f31711591c56f3896fb6f092752fb82c4ea with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -465,14 +465,14 @@
465 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
466 ** [sqlite_version()] and [sqlite_source_id()].
467 */
468 #define SQLITE_VERSION "3.51.0"
469 #define SQLITE_VERSION_NUMBER 3051000
470 #define SQLITE_SOURCE_ID "2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091"
471 #define SQLITE_SCM_BRANCH "trunk"
472 #define SQLITE_SCM_TAGS ""
473 #define SQLITE_SCM_DATETIME "2025-09-09T10:28:06.692Z"
474
475 /*
476 ** CAPI3REF: Run-Time Library Version Numbers
477 ** KEYWORDS: sqlite3_version sqlite3_sourceid
478 **
@@ -258472,11 +258472,11 @@
258472 int nArg, /* Number of args */
258473 sqlite3_value **apUnused /* Function arguments */
258474 ){
258475 assert( nArg==0 );
258476 UNUSED_PARAM2(nArg, apUnused);
258477 sqlite3_result_text(pCtx, "fts5: 2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091", -1, SQLITE_TRANSIENT);
258478 }
258479
258480 /*
258481 ** Implementation of fts5_locale(LOCALE, TEXT) function.
258482 **
258483
--- 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 ** 61d9e204c5801a94811fdb0afe2c04f9814e with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -465,14 +465,14 @@
465 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
466 ** [sqlite_version()] and [sqlite_source_id()].
467 */
468 #define SQLITE_VERSION "3.51.0"
469 #define SQLITE_VERSION_NUMBER 3051000
470 #define SQLITE_SOURCE_ID "2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70"
471 #define SQLITE_SCM_BRANCH "trunk"
472 #define SQLITE_SCM_TAGS ""
473 #define SQLITE_SCM_DATETIME "2025-09-10T14:28:07.926Z"
474
475 /*
476 ** CAPI3REF: Run-Time Library Version Numbers
477 ** KEYWORDS: sqlite3_version sqlite3_sourceid
478 **
@@ -258472,11 +258472,11 @@
258472 int nArg, /* Number of args */
258473 sqlite3_value **apUnused /* Function arguments */
258474 ){
258475 assert( nArg==0 );
258476 UNUSED_PARAM2(nArg, apUnused);
258477 sqlite3_result_text(pCtx, "fts5: 2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70", -1, SQLITE_TRANSIENT);
258478 }
258479
258480 /*
258481 ** Implementation of fts5_locale(LOCALE, TEXT) function.
258482 **
258483
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.51.0"
150150
#define SQLITE_VERSION_NUMBER 3051000
151
-#define SQLITE_SOURCE_ID "2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091"
151
+#define SQLITE_SOURCE_ID "2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2025-09-09T10:28:06.692Z"
154
+#define SQLITE_SCM_DATETIME "2025-09-10T14:28:07.926Z"
155155
156156
/*
157157
** CAPI3REF: Run-Time Library Version Numbers
158158
** KEYWORDS: sqlite3_version sqlite3_sourceid
159159
**
160160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.51.0"
150 #define SQLITE_VERSION_NUMBER 3051000
151 #define SQLITE_SOURCE_ID "2025-09-09 10:28:06 0f31711591c56f3896fb6f092752fb82c4ea646bf8e5838dfbe55302994ea091"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2025-09-09T10:28:06.692Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.51.0"
150 #define SQLITE_VERSION_NUMBER 3051000
151 #define SQLITE_SOURCE_ID "2025-09-10 14:28:07 61d9e204c5801a94811fdb0afe2c04f9814e08f2e141afa6dbda0fa45f026f70"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2025-09-10T14:28:07.926Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160

Keyboard Shortcuts

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