Skip to content

Commit 701ddac

Browse files
committed
Revert SQLITE upgrade back to 3.47
1 parent b026653 commit 701ddac

File tree

4 files changed

+43
-39
lines changed

4 files changed

+43
-39
lines changed

build/BUILD.sqlite3

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -205,32 +205,6 @@ genrule(
205205

206206
GENERATED_SOURCES += ["keywordhash.h"]
207207

208-
# ========================================================================
209-
# Constructs ctime.c
210-
211-
genrule(
212-
name = "ctime_c",
213-
srcs = [],
214-
outs = ["ctime.c"],
215-
cmd = "tclsh $(location tool/mkctimec.tcl) $(RULEDIR)/ctime.c",
216-
tools = ["tool/mkctimec.tcl"],
217-
)
218-
219-
GENERATED_SOURCES += ["ctime.c"]
220-
221-
# ========================================================================
222-
# Constructs pragma.h
223-
224-
genrule(
225-
name = "pragma_h",
226-
srcs = [],
227-
outs = ["pragma.h"],
228-
cmd = "tclsh $(location tool/mkpragmatab.tcl) $(RULEDIR)/pragma.h",
229-
tools = ["tool/mkpragmatab.tcl"],
230-
)
231-
232-
GENERATED_SOURCES += ["pragma.h"]
233-
234208
# ========================================================================
235209
# Constructs sqlite3.h.
236210

build/deps/deps.MODULE.bazel

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ archive_override(
6060
bazel_dep(name = "sqlite3")
6161

6262
# We have some patches that aren't included in BCR:
63-
# https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/sqlite3/3.51.1/patches
63+
# https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/sqlite3/3.47.0/patches
6464
archive_override(
6565
module_name = "sqlite3",
6666
build_file = "//:build/BUILD.sqlite3",
@@ -69,16 +69,17 @@ archive_override(
6969
"//:patches/sqlite/0001-row-counts-plain.patch",
7070
"//:patches/sqlite/0002-macOS-missing-PATH-fix.patch",
7171
"//:patches/sqlite/0003-sqlite-complete-early-exit.patch",
72+
"//:patches/sqlite/0004-invalid-wal-on-rollback-fix.patch",
7273
],
7374
remote_file_integrity = {
74-
"MODULE.bazel": "sha256-YgTah0CSnA9l6ERyXOm3/1ljRPSdlk72qn6TE1QyeFs=",
75+
"MODULE.bazel": "sha256-TtpmqyHyks3o0WcSJO0XFyKkHfAIF98wq06+urs3oKI=",
7576
},
7677
remote_file_urls = {
77-
"MODULE.bazel": ["https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/refs/heads/main/modules/sqlite3/3.51.1/MODULE.bazel"],
78+
"MODULE.bazel": ["https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/refs/heads/main/modules/sqlite3/3.47.0/MODULE.bazel"],
7879
},
79-
sha256 = "0f8e765ac8ea7c36cf8ea9bffdd5c103564f4a8a635f215f9f783b338a13d971",
80-
strip_prefix = "sqlite-src-3510100",
81-
url = "https://sqlite.org/2025/sqlite-src-3510100.zip",
80+
sha256 = "f59c349bedb470203586a6b6d10adb35f2afefa49f91e55a672a36a09a8fedf7",
81+
strip_prefix = "sqlite-src-3470000",
82+
url = "https://sqlite.org/2024/sqlite-src-3470000.zip",
8283
)
8384

8485
bazel_dep(name = "tcmalloc", version = "0.0.0-20250927-12f2552")

patches/sqlite/0002-macOS-missing-PATH-fix.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
diff -u5 -r sqlite-src-pristine-patched1/tool/mksqlite3c.tcl sqlite-src-modified/tool/mksqlite3c.tcl
2-
--- sqlite-src-pristine-patched1/tool/mksqlite3c.tcl 2025-11-19 08:32:31.802107018 -0600
3-
+++ sqlite-src-modified/tool/mksqlite3c.tcl 2025-11-19 08:28:09.082039967 -0600
4-
@@ -87,11 +87,14 @@
1+
diff --color -u5 -r sqlite-src-3440000-pristine/tool/mksqlite3c.tcl sqlite-src-3440000-modified/tool/mksqlite3c.tcl
2+
--- sqlite-src-3440000-pristine/tool/mksqlite3c.tcl 2023-11-01 07:31:37
3+
+++ sqlite-src-3440000-modified/tool/mksqlite3c.tcl 2024-03-14 17:36:55
4+
@@ -84,11 +84,14 @@
55
set fname sqlite3.c
66
if {$enable_recover} { set fname sqlite3r.c }
7-
set out [open $fname wb]
7+
set out [open $fname w]
88
# Force the output to use unix line endings, even on Windows.
9-
fconfigure $out -translation binary
9+
fconfigure $out -translation lf
1010
-set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
1111
+# The command below results in "couldn't find HOME environment variable to
1212
+# expand path" errors on macOS CI runs. today is unused, so it is safe to
1313
+# comment it out.
14-
+#set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
14+
+# set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
1515
puts $out [subst \
1616
{/******************************************************************************
1717
** This file is an amalgamation of many separate C source files from SQLite
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff -u5 -r sqlite-src-pristine/src/wal.c sqlite-src-modified/src/wal.c
2+
--- sqlite-src-pristine/src/wal.c 2024-10-21 09:47:53.000000000 -0700
3+
+++ sqlite-src-modified/src/wal.c 2025-06-17 23:10:43.657220118 -0700
4+
@@ -3760,10 +3760,11 @@
5+
rc = xUndo(pUndoCtx, walFramePgno(pWal, iFrame));
6+
}
7+
if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal);
8+
}
9+
SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
10+
+ pWal->iReCksum = 0;
11+
}
12+
return rc;
13+
}
14+
15+
/*
16+
@@ -3807,10 +3808,13 @@
17+
pWal->hdr.aFrameCksum[1] = aWalData[2];
18+
SEH_TRY {
19+
walCleanupHash(pWal);
20+
}
21+
SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
22+
+ if( pWal->iReCksum>pWal->hdr.mxFrame ){
23+
+ pWal->iReCksum = 0;
24+
+ }
25+
}
26+
27+
return rc;
28+
}
29+

0 commit comments

Comments
 (0)