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 2
2
3
3
#include < algorithm>
4
4
#include < limits>
5
+ #include < locale.h>
5
6
#include " sql/mysqld.h"
6
7
#include " sql/sql_class.h"
7
8
#include " sql/sql_lex.h"
@@ -1339,14 +1340,21 @@ int main(int argc, char **argv) {
1339
1340
char *query = NULL ;
1340
1341
char *sqlparse_path = strdup (" /usr/local/sqlparser" );
1341
1342
int i = 0 ;
1342
-
1343
+ char *lc = NULL ;
1343
1344
if (mysqld_init (sqlparse_path)) {
1344
1345
sql_print_error (" 加载sqlparser模块有错 \n " );
1345
1346
if (sqlparse_path) free (sqlparse_path);
1346
1347
return -1 ;
1347
1348
}
1348
1349
if (sqlparse_path) free (sqlparse_path);
1349
1350
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
+
1350
1358
ConnectionOptionsInit (&options);
1351
1359
context = g_option_context_new (" sqladvisor" );
1352
1360
g_option_context_add_main_entries (context, entries, NULL );
You can’t perform that action at this time.
0 commit comments