<commit_before>require 'test_helper'
require 'db/mysql_config'

require 'jdbc/mysql' # driver not loaded for plain JDBC
Jdbc::MySQL.load_driver

JDBC_CONFIG = {
  :adapter => 'jdbc',
  :driver => 'com.mysql.jdbc.Driver',
  :url => "jdbc:mysql://#{MYSQL_CONFIG[:host]}/#{MYSQL_CONFIG[:database]}",
  :username => MYSQL_CONFIG[:username],
  :password => MYSQL_CONFIG[:password],
}

ActiveRecord::Base.establish_connection(JDBC_CONFIG)<commit_msg>explicit MySQL default port no if missing in (test) config for JDBC URL<commit_after>require 'test_helper'
require 'db/mysql_config'

require 'jdbc/mysql' # driver not loaded for plain JDBC
Jdbc::MySQL.load_driver

JDBC_CONFIG = {
  :adapter => 'jdbc',
  :driver => 'com.mysql.jdbc.Driver',
  :username => MYSQL_CONFIG[:username],
  :password => <PASSWORD>],
}
JDBC_CONFIG[:url] = "jdbc:mysql://" << 
  "#{MYSQL_CONFIG[:host]}:#{MYSQL_CONFIG[:port] || 3306}/#{MYSQL_CONFIG[:database]}"

ActiveRecord::Base.establish_connection(JDBC_CONFIG)
{'fraction_non_alphanumeric': 0.167853509664293, 'fraction_numerical': 0.004069175991861648, 'mean_word_length': 6.569230769230769, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '1017444', 'n_tokens_mistral': 357, 'n_tokens_neox': 345, 'n_words': 63}