Permalink
Browse files

Merge pull request #29 from wiseleyb/master

fixed bug around port=''
  • Loading branch information...
2 parents 672b233 + 8c83edc commit e16c6bb0d2c5143ac8d0d3e09eeafde37e080253 @maxlapshin committed Sep 16, 2011
Showing with 41 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +6 −0 Gemfile
  3. +21 −0 Gemfile.lock
  4. +2 −0 README.rdoc
  5. +3 −0 lib/mysql2psql/mysql_reader.rb
  6. +7 −0 test/integration/mysql_reader_base_test.rb
View
@@ -2,3 +2,5 @@
configs
test/fixtures/test*.sql
pkg
+.rvmrc
+.bundle
View
@@ -0,0 +1,6 @@
+source :rubygems
+
+gem 'mysql'
+gem 'pg'
+gem 'test-unit'
+gem 'jeweler'
View
@@ -0,0 +1,21 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ git (1.2.5)
+ jeweler (1.6.0)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ mysql (2.8.1)
+ pg (0.11.0)
+ rake (0.8.7)
+ test-unit (2.3.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jeweler
+ mysql
+ pg
+ test-unit
View
@@ -52,6 +52,8 @@ The 'mysql' gem in particular may need a hint on where to find the mysql headers
NB: With Ruby 1.8.x, the gem install will usually complain about "No definition for ..." errors. These are non-fatal and just affect the documentation install. This doesn't happen with Ruby 1.9.2.
+With bundler you can do a simple: bundle install
+
== Getting the source
Mysql2psql was first produced by Max Lapshin <max@maxidoors.ru> who maintains the master
repository at http://github.com/maxlapshin/mysql2postgres
@@ -179,6 +179,9 @@ def initialize(options)
options.mysqlhostname('localhost'), options.mysqlusername,
options.mysqlpassword, options.mysqldatabase,
options.mysqlport, options.mysqlsocket
+ @port = nil if @port == "" # for things like Amazon's RDS you don't have a port and connect fails with "" for a value
+ @sock = nil if @sock == ""
+ @flag = nil if @flag == ""
connect
end
@@ -32,4 +32,11 @@ def test_mysql_reconnect
reader.reconnect
end
end
+ def test_mysql_connection_without_port
+ assert_nothing_raised do
+ options.mysqlport = ""
+ options.mysqlsocket = ""
+ reader = Mysql2psql::MysqlReader.new(options)
+ end
+ end
end

0 comments on commit e16c6bb

Please sign in to comment.