Sha256: 022191c458bc589d4e4ee186f6dc29f295f54654c4f1c3883f4bfa35884a39da

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

module Earth
  module Warnings
    def Warnings.check_mysql_ansi_mode
      if ::ActiveRecord::Base.connection.adapter_name =~ /mysql/i
        sql_mode = ::ActiveRecord::Base.connection.select_value("SELECT @@GLOBAL.sql_mode") + ::ActiveRecord::Base.connection.select_value("SELECT @@SESSION.sql_mode")
        unless sql_mode.downcase.include? 'pipes_as_concat'
          ::Kernel.warn "[earth gem] Warning: MySQL detected, but PIPES_AS_CONCAT not set. Importing from scratch will fail. Consider setting sql-mode=ANSI in my.cnf."
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/warnings.rb
earth-1.1.2 lib/earth/warnings.rb
earth-1.1.1 lib/earth/warnings.rb
earth-1.1.0 lib/earth/warnings.rb
earth-1.0.3 lib/earth/warnings.rb
earth-1.0.2 lib/earth/warnings.rb
earth-1.0.1 lib/earth/warnings.rb
earth-1.0.0 lib/earth/warnings.rb