File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 22
33#include < algorithm>
44#include < limits>
5+ #include < locale.h>
56#include " sql/mysqld.h"
67#include " sql/sql_class.h"
78#include " sql/sql_lex.h"
@@ -1339,14 +1340,21 @@ int main(int argc, char **argv) {
13391340 char *query = NULL ;
13401341 char *sqlparse_path = strdup (" /usr/local/sqlparser" );
13411342 int i = 0 ;
1342-
1343+ char *lc = NULL ;
13431344 if (mysqld_init (sqlparse_path)) {
13441345 sql_print_error (" 加载sqlparser模块有错 \n " );
13451346 if (sqlparse_path) free (sqlparse_path);
13461347 return -1 ;
13471348 }
13481349 if (sqlparse_path) free (sqlparse_path);
13491350
1351+ lc = setlocale (LC_ALL, " " );
1352+ if (NULL == lc) {
1353+ sql_print_error (" setlocale 有错 \n " );
1354+ if (sqlparse_path) free (sqlparse_path);
1355+ return -1 ;
1356+ }
1357+
13501358 ConnectionOptionsInit (&options);
13511359 context = g_option_context_new (" sqladvisor" );
13521360 g_option_context_add_main_entries (context, entries, NULL );
You can’t perform that action at this time.
0 commit comments