Skip to content

Commit 36b37ac

Browse files
committed
libsql-sqlite3: Fix error reporting in WAL API
We need to call sqlite3Error() to report anything but "not an error" to callers.
1 parent 6c64833 commit 36b37ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libsql-sqlite3/src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,7 @@ int libsql_wal_frame_count(
24702470
sqlite3_mutex_enter(db->mutex);
24712471
pPager = sqlite3BtreePager(db->aDb[0].pBt);
24722472
rc = sqlite3PagerWalFrameCount(pPager, pnFrame);
2473+
sqlite3Error(db, rc);
24732474
sqlite3_mutex_leave(db->mutex);
24742475
return rc;
24752476
#endif
@@ -2498,6 +2499,7 @@ int libsql_wal_get_frame(
24982499
sqlite3_mutex_enter(db->mutex);
24992500
pPager = sqlite3BtreePager(db->aDb[0].pBt);
25002501
rc = sqlite3PagerWalReadFrameRaw(pPager, iFrame, pBuf, nBuf);
2502+
sqlite3Error(db, rc);
25012503
sqlite3_mutex_leave(db->mutex);
25022504

25032505
return rc;
@@ -2527,6 +2529,7 @@ int libsql_wal_insert_begin(sqlite3 *db) {
25272529
goto out_unlock;
25282530
}
25292531
out_unlock:
2532+
sqlite3Error(db, rc);
25302533
sqlite3_mutex_leave(db->mutex);
25312534
return rc;
25322535
}
@@ -2542,6 +2545,7 @@ int libsql_wal_insert_end(sqlite3 *db) {
25422545
goto out_unlock;
25432546
}
25442547
out_unlock:
2548+
sqlite3Error(db, rc);
25452549
sqlite3_mutex_leave(db->mutex);
25462550
return rc;
25472551
}
@@ -2573,6 +2577,7 @@ int libsql_wal_insert_frame(
25732577
goto out_unlock;
25742578
}
25752579
out_unlock:
2580+
sqlite3Error(db, rc);
25762581
sqlite3_mutex_leave(db->mutex);
25772582

25782583
return rc;

0 commit comments

Comments
 (0)