Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: third_party/sqlite/patches/0005-Virtual-table-supporting-recovery-of-corrupted-datab.patch

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/patches/0005-Virtual-table-supporting-recovery-of-corrupted-datab.patch
diff --git a/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch b/third_party/sqlite/patches/0005-Virtual-table-supporting-recovery-of-corrupted-datab.patch
similarity index 98%
rename from third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch
rename to third_party/sqlite/patches/0005-Virtual-table-supporting-recovery-of-corrupted-datab.patch
index a746784408eecbf4fb7db47205c9c27b7640e2bf..35a29b9c28ca7fb963260e92140d88ee0059d4bf 100644
--- a/third_party/sqlite/patches/0006-Virtual-table-supporting-recovery-of-corrupted-datab.patch
+++ b/third_party/sqlite/patches/0005-Virtual-table-supporting-recovery-of-corrupted-datab.patch
@@ -1,7 +1,7 @@
-From ec588be0416fab3e957d0901eb6e638543b01229 Mon Sep 17 00:00:00 2001
+From 29b8ad9263dbc700c002e9044c7c712a566a26d7 Mon Sep 17 00:00:00 2001
From: Scott Hess <shess@chromium.org>
Date: Sat, 20 Jul 2013 11:42:21 -0700
-Subject: [PATCH 06/11] Virtual table supporting recovery of corrupted
+Subject: [PATCH 05/10] Virtual table supporting recovery of corrupted
databases.
"recover" implements a virtual table which uses the SQLite pager layer
@@ -17,16 +17,16 @@ third_party/sqlite/src/src/{recover,recover-alt}.c .
---
third_party/sqlite/src/Makefile.in | 1 +
third_party/sqlite/src/Makefile.linux-gcc | 4 +
- third_party/sqlite/src/main.mk | 4 +-
+ third_party/sqlite/src/main.mk | 5 +-
third_party/sqlite/src/src/main.c | 8 +
- third_party/sqlite/src/src/recover.c | 2165 ++++++++++++++++++++++++++++
+ third_party/sqlite/src/src/recover.c | 2167 ++++++++++++++++++++++++++++
third_party/sqlite/src/src/sqlite.h.in | 16 +
third_party/sqlite/src/test/recover.test | 147 ++
third_party/sqlite/src/test/recover0.test | 532 +++++++
third_party/sqlite/src/test/recover1.test | 429 ++++++
third_party/sqlite/src/test/recover2.test | 157 ++
third_party/sqlite/src/tool/mksqlite3c.tcl | 2 +
- 11 files changed, 3464 insertions(+), 1 deletion(-)
+ 11 files changed, 3467 insertions(+), 1 deletion(-)
create mode 100644 third_party/sqlite/src/src/recover.c
create mode 100644 third_party/sqlite/src/test/recover.test
create mode 100644 third_party/sqlite/src/test/recover0.test
@@ -34,10 +34,10 @@ third_party/sqlite/src/src/{recover,recover-alt}.c .
create mode 100644 third_party/sqlite/src/test/recover2.test
diff --git a/third_party/sqlite/src/Makefile.in b/third_party/sqlite/src/Makefile.in
-index a2213e8..1389486 100644
+index 1fe49d6..8b965c7 100644
--- a/third_party/sqlite/src/Makefile.in
+++ b/third_party/sqlite/src/Makefile.in
-@@ -253,6 +253,7 @@ SRC = \
+@@ -260,6 +260,7 @@ SRC = \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
@@ -46,7 +46,7 @@ index a2213e8..1389486 100644
$(TOP)/src/rowset.c \
$(TOP)/src/select.c \
diff --git a/third_party/sqlite/src/Makefile.linux-gcc b/third_party/sqlite/src/Makefile.linux-gcc
-index 4f6cdf1..dd8f46d 100644
+index 952e8d1..f6291c0 100644
--- a/third_party/sqlite/src/Makefile.linux-gcc
+++ b/third_party/sqlite/src/Makefile.linux-gcc
@@ -81,6 +81,10 @@ OPTS += -DSQLITE_MEMDEBUG=1
@@ -61,19 +61,20 @@ index 4f6cdf1..dd8f46d 100644
# Nothing for unix.
#
diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk
-index dc56b0d..2189fd6 100644
+index 6ff3bd4..a8629aa 100644
--- a/third_party/sqlite/src/main.mk
+++ b/third_party/sqlite/src/main.mk
-@@ -65,7 +65,7 @@ LIBOBJ+= vdbe.o parse.o \
+@@ -67,7 +67,8 @@ LIBOBJ+= vdbe.o parse.o \
mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
notify.o opcodes.o os.o os_unix.o os_win.o \
pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
-- random.o resolve.o rowset.o rtree.o select.o status.o \
-+ random.o recover.o resolve.o rowset.o rtree.o select.o status.o \
- table.o threads.o tokenize.o trigger.o \
+- random.o resolve.o rowset.o rtree.o select.o sqlite3rbu.o status.o \
++ random.o recover.o resolve.o rowset.o rtree.o \
++ select.o sqlite3rbu.o status.o \
+ table.o threads.o tokenize.o treeview.o trigger.o \
update.o userauth.o util.o vacuum.o \
vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
-@@ -135,6 +135,7 @@ SRC = \
+@@ -140,6 +141,7 @@ SRC = \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
@@ -81,7 +82,7 @@ index dc56b0d..2189fd6 100644
$(TOP)/src/resolve.c \
$(TOP)/src/rowset.c \
$(TOP)/src/select.c \
-@@ -315,6 +316,7 @@ TESTSRC2 = \
+@@ -360,6 +362,7 @@ TESTSRC2 = \
$(TOP)/src/prepare.c \
$(TOP)/src/printf.c \
$(TOP)/src/random.c \
@@ -90,10 +91,10 @@ index dc56b0d..2189fd6 100644
$(TOP)/src/pcache1.c \
$(TOP)/src/select.c \
diff --git a/third_party/sqlite/src/src/main.c b/third_party/sqlite/src/src/main.c
-index fc03700..d15ab9bb 100644
+index 3be7c77..301808c 100644
--- a/third_party/sqlite/src/src/main.c
+++ b/third_party/sqlite/src/src/main.c
-@@ -2644,6 +2644,14 @@ static int openDatabase(
+@@ -2927,6 +2927,14 @@ static int openDatabase(
}
#endif
@@ -110,10 +111,10 @@ index fc03700..d15ab9bb 100644
rc = sqlite3IcuInit(db);
diff --git a/third_party/sqlite/src/src/recover.c b/third_party/sqlite/src/src/recover.c
new file mode 100644
-index 0000000..6882d6f
+index 0000000..8e3929d
--- /dev/null
+++ b/third_party/sqlite/src/src/recover.c
-@@ -0,0 +1,2165 @@
+@@ -0,0 +1,2167 @@
+/*
+** 2012 Jan 11
+**
@@ -335,7 +336,8 @@ index 0000000..6882d6f
+ * DbPage.pData, .pPager, and .pgno
+ * sqlite3 struct.
+ * sqlite3BtreePager() and sqlite3BtreeGetPageSize()
-+ * sqlite3PagerAcquire() and sqlite3PagerUnref()
++ * sqlite3BtreeGetOptimalReserve()
++ * sqlite3PagerGet() and sqlite3PagerUnref()
+ * getVarint().
+ */
+#include "sqliteInt.h"
@@ -521,7 +523,8 @@ index 0000000..6882d6f
+ }
+
+ *pPager = sqlite3BtreePager(pBt);
-+ *pnPageSize = sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetReserve(pBt);
++ *pnPageSize =
++ sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetOptimalReserve(pBt);
+ return SQLITE_OK;
+}
+
@@ -893,7 +896,7 @@ index 0000000..6882d6f
+ if( interiorCursorPageInUse(pCursor, iPage) ){
+ fprintf(stderr, "Loop detected at %d\n", iPage);
+ }else{
-+ int rc = sqlite3PagerAcquire(pCursor->pPage->pPager, iPage, ppPage, 0);
++ int rc = sqlite3PagerGet(pCursor->pPage->pPager, iPage, ppPage, 0);
+ if( rc==SQLITE_OK ){
+ return SQLITE_ROW;
+ }
@@ -1037,7 +1040,7 @@ index 0000000..6882d6f
+ while( iNextPage && nBytes<nRecordBytes ){
+ RecoverOverflow *pOverflow; /* New overflow page for the list. */
+
-+ rc = sqlite3PagerAcquire(pPage->pPager, iNextPage, &pPage, 0);
++ rc = sqlite3PagerGet(pPage->pPager, iNextPage, &pPage, 0);
+ if( rc!=SQLITE_OK ){
+ break;
+ }
@@ -1366,7 +1369,7 @@ index 0000000..6882d6f
+ int rc;
+
+ /* Start out with the root page. */
-+ rc = sqlite3PagerAcquire(pPager, iRootPage, &pPage, 0);
++ rc = sqlite3PagerGet(pPager, iRootPage, &pPage, 0);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
@@ -2280,12 +2283,12 @@ index 0000000..6882d6f
+ return SQLITE_OK;
+}
diff --git a/third_party/sqlite/src/src/sqlite.h.in b/third_party/sqlite/src/src/sqlite.h.in
-index 36aa999..333adfe 100644
+index e5673fd..6829bcb 100644
--- a/third_party/sqlite/src/src/sqlite.h.in
+++ b/third_party/sqlite/src/src/sqlite.h.in
-@@ -7408,6 +7408,22 @@ int sqlite3_vtab_on_conflict(sqlite3 *);
-
-
+@@ -7411,6 +7411,22 @@ int sqlite3_strnicmp(const char *, const char *, int);
+ */
+ int sqlite3_strglob(const char *zGlob, const char *zStr);
+/* Begin recover virtual table patch for Chromium */
+/* Our patches don't conform to SQLite's amalgamation processing. Hack it. */
@@ -3596,10 +3599,10 @@ index 0000000..8aa4e04
+
+finish_test
diff --git a/third_party/sqlite/src/tool/mksqlite3c.tcl b/third_party/sqlite/src/tool/mksqlite3c.tcl
-index 0e97923..9e2b0fe 100644
+index 23241e2..1113758 100644
--- a/third_party/sqlite/src/tool/mksqlite3c.tcl
+++ b/third_party/sqlite/src/tool/mksqlite3c.tcl
-@@ -316,6 +316,8 @@ foreach file {
+@@ -361,6 +361,8 @@ foreach file {
main.c
notify.c
@@ -3609,5 +3612,5 @@ index 0e97923..9e2b0fe 100644
fts3_aux.c
fts3_expr.c
--
-2.4.5
+2.7.0

Powered by Google App Engine
This is Rietveld 408576698