builder/extra/tools/ruby-tpm/configure/dbms_types/mysql.rb
# Execute mysql command and return result to client. 
Execute mysql command and return result to client.
Execute mysql command and return result to client .
def run(command)
    if Configurator.instance.get_ip_addresses(@host) == false
      return ""
    end
    begin
      if Configurator.instance.is_localhost?(@host)
        mysql_cmd = @config.getProperty(@prefix + [REPL_MYSQL_COMMAND])
        unless File.executable?(mysql_cmd)
          mysql_cmd = "mysql"
        end
      else
        mysql_cmd = "mysql"
      end
      tmp = Tempfile.new('options')
      tmp << "[client]\n"
      tmp << "user=#{@username}\n"
      tmp << "password=#{@password}\n"
      tmp << "port=#{@port}\n"
      if @sslca != ""
        tmp << "ssl-ca=#{@sslca}\n"
      end
      if @sslcert != ""
        tmp << "ssl-cert=#{@sslcert}\n"
      end
      if @sslkey != ""
        tmp << "ssl-key=#{@sslkey}\n"
      end
      tmp.flush
      Timeout.timeout(5) {
        return cmd_result("#{mysql_cmd} --defaults-file=#{tmp.path} -h#{@host} -e \"#{command}\"")
      }
    rescue Timeout::Error
    rescue RemoteCommandNotAllowed
    rescue => e
    end
    return ""
  end
def run ( command ) if Configurator . instance . get_ip_addresses ( @host ) == false return "" end begin if Configurator . instance . is_localhost? ( @host ) mysql_cmd = @config . getProperty ( @prefix + [ REPL_MYSQL_COMMAND ] ) unless File . executable? ( mysql_cmd ) mysql_cmd = "mysql" end else mysql_cmd = "mysql" end tmp = Tempfile . new ( 'options' ) tmp << "[client]\n" tmp << "user=#{@username}\n" tmp << "password=#{@password}\n" tmp << "port=#{@port}\n" if @sslca != "" tmp << "ssl-ca=#{@sslca}\n" end if @sslcert != "" tmp << "ssl-cert=#{@sslcert}\n" end if @sslkey != "" tmp << "ssl-key=#{@sslkey}\n" end tmp . flush Timeout . timeout ( 5 ) { return cmd_result ( "#{mysql_cmd} --defaults-file=#{tmp.path} -h#{@host} -e \"#{command}\"" ) } rescue Timeout :: Error rescue RemoteCommandNotAllowed rescue => e end return "" end
Execute mysql command and return result to client.
Execute mysql command and return result to client .
# Provisional workaround for MySQL 5.6 non-removable warning (Issue#445)
command