11/*
22 Copyright (c) 2000, 2018, Oracle and/or its affiliates.
3- Copyright (c) 2009, 2021 , MariaDB Corporation.
3+ Copyright (c) 2009, 2022 , MariaDB Corporation.
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
4242#include < violite.h>
4343#include < my_sys.h>
4444#include < source_revision.h>
45- #if defined(USE_LIBEDIT_INTERFACE) && defined( HAVE_LOCALE_H)
45+ #if defined(HAVE_LOCALE_H)
4646#include < locale.h>
4747#endif
4848
@@ -1491,7 +1491,7 @@ static bool do_connect(MYSQL *mysql, const char *host, const char *user,
14911491 if (opt_secure_auth)
14921492 mysql_options (mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
14931493#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
1494- if (opt_use_ssl)
1494+ if (opt_use_ssl && opt_protocol <= MYSQL_PROTOCOL_SOCKET )
14951495 {
14961496 mysql_ssl_set (mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
14971497 opt_ssl_capath, opt_ssl_cipher);
@@ -2506,7 +2506,7 @@ static bool add_line(String &buffer, char *line, size_t line_length,
25062506 !(*in_string &&
25072507 (mysql.server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)))
25082508 {
2509- // Found possbile one character command like \c
2509+ // Found possible one character command like \c
25102510
25112511 /*
25122512 The null-terminating character (ASCII '\0') marks the end of user
@@ -2857,6 +2857,9 @@ static void initialize_readline ()
28572857 /* Allow conditional parsing of the ~/.inputrc file. */
28582858 rl_readline_name= (char *) " mysql" ;
28592859 rl_terminal_name= getenv (" TERM" );
2860+ #ifdef HAVE_SETLOCALE
2861+ setlocale (LC_ALL," " );
2862+ #endif
28602863
28612864 /* Tell the completer that we want a crack first. */
28622865#if defined(USE_NEW_READLINE_INTERFACE)
@@ -2865,9 +2868,6 @@ static void initialize_readline ()
28652868
28662869 rl_add_defun (" magic-space" , (rl_command_func_t *)&fake_magic_space, -1 );
28672870#elif defined(USE_LIBEDIT_INTERFACE)
2868- #ifdef HAVE_LOCALE_H
2869- setlocale (LC_ALL," " ); /* so as libedit use isprint */
2870- #endif
28712871 rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
28722872 rl_completion_entry_function= &no_completion;
28732873 rl_add_defun (" magic-space" , (Function*)&fake_magic_space, -1 );
@@ -3791,7 +3791,6 @@ print_table_data(MYSQL_RES *result)
37913791{
37923792 String separator (256 );
37933793 MYSQL_ROW cur;
3794- MYSQL_FIELD *field;
37953794 bool *num_flag;
37963795
37973796 num_flag=(bool *) my_alloca (sizeof (bool )*mysql_num_fields (result));
@@ -3803,7 +3802,7 @@ print_table_data(MYSQL_RES *result)
38033802 mysql_field_seek (result,0 );
38043803 }
38053804 separator.copy (" +" ,1 ,charset_info);
3806- while ((field = mysql_fetch_field (result) ))
3805+ while (MYSQL_FIELD *field = mysql_fetch_field (result))
38073806 {
38083807 uint length= column_names ? field->name_length : 0 ;
38093808 if (quick)
@@ -3825,7 +3824,7 @@ print_table_data(MYSQL_RES *result)
38253824 {
38263825 mysql_field_seek (result,0 );
38273826 (void ) tee_fputs (" |" , PAGER);
3828- for (uint off= 0 ; ( field = mysql_fetch_field (result)) ; off++ )
3827+ while (MYSQL_FIELD * field= mysql_fetch_field (result))
38293828 {
38303829 size_t name_length= (uint) strlen (field->name );
38313830 size_t numcells= charset_info->numcells (field->name ,
@@ -3867,7 +3866,7 @@ print_table_data(MYSQL_RES *result)
38673866 data_length= (uint) lengths[off];
38683867 }
38693868
3870- field= mysql_fetch_field (result);
3869+ MYSQL_FIELD * field= mysql_fetch_field (result);
38713870 field_max_length= field->max_length ;
38723871
38733872 /*
0 commit comments