mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Update Mroonga to the latest version on 2015-02-17T13:34:27+0900
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# -*- indent-tabs-mode: nil -*-
|
# -*- indent-tabs-mode: nil -*-
|
||||||
#
|
#
|
||||||
# Copyright(C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
|
# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
|
||||||
# Copyright(C) 2013 Kentoku SHIBA
|
# Copyright(C) 2013 Kentoku SHIBA
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
@@ -75,6 +75,28 @@ file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX)
|
|||||||
file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION)
|
file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION)
|
||||||
|
|
||||||
if(MRN_GROONGA_BUNDLED)
|
if(MRN_GROONGA_BUNDLED)
|
||||||
|
option(MRN_GROONGA_EMBED
|
||||||
|
"Embed libgroonga"
|
||||||
|
ON)
|
||||||
|
if(MRN_GROONGA_EMBED)
|
||||||
|
set(GRN_EMBED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
|
||||||
|
"${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
|
||||||
|
option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
|
||||||
|
"Embed groonga-normalizer-mysql Groonga plugin"
|
||||||
|
ON)
|
||||||
|
if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
|
||||||
|
set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
|
||||||
|
else()
|
||||||
|
set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
|
||||||
|
set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
|
||||||
|
endif()
|
||||||
|
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
|
||||||
|
set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
|
add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
|
||||||
else()
|
else()
|
||||||
file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
|
file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
|
||||||
@@ -98,15 +120,21 @@ set(MRN_C_COMPILE_FLAGS "")
|
|||||||
set(MRN_CXX_COMPILE_FLAGS "")
|
set(MRN_CXX_COMPILE_FLAGS "")
|
||||||
|
|
||||||
macro(mrn_check_cflag flag)
|
macro(mrn_check_cflag flag)
|
||||||
check_c_compiler_flag(${flag} "HAVE_C_${flag}")
|
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
|
||||||
if(HAVE_C_${flag})
|
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
|
||||||
|
set(temporary_variable_name "CFLAG${temporary_variable_name}")
|
||||||
|
check_c_compiler_flag(${flag} ${temporary_variable_name})
|
||||||
|
if(${temporary_variable_name})
|
||||||
set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}")
|
set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}")
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(mrn_check_cxxflag flag)
|
macro(mrn_check_cxxflag flag)
|
||||||
check_cxx_compiler_flag(${flag} "HAVE_CXX_${flag}")
|
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
|
||||||
if(HAVE_CXX_${flag})
|
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
|
||||||
|
set(temporary_variable_name "CXXFLAG${temporary_variable_name}")
|
||||||
|
check_cxx_compiler_flag(${flag} ${temporary_variable_name})
|
||||||
|
if(${temporary_variable_name})
|
||||||
set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}")
|
set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}")
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
@@ -122,7 +150,7 @@ else()
|
|||||||
set(MRN_RELATIVE_DIR_PREFIX "")
|
set(MRN_RELATIVE_DIR_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am MROONGA_SOURCES)
|
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am MRN_SOURCES)
|
||||||
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_no_mysql_sources.am
|
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_no_mysql_sources.am
|
||||||
LIBMRN_NO_MYSQL_SOURCES)
|
LIBMRN_NO_MYSQL_SOURCES)
|
||||||
string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}lib/\\1"
|
string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}lib/\\1"
|
||||||
@@ -157,11 +185,18 @@ else()
|
|||||||
set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/regex")
|
set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/regex")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS "${MYSQL_SOURCE_DIR}/extra/rapidjson")
|
||||||
|
set(MYSQL_RAPIDJSON_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/extra/rapidjson/include")
|
||||||
|
else()
|
||||||
|
set(MYSQL_RAPIDJSON_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(MYSQL_INCLUDE_DIRS
|
set(MYSQL_INCLUDE_DIRS
|
||||||
"${MYSQL_BUILD_DIR}/include"
|
"${MYSQL_BUILD_DIR}/include"
|
||||||
"${MYSQL_SOURCE_DIR}/sql"
|
"${MYSQL_SOURCE_DIR}/sql"
|
||||||
"${MYSQL_SOURCE_DIR}/include"
|
"${MYSQL_SOURCE_DIR}/include"
|
||||||
"${MYSQL_REGEX_INCLUDE_DIR}"
|
"${MYSQL_REGEX_INCLUDE_DIR}"
|
||||||
|
"${MYSQL_RAPIDJSON_INCLUDE_DIR}"
|
||||||
"${MYSQL_SOURCE_DIR}")
|
"${MYSQL_SOURCE_DIR}")
|
||||||
|
|
||||||
if(MRN_BUNDLED)
|
if(MRN_BUNDLED)
|
||||||
@@ -190,6 +225,12 @@ else()
|
|||||||
set_mysql_config_value("--version" MYSQL_VERSION)
|
set_mysql_config_value("--version" MYSQL_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${MYSQL_VERSION} VERSION_LESS "5.5.0")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Mroonga doesn't support MySQL < 5.5.0: <${MYSQL_VERSION}>")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${MYSQL_VERSION} VERSION_GREATER "10.0.0" AND
|
if(${MYSQL_VERSION} VERSION_GREATER "10.0.0" AND
|
||||||
${MYSQL_VERSION} VERSION_LESS "10.0.9")
|
${MYSQL_VERSION} VERSION_LESS "10.0.9")
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
@@ -201,10 +242,14 @@ if(MRN_GROONGA_BUNDLED)
|
|||||||
set(GROONGA_INCLUDE_DIRS "${MRN_BUNDLED_GROONGA_DIR}/include")
|
set(GROONGA_INCLUDE_DIRS "${MRN_BUNDLED_GROONGA_DIR}/include")
|
||||||
set(GROONGA_LIBRARY_DIRS "${MRN_BUNDLED_GROONGA_DIR}/lib")
|
set(GROONGA_LIBRARY_DIRS "${MRN_BUNDLED_GROONGA_DIR}/lib")
|
||||||
set(GROONGA_LIBRARIES "libgroonga")
|
set(GROONGA_LIBRARIES "libgroonga")
|
||||||
if(EXISTS "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
|
|
||||||
set(GROONGA_NORMALIZER_MYSQL_FOUND TRUE)
|
set(MRN_LIBRARY_DIRS ${GROONGA_LIBRARY_DIRS})
|
||||||
else()
|
set(MRN_LIBRARIES ${GROONGA_LIBRARIES})
|
||||||
set(GROONGA_NORMALIZER_MYSQL_FOUND FALSE)
|
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
|
||||||
|
set(MRN_LIBRARY_DIRS
|
||||||
|
${MRN_LIBRARY_DIRS}
|
||||||
|
"${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR}/normalizers")
|
||||||
|
set(MRN_LIBRARIES ${MRN_LIBRARIES} mysql_normalizer)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
@@ -213,12 +258,6 @@ else()
|
|||||||
"groonga-normalizer-mysql >= ${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}")
|
"groonga-normalizer-mysql >= ${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED)
|
|
||||||
read_file_list(${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_sources.am MRN_GRN_NORMALIZER_MYSQL_SOURCES)
|
|
||||||
string(REGEX REPLACE "([^;]+)" "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/\\1"
|
|
||||||
MRN_GRN_NORMALIZER_MYSQL_SOURCES "${MRN_GRN_NORMALIZER_MYSQL_SOURCES}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
"${PROJECT_BINARY_DIR}"
|
"${PROJECT_BINARY_DIR}"
|
||||||
"${PROJECT_SOURCE_DIR}"
|
"${PROJECT_SOURCE_DIR}"
|
||||||
@@ -235,29 +274,23 @@ else()
|
|||||||
"${MYSQL_SERVICES_LIB_DIR}")
|
"${MYSQL_SERVICES_LIB_DIR}")
|
||||||
endif()
|
endif()
|
||||||
link_directories(
|
link_directories(
|
||||||
${GROONGA_LIBRARY_DIRS}
|
${MRN_LIBRARY_DIRS}
|
||||||
${MYSQL_LIBRARY_DIRS})
|
${MYSQL_LIBRARY_DIRS})
|
||||||
|
|
||||||
if(MRN_BUNDLED)
|
set(MRN_ALL_SOURCES
|
||||||
if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED)
|
${MRN_SOURCES}
|
||||||
mysql_add_plugin(mroonga
|
|
||||||
"${MROONGA_SOURCES};${MRN_UDF_SOURCES};${MRN_GRN_NORMALIZER_MYSQL_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}"
|
|
||||||
STORAGE_ENGINE MODULE_ONLY
|
|
||||||
LINK_LIBRARIES ${GROONGA_LIBRARIES})
|
|
||||||
else()
|
|
||||||
mysql_add_plugin(mroonga
|
|
||||||
"${MROONGA_SOURCES};${MRN_UDF_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}"
|
|
||||||
STORAGE_ENGINE MODULE_ONLY
|
|
||||||
LINK_LIBRARIES ${GROONGA_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
else()
|
|
||||||
add_library(mroonga MODULE
|
|
||||||
${MROONGA_SOURCES}
|
|
||||||
${MRN_UDF_SOURCES}
|
${MRN_UDF_SOURCES}
|
||||||
${LIBMRN_NO_MYSQL_SOURCES}
|
${LIBMRN_NO_MYSQL_SOURCES}
|
||||||
${LIBMRN_NEED_MYSQL_SOURCES})
|
${LIBMRN_NEED_MYSQL_SOURCES})
|
||||||
|
|
||||||
|
if(MRN_BUNDLED)
|
||||||
|
mysql_add_plugin(mroonga
|
||||||
|
${MRN_ALL_SOURCES}
|
||||||
|
STORAGE_ENGINE MODULE_ONLY
|
||||||
|
LINK_LIBRARIES ${MRN_LIBRARIES})
|
||||||
|
else()
|
||||||
|
add_library(mroonga MODULE ${MRN_ALL_SOURCES})
|
||||||
|
|
||||||
set(MYSQL_LIBRARIES "mysqlservices")
|
set(MYSQL_LIBRARIES "mysqlservices")
|
||||||
target_link_libraries(mroonga ${GROONGA_LIBRARIES} ${MYSQL_LIBRARIES})
|
target_link_libraries(mroonga ${GROONGA_LIBRARIES} ${MYSQL_LIBRARIES})
|
||||||
|
|
||||||
@@ -303,14 +336,14 @@ else()
|
|||||||
mrn_check_cxxflag("-fno-rtti")
|
mrn_check_cxxflag("-fno-rtti")
|
||||||
mrn_check_cxxflag("-felide-constructors")
|
mrn_check_cxxflag("-felide-constructors")
|
||||||
endif()
|
endif()
|
||||||
set_source_files_properties(${MROONGA_SOURCES} PROPERTIES
|
set_source_files_properties(${MRN_SOURCES} PROPERTIES
|
||||||
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
|
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
|
||||||
set_source_files_properties(${LIBMRN_NEED_MYSQL_SOURCES} PROPERTIES
|
set_source_files_properties(${LIBMRN_NEED_MYSQL_SOURCES} PROPERTIES
|
||||||
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
|
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
|
||||||
set_source_files_properties(${MRN_UDF_SOURCES} PROPERTIES
|
set_source_files_properties(${MRN_UDF_SOURCES} PROPERTIES
|
||||||
COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}")
|
COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}")
|
||||||
set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES
|
set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES
|
||||||
COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}")
|
COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}")
|
||||||
set_property(TARGET mroonga APPEND PROPERTY
|
set_property(TARGET mroonga APPEND PROPERTY
|
||||||
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
|
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
|
||||||
set_target_properties(mroonga PROPERTIES
|
set_target_properties(mroonga PROPERTIES
|
||||||
@@ -321,19 +354,20 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GROONGA_NORMALIZER_MYSQL_FOUND)
|
if(GROONGA_NORMALIZER_MYSQL_FOUND)
|
||||||
set(WITH_GROONGA_NORMALIZER_MYSQL 1)
|
set_property(TARGET mroonga APPEND PROPERTY
|
||||||
ADD_DEFINITIONS(-DWITH_GROONGA_NORMALIZER_MYSQL=1)
|
COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1")
|
||||||
if(MRN_GROONGA_BUNDLED)
|
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
|
||||||
ADD_DEFINITIONS(-DGROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC=1)
|
set_property(TARGET mroonga APPEND PROPERTY
|
||||||
|
COMPILE_DEFINITIONS "MRN_GROONGA_NORMALIZER_MYSQL_EMBED")
|
||||||
else()
|
else()
|
||||||
set(GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME \"normalizers/mysql\")
|
|
||||||
set_property(TARGET mroonga APPEND PROPERTY
|
set_property(TARGET mroonga APPEND PROPERTY
|
||||||
COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"")
|
COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(MRN_DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser")
|
set(MRN_DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser")
|
||||||
ADD_DEFINITIONS(-DMRN_PARSER_DEFAULT="${MRN_DEFAULT_PARSER}")
|
set_property(TARGET mroonga APPEND PROPERTY
|
||||||
|
COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${MRN_DEFAULT_PARSER}\"")
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
"${PROJECT_SOURCE_DIR}/mrn_version.h.in"
|
"${PROJECT_SOURCE_DIR}/mrn_version.h.in"
|
||||||
|
@@ -67,8 +67,6 @@ update-latest-release: misc
|
|||||||
misc/update-latest-release.rb \
|
misc/update-latest-release.rb \
|
||||||
$(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
|
$(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
|
||||||
$(VERSION) $(NEW_RELEASE_DATE) \
|
$(VERSION) $(NEW_RELEASE_DATE) \
|
||||||
packages/rpm/fedora/mysql-mroonga.spec.in \
|
|
||||||
packages/rpm/fedora/mariadb-mroonga.spec.in \
|
|
||||||
packages/rpm/centos/mariadb-mroonga.spec.in \
|
packages/rpm/centos/mariadb-mroonga.spec.in \
|
||||||
packages/rpm/centos/mysql55-mroonga.spec.in \
|
packages/rpm/centos/mysql55-mroonga.spec.in \
|
||||||
packages/rpm/centos/mysql56-community-mroonga.spec.in \
|
packages/rpm/centos/mysql56-community-mroonga.spec.in \
|
||||||
|
51
storage/mroonga/appveyor.yml
Normal file
51
storage/mroonga/appveyor.yml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
version: "{build}"
|
||||||
|
clone_depth: 10
|
||||||
|
install:
|
||||||
|
- cd ..
|
||||||
|
- choco install curl 7zip.commandline
|
||||||
|
- curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-10.0.16/source/mariadb-10.0.16.tar.gz
|
||||||
|
- 7z x mariadb-10.0.16.tar.gz
|
||||||
|
- 7z x mariadb-10.0.16.tar > nul
|
||||||
|
- cd mariadb-10.0.16
|
||||||
|
- rmdir /S /Q storage\mroonga\
|
||||||
|
- move ..\mroonga storage\mroonga
|
||||||
|
- git clone --quiet --depth 1 https://github.com/groonga/groonga.git ..\groonga
|
||||||
|
- rmdir /S /Q ..\groonga\test\
|
||||||
|
- mkdir storage\mroonga\vendor
|
||||||
|
- move ..\groonga storage\mroonga\vendor\groonga
|
||||||
|
- git clone --quiet --depth 1 https://github.com/groonga/groonga-normalizer-mysql.git storage\mroonga\vendor\groonga\vendor\plugins\groonga-normalizer-mysql
|
||||||
|
build_script:
|
||||||
|
- "echo # > win\\packaging\\CMakeLists.txt"
|
||||||
|
- cmake . -G "Visual Studio 12 Win64"
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
-DWITHOUT_ARCHIVE=ON
|
||||||
|
-DWITHOUT_BLACKHOLE=ON
|
||||||
|
-DWITHOUT_CASSANDRA=ON
|
||||||
|
-DWITHOUT_CONNECT=ON
|
||||||
|
-DWITHOUT_CSV=ON
|
||||||
|
-DWITHOUT_EXAMPLE=ON
|
||||||
|
-DWITHOUT_FEDERATED=ON
|
||||||
|
-DWITHOUT_FEDERATEDX=ON
|
||||||
|
-DWITHOUT_HEAP=ON
|
||||||
|
-DWITHOUT_INNOBASE=ON
|
||||||
|
-DWITHOUT_MYISAM=ON
|
||||||
|
-DWITHOUT_MYISAMMRG=ON
|
||||||
|
-DWITHOUT_OQGRAPH=ON
|
||||||
|
-DWITHOUT_PERFSCHEMA=OFF
|
||||||
|
-DWITHOUT_SEQUENCE=ON
|
||||||
|
-DWITHOUT_SPHINX=ON
|
||||||
|
-DWITHOUT_SPIDER=ON
|
||||||
|
-DWITHOUT_TEST_SQL_DISCOVERY=ON
|
||||||
|
-DWITHOUT_TOKUDB=ON
|
||||||
|
-DWITHOUT_XTRADB=ON
|
||||||
|
-DWITH_UNIT_TESTS=OFF
|
||||||
|
- cmake --build . --config Debug
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
- provider: Email
|
||||||
|
to:
|
||||||
|
- groonga-mysql-commit@lists.sourceforge.jp
|
||||||
|
- kou@clear-code.com
|
||||||
|
on_build_status_changed: true
|
||||||
|
|
||||||
|
test: off
|
@@ -174,6 +174,10 @@ AC_DEFUN([CONFIG_OPTION_MYSQL],[
|
|||||||
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/include"
|
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/include"
|
||||||
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql"
|
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql"
|
||||||
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/include"
|
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/include"
|
||||||
|
if test -d "$ac_mysql_source_dir/extra/rapidjson"; then
|
||||||
|
mysql_rapidjson_include_dir="$ac_mysql_source_dir/extra/rapidjson/include"
|
||||||
|
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$mysql_rapidjson_include_dir"
|
||||||
|
fi
|
||||||
if test -d "$ac_mysql_source_dir/pcre"; then
|
if test -d "$ac_mysql_source_dir/pcre"; then
|
||||||
mysql_regex_include_dir="$ac_mysql_source_dir/pcre"
|
mysql_regex_include_dir="$ac_mysql_source_dir/pcre"
|
||||||
else
|
else
|
||||||
@@ -461,7 +465,6 @@ AC_CONFIG_FILES([
|
|||||||
packages/Makefile
|
packages/Makefile
|
||||||
packages/rpm/Makefile
|
packages/rpm/Makefile
|
||||||
packages/rpm/centos/Makefile
|
packages/rpm/centos/Makefile
|
||||||
packages/rpm/fedora/Makefile
|
|
||||||
packages/yum/Makefile
|
packages/yum/Makefile
|
||||||
packages/apt/Makefile
|
packages/apt/Makefile
|
||||||
packages/source/Makefile
|
packages/source/Makefile
|
||||||
@@ -486,8 +489,6 @@ AC_OUTPUT([
|
|||||||
packages/rpm/centos/mysql55-mroonga.spec
|
packages/rpm/centos/mysql55-mroonga.spec
|
||||||
packages/rpm/centos/mysql56-community-mroonga.spec
|
packages/rpm/centos/mysql56-community-mroonga.spec
|
||||||
packages/rpm/centos/mariadb-mroonga.spec
|
packages/rpm/centos/mariadb-mroonga.spec
|
||||||
packages/rpm/fedora/mysql-mroonga.spec
|
|
||||||
packages/rpm/fedora/mariadb-mroonga.spec
|
|
||||||
packages/yum/env.sh
|
packages/yum/env.sh
|
||||||
data/install.sql
|
data/install.sql
|
||||||
])
|
])
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -263,7 +263,6 @@ private:
|
|||||||
grn_obj **grn_column_ranges;
|
grn_obj **grn_column_ranges;
|
||||||
grn_obj **grn_index_tables;
|
grn_obj **grn_index_tables;
|
||||||
grn_obj **grn_index_columns;
|
grn_obj **grn_index_columns;
|
||||||
bool grn_table_is_referenced;
|
|
||||||
|
|
||||||
// buffers
|
// buffers
|
||||||
grn_obj encoded_key_buffer;
|
grn_obj encoded_key_buffer;
|
||||||
@@ -641,7 +640,7 @@ private:
|
|||||||
void storage_store_field_geometry(Field *field,
|
void storage_store_field_geometry(Field *field,
|
||||||
const char *value, uint value_length);
|
const char *value, uint value_length);
|
||||||
void storage_store_field(Field *field, const char *value, uint value_length);
|
void storage_store_field(Field *field, const char *value, uint value_length);
|
||||||
void storage_store_field_column(Field *field,
|
void storage_store_field_column(Field *field, bool is_primary_key,
|
||||||
int nth_column, grn_id record_id);
|
int nth_column, grn_id record_id);
|
||||||
void storage_store_fields(uchar *buf, grn_id record_id);
|
void storage_store_fields(uchar *buf, grn_id record_id);
|
||||||
void storage_store_fields_for_prep_update(const uchar *old_data,
|
void storage_store_fields_for_prep_update(const uchar *old_data,
|
||||||
@@ -742,7 +741,6 @@ private:
|
|||||||
int wrapper_open(const char *name, int mode, uint test_if_locked);
|
int wrapper_open(const char *name, int mode, uint test_if_locked);
|
||||||
int wrapper_open_indexes(const char *name);
|
int wrapper_open_indexes(const char *name);
|
||||||
int storage_open(const char *name, int mode, uint test_if_locked);
|
int storage_open(const char *name, int mode, uint test_if_locked);
|
||||||
void update_grn_table_is_referenced();
|
|
||||||
int open_table(const char *name);
|
int open_table(const char *name);
|
||||||
int storage_open_columns(void);
|
int storage_open_columns(void);
|
||||||
int storage_open_indexes(const char *name);
|
int storage_open_indexes(const char *name);
|
||||||
@@ -785,7 +783,9 @@ private:
|
|||||||
grn_obj *index_column);
|
grn_obj *index_column);
|
||||||
int storage_write_row_multiple_column_indexes(uchar *buf, grn_id record_id);
|
int storage_write_row_multiple_column_indexes(uchar *buf, grn_id record_id);
|
||||||
int storage_write_row_unique_index(uchar *buf,
|
int storage_write_row_unique_index(uchar *buf,
|
||||||
KEY *key_info, grn_obj *index_table,
|
KEY *key_info,
|
||||||
|
grn_obj *index_table,
|
||||||
|
grn_obj *index_column,
|
||||||
grn_id *key_id);
|
grn_id *key_id);
|
||||||
int storage_write_row_unique_indexes(uchar *buf);
|
int storage_write_row_unique_indexes(uchar *buf);
|
||||||
int wrapper_get_record_id(uchar *data, grn_id *record_id, const char *context);
|
int wrapper_get_record_id(uchar *data, grn_id *record_id, const char *context);
|
||||||
@@ -904,6 +904,7 @@ private:
|
|||||||
grn_obj *match_columns,
|
grn_obj *match_columns,
|
||||||
uint *consumed_keyword_length,
|
uint *consumed_keyword_length,
|
||||||
grn_obj *tmp_objects);
|
grn_obj *tmp_objects);
|
||||||
|
grn_expr_flags expr_flags_in_boolean_mode();
|
||||||
grn_rc generic_ft_init_ext_prepare_expression_in_boolean_mode(
|
grn_rc generic_ft_init_ext_prepare_expression_in_boolean_mode(
|
||||||
struct st_mrn_ft_info *info,
|
struct st_mrn_ft_info *info,
|
||||||
String *key,
|
String *key,
|
||||||
@@ -1029,6 +1030,7 @@ private:
|
|||||||
bool storage_is_crashed() const;
|
bool storage_is_crashed() const;
|
||||||
bool wrapper_auto_repair(int error) const;
|
bool wrapper_auto_repair(int error) const;
|
||||||
bool storage_auto_repair(int error) const;
|
bool storage_auto_repair(int error) const;
|
||||||
|
int generic_disable_index(int i, KEY *key_info);
|
||||||
int wrapper_disable_indexes(uint mode);
|
int wrapper_disable_indexes(uint mode);
|
||||||
int storage_disable_indexes(uint mode);
|
int storage_disable_indexes(uint mode);
|
||||||
int wrapper_enable_indexes(uint mode);
|
int wrapper_enable_indexes(uint mode);
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
#include "mrn_lock.hpp"
|
#include "mrn_lock.hpp"
|
||||||
#include "mrn_path_mapper.hpp"
|
#include "mrn_path_mapper.hpp"
|
||||||
|
|
||||||
|
#include <groonga/plugin.h>
|
||||||
|
|
||||||
// for debug
|
// for debug
|
||||||
#define MRN_CLASS_NAME "mrn::DatabaseManager"
|
#define MRN_CLASS_NAME "mrn::DatabaseManager"
|
||||||
|
|
||||||
@@ -38,19 +40,19 @@
|
|||||||
# define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode))
|
# define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
grn_rc GRN_PLUGIN_IMPL_NAME_TAGGED(init, normalizers_mysql)(grn_ctx *ctx);
|
||||||
|
grn_rc GRN_PLUGIN_IMPL_NAME_TAGGED(register, normalizers_mysql)(grn_ctx *ctx);
|
||||||
|
}
|
||||||
|
|
||||||
namespace mrn {
|
namespace mrn {
|
||||||
DatabaseManager::DatabaseManager(grn_ctx *ctx)
|
DatabaseManager::DatabaseManager(grn_ctx *ctx, mysql_mutex_t *mutex)
|
||||||
: ctx_(ctx),
|
: ctx_(ctx),
|
||||||
cache_(NULL),
|
cache_(NULL),
|
||||||
mutex_(),
|
mutex_(mutex) {
|
||||||
mutex_initialized_(false) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DatabaseManager::~DatabaseManager(void) {
|
DatabaseManager::~DatabaseManager(void) {
|
||||||
if (mutex_initialized_) {
|
|
||||||
pthread_mutex_destroy(&mutex_);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cache_) {
|
if (cache_) {
|
||||||
void *db_address;
|
void *db_address;
|
||||||
GRN_HASH_EACH(ctx_, cache_, id, NULL, 0, &db_address, {
|
GRN_HASH_EACH(ctx_, cache_, id, NULL, 0, &db_address, {
|
||||||
@@ -75,13 +77,6 @@ namespace mrn {
|
|||||||
DBUG_RETURN(false);
|
DBUG_RETURN(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_init(&mutex_, NULL) != 0) {
|
|
||||||
GRN_LOG(ctx_, GRN_LOG_ERROR,
|
|
||||||
"failed to initialize mutex for opened database cache hash table");
|
|
||||||
DBUG_RETURN(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_initialized_ = true;
|
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +87,7 @@ namespace mrn {
|
|||||||
*db = NULL;
|
*db = NULL;
|
||||||
|
|
||||||
mrn::PathMapper mapper(path);
|
mrn::PathMapper mapper(path);
|
||||||
mrn::Lock lock(&mutex_);
|
mrn::Lock lock(mutex_);
|
||||||
|
|
||||||
error = mrn::encoding::set(ctx_, system_charset_info);
|
error = mrn::encoding::set(ctx_, system_charset_info);
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -145,7 +140,7 @@ namespace mrn {
|
|||||||
MRN_DBUG_ENTER_METHOD();
|
MRN_DBUG_ENTER_METHOD();
|
||||||
|
|
||||||
mrn::PathMapper mapper(path);
|
mrn::PathMapper mapper(path);
|
||||||
mrn::Lock lock(&mutex_);
|
mrn::Lock lock(mutex_);
|
||||||
|
|
||||||
grn_id id;
|
grn_id id;
|
||||||
void *db_address;
|
void *db_address;
|
||||||
@@ -171,7 +166,7 @@ namespace mrn {
|
|||||||
MRN_DBUG_ENTER_METHOD();
|
MRN_DBUG_ENTER_METHOD();
|
||||||
|
|
||||||
mrn::PathMapper mapper(path);
|
mrn::PathMapper mapper(path);
|
||||||
mrn::Lock lock(&mutex_);
|
mrn::Lock lock(mutex_);
|
||||||
|
|
||||||
grn_id id;
|
grn_id id;
|
||||||
void *db_address;
|
void *db_address;
|
||||||
@@ -211,7 +206,7 @@ namespace mrn {
|
|||||||
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
mrn::Lock lock(&mutex_);
|
mrn::Lock lock(mutex_);
|
||||||
|
|
||||||
grn_hash_cursor *cursor;
|
grn_hash_cursor *cursor;
|
||||||
cursor = grn_hash_cursor_open(ctx_, cache_,
|
cursor = grn_hash_cursor_open(ctx_, cache_,
|
||||||
@@ -323,15 +318,12 @@ namespace mrn {
|
|||||||
if (mysql_normalizer) {
|
if (mysql_normalizer) {
|
||||||
grn_obj_unlink(ctx_, mysql_normalizer);
|
grn_obj_unlink(ctx_, mysql_normalizer);
|
||||||
} else {
|
} else {
|
||||||
#ifdef GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC
|
# ifdef MRN_GROONGA_NORMALIZER_MYSQL_EMBED
|
||||||
char ref_path[FN_REFLEN + 1], *tmp;
|
GRN_PLUGIN_IMPL_NAME_TAGGED(init, normalizers_mysql)(ctx_);
|
||||||
tmp = strmov(ref_path, opt_plugin_dir);
|
GRN_PLUGIN_IMPL_NAME_TAGGED(register, normalizers_mysql)(ctx_);
|
||||||
tmp = strmov(tmp, "/ha_mroonga");
|
# else
|
||||||
strcpy(tmp, SO_EXT);
|
|
||||||
grn_plugin_register_by_path(ctx_, ref_path);
|
|
||||||
#else
|
|
||||||
grn_plugin_register(ctx_, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
|
grn_plugin_register(ctx_, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
namespace mrn {
|
namespace mrn {
|
||||||
class DatabaseManager {
|
class DatabaseManager {
|
||||||
public:
|
public:
|
||||||
DatabaseManager(grn_ctx *ctx);
|
DatabaseManager(grn_ctx *ctx, mysql_mutex_t *mutex);
|
||||||
~DatabaseManager(void);
|
~DatabaseManager(void);
|
||||||
bool init(void);
|
bool init(void);
|
||||||
int open(const char *path, grn_obj **db);
|
int open(const char *path, grn_obj **db);
|
||||||
@@ -38,8 +38,7 @@ namespace mrn {
|
|||||||
private:
|
private:
|
||||||
grn_ctx *ctx_;
|
grn_ctx *ctx_;
|
||||||
grn_hash *cache_;
|
grn_hash *cache_;
|
||||||
pthread_mutex_t mutex_;
|
mysql_mutex_t *mutex_;
|
||||||
bool mutex_initialized_;
|
|
||||||
|
|
||||||
void mkdir_p(const char *directory);
|
void mkdir_p(const char *directory);
|
||||||
void ensure_database_directory(void);
|
void ensure_database_directory(void);
|
||||||
|
@@ -20,12 +20,12 @@
|
|||||||
#include "mrn_lock.hpp"
|
#include "mrn_lock.hpp"
|
||||||
|
|
||||||
namespace mrn {
|
namespace mrn {
|
||||||
Lock::Lock(pthread_mutex_t *mutex)
|
Lock::Lock(mysql_mutex_t *mutex)
|
||||||
: mutex_(mutex) {
|
: mutex_(mutex) {
|
||||||
pthread_mutex_lock(mutex_);
|
mysql_mutex_lock(mutex_);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lock::~Lock() {
|
Lock::~Lock() {
|
||||||
pthread_mutex_unlock(mutex_);
|
mysql_mutex_unlock(mutex_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,10 +26,10 @@
|
|||||||
namespace mrn {
|
namespace mrn {
|
||||||
class Lock {
|
class Lock {
|
||||||
public:
|
public:
|
||||||
Lock(pthread_mutex_t *mutex);
|
Lock(mysql_mutex_t *mutex);
|
||||||
~Lock();
|
~Lock();
|
||||||
private:
|
private:
|
||||||
pthread_mutex_t *mutex_;
|
mysql_mutex_t *mutex_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,10 +35,10 @@ namespace mrn {
|
|||||||
};
|
};
|
||||||
~Parameter() {
|
~Parameter() {
|
||||||
if (key_) {
|
if (key_) {
|
||||||
my_free(key_, MYF(0));
|
my_free(key_);
|
||||||
}
|
}
|
||||||
if (value_) {
|
if (value_) {
|
||||||
my_free(value_, MYF(0));
|
my_free(value_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
Copyright(C) 2010 Tetsuro IKEDA
|
Copyright(C) 2010 Tetsuro IKEDA
|
||||||
Copyright(C) 2011-2013 Kentoku SHIBA
|
Copyright(C) 2011-2013 Kentoku SHIBA
|
||||||
Copyright(C) 2011-2012 Kouhei Sutou <kou@clear-code.com>
|
Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -184,6 +184,9 @@ namespace mrn {
|
|||||||
int i = len, j = 0;
|
int i = len, j = 0;
|
||||||
for (; mysql_path_[--i] != FN_LIBCHAR ;) {}
|
for (; mysql_path_[--i] != FN_LIBCHAR ;) {}
|
||||||
for (; i < len ;) {
|
for (; i < len ;) {
|
||||||
|
if (len - i - 1 >= 3 && strncmp(mysql_path_ + i + 1, "#P#", 3) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
mysql_table_name_[j++] = mysql_path_[++i];
|
mysql_table_name_[j++] = mysql_path_[++i];
|
||||||
}
|
}
|
||||||
mysql_table_name_[j] = '\0';
|
mysql_table_name_[j] = '\0';
|
||||||
|
@@ -28,5 +28,11 @@
|
|||||||
#define ER_MRN_ERROR_FROM_GROONGA_STR "Error from Groonga [%s]"
|
#define ER_MRN_ERROR_FROM_GROONGA_STR "Error from Groonga [%s]"
|
||||||
#define ER_MRN_INVALID_NULL_VALUE_NUM 16505
|
#define ER_MRN_INVALID_NULL_VALUE_NUM 16505
|
||||||
#define ER_MRN_INVALID_NULL_VALUE_STR "NULL value can't be used for %s"
|
#define ER_MRN_INVALID_NULL_VALUE_STR "NULL value can't be used for %s"
|
||||||
|
#define ER_MRN_UNSUPPORTED_COLUMN_FLAG_NUM 16506
|
||||||
|
#define ER_MRN_UNSUPPORTED_COLUMN_FLAG_STR \
|
||||||
|
"The column flag '%-.64s' is unsupported. It is ignored"
|
||||||
|
#define ER_MRN_INVALID_COLUMN_FLAG_NUM 16507
|
||||||
|
#define ER_MRN_INVALID_COLUMN_FLAG_STR \
|
||||||
|
"The column flag '%-.64s' is invalid. '%-64s' is used instead"
|
||||||
|
|
||||||
#endif /* MRN_ERR_H_ */
|
#endif /* MRN_ERR_H_ */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* -*- c-basic-offset: 2 -*- */
|
/* -*- c-basic-offset: 2 -*- */
|
||||||
/*
|
/*
|
||||||
Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
|
Copyright(C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -22,15 +22,6 @@
|
|||||||
|
|
||||||
#include "mrn_mysql.h"
|
#include "mrn_mysql.h"
|
||||||
|
|
||||||
#if MYSQL_VERSION_ID >= 50500
|
|
||||||
# define my_free(PTR, FLAG) my_free(PTR)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MYSQL_VERSION_ID < 50500
|
|
||||||
# define mysql_mutex_lock(mutex) pthread_mutex_lock(mutex)
|
|
||||||
# define mysql_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MYSQL_VERSION_ID >= 50604
|
#if MYSQL_VERSION_ID >= 50604
|
||||||
# define MRN_HAVE_MYSQL_TYPE_TIMESTAMP2
|
# define MRN_HAVE_MYSQL_TYPE_TIMESTAMP2
|
||||||
# define MRN_HAVE_MYSQL_TYPE_DATETIME2
|
# define MRN_HAVE_MYSQL_TYPE_DATETIME2
|
||||||
|
@@ -61,14 +61,16 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern HASH mrn_open_tables;
|
extern HASH mrn_open_tables;
|
||||||
extern pthread_mutex_t mrn_open_tables_mutex;
|
extern mysql_mutex_t mrn_open_tables_mutex;
|
||||||
extern HASH mrn_long_term_share;
|
extern HASH mrn_long_term_share;
|
||||||
extern pthread_mutex_t mrn_long_term_share_mutex;
|
extern mysql_mutex_t mrn_long_term_share_mutex;
|
||||||
extern char *mrn_default_parser;
|
extern char *mrn_default_parser;
|
||||||
extern char *mrn_default_wrapper_engine;
|
extern char *mrn_default_wrapper_engine;
|
||||||
extern handlerton *mrn_hton_ptr;
|
extern handlerton *mrn_hton_ptr;
|
||||||
extern HASH mrn_allocated_thds;
|
extern HASH mrn_allocated_thds;
|
||||||
extern pthread_mutex_t mrn_allocated_thds_mutex;
|
extern mysql_mutex_t mrn_allocated_thds_mutex;
|
||||||
|
extern PSI_mutex_key mrn_share_mutex_key;
|
||||||
|
extern PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key;
|
||||||
|
|
||||||
static char *mrn_get_string_between_quote(const char *ptr)
|
static char *mrn_get_string_between_quote(const char *ptr)
|
||||||
{
|
{
|
||||||
@@ -424,7 +426,7 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my_free(params_string, MYF(0));
|
my_free(params_string);
|
||||||
params_string = NULL;
|
params_string = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,7 +457,7 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
|
|||||||
!strncasecmp(share->engine, MRN_GROONGA_STR, MRN_GROONGA_LEN)
|
!strncasecmp(share->engine, MRN_GROONGA_STR, MRN_GROONGA_LEN)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
my_free(share->engine, MYF(0));
|
my_free(share->engine);
|
||||||
share->engine = NULL;
|
share->engine = NULL;
|
||||||
share->engine_length = 0;
|
share->engine_length = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -474,7 +476,7 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
if (params_string)
|
if (params_string)
|
||||||
my_free(params_string, MYF(0));
|
my_free(params_string);
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +502,7 @@ int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i)
|
|||||||
if (key_info->comment.length == 0)
|
if (key_info->comment.length == 0)
|
||||||
{
|
{
|
||||||
if (share->key_parser[i]) {
|
if (share->key_parser[i]) {
|
||||||
my_free(share->key_parser[i], MYF(0));
|
my_free(share->key_parser[i]);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!(share->key_parser[i] = my_strdup(mrn_default_parser, MYF(MY_WME)))
|
!(share->key_parser[i] = my_strdup(mrn_default_parser, MYF(MY_WME)))
|
||||||
@@ -574,12 +576,12 @@ int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param_string)
|
if (param_string)
|
||||||
my_free(param_string, MYF(0));
|
my_free(param_string);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (param_string)
|
if (param_string)
|
||||||
my_free(param_string, MYF(0));
|
my_free(param_string);
|
||||||
#if MYSQL_VERSION_ID >= 50500
|
#if MYSQL_VERSION_ID >= 50500
|
||||||
error_alloc_param_string:
|
error_alloc_param_string:
|
||||||
#endif
|
#endif
|
||||||
@@ -677,12 +679,12 @@ int mrn_add_column_param(MRN_SHARE *share, Field *field, int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param_string)
|
if (param_string)
|
||||||
my_free(param_string, MYF(0));
|
my_free(param_string);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (param_string)
|
if (param_string)
|
||||||
my_free(param_string, MYF(0));
|
my_free(param_string);
|
||||||
error_alloc_param_string:
|
error_alloc_param_string:
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
@@ -714,26 +716,26 @@ int mrn_free_share_alloc(
|
|||||||
uint i;
|
uint i;
|
||||||
MRN_DBUG_ENTER_FUNCTION();
|
MRN_DBUG_ENTER_FUNCTION();
|
||||||
if (share->engine)
|
if (share->engine)
|
||||||
my_free(share->engine, MYF(0));
|
my_free(share->engine);
|
||||||
if (share->default_tokenizer)
|
if (share->default_tokenizer)
|
||||||
my_free(share->default_tokenizer, MYF(0));
|
my_free(share->default_tokenizer);
|
||||||
if (share->normalizer)
|
if (share->normalizer)
|
||||||
my_free(share->normalizer, MYF(0));
|
my_free(share->normalizer);
|
||||||
if (share->token_filters)
|
if (share->token_filters)
|
||||||
my_free(share->token_filters, MYF(0));
|
my_free(share->token_filters);
|
||||||
for (i = 0; i < share->table_share->keys; i++)
|
for (i = 0; i < share->table_share->keys; i++)
|
||||||
{
|
{
|
||||||
if (share->index_table && share->index_table[i])
|
if (share->index_table && share->index_table[i])
|
||||||
my_free(share->index_table[i], MYF(0));
|
my_free(share->index_table[i]);
|
||||||
if (share->key_parser[i])
|
if (share->key_parser[i])
|
||||||
my_free(share->key_parser[i], MYF(0));
|
my_free(share->key_parser[i]);
|
||||||
}
|
}
|
||||||
for (i = 0; i < share->table_share->fields; i++)
|
for (i = 0; i < share->table_share->fields; i++)
|
||||||
{
|
{
|
||||||
if (share->col_flags && share->col_flags[i])
|
if (share->col_flags && share->col_flags[i])
|
||||||
my_free(share->col_flags[i], MYF(0));
|
my_free(share->col_flags[i]);
|
||||||
if (share->col_type && share->col_type[i])
|
if (share->col_type && share->col_type[i])
|
||||||
my_free(share->col_type[i], MYF(0));
|
my_free(share->col_type[i]);
|
||||||
}
|
}
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
@@ -745,8 +747,8 @@ void mrn_free_long_term_share(MRN_LONG_TERM_SHARE *long_term_share)
|
|||||||
mrn::Lock lock(&mrn_long_term_share_mutex);
|
mrn::Lock lock(&mrn_long_term_share_mutex);
|
||||||
my_hash_delete(&mrn_long_term_share, (uchar*) long_term_share);
|
my_hash_delete(&mrn_long_term_share, (uchar*) long_term_share);
|
||||||
}
|
}
|
||||||
pthread_mutex_destroy(&long_term_share->auto_inc_mutex);
|
mysql_mutex_destroy(&long_term_share->auto_inc_mutex);
|
||||||
my_free(long_term_share, MYF(0));
|
my_free(long_term_share);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,8 +777,9 @@ MRN_LONG_TERM_SHARE *mrn_get_long_term_share(const char *table_name,
|
|||||||
long_term_share->table_name = tmp_name;
|
long_term_share->table_name = tmp_name;
|
||||||
long_term_share->table_name_length = table_name_length;
|
long_term_share->table_name_length = table_name_length;
|
||||||
memcpy(long_term_share->table_name, table_name, table_name_length);
|
memcpy(long_term_share->table_name, table_name, table_name_length);
|
||||||
if (pthread_mutex_init(&long_term_share->auto_inc_mutex,
|
if (mysql_mutex_init(mrn_long_term_share_auto_inc_mutex_key,
|
||||||
MY_MUTEX_INIT_FAST))
|
&long_term_share->auto_inc_mutex,
|
||||||
|
MY_MUTEX_INIT_FAST) != 0)
|
||||||
{
|
{
|
||||||
*error = HA_ERR_OUT_OF_MEM;
|
*error = HA_ERR_OUT_OF_MEM;
|
||||||
goto error_init_auto_inc_mutex;
|
goto error_init_auto_inc_mutex;
|
||||||
@@ -790,9 +793,9 @@ MRN_LONG_TERM_SHARE *mrn_get_long_term_share(const char *table_name,
|
|||||||
DBUG_RETURN(long_term_share);
|
DBUG_RETURN(long_term_share);
|
||||||
|
|
||||||
error_hash_insert:
|
error_hash_insert:
|
||||||
pthread_mutex_destroy(&long_term_share->auto_inc_mutex);
|
mysql_mutex_destroy(&long_term_share->auto_inc_mutex);
|
||||||
error_init_auto_inc_mutex:
|
error_init_auto_inc_mutex:
|
||||||
my_free(long_term_share, MYF(0));
|
my_free(long_term_share);
|
||||||
error_alloc_long_term_share:
|
error_alloc_long_term_share:
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
@@ -912,7 +915,9 @@ MRN_SHARE *mrn_get_share(const char *table_name, TABLE *table, int *error)
|
|||||||
share->wrap_table_share = wrap_table_share;
|
share->wrap_table_share = wrap_table_share;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST))
|
if (mysql_mutex_init(mrn_share_mutex_key,
|
||||||
|
&share->mutex,
|
||||||
|
MY_MUTEX_INIT_FAST) != 0)
|
||||||
{
|
{
|
||||||
*error = HA_ERR_OUT_OF_MEM;
|
*error = HA_ERR_OUT_OF_MEM;
|
||||||
goto error_init_mutex;
|
goto error_init_mutex;
|
||||||
@@ -934,11 +939,11 @@ MRN_SHARE *mrn_get_share(const char *table_name, TABLE *table, int *error)
|
|||||||
|
|
||||||
error_hash_insert:
|
error_hash_insert:
|
||||||
error_get_long_term_share:
|
error_get_long_term_share:
|
||||||
pthread_mutex_destroy(&share->mutex);
|
mysql_mutex_destroy(&share->mutex);
|
||||||
error_init_mutex:
|
error_init_mutex:
|
||||||
error_parse_table_param:
|
error_parse_table_param:
|
||||||
mrn_free_share_alloc(share);
|
mrn_free_share_alloc(share);
|
||||||
my_free(share, MYF(0));
|
my_free(share);
|
||||||
error_alloc_share:
|
error_alloc_share:
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
@@ -954,7 +959,7 @@ int mrn_free_share(MRN_SHARE *share)
|
|||||||
plugin_unlock(NULL, share->plugin);
|
plugin_unlock(NULL, share->plugin);
|
||||||
mrn_free_share_alloc(share);
|
mrn_free_share_alloc(share);
|
||||||
thr_lock_delete(&share->lock);
|
thr_lock_delete(&share->lock);
|
||||||
pthread_mutex_destroy(&share->mutex);
|
mysql_mutex_destroy(&share->mutex);
|
||||||
if (share->wrapper_mode) {
|
if (share->wrapper_mode) {
|
||||||
#ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
|
#ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
|
||||||
mysql_mutex_destroy(&(share->wrap_table_share->LOCK_share));
|
mysql_mutex_destroy(&(share->wrap_table_share->LOCK_share));
|
||||||
@@ -963,7 +968,7 @@ int mrn_free_share(MRN_SHARE *share)
|
|||||||
mysql_mutex_destroy(&(share->wrap_table_share->LOCK_ha_data));
|
mysql_mutex_destroy(&(share->wrap_table_share->LOCK_ha_data));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
my_free(share, MYF(0));
|
my_free(share);
|
||||||
}
|
}
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
@@ -1025,9 +1030,9 @@ TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path
|
|||||||
}
|
}
|
||||||
share->tmp_table = INTERNAL_TMP_TABLE; // TODO: is this right?
|
share->tmp_table = INTERNAL_TMP_TABLE; // TODO: is this right?
|
||||||
share->path.str = (char *) path;
|
share->path.str = (char *) path;
|
||||||
share->path.length = strlen(path);
|
share->path.length = strlen(share->path.str);
|
||||||
share->normalized_path.str = share->path.str;
|
share->normalized_path.str = my_strdup(path, MYF(MY_WME));
|
||||||
share->normalized_path.length = share->path.length;
|
share->normalized_path.length = strlen(share->normalized_path.str);
|
||||||
if (open_table_def(thd, share, GTS_TABLE))
|
if (open_table_def(thd, share, GTS_TABLE))
|
||||||
{
|
{
|
||||||
*error = ER_CANT_OPEN_FILE;
|
*error = ER_CANT_OPEN_FILE;
|
||||||
@@ -1039,7 +1044,9 @@ TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path
|
|||||||
void mrn_free_tmp_table_share(TABLE_SHARE *tmp_table_share)
|
void mrn_free_tmp_table_share(TABLE_SHARE *tmp_table_share)
|
||||||
{
|
{
|
||||||
MRN_DBUG_ENTER_FUNCTION();
|
MRN_DBUG_ENTER_FUNCTION();
|
||||||
|
char *normalized_path = tmp_table_share->normalized_path.str;
|
||||||
free_table_share(tmp_table_share);
|
free_table_share(tmp_table_share);
|
||||||
|
my_free(normalized_path);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1131,11 +1138,11 @@ void mrn_clear_alter_share(THD *thd)
|
|||||||
slot_data->alter_create_info = NULL;
|
slot_data->alter_create_info = NULL;
|
||||||
slot_data->disable_keys_create_info = NULL;
|
slot_data->disable_keys_create_info = NULL;
|
||||||
if (slot_data->alter_connect_string) {
|
if (slot_data->alter_connect_string) {
|
||||||
my_free(slot_data->alter_connect_string, MYF(0));
|
my_free(slot_data->alter_connect_string);
|
||||||
slot_data->alter_connect_string = NULL;
|
slot_data->alter_connect_string = NULL;
|
||||||
}
|
}
|
||||||
if (slot_data->alter_comment) {
|
if (slot_data->alter_comment) {
|
||||||
my_free(slot_data->alter_comment, MYF(0));
|
my_free(slot_data->alter_comment);
|
||||||
slot_data->alter_comment = NULL;
|
slot_data->alter_comment = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ typedef struct st_mroonga_long_term_share
|
|||||||
uint table_name_length;
|
uint table_name_length;
|
||||||
|
|
||||||
// for auto_increment (storage mode only)
|
// for auto_increment (storage mode only)
|
||||||
pthread_mutex_t auto_inc_mutex;
|
mysql_mutex_t auto_inc_mutex;
|
||||||
bool auto_inc_inited;
|
bool auto_inc_inited;
|
||||||
ulonglong auto_inc_value;
|
ulonglong auto_inc_value;
|
||||||
} MRN_LONG_TERM_SHARE;
|
} MRN_LONG_TERM_SHARE;
|
||||||
@@ -43,7 +43,7 @@ typedef struct st_mroonga_share
|
|||||||
char *table_name;
|
char *table_name;
|
||||||
uint table_name_length;
|
uint table_name_length;
|
||||||
uint use_count;
|
uint use_count;
|
||||||
pthread_mutex_t mutex;
|
mysql_mutex_t mutex;
|
||||||
THR_LOCK lock;
|
THR_LOCK lock;
|
||||||
TABLE_SHARE *table_share;
|
TABLE_SHARE *table_share;
|
||||||
TABLE_SHARE *wrap_table_share;
|
TABLE_SHARE *wrap_table_share;
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
let $libgroonga_support_lz4 =
|
||||||
|
`SELECT @@mroonga_libgroonga_support_lz4;`;
|
||||||
|
--enable_query_log
|
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
let $libgroonga_support_zlib =
|
||||||
|
`SELECT @@mroonga_libgroonga_support_zlib;`;
|
||||||
|
--enable_query_log
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/check_libgroonga_support_lz4.inc
|
||||||
|
|
||||||
|
if (!$libgroonga_support_lz4) {
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||||
|
skip "This test is for libgroonga supports lz4";
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/check_libgroonga_support_zlib.inc
|
||||||
|
|
||||||
|
if (!$libgroonga_support_zlib) {
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||||
|
skip "This test is for libgroonga supports zlib";
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/check_libgroonga_support_lz4.inc
|
||||||
|
|
||||||
|
if ($libgroonga_support_lz4) {
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||||
|
skip "This test is for libgroonga doesn't support lz4";
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/check_libgroonga_support_zlib.inc
|
||||||
|
|
||||||
|
if ($libgroonga_support_zlib) {
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||||
|
skip "This test is for libgroonga doesn't support zlib";
|
||||||
|
}
|
@@ -6,4 +6,5 @@ create_table_token_filters_index_comment_one_token_filter : Bundled Mroonga does
|
|||||||
create_table_token_filters_table_comment_multiple_token_filters : Bundled Mroonga does not support token filter yet.
|
create_table_token_filters_table_comment_multiple_token_filters : Bundled Mroonga does not support token filter yet.
|
||||||
create_table_token_filters_table_comment_one_token_filter : Bundled Mroonga does not support token filter yet.
|
create_table_token_filters_table_comment_one_token_filter : Bundled Mroonga does not support token filter yet.
|
||||||
foreign_key_create : Bundled Mroonga does not support this test yet.
|
foreign_key_create : Bundled Mroonga does not support this test yet.
|
||||||
|
partition_insert : Bundled Mroonga does not support this test yet.
|
||||||
|
|
||||||
|
@@ -0,0 +1,19 @@
|
|||||||
|
DROP TABLE IF EXISTS ids;
|
||||||
|
CREATE TABLE ids (
|
||||||
|
id1 INT,
|
||||||
|
id2 INT
|
||||||
|
) DEFAULT CHARSET=utf8mb4;
|
||||||
|
INSERT INTO ids (id1, id2) values (1, 2), (1, 2);
|
||||||
|
ALTER TABLE ids ADD UNIQUE INDEX (id1, id2);
|
||||||
|
ERROR 23000: Can't write, because of unique constraint, to table 'ids'
|
||||||
|
SHOW CREATE TABLE ids;
|
||||||
|
Table Create Table
|
||||||
|
ids CREATE TABLE `ids` (
|
||||||
|
`id1` int(11) DEFAULT NULL,
|
||||||
|
`id2` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4
|
||||||
|
SELECT * FROM ids;
|
||||||
|
id1 id2
|
||||||
|
1 2
|
||||||
|
1 2
|
||||||
|
DROP TABLE ids;
|
@@ -0,0 +1,27 @@
|
|||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE terms (
|
||||||
|
term varchar(256) NOT NULL PRIMARY KEY
|
||||||
|
) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
|
||||||
|
DEFAULT CHARSET=utf8;
|
||||||
|
CREATE TABLE memos (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
content text NOT NULL,
|
||||||
|
FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
mroonga_command("dump")
|
||||||
|
table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
|
||||||
|
column_create terms term COLUMN_SCALAR ShortText
|
||||||
|
table_create memos TABLE_PAT_KEY Int32
|
||||||
|
column_create memos content COLUMN_SCALAR LongText
|
||||||
|
column_create memos id COLUMN_SCALAR Int32
|
||||||
|
column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content
|
||||||
|
ALTER TABLE memos DISABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
mroonga_command("dump")
|
||||||
|
table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
|
||||||
|
column_create terms term COLUMN_SCALAR ShortText
|
||||||
|
table_create memos TABLE_PAT_KEY Int32
|
||||||
|
column_create memos content COLUMN_SCALAR LongText
|
||||||
|
column_create memos id COLUMN_SCALAR Int32
|
||||||
|
DROP TABLE memos;
|
@@ -0,0 +1,28 @@
|
|||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE terms (
|
||||||
|
term varchar(256) NOT NULL PRIMARY KEY
|
||||||
|
) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
|
||||||
|
DEFAULT CHARSET=utf8;
|
||||||
|
CREATE TABLE memos (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
content text NOT NULL,
|
||||||
|
FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
ALTER TABLE memos DISABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
mroonga_command("dump")
|
||||||
|
table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
|
||||||
|
column_create terms term COLUMN_SCALAR ShortText
|
||||||
|
table_create memos TABLE_PAT_KEY Int32
|
||||||
|
column_create memos content COLUMN_SCALAR LongText
|
||||||
|
column_create memos id COLUMN_SCALAR Int32
|
||||||
|
ALTER TABLE memos ENABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
mroonga_command("dump")
|
||||||
|
table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
|
||||||
|
column_create terms term COLUMN_SCALAR ShortText
|
||||||
|
table_create memos TABLE_PAT_KEY Int32
|
||||||
|
column_create memos content COLUMN_SCALAR LongText
|
||||||
|
column_create memos id COLUMN_SCALAR Int32
|
||||||
|
column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content
|
||||||
|
DROP TABLE memos;
|
@@ -1,42 +1,30 @@
|
|||||||
DROP DATABASE IF EXISTS mroonga;
|
CREATE TABLE terms (
|
||||||
CREATE DATABASE mroonga;
|
|
||||||
USE mroonga;
|
|
||||||
CREATE TABLE tags (
|
|
||||||
name VARCHAR(64) PRIMARY KEY
|
name VARCHAR(64) PRIMARY KEY
|
||||||
) DEFAULT CHARSET=utf8
|
) DEFAULT CHARSET=utf8
|
||||||
COLLATE=utf8_bin
|
COMMENT='default_tokenizer "TokenBigram"';
|
||||||
COMMENT='default_tokenizer "TokenDelimit"';
|
|
||||||
CREATE TABLE bugs (
|
CREATE TABLE bugs (
|
||||||
id INT UNSIGNED PRIMARY KEY,
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"',
|
title TEXT,
|
||||||
FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'
|
FULLTEXT INDEX (title) COMMENT 'table "terms"'
|
||||||
) DEFAULT CHARSET=utf8;
|
) DEFAULT CHARSET=utf8;
|
||||||
INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
|
INSERT INTO bugs (id, title) VALUES (1, "Mroonga can't build with MySQL X.Y.Z");
|
||||||
SELECT mroonga_command("dump");
|
SELECT * FROM terms ORDER BY name;
|
||||||
mroonga_command("dump")
|
name
|
||||||
table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
|
'
|
||||||
column_create tags name COLUMN_SCALAR ShortText
|
.
|
||||||
table_create bugs TABLE_PAT_KEY UInt32
|
BUILD
|
||||||
column_create bugs id COLUMN_SCALAR UInt32
|
CAN
|
||||||
column_create bugs tags COLUMN_VECTOR tags
|
MROONGA
|
||||||
column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags
|
MYSQL
|
||||||
load --table tags
|
T
|
||||||
[
|
WITH
|
||||||
["_key","name"],
|
X
|
||||||
["Linux",""],
|
Y
|
||||||
["MySQL",""],
|
Z
|
||||||
["groonga",""]
|
SELECT *, MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
|
||||||
]
|
|
||||||
load --table bugs
|
|
||||||
[
|
|
||||||
["_key","id","tags"],
|
|
||||||
[1,1,["Linux","MySQL","groonga"]]
|
|
||||||
]
|
|
||||||
SELECT *, MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE) AS score
|
|
||||||
FROM bugs
|
FROM bugs
|
||||||
WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE);
|
WHERE MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE);
|
||||||
id tags score
|
id title score
|
||||||
1 Linux MySQL groonga 1
|
1 Mroonga can't build with MySQL X.Y.Z 1
|
||||||
DROP TABLE bugs;
|
DROP TABLE bugs;
|
||||||
DROP TABLE tags;
|
DROP TABLE terms;
|
||||||
DROP DATABASE mroonga;
|
|
||||||
|
@@ -0,0 +1,42 @@
|
|||||||
|
DROP DATABASE IF EXISTS mroonga;
|
||||||
|
CREATE DATABASE mroonga;
|
||||||
|
USE mroonga;
|
||||||
|
CREATE TABLE tags (
|
||||||
|
name VARCHAR(64) PRIMARY KEY
|
||||||
|
) DEFAULT CHARSET=utf8
|
||||||
|
COLLATE=utf8_bin
|
||||||
|
COMMENT='default_tokenizer "TokenDelimit"';
|
||||||
|
CREATE TABLE bugs (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"',
|
||||||
|
FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
mroonga_command("dump")
|
||||||
|
table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
|
||||||
|
column_create tags name COLUMN_SCALAR ShortText
|
||||||
|
table_create bugs TABLE_PAT_KEY UInt32
|
||||||
|
column_create bugs id COLUMN_SCALAR UInt32
|
||||||
|
column_create bugs tags COLUMN_VECTOR tags
|
||||||
|
column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags
|
||||||
|
load --table tags
|
||||||
|
[
|
||||||
|
["_key","name"],
|
||||||
|
["Linux",""],
|
||||||
|
["MySQL",""],
|
||||||
|
["groonga",""]
|
||||||
|
]
|
||||||
|
load --table bugs
|
||||||
|
[
|
||||||
|
["_key","id","tags"],
|
||||||
|
[1,1,["Linux","MySQL","groonga"]]
|
||||||
|
]
|
||||||
|
SELECT *, MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
|
||||||
|
FROM bugs
|
||||||
|
WHERE MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE);
|
||||||
|
id tags score
|
||||||
|
1 Linux MySQL groonga 1
|
||||||
|
DROP TABLE bugs;
|
||||||
|
DROP TABLE tags;
|
||||||
|
DROP DATABASE mroonga;
|
@@ -0,0 +1,10 @@
|
|||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
SELECT * FROM entries;
|
||||||
|
id content
|
||||||
|
1 I found Mroonga that is a MySQL storage engine to use Groonga!
|
||||||
|
DROP TABLE entries;
|
@@ -0,0 +1,10 @@
|
|||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
SELECT * FROM entries;
|
||||||
|
id content
|
||||||
|
1 I found Mroonga that is a MySQL storage engine to use Groonga!
|
||||||
|
DROP TABLE entries;
|
@@ -0,0 +1,12 @@
|
|||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
Warnings:
|
||||||
|
Warning 16506 The column flag 'COMPRESS_LZ4' is unsupported. It is ignored
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
SELECT * FROM entries;
|
||||||
|
id content
|
||||||
|
1 I found Mroonga that is a MySQL storage engine to use Groonga!
|
||||||
|
DROP TABLE entries;
|
@@ -0,0 +1,12 @@
|
|||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
Warnings:
|
||||||
|
Warning 16506 The column flag 'COMPRESS_ZLIB' is unsupported. It is ignored
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
SELECT * FROM entries;
|
||||||
|
id content
|
||||||
|
1 I found Mroonga that is a MySQL storage engine to use Groonga!
|
||||||
|
DROP TABLE entries;
|
@@ -0,0 +1,16 @@
|
|||||||
|
DROP TABLE IF EXISTS diaries;
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
day DATE PRIMARY KEY,
|
||||||
|
content VARCHAR(64) NOT NULL,
|
||||||
|
FULLTEXT INDEX (content) COMMENT 'normalizer "none"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES ("2013-04-23", "Mroonga");
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH (content) AGAINST ("+Mroonga" IN BOOLEAN MODE);
|
||||||
|
day content
|
||||||
|
2013-04-23 Mroonga
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH (content) AGAINST ("+mroonga" IN BOOLEAN MODE);
|
||||||
|
day content
|
||||||
|
DROP TABLE diaries;
|
@@ -0,0 +1,18 @@
|
|||||||
|
DROP TABLE IF EXISTS users;
|
||||||
|
CREATE TABLE users (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
name varchar(100) NOT NULL,
|
||||||
|
UNIQUE KEY (name)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO users VALUES (1, "Alice");
|
||||||
|
INSERT INTO users VALUES (2, "Bob");
|
||||||
|
INSERT INTO users VALUES (3, "Bob");
|
||||||
|
ERROR 23000: Duplicate entry 'Bob' for key 'name'
|
||||||
|
SELECT * FROM users;
|
||||||
|
id name
|
||||||
|
1 Alice
|
||||||
|
2 Bob
|
||||||
|
SELECT * FROM users WHERE name = "Bob";
|
||||||
|
id name
|
||||||
|
2 Bob
|
||||||
|
DROP TABLE users;
|
@@ -1,4 +1,4 @@
|
|||||||
select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE
|
select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE
|
||||||
from information_schema.plugins where plugin_name = "Mroonga";
|
from information_schema.plugins where plugin_name = "Mroonga";
|
||||||
PLUGIN_NAME PLUGIN_VERSION PLUGIN_TYPE
|
PLUGIN_NAME PLUGIN_VERSION PLUGIN_TYPE
|
||||||
Mroonga 4.6 STORAGE ENGINE
|
Mroonga 5.0 STORAGE ENGINE
|
||||||
|
@@ -15,16 +15,19 @@ diaries CREATE TABLE `diaries` (
|
|||||||
UNIQUE KEY `day` (`day`)
|
UNIQUE KEY `day` (`day`)
|
||||||
) ENGINE=Mroonga DEFAULT CHARSET=utf8
|
) ENGINE=Mroonga DEFAULT CHARSET=utf8
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-14", "clear day")
|
VALUES ("2012-02-14", "clear day1")
|
||||||
ON DUPLICATE KEY UPDATE title = "clear day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "clear day1 (duplicated)";
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-14", "rainy day")
|
VALUES ("2012-02-14", "clear day2")
|
||||||
ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "clear day2 (duplicated)";
|
||||||
|
INSERT INTO diaries (day, title)
|
||||||
|
VALUES ("2012-02-14", "clear day3")
|
||||||
|
ON DUPLICATE KEY UPDATE title = "clear day3 (duplicated)";
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-15", "cloudy day")
|
VALUES ("2012-02-15", "cloudy day")
|
||||||
ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)";
|
||||||
SELECT * FROM diaries;
|
SELECT * FROM diaries;
|
||||||
id day title
|
id day title
|
||||||
1 2012-02-14 rainy day (duplicated)
|
1 2012-02-14 clear day3 (duplicated)
|
||||||
3 2012-02-15 cloudy day
|
4 2012-02-15 cloudy day
|
||||||
DROP TABLE diaries;
|
DROP TABLE diaries;
|
||||||
|
@@ -0,0 +1,42 @@
|
|||||||
|
DROP TABLE IF EXISTS logs;
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE logs (
|
||||||
|
timestamp DATETIME,
|
||||||
|
message TEXT
|
||||||
|
) DEFAULT CHARSET=UTF8
|
||||||
|
PARTITION BY RANGE (TO_DAYS(timestamp)) (
|
||||||
|
PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
|
||||||
|
PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
|
||||||
|
PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
|
||||||
|
PARTITION pfuture VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
SHOW CREATE TABLE logs;
|
||||||
|
Table Create Table
|
||||||
|
logs CREATE TABLE `logs` (
|
||||||
|
`timestamp` datetime DEFAULT NULL,
|
||||||
|
`message` text
|
||||||
|
) ENGINE=Mroonga DEFAULT CHARSET=utf8
|
||||||
|
/*!50100 PARTITION BY RANGE (TO_DAYS(timestamp))
|
||||||
|
(PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga,
|
||||||
|
PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga,
|
||||||
|
PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga,
|
||||||
|
PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) */
|
||||||
|
INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-01-31 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-02-28 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-03-31 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-04-30 23:59:59', 'Shutdown');
|
||||||
|
SELECT * FROM logs ORDER BY timestamp;
|
||||||
|
timestamp message
|
||||||
|
2015-01-01 00:00:00 Start
|
||||||
|
2015-01-31 23:59:59 Shutdown
|
||||||
|
2015-02-01 00:00:00 Start
|
||||||
|
2015-02-28 23:59:59 Shutdown
|
||||||
|
2015-03-01 00:00:00 Start
|
||||||
|
2015-03-31 23:59:59 Shutdown
|
||||||
|
2015-04-01 00:00:00 Start
|
||||||
|
2015-04-30 23:59:59 Shutdown
|
||||||
|
DROP TABLE logs;
|
@@ -0,0 +1,10 @@
|
|||||||
|
DROP TABLE IF EXISTS diaries;
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
id varchar(32) NOT NULL PRIMARY KEY,
|
||||||
|
content text,
|
||||||
|
FULLTEXT INDEX (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
REPLACE INTO diaries(content) VALUES("Hello");
|
||||||
|
ERROR HY000: primary key is empty
|
||||||
|
DROP TABLE diaries;
|
@@ -0,0 +1,18 @@
|
|||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN";
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
content TEXT,
|
||||||
|
FULLTEXT KEY (title),
|
||||||
|
FULLTEXT KEY (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST("content:@Hello" IN BOOLEAN MODE);
|
||||||
|
title content
|
||||||
|
Groonga Hello Groonga
|
||||||
|
DROP TABLE diaries;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
@@ -0,0 +1,16 @@
|
|||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_LEADING_NOT";
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES("Groonga");
|
||||||
|
INSERT INTO diaries VALUES("Mroonga");
|
||||||
|
SELECT * FROM diaries WHERE MATCH(title) AGAINST("-Groonga" IN BOOLEAN MODE);
|
||||||
|
title
|
||||||
|
Mroonga
|
||||||
|
DROP TABLE diaries;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
@@ -0,0 +1,18 @@
|
|||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN,ALLOW_UPDATE";
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
content TEXT,
|
||||||
|
FULLTEXT KEY (title),
|
||||||
|
FULLTEXT KEY (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST('content:="Hello Mroonga"' IN BOOLEAN MODE);
|
||||||
|
title content
|
||||||
|
Groonga Hello Mroonga
|
||||||
|
DROP TABLE diaries;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
@@ -0,0 +1,15 @@
|
|||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY";
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES("Re:Mroonga");
|
||||||
|
SELECT * FROM diaries WHERE MATCH(title) AGAINST("Re:Mroonga" IN BOOLEAN MODE);
|
||||||
|
title
|
||||||
|
Re:Mroonga
|
||||||
|
DROP TABLE diaries;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
@@ -0,0 +1,16 @@
|
|||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_SCRIPT";
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO diaries VALUES("Re:Mroonga");
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST("title @ 'Re:Mroonga'" IN BOOLEAN MODE);
|
||||||
|
title
|
||||||
|
Re:Mroonga
|
||||||
|
DROP TABLE diaries;
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
@@ -1,3 +1,3 @@
|
|||||||
show variables like 'mroonga_version';
|
show variables like 'mroonga_version';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
mroonga_version 4.06
|
mroonga_version 5.00
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source include/not_embedded.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS ids;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE ids (
|
||||||
|
id1 INT,
|
||||||
|
id2 INT
|
||||||
|
) DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
INSERT INTO ids (id1, id2) values (1, 2), (1, 2);
|
||||||
|
|
||||||
|
--error ER_DUP_UNIQUE
|
||||||
|
ALTER TABLE ids ADD UNIQUE INDEX (id1, id2);
|
||||||
|
SHOW CREATE TABLE ids;
|
||||||
|
|
||||||
|
SELECT * FROM ids;
|
||||||
|
|
||||||
|
DROP TABLE ids;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,45 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
DROP DATABASE test;
|
||||||
|
CREATE DATABASE test;
|
||||||
|
USE test;
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE terms (
|
||||||
|
term varchar(256) NOT NULL PRIMARY KEY
|
||||||
|
) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
|
||||||
|
DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE memos (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
content text NOT NULL,
|
||||||
|
FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
ALTER TABLE memos DISABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
|
||||||
|
DROP TABLE memos;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,46 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
DROP DATABASE test;
|
||||||
|
CREATE DATABASE test;
|
||||||
|
USE test;
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE terms (
|
||||||
|
term varchar(256) NOT NULL PRIMARY KEY
|
||||||
|
) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
|
||||||
|
DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE memos (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
content text NOT NULL,
|
||||||
|
FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
ALTER TABLE memos DISABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
ALTER TABLE memos ENABLE KEYS;
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
|
||||||
|
DROP TABLE memos;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -16,39 +16,27 @@
|
|||||||
|
|
||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
--source ../../include/mroonga/have_mroonga.inc
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
--source ../../include/mroonga/load_mroonga_functions.inc
|
|
||||||
|
|
||||||
--disable_warnings
|
CREATE TABLE terms (
|
||||||
DROP DATABASE IF EXISTS mroonga;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE DATABASE mroonga;
|
|
||||||
USE mroonga;
|
|
||||||
|
|
||||||
CREATE TABLE tags (
|
|
||||||
name VARCHAR(64) PRIMARY KEY
|
name VARCHAR(64) PRIMARY KEY
|
||||||
) DEFAULT CHARSET=utf8
|
) DEFAULT CHARSET=utf8
|
||||||
COLLATE=utf8_bin
|
COMMENT='default_tokenizer "TokenBigram"';
|
||||||
COMMENT='default_tokenizer "TokenDelimit"';
|
|
||||||
|
|
||||||
CREATE TABLE bugs (
|
CREATE TABLE bugs (
|
||||||
id INT UNSIGNED PRIMARY KEY,
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"',
|
title TEXT,
|
||||||
FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'
|
FULLTEXT INDEX (title) COMMENT 'table "terms"'
|
||||||
) DEFAULT CHARSET=utf8;
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
|
INSERT INTO bugs (id, title) VALUES (1, "Mroonga can't build with MySQL X.Y.Z");
|
||||||
|
|
||||||
SELECT mroonga_command("dump");
|
SELECT * FROM terms ORDER BY name;
|
||||||
|
|
||||||
SELECT *, MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE) AS score
|
SELECT *, MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
|
||||||
FROM bugs
|
FROM bugs
|
||||||
WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE);
|
WHERE MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE);
|
||||||
|
|
||||||
DROP TABLE bugs;
|
DROP TABLE bugs;
|
||||||
DROP TABLE tags;
|
DROP TABLE terms;
|
||||||
|
|
||||||
DROP DATABASE mroonga;
|
|
||||||
|
|
||||||
--source ../../include/mroonga/unload_mroonga_functions.inc
|
|
||||||
--source ../../include/mroonga/have_mroonga_deinit.inc
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
||||||
|
@@ -0,0 +1,54 @@
|
|||||||
|
# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source include/not_embedded.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE IF EXISTS mroonga;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE DATABASE mroonga;
|
||||||
|
USE mroonga;
|
||||||
|
|
||||||
|
CREATE TABLE tags (
|
||||||
|
name VARCHAR(64) PRIMARY KEY
|
||||||
|
) DEFAULT CHARSET=utf8
|
||||||
|
COLLATE=utf8_bin
|
||||||
|
COMMENT='default_tokenizer "TokenDelimit"';
|
||||||
|
|
||||||
|
CREATE TABLE bugs (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"',
|
||||||
|
FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
|
||||||
|
|
||||||
|
SELECT mroonga_command("dump");
|
||||||
|
|
||||||
|
SELECT *, MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
|
||||||
|
FROM bugs
|
||||||
|
WHERE MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE bugs;
|
||||||
|
DROP TABLE tags;
|
||||||
|
|
||||||
|
DROP DATABASE mroonga;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,37 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/support_libgroonga_lz4.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
|
||||||
|
SELECT * FROM entries;
|
||||||
|
|
||||||
|
DROP TABLE entries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,37 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/support_libgroonga_zlib.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
|
||||||
|
SELECT * FROM entries;
|
||||||
|
|
||||||
|
DROP TABLE entries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,37 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/unsupport_libgroonga_lz4.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
|
||||||
|
SELECT * FROM entries;
|
||||||
|
|
||||||
|
DROP TABLE entries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,37 @@
|
|||||||
|
# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/unsupport_libgroonga_zlib.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS entries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE entries (
|
||||||
|
id INT UNSIGNED PRIMARY KEY,
|
||||||
|
content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
|
||||||
|
|
||||||
|
SELECT * FROM entries;
|
||||||
|
|
||||||
|
DROP TABLE entries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,42 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
--source ../../include/mroonga/load_mroonga_functions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS diaries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
SET NAMES utf8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
day DATE PRIMARY KEY,
|
||||||
|
content VARCHAR(64) NOT NULL,
|
||||||
|
FULLTEXT INDEX (content) COMMENT 'normalizer "none"'
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES ("2013-04-23", "Mroonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH (content) AGAINST ("+Mroonga" IN BOOLEAN MODE);
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH (content) AGAINST ("+mroonga" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/unload_mroonga_functions.inc
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,40 @@
|
|||||||
|
# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS users;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE users (
|
||||||
|
id int PRIMARY KEY,
|
||||||
|
name varchar(100) NOT NULL,
|
||||||
|
UNIQUE KEY (name)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO users VALUES (1, "Alice");
|
||||||
|
|
||||||
|
INSERT INTO users VALUES (2, "Bob");
|
||||||
|
-- error ER_DUP_ENTRY
|
||||||
|
INSERT INTO users VALUES (3, "Bob");
|
||||||
|
|
||||||
|
SELECT * FROM users;
|
||||||
|
SELECT * FROM users WHERE name = "Bob";
|
||||||
|
|
||||||
|
DROP TABLE users;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -29,11 +29,14 @@ CREATE TABLE diaries (
|
|||||||
SHOW CREATE TABLE diaries;
|
SHOW CREATE TABLE diaries;
|
||||||
|
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-14", "clear day")
|
VALUES ("2012-02-14", "clear day1")
|
||||||
ON DUPLICATE KEY UPDATE title = "clear day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "clear day1 (duplicated)";
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-14", "rainy day")
|
VALUES ("2012-02-14", "clear day2")
|
||||||
ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "clear day2 (duplicated)";
|
||||||
|
INSERT INTO diaries (day, title)
|
||||||
|
VALUES ("2012-02-14", "clear day3")
|
||||||
|
ON DUPLICATE KEY UPDATE title = "clear day3 (duplicated)";
|
||||||
INSERT INTO diaries (day, title)
|
INSERT INTO diaries (day, title)
|
||||||
VALUES ("2012-02-15", "cloudy day")
|
VALUES ("2012-02-15", "cloudy day")
|
||||||
ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)";
|
ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)";
|
||||||
|
@@ -0,0 +1,49 @@
|
|||||||
|
# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS logs;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
CREATE TABLE logs (
|
||||||
|
timestamp DATETIME,
|
||||||
|
message TEXT
|
||||||
|
) DEFAULT CHARSET=UTF8
|
||||||
|
PARTITION BY RANGE (TO_DAYS(timestamp)) (
|
||||||
|
PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
|
||||||
|
PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
|
||||||
|
PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
|
||||||
|
PARTITION pfuture VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
SHOW CREATE TABLE logs;
|
||||||
|
|
||||||
|
INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-01-31 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-02-28 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-03-31 23:59:59', 'Shutdown');
|
||||||
|
INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
|
||||||
|
INSERT INTO logs VALUES('2015-04-30 23:59:59', 'Shutdown');
|
||||||
|
|
||||||
|
SELECT * FROM logs ORDER BY timestamp;
|
||||||
|
|
||||||
|
DROP TABLE logs;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,35 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS diaries;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
id varchar(32) NOT NULL PRIMARY KEY,
|
||||||
|
content text,
|
||||||
|
FULLTEXT INDEX (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- error ER_ERROR_ON_WRITE
|
||||||
|
REPLACE INTO diaries(content) VALUES("Hello");
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,43 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN";
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
content TEXT,
|
||||||
|
FULLTEXT KEY (title),
|
||||||
|
FULLTEXT KEY (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST("content:@Hello" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,41 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_LEADING_NOT";
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES("Groonga");
|
||||||
|
INSERT INTO diaries VALUES("Mroonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries WHERE MATCH(title) AGAINST("-Groonga" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,43 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN,ALLOW_UPDATE";
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
content TEXT,
|
||||||
|
FULLTEXT KEY (title),
|
||||||
|
FULLTEXT KEY (content)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST('content:="Hello Mroonga"' IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,40 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY";
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES("Re:Mroonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries WHERE MATCH(title) AGAINST("Re:Mroonga" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
@@ -0,0 +1,41 @@
|
|||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2.1 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga.inc
|
||||||
|
|
||||||
|
SET @mroonga_boolean_mode_syntax_flags_backup =
|
||||||
|
@@mroonga_boolean_mode_syntax_flags;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags = "SYNTAX_SCRIPT";
|
||||||
|
|
||||||
|
SET NAMES UTF8;
|
||||||
|
|
||||||
|
CREATE TABLE diaries (
|
||||||
|
title TEXT,
|
||||||
|
FULLTEXT KEY (title)
|
||||||
|
) DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO diaries VALUES("Re:Mroonga");
|
||||||
|
|
||||||
|
SELECT * FROM diaries
|
||||||
|
WHERE MATCH(title) AGAINST("title @ 'Re:Mroonga'" IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
DROP TABLE diaries;
|
||||||
|
|
||||||
|
SET mroonga_boolean_mode_syntax_flags =
|
||||||
|
@mroonga_boolean_mode_syntax_flags_backup;
|
||||||
|
|
||||||
|
--source ../../include/mroonga/have_mroonga_deinit.inc
|
7
storage/mroonga/packages/Makefile.am
Normal file
7
storage/mroonga/packages/Makefile.am
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
SUBDIRS = \
|
||||||
|
apt \
|
||||||
|
rpm \
|
||||||
|
source \
|
||||||
|
ubuntu \
|
||||||
|
windows \
|
||||||
|
yum
|
67
storage/mroonga/packages/apt/Makefile.am
Normal file
67
storage/mroonga/packages/apt/Makefile.am
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
REPOSITORIES_PATH = repositories
|
||||||
|
DISTRIBUTIONS = debian
|
||||||
|
ARCHITECTURES = i386 amd64
|
||||||
|
CODE_NAMES = wheezy
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
release: build sign-packages update-repository sign-repository upload
|
||||||
|
|
||||||
|
remove-existing-packages:
|
||||||
|
for distribution in $(DISTRIBUTIONS); do \
|
||||||
|
find $(REPOSITORIES_PATH)/$${distribution}/pool \
|
||||||
|
-type f -delete; \
|
||||||
|
done
|
||||||
|
|
||||||
|
download:
|
||||||
|
for distribution in $(DISTRIBUTIONS); do \
|
||||||
|
rsync -avz --progress --delete \
|
||||||
|
$(RSYNC_PATH)/$${distribution} $(REPOSITORIES_PATH)/; \
|
||||||
|
done
|
||||||
|
|
||||||
|
sign-packages:
|
||||||
|
./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
|
||||||
|
|
||||||
|
update-repository:
|
||||||
|
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
|
||||||
|
'$(ARCHITECTURES)' '$(CODE_NAMES)'
|
||||||
|
|
||||||
|
sign-repository:
|
||||||
|
./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
|
||||||
|
|
||||||
|
ensure-rsync-path:
|
||||||
|
@if test -z "$(RSYNC_PATH)"; then \
|
||||||
|
echo "--with-rsync-path configure option must be specified."; \
|
||||||
|
false; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload: ensure-rsync-path
|
||||||
|
for distribution in $(DISTRIBUTIONS); do \
|
||||||
|
(cd $(REPOSITORIES_PATH)/$${distribution}; \
|
||||||
|
rsync -avz --progress --delete \
|
||||||
|
dists pool $(RSYNC_PATH)/$${distribution}; \
|
||||||
|
); \
|
||||||
|
done
|
||||||
|
|
||||||
|
build: build-package-deb
|
||||||
|
|
||||||
|
build-package-deb: prepare-build-package-deb
|
||||||
|
vagrant destroy --force
|
||||||
|
for architecture in $(ARCHITECTURES); do \
|
||||||
|
for code_name in $(CODE_NAMES); do \
|
||||||
|
id=debian-$$code_name-$$architecture; \
|
||||||
|
vagrant up $$id || exit 1; \
|
||||||
|
vagrant destroy --force $$id; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
|
||||||
|
prepare-build-package-deb: source env.sh
|
||||||
|
cp env.sh tmp/
|
||||||
|
rm -rf tmp/debian
|
||||||
|
cp -rp $(srcdir)/../debian tmp/
|
||||||
|
|
||||||
|
source: tmp/$(PACKAGE)-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
|
||||||
|
mkdir -p tmp
|
||||||
|
cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
|
29
storage/mroonga/packages/apt/Vagrantfile
vendored
Normal file
29
storage/mroonga/packages/apt/Vagrantfile
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
vms = [
|
||||||
|
{
|
||||||
|
:id => "debian-wheezy-i386",
|
||||||
|
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8-i386_chef-provisionerless.box",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:id => "debian-wheezy-amd64",
|
||||||
|
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8_chef-provisionerless.box",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
vms.each do |vm|
|
||||||
|
config.vm.define(vm[:id]) do |node|
|
||||||
|
node.vm.box = vm[:id]
|
||||||
|
node.vm.box_url = vm[:box_url]
|
||||||
|
node.vm.provision(:shell, :path => "build-deb.sh")
|
||||||
|
node.vm.provider("virtualbox") do |virtual_box|
|
||||||
|
virtual_box.memory = 768
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
78
storage/mroonga/packages/apt/build-deb.sh
Executable file
78
storage/mroonga/packages/apt/build-deb.sh
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LANG=C
|
||||||
|
|
||||||
|
mysql_server_package=mysql-server
|
||||||
|
|
||||||
|
run()
|
||||||
|
{
|
||||||
|
"$@"
|
||||||
|
if test $? -ne 0; then
|
||||||
|
echo "Failed $@"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
. /vagrant/tmp/env.sh
|
||||||
|
|
||||||
|
grep '^deb ' /etc/apt/sources.list | \
|
||||||
|
sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list
|
||||||
|
|
||||||
|
run apt-get update
|
||||||
|
run apt-get install -y lsb-release
|
||||||
|
|
||||||
|
distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
|
||||||
|
code_name=$(lsb_release --codename --short)
|
||||||
|
case "${distribution}" in
|
||||||
|
debian)
|
||||||
|
component=main
|
||||||
|
run cat <<EOF > /etc/apt/sources.list.d/groonga.list
|
||||||
|
deb http://packages.groonga.org/debian/ wheezy main
|
||||||
|
deb-src http://packages.groonga.org/debian/ wheezy main
|
||||||
|
EOF
|
||||||
|
if ! grep --quiet security /etc/apt/sources.list; then
|
||||||
|
run cat <<EOF > /etc/apt/sources.list.d/security.list
|
||||||
|
deb http://security.debian.org/ ${code_name}/updates main
|
||||||
|
deb-src http://security.debian.org/ ${code_name}/updates main
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
run apt-get update
|
||||||
|
run apt-get install -y --allow-unauthenticated groonga-keyring
|
||||||
|
run apt-get update
|
||||||
|
;;
|
||||||
|
ubuntu)
|
||||||
|
component=universe
|
||||||
|
run cat <<EOF > /etc/apt/sources.list.d/security.list
|
||||||
|
deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
|
||||||
|
deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
|
||||||
|
EOF
|
||||||
|
run sed -e 's/main/universe/' /etc/apt/sources.list > \
|
||||||
|
/etc/apt/sources.list.d/universe.list
|
||||||
|
run apt-get -y install software-properties-common
|
||||||
|
run add-apt-repository -y universe
|
||||||
|
run add-apt-repository -y ppa:groonga/ppa
|
||||||
|
run apt-get update
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
run apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
|
||||||
|
run apt-get build-dep -y ${mysql_server_package}
|
||||||
|
|
||||||
|
run mkdir -p build
|
||||||
|
run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
|
||||||
|
build/${PACKAGE}_${VERSION}.orig.tar.gz
|
||||||
|
run cd build
|
||||||
|
run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
|
||||||
|
run cd ${PACKAGE}-${VERSION}/
|
||||||
|
run cp -rp /vagrant/tmp/debian debian
|
||||||
|
# export DEB_BUILD_OPTIONS=noopt
|
||||||
|
MYSQL_PACKAGE_INFO=$(apt-cache show mysql-server | grep Version | sort | tail -1)
|
||||||
|
MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_INFO##Version: }
|
||||||
|
sed -i "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/" debian/control
|
||||||
|
run debuild -us -uc
|
||||||
|
run cd -
|
||||||
|
|
||||||
|
package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
|
||||||
|
pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
|
||||||
|
run mkdir -p "${pool_dir}/"
|
||||||
|
run cp *.tar.gz *.diff.gz *.dsc *.deb "${pool_dir}/"
|
15
storage/mroonga/packages/apt/env.sh.in
Normal file
15
storage/mroonga/packages/apt/env.sh.in
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
PACKAGE=@PACKAGE@
|
||||||
|
VERSION=@VERSION@
|
||||||
|
DEPENDED_PACKAGES="
|
||||||
|
debhelper
|
||||||
|
autotools-dev
|
||||||
|
libgroonga-dev
|
||||||
|
pkg-config
|
||||||
|
libmecab-dev
|
||||||
|
mecab-utils
|
||||||
|
libmysqlclient-dev
|
||||||
|
libmysqld-dev
|
||||||
|
libssl-dev
|
||||||
|
groonga-normalizer-mysql
|
||||||
|
wget
|
||||||
|
"
|
42
storage/mroonga/packages/apt/sign-packages.sh
Executable file
42
storage/mroonga/packages/apt/sign-packages.sh
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
script_base_dir=`dirname $0`
|
||||||
|
|
||||||
|
if [ $# != 3 ]; then
|
||||||
|
echo "Usage: $0 GPG_UID DESITINATION CODES"
|
||||||
|
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GPG_UID=$1
|
||||||
|
DESTINATION=$2
|
||||||
|
CODES=$3
|
||||||
|
|
||||||
|
run()
|
||||||
|
{
|
||||||
|
"$@"
|
||||||
|
if test $? -ne 0; then
|
||||||
|
echo "Failed $@"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for code_name in ${CODES}; do
|
||||||
|
case ${code_name} in
|
||||||
|
squeeze|wheezy|jessie|unstable)
|
||||||
|
distribution=debian
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
distribution=ubuntu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
base_directory=${DESTINATION}${distribution}
|
||||||
|
debsign -pgpg2 --re-sign -k${GPG_UID} \
|
||||||
|
$(find ${base_directory} -name '*.dsc' -or -name '*.changes') &
|
||||||
|
if [ "${PARALLEL}" != "yes" ]; then
|
||||||
|
wait
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
wait
|
46
storage/mroonga/packages/apt/sign-repository.sh
Executable file
46
storage/mroonga/packages/apt/sign-repository.sh
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
script_base_dir=`dirname $0`
|
||||||
|
|
||||||
|
if [ $# != 3 ]; then
|
||||||
|
echo "Usage: $0 GPG_UID DESTINATION CODES"
|
||||||
|
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GPG_UID=$1
|
||||||
|
DESTINATION=$2
|
||||||
|
CODES=$3
|
||||||
|
|
||||||
|
run()
|
||||||
|
{
|
||||||
|
"$@"
|
||||||
|
if test $? -ne 0; then
|
||||||
|
echo "Failed $@"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for code_name in ${CODES}; do
|
||||||
|
case ${code_name} in
|
||||||
|
squeeze|wheezy|jessie|unstable)
|
||||||
|
distribution=debian
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
distribution=ubuntu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
release=${DESTINATION}${distribution}/dists/${code_name}/Release
|
||||||
|
rm -f ${release}.gpg
|
||||||
|
gpg2 --sign --detach-sign --armor \
|
||||||
|
--local-user ${GPG_UID} \
|
||||||
|
--output ${release}.gpg \
|
||||||
|
${release} &
|
||||||
|
|
||||||
|
if [ "${PARALLEL}" != "yes" ]; then
|
||||||
|
wait
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
wait
|
130
storage/mroonga/packages/apt/update-repository.sh
Executable file
130
storage/mroonga/packages/apt/update-repository.sh
Executable file
@@ -0,0 +1,130 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
script_base_dir=`dirname $0`
|
||||||
|
|
||||||
|
if [ $# != 4 ]; then
|
||||||
|
echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES"
|
||||||
|
echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PROJECT_NAME=$1
|
||||||
|
DESTINATION=$2
|
||||||
|
ARCHITECTURES=$3
|
||||||
|
CODES=$4
|
||||||
|
|
||||||
|
run()
|
||||||
|
{
|
||||||
|
"$@"
|
||||||
|
if test $? -ne 0; then
|
||||||
|
echo "Failed $@"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
update_repository()
|
||||||
|
{
|
||||||
|
distribution=$1
|
||||||
|
code_name=$2
|
||||||
|
component=$3
|
||||||
|
|
||||||
|
rm -rf dists/${code_name}
|
||||||
|
mkdir -p dists/${code_name}/${component}/binary-i386/
|
||||||
|
mkdir -p dists/${code_name}/${component}/binary-amd64/
|
||||||
|
mkdir -p dists/${code_name}/${component}/source/
|
||||||
|
|
||||||
|
cat <<EOF > dists/.htaccess
|
||||||
|
Options +Indexes
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > dists/${code_name}/${component}/binary-i386/Release
|
||||||
|
Archive: ${code_name}
|
||||||
|
Component: ${component}
|
||||||
|
Origin: The ${PROJECT_NAME} project
|
||||||
|
Label: The ${PROJECT_NAME} project
|
||||||
|
Architecture: i386
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > dists/${code_name}/${component}/binary-amd64/Release
|
||||||
|
Archive: ${code_name}
|
||||||
|
Component: ${component}
|
||||||
|
Origin: The ${PROJECT_NAME} project
|
||||||
|
Label: The ${PROJECT_NAME} project
|
||||||
|
Architecture: amd64
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > dists/${code_name}/${component}/source/Release
|
||||||
|
Archive: ${code_name}
|
||||||
|
Component: ${component}
|
||||||
|
Origin: The ${PROJECT_NAME} project
|
||||||
|
Label: The ${PROJECT_NAME} project
|
||||||
|
Architecture: source
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > generate-${code_name}.conf
|
||||||
|
Dir::ArchiveDir ".";
|
||||||
|
Dir::CacheDir ".";
|
||||||
|
TreeDefault::Directory "pool/${code_name}/${component}";
|
||||||
|
TreeDefault::SrcDirectory "pool/${code_name}/${component}";
|
||||||
|
Default::Packages::Extensions ".deb";
|
||||||
|
Default::Packages::Compress ". gzip bzip2";
|
||||||
|
Default::Sources::Compress ". gzip bzip2";
|
||||||
|
Default::Contents::Compress "gzip bzip2";
|
||||||
|
|
||||||
|
BinDirectory "dists/${code_name}/${component}/binary-i386" {
|
||||||
|
Packages "dists/${code_name}/${component}/binary-i386/Packages";
|
||||||
|
Contents "dists/${code_name}/Contents-i386";
|
||||||
|
SrcPackages "dists/${code_name}/${component}/source/Sources";
|
||||||
|
};
|
||||||
|
|
||||||
|
BinDirectory "dists/${code_name}/${component}/binary-amd64" {
|
||||||
|
Packages "dists/${code_name}/${component}/binary-amd64/Packages";
|
||||||
|
Contents "dists/${code_name}/Contents-amd64";
|
||||||
|
SrcPackages "dists/${code_name}/${component}/source/Sources";
|
||||||
|
};
|
||||||
|
|
||||||
|
Tree "dists/${code_name}" {
|
||||||
|
Sections "${component}";
|
||||||
|
Architectures "i386 amd64 source";
|
||||||
|
};
|
||||||
|
EOF
|
||||||
|
apt-ftparchive generate generate-${code_name}.conf
|
||||||
|
chmod 644 dists/${code_name}/Contents-*
|
||||||
|
|
||||||
|
rm -f dists/${code_name}/Release*
|
||||||
|
rm -f *.db
|
||||||
|
cat <<EOF > release-${code_name}.conf
|
||||||
|
APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project";
|
||||||
|
APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project";
|
||||||
|
APT::FTPArchive::Release::Architectures "i386 amd64";
|
||||||
|
APT::FTPArchive::Release::Codename "${code_name}";
|
||||||
|
APT::FTPArchive::Release::Suite "${code_name}";
|
||||||
|
APT::FTPArchive::Release::Components "${component}";
|
||||||
|
APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages";
|
||||||
|
EOF
|
||||||
|
apt-ftparchive -c release-${code_name}.conf \
|
||||||
|
release dists/${code_name} > /tmp/Release
|
||||||
|
mv /tmp/Release dists/${code_name}
|
||||||
|
}
|
||||||
|
|
||||||
|
for code_name in ${CODES}; do
|
||||||
|
case ${code_name} in
|
||||||
|
squeeze|wheezy|jessie|unstable)
|
||||||
|
distribution=debian
|
||||||
|
component=main
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
distribution=ubuntu
|
||||||
|
component=universe
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mkdir -p ${DESTINATION}${distribution}
|
||||||
|
(cd ${DESTINATION}${distribution}
|
||||||
|
update_repository $distribution $code_name $component) &
|
||||||
|
if [ "${PARALLEL}" != "yes" ]; then
|
||||||
|
wait
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
wait
|
665
storage/mroonga/packages/check-utility.sh
Executable file
665
storage/mroonga/packages/check-utility.sh
Executable file
@@ -0,0 +1,665 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Usage: check-utility.sh [--install-groonga]
|
||||||
|
# [--check-install]
|
||||||
|
# [--check-address]
|
||||||
|
# [--enable-repository]
|
||||||
|
#
|
||||||
|
# CODES="squeeze wheezy unstable lucid natty oneiric precise"
|
||||||
|
# DISTRIBUTIONS="centos fedora"
|
||||||
|
|
||||||
|
CHROOT_ROOT=/var/lib/chroot
|
||||||
|
CHECK_ADDRESS=0
|
||||||
|
CHECK_INSTALL=0
|
||||||
|
CHECK_INSTALL_PACKAGE=mysql-server-mroonga
|
||||||
|
CHECK_BUILD=0
|
||||||
|
CHECK_DEPENDS=0
|
||||||
|
CHECK_PROVIDES=0
|
||||||
|
ENABLE_REPOSITORY=0
|
||||||
|
DISABLE_REPOSITORY=0
|
||||||
|
INSTALL_SCRIPT=0
|
||||||
|
INSTALL_MROONGA=0
|
||||||
|
UNINSTALL_MROONGA=0
|
||||||
|
|
||||||
|
common_deb_procedure ()
|
||||||
|
{
|
||||||
|
for code in $CODES; do
|
||||||
|
for arch in $DEB_ARCHITECTURES; do
|
||||||
|
root_dir=$CHROOT_ROOT/$code-$arch
|
||||||
|
eval $1 $code $arch $root_dir
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
common_rpm_procedure ()
|
||||||
|
{
|
||||||
|
for dist in $DISTRIBUTIONS; do
|
||||||
|
case $dist in
|
||||||
|
"fedora")
|
||||||
|
DISTRIBUTIONS_VERSION="19"
|
||||||
|
;;
|
||||||
|
"centos")
|
||||||
|
DISTRIBUTIONS_VERSION="5 6"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
for ver in $DISTRIBUTIONS_VERSION; do
|
||||||
|
for arch in $RPM_ARCHITECTURES; do
|
||||||
|
root_dir=$CHROOT_ROOT/$dist-$ver-$arch
|
||||||
|
eval $1 $dist $arch $ver $root_dir
|
||||||
|
done
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
echo_packages_repository_address ()
|
||||||
|
{
|
||||||
|
root_dir=$1
|
||||||
|
code=$2
|
||||||
|
arch=$3
|
||||||
|
address=`grep "packages.groonga.org" $root_dir/etc/hosts | grep -v "#"`
|
||||||
|
if [ -z "$address" ]; then
|
||||||
|
echo "$code-$arch: default"
|
||||||
|
else
|
||||||
|
echo "$code-$arch: $address"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_distributions ()
|
||||||
|
{
|
||||||
|
if [ -z "$DISTRIBUTIONS" ]; then
|
||||||
|
DISTRIBUTIONS="centos fedora"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_rpm_architectures ()
|
||||||
|
{
|
||||||
|
if [ -z "$RPM_ARCHITECTURES" ]; then
|
||||||
|
RPM_ARCHITECTURES="i386 x86_64"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_codes ()
|
||||||
|
{
|
||||||
|
if [ -z "$CODES" ]; then
|
||||||
|
CODES="squeeze wheezy jessie unstable lucid precise quantal raring"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
setup_deb_architectures ()
|
||||||
|
{
|
||||||
|
if [ -z "$DEB_ARCHITECTURES" ]; then
|
||||||
|
DEB_ARCHITECTURES="i386 amd64"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_packages_repository_address ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "check_packages_deb_repository_address"
|
||||||
|
common_rpm_procedure "check_packages_rpm_repository_address"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_packages_deb_repository_address ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$4
|
||||||
|
echo_packages_repository_address "$root_dir" "$code" "$arch"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_packages_rpm_repository_address ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
echo_packages_repository_address "$root_dir" "$dist-$ver" "$arch"
|
||||||
|
}
|
||||||
|
|
||||||
|
host_address ()
|
||||||
|
{
|
||||||
|
ifconfig_result=`LANG=C /sbin/ifconfig wlan0`
|
||||||
|
inet_addr=`echo "$ifconfig_result" | grep "inet addr:192"`
|
||||||
|
address=`echo $inet_addr | ruby -ne '/inet addr:(.+?)\s/ =~ $_ && puts($1)'`
|
||||||
|
HOST_ADDRESS=$address
|
||||||
|
}
|
||||||
|
|
||||||
|
check_build_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "check_build_deb_packages"
|
||||||
|
common_rpm_procedure "check_build_rpm_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_build_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
BASE_VERSION=`cat ../version`
|
||||||
|
RESULT_SET=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch`
|
||||||
|
if [ -z "$RESULT_SET" ]; then
|
||||||
|
printf "%8s %5s %s => 0 deb\n" $code $arch $BASE_VERSION
|
||||||
|
else
|
||||||
|
PACKAGE_COUNT=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch | wc | awk '{print \$1}'`
|
||||||
|
printf "%8s %5s %s => %2d debs\n" $code $arch $BASE_VERSION $PACKAGE_COUNT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_build_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
BASE_VERSION=`cat ../version`
|
||||||
|
FIND_PATH=yum/repositories/$dist/$ver/$arch
|
||||||
|
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"`
|
||||||
|
if [ -z "$RESULT_SET" ]; then
|
||||||
|
printf "%8s %6s %s => 0 rpm\n" $dist$ver $arch $BASE_VERSION
|
||||||
|
else
|
||||||
|
PACKAGE_COUNT=`find $FIND_PATH -name "*$BASE_VERSION*" | wc -l`
|
||||||
|
printf "%8s %6s %s => %2d rpms\n" $dist$ver $arch $BASE_VERSION $PACKAGE_COUNT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_depends_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "check_depends_deb_packages"
|
||||||
|
common_rpm_procedure "check_depends_rpm_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_depends_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
BASE_VERSION=`cat ../version`
|
||||||
|
FIND_PATH=apt/repositories/*/pool/$code
|
||||||
|
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*.deb"`
|
||||||
|
if [ -z "$RESULT_SET" ]; then
|
||||||
|
printf "%8s %5s %s => 404 deb\n" $code $arch $BASE_VERSION
|
||||||
|
else
|
||||||
|
for pkg in $RESULT_SET; do
|
||||||
|
DEB_NAME=`basename $pkg`
|
||||||
|
DEPENDS=`dpkg -I $pkg | grep "Depends"`
|
||||||
|
printf "%8s %5s %s => %s\n" $code $arch $DEB_NAME "$DEPENDS"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_depends_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
BASE_VERSION=`cat ../version`
|
||||||
|
FIND_PATH=yum/repositories/$dist/$ver/$arch
|
||||||
|
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"`
|
||||||
|
if [ -z "$RESULT_SET" ]; then
|
||||||
|
printf "%8s %6s %s => 404 rpm\n" $dist$ver $arch $BASE_VERSION
|
||||||
|
else
|
||||||
|
for pkg in $RESULT_SET; do
|
||||||
|
RPM_NAME=`basename $pkg`
|
||||||
|
DEPENDS=`rpm -qp --requires $pkg | grep -i "mysql" | tr -t '\n' ' '`
|
||||||
|
printf "%9s %6s %s => %s\n" $dist$ver $arch $RPM_NAME "$DEPENDS"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_provided_mysql_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "check_provided_mysql_deb_packages"
|
||||||
|
common_rpm_procedure "check_provided_mysql_rpm_packages"
|
||||||
|
for code in $CODES; do
|
||||||
|
echo $code
|
||||||
|
cat tmp/$code-amd64-mysql-server.txt
|
||||||
|
done
|
||||||
|
for dist in $DISTRIBUTIONS; do
|
||||||
|
echo $dist
|
||||||
|
cat tmp/$dist-x86_64-mysql-server.txt
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
check_provided_mysql_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$3
|
||||||
|
cat > tmp/check-provided-mysql.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
apt-get update > /dev/null
|
||||||
|
apt-cache show mysql-server | grep "Version" | head -1 > /tmp/$code-$arch-mysql-server.txt
|
||||||
|
EOF
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
CHECK_SCRIPT=check-provided-mysql.sh
|
||||||
|
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
cp tmp/$CHECK_SCRIPT $root_dir/tmp
|
||||||
|
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
|
||||||
|
cp $root_dir/tmp/$code-$arch-mysql-server.txt tmp
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_provided_mysql_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
cat > tmp/check-provided-mysql.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
yum update > /dev/null
|
||||||
|
yum info mysql-server | grep "Version" > /tmp/$code-$arch-mysql-server.txt
|
||||||
|
EOF
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
CHECK_SCRIPT=check-provided-mysql.sh
|
||||||
|
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
cp tmp/$CHECK_SCRIPT $root_dir/tmp
|
||||||
|
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
|
||||||
|
cp $root_dir/tmp/$code-$arch-mysql-server.txt tmp
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_installed_mroonga_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "check_installed_mroonga_deb_packages"
|
||||||
|
common_rpm_procedure "check_installed_mroonga_rpm_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_installed_mroonga_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$3
|
||||||
|
cat > tmp/check-deb-mroonga.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
dpkg -l | grep $CHECK_INSTALL_PACKAGE
|
||||||
|
EOF
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
CHECK_SCRIPT=check-deb-mroonga.sh
|
||||||
|
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
cp tmp/$CHECK_SCRIPT $root_dir/tmp
|
||||||
|
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_installed_mroonga_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
cat > tmp/check-rpm-mroonga.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
rpm -qa | grep $CHECK_INSTALL_PACKAGE
|
||||||
|
EOF
|
||||||
|
CHECK_SCRIPT=check-rpm-mroonga.sh
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
cp tmp/$CHECK_SCRIPT $root_dir/tmp
|
||||||
|
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
|
||||||
|
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_mroonga_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "install_mroonga_deb_packages"
|
||||||
|
common_rpm_procedure "install_mroonga_rpm_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_mroonga_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$4
|
||||||
|
cat > tmp/install-aptitude-mroonga.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
sudo aptitude clean
|
||||||
|
rm -f /var/lib/apt/lists/packages.groonga.org_*
|
||||||
|
rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
|
||||||
|
sudo aptitude update
|
||||||
|
sudo aptitude -V -D -y --allow-untrusted install groonga-keyring
|
||||||
|
sudo aptitude update
|
||||||
|
sudo aptitude -V -D install mysql-server-mroonga
|
||||||
|
sudo aptitude -V -D install groonga-tokenizer-mecab
|
||||||
|
EOF
|
||||||
|
cat > tmp/install-aptget-mroonga.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
sudo apt-get clean
|
||||||
|
rm -f /var/lib/apt/lists/packages.groonga.org_*
|
||||||
|
rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y --allow-unauthenticated install groonga-keyring
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -V -y install mysql-server-mroonga
|
||||||
|
sudo apt-get -V -y install groonga-tokenizer-mecab
|
||||||
|
EOF
|
||||||
|
root_dir=$CHROOT_ROOT/$code-$arch
|
||||||
|
INSTALL_SCRIPT=""
|
||||||
|
case $code in
|
||||||
|
squeeze|unstable)
|
||||||
|
INSTALL_SCRIPT=install-aptitude-mroonga.sh
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
INSTALL_SCRIPT=install-aptget-mroonga.sh
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
echo "copy install script $INSTALL_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$INSTALL_SCRIPT
|
||||||
|
cp tmp/$INSTALL_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$INSTALL_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$INSTALL_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_mroonga_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
cat > tmp/install-centos5-mroonga.sh <<EOF
|
||||||
|
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm
|
||||||
|
sudo yum makecache
|
||||||
|
sudo yum install -y MySQL-server
|
||||||
|
sudo service mysql start
|
||||||
|
sudo yum install -y mysql-mroonga
|
||||||
|
sudo yum install -y groonga-tokenizer-mecab
|
||||||
|
EOF
|
||||||
|
cat > tmp/install-centos6-mroonga.sh <<EOF
|
||||||
|
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm
|
||||||
|
sudo yum makecache
|
||||||
|
sudo yum install -y mysql-server
|
||||||
|
sudo service mysql start
|
||||||
|
sudo yum install -y mysql-mroonga
|
||||||
|
sudo yum install -y groonga-tokenizer-mecab
|
||||||
|
EOF
|
||||||
|
cat > tmp/install-fedora-mroonga.sh <<EOF
|
||||||
|
sudo rpm -ivh http://packages.groonga.org/fedora/groonga-release-1.1.0-0.noarch.rpm
|
||||||
|
sudo yum makecache
|
||||||
|
sudo yum install -y mysql-mroonga
|
||||||
|
sudo yum install -y groonga-tokenizer-mecab
|
||||||
|
EOF
|
||||||
|
INSTALL_SCRIPT=""
|
||||||
|
case "$dist-$ver" in
|
||||||
|
centos-5)
|
||||||
|
INSTALL_SCRIPT=install-centos5-mroonga.sh
|
||||||
|
;;
|
||||||
|
centos-6)
|
||||||
|
INSTALL_SCRIPT=install-centos6-mroonga.sh
|
||||||
|
;;
|
||||||
|
fedora-18)
|
||||||
|
INSTALL_SCRIPT=install-fedora-mroonga.sh
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
echo "copy install script $INSTALL_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$INSTALL_SCRIPT
|
||||||
|
cp tmp/$INSTALL_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$INSTALL_SCRIPT
|
||||||
|
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$INSTALL_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uninstall_mroonga_packages ()
|
||||||
|
{
|
||||||
|
common_deb_procedure "uninstall_mroonga_deb_packages"
|
||||||
|
common_rpm_procedure "uninstall_mroonga_rpm_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall_mroonga_deb_packages ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$4
|
||||||
|
UNINSTALL_SCRIPT=uninstall-deb-mroonga.sh
|
||||||
|
cat > $UNINSTALL_SCRIPT <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
sudo apt-get purge mroonga-* mysql-*
|
||||||
|
EOF
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
echo "copy uninstall script $UNINSTALL_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
|
||||||
|
cp $UNINSTALL_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall_mroonga_rpm_packages ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
UNINSTALL_SCRIPT=uninstall-rpm-mroonga.sh
|
||||||
|
cat > tmp/$UNINSTALL_SCRIPT <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
sudo yum remove mroonga-* mysql-*
|
||||||
|
EOF
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
echo "copy install script $UNINSTALL_SCRIPT to $root_dir/tmp"
|
||||||
|
sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
|
||||||
|
cp tmp/$UNINSTALL_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
|
||||||
|
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
enable_temporaly_mroonga_repository ()
|
||||||
|
{
|
||||||
|
cat > tmp/enable-repository.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
|
||||||
|
echo "$HOST_ADDRESS packages.groonga.org" >> /tmp/hosts
|
||||||
|
cp -f /tmp/hosts /etc/hosts
|
||||||
|
EOF
|
||||||
|
common_deb_procedure "enable_temporaly_mroonga_deb_repository"
|
||||||
|
common_rpm_procedure "enable_temporaly_mroonga_rpm_repository"
|
||||||
|
check_packages_repository_address
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_temporaly_mroonga_deb_repository ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$4
|
||||||
|
today=`date '+%Y%m%d.%s'`
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
|
||||||
|
sudo cp tmp/enable-repository.sh $root_dir/tmp
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/enable-repository.sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_temporaly_mroonga_rpm_repository ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
today=`date '+%Y%m%d.%s'`
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
|
||||||
|
sudo cp tmp/enable-repository.sh $root_dir/tmp
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/enable-repository.sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_temporaly_mroonga_repository ()
|
||||||
|
{
|
||||||
|
cat > tmp/disable-repository.sh <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
|
||||||
|
cp -f /tmp/hosts /etc/hosts
|
||||||
|
EOF
|
||||||
|
common_deb_procedure "disable_temporaly_mroonga_deb_repository"
|
||||||
|
common_rpm_procedure "disable_temporaly_mroonga_rpm_repository"
|
||||||
|
check_packages_repository_address
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_temporaly_mroonga_deb_repository ()
|
||||||
|
{
|
||||||
|
code=$1
|
||||||
|
arch=$2
|
||||||
|
root_dir=$4
|
||||||
|
DISABLE_SCRIPT=disable-repository.sh
|
||||||
|
today=`date '+%Y%m%d.%s'`
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
|
||||||
|
cp tmp/$DISABLE_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$DISABLE_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$DISABLE_SCRIPT
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_temporaly_mroonga_rpm_repository ()
|
||||||
|
{
|
||||||
|
dist=$1
|
||||||
|
arch=$2
|
||||||
|
ver=$3
|
||||||
|
root_dir=$4
|
||||||
|
DISABLE_SCRIPT=disable-repository.sh
|
||||||
|
today=`date '+%Y%m%d.%s'`
|
||||||
|
if [ -d $root_dir ]; then
|
||||||
|
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
|
||||||
|
cp tmp/$DISABLE_SCRIPT $root_dir/tmp
|
||||||
|
chmod 755 $root_dir/tmp/$DISABLE_SCRIPT
|
||||||
|
sudo chname $code-$arch chroot $root_dir /tmp/$DISABLE_SCRIPT
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
host_address
|
||||||
|
echo $HOST_ADDRESS
|
||||||
|
|
||||||
|
while [ $# -ne 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
--check-install)
|
||||||
|
CHECK_INSTALL=1
|
||||||
|
shift
|
||||||
|
if [ ! -z "$1" ]; then
|
||||||
|
case $1 in
|
||||||
|
groonga|mroonga|roonga|mecab|mysql)
|
||||||
|
CHECK_INSTALL_PACKAGE=$1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--check-address)
|
||||||
|
CHECK_ADDRESS=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--check-depends)
|
||||||
|
CHECK_DEPENDS=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--check-provides)
|
||||||
|
CHECK_PROVIDES=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--check-build)
|
||||||
|
CHECK_BUILD=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--enable-repository)
|
||||||
|
ENABLE_REPOSITORY=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--disable-repository)
|
||||||
|
DISABLE_REPOSITORY=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--install-mroonga)
|
||||||
|
INSTALL_MROONGA=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--uninstall-mroonga)
|
||||||
|
UNINSTALL_MROONGA=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--code)
|
||||||
|
shift
|
||||||
|
if [ "$1" = "all" ]; then
|
||||||
|
setup_codes
|
||||||
|
else
|
||||||
|
CODES=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--code-arch)
|
||||||
|
shift
|
||||||
|
if [ "$1" = "all" ]; then
|
||||||
|
setup_deb_architectures
|
||||||
|
else
|
||||||
|
DEB_ARCHITECTURES=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--dist)
|
||||||
|
shift
|
||||||
|
if [ "$1" = "all" ]; then
|
||||||
|
setup_distributions
|
||||||
|
else
|
||||||
|
DISTRIBUTIONS=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--dist-arch)
|
||||||
|
shift
|
||||||
|
if [ "$1" = "all" ]; then
|
||||||
|
setup_rpm_architectures
|
||||||
|
else
|
||||||
|
RPM_ARCHITECTURES=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p tmp
|
||||||
|
setup_deb_architectures
|
||||||
|
setup_rpm_architectures
|
||||||
|
|
||||||
|
if [ $CHECK_INSTALL -ne 0 ]; then
|
||||||
|
check_installed_mroonga_packages
|
||||||
|
fi
|
||||||
|
if [ $CHECK_ADDRESS -ne 0 ]; then
|
||||||
|
check_packages_repository_address
|
||||||
|
fi
|
||||||
|
if [ $CHECK_BUILD -ne 0 ]; then
|
||||||
|
check_build_packages
|
||||||
|
fi
|
||||||
|
if [ $CHECK_DEPENDS -ne 0 ]; then
|
||||||
|
check_depends_packages
|
||||||
|
fi
|
||||||
|
if [ $CHECK_PROVIDES -ne 0 ]; then
|
||||||
|
check_provided_mysql_packages
|
||||||
|
fi
|
||||||
|
if [ $ENABLE_REPOSITORY -ne 0 ]; then
|
||||||
|
enable_temporaly_mroonga_repository
|
||||||
|
fi
|
||||||
|
if [ $DISABLE_REPOSITORY -ne 0 ]; then
|
||||||
|
disable_temporaly_mroonga_repository
|
||||||
|
fi
|
||||||
|
if [ $INSTALL_MROONGA -ne 0 ]; then
|
||||||
|
install_mroonga_packages
|
||||||
|
fi
|
||||||
|
if [ $UNINSTALL_MROONGA -ne 0 ]; then
|
||||||
|
uninstall_mroonga_packages
|
||||||
|
fi
|
||||||
|
|
@@ -0,0 +1,5 @@
|
|||||||
|
/usr/lib/groonga/plugins/ r,
|
||||||
|
/usr/lib/groonga/plugins/** rm,
|
||||||
|
/etc/mecabrc r,
|
||||||
|
/var/lib/mecab/dic/** r,
|
||||||
|
#include <local/mysql-server-mroonga>
|
391
storage/mroonga/packages/debian/changelog
Normal file
391
storage/mroonga/packages/debian/changelog
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
mroonga (5.00-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- <hayashi@clear-code.com> Mon, 09 Feb 2015 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.10-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Jan 2015 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.09-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@cozmixng.org> Mon, 29 Dec 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.08-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Nov 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.07-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Oct 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.06-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Sep 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.05-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Aug 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.04-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jul 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.03-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.02-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 Apr 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.01-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.37
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 28 Apr 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.01-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Mar 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.00-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.35+dfsg-2 on Debian jessie
|
||||||
|
* Built for mysql-server 5.5.35+dfsg-2 on Debian sid
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 06 Mar 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (4.00-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 09 Feb 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.12-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server updates on Ubuntu 12.04,12.10, and 13.10.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 13:12:56 +0900
|
||||||
|
|
||||||
|
mroonga (3.12-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.11-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Dec 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.10-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Nov 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.09-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Oct 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.08-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Sep 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.07-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Aug 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.06-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Jul 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.05-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Jun 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.04-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.31-0ubuntu0.12.04.2 on Ubuntu 12.04 (precise)
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 13 Jun 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.04-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 May 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.03-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.31+dfsg-0+wheezy1 on Debian wheezy
|
||||||
|
* Built for mysql-server 5.5.31+dfsg-1 on Debian unstable
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 16 May 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.03-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Apr 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.02-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.29-0ubuntu0.12.04.2 on Ubuntu 12.04 (precise)
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 22:15:39 +0900
|
||||||
|
|
||||||
|
mroonga (3.02-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.01-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 28 Feb 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (3.00-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 09 Feb 2013 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.10-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.29+dfsg-1 on Debian/unstable.
|
||||||
|
* Built for mysql-server 5.1.67-0ubuntu0.10.04.1 on Ubuntu 10.04(lucid).
|
||||||
|
* Built for mysql-server 5.1.67-0ubuntu0.11.10.1 on Ubuntu 11.10(oneiric).
|
||||||
|
* Built for mysql-server 5.5.29-0ubuntu0.12.04.1 on Ubuntu 12.04(precise).
|
||||||
|
* Built for mysql-server 5.5.29-0ubuntu0.12.10.1 on Ubuntu 12.10(quantal).
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 24 Jan 2013 10:28:16 +0900
|
||||||
|
|
||||||
|
mroonga (2.10-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Dec 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.09-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built for mysql-server 5.5.28-0ubuntu0.12.10.2 on Ubuntu 12.10.
|
||||||
|
Reported by @watanabekiyokaz
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 12 Dec 2012 13:28:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.09-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Nov 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.08-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Oct 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.07-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Sep 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.06-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Aug 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.05-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Jul 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.04-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Ensure deleting mroonga plugin before install.
|
||||||
|
Suggested by Kazuhiro Isobe. Thanks!!!
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jun 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.03-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 May 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.02-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Require groonga >= 2.0.2.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 Apr 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.01-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Ensure plugin is uninstalled by closing all tables use mroonga.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Mar 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (2.00-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Feb 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (1.20-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Add mysql-server-mroonga-compatible package for "groonga" storage engine.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jan 2012 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (1.11-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Change apparmor configuration file name:
|
||||||
|
mysql-server-groonga -> mysql-server-mroonga
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Dec 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
mroonga (1.10-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Sat, 29 Oct 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (1.0.0-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Sep 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.9-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Aug 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.8-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jul 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.7-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Jun 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.6-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 May 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.5-4) unstable; urgency=low
|
||||||
|
|
||||||
|
* fix a typo.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 01:05:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.5-3) unstable; urgency=low
|
||||||
|
|
||||||
|
* fix AppArmor files.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 00:59:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.5-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* hook script fix.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 00:58:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.5-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.4-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Nov 2010 00:00:00 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.3-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Oct 2010 16:34:04 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.2-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Sat, 25 Sep 2010 14:52:49 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.1-4) unstable; urgency=low
|
||||||
|
|
||||||
|
* follow configure option changes.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@cozmixng.org> Fri, 10 Sep 2010 08:45:53 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.1-3) unstable; urgency=low
|
||||||
|
|
||||||
|
* Use HEAD.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Thu, 02 Sep 2010 12:03:46 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.1-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Built with groonga 1.0.0.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@cozmixng.org> Mon, 30 Aug 2010 13:26:25 +0900
|
||||||
|
|
||||||
|
groonga-storage-engine (0.1-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Kouhei Sutou <kou@clear-code.com> Mon, 23 Aug 2010 13:52:01 +0900
|
1
storage/mroonga/packages/debian/compat
Normal file
1
storage/mroonga/packages/debian/compat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
9
|
51
storage/mroonga/packages/debian/control.in
Normal file
51
storage/mroonga/packages/debian/control.in
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
Source: mroonga
|
||||||
|
Section: database
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Kouhei Sutou <kou@clear-code.com>
|
||||||
|
Build-Depends:
|
||||||
|
debhelper (>= 7.0.50),
|
||||||
|
autotools-dev,
|
||||||
|
pkg-config,
|
||||||
|
libgroonga-dev (>= @REQUIRED_GROONGA_VERSION@),
|
||||||
|
groonga-normalizer-mysql,
|
||||||
|
libmysqlclient-dev,
|
||||||
|
libmysqld-dev,
|
||||||
|
libssl-dev,
|
||||||
|
wget,
|
||||||
|
lsb-release
|
||||||
|
Standards-Version: 3.9.1
|
||||||
|
Homepage: http://mroonga.org/
|
||||||
|
|
||||||
|
Package: mysql-server-mroonga
|
||||||
|
Section: database
|
||||||
|
Architecture: any
|
||||||
|
Replaces: mysql-server-groonga (<< 1.10-1)
|
||||||
|
Breaks: mysql-server-groonga (<< 1.10-1)
|
||||||
|
Depends:
|
||||||
|
${misc:Depends},
|
||||||
|
${shlibs:Depends},
|
||||||
|
libgroonga0 (>= @REQUIRED_GROONGA_VERSION@),
|
||||||
|
mysql-server (= MYSQL_VERSION),
|
||||||
|
groonga-normalizer-mysql
|
||||||
|
Description: A fast fulltext searchable storage engine for MySQL.
|
||||||
|
Mroonga is a fast fulltext searchable storage engine for MySQL.
|
||||||
|
It is based on Groonga, a fast fulltext search engine and column store.
|
||||||
|
Groonga is good at real time update.
|
||||||
|
.
|
||||||
|
This package provides a MySQL storage engine as a shared library.
|
||||||
|
This provides "mroonga" storage engine. It means you can use
|
||||||
|
"ENGINE = mroonga" in "CREATE TABLE".
|
||||||
|
|
||||||
|
Package: mysql-server-mroonga-doc
|
||||||
|
Section: doc
|
||||||
|
Architecture: all
|
||||||
|
Replaces: mysql-server-groonga-doc (<< 1.10-1)
|
||||||
|
Breaks: mysql-server-groonga-doc (<< 1.10-1)
|
||||||
|
Depends:
|
||||||
|
${misc:Depends}
|
||||||
|
Description: Documentation of Mroonga.
|
||||||
|
Mroonga is a fast fulltext searchable storage engine for MySQL.
|
||||||
|
It is based on Groonga, a fast fulltext search engine and column store.
|
||||||
|
Groonga is good at real time update.
|
||||||
|
.
|
||||||
|
This package provides documentation of Mroonga.
|
27
storage/mroonga/packages/debian/copyright
Normal file
27
storage/mroonga/packages/debian/copyright
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
This work was packaged for Debian by:
|
||||||
|
|
||||||
|
Kouhei Sutou <kou@clear-code.com> on Thu, 02 Sep 2010 13:51:56 +0900.
|
||||||
|
|
||||||
|
It was downloaded:
|
||||||
|
|
||||||
|
<http://github.com/mroonga/mroonga/downloads>
|
||||||
|
|
||||||
|
Upstream Author(s):
|
||||||
|
|
||||||
|
Tetsuro IKEDA <ikdttr at gmail.com>
|
||||||
|
Daijiro MORI <morita at razil. jp>
|
||||||
|
Tasuku SUENAGA <a at razil. jp>
|
||||||
|
Kouhei Sutou <kou at clear-code. com>
|
||||||
|
|
||||||
|
Copyright:
|
||||||
|
|
||||||
|
Copyright(C) 2009-2010 Tetsuro IKEDA
|
||||||
|
|
||||||
|
License:
|
||||||
|
|
||||||
|
LGPLv2.1
|
||||||
|
|
||||||
|
See `/usr/share/common-licenses/LGPL-2.1'.
|
||||||
|
|
||||||
|
The Debian packaging is done by Kouhei Sutou <kou@clear-code.com> in 2010,
|
||||||
|
and put into public domain, anyone can use it for any purpose.
|
@@ -0,0 +1 @@
|
|||||||
|
usr/share/doc/mysql-server-mroonga-doc/
|
@@ -0,0 +1,3 @@
|
|||||||
|
usr/lib/mysql/plugin/ha_mroonga.so*
|
||||||
|
usr/share/mroonga/*
|
||||||
|
debian/apparmor/mysql-server-mroonga etc/apparmor.d/abstractions/
|
72
storage/mroonga/packages/debian/mysql-server-mroonga.postinst
Executable file
72
storage/mroonga/packages/debian/mysql-server-mroonga.postinst
Executable file
@@ -0,0 +1,72 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
prevver="$2"
|
||||||
|
|
||||||
|
install_plugin() {
|
||||||
|
cat /usr/share/mroonga/install.sql | \
|
||||||
|
mysql --defaults-file=/etc/mysql/debian.cnf || true
|
||||||
|
}
|
||||||
|
|
||||||
|
install_apparmor() {
|
||||||
|
mysql_apparmor_profile_name=usr.sbin.mysqld
|
||||||
|
mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name}
|
||||||
|
mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name}
|
||||||
|
apparmor_profile_name=mysql-server-mroonga
|
||||||
|
include_profile="#include <abstractions/${apparmor_profile_name}>"
|
||||||
|
local_apparmor_profile=/etc/apparmor.d/local/${apparmor_profile_name}
|
||||||
|
if test -f "${mysql_local_apparmor_profile}"; then
|
||||||
|
if ! grep -q "${include_profile}" "${mysql_local_apparmor_profile}"; then
|
||||||
|
echo >> "${mysql_local_apparmor_profile}"
|
||||||
|
echo "${include_profile}" >> "${mysql_local_apparmor_profile}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql
|
||||||
|
mysql_plugin_dir=/usr/lib/mysql/plugin
|
||||||
|
if test -f "${mysql_abstraction_apparmor_profile}" && \
|
||||||
|
! grep -q "${mysql_plugin_dir}" \
|
||||||
|
"${mysql_abstraction_apparmor_profile}"; then
|
||||||
|
# For Lucid.
|
||||||
|
cat <<EOF >> "${mysql_abstraction_apparmor_profile}"
|
||||||
|
|
||||||
|
# ${apparmor_profile_name}: START
|
||||||
|
# Added by mysql-server-mroonga.
|
||||||
|
${mysql_plugin_dir}/ r,
|
||||||
|
${mysql_plugin_dir}/*.so* mr,
|
||||||
|
${include_profile}
|
||||||
|
# ${apparmor_profile_name}: END
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! test -e "$local_apparmor_profile"; then
|
||||||
|
mkdir -p $(dirname "$local_apparmor_profile")
|
||||||
|
cat <<EOF > "$local_apparmor_profile"
|
||||||
|
# Site-specific additions and overrides for ${apparmor_profile_name}.
|
||||||
|
# For more details, please see /etc/apparmor.d/local/README.
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if aa-status --enabled 2>/dev/null; then
|
||||||
|
apparmor_parser -r -T -W "${mysql_apparmor_profile}" || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
configure)
|
||||||
|
install_apparmor
|
||||||
|
install_plugin
|
||||||
|
;;
|
||||||
|
abort-upgrade|abort-deconfigure|abort-remove)
|
||||||
|
:
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Called with unknown argument $1, bailing out."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
38
storage/mroonga/packages/debian/mysql-server-mroonga.postrm
Executable file
38
storage/mroonga/packages/debian/mysql-server-mroonga.postrm
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = "purge" ]; then
|
||||||
|
mysql_apparmor_profile_name=usr.sbin.mysqld
|
||||||
|
mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name}
|
||||||
|
mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name}
|
||||||
|
mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql
|
||||||
|
apparmor_profile_name=mysql-server-mroonga
|
||||||
|
if test -f "${mysql_local_apparmor_profile}"; then
|
||||||
|
include_profile="#include <abstractions/${apparmor_profile_name}>"
|
||||||
|
if grep -q "${include_profile}" "${mysql_local_apparmor_profile}"; then
|
||||||
|
sed -i'' -e "s,${include_profile},," \
|
||||||
|
"${mysql_local_apparmor_profile}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
start_marker_re="^# ${apparmor_profile_name}: START$"
|
||||||
|
end_marker_re="^# ${apparmor_profile_name}: END$"
|
||||||
|
if test -f "${mysql_abstraction_apparmor_profile}" && \
|
||||||
|
grep -q "${start_marker_re}" \
|
||||||
|
"${mysql_abstraction_apparmor_profile}"; then
|
||||||
|
sed -i'' -e "/${start_marker_re}/,/${end_marker_re}/d" \
|
||||||
|
"${mysql_abstraction_apparmor_profile}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f "/etc/apparmor.d/local/${apparmor_profile_name}" || true
|
||||||
|
rmdir /etc/apparmor.d/local 2>/dev/null || true
|
||||||
|
|
||||||
|
if aa-status --enabled 2>/dev/null; then
|
||||||
|
apparmor_parser -r -T -W "${mysql_apparmor_profile}" || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
10
storage/mroonga/packages/debian/mysql-server-mroonga.prerm
Executable file
10
storage/mroonga/packages/debian/mysql-server-mroonga.prerm
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cat /usr/share/mroonga/uninstall.sql | \
|
||||||
|
mysql --defaults-file=/etc/mysql/debian.cnf || true
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
39
storage/mroonga/packages/debian/rules
Executable file
39
storage/mroonga/packages/debian/rules
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# -*- makefile-gmake -*-
|
||||||
|
#
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
# This has to be exported to make some magic below work.
|
||||||
|
export DH_OPTIONS
|
||||||
|
|
||||||
|
export MYSQL_VERSION := $(shell apt-cache show mysql-server-5.5 | grep Version | head -n 1 | awk '{print $$2}' | awk -F '-' '{print $$1}')
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
path=main/m/mysql-5.5/mysql-5.5_$(MYSQL_VERSION).orig.tar.gz; \
|
||||||
|
if [ "$$(lsb_release --id --short)" = "Ubuntu" ]; then \
|
||||||
|
base_url=http://archive.ubuntu.com/ubuntu/pool; \
|
||||||
|
security_base_url=http://security.ubuntu.com/ubuntu/pool; \
|
||||||
|
else \
|
||||||
|
base_url=http://ftp.debian.org/debian/pool; \
|
||||||
|
security_base_url=http://security.debian.org/pool/updates; \
|
||||||
|
fi; \
|
||||||
|
wget $${security_base_url}/$${path} || \
|
||||||
|
wget $${base_url}/$${path}
|
||||||
|
tar xf mysql-5.5_$(MYSQL_VERSION).orig.tar.gz
|
||||||
|
dh_auto_configure -- --with-mysql-source=./mysql-$(MYSQL_VERSION)
|
||||||
|
|
||||||
|
# disable 'make check'.
|
||||||
|
override_dh_auto_test:
|
||||||
|
|
||||||
|
override_dh_install:
|
||||||
|
mv debian/tmp/usr/share/doc/mroonga/ \
|
||||||
|
debian/tmp/usr/share/doc/mysql-server-mroonga-doc/
|
||||||
|
dh_install
|
||||||
|
# if test -x /usr/bin/dh_apparmor; then \
|
||||||
|
# dh_apparmor \
|
||||||
|
# -pmysql-server-mroonga \
|
||||||
|
# --profile-name=usr.lib.mysql.plugin.ha_mroonga; \
|
||||||
|
# fi
|
2
storage/mroonga/packages/rpm/Makefile.am
Normal file
2
storage/mroonga/packages/rpm/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
SUBDIRS = \
|
||||||
|
centos
|
9
storage/mroonga/packages/rpm/centos/Makefile.am
Normal file
9
storage/mroonga/packages/rpm/centos/Makefile.am
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
EXTRA_DIST = \
|
||||||
|
mysql55-mroonga.spec.in \
|
||||||
|
mysql56-community-mroonga.spec.in \
|
||||||
|
mariadb-mroonga.spec.in
|
||||||
|
|
||||||
|
noinst_DATA = \
|
||||||
|
mysql55-mroonga.spec \
|
||||||
|
mysql56-community-mroonga.spec \
|
||||||
|
mariadb-mroonga.spec
|
396
storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in
Normal file
396
storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
%define mariadb_epoch_default 1
|
||||||
|
%define mariadb_version_default 5.5.41
|
||||||
|
%define mariadb_release_default 1
|
||||||
|
%define mariadb_dist_default .el7_0
|
||||||
|
%define mariadb_download_base_url_default http://vault.centos.org/7.0.1406/updates/Source/SPackages
|
||||||
|
%define mariadb_spec_file_default mariadb.spec
|
||||||
|
|
||||||
|
%{!?mariadb_epoch:%define mariadb_epoch %{mariadb_epoch_default}}
|
||||||
|
%{!?mariadb_version:%define mariadb_version %{mariadb_version_default}}
|
||||||
|
%{!?mariadb_release:%define mariadb_release %{mariadb_release_default}}
|
||||||
|
%{!?mariadb_dist:%define mariadb_dist %{mariadb_dist_default}}
|
||||||
|
%{!?mariadb_download_base_url:%define mariadb_download_base_url %{mariadb_download_base_url_default}}
|
||||||
|
%{!?mariadb_spec_file:%define mariadb_spec_file %{mariadb_spec_file_default}}
|
||||||
|
|
||||||
|
%define mariadb_package_version %{mariadb_epoch}:%{mariadb_version}-%{mariadb_release}%{mariadb_dist}
|
||||||
|
|
||||||
|
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
|
||||||
|
|
||||||
|
Name: mariadb-mroonga
|
||||||
|
Version: @VERSION@
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A fast fulltext searchable storage engine for MariaDB
|
||||||
|
|
||||||
|
Group: Applications/Databases
|
||||||
|
License: LGPLv2.1
|
||||||
|
URL: http://mroonga.org/
|
||||||
|
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
|
||||||
|
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
|
||||||
|
BuildRequires: groonga-devel >= %{groonga_required_version}
|
||||||
|
BuildRequires: groonga-normalizer-mysql-devel
|
||||||
|
BuildRequires: wget
|
||||||
|
BuildRequires: mariadb-devel
|
||||||
|
Requires: mariadb-server = %{mariadb_package_version}
|
||||||
|
Requires: mariadb = %{mariadb_package_version}
|
||||||
|
Requires: groonga-libs >= %{groonga_required_version}
|
||||||
|
Requires: groonga-normalizer-mysql
|
||||||
|
|
||||||
|
%description
|
||||||
|
Mroonga is a fast fulltext searchable storage plugin for MariaDB.
|
||||||
|
It is based on Groonga that is a fast fulltext search engine and
|
||||||
|
column store. Groonga is good at real-time update.
|
||||||
|
|
||||||
|
%package doc
|
||||||
|
Summary: Documentation for Mroonga
|
||||||
|
Group: Documentation
|
||||||
|
License: LGPLv2.1
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
Documentation for Mroonga
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n mroonga-%{version}
|
||||||
|
|
||||||
|
mariadb_full_version=%{mariadb_version}-%{mariadb_release}%{mariadb_dist}
|
||||||
|
srpm=mariadb-${mariadb_full_version}.src.rpm
|
||||||
|
if [ ! -f ../../SRPMS/$srpm ]; then
|
||||||
|
wget --continue -O ../../SRPMS/$srpm %{mariadb_download_base_url}/$srpm
|
||||||
|
rpm -Uvh ../../SRPMS/$srpm
|
||||||
|
rm ../../SRPMS/$srpm
|
||||||
|
fi
|
||||||
|
|
||||||
|
%build
|
||||||
|
mariadb_source=../mariadb-%{mariadb_version}
|
||||||
|
if [ ! -d ${mariadb_source} ]; then
|
||||||
|
rpmbuild -bc \
|
||||||
|
--define 'runselftest 0' \
|
||||||
|
--define 'optflags -O0' \
|
||||||
|
../../SPECS/%{mariadb_spec_file}
|
||||||
|
fi
|
||||||
|
%configure \
|
||||||
|
--disable-static \
|
||||||
|
--with-mysql-source=${mariadb_source} \
|
||||||
|
%{?mroonga_configure_options}
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
|
||||||
|
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%post
|
||||||
|
if /usr/bin/mysql -u root -e "quit"; then
|
||||||
|
password_option=""
|
||||||
|
else
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
current_version=0
|
||||||
|
version=$(echo %{groonga_required_version} | sed -e 's/\.//g')
|
||||||
|
required_version=$(expr $version)
|
||||||
|
version=$(/usr/bin/mysql -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
|
||||||
|
grep mroonga | cut -f 2 | sed -e 's/\.//g')
|
||||||
|
if [ -n "$version" ]; then
|
||||||
|
current_version=$(expr $version)
|
||||||
|
fi
|
||||||
|
install_sql=%{_datadir}/mroonga/install.sql
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
|
||||||
|
if [ "$1" = 2 ] ; then
|
||||||
|
if [ $current_version -lt $required_version ]; then
|
||||||
|
command="/usr/bin/mysql -u root $password_option"
|
||||||
|
echo "run the following command after restarting MySQL server:";
|
||||||
|
echo " $command < ${uninstall_sql}"
|
||||||
|
echo " $command < ${install_sql}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
command="/usr/bin/mysql -u root $password_option"
|
||||||
|
command="${command} < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
command="/usr/bin/mysql -u root $password_option < ${install_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to register Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
|
||||||
|
%preun
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
|
||||||
|
if mysql -u root -e "quit"; then
|
||||||
|
password_option=""
|
||||||
|
else
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
if [ "$1" = 0 ]; then
|
||||||
|
command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_libdir}/mysql/plugin/
|
||||||
|
%{_datadir}/mroonga/*
|
||||||
|
%{_datadir}/man/man1/*
|
||||||
|
%{_datadir}/man/*/man1/*
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc README COPYING
|
||||||
|
%doc mysql-mroonga-doc/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Feb 09 2015 <hayashi@clear-code.com> - 5.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Jan 14 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.09-2
|
||||||
|
- build against mariadb-5.5.40-2.el7_0.
|
||||||
|
|
||||||
|
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Aug 14 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-4
|
||||||
|
- build MariaDB for libmysqlservices.a.
|
||||||
|
|
||||||
|
* Thu Aug 14 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-3
|
||||||
|
- support epoch in MariaDB.
|
||||||
|
|
||||||
|
* Wed Aug 13 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-2
|
||||||
|
- build against mariadb-5.5.37-1.el7_0.
|
||||||
|
|
||||||
|
* Sun Aug 10 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-1
|
||||||
|
- initial packaging for CentOS 7 based on mysql-mroogna package.
|
||||||
|
|
||||||
|
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Feb 13 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
|
||||||
|
- use MySQL 5.1.73-3 on CentOS 6.
|
||||||
|
|
||||||
|
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Dec 7 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-2
|
||||||
|
- use MySQL 5.1.71-1 on CentOS 6.
|
||||||
|
|
||||||
|
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Sep 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.08-1
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.6.14-1 on CentOS 5.
|
||||||
|
|
||||||
|
* Wed Sep 4 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.07-2
|
||||||
|
- fix a bug that mroonga is removed accidentally on upgrade #1918.
|
||||||
|
Reported by @ceekz. Thanks!!!
|
||||||
|
|
||||||
|
* Thu Aug 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.07-1
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.6.13-1 on CentOS 5.
|
||||||
|
|
||||||
|
* Mon Jul 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.06-1
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.6.12-2 on CentOS 5.
|
||||||
|
|
||||||
|
* Sat Jun 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.05-1
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.6.12 on CentOS 5.
|
||||||
|
|
||||||
|
* Wed May 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.04-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri May 10 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.03-2
|
||||||
|
- use MySQL 5.6.11-2 on CentOS 5. see http://bugs.mysql.com/bug.php?id=69027
|
||||||
|
Reported by Y.Kentaro. Thanks!!!
|
||||||
|
|
||||||
|
* Mon Apr 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.03-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.02-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.01-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Feb 09 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.00-0
|
||||||
|
- new upstream release.
|
||||||
|
- require groonga 3.0.0 or later
|
||||||
|
|
||||||
|
* Tue Feb 05 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 2.10-2
|
||||||
|
- use MySQL 5.1.67-1 on CentOS 6.
|
||||||
|
Reported by wakisuke.ua. Thanks!!!
|
||||||
|
|
||||||
|
* Sat Dec 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.10-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Dec 10 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.09-1
|
||||||
|
- use MySQL 5.1.66-2 on CentOS 6.
|
||||||
|
Reported by wakisuke.ua. Thanks!!!
|
||||||
|
|
||||||
|
* Thu Nov 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.09-0
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.5.28 on CentOS 5.
|
||||||
|
- use MySQL 5.1.66 on CentOS 6.
|
||||||
|
|
||||||
|
* Mon Oct 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.08-0
|
||||||
|
- new upstream release.
|
||||||
|
- add missing "DROP FUNCTION mroonga_snippet".
|
||||||
|
Reported by @tokuhy. Thanks!!!
|
||||||
|
|
||||||
|
* Sat Sep 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.07-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Aug 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.06-0
|
||||||
|
- new upstream release.
|
||||||
|
- make MySQL spec file name customizable.
|
||||||
|
- make mroonga configure options customizable.
|
||||||
|
- add missing mysql-devel BuildRequires. Reported by wing. Thanks!!!
|
||||||
|
- use MySQL 5.5.27.
|
||||||
|
|
||||||
|
* Sun Jul 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.05-0
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.5.25a.
|
||||||
|
|
||||||
|
* Fri Jun 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.04-0
|
||||||
|
- new upstream release.
|
||||||
|
- ensure deleting mroonga plugin before install.
|
||||||
|
Suggested by Kazuhiro Isobe. Thanks!!!
|
||||||
|
- use MySQL 5.5.25.
|
||||||
|
|
||||||
|
* Tue May 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.03-0
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.5.24.
|
||||||
|
- make mysql_* variables customizable
|
||||||
|
- require groonga 2.0.3 or later.
|
||||||
|
|
||||||
|
* Sun Apr 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.02-0
|
||||||
|
- new upstream release.
|
||||||
|
- use MySQL 5.5.23.
|
||||||
|
- require groonga 2.0.2 or later.
|
||||||
|
|
||||||
|
* Thu Mar 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.01-0
|
||||||
|
- new upstream release.
|
||||||
|
- ensure plugin is uninstalled by closing all tables use mroonga.
|
||||||
|
|
||||||
|
* Wed Feb 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.00-0
|
||||||
|
- new upstream release.
|
||||||
|
- always install/uninstall plugin.
|
||||||
|
- use MySQL 5.1.61 and 5.5.21.
|
||||||
|
- require groonga 2.0.0 or later.
|
||||||
|
|
||||||
|
* Sun Jan 29 2012 Kouhei Sutou <kou@clear-code.com> - 1.20-0
|
||||||
|
- new upstream release.
|
||||||
|
- require groonga 1.3.0.
|
||||||
|
- groonga -> mroonga.
|
||||||
|
- use MySQL 5.5.20.
|
||||||
|
|
||||||
|
* Thu Dec 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.11-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Oct 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.10-0
|
||||||
|
- new upstream release.
|
||||||
|
- groonga storage engine -> mroonga.
|
||||||
|
|
||||||
|
* Thu Sep 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.0-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Aug 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.9-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Jul 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.8-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Jun 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.7-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun May 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.6-0
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue May 17 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-2
|
||||||
|
- use MySQL 5.5.12.
|
||||||
|
|
||||||
|
* Tue Mar 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Jan 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-4
|
||||||
|
- do not remove plugin on upgrade.
|
||||||
|
|
||||||
|
* Wed Jan 12 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-3
|
||||||
|
- rebuild without debug symbol.
|
||||||
|
|
||||||
|
* Thu Dec 30 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-2
|
||||||
|
- use MySQL 5.5.8-1.
|
||||||
|
- fix SQL literal notation.
|
||||||
|
|
||||||
|
* Mon Nov 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-1
|
||||||
|
- use the latest MySQL.
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Nov 21 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-2
|
||||||
|
- install user define function.
|
||||||
|
|
||||||
|
* Fri Oct 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Oct 08 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-2
|
||||||
|
- specify target MySQL version.
|
||||||
|
- use %{version}.
|
||||||
|
|
||||||
|
* Wed Sep 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Sep 12 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-3
|
||||||
|
- require MySQL-client-community.
|
||||||
|
|
||||||
|
* Fri Sep 10 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-2
|
||||||
|
- use MySQL-devel-community.
|
||||||
|
|
||||||
|
* Fri Sep 03 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-1
|
||||||
|
- initial packaging for CentOS.
|
218
storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in
Normal file
218
storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
%{?scl:%scl_package mroonga}
|
||||||
|
%{!?scl:%global pkg_name %{name}}
|
||||||
|
%{!?centos_ver:%define centos_ver 5}
|
||||||
|
|
||||||
|
%if %{centos_ver} == 6
|
||||||
|
%define mysql_version_default 5.5.41
|
||||||
|
%define mysql_release_default 2
|
||||||
|
%define mysql_dist_default el6.centos.alt
|
||||||
|
%define mysql_download_base_url_default http://vault.centos.org/6.6/SCL/Source/SPackages
|
||||||
|
%define mysql_spec_file_default mysql.spec
|
||||||
|
%else
|
||||||
|
%define mysql_version_default 5.5.40
|
||||||
|
%define mysql_release_default 2
|
||||||
|
%define mysql_dist_default el5
|
||||||
|
%define mysql_download_base_url_default http://vault.centos.org/5.11/updates/SRPMS
|
||||||
|
%define mysql_spec_file_default mysql.spec
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%{!?mysql_version:%define mysql_version %{mysql_version_default}}
|
||||||
|
%{!?mysql_release:%define mysql_release %{mysql_release_default}}
|
||||||
|
%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}}
|
||||||
|
%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}}
|
||||||
|
%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}}
|
||||||
|
|
||||||
|
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
|
||||||
|
|
||||||
|
Name: %{?scl_prefix}mroonga
|
||||||
|
Version: @VERSION@
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A fast fulltext searchable storage engine for MySQL
|
||||||
|
|
||||||
|
Group: Applications/Databases
|
||||||
|
License: LGPLv2.1
|
||||||
|
URL: http://mroonga.org/
|
||||||
|
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
|
||||||
|
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
|
||||||
|
BuildRequires: groonga-devel >= %{groonga_required_version}
|
||||||
|
BuildRequires: groonga-normalizer-mysql-devel
|
||||||
|
BuildRequires: wget
|
||||||
|
BuildRequires: which
|
||||||
|
BuildRequires: mysql55-mysql-devel
|
||||||
|
BuildRequires: mysql55-build
|
||||||
|
Requires: mysql55-mysql-server = %{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
Requires: mysql55-mysql = %{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
Requires: groonga-libs >= %{groonga_required_version}
|
||||||
|
Requires: groonga-normalizer-mysql
|
||||||
|
%{?scl:Requires: %scl_runtime}
|
||||||
|
|
||||||
|
%description
|
||||||
|
Mroonga is a fast fulltext searchable storage plugin for MySQL.
|
||||||
|
It is based on Groonga that is a fast fulltext search engine and
|
||||||
|
column store. Groonga is good at real-time update.
|
||||||
|
|
||||||
|
%package doc
|
||||||
|
Summary: Documentation for Mroonga
|
||||||
|
Group: Documentation
|
||||||
|
License: LGPLv2.1
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
Documentation for Mroonga
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{pkg_name}-%{version}
|
||||||
|
|
||||||
|
mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
srpm=mysql55-mysql-${mysql_full_version}.src.rpm
|
||||||
|
if [ ! -f ../../SRPMS/$srpm ]; then
|
||||||
|
wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm
|
||||||
|
rpm -Uvh ../../SRPMS/$srpm
|
||||||
|
fi
|
||||||
|
|
||||||
|
%build
|
||||||
|
mysql_source=../mysql-%{mysql_version}
|
||||||
|
if [ ! -d ${mysql_source} ]; then
|
||||||
|
specs_dir=
|
||||||
|
MYSQL_RPMBUILD_TEST=no rpmbuild -bp \
|
||||||
|
--define 'runselftest 0' \
|
||||||
|
--define 'optflags -O0' \
|
||||||
|
../../SPECS/%{mysql_spec_file}
|
||||||
|
fi
|
||||||
|
%configure --disable-static --with-mysql-source=${mysql_source} \
|
||||||
|
--disable-fast-mutexes \
|
||||||
|
--with-mysql-config=`scl enable mysql55 'which mysql_config'` \
|
||||||
|
%{?mroonga_configure_options}
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
|
||||||
|
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%post
|
||||||
|
mysql_command=`scl enable mysql55 'which mysql'`
|
||||||
|
password_option=""
|
||||||
|
$mysql_command -u root -e "quit"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
current_version=0
|
||||||
|
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
|
||||||
|
required_version=`expr $version`
|
||||||
|
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
|
||||||
|
grep mroonga | cut -f 2 | sed -e 's/\.//g'`
|
||||||
|
if [ -n "$version" ]; then
|
||||||
|
current_version=`expr $version`
|
||||||
|
fi
|
||||||
|
install_sql=%{_datadir}/mroonga/install.sql
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
|
||||||
|
if [ "$1" = 2 ] ; then
|
||||||
|
if [ $current_version -lt $required_version ]; then
|
||||||
|
command="$mysql_command -u root $password_option"
|
||||||
|
echo "run the following command after restarting MySQL server:";
|
||||||
|
echo " $command < ${uninstall_sql}"
|
||||||
|
echo " $command < ${install_sql}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
command="$mysql_command -u root $password_option < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
command="$mysql_command -u root $password_option < ${install_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to register Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
|
||||||
|
%preun
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
mysql_command=`scl enable mysql55 'which mysql'`
|
||||||
|
if $mysql_command -u root -e "quit"; then
|
||||||
|
password_option=""
|
||||||
|
else
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
if [ "$1" = 0 ]; then
|
||||||
|
command="$mysql_command -u root $password_option < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_libdir}/mysql/plugin/
|
||||||
|
%{_datadir}/mroonga/*
|
||||||
|
%{_datadir}/man/man1/*
|
||||||
|
%{_datadir}/man/*/man1/*
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc README COPYING
|
||||||
|
%doc mysql-mroonga-doc/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Feb 09 2015 <hayashi@clear-code.com> - 5.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-2
|
||||||
|
- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!!
|
||||||
|
|
||||||
|
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Mar 06 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
|
||||||
|
- use MySQL 5.5.36 on CentOS 5.
|
||||||
|
|
||||||
|
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
|
||||||
|
- initial packaging for MySQL 5.5 on CentOS 5.
|
@@ -0,0 +1,222 @@
|
|||||||
|
%{!?centos_ver:%define centos_ver 6}
|
||||||
|
|
||||||
|
%if %{centos_ver} == 7
|
||||||
|
%define mysql_version_default 5.6.23
|
||||||
|
%define mysql_release_default 2
|
||||||
|
%define mysql_dist_default el7
|
||||||
|
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/7/SRPMS
|
||||||
|
%define mysql_spec_file_default mysql.spec
|
||||||
|
%else
|
||||||
|
%define mysql_version_default 5.6.23
|
||||||
|
%define mysql_release_default 2
|
||||||
|
%define mysql_dist_default el6
|
||||||
|
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/6/SRPMS
|
||||||
|
%define mysql_spec_file_default mysql.spec
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%{!?mysql_version:%define mysql_version %{mysql_version_default}}
|
||||||
|
%{!?mysql_release:%define mysql_release %{mysql_release_default}}
|
||||||
|
%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}}
|
||||||
|
%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}}
|
||||||
|
%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}}
|
||||||
|
|
||||||
|
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
|
||||||
|
|
||||||
|
Name: mysql-community-mroonga
|
||||||
|
Version: @VERSION@
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A fast fulltext searchable storage engine for MySQL
|
||||||
|
|
||||||
|
Group: Applications/Databases
|
||||||
|
License: LGPLv2.1
|
||||||
|
URL: http://mroonga.org/
|
||||||
|
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
|
||||||
|
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
|
||||||
|
BuildRequires: groonga-devel >= %{groonga_required_version}
|
||||||
|
BuildRequires: groonga-normalizer-mysql-devel
|
||||||
|
BuildRequires: wget
|
||||||
|
BuildRequires: which
|
||||||
|
BuildRequires: gcc, gcc-c++
|
||||||
|
BuildRequires: mysql-community-devel
|
||||||
|
Requires: mysql-community-server = %{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
Requires: mysql-community-client = %{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
Requires: groonga-libs >= %{groonga_required_version}
|
||||||
|
Requires: groonga-normalizer-mysql
|
||||||
|
|
||||||
|
%description
|
||||||
|
Mroonga is a fast fulltext searchable storage plugin for MySQL.
|
||||||
|
It is based on Groonga that is a fast fulltext search engine and
|
||||||
|
column store. Groonga is good at real-time update.
|
||||||
|
|
||||||
|
%package doc
|
||||||
|
Summary: Documentation for Mroonga
|
||||||
|
Group: Documentation
|
||||||
|
License: LGPLv2.1
|
||||||
|
|
||||||
|
%description doc
|
||||||
|
Documentation for Mroonga
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n mroonga-%{version}
|
||||||
|
|
||||||
|
mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist}
|
||||||
|
srpm=mysql-community-${mysql_full_version}.src.rpm
|
||||||
|
if [ ! -f ../../SRPMS/$srpm ]; then
|
||||||
|
wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm
|
||||||
|
rpm -Uvh ../../SRPMS/$srpm
|
||||||
|
fi
|
||||||
|
|
||||||
|
%build
|
||||||
|
mysql_source=../mysql-%{mysql_version}/mysql-%{mysql_version}
|
||||||
|
if [ ! -d ${mysql_source} ]; then
|
||||||
|
specs_dir=
|
||||||
|
MYSQL_RPMBUILD_TEST=no rpmbuild -bp \
|
||||||
|
--define 'runselftest 0' \
|
||||||
|
--define 'optflags -O0' \
|
||||||
|
../../SPECS/%{mysql_spec_file}
|
||||||
|
fi
|
||||||
|
%configure --disable-static --with-mysql-source=${mysql_source} \
|
||||||
|
%{?mroonga_configure_options}
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
|
||||||
|
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%post
|
||||||
|
mysql_command=`which mysql`
|
||||||
|
password_option=""
|
||||||
|
$mysql_command -u root -e "quit"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
current_version=0
|
||||||
|
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
|
||||||
|
required_version=`expr $version`
|
||||||
|
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
|
||||||
|
grep mroonga | cut -f 2 | sed -e 's/\.//g'`
|
||||||
|
if [ -n "$version" ]; then
|
||||||
|
current_version=`expr $version`
|
||||||
|
fi
|
||||||
|
install_sql=%{_datadir}/mroonga/install.sql
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
|
||||||
|
if [ "$1" = 2 ] ; then
|
||||||
|
if [ $current_version -lt $required_version ]; then
|
||||||
|
command="$mysql_command -u root $password_option"
|
||||||
|
echo "run the following command after restarting MySQL server:";
|
||||||
|
echo " $command < ${uninstall_sql}"
|
||||||
|
echo " $command < ${install_sql}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
command="$mysql_command -u root $password_option < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
command="$mysql_command -u root $password_option < ${install_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to register Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
|
||||||
|
%preun
|
||||||
|
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
|
||||||
|
mysql_command=`which mysql`
|
||||||
|
if $mysql_command -u root -e "quit"; then
|
||||||
|
password_option=""
|
||||||
|
else
|
||||||
|
password_option="-p"
|
||||||
|
fi
|
||||||
|
if [ "$1" = 0 ]; then
|
||||||
|
command="$mysql_command -u root $password_option < ${uninstall_sql}"
|
||||||
|
echo $command
|
||||||
|
eval $command || \
|
||||||
|
(echo "run the following command to unregister Mroonga:"; \
|
||||||
|
echo " $command")
|
||||||
|
fi
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_libdir}/mysql/plugin/
|
||||||
|
%{_datadir}/mroonga/*
|
||||||
|
%{_datadir}/man/man1/*
|
||||||
|
%{_datadir}/man/*/man1/*
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc README COPYING
|
||||||
|
%doc mysql-mroonga-doc/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Feb 09 2015 <hayashi@clear-code.com> - 5.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Feb 04 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-2
|
||||||
|
- build against MySQL 5.6.23-2 on MySQL yum repository.
|
||||||
|
|
||||||
|
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Sep 27 2014 Eiichi Sato <miko@cafelounge.net> - 4.05-2
|
||||||
|
- build against MySQL 5.6.21-2 on MySQL yum repository.
|
||||||
|
|
||||||
|
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Aug 09 2014 Eiichi Sato <miko@cafelounge.net> - 4.04-2
|
||||||
|
- build against MySQL 5.6.20-4 on MySQL yum repository.
|
||||||
|
|
||||||
|
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-2
|
||||||
|
- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!!
|
||||||
|
|
||||||
|
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Thu Mar 06 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
|
||||||
|
- use MySQL 5.5.36 on CentOS 5.
|
||||||
|
|
||||||
|
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
|
||||||
|
- new upstream release.
|
||||||
|
|
||||||
|
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
|
||||||
|
- initial packaging for MySQL 5.5 on CentOS 5.
|
123
storage/mroonga/packages/source/Makefile.am
Normal file
123
storage/mroonga/packages/source/Makefile.am
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
MROONGA_BASE = $(PACKAGE)-$(VERSION)
|
||||||
|
MROONGA_TAR_GZ = $(MROONGA_BASE).tar.gz
|
||||||
|
|
||||||
|
GROONGA_VERSION = 5.0.0
|
||||||
|
GROONGA_BASE = groonga-$(GROONGA_VERSION)
|
||||||
|
GROONGA_TAR_GZ = $(GROONGA_BASE).tar.gz
|
||||||
|
|
||||||
|
GROONGA_NORMALIZER_MYSQL_VERSION = 1.0.8
|
||||||
|
GROONGA_NORMALIZER_MYSQL_BASE = \
|
||||||
|
groonga-normalizer-mysql-$(GROONGA_NORMALIZER_MYSQL_VERSION)
|
||||||
|
GROONGA_NORMALIZER_MYSQL_TAR_GZ = \
|
||||||
|
$(GROONGA_NORMALIZER_MYSQL_BASE).tar.gz
|
||||||
|
|
||||||
|
MARIADB_VERSION = 10.0.16
|
||||||
|
MARIADB_BASE = mariadb-$(MARIADB_VERSION)
|
||||||
|
MARIADB_TAR_GZ = $(MARIADB_BASE).tar.gz
|
||||||
|
|
||||||
|
MARIADB_WITH_MROONGA_BASE = $(MARIADB_BASE)-with-$(MROONGA_BASE)
|
||||||
|
MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE = $(MARIADB_WITH_MROONGA_BASE)-for-windows
|
||||||
|
|
||||||
|
GROONGA_PROJECT_DOWNLOAD_BASE = http://packages.groonga.org/source
|
||||||
|
GROONGA_DOWNLOAD_BASE = $(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga
|
||||||
|
GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE = \
|
||||||
|
$(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga-normalizer-mysql
|
||||||
|
MARIADB_DOWNLOAD_BASE = http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb
|
||||||
|
|
||||||
|
|
||||||
|
CURL = curl --fail --silent --show-error
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
release: archive upload
|
||||||
|
|
||||||
|
ensure-rsync-path:
|
||||||
|
@if test -z "$(RSYNC_PATH)"; then \
|
||||||
|
echo "--with-rsync-path configure option must be specified."; \
|
||||||
|
false; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
download: ensure-rsync-path
|
||||||
|
rsync -avz --progress --delete $(RSYNC_PATH)/source/mroonga/ files
|
||||||
|
|
||||||
|
ARCHIVES = \
|
||||||
|
files/$(MROONGA_TAR_GZ) \
|
||||||
|
files/$(MARIADB_WITH_MROONGA_BASE).tar.gz \
|
||||||
|
files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip
|
||||||
|
|
||||||
|
archive: $(ARCHIVES)
|
||||||
|
|
||||||
|
upload: ensure-rsync-path
|
||||||
|
rsync -avz --progress --delete files/ $(RSYNC_PATH)/source/mroonga
|
||||||
|
|
||||||
|
files/$(MROONGA_TAR_GZ): $(top_builddir)/$(MROONGA_TAR_GZ)
|
||||||
|
mkdir -p files
|
||||||
|
cp -p $< $@
|
||||||
|
|
||||||
|
tmp/$(GROONGA_TAR_GZ):
|
||||||
|
mkdir -p tmp
|
||||||
|
$(CURL) --output $@ $(GROONGA_DOWNLOAD_BASE)/$(GROONGA_TAR_GZ)
|
||||||
|
|
||||||
|
tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ):
|
||||||
|
mkdir -p tmp
|
||||||
|
$(CURL) --output $@ $(GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE)/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ)
|
||||||
|
|
||||||
|
tmp/$(MARIADB_TAR_GZ):
|
||||||
|
mkdir -p tmp
|
||||||
|
$(CURL) --output $@ $(MARIADB_DOWNLOAD_BASE)/mariadb-$(MARIADB_VERSION)/source/$(MARIADB_TAR_GZ)
|
||||||
|
|
||||||
|
MARIADB_WITH_MROONGA_ARCHIVES = \
|
||||||
|
tmp/$(GROONGA_TAR_GZ) \
|
||||||
|
tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) \
|
||||||
|
tmp/$(MARIADB_TAR_GZ) \
|
||||||
|
$(top_builddir)/$(MROONGA_TAR_GZ)
|
||||||
|
|
||||||
|
BUNDLED_MROONGA_PATH = $(MARIADB_BASE)/storage/$(PACKAGE)
|
||||||
|
BUNDLED_GROONGA_PATH = $(BUNDLED_MROONGA_PATH)/vendor/groonga
|
||||||
|
BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH = \
|
||||||
|
$(BUNDLED_GROONGA_PATH)/vendor/plugins/groonga-normalizer-mysql
|
||||||
|
|
||||||
|
tmp/$(MARIADB_WITH_MROONGA_BASE).stamp: $(MARIADB_WITH_MROONGA_ARCHIVES)
|
||||||
|
rm -rf $(MARIADB_BASE)
|
||||||
|
tar xf tmp/$(MARIADB_TAR_GZ)
|
||||||
|
|
||||||
|
rm -fr $(MARIADB_BASE)/storage/mroonga
|
||||||
|
tar xf $(top_builddir)/$(MROONGA_TAR_GZ)
|
||||||
|
mv $(MROONGA_BASE) $(BUNDLED_MROONGA_PATH)
|
||||||
|
|
||||||
|
mkdir -p $$(dirname $(BUNDLED_GROONGA_PATH))
|
||||||
|
tar xf tmp/$(GROONGA_TAR_GZ)
|
||||||
|
rm -rf $(GROONGA_BASE)/test
|
||||||
|
mv $(GROONGA_BASE) $(BUNDLED_GROONGA_PATH)
|
||||||
|
|
||||||
|
tar xf tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ)
|
||||||
|
rm -rf $(GROONGA_NORMALIZER_MYSQL_BASE)/test
|
||||||
|
mv $(GROONGA_NORMALIZER_MYSQL_BASE) $(BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH)
|
||||||
|
|
||||||
|
rm -rf tmp/$(MARIADB_WITH_MROONGA_BASE)
|
||||||
|
mv $(MARIADB_BASE) tmp/$(MARIADB_WITH_MROONGA_BASE)
|
||||||
|
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
files/$(MARIADB_WITH_MROONGA_BASE).tar.gz: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp
|
||||||
|
mkdir -p files/
|
||||||
|
(cd tmp && tar czf ../$@ $(MARIADB_WITH_MROONGA_BASE))
|
||||||
|
|
||||||
|
PATCHES = \
|
||||||
|
patches/mariadb-10.0.3-windows-build.diff
|
||||||
|
|
||||||
|
tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp $(PATCHES)
|
||||||
|
rm -rf tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE)
|
||||||
|
cp -a \
|
||||||
|
tmp/$(MARIADB_WITH_MROONGA_BASE) \
|
||||||
|
tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE)
|
||||||
|
for patch in $(PATCHES); do \
|
||||||
|
(cd tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE) && \
|
||||||
|
patch -p1 < $(abs_srcdir)/$${patch}); \
|
||||||
|
done
|
||||||
|
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip: tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp
|
||||||
|
mkdir -p files/
|
||||||
|
(cd tmp && zip -q -r ../$@ $(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE))
|
@@ -0,0 +1,9 @@
|
|||||||
|
diff -ur mariadb-10.0.2.orig/sql/sql_locale.cc mariadb-10.0.2/sql/sql_locale.cc
|
||||||
|
--- mariadb-10.0.2.orig/sql/sql_locale.cc 2013-04-23 13:13:59.000000000 +0900
|
||||||
|
+++ mariadb-10.0.2/sql/sql_locale.cc 2013-05-19 12:55:27.590366542 +0900
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
24
storage/mroonga/packages/ubuntu/Makefile.am
Normal file
24
storage/mroonga/packages/ubuntu/Makefile.am
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
CODE_NAMES = precise,trusty,utopic
|
||||||
|
SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
ensure-launchpad-configuration:
|
||||||
|
@if test -z "$(LAUNCHPAD_UPLOADER_PGP_KEY)"; then \
|
||||||
|
echo "--with-launchpad-uploader-pgp-key configure option must be specified."; \
|
||||||
|
false; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload: source ensure-launchpad-configuration
|
||||||
|
./upload.rb \
|
||||||
|
--package '$(PACKAGE)' \
|
||||||
|
--version '$(VERSION)' \
|
||||||
|
--source-archive '$(SOURCE)' \
|
||||||
|
--code-names '$(CODE_NAMES)' \
|
||||||
|
--debian-directory '$(srcdir)/../debian/' \
|
||||||
|
--pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)'
|
||||||
|
|
||||||
|
source: $(SOURCE)
|
||||||
|
|
||||||
|
$(SOURCE):
|
||||||
|
ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE)
|
168
storage/mroonga/packages/ubuntu/upload.rb
Executable file
168
storage/mroonga/packages/ubuntu/upload.rb
Executable file
@@ -0,0 +1,168 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
#
|
||||||
|
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
|
||||||
|
# Copyright(C) 2014 HAYASHI Kentaro <hayashi@clear-code.com>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License version 2.1 as published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
require "optparse"
|
||||||
|
require "fileutils"
|
||||||
|
require "pathname"
|
||||||
|
require "open-uri"
|
||||||
|
|
||||||
|
class Uploader
|
||||||
|
def initialize
|
||||||
|
@dput_configuration_name = "groonga-ppa"
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
ensure_dput_configuration
|
||||||
|
|
||||||
|
parse_command_line!
|
||||||
|
|
||||||
|
ensure_mysql_version
|
||||||
|
|
||||||
|
@required_groonga_version = required_groonga_version
|
||||||
|
|
||||||
|
@code_names.each do |code_name|
|
||||||
|
upload(code_name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def ensure_dput_configuration
|
||||||
|
dput_cf_path = Pathname.new("~/.dput.cf").expand_path
|
||||||
|
if dput_cf_path.exist?
|
||||||
|
dput_cf_content = dput_cf_path.read
|
||||||
|
else
|
||||||
|
dput_cf_content = ""
|
||||||
|
end
|
||||||
|
dput_cf_content.each_line do |line|
|
||||||
|
return if line.chomp == "[#{@dput_configuration_name}]"
|
||||||
|
end
|
||||||
|
|
||||||
|
dput_cf_path.open("w") do |dput_cf|
|
||||||
|
dput_cf.puts(dput_cf_content)
|
||||||
|
dput_cf.puts(<<-CONFIGURATION)
|
||||||
|
[#{@dput_configuration_name}]
|
||||||
|
fqdn = ppa.launchpad.net
|
||||||
|
method = ftp
|
||||||
|
incoming = ~groonga/ppa/ubuntu/
|
||||||
|
login = anonymous
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
CONFIGURATION
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def ensure_mysql_version
|
||||||
|
@mysql_version = {}
|
||||||
|
@code_names.each do |code_name|
|
||||||
|
open("http://packages.ubuntu.com/#{code_name}/allpackages?format=txt.gz") do |file|
|
||||||
|
file.each_line do |line|
|
||||||
|
@mysql_version[code_name] = $1 if line =~ /\Amysql-server \((.+?)\).+/
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_command_line!
|
||||||
|
|
||||||
|
parser = OptionParser.new
|
||||||
|
parser.on("--package=NAME",
|
||||||
|
"The package name") do |name|
|
||||||
|
@package = name
|
||||||
|
end
|
||||||
|
parser.on("--version=VERSION",
|
||||||
|
"The version") do |version|
|
||||||
|
@version = version
|
||||||
|
end
|
||||||
|
parser.on("--source-archive=ARCHIVE",
|
||||||
|
"The source archive") do |source_archive|
|
||||||
|
@source_archive = Pathname.new(source_archive).expand_path
|
||||||
|
end
|
||||||
|
parser.on("--code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array,
|
||||||
|
"The target code names") do |code_names|
|
||||||
|
@code_names = code_names
|
||||||
|
end
|
||||||
|
parser.on("--debian-directory=DIRECTORY",
|
||||||
|
"The debian/ directory") do |debian_directory|
|
||||||
|
@debian_directory = Pathname.new(debian_directory).expand_path
|
||||||
|
end
|
||||||
|
parser.on("--pgp-sign-key=KEY",
|
||||||
|
"The PGP key to sign .changes and .dsc") do |pgp_sign_key|
|
||||||
|
@pgp_sign_key = pgp_sign_key
|
||||||
|
end
|
||||||
|
parser.on("--pbuilder",
|
||||||
|
"Use pbuilder for build check") do |pbuilder|
|
||||||
|
@use_pbuilder = pbuilder
|
||||||
|
end
|
||||||
|
|
||||||
|
parser.parse!
|
||||||
|
end
|
||||||
|
|
||||||
|
def upload(code_name)
|
||||||
|
in_temporary_directory do
|
||||||
|
FileUtils.cp(@source_archive.to_s,
|
||||||
|
"#{@package}_#{@version}.orig.tar.gz")
|
||||||
|
run_command("tar", "xf", @source_archive.to_s)
|
||||||
|
directory_name = "#{@package}-#{@version}"
|
||||||
|
Dir.chdir(directory_name) do
|
||||||
|
FileUtils.cp_r(@debian_directory.to_s, "debian")
|
||||||
|
deb_version = "#{current_deb_version.succ}~#{code_name}1"
|
||||||
|
run_command("dch",
|
||||||
|
"--distribution", code_name,
|
||||||
|
"--newversion", deb_version,
|
||||||
|
"Build for #{code_name}.")
|
||||||
|
run_command("sed",
|
||||||
|
"-i", "-e", "s,MYSQL_VERSION,#{@mysql_version[code_name]},",
|
||||||
|
"debian/control")
|
||||||
|
run_command("debuild", "-S", "-sa", "-pgpg2", "-k#{@pgp_sign_key}")
|
||||||
|
if @use_pbuilder
|
||||||
|
run_command("pbuilder-dist", code_name, "build",
|
||||||
|
"../#{@package}_#{deb_version}.dsc")
|
||||||
|
else
|
||||||
|
run_command("dput", @dput_configuration_name,
|
||||||
|
"../#{@package}_#{deb_version}_source.changes")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def required_groonga_version
|
||||||
|
File.read("../../required_groonga_version").lines.first.chomp
|
||||||
|
end
|
||||||
|
|
||||||
|
def current_deb_version
|
||||||
|
/\((.+)\)/ =~ File.read("debian/changelog").lines.first
|
||||||
|
$1
|
||||||
|
end
|
||||||
|
|
||||||
|
def in_temporary_directory
|
||||||
|
name = "tmp"
|
||||||
|
FileUtils.rm_rf(name)
|
||||||
|
FileUtils.mkdir_p(name)
|
||||||
|
Dir.chdir(name) do
|
||||||
|
yield
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def run_command(*command_line)
|
||||||
|
unless system(*command_line)
|
||||||
|
raise "failed to run command: #{command_line.join(' ')}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
uploader = Uploader.new
|
||||||
|
uploader.run
|
12
storage/mroonga/packages/windows/Makefile.am
Normal file
12
storage/mroonga/packages/windows/Makefile.am
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
EXTRA_DIST = \
|
||||||
|
README.md \
|
||||||
|
build-vc2010.bat \
|
||||||
|
build-vc2010-zip-32.bat \
|
||||||
|
build-vc2010-zip-64.bat \
|
||||||
|
build-vc2010-msi-32.bat \
|
||||||
|
build-vc2010-msi-64.bat \
|
||||||
|
build-vc2013.bat \
|
||||||
|
build-vc2013-zip-32.bat \
|
||||||
|
build-vc2013-zip-64.bat \
|
||||||
|
build-vc2013-msi-32.bat \
|
||||||
|
build-vc2013-msi-64.bat
|
20
storage/mroonga/packages/windows/README.md
Normal file
20
storage/mroonga/packages/windows/README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# How to build Windows binaries
|
||||||
|
|
||||||
|
## Preparation
|
||||||
|
|
||||||
|
TODO...
|
||||||
|
|
||||||
|
## Build with Visual C++ Express
|
||||||
|
|
||||||
|
You need to use Visual C++ 2012 or later to build Mroonga with Express
|
||||||
|
edition. `build-vc2013.bat` is a build batch script to build with
|
||||||
|
Visual C++ Express 2013.
|
||||||
|
|
||||||
|
Note that you can't build MSI file with Express edition. You need to
|
||||||
|
use Professional edition or upper editions to build MSI file.
|
||||||
|
|
||||||
|
## Build with Visual C++ Professional
|
||||||
|
|
||||||
|
You can build both zip file MSI file with Professional edition.
|
||||||
|
`build-vc2010.bat` is a build batch script to build with Visual C++
|
||||||
|
Professional 2010.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user