Added support for MariaDB 10.1 embedded library
The code used in the query classifier was not compatible with 10.1 version of MariaDB and needed to be fine tuned in order for it to work with all supported versions of MariaDB.
This commit is contained in:
parent
1b9920ef10
commit
23b2ce004b
@ -15,9 +15,9 @@ endif()
|
||||
|
||||
file(READ ${MYSQL_VERSION_H} MYSQL_VERSION_CONTENTS)
|
||||
string(REGEX REPLACE ".*MYSQL_SERVER_VERSION[^0-9.]+([0-9.]+).*" "\\1" MYSQL_VERSION ${MYSQL_VERSION_CONTENTS})
|
||||
string(REGEX REPLACE ".*MYSQL_COMPILATION_COMMENT.+\"(.+)\".*" "\\1" MYSQL_PROVIDER ${MYSQL_VERSION_CONTENTS})
|
||||
string(REGEX REPLACE ".*MYSQL_COMPILATION_COMMENT[[:space:]]+\"(.+)\".*" "\\1" MYSQL_PROVIDER ${MYSQL_VERSION_CONTENTS})
|
||||
string(TOLOWER ${MYSQL_PROVIDER} MYSQL_PROVIDER)
|
||||
if(MYSQL_PROVIDER MATCHES "mariadb")
|
||||
if(MYSQL_PROVIDER MATCHES "[mM]aria[dD][bB]")
|
||||
set(MYSQL_PROVIDER "MariaDB" CACHE INTERNAL "The MySQL provider")
|
||||
elseif(MYSQL_PROVIDER MATCHES "mysql")
|
||||
set(MYSQL_PROVIDER "MySQL" CACHE INTERNAL "The MySQL provider")
|
||||
@ -36,6 +36,17 @@ if(MYSQL_VERSION VERSION_LESS 5.5.41)
|
||||
message(WARNING "MySQL version is ${MYSQL_VERSION}. Minimum supported version is 5.5.41.")
|
||||
endif()
|
||||
|
||||
if(NOT (MYSQL_VERSION VERSION_LESS 10.1))
|
||||
|
||||
# 10.1 needs lzma
|
||||
find_library(HAVE_LIBLZMA NAMES lzma)
|
||||
if(NOT HAVE_LIBLZMA)
|
||||
message(FATAL_ERROR "Could not find liblzma")
|
||||
endif()
|
||||
set(LZMA_LINK_FLAGS "lzma" CACHE STRING "liblzma link flags")
|
||||
endif()
|
||||
|
||||
|
||||
if (DEFINED EMBEDDED_LIB)
|
||||
if( NOT (IS_DIRECTORY ${EMBEDDED_LIB}) )
|
||||
debugmsg("EMBEDDED_LIB is not a directory: ${EMBEDDED_LIB}")
|
||||
|
@ -352,7 +352,7 @@ static bool create_parse_tree(
|
||||
failp = TRUE;
|
||||
goto return_here;
|
||||
}
|
||||
mysql_reset_thd_for_next_command(thd);
|
||||
thd->reset_for_next_command();
|
||||
|
||||
/**
|
||||
* Set some database to thd so that parsing won't fail because of
|
||||
@ -804,7 +804,7 @@ static bool skygw_stmt_causes_implicit_commit(
|
||||
|
||||
switch (lex->sql_command) {
|
||||
case SQLCOM_DROP_TABLE:
|
||||
succp = !(lex->drop_temporary);
|
||||
succp = !(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE);
|
||||
break;
|
||||
case SQLCOM_ALTER_TABLE:
|
||||
case SQLCOM_CREATE_TABLE:
|
||||
|
@ -5,7 +5,7 @@ if(BUILD_TESTS OR BUILD_TOOLS)
|
||||
elseif(WITH_TCMALLOC)
|
||||
target_link_libraries(fullcore ${TCMALLOC_LIBRARIES})
|
||||
endif()
|
||||
target_link_libraries(fullcore ${CURL_LIBRARIES} utils log_manager pthread ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ssl aio rt crypt dl crypto inih z m stdc++)
|
||||
target_link_libraries(fullcore ${CURL_LIBRARIES} utils log_manager pthread ${LZMA_LINK_FLAGS} ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ssl aio rt crypt dl crypto inih z m stdc++)
|
||||
add_dependencies(fullcore pcre2)
|
||||
endif()
|
||||
|
||||
@ -22,7 +22,7 @@ elseif(WITH_TCMALLOC)
|
||||
target_link_libraries(maxscale ${TCMALLOC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
target_link_libraries(maxscale ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ${CURL_LIBRARIES} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++)
|
||||
target_link_libraries(maxscale ${LZMA_LINK_FLAGS} ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ${CURL_LIBRARIES} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++)
|
||||
install(TARGETS maxscale DESTINATION ${MAXSCALE_BINDIR})
|
||||
|
||||
add_executable(maxkeys maxkeys.c spinlock.c secrets.c utils.c gwdirs.c random_jkiss.c ${CMAKE_SOURCE_DIR}/log_manager/log_manager.cc)
|
||||
|
@ -20,7 +20,7 @@ add_executable(maxbinlogcheck maxbinlogcheck.c blr_file.c blr_cache.c blr_master
|
||||
${CMAKE_SOURCE_DIR}/log_manager/log_manager.cc)
|
||||
|
||||
|
||||
target_link_libraries(maxbinlogcheck utils ssl pthread ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} aio rt crypt dl crypto inih z m stdc++ ${CURL_LIBRARIES})
|
||||
target_link_libraries(maxbinlogcheck utils ssl pthread ${LZMA_LINK_FLAGS} ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} aio rt crypt dl crypto inih z m stdc++ ${CURL_LIBRARIES})
|
||||
|
||||
install(TARGETS maxbinlogcheck DESTINATION bin)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user