Skip to content

Commit 26a91bc

Browse files
committed
修正参数错误日志无法输出的问题
1 parent d2442e6 commit 26a91bc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

sqladvisor/main.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,14 @@ int main(int argc, char **argv) {
13391339
char *query = NULL;
13401340
char *sqlparse_path = strdup("/usr/local/sqlparser");
13411341
int i = 0;
1342+
1343+
if (mysqld_init(sqlparse_path)) {
1344+
sql_print_error("加载sqlparser模块有错 \n");
1345+
if(sqlparse_path) free(sqlparse_path);
1346+
return -1;
1347+
}
1348+
if(sqlparse_path) free(sqlparse_path);
1349+
13421350
ConnectionOptionsInit(&options);
13431351
context = g_option_context_new("sqladvisor");
13441352
g_option_context_add_main_entries(context, entries, NULL);
@@ -1363,13 +1371,6 @@ int main(int argc, char **argv) {
13631371
}
13641372
}
13651373

1366-
if (mysqld_init(sqlparse_path)) {
1367-
sql_print_error("加载sqlparser模块有错 \n");
1368-
if(sqlparse_path) free(sqlparse_path);
1369-
return -1;
1370-
}
1371-
if(sqlparse_path) free(sqlparse_path);
1372-
13731374
if (options.username == NULL || options.password == NULL
13741375
|| options.host == NULL || options.dbname == NULL
13751376
|| options.query[0] == NULL) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy