A platform for community discussion. Free, open, simple.
FIX: ensures reports can't modify records (#8006)
Joffrey JAFFEUX0a6d1b687cc9
diff --git a/app/models/report.rb b/app/models/report.rbindex 783247fb0f9..d4387b0f614 100644--- a/app/models/report.rb+++ b/app/models/report.rb@@ -83,6 +83,8 @@ class Reportdef self.wrap_slow_query(timeout = 20000)ActiveRecord::Base.connection.transaction do+ # Allows only read only transactions+ DB.exec "SET TRANSACTION READ ONLY"# Set a statement timeout so we can't tie up the serverDB.exec "SET LOCAL statement_timeout = #{timeout}"yield