myreplicator 1.1.28 → 1.1.29
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.
@@ -121,7 +121,8 @@ module Myreplicator
|
|
121
121
|
:source_schema => @export_obj.source_schema,
|
122
122
|
:table => @export_obj.table_name,
|
123
123
|
:filepath => filepath,
|
124
|
-
:destination_schema => @export_obj.destination_schema
|
124
|
+
:destination_schema => @export_obj.destination_schema,
|
125
|
+
:enclosed_by => Myreplicator.configs[@export_obj.source_schema]["enclosed_by"]}
|
125
126
|
|
126
127
|
schema_status = Myreplicator::MysqlExporter.schema_changed?(options)
|
127
128
|
Kernel.p "===== schema_status ====="
|
@@ -132,7 +133,7 @@ module Myreplicator
|
|
132
133
|
options[:incremental_col] = @export_obj.incremental_column
|
133
134
|
options[:incremental_col_type] = @export_obj.incremental_column_type
|
134
135
|
#options[:incremental_val] = @export_obj.max_incremental_value
|
135
|
-
options[:incremental_val] = [@export_obj.destination_max_incremental_value, @export_obj.max_incremental_value].min
|
136
|
+
options[:incremental_val] = [@export_obj.destination_max_incremental_value, @export_obj.max_incremental_value].min
|
136
137
|
end
|
137
138
|
|
138
139
|
#Kernel.p "===== incremental_export_into_outfile OPTIONS ====="
|
@@ -123,8 +123,12 @@ module Myreplicator
|
|
123
123
|
Kernel.p options
|
124
124
|
sql = "SELECT * INTO OUTFILE '#{options[:filepath]}' "
|
125
125
|
|
126
|
-
|
127
|
-
|
126
|
+
if options[:enclosed_by].blank?
|
127
|
+
sql += " FIELDS TERMINATED BY '\\0' ESCAPED BY '' LINES TERMINATED BY ';~~;\n'"
|
128
|
+
else
|
129
|
+
sql += " FIELDS TERMINATED BY '\\0' ESCAPED BY '' OPTIONALLY ENCLOSED BY '\\\"' LINES TERMINATED BY ';~~;\n'"
|
130
|
+
end
|
131
|
+
|
128
132
|
sql += "FROM #{options[:db]}.#{options[:table]} "
|
129
133
|
|
130
134
|
if !options[:incremental_col].blank? && !options[:incremental_val].blank?
|
@@ -86,7 +86,7 @@ module Myreplicator
|
|
86
86
|
puts options
|
87
87
|
# How not to hard code the vertica connection config ?
|
88
88
|
vertica_options = ActiveRecord::Base.configurations["vertica"]
|
89
|
-
|
89
|
+
enclosed_by = Myreplicator.configs[options[:source_schema]]['enclosed_by']
|
90
90
|
options.reverse_merge!(:host => vertica_options["host"],
|
91
91
|
:user => vertica_options["username"],
|
92
92
|
:pass => vertica_options["password"],
|
@@ -97,7 +97,7 @@ module Myreplicator
|
|
97
97
|
:delimiter => "\\0",
|
98
98
|
:null_value => "NULL",
|
99
99
|
:line_terminate => ";~~;\n",
|
100
|
-
:enclosed => '')
|
100
|
+
:enclosed => "#{Myreplicator.configs[options[:source_schema]]['enclosed_by']}")
|
101
101
|
#:enclosed => '\"')
|
102
102
|
# working now but should fix this
|
103
103
|
if !vertica_options["vsql"].blank?
|
@@ -130,6 +130,7 @@ module Myreplicator
|
|
130
130
|
ops = {:mysql_schema => schema_check[:mysql_schema],
|
131
131
|
:vertica_db => options[:db],
|
132
132
|
:vertica_schema => options[:destination_schema],
|
133
|
+
:source_schema => options[:source_schema],
|
133
134
|
:table => options[:table_name],
|
134
135
|
:export_id => options[:export_id],
|
135
136
|
:filepath => options[:filepath]
|
data/lib/myreplicator/version.rb
CHANGED
@@ -8848,3 +8848,17 @@ Connecting to database specified by database.yml
|
|
8848
8848
|
Connecting to database specified by database.yml
|
8849
8849
|
Connecting to database specified by database.yml
|
8850
8850
|
Connecting to database specified by database.yml
|
8851
|
+
Connecting to database specified by database.yml
|
8852
|
+
Connecting to database specified by database.yml
|
8853
|
+
Connecting to database specified by database.yml
|
8854
|
+
Connecting to database specified by database.yml
|
8855
|
+
Connecting to database specified by database.yml
|
8856
|
+
Connecting to database specified by database.yml
|
8857
|
+
Connecting to database specified by database.yml
|
8858
|
+
Connecting to database specified by database.yml
|
8859
|
+
Connecting to database specified by database.yml
|
8860
|
+
Connecting to database specified by database.yml
|
8861
|
+
Connecting to database specified by database.yml
|
8862
|
+
Connecting to database specified by database.yml
|
8863
|
+
Connecting to database specified by database.yml
|
8864
|
+
Connecting to database specified by database.yml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myreplicator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.29
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -359,7 +359,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
segments:
|
361
361
|
- 0
|
362
|
-
hash: -
|
362
|
+
hash: -530255392242392839
|
363
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
364
364
|
none: false
|
365
365
|
requirements:
|
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
368
|
version: '0'
|
369
369
|
segments:
|
370
370
|
- 0
|
371
|
-
hash: -
|
371
|
+
hash: -530255392242392839
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
374
|
rubygems_version: 1.8.24
|