@@ -97,6 +97,7 @@ def initialize
9797 @result_exist = false
9898 @local_infile = nil
9999 @ssl_mode = SSL_MODE_PREFERRED
100+ @get_server_public_key = false
100101 end
101102
102103 # Connect to mysqld.
@@ -113,7 +114,7 @@ def connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=0
113114 warn 'unsupported flag: CLIENT_COMPRESS' if $VERBOSE
114115 flag &= ~CLIENT_COMPRESS
115116 end
116- @protocol = Protocol . new host , port , socket , @connect_timeout , @read_timeout , @write_timeout , @local_infile , @ssl_mode
117+ @protocol = Protocol . new host , port , socket , @connect_timeout , @read_timeout , @write_timeout , @local_infile , @ssl_mode , @get_server_public_key
117118 @protocol . authenticate user , passwd , db , flag , @charset
118119 @charset ||= @protocol . charset
119120 @host_info = ( host . nil? || host == "localhost" ) ? 'Localhost via UNIX socket' : "#{ host } via TCP/IP"
@@ -145,7 +146,8 @@ def close!
145146 # Set option for connection.
146147 #
147148 # Available options:
148- # Mysql::INIT_COMMAND, Mysql::OPT_CONNECT_TIMEOUT, Mysql::OPT_READ_TIMEOUT,
149+ # Mysql::INIT_COMMAND, Mysql::OPT_CONNECT_TIMEOUT, Mysql::OPT_GET_SERVER_PUBLIC_KEY,
150+ # Mysql::OPT_LOAD_DATA_LOCAL_DIR, Mysql::OPT_LOCAL_INFILE, Mysql::OPT_READ_TIMEOUT,
149151 # Mysql::OPT_SSL_MODE, Mysql::OPT_WRITE_TIMEOUT, Mysql::SET_CHARSET_NAME
150152 # @param [Integer] opt option
151153 # @param [Integer] value option value that is depend on opt
@@ -165,7 +167,8 @@ def options(opt, value=nil)
165167# when Mysql::OPT_CONNECT_ATTR_RESET
166168 when Mysql ::OPT_CONNECT_TIMEOUT
167169 @connect_timeout = value
168- # when Mysql::OPT_GET_SERVER_PUBLIC_KEY
170+ when Mysql ::OPT_GET_SERVER_PUBLIC_KEY
171+ @get_server_public_key = value
169172 when Mysql ::OPT_LOAD_DATA_LOCAL_DIR
170173 @local_infile = value
171174 when Mysql ::OPT_LOCAL_INFILE
0 commit comments