<commit_before># ActiveRecord 3.0 BACK PORT ONLY
# https://github.com/brianmario/mysql2/commit/14accdf8d1bf557f652c19b870316094a7441334#diff-0

if ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 0
  module ActiveRecord
    module ConnectionAdapters
      class Mysql2Adapter < AbstractAdapter     
        def tables(name = nil, database = nil) #:nodoc:
          sql = ["SHOW TABLES", database].compact.join(' IN ')
          execute(sql, 'SCHEMA').collect do |field|
            field.first
          end
        end
      
        def table_exists?(name)
          return true if super
          name          = name.to_s
          schema, table = name.split('.', 2)
          unless table # A table was provided without a schema
            table  = schema
            schema = nil
          end
          tables(nil, schema).include? table
        end
      end
    end
  end
end<commit_msg>fix patch<commit_after># ActiveRecord 3.0 BACK PORT ONLY
# https://github.com/brianmario/mysql2/commit/14accdf8d1bf557f652c19b870316094a7441334#diff-0

if ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 0
  module ActiveRecord
    module ConnectionAdapters
      class Mysql2Adapter < AbstractAdapter     
        
        def real_tables(name = nil, database = nil) #:nodoc:
          sql = ["SHOW TABLES", database].compact.join(' IN ')
          execute(sql, 'SCHEMA').collect do |field|
            field.first
          end
        end
      
        def table_exists?(name)
          return true if super
          name          = name.to_s
          schema, table = name.split('.', 2)
          unless table # A table was provided without a schema
            table  = schema
            schema = nil
          end
          real_tables(nil, schema).include? table
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08869659275283938, 'fraction_numerical': 0.038939967550027044, 'mean_word_length': 1.9695024077046548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4254101', 'n_tokens_mistral': 576, 'n_tokens_neox': 527, 'n_words': 142}