2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2019-07-04 11:16:55 +00:00
|
|
|
case ActiveRecord::Base.connection_config[:adapter]
|
|
|
|
when 'mysql2'
|
|
|
|
Rails.application.config.db_4bytes_utf8 = false
|
|
|
|
Rails.application.config.db_case_sensitive = false
|
|
|
|
Rails.application.config.db_like = 'LIKE'
|
|
|
|
Rails.application.config.db_null_byte = true
|
2021-12-03 10:13:40 +00:00
|
|
|
|
|
|
|
# Because of missing ticket updates in high load environments
|
|
|
|
# we changed the transaction isolation level equally to postgres
|
|
|
|
# to READ COMMITTED which fixed the problem entirely #3877
|
|
|
|
ActiveRecord::ConnectionAdapters::Mysql2Adapter.set_callback :checkout, :before do |conn|
|
|
|
|
conn.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED')
|
|
|
|
end
|
2019-07-04 11:16:55 +00:00
|
|
|
when 'postgresql'
|
|
|
|
Rails.application.config.db_4bytes_utf8 = true
|
|
|
|
Rails.application.config.db_case_sensitive = true
|
|
|
|
Rails.application.config.db_like = 'ILIKE'
|
|
|
|
Rails.application.config.db_null_byte = false
|
|
|
|
end
|