Open lefoyer opened 9 years ago
find work varint first add 'TARGET_LINK_LIBRARIES(disablemyisam myisam)' to end you CMakeList.txt next change instruction to
cp -r src /path/to/mysql-src/plugin/disable_myisam
cd /path/to/mysql-src
sed -i 's/SET(MYISAM_SOURCES/ADD_DEFINITIONS( -fPIC )\n\nSET(MYISAM_SOURCES/' storage/myisam/CMakeLists.txt
cmake . -DBUILD_CONFIG=mysql_release
cd storage/myisam
make
cd ../../
cd plugin/disable_myisam
make
make install
I use this plugin with mariadb-5.5.49, but I am unable to compile it. I see following error on cmake.
-- Looking for event.h - not found CMake Error at CMakeLists.txt:490 (TARGET_LINK_LIBRARIES): Attempt to add link library "myisam" to target "disablemyisam" which is not built in this directory.
Please help, thanks.
And gets following error when I follow https://github.com/xiezhenye/mysql-plugin-disable-myisam
[ 94%] Building CXX object plugin/disable_myisam/CMakeFiles/disablemyisam.dir/disable_myisam.cc.o In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:62, from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/set:60, from /opt/src/mariadb-5.5.49/plugin/disable_myisam/disable_myisam.cc:23: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:232:56: error: macro "min" passed 3 arguments, but takes just 2 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:253:56: error: macro "max" passed 3 arguments, but takes just 2 In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:62, from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/set:60, from /opt/src/mariadb-5.5.49/plugin/disable_myisam/disable_myisam.cc:23: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:186: error: expected unqualified-id before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:186: error: expected ‘)’ before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:186: error: expected ‘)’ before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:186: error: expected initializer before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:209: error: expected unqualified-id before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:209: error: expected ‘)’ before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:209: error: expected ‘)’ before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:209: error: expected initializer before ‘const’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:232: error: ‘std::min’ declared as an ‘inline’ variable /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:232: error: template declaration of ‘const _Tp& std::min’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:235: error: expected primary-expression before ‘if’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:235: error: expected ‘}’ before ‘if’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:237: error: expected unqualified-id before ‘return’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:253: error: ‘max’ declared as an ‘inline’ variable /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:253: error: template declaration of ‘const _Tp& max’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:256: error: expected primary-expression before ‘if’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:256: error: expected ‘}’ before ‘if’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:258: error: expected unqualified-id before ‘return’ /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:259: error: expected declaration before ‘}’ token make[2]: * [plugin/disable_myisam/CMakeFiles/disablemyisam.dir/disable_myisam.cc.o] Error 1 make[1]: * [plugin/disable_myisam/CMakeFiles/disablemyisam.dir/all] Error 2 make: *\ [all] Error 2
I've tried append 'TARGET_LINK_LIBRARIES(disablemyisam myisam)' to CMakeList.txt It works with Mariadb 10
I am compile and include plugin
But mariadb in log write:
I am find:
libmyisam.a in storage/myisam folder
What need add to CMakeList.txt for compile disable_myisam static linked with libmyisam.a.