Skip to content

Commit b41f73c

Browse files
committed
do not check updatedTableInfosThisTx as we can't reset on read
`commitHook` is only called after a write or explicit transaction. Table infos need to be updated in read-only scenarios.
1 parent 0d62b52 commit b41f73c

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

core/rs/core/src/tableinfo.rs

-11
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,6 @@ pub extern "C" fn crsql_ensure_table_infos_are_up_to_date(
750750
ext_data: *mut crsql_ExtData,
751751
err: *mut *mut c_char,
752752
) -> c_int {
753-
let already_updated = unsafe { (*ext_data).updatedTableInfosThisTx == 1 };
754-
if already_updated {
755-
return ResultCode::OK as c_int;
756-
}
757-
758753
let schema_changed =
759754
unsafe { crsql_fetchPragmaSchemaVersion(db, ext_data, TABLE_INFO_SCHEMA_VERSION) };
760755

@@ -769,9 +764,6 @@ pub extern "C" fn crsql_ensure_table_infos_are_up_to_date(
769764
Ok(new_table_infos) => {
770765
*table_infos = new_table_infos;
771766
forget(table_infos);
772-
unsafe {
773-
(*ext_data).updatedTableInfosThisTx = 1;
774-
}
775767
return ResultCode::OK as c_int;
776768
}
777769
Err(e) => {
@@ -782,9 +774,6 @@ pub extern "C" fn crsql_ensure_table_infos_are_up_to_date(
782774
}
783775

784776
forget(table_infos);
785-
unsafe {
786-
(*ext_data).updatedTableInfosThisTx = 1;
787-
}
788777
return ResultCode::OK as c_int;
789778
}
790779

core/src/crsqlite.c

-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static int commitHook(void *pUserData) {
3838
pExtData->dbVersion = pExtData->pendingDbVersion;
3939
pExtData->pendingDbVersion = -1;
4040
pExtData->seq = 0;
41-
pExtData->updatedTableInfosThisTx = 0;
4241
return SQLITE_OK;
4342
}
4443

@@ -47,7 +46,6 @@ static void rollbackHook(void *pUserData) {
4746

4847
pExtData->pendingDbVersion = -1;
4948
pExtData->seq = 0;
50-
pExtData->updatedTableInfosThisTx = 0;
5149
}
5250

5351
#ifdef LIBSQL

0 commit comments

Comments
 (0)