Skip to content

Commit 542e6ca

Browse files
committed
allow running tests using rake test_mysql DRIVER=MariaDB
1 parent fd74fb4 commit 542e6ca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/db/mysql_config.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@
88

99
unless ( ps = ENV['PREPARED_STATEMENTS'] || ENV['PS'] ).nil?
1010
MYSQL_CONFIG[:prepared_statements] = ps
11+
end
12+
13+
if driver = ENV['DRIVER']
14+
if driver =~ /maria/i
15+
if driver.index('.').nil?
16+
driver = 'org.mariadb.jdbc.Driver'
17+
end
18+
jars = File.expand_path('../jars', File.dirname(__FILE__))
19+
if jar = Dir.glob("#{jars}/mariadb*.jar").last
20+
load jar
21+
end
22+
end
23+
MYSQL_CONFIG[:driver] = driver if driver.index('.')
1124
end

0 commit comments

Comments
 (0)