From aabea5f779f18044389e49e4d7d49fc7ddbd7d47 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 12 Dec 2024 21:16:05 -0500 Subject: [PATCH] sqlite3: fix missing pager causing SQLITE_MISUSE This fixes a missing pager that `libsql_pager_codec` expects to not be null. All this does is add the pager when we call `sqlite3PagerWalInsert` to the wal frame we want to insert. Fixes #1867 --- libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c | 1 + libsql-ffi/bundled/src/sqlite3.c | 1 + libsql-sqlite3/src/pager.c | 1 + 3 files changed, 3 insertions(+) diff --git a/libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c b/libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c index 69d2a9eb93..a12f706ef7 100644 --- a/libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c +++ b/libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c @@ -65363,6 +65363,7 @@ SQLITE_PRIVATE int sqlite3PagerWalInsert(Pager *pPager, unsigned int iFrame, voi pghdr.pExtra = NULL; pghdr.pgno = pgno; pghdr.flags = 0; + pghdr.pPager = pPager; int isCommit = (nTruncate != 0); diff --git a/libsql-ffi/bundled/src/sqlite3.c b/libsql-ffi/bundled/src/sqlite3.c index 69d2a9eb93..a12f706ef7 100644 --- a/libsql-ffi/bundled/src/sqlite3.c +++ b/libsql-ffi/bundled/src/sqlite3.c @@ -65363,6 +65363,7 @@ SQLITE_PRIVATE int sqlite3PagerWalInsert(Pager *pPager, unsigned int iFrame, voi pghdr.pExtra = NULL; pghdr.pgno = pgno; pghdr.flags = 0; + pghdr.pPager = pPager; int isCommit = (nTruncate != 0); diff --git a/libsql-sqlite3/src/pager.c b/libsql-sqlite3/src/pager.c index ed8c99ee13..bcd179a4a3 100644 --- a/libsql-sqlite3/src/pager.c +++ b/libsql-sqlite3/src/pager.c @@ -7852,6 +7852,7 @@ int sqlite3PagerWalInsert(Pager *pPager, unsigned int iFrame, void *pBuf, unsign pghdr.pExtra = NULL; pghdr.pgno = pgno; pghdr.flags = 0; + pghdr.pPager = pPager; int isCommit = (nTruncate != 0);