diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-06-30 16:38:05 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-06-30 16:38:05 +0200 |
commit | 932646b1ff6a8f5815a961340a9e1ee4702f5b44 (patch) | |
tree | 5bc42ace8ae1f7e4d00baffd468bdb7564e851f1 /storage/oqgraph | |
parent | 0bb30f3603b519780eaf3fe0527b1c6af285229a (diff) | |
parent | 33492ec8d4e2077cf8e07d0628a959d8729bd1f9 (diff) | |
download | mariadb-git-932646b1ff6a8f5815a961340a9e1ee4702f5b44.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage/oqgraph')
-rw-r--r-- | storage/oqgraph/CMakeLists.txt | 53 | ||||
-rw-r--r-- | storage/oqgraph/ha_oqgraph.cc | 6 | ||||
-rw-r--r-- | storage/oqgraph/oqgraph_judy.cc | 22 | ||||
-rw-r--r-- | storage/oqgraph/oqgraph_shim.h | 2 |
4 files changed, 56 insertions, 27 deletions
diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 772a8f61bd5..613a44807c7 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -37,33 +37,36 @@ CHECK_CXX_SOURCE_COMPILES( int main() { return 0; } " OQGRAPH_OK) ENDIF() - -IF(OQGRAPH_OK) - ADD_DEFINITIONS(-DHAVE_OQGRAPH) - IF(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" PARENT_SCOPE) - # Fix problem with judy not finding inttypes.h on Windows: - ADD_DEFINITIONS(-DJU_WIN) - ELSE(MSVC) - # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being - STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive" PARENT_SCOPE) - ENDIF(MSVC) - - ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1) - MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc - oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc - STORAGE_ENGINE - MODULE_ONLY - RECOMPILE_FOR_EMBEDDED - COMPONENT oqgraph-engine - LINK_LIBRARIES ${Judy_LIBRARIES}) -ELSE(OQGRAPH_OK) - MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled") -ENDIF(OQGRAPH_OK) ENDFUNCTION() IF(NOT DEFINED OQGRAPH_OK) CHECK_OQGRAPH() + IF (NOT OQGRAPH_OK) + MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled") + ENDIF() +ENDIF() + +IF(NOT OQGRAPH_OK) + RETURN() ENDIF() + +ADD_DEFINITIONS(-DHAVE_OQGRAPH) +IF(MSVC) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # Fix problem with judy not finding inttypes.h on Windows: + ADD_DEFINITIONS(-DJU_WIN) +ELSE(MSVC) + # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being + STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive") +ENDIF(MSVC) + +ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1) +MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc + oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc + STORAGE_ENGINE + MODULE_ONLY + RECOMPILE_FOR_EMBEDDED + COMPONENT oqgraph-engine + LINK_LIBRARIES ${Judy_LIBRARIES}) diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 9247d778e98..6e6377b7068 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -63,7 +63,7 @@ #ifdef VERBOSE_DEBUG #else #undef DBUG_PRINT -#define DBUG_PRINT(x ...) +#define DBUG_PRINT(x,y) #endif #ifdef RETAIN_INT_LATCH_COMPATIBILITY @@ -1136,6 +1136,10 @@ int ha_oqgraph::info(uint flag) int ha_oqgraph::extra(enum ha_extra_function operation) { + if (graph->get_thd() != ha_thd()) { + DBUG_PRINT( "oq-debug", ("rnd_pos g->table->in_use: 0x%lx <-- current_thd 0x%lx", (long) graph->get_thd(), (long) current_thd)); + graph->set_thd(current_thd); + } return edges->file->extra(operation); } diff --git a/storage/oqgraph/oqgraph_judy.cc b/storage/oqgraph/oqgraph_judy.cc index 020cab57ed2..44c7e28e268 100644 --- a/storage/oqgraph/oqgraph_judy.cc +++ b/storage/oqgraph/oqgraph_judy.cc @@ -23,6 +23,28 @@ */ #include "oqgraph_judy.h" + +/* + Currently the only active code that can return error is: + judy_bitset::reset()/J1U() + judy_bitset::setbit()/J1S() + + In most cases errors are either about wrong parameters passed to Judy + functions or internal structures corruption. These definitely deserve + abnormal process termination instead of exit() as it is done by original + JUDYERROR. + + TODO: there's one exception that should be handled properly though: OOM. +*/ +#include <stdio.h> +#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \ + { \ + (void) fprintf(stderr, "File '%s', line %d: %s(), " \ + "JU_ERRNO_* == %d, ID == %d\n", \ + CallerFile, CallerLine, \ + JudyFunc, JudyErrno, JudyErrID); \ + abort(); \ + } #include <Judy.h> void open_query::judy_bitset::clear() diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h index 6ea9d10631f..af240b88ebd 100644 --- a/storage/oqgraph/oqgraph_shim.h +++ b/storage/oqgraph/oqgraph_shim.h @@ -254,7 +254,7 @@ namespace boost typedef no_property type; }; -#if BOOST_VERSION >= 104601 +#if BOOST_VERSION < 106000 && BOOST_VERSION >= 104601 template <> struct graph_bundle_type<oqgraph3::graph> { |