Meituan-Dianping / Meituan-Dianping/SQLAdvisor
在ubuntu16上安装后,./sqladvisor --help执行结果是[ERROR] setlocale 有错
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 5.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
`root@ubuntu:/opt/sqlAdvisor/SQLAdvisor/sqladvisor# make
Scanning dependencies of target sqladvisor
[ 50%] Building CXX object CMakeFiles/sqladvisor.dir/main.cc.o
In file included from /usr/local/sqlparser/include/sql/item.h:2470:0,
from /usr/local/sqlparser/include/sql/sql_class.h:39,
from /opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc:7:
/usr/local/sqlparser/include/sql/item_timefunc.h: In member function 'virtual longlong Item_time_func::val_int()':
/usr/local/sqlparser/include/sql/item_timefunc.h:533:12: warning: converting to non-pointer type 'longlong {aka long long int}' from NULL [-Wconversion-null]
return NULL;
^
/opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc: In function 'void final_table_drived()':
/opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc:333:37: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::set<TABLE_LIST*>::size_type {aka long unsigned int}' [-Wformat=]
TABLE_DRIVERD.size());
^
/opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc:353:126: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::set<TABLE_LIST*>::size_type {aka long unsigned int}' [-Wformat=]
sql_print_information("第%d步:侯选驱动表个数:%d,但无法确定驱动表 \n", STEP_CNT++,TABLE_DRIVERD.size());
^
/opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc: In function 'int mysql_sql_parse_field_cardinality_new(Item_field*, const char*)':
/opt/sqlAdvisor/SQLAdvisor/sqladvisor/main.cc:604:76: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ulonglong {aka long long unsigned int}' [-Wformat=]
tablename, table_count, rand_rows, field_print, cardinality);
^
[100%] Linking CXX executable sqladvisor
[100%] Built target sqladvisor
root@ubuntu:/opt/sqlAdvisor/SQLAdvisor/sqladvisor# ./sqladvisor
2018-06-13 18:45:10 5781 [ERROR] setlocale 有错
root@ubuntu:/opt/sqlAdvisor/SQLAdvisor/sqladvisor# ./sqladvisor --help
2018-06-13 18:46:11 5783 [ERROR] setlocale 有错`
到最后一步,make后,生成了可以执行的sqladvisor,
执行 ./sqladvisor --help的结果提示错误,如上面所示。
SQLAdvisor/sqladvisor/CMakeList.txt的内容如下:
`root@ubuntu:/opt/sqlAdvisor/SQLAdvisor/sqladvisor# more CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project(sqladvisor)
include_directories("/usr/local/sqlparser/include")
include_directories("/usr/local/sqlparser/include/regex")
include_directories("/usr/lib/x86_64-linux-gnu/glib-2.0/include")
include_directories("/usr/include/glib-2.0")
link_directories("/usr/local/sqlparser/lib")
link_directories("/usr/lib64")
set(TEST_SRC main.cc)
add_executable(sqladvisor ${TEST_SRC})
target_link_libraries(sqladvisor sqlparser-debug)
target_link_libraries(sqladvisor perconaserverclient_r)
target_link_libraries(sqladvisor glib-2.0)
`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the problem with ./sqladvisor --help on Ubuntu 16, then inspect main.cc and CMakeLists.txt for the locale setup and linked dependencies. Done means the command runs without the setlocale error while preserving the existing build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, ubuntu
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100