Skip to content

Commit

Permalink
MDEV-27525 Invalid (non-UTF8) characters found for option 'plugin_dir'
Browse files Browse the repository at this point in the history
Two Problems
1. Upgrade wizard failed to retrieve path to service executable,
if it contained non-ASCII.
Fixed by setlocale(LC_ALL, "en_US.UTF8"), which was missing in upgrade wizard

2.mysql_upgrade_service only updated (converted to UTF8) the server's sections
leaving client's as-is

Corrected typo.

3. Fixed assertion in my_getopt, turns out to be too strict.
  • Loading branch information
vaintroub committed Jan 18, 2022
1 parent 71966c7 commit 2e48fbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions mysys/my_getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ static void validate_value(const char *key, const char *value,
}
else
{
/*
Should never happen, non-UTF8 can be read from option's
file only.
*/
DBUG_ASSERT(0);
my_getopt_error_reporter(
WARNING_LEVEL, "%s: invalid (non-UTF8) characters for option %s",
my_progname, key);
Expand Down
2 changes: 1 addition & 1 deletion sql/upgrade_conf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static bool is_mariadb_section(const char *name, bool *is_server)
if (*is_server= !strcmp(section_name, name))
break;

return *is_server;
return true;
}


Expand Down
6 changes: 6 additions & 0 deletions win/upgrade_wizard/upgradeDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <vector>

#include <winservice.h>
#include <locale.h>

using namespace std;

Expand Down Expand Up @@ -271,6 +272,11 @@ BOOL CUpgradeDlg::OnInitDialog()

m_Progress.ShowWindow(SW_HIDE);
m_Ok.EnableWindow(FALSE);
if (GetACP() == CP_UTF8)
{
/* Required for mbstowcs, used in some functions.*/
setlocale(LC_ALL, "en_US.UTF8");
}
PopulateServicesList();
return TRUE; // return TRUE unless you set the focus to a control
}
Expand Down

0 comments on commit 2e48fbe

Please sign in to comment.