Skip to content

Commit

Permalink
[merge] attach dbs immutably
Browse files Browse the repository at this point in the history
Summary: When merging buck-out outputs, use the `immutable` flag. This prevents SQLite from writing to these databases, or to create intermediate files (like the writeahead log) in buck-out.

Reviewed By: jvillard

Differential Revision:
D46836978

Privacy Context Container: L1122176

fbshipit-source-id: 35933104e398d723014002321934a20f50a33648
  • Loading branch information
ngorogiannis authored and facebook-github-bot committed Oct 13, 2023
1 parent 89f9f89 commit f0f67c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion infer/src/base/DBWriter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ module Implementation = struct
if not (ISys.file_exists db_file) then
L.die InternalError "Tried to merge in DB at %s but path does not exist.@\n" db_file ;
let main_db = Database.get_database CaptureDatabase in
SqliteUtils.with_attached_db main_db ~db_file ~db_name:"attached" ~f:(fun () ->
SqliteUtils.with_attached_db main_db ~db_file ~db_name:"attached" ~immutable:true
~f:(fun () ->
merge_procedures_table ~db:CaptureDatabase ~to_db:"memdb" ~db_file ;
merge_source_files_table ~db_file )
in
Expand Down

0 comments on commit f0f67c8

Please sign in to comment.