diff --git a/lib/active_record/connection_adapters/janus_mysql2_adapter.rb b/lib/active_record/connection_adapters/janus_mysql2_adapter.rb index d86417f..294b913 100644 --- a/lib/active_record/connection_adapters/janus_mysql2_adapter.rb +++ b/lib/active_record/connection_adapters/janus_mysql2_adapter.rb @@ -32,7 +32,7 @@ class JanusMysql2Adapter < ActiveRecord::ConnectionAdapters::Mysql2Adapter SQL_REPLICA_MATCHERS = [/\A\s*(select|with.+\)\s*select)\s/i].freeze SQL_ALL_MATCHERS = [/\A\s*set\s/i].freeze SQL_SKIP_ALL_MATCHERS = [/\A\s*set\s+local\s/i].freeze - WRITE_PREFIXES = %w(INSERT UPDATE DELETE LOCK CREATE GRANT DROP ALTER).freeze + WRITE_PREFIXES = %w(INSERT UPDATE DELETE LOCK CREATE GRANT DROP ALTER TRUNCATE FLUSH).freeze attr_reader :config diff --git a/lib/janus/version.rb b/lib/janus/version.rb index 4299fec..8827007 100644 --- a/lib/janus/version.rb +++ b/lib/janus/version.rb @@ -4,7 +4,7 @@ module Janus unless defined?(::Janus::VERSION) module VERSION MAJOR = 0 - MINOR = 13 + MINOR = 14 PATCH = 0 PRE = nil diff --git a/spec/lib/active_record/connection_adapters/janus_mysql_adapter_spec.rb b/spec/lib/active_record/connection_adapters/janus_mysql_adapter_spec.rb index 25bad28..53c7a8e 100644 --- a/spec/lib/active_record/connection_adapters/janus_mysql_adapter_spec.rb +++ b/spec/lib/active_record/connection_adapters/janus_mysql_adapter_spec.rb @@ -16,7 +16,7 @@ } it { expect(described_class::SQL_REPLICA_MATCHERS).to eq([/\A\s*(select|with.+\)\s*select)\s/i]) } it { expect(described_class::SQL_ALL_MATCHERS).to eq([/\A\s*set\s/i]) } - it { expect(described_class::WRITE_PREFIXES).to eq %w(INSERT UPDATE DELETE LOCK CREATE GRANT DROP ALTER) } + it { expect(described_class::WRITE_PREFIXES).to eq %w(INSERT UPDATE DELETE LOCK CREATE GRANT DROP ALTER TRUNCATE FLUSH) } let(:database) { 'test' } let(:primary_config) do