mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 13:54:27 +01:00
Merge 'core: Enforce shared database object per database file' from Pekka Enberg
We need to ensures that there is a single, shared `Database` object per a database file. We need because it is not safe to have multiple independent WAL files open because coordination happens at process-level POSIX file advisory locks. Fixes #2267 Reviewed-by: Pere Diaz Bou <pere-altea@homail.com> Closes #2299
This commit is contained in:
@@ -355,6 +355,7 @@ mod tests {
|
||||
),
|
||||
SQLITE_OK
|
||||
);
|
||||
assert_eq!(sqlite3_close(db), SQLITE_OK);
|
||||
}
|
||||
let mut wal_path = temp_file.path().to_path_buf();
|
||||
assert!(wal_path.set_extension("db-wal"));
|
||||
@@ -380,6 +381,7 @@ mod tests {
|
||||
assert_eq!(sqlite3_step(stmt), SQLITE_DONE);
|
||||
assert_eq!(sqlite3_finalize(stmt), SQLITE_OK);
|
||||
}
|
||||
assert_eq!(sqlite3_close(db), SQLITE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,6 +461,7 @@ mod tests {
|
||||
),
|
||||
SQLITE_OK
|
||||
);
|
||||
assert_eq!(sqlite3_close(db), SQLITE_OK);
|
||||
}
|
||||
let mut wal_path = temp_file.path().to_path_buf();
|
||||
assert!(wal_path.set_extension("db-wal"));
|
||||
@@ -483,6 +486,7 @@ mod tests {
|
||||
assert_eq!(sqlite3_step(stmt), SQLITE_DONE);
|
||||
assert_eq!(sqlite3_finalize(stmt), SQLITE_OK);
|
||||
}
|
||||
assert_eq!(sqlite3_close(db), SQLITE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user