You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-879 Fix QueryStats linking issues
With 1.1 we have removed libdrizzle and used MariaDB's client library instead for both CrossEngine and QueryStats. Unfortunately MariaDB 10.2 has two client libraries which have different structs with the same name. When QueryStats was running inside the ColumnStore plugin this symbol conflict was causing a crash. The server's built-in client API has several different and several missing functions so some additions to sm.cpp were made to fill the gaps. This patch does the following: * Make sure that libmariadb is only linked to executables, not the ColumnStore Plugin (to avoid symbol conflicts). Note that all executables that link to CrossEngine and/or QueryStats need to link to libmariadb to avoid missing symbol issues. * Use the server's built-in client API for QueryStats when run in the plugin * Replace missing server built-in client API calls in sm.cpp (this is for QueryStats and CrossEngine to keep the dynamic linker happy) * Fixes issue where using 'localhost' as the MariaDB Server hostname would fail in QueryStats.
This commit is contained in:
@ -155,6 +155,8 @@ ENDIF()
|
|||||||
MESSAGE("SERVER_BUILD_INCLUDE_DIR = ${SERVER_BUILD_INCLUDE_DIR}")
|
MESSAGE("SERVER_BUILD_INCLUDE_DIR = ${SERVER_BUILD_INCLUDE_DIR}")
|
||||||
MESSAGE("SERVER_SOURCE_ROOT_DIR = ${SERVER_SOURCE_ROOT_DIR}")
|
MESSAGE("SERVER_SOURCE_ROOT_DIR = ${SERVER_SOURCE_ROOT_DIR}")
|
||||||
|
|
||||||
|
SET (MARIADB_CLIENT_LIBS -L${SERVER_BUILD_INCLUDE_DIR}/../libmariadb/libmariadb/ libmariadb.so)
|
||||||
|
|
||||||
#SET (ENGINE_UTILS_BOOSTIDB_INCLUDE "{CMAKE_CURRENT_SOURCE_DIR}/utils/boost_idb")
|
#SET (ENGINE_UTILS_BOOSTIDB_INCLUDE "{CMAKE_CURRENT_SOURCE_DIR}/utils/boost_idb")
|
||||||
SET (ENGINE_UTILS_MESSAGEQCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/messageqcpp")
|
SET (ENGINE_UTILS_MESSAGEQCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/messageqcpp")
|
||||||
SET (ENGINE_WE_SHARED_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/writeengine/shared")
|
SET (ENGINE_WE_SHARED_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/writeengine/shared")
|
||||||
|
@ -61,8 +61,6 @@ set(joblist_LIB_SRCS
|
|||||||
|
|
||||||
add_library(joblist SHARED ${joblist_LIB_SRCS})
|
add_library(joblist SHARED ${joblist_LIB_SRCS})
|
||||||
|
|
||||||
target_link_libraries(joblist -L${SERVER_BUILD_INCLUDE_DIR}/../libmariadb/libmariadb/ libmariadb.so)
|
|
||||||
|
|
||||||
set_target_properties(joblist PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
set_target_properties(joblist PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||||
|
@ -114,7 +114,7 @@ int LibMySQL::init(const char* h, unsigned int p, const char* u, const char* w,
|
|||||||
int LibMySQL::run(const char* query)
|
int LibMySQL::run(const char* query)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (mysql_query(fCon, query) != 0)
|
if (mysql_real_query(fCon, query, strlen(query)) != 0)
|
||||||
{
|
{
|
||||||
fErrStr = "fatal error reading result from crossengine client lib";
|
fErrStr = "fatal error reading result from crossengine client lib";
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
*
|
*
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <mysql.h>
|
||||||
|
#include <my_sys.h>
|
||||||
|
#include <errmsg.h>
|
||||||
|
#include <sql_common.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -458,3 +462,63 @@ void cpsm_conhdl_t::write(ByteStream bs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following functions exist because QueryStats is used by sm.
|
||||||
|
* QueryStats needs to use a MariaDB client connection and has to use the
|
||||||
|
* server's built-in client which doesn't have the same API as the general
|
||||||
|
* MariaDB client.
|
||||||
|
* These functions reproduce the missing functionality.
|
||||||
|
* Everywhere else QueryStats is linked to uses the general MariaDB API so
|
||||||
|
* these functions aren't needed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned long mysql_real_escape_string(MYSQL *mysql,
|
||||||
|
char *to,const char *from,
|
||||||
|
unsigned long length)
|
||||||
|
{
|
||||||
|
return escape_string_for_mysql(mysql->charset, to, length*2+1, from, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clone of sql-common/client.c cli_use_result
|
||||||
|
MYSQL_RES* mysql_use_result(MYSQL *mysql)
|
||||||
|
{
|
||||||
|
MYSQL_RES *result;
|
||||||
|
DBUG_ENTER("mysql_use_result (clone)");
|
||||||
|
|
||||||
|
if (!mysql->fields)
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
if (mysql->status != MYSQL_STATUS_GET_RESULT)
|
||||||
|
{
|
||||||
|
set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result)+
|
||||||
|
sizeof(ulong)*mysql->field_count,
|
||||||
|
MYF(MY_WME | MY_ZEROFILL))))
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
result->lengths=(ulong*) (result+1);
|
||||||
|
result->methods= mysql->methods;
|
||||||
|
if (!(result->row=(MYSQL_ROW)
|
||||||
|
my_malloc(sizeof(result->row[0])*(mysql->field_count+1), MYF(MY_WME))))
|
||||||
|
{ /* Ptrs: to one row */
|
||||||
|
my_free(result);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
result->fields= mysql->fields;
|
||||||
|
result->field_alloc= mysql->field_alloc;
|
||||||
|
result->field_count= mysql->field_count;
|
||||||
|
result->current_field=0;
|
||||||
|
result->handle= mysql;
|
||||||
|
result->current_row= 0;
|
||||||
|
mysql->fields=0; /* fields is now in result */
|
||||||
|
clear_alloc_root(&mysql->field_alloc);
|
||||||
|
mysql->status=MYSQL_STATUS_USE_RESULT;
|
||||||
|
mysql->unbuffered_fetch_owner= &result->unbuffered_fetch_cancelled;
|
||||||
|
DBUG_RETURN(result); /* Data is read to be fetched */
|
||||||
|
}
|
||||||
|
|
||||||
|
MYSQL_FIELD* mysql_fetch_fields(MYSQL_RES *res)
|
||||||
|
{
|
||||||
|
return res->fields;
|
||||||
|
}
|
||||||
|
@ -8,7 +8,7 @@ set(DDLProc_SRCS ddlproc.cpp ddlprocessor.cpp)
|
|||||||
|
|
||||||
add_executable(DDLProc ${DDLProc_SRCS})
|
add_executable(DDLProc ${DDLProc_SRCS})
|
||||||
|
|
||||||
target_link_libraries(DDLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool)
|
target_link_libraries(DDLProc ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool)
|
||||||
|
|
||||||
install(TARGETS DDLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS DDLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ set(DMLProc_SRCS
|
|||||||
|
|
||||||
add_executable(DMLProc ${DMLProc_SRCS})
|
add_executable(DMLProc ${DMLProc_SRCS})
|
||||||
|
|
||||||
target_link_libraries(DMLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool ddlcleanuputil batchloader)
|
target_link_libraries(DMLProc ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool ddlcleanuputil batchloader)
|
||||||
|
|
||||||
install(TARGETS DMLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS DMLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(ExeMgr_SRCS main.cpp activestatementcounter.cpp femsghandler.cpp)
|
|||||||
|
|
||||||
add_executable(ExeMgr ${ExeMgr_SRCS})
|
add_executable(ExeMgr ${ExeMgr_SRCS})
|
||||||
|
|
||||||
target_link_libraries(ExeMgr ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES} cacheutils threadpool)
|
target_link_libraries(ExeMgr ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} cacheutils threadpool)
|
||||||
|
|
||||||
install(TARGETS ExeMgr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS ExeMgr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(columnstoreDBWrite_SRCS columnstoreDB.cpp)
|
|||||||
|
|
||||||
add_executable(columnstoreDBWrite ${columnstoreDBWrite_SRCS})
|
add_executable(columnstoreDBWrite ${columnstoreDBWrite_SRCS})
|
||||||
|
|
||||||
target_link_libraries(columnstoreDBWrite ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(columnstoreDBWrite ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS columnstoreDBWrite DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS columnstoreDBWrite DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(columnstoreSupport_SRCS columnstoreSupport.cpp)
|
|||||||
|
|
||||||
add_executable(columnstoreSupport ${columnstoreSupport_SRCS})
|
add_executable(columnstoreSupport ${columnstoreSupport_SRCS})
|
||||||
|
|
||||||
target_link_libraries(columnstoreSupport ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(columnstoreSupport ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS columnstoreSupport DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS columnstoreSupport DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(mcsadmin_SRCS mcsadmin.cpp)
|
|||||||
|
|
||||||
add_executable(mcsadmin ${mcsadmin_SRCS})
|
add_executable(mcsadmin ${mcsadmin_SRCS})
|
||||||
|
|
||||||
target_link_libraries(mcsadmin ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS} ${ENGINE_WRITE_LIBS})
|
target_link_libraries(mcsadmin ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS} ${ENGINE_WRITE_LIBS})
|
||||||
|
|
||||||
install(TARGETS mcsadmin DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS mcsadmin DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(postConfigure_SRCS postConfigure.cpp helpers.cpp)
|
|||||||
|
|
||||||
add_executable(postConfigure ${postConfigure_SRCS})
|
add_executable(postConfigure ${postConfigure_SRCS})
|
||||||
|
|
||||||
target_link_libraries(postConfigure ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(postConfigure ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS postConfigure DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS postConfigure DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ set(installer_SRCS installer.cpp helpers.cpp)
|
|||||||
|
|
||||||
add_executable(installer ${installer_SRCS})
|
add_executable(installer ${installer_SRCS})
|
||||||
|
|
||||||
target_link_libraries(installer ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(installer ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS installer DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS installer DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ set(getMySQLpw_SRCS getMySQLpw.cpp)
|
|||||||
|
|
||||||
add_executable(getMySQLpw ${getMySQLpw_SRCS})
|
add_executable(getMySQLpw ${getMySQLpw_SRCS})
|
||||||
|
|
||||||
target_link_libraries(getMySQLpw ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(getMySQLpw ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS getMySQLpw DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS getMySQLpw DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ set(amazonInstaller_SRCS amazonInstaller.cpp helpers.cpp)
|
|||||||
|
|
||||||
add_executable(amazonInstaller ${amazonInstaller_SRCS})
|
add_executable(amazonInstaller ${amazonInstaller_SRCS})
|
||||||
|
|
||||||
target_link_libraries(amazonInstaller ${ENGINE_LDFLAGS} readline ncurses ${SNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(amazonInstaller ${ENGINE_LDFLAGS} readline ncurses ${SNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS amazonInstaller DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS amazonInstaller DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ set(mycnfUpgrade_SRCS mycnfUpgrade.cpp)
|
|||||||
|
|
||||||
add_executable(mycnfUpgrade ${mycnfUpgrade_SRCS})
|
add_executable(mycnfUpgrade ${mycnfUpgrade_SRCS})
|
||||||
|
|
||||||
target_link_libraries(mycnfUpgrade ${ENGINE_LDFLAGS} readline ncurses ${ENGINE_EXEC_LIBS})
|
target_link_libraries(mycnfUpgrade ${ENGINE_LDFLAGS} readline ncurses ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS mycnfUpgrade DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS mycnfUpgrade DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ set(ServerMonitor_SRCS
|
|||||||
|
|
||||||
add_executable(ServerMonitor ${ServerMonitor_SRCS})
|
add_executable(ServerMonitor ${ServerMonitor_SRCS})
|
||||||
|
|
||||||
target_link_libraries(ServerMonitor ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(ServerMonitor ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS ServerMonitor DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS ServerMonitor DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ set(PrimProc_SRCS
|
|||||||
|
|
||||||
add_executable(PrimProc ${PrimProc_SRCS})
|
add_executable(PrimProc ${PrimProc_SRCS})
|
||||||
|
|
||||||
target_link_libraries(PrimProc ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} threadpool cacheutils dbbc processor)
|
target_link_libraries(PrimProc ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} threadpool cacheutils dbbc processor)
|
||||||
|
|
||||||
install(TARGETS PrimProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS PrimProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(ProcMgr_SRCS main.cpp processmanager.cpp)
|
|||||||
|
|
||||||
add_executable(ProcMgr ${ProcMgr_SRCS})
|
add_executable(ProcMgr ${ProcMgr_SRCS})
|
||||||
|
|
||||||
target_link_libraries(ProcMgr ${ENGINE_LDFLAGS} cacheutils ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(ProcMgr ${ENGINE_LDFLAGS} cacheutils ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS ProcMgr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS ProcMgr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(ProcMon_SRCS main.cpp processmonitor.cpp)
|
|||||||
|
|
||||||
add_executable(ProcMon ${ProcMon_SRCS})
|
add_executable(ProcMon ${ProcMon_SRCS})
|
||||||
|
|
||||||
target_link_libraries(ProcMon ${ENGINE_LDFLAGS} cacheutils ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(ProcMon ${ENGINE_LDFLAGS} cacheutils ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS ProcMon DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS ProcMon DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(clearShm_SRCS main.cpp)
|
|||||||
|
|
||||||
add_executable(clearShm ${clearShm_SRCS})
|
add_executable(clearShm ${clearShm_SRCS})
|
||||||
|
|
||||||
target_link_libraries(clearShm ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(clearShm ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS clearShm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS clearShm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(cleartablelock_SRCS cleartablelock.cpp cleartablelockthread.cpp)
|
|||||||
|
|
||||||
add_executable(cleartablelock ${cleartablelock_SRCS})
|
add_executable(cleartablelock ${cleartablelock_SRCS})
|
||||||
|
|
||||||
target_link_libraries(cleartablelock ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS})
|
target_link_libraries(cleartablelock ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||||
|
|
||||||
install(TARGETS cleartablelock DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS cleartablelock DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(autoInstaller_SRCS autoInstaller.cpp)
|
|||||||
|
|
||||||
add_executable(autoInstaller ${autoInstaller_SRCS})
|
add_executable(autoInstaller ${autoInstaller_SRCS})
|
||||||
|
|
||||||
target_link_libraries(autoInstaller ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS} readline ncurses)
|
target_link_libraries(autoInstaller ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS} readline ncurses)
|
||||||
|
|
||||||
install(TARGETS autoInstaller DESTINATION ${ENGINE_BINDIR})
|
install(TARGETS autoInstaller DESTINATION ${ENGINE_BINDIR})
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ set(autoConfigure_SRCS autoConfigure.cpp)
|
|||||||
|
|
||||||
add_executable(autoConfigure ${autoConfigure_SRCS})
|
add_executable(autoConfigure ${autoConfigure_SRCS})
|
||||||
|
|
||||||
target_link_libraries(autoConfigure ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(autoConfigure ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS autoConfigure DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS autoConfigure DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ set(svnQuery_SRCS svnQuery.cpp)
|
|||||||
|
|
||||||
add_executable(svnQuery ${svnQuery_SRCS})
|
add_executable(svnQuery ${svnQuery_SRCS})
|
||||||
|
|
||||||
target_link_libraries(svnQuery ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(svnQuery ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS svnQuery DESTINATION ${ENGINE_BINDIR})
|
install(TARGETS svnQuery DESTINATION ${ENGINE_BINDIR})
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(cplogger_SRCS main.cpp)
|
|||||||
|
|
||||||
add_executable(cplogger ${cplogger_SRCS})
|
add_executable(cplogger ${cplogger_SRCS})
|
||||||
|
|
||||||
target_link_libraries(cplogger ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(cplogger ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS cplogger DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS cplogger DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(dbbuilder_SRCS dbbuilder.cpp systemcatalog.cpp)
|
|||||||
|
|
||||||
add_executable(dbbuilder ${dbbuilder_SRCS})
|
add_executable(dbbuilder ${dbbuilder_SRCS})
|
||||||
|
|
||||||
target_link_libraries(dbbuilder ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS})
|
target_link_libraries(dbbuilder ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||||
|
|
||||||
install(TARGETS dbbuilder DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS dbbuilder DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ set(colxml_SRCS colxml.cpp)
|
|||||||
|
|
||||||
add_executable(colxml ${colxml_SRCS})
|
add_executable(colxml ${colxml_SRCS})
|
||||||
|
|
||||||
target_link_libraries(colxml ${ENGINE_LDFLAGS} dbload ${ENGINE_WRITE_LIBS})
|
target_link_libraries(colxml ${ENGINE_LDFLAGS} dbload ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||||
|
|
||||||
install(TARGETS colxml DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS colxml DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(ddlcleanup_SRCS ddlcleanup.cpp)
|
|||||||
|
|
||||||
add_executable(ddlcleanup ${ddlcleanup_SRCS})
|
add_executable(ddlcleanup ${ddlcleanup_SRCS})
|
||||||
|
|
||||||
target_link_libraries(ddlcleanup ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} ddlcleanuputil)
|
target_link_libraries(ddlcleanup ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ddlcleanuputil)
|
||||||
|
|
||||||
install(TARGETS ddlcleanup DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS ddlcleanup DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(editem_SRCS editem.cpp)
|
|||||||
|
|
||||||
add_executable(editem ${editem_SRCS})
|
add_executable(editem ${editem_SRCS})
|
||||||
|
|
||||||
target_link_libraries(editem ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(editem ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS editem DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS editem DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(getConfig_SRCS main.cpp)
|
|||||||
|
|
||||||
add_executable(getConfig ${getConfig_SRCS})
|
add_executable(getConfig ${getConfig_SRCS})
|
||||||
|
|
||||||
target_link_libraries(getConfig ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(getConfig ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS getConfig DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS getConfig DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(setConfig_SRCS main.cpp)
|
|||||||
|
|
||||||
add_executable(setConfig ${setConfig_SRCS})
|
add_executable(setConfig ${setConfig_SRCS})
|
||||||
|
|
||||||
target_link_libraries(setConfig ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(setConfig ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS setConfig DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS setConfig DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ set(viewtablelock_SRCS viewtablelock.cpp)
|
|||||||
|
|
||||||
add_executable(viewtablelock ${viewtablelock_SRCS})
|
add_executable(viewtablelock ${viewtablelock_SRCS})
|
||||||
|
|
||||||
target_link_libraries(viewtablelock ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(viewtablelock ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS viewtablelock DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS viewtablelock DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||||
|
|
||||||
|
|
||||||
########### next target ###############
|
########### next target ###############
|
||||||
|
|
||||||
set(querystats_LIB_SRCS querystats.cpp)
|
set(querystats_LIB_SRCS querystats.cpp)
|
||||||
|
@ -210,6 +210,9 @@ void QueryStats::insert()
|
|||||||
if (mysql.fCon == NULL)
|
if (mysql.fCon == NULL)
|
||||||
handleMySqlError("fatal error initializing querystats lib", -1);
|
handleMySqlError("fatal error initializing querystats lib", -1);
|
||||||
|
|
||||||
|
unsigned int tcp_option = MYSQL_PROTOCOL_TCP;
|
||||||
|
mysql_options(mysql.fCon, MYSQL_OPT_PROTOCOL, &tcp_option);
|
||||||
|
|
||||||
if (mysql_real_connect(mysql.fCon, host.c_str(), user.c_str(), pwd.c_str(),
|
if (mysql_real_connect(mysql.fCon, host.c_str(), user.c_str(), pwd.c_str(),
|
||||||
SCHEMA.c_str(), port, NULL, 0) == NULL)
|
SCHEMA.c_str(), port, NULL, 0) == NULL)
|
||||||
handleMySqlError("fatal error setting up parms in querystats lib", mysql_errno(mysql.fCon));
|
handleMySqlError("fatal error setting up parms in querystats lib", mysql_errno(mysql.fCon));
|
||||||
@ -241,7 +244,7 @@ void QueryStats::insert()
|
|||||||
insert << fNumFiles << ", ";
|
insert << fNumFiles << ", ";
|
||||||
insert << fFileBytes << ")"; // the last 2 fields are not populated yet
|
insert << fFileBytes << ")"; // the last 2 fields are not populated yet
|
||||||
|
|
||||||
int ret = mysql_query(mysql.fCon, insert.str().c_str());
|
int ret = mysql_real_query(mysql.fCon, insert.str().c_str(), insert.str().length());
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
handleMySqlError("fatal error executing query in querystats lib", ret);
|
handleMySqlError("fatal error executing query in querystats lib", ret);
|
||||||
}
|
}
|
||||||
@ -287,6 +290,9 @@ uint32_t QueryStats::userPriority(string _host, const string _user)
|
|||||||
if (mysql.fCon == NULL)
|
if (mysql.fCon == NULL)
|
||||||
handleMySqlError("fatal error initializing querystats lib", -1);
|
handleMySqlError("fatal error initializing querystats lib", -1);
|
||||||
|
|
||||||
|
unsigned int tcp_option = MYSQL_PROTOCOL_TCP;
|
||||||
|
mysql_options(mysql.fCon, MYSQL_OPT_PROTOCOL, &tcp_option);
|
||||||
|
|
||||||
if (mysql_real_connect(mysql.fCon, host.c_str(), user.c_str(), pwd.c_str(),
|
if (mysql_real_connect(mysql.fCon, host.c_str(), user.c_str(), pwd.c_str(),
|
||||||
SCHEMA.c_str(), port, NULL, 0) == NULL)
|
SCHEMA.c_str(), port, NULL, 0) == NULL)
|
||||||
handleMySqlError("fatal error connecting to InfiniDB in querystats lib", mysql_errno(mysql.fCon));
|
handleMySqlError("fatal error connecting to InfiniDB in querystats lib", mysql_errno(mysql.fCon));
|
||||||
@ -307,7 +313,7 @@ uint32_t QueryStats::userPriority(string _host, const string _user)
|
|||||||
<< _user
|
<< _user
|
||||||
<< "') and upper(a.priority) = upper(b.priority)";
|
<< "') and upper(a.priority) = upper(b.priority)";
|
||||||
|
|
||||||
int ret =mysql_query(mysql.fCon, query.str().c_str());
|
int ret =mysql_real_query(mysql.fCon, query.str().c_str(), query.str().length());
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
handleMySqlError("fatal error executing query in querystats lib", ret);
|
handleMySqlError("fatal error executing query in querystats lib", ret);
|
||||||
// Using mysql_store_result here as for mysql_use_result we would need to get every row
|
// Using mysql_store_result here as for mysql_use_result we would need to get every row
|
||||||
|
@ -43,7 +43,7 @@ set(controllernode_SRCS masternode.cpp masterdbrmnode.cpp)
|
|||||||
|
|
||||||
add_executable(controllernode ${controllernode_SRCS})
|
add_executable(controllernode ${controllernode_SRCS})
|
||||||
|
|
||||||
target_link_libraries(controllernode ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} )
|
target_link_libraries(controllernode ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} )
|
||||||
|
|
||||||
install(TARGETS controllernode DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS controllernode DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ set(workernode_SRCS slavenode.cpp)
|
|||||||
|
|
||||||
add_executable(workernode ${workernode_SRCS})
|
add_executable(workernode ${workernode_SRCS})
|
||||||
|
|
||||||
target_link_libraries(workernode ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(workernode ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS workernode DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS workernode DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ set(dbrmctl_SRCS dbrmctl.cpp)
|
|||||||
|
|
||||||
add_executable(dbrmctl ${dbrmctl_SRCS})
|
add_executable(dbrmctl ${dbrmctl_SRCS})
|
||||||
|
|
||||||
target_link_libraries(dbrmctl ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS})
|
target_link_libraries(dbrmctl ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS})
|
||||||
|
|
||||||
install(TARGETS dbrmctl DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS dbrmctl DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ set(reset_locks_SRCS reset_locks.cpp)
|
|||||||
|
|
||||||
add_executable(reset_locks ${reset_locks_SRCS})
|
add_executable(reset_locks ${reset_locks_SRCS})
|
||||||
|
|
||||||
target_link_libraries(reset_locks ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
target_link_libraries(reset_locks ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS reset_locks DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS reset_locks DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ set(rollback_SRCS rollback.cpp)
|
|||||||
|
|
||||||
add_executable(rollback ${rollback_SRCS})
|
add_executable(rollback ${rollback_SRCS})
|
||||||
|
|
||||||
target_link_libraries(rollback ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
target_link_libraries(rollback ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS rollback DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS rollback DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ set(save_brm_SRCS save_brm.cpp)
|
|||||||
|
|
||||||
add_executable(save_brm ${save_brm_SRCS})
|
add_executable(save_brm ${save_brm_SRCS})
|
||||||
|
|
||||||
target_link_libraries(save_brm ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
target_link_libraries(save_brm ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS save_brm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS save_brm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ set(load_brm_SRCS load_brm.cpp)
|
|||||||
|
|
||||||
add_executable(load_brm ${load_brm_SRCS})
|
add_executable(load_brm ${load_brm_SRCS})
|
||||||
|
|
||||||
target_link_libraries(load_brm ${ENGINE_LDFLAGS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
target_link_libraries(load_brm ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_OAM_LIBS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS load_brm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS load_brm DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ set(cpimport.bin_SRCS cpimport.cpp)
|
|||||||
|
|
||||||
add_executable(cpimport.bin ${cpimport.bin_SRCS})
|
add_executable(cpimport.bin ${cpimport.bin_SRCS})
|
||||||
|
|
||||||
target_link_libraries(cpimport.bin ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} we_bulk we_xml)
|
target_link_libraries(cpimport.bin ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} we_bulk we_xml)
|
||||||
|
|
||||||
install(TARGETS cpimport.bin DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS cpimport.bin DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ set(WriteEngineServer_SRCS
|
|||||||
|
|
||||||
add_executable(WriteEngineServer ${WriteEngineServer_SRCS})
|
add_executable(WriteEngineServer ${WriteEngineServer_SRCS})
|
||||||
|
|
||||||
target_link_libraries(WriteEngineServer ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} threadpool writeengineredistribute)
|
target_link_libraries(WriteEngineServer ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} threadpool writeengineredistribute)
|
||||||
|
|
||||||
install(TARGETS WriteEngineServer DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS WriteEngineServer DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ set(cpimport_SRCS
|
|||||||
|
|
||||||
add_executable(cpimport ${cpimport_SRCS})
|
add_executable(cpimport ${cpimport_SRCS})
|
||||||
|
|
||||||
target_link_libraries(cpimport ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} batchloader threadpool)
|
target_link_libraries(cpimport ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} batchloader threadpool)
|
||||||
|
|
||||||
install(TARGETS cpimport DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
install(TARGETS cpimport DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user