Skip to content

Commit c91a813

Browse files
committed
Allow using a different socket to test mysql
1 parent d4d14a3 commit c91a813

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

activerecord/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ namespace :db do
197197
namespace :mysql do
198198
connection_arguments = lambda do |connection_name|
199199
config = ARTest.config["connections"]["mysql2"][connection_name]
200-
["--user=#{config["username"]}", "--password=#{config["password"]}", ("--host=#{config["host"]}" if config["host"])].join(" ")
200+
["--user=#{config["username"]}", "--password=#{config["password"]}", ("--host=#{config["host"]}" if config["host"]), ("--socket=#{config["socket"]}" if config["socket"])].join(" ")
201201
end
202202

203203
desc "Build the MySQL test databases"

activerecord/test/config.example.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ connections:
4545
<% end %>
4646
<% if ENV['MYSQL_HOST'] %>
4747
host: <%= ENV['MYSQL_HOST'] %>
48+
<% end %>
49+
<% if ENV['MYSQL_SOCK'] %>
50+
socket: "<%= ENV['MYSQL_SOCK'] %>"
4851
<% end %>
4952
arunit2:
5053
username: rails
@@ -56,6 +59,9 @@ connections:
5659
<% if ENV['MYSQL_HOST'] %>
5760
host: <%= ENV['MYSQL_HOST'] %>
5861
<% end %>
62+
<% if ENV['MYSQL_SOCK'] %>
63+
socket: "<%= ENV['MYSQL_SOCK'] %>"
64+
<% end %>
5965

6066
oracle:
6167
arunit:

0 commit comments

Comments
 (0)