Class: Mysql2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/resolver_replace/plugins/mysql2.rb

Instance Method Summary collapse

Instance Method Details

#connect(user, pass, host, port, database, socket, flags) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/resolver_replace/plugins/mysql2.rb', line 7

def connect user, pass, host, port, database, socket, flags
  begin
    ip = ResolverReplace.getaddress(host).to_s
    original_resolver_connect user, pass, ip, port, database, socket, flags
  rescue ResolverReplace.error_class => e
    raise Mysql2::Error, "#{e.class}: #{e.message}"
  end
end

#original_resolver_connectObject


6
# File 'lib/resolver_replace/plugins/mysql2.rb', line 6

alias original_resolver_connect connect