summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-12-03 14:21:13 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2021-12-03 15:36:40 +0100
commitdd01f8a94183702f98906913cebebe0a61de3f47 (patch)
tree4099970a622c22247289f5f734372180ffa765f4
parent4ac7001728c70dd54204143510992a06f6f1915e (diff)
downloadmariadb-git-10.8-MDEV-26713.tar.gz
Adjust console codepage for other utilities working with console10.8-MDEV-26713
-rw-r--r--client/mysqladmin.cc1
-rw-r--r--client/mysqlcheck.c1
-rw-r--r--client/mysqlimport.c1
-rw-r--r--client/mysqlshow.c1
-rw-r--r--include/my_sys.h2
5 files changed, 6 insertions, 0 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 6fa5d6c73d0..a7159d2bb6a 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -438,6 +438,7 @@ int main(int argc,char *argv[])
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME))
default_charset= (char *)my_default_csname();
+ my_set_console_cp(default_charset);
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
error_flags= (myf)(opt_nobeep ? 0 : ME_BELL);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 480308aa015..eb063765a37 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -503,6 +503,7 @@ static int get_options(int *argc, char ***argv)
printf("Unsupported character set: %s\n", default_charset);
DBUG_RETURN(1);
}
+ my_set_console_cp(default_charset);
if (*argc > 0 && opt_alldbs)
{
printf("You should give only options, no arguments at all, with option\n");
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 8723641c74b..48f11667cd1 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -525,6 +525,7 @@ static MYSQL *db_connect(char *host, char *database,
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME))
default_charset= (char *)my_default_csname();
+ my_set_console_cp(default_charset);
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, my_default_csname());
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 9b31d87225c..cbac1817c3c 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -147,6 +147,7 @@ int main(int argc, char **argv)
if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME))
default_charset= (char *)my_default_csname();
+ my_set_console_cp(default_charset);
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
diff --git a/include/my_sys.h b/include/my_sys.h
index 455a1c75654..7186cd03cb1 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1087,6 +1087,8 @@ extern char *get_tty_password(const char *opt_message);
/* File system character set */
extern CHARSET_INFO *fs_character_set(void);
extern int my_set_console_cp(const char *name);
+#else
+#define my_set_console_cp(A) do {} while (0)
#endif
extern const char *my_default_csname(void);
extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,