From f547d11cf4447f0708c222e1fc882701bceefaa1 Mon Sep 17 00:00:00 2001 From: longxuegang Date: Fri, 10 Mar 2017 17:37:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9README.md,=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E4=B8=80=E4=BA=9B=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73cd332..f3073c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ### 一、简介 -SQLAdvisor是由美团点评公司技术工程部DBA团队(北京)开发维护的一个分析SQL给出索引优化建议的工具。它基于MySQL原生态词法解析,结合分析SQL中的where条件、聚合条件、多表Join关系 给出索引优化建议。**目前SQLAdvisor在美团点评广泛应用,包括美团支付、酒店旅游、外卖、团购等产品线,公司内部对SQLAdvisor的开发全面转到github上,开源和内部使用保持一致**。 +SQLAdvisor是由美团点评公司技术工程部DBA团队(北京)开发维护的一个分析SQL给出索引优化建议的工具。它基于MySQL原生态词法解析,结合分析SQL中的where条件、聚合条件、多表Join关系 给出索引优化建议。**目前SQLAdvisor在美团点评内部广泛应用,公司内部对SQLAdvisor的开发全面转到github上,开源和内部使用保持一致**。 **主要功能:输出SQL索引优化建议** From ce1652d8e476d52d98fc74b36a4ad026eea8ba79 Mon Sep 17 00:00:00 2001 From: tsthght <781181214@qq.com> Date: Tue, 14 Mar 2017 08:43:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bugfix:=E4=BF=AE=E5=A4=8D=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=A1=8C=E4=B8=8D=E6=94=AF=E6=8C=81=E4=B8=AD=E6=96=87=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(issue=20#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqladvisor/main.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sqladvisor/main.cc b/sqladvisor/main.cc index 36882a7..b39b625 100644 --- a/sqladvisor/main.cc +++ b/sqladvisor/main.cc @@ -2,6 +2,7 @@ #include #include +#include #include "sql/mysqld.h" #include "sql/sql_class.h" #include "sql/sql_lex.h" @@ -1339,7 +1340,7 @@ int main(int argc, char **argv) { char *query = NULL; char *sqlparse_path = strdup("/usr/local/sqlparser"); int i = 0; - + char *lc = NULL; if (mysqld_init(sqlparse_path)) { sql_print_error("加载sqlparser模块有错 \n"); if(sqlparse_path) free(sqlparse_path); @@ -1347,6 +1348,13 @@ int main(int argc, char **argv) { } if(sqlparse_path) free(sqlparse_path); + lc = setlocale(LC_ALL, ""); + if (NULL == lc) { + sql_print_error("setlocale 有错 \n"); + if(sqlparse_path) free(sqlparse_path); + return -1; + } + ConnectionOptionsInit(&options); context = g_option_context_new("sqladvisor"); g_option_context_add_main_entries(context, entries, NULL);