10000 Snapshot of upstream SQLite 3.37.2 · sqlcipher/sqlcipher@90401f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90401f0

Browse files
committed
Snapshot of upstream SQLite 3.37.2
1 parent 328a4c8 commit 90401f0

File tree

262 files changed

+13744
-4621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+13744
-4621
lines changed

Makefile.in

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
165165
###############################################################################
166166

167167
USE_AMALGAMATION = @USE_AMALGAMATION@
168+
AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@
168169

169170
# Object files for the SQLite library (non-amalgamation).
170171
#
@@ -467,7 +468,8 @@ TESTSRC += \
467468
$(TOP)/ext/misc/unionvtab.c \
468469
$(TOP)/ext/misc/wholenumber.c \
469470
$(TOP)/ext/misc/zipfile.c \
470-
$(TOP)/ext/userauth/userauth.c
471+
$(TOP)/ext/userauth/userauth.c \
472+
$(TOP)/ext/rtree/test_rtreedoc.c
471473

472474
# Source code to the library files needed by the test fixture
473475
#
@@ -622,7 +624,7 @@ FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
622624
FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
623625
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
624626
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS3_PARENTHESIS
625-
#FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
627+
FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
626628
FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
627629
FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
628630
FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
@@ -756,7 +758,7 @@ mptest: mptester$(TEXE)
756758
touch .target_source
757759

758760
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl
759-
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
761+
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
760762
cp tsrc/sqlite3ext.h .
761763
cp $(TOP)/ext/session/sqlite3session.h .
762764

@@ -1249,7 +1251,10 @@ coretestprogs: $(TESTPROGS)
12491251
testprogs: coretestprogs srcck1$(BEXE) fuzzcheck$(TEXE) sessionfuzz$(TEXE)
12501252

12511253
# A very detailed test running most or all test cases
1252-
fulltest: $(TESTPROGS) fuzztest
1254+
fulltest: alltest fuzztest
1255+
1256+
# Run most or all tcl test cases
1257+
alltest: $(TESTPROGS)
12531258
./testfixture$(TEXE) $(TOP)/test/all.test $(TESTOPTS)
12541259

12551260
# Really really long testing

Makefile.msc

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ DEBUG = 0
235235
!ENDIF
236236

237237
# <<mark>>
238-
# Disable use of the --linemacros argument to the mksqlite3c.tcl tool, which
239-
# is used to build the amalgamation.
238+
# By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which
239+
# is used to build the amalgamation. This can be turned off to ease debug
240+
# of the amalgamation away from the source tree.
240241
#
241242
!IFNDEF NO_LINEMACROS
242243
NO_LINEMACROS = 0
@@ -788,9 +789,9 @@ MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl
788789

789790
!IFNDEF MKSQLITE3C_ARGS
790791
!IF $(DEBUG)>1 && $(NO_LINEMACROS)==0
791-
MKSQLITE3C_ARGS = --linemacros
792+
MKSQLITE3C_ARGS = --linemacros=1
792793
!ELSE
793-
MKSQLITE3C_ARGS =
794+
MKSQLITE3C_ARGS = --linemacros=0
794795
!ENDIF
795796
!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
796797
MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall
@@ -1585,6 +1586,7 @@ TESTEXT = \
15851586
$(TOP)\ext\misc\totype.c \
15861587
$(TOP)\ext\misc\unionvtab.c \
15871588
$(TOP)\ext\misc\wholenumber.c \
1589+
$(TOP)\ext\rtree\test_rtreedoc.c \
15881590
fts5.c
15891591

15901592
# If use of zlib is enabled, add the "zipfile.c" source file.
@@ -1697,6 +1699,7 @@ MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
16971699
FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
16981700
FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
16991701
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
1702+
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5
17001703
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
17011704
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
17021705
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
@@ -2208,11 +2211,11 @@ SHELL_SRC = \
22082211
$(TOP)\src\shell.c.in \
22092212
$(TOP)\ext\misc\appendvfs.c \
22102213
$(TOP)\ext\misc\completion.c \
2211-
$(TOP)\ext\misc\decimal.c \
2214+
$(TOP)\ext\misc\decimal.c \
22122215
$(TOP)\ext\misc\fileio.c \
2213-
$(TOP)\ext\misc\ieee754.c \
2214-
$(TOP)\ext\misc\regexp.c \
2215-
$(TOP)\ext\misc\series.c \
2216+
$(TOP)\ext\misc\ieee754.c \
2217+
$(TOP)\ext\misc\regexp.c \
2218+
$(TOP)\ext\misc\series.c \
22162219
$(TOP)\ext\misc\shathree.c \
22172220
$(TOP)\ext\misc\uint.c \
22182221
$(TOP)\ext\expert\sqlite3expert.c \
@@ -2435,7 +2438,9 @@ coretestprogs: $(TESTPROGS)
24352438

24362439
testprogs: coretestprogs srcck1.exe fuzzcheck.exe sessionfuzz.exe
24372440

2438-
fulltest: $(TESTPROGS) fuzztest
2441+
fulltest: alltest fuzztest
2442+
2443+
alltest: $(TESTPROGS)
24392444
@set PATH=$(LIBTCLPATH);$(PATH)
24402445
.\testfixture.exe $(TOP)\test\all.test $(TESTOPTS)
24412446

@@ -2463,7 +2468,11 @@ quicktest: testfixture.exe sourcetest
24632468
# This is the common case. Run many tests that do not take too long,
24642469
# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
24652470
#
2466-
test: $(TESTPROGS) sourcetest fuzztest
2471+
test: $(TESTPROGS) sourcetest fuzztest tcltest
2472+
2473+
# The veryquick.test TCL tests.
2474+
#
2475+
tcltest: testfixture.exe
24672476
@set PATH=$(LIBTCLPATH);$(PATH)
24682477
.\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
24692478

@@ -2585,6 +2594,17 @@ rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H
25852594
$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
25862595
$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
25872596

2597+
THREADTEST3_SRC = \
2598+
$(TOP)\test\threadtest3.c \
2599+
$(TOP)\test\tt3_checkpoint.c \
2600+
$(TOP)\test\tt3_index.c \
2601+
$(TOP)\test\tt3_vacuum.c \
2602+
$(TOP)\test\tt3_stress.c \
2603+
$(TOP)\test\tt3_lookaside1.c
2604+
2605+
threadtest3.exe: $(THREADTEST3_SRC) $(TOP)\src\test_multiplex.c $(SQLITE3C) $(SQLITE3H)
2606+
$(LTLINK) $(NO_WARN) $(TOP)\test\threadtest3.c $(TOP)\src\test_multiplex.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
2607+
25882608
LSMDIR=$(TOP)\ext\lsm1
25892609
!INCLUDE $(LSMDIR)\Makefile.msc
25902610

@@ -2622,7 +2642,7 @@ clean:
26222642
del /Q sqlite-*-output.vsix 2>NUL
26232643
del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
26242644
del /Q sqltclsh.* 2>NUL
2625-
del /Q dbfuzz.exe sessionfuzz.exe 2>NUL
2645+
del /Q dbfuzz.exe sessionfuzz.exe threadtest3.exe 2>NUL
26262646
del /Q kvtest.exe ossshell.exe scrub.exe 2>NUL
26272647
del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
26282648
del /Q fts5.* fts5parse.* 2>NUL

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.36.0
1+
3.37.2

autoconf/tea/win/nmakehlp.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
#define _CRT_SECURE_NO_DEPRECATE
1616
#include <windows.h>
17+
#ifdef _MSC_VER
1718
#pragma comment (lib, "user32.lib")
1819
#pragma comment (lib, "kernel32.lib")
20+
#endif
1921
#include <stdio.h>
2022
#include <math.h>
2123

@@ -37,7 +39,7 @@
3739
/* protos */
3840

3941
static int CheckForCompilerFeature(const char *option);
40-
static int CheckForLinkerFeature(const char **options, int count);
42+
static int CheckForLinkerFeature(char **options, int count);
4143
static int IsIn(const char *string, const char *substring);
4244
static int SubstituteFile(const char *substs, const char *filename);
4345
static int QualifyPath(const char *path);
@@ -54,8 +56,8 @@ typedef struct {
5456
char buffer[STATICBUFFERSIZE];
5557
} pipeinfo;
5658

57-
pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
58-
pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
59+
pipeinfo Out = {INVALID_HANDLE_VALUE, ""};
60+
pipeinfo Err = {INVALID_HANDLE_VALUE, ""};
5961

6062
/*
6163
* exitcodes: 0 == no, 1 == yes, 2 == error
@@ -273,7 +275,7 @@ CheckForCompilerFeature(
273275
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
274276

275277
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
276-
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
278+
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
277279
(300-chars), 0);
278280
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
279281
return 2;
@@ -326,7 +328,7 @@ CheckForCompilerFeature(
326328

327329
static int
328330
CheckForLinkerFeature(
329-
const char **options,
331+
char **options,
330332
int count)
331333
{
332334
STARTUPINFO si;
@@ -407,7 +409,7 @@ CheckForLinkerFeature(
407409
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
408410

409411
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
410-
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
412+
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
411413
(300-chars), 0);
412414
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
413415
return 2;
@@ -503,7 +505,6 @@ GetVersionFromFile(
503505
const char *match,
504506
int numdots)
505507
{
506-
size_t cbBuffer = 100;
507508
static char szBuffer[100];
508509
char *szResult = NULL;
509510
FILE *fp = fopen(filename, "rt");
@@ -513,7 +514,7 @@ GetVersionFromFile(
513514
* Read data until we see our match string.
514515
*/
515516

516-
while (fgets(szBuffer, cbBuffer, fp) != NULL) {
517+
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
517518
LPSTR p, q;
518519

519520
p = strstr(szBuffer, match);
@@ -523,7 +524,7 @@ GetVersionFromFile(
523524
*/
524525

525526
p += strlen(match);
526-
while (*p && !isdigit(*p)) {
527+
while (*p && !isdigit((unsigned char)*p)) {
527528
++p;
528529
}
529530

@@ -532,14 +533,13 @@ GetVersionFromFile(
532533
*/
533534

534535
q = p;
535-
while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q)
536-
&& (!strchr("ab", q[-1])) || --numdots))) {
536+
while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q)
537+
&& !strchr("ab", q[-1])) || --numdots))) {
537538
++q;
538539
}
539540

540-
memcpy(szBuffer, p, q - p);
541-
szBuffer[q-p] = 0;
542-
szResult = szBuffer;
541+
*q = 0;
542+
szResult = p;
543543
break;
544544
}
545545
}
@@ -562,7 +562,7 @@ typedef struct list_item_t {
562562
static list_item_t *
563563
list_insert(list_item_t **listPtrPtr, const char *key, const char *value)
564564
{
565-
list_item_t *itemPtr = malloc(sizeof(list_item_t));
565+
list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t));
566566
if (itemPtr) {
567567
itemPtr->key = strdup(key);
568568
itemPtr->value = strdup(value);
@@ -611,9 +611,7 @@ SubstituteFile(
611611
const char *substitutions,
612612
const char *filename)
613613
{
614-
size_t cbBuffer = 1024;
615614
static char szBuffer[1024], szCopy[1024];
616-
char *szResult = NULL;
617615
list_item_t *substPtr = NULL;
618616
FILE *fp, *sp;
619617

@@ -626,7 +624,7 @@ SubstituteFile(
626624

627625
sp = fopen(substitutions, "rt");
628626
if (sp != NULL) {
629-
while (fgets(szBuffer, cbBuffer, sp) != NULL) {
627+
while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) {
630628
unsigned char *ks, *ke, *vs, *ve;
631629
ks = (unsigned char*)szBuffer;
632630
while (ks && *ks && isspace(*ks)) ++ks;
@@ -657,7 +655,7 @@ SubstituteFile(
657655
* Run the substitutions over each line of the input
658656
*/
659657

660-
while (fgets(szBuffer, cbBuffer, fp) != NULL) {
658+
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
661659
list_item_t *p = NULL;
662660
for (p = substPtr; p != NULL; p = p->nextPtr) {
663661
char *m = strstr(szBuffer, p->key);
@@ -674,7 +672,7 @@ SubstituteFile(
674672
memcpy(szBuffer, szCopy, sizeof(szCopy));
675673
}
676674
}
677-
printf(szBuffer);
675+
printf("%s", szBuffer);
678676
}
679677

680678
list_free(&substPtr);
@@ -725,7 +723,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
725723
{
726724
HANDLE hSearch;
727725
char path[MAX_PATH+1];
728-
int dirlen, keylen, ret;
726+
size_t dirlen;
727+
int keylen, ret;
729728
WIN32_FIND_DATA finfo;
730729

731730
if (dir == NULL || keypath == NULL)
@@ -792,7 +791,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
792791
*/
793792
static int LocateDependency(const char *keypath)
794793
{
795-
int i, ret;
794+
size_t i;
795+
int ret;
796796
static const char *paths[] = {"..", "..\\..", "..\\..\\.."};
797797

798798
for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) {

0 commit comments

Comments
 (0)
0