mysql_isolated_server 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ class MysqlIsolatedServer
|
|
14
14
|
@load_data_path = options[:data_path]
|
15
15
|
@port = options[:port]
|
16
16
|
@allow_output = options[:allow_output]
|
17
|
+
@server_id = rand(2**31)
|
17
18
|
end
|
18
19
|
|
19
20
|
def make_slave_of(master)
|
@@ -72,9 +73,8 @@ class MysqlIsolatedServer
|
|
72
73
|
tzinfo_to_sql = locate_executable("mysql_tzinfo_to_sql5", "mysql_tzinfo_to_sql")
|
73
74
|
raise "could not find mysql_tzinfo_to_sql" unless tzinfo_to_sql
|
74
75
|
system("#{tzinfo_to_sql} /usr/share/zoneinfo 2>/dev/null | mysql -h127.0.0.1 --database=mysql --port=#{@port} -u root mysql ")
|
75
|
-
|
76
|
-
|
77
|
-
system(%Q(mysql -h127.0.0.1 --port=#{@port} --database=mysql -u root -e "GRANT SELECT ON *.* to 'zdslave'@'localhost'"))
|
76
|
+
connection.query("SET GLOBAL time_zone='UTC'")
|
77
|
+
connection.query("SET GLOBAL server_id=#{@server_id}")
|
78
78
|
end
|
79
79
|
|
80
80
|
def grab_free_port
|