From 98e09ee4b624ded618124986fa0c04ef85e08cc0 Mon Sep 17 00:00:00 2001 From: Vincent Milum Jr Date: Mon, 2 Oct 2017 13:21:00 -0700 Subject: [PATCH 001/103] MDEV-13909 Fix wsrep_sst_rsync fails on debian Fix for the following error messages during SST: /usr/local/mysql/bin/wsrep_sst_rsync: 258: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found /usr/local/mysql/bin/wsrep_sst_rsync: 263: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found /usr/local/mysql/bin/wsrep_sst_rsync: 268: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found --- scripts/wsrep_sst_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 6906bcbc31541..15632bf368348 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -244,18 +244,18 @@ parse_cnf() # finally get the variable value (if variables has been specified multiple time use the last value only) # look in group+suffix - if [[ -n $WSREP_SST_OPT_CONF_SUFFIX ]]; then + if [ -n $WSREP_SST_OPT_CONF_SUFFIX ]; then reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF "${group}${WSREP_SST_OPT_CONF_SUFFIX}" | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) fi # look in group - if [[ -z $reval ]]; then + if [ -z $reval ]; then reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) fi # use default if we haven't found a value - if [[ -z $reval ]]; then - [[ -n $3 ]] && reval=$3 + if [ -z $reval ]; then + [ -n $3 ] && reval=$3 fi echo $reval } From 13167e64898da6373fa8cab2ad89514eaf886412 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Tue, 10 Oct 2017 23:15:25 +0900 Subject: [PATCH 002/103] Update Mroonga to the latest version on 2017-10-10T23:15:25+0900 --- storage/mroonga/CMakeLists.txt | 154 +- storage/mroonga/CMakeLists.txt.orig | 480 + storage/mroonga/Makefile.am | 46 +- storage/mroonga/appveyor.yml | 69 +- storage/mroonga/autogen.sh | 115 +- .../mroonga/build/makefiles/sphinx-build.am | 2 - storage/mroonga/config.sh.in | 2 +- storage/mroonga/configure.ac | 38 +- storage/mroonga/data/install.sql.in | 16 + storage/mroonga/data/uninstall.sql | 4 + storage/mroonga/ha_mroonga.cpp | 2940 +- storage/mroonga/ha_mroonga.def | 3 + storage/mroonga/ha_mroonga.hpp | 183 +- .../mroonga/lib/libmrn_need_mysql_sources.am | 21 +- storage/mroonga/lib/mrn_column_name.cpp | 63 + storage/mroonga/lib/mrn_column_name.hpp | 38 + .../mroonga/lib/mrn_condition_converter.cpp | 53 +- .../mroonga/lib/mrn_condition_converter.hpp | 2 +- storage/mroonga/lib/mrn_context_pool.cpp | 120 + storage/mroonga/lib/mrn_context_pool.hpp | 41 + .../mroonga/lib/mrn_count_skip_checker.cpp | 303 + .../mroonga/lib/mrn_count_skip_checker.hpp | 57 + storage/mroonga/lib/mrn_current_thread.hpp | 27 + storage/mroonga/lib/mrn_database.cpp | 89 + storage/mroonga/lib/mrn_database.hpp | 47 + storage/mroonga/lib/mrn_database_manager.cpp | 76 +- storage/mroonga/lib/mrn_database_manager.hpp | 5 +- storage/mroonga/lib/mrn_database_repairer.cpp | 120 +- storage/mroonga/lib/mrn_database_repairer.hpp | 17 +- storage/mroonga/lib/mrn_index_table_name.cpp | 28 +- storage/mroonga/lib/mrn_index_table_name.hpp | 7 +- .../lib/mrn_multiple_column_key_codec.cpp | 9 + .../lib/mrn_multiple_column_key_codec.hpp | 4 +- storage/mroonga/lib/mrn_operation.cpp | 51 + storage/mroonga/lib/mrn_operation.hpp | 42 + storage/mroonga/lib/mrn_operations.cpp | 401 + storage/mroonga/lib/mrn_operations.hpp | 60 + storage/mroonga/lib/mrn_path_mapper.cpp | 4 + storage/mroonga/lib/mrn_path_mapper.hpp | 2 + storage/mroonga/lib/mrn_query_parser.cpp | 361 + storage/mroonga/lib/mrn_query_parser.hpp | 67 + storage/mroonga/lib/mrn_smart_bitmap.cpp | 42 + storage/mroonga/lib/mrn_smart_bitmap.hpp | 36 + .../lib/mrn_table_fields_offset_mover.cpp | 41 + .../lib/mrn_table_fields_offset_mover.hpp | 33 + storage/mroonga/mrn_err.h | 3 + storage/mroonga/mrn_mysql.h | 19 +- storage/mroonga/mrn_mysql_compat.h | 243 +- storage/mroonga/mrn_table.cpp | 68 +- storage/mroonga/mrn_variables.hpp | 24 + .../{have_64bit.inc => check_64bit.inc} | 9 +- .../mroonga/include/mroonga/check_freebsd.inc | 5 +- .../include/mroonga/check_ha_mroonga_so.inc | 2 +- .../mroonga/check_libgroonga_embedded.inc | 2 +- .../mroonga/check_libgroonga_support_lz4.inc | 2 +- .../mroonga/check_libgroonga_support_zlib.inc | 2 +- .../mroonga/check_libgroonga_support_zstd.inc | 20 + .../mroonga/include/mroonga/check_mariadb.inc | 2 +- .../mroonga/include/mroonga/check_osx.inc | 16 +- .../mroonga/include/mroonga/check_solaris.inc | 20 + .../include/mroonga/check_strict_sql_mode.inc | 21 + .../mroonga/include/mroonga/check_version.inc | 22 +- .../mroonga/include/mroonga/check_windows.inc | 2 +- .../mroonga/include/mroonga/have_32bit.inc | 28 - .../mroonga/have_fractional_seconds.inc | 6 +- .../mroonga/include/mroonga/have_freebsd.inc | 6 +- .../mroonga/have_groonga_plugin_register.inc | 4 +- .../mroonga/include/mroonga/have_mariadb.inc | 4 +- .../mroonga/have_mariadb_10_2_or_later.inc | 26 + .../mroonga/include/mroonga/have_mroonga.inc | 2 +- .../include/mroonga/have_mroonga_deinit.inc | 2 +- .../include/mroonga/have_mroonga_helper.inc | 2 +- .../mroonga/include/mroonga/have_mysql.inc | 4 +- .../mroonga/have_mysql_5_7_or_later.inc | 26 + .../mroonga/have_signed_64bit_time_t.inc | 28 + .../mroonga/include/mroonga/have_solaris.inc | 21 + .../include/mroonga/have_strict_sql_mode.inc | 21 + ..._version_100.inc => have_version_10_0.inc} | 8 +- ...ter.inc => have_version_10_0_or_later.inc} | 8 +- ...ve_version_56.inc => have_version_5_5.inc} | 8 +- ...ve_version_55.inc => have_version_5_6.inc} | 6 +- ...ater.inc => have_version_5_6_or_later.inc} | 6 +- ...ve_version_57.inc => have_version_5_7.inc} | 6 +- .../mroonga/have_version_5_7_or_later.inc | 21 + .../mroonga/load_mroonga_functions.inc | 8 +- .../mroonga/include/mroonga/skip_freebsd.inc | 6 +- ...ter.inc => skip_mariadb_10_0_or_later.inc} | 10 +- .../mroonga/skip_mariadb_10_1_or_earlier.inc | 24 + .../mroonga/skip_mariadb_10_2_or_later.inc | 24 + ...ip_mariadb_55.inc => skip_mariadb_5_5.inc} | 8 +- .../{skip_mysql_55.inc => skip_mysql_5_5.inc} | 8 +- .../{skip_mysql_57.inc => skip_mysql_5_7.inc} | 6 +- .../mroonga/skip_mysql_5_7_or_later.inc | 24 + .../mroonga/include/mroonga/skip_osx.inc | 4 +- .../mroonga/skip_signed_64bit_time_t.inc | 28 + .../mroonga/include/mroonga/skip_solaris.inc | 21 + .../include/mroonga/skip_solaris10.inc | 3 - .../include/mroonga/skip_strict_sql_mode.inc | 21 + .../mroonga/support_libgroonga_lz4.inc | 4 +- .../mroonga/support_libgroonga_zlib.inc | 4 +- .../mroonga/support_libgroonga_zstd.inc | 22 + .../mroonga/unload_mroonga_functions.inc | 8 +- .../mroonga/unsupport_libgroonga_lz4.inc | 4 +- .../mroonga/unsupport_libgroonga_zlib.inc | 4 +- .../mroonga/unsupport_libgroonga_zstd.inc | 22 + .../r/alter_table_add_column_after.result | 10 +- .../r/alter_table_add_column_first.result | 10 +- ...lter_table_add_column_flags_comment.result | 5 + ...er_table_add_column_flags_parameter.result | 5 + ...ble_add_column_groonga_type_comment.result | 11 +- ...e_add_column_groonga_type_parameter.result | 14 +- ...er_table_add_column_multibyte_cp932.result | 35 + ...ter_table_add_column_multibyte_utf8.result | 35 + .../r/alter_table_add_column_multiple.result | 10 +- .../r/alter_table_add_column_plain.result | 10 +- ...alter_table_add_column_type_comment.result | 11 +- ...ndex_token_filters_one_token_filter.result | 9 +- ...er_table_change_column_rename_after.result | 14 +- ...er_table_change_column_rename_first.result | 14 +- ...table_change_column_rename_multiple.result | 24 +- ...table_change_column_rename_no_order.result | 14 +- ... alter_table_change_engine_decimal.result} | 25 +- ...table_change_engine_fulltext_index.result} | 30 +- .../r/alter_table_change_token_filter.result | 23 +- ...r_table_disable_keys_fulltext_table.result | 22 +- .../r/alter_table_drop_column_multiple.result | 8 +- .../r/alter_table_drop_column_one.result | 10 +- ...er_table_enable_keys_fulltext_table.result | 22 +- .../r/alter_table_fulltext_add_normal.result | 10 +- .../r/alter_table_modify_column_after.result | 14 +- .../r/alter_table_modify_column_first.result | 14 +- .../alter_table_modify_column_no_order.result | 10 +- ...le_recreate_anonymous_index_at_once.result | 18 - .../storage/r/alter_table_rename_table.result | 30 +- .../storage/r/alter_table_spatial.result | 4 +- .../storage/r/check_table_broken.result | 18 + .../storage/r/check_table_not_broken.result | 13 + .../storage/r/column_date_with_index.result | 4 +- .../r/column_date_without_index.result | 4 +- .../r/column_datetime_32bit_2038.result | 8 - ...mn_datetime_32bit_before_unix_epoch.result | 8 - .../r/column_datetime_32bit_max.result | 8 - .../column_datetime_32bit_out_of_range.result | 8 - .../r/column_datetime_64bit_2038.result | 8 - ...mn_datetime_64bit_before_unix_epoch.result | 12 +- .../r/column_datetime_64bit_max.result | 8 - ..._64bit_strict_sql_mode_out_of_range.result | 12 + ...ime_64bit_version_5_5_out_of_range.result} | 8 - ..._version_5_6_or_later_out_of_range.result} | 8 - ...etime_fractional_seconds_with_index.result | 9 - ...me_fractional_seconds_without_index.result | 8 - ..._datetime_freebsd_before_unix_epoch.result | 8 - ...me_mariadb_10_2_or_later_zero_date.result} | 9 - ...ariadb_10_2_or_later_zero_month_day.result | 12 + ...tetime_mysql_5_7_or_later_zero_date.result | 14 + ...e_mysql_5_7_or_later_zero_month_day.result | 12 + .../storage/r/column_datetime_null.result | 8 - .../r/column_datetime_with_index.result | 9 - .../r/column_datetime_without_index.result | 8 - .../r/column_datetime_zero_date.result | 25 +- .../r/column_datetime_zero_month_day.result | 20 + ...cimal_fractional_seconds_with_index.result | 9 - ...al_fractional_seconds_without_index.result | 8 - .../r/column_decimal_with_index.result | 9 - .../r/column_decimal_without_index.result | 8 - .../column_generated_stored_add_column.result | 15 + .../r/column_generated_stored_delete.result | 15 + ...column_generated_stored_drop_column.result | 17 + .../r/column_generated_stored_insert.result | 15 + .../r/column_generated_stored_reindex.result | 17 + .../r/column_generated_stored_update.result | 15 + ...column_generated_virtual_add_column.result | 15 + .../r/column_generated_virtual_delete.result | 15 + ...olumn_generated_virtual_drop_column.result | 16 + .../r/column_generated_virtual_insert.result | 15 + ...ual_mariadb_10_2_or_later_add_index.result | 9 + ..._2_or_later_create_table_with_index.result | 8 + ...irtual_mysql_5_7_or_later_add_index.result | 9 + .../r/column_generated_virtual_update.result | 16 + ...a_index_fulltext_vector_other_table.result | 11 +- ...olumn_groonga_index_int_other_table.result | 13 +- .../column_groonga_scalar_support_zstd.result | 10 + ...olumn_groonga_scalar_unsupport_zstd.result | 12 + .../r/column_groonga_vector_reference.result | 9 +- .../storage/r/column_json_insert.result | 13 + .../storage/r/column_multibyte_cp932.result | 32 + .../storage/r/column_multibyte_utf8.result | 32 + ..._time_fractional_seconds_with_index.result | 10 - .../storage/r/column_time_with_index.result | 10 - ...stamp_fractional_seconds_with_index.result | 10 - .../r/column_timestamp_with_index.result | 14 +- .../storage/r/column_year_with_index.result | 9 - .../r/column_year_without_index.result | 8 - .../mroonga/storage/r/count_star.result | 11 + ... create_table_column_flags_comment.result} | 5 + ...reate_table_column_flags_parameter.result} | 12 +- ..._table_column_groonga_type_comment.result} | 11 +- ...le_column_groonga_type_nonexistent.result} | 0 ...able_column_groonga_type_parameter.result} | 14 +- ...> create_table_column_type_comment.result} | 11 +- ...eate_table_column_type_nonexistent.result} | 0 .../r/create_table_default_tokenizer.result | 5 + .../r/create_table_index_flags_comment.result | 2 +- ...eate_table_index_flags_index_medium.result | 10 + ...reate_table_index_flags_index_small.result | 10 + .../r/create_table_index_flags_none.result | 2 +- .../create_table_index_flags_parameter.result | 2 +- ...create_table_index_index_flags_none.result | 2 +- ...flags_with_position_and_with_weight.result | 2 +- ...index_normalizer_fulltext_index_bin.result | 16 + ...te_table_index_normalizer_index_bin.result | 22 + .../create_table_index_parser_comment.result | 14 +- .../create_table_index_parser_default.result | 8 - .../r/create_table_index_parser_off.result | 14 +- ...oken_filters_multiple_token_filters.result | 9 +- ...ndex_token_filters_one_token_filter.result | 9 +- ...table_index_token_filters_parameter.result | 9 +- ...reate_table_index_tokenizer_comment.result | 8 - ...reate_table_index_tokenizer_default.result | 8 - .../r/create_table_index_tokenizer_off.result | 8 - ...ate_table_index_tokenizer_parameter.result | 8 - ...oken_filters_multiple_token_filters.result | 13 +- ...able_token_filters_one_token_filter.result | 13 +- .../storage/r/drop_database_no_table.result | 20 + .../storage/r/foreign_key_alter_add.result | 24 + .../storage/r/foreign_key_alter_drop.result | 23 + .../storage/r/foreign_key_create.result | 145 +- .../r/foreign_key_delete_existent.result | 53 + .../r/foreign_key_delete_nonexistent.result | 53 + .../r/foreign_key_insert_existent.result | 51 + .../r/foreign_key_insert_nonexistent.result | 37 + .../storage/r/foreign_key_rename.result | 28 + .../r/foreign_key_update_existent.result | 55 + .../r/foreign_key_update_nonexistent.result | 53 + .../r/fulltext_boolean_mode_escape.result | 4 +- .../fulltext_boolean_mode_leading_not.result | 9 - ..._mode_pragma_syntax_script_operator.result | 20 + ..._mode_pragma_syntax_script_selector.result | 25 + ...ext_boolean_mode_syntax_error_error.result | 4 +- ...ean_mode_syntax_error_error_and_log.result | 4 +- ...xt_boolean_mode_syntax_error_ignore.result | 4 +- ...an_mode_syntax_error_ignore_and_log.result | 4 +- .../storage/r/fulltext_charset_utf8mb4.result | 9 - .../storage/r/fulltext_found_rows.result | 13 - .../storage/r/fulltext_index_recreate.result | 9 - .../storage/r/fulltext_insert_values.result | 8 - ...lltext_multiple_column_index_delete.result | 11 - ...lltext_multiple_column_index_insert.result | 11 - ...text_multiple_column_index_recreate.result | 11 - ...lltext_multiple_column_index_update.result | 11 - .../storage/r/fulltext_multiple_index.result | 10 - .../storage/r/fulltext_no_primary_key.result | 7 - ... fulltext_version_10_0_no_such_key.result} | 0 ...> fulltext_version_5_5_no_such_key.result} | 0 ...> fulltext_version_5_6_no_such_key.result} | 0 .../r/function_command_auto-escape.result | 16 + ...ction_command_special-database-name.result | 22 + ...on_escape_error_query_is_not_string.result | 2 +- ...esult => function_escape_query_all.result} | 0 ...lt => function_escape_query_custom.result} | 0 .../r/function_escape_query_join.result | 26 + ...function_escape_query_match_against.result | 18 + .../r/function_escape_query_named.result | 4 + ...lt => function_escape_query_nested.result} | 0 .../r/function_escape_script_decimal.result | 11 + .../r/function_escape_script_integer.result | 4 + .../r/function_escape_script_real.result | 11 + .../r/function_escape_script_string.result | 4 + ...tion_highlight_html_dynamic_keyword.result | 11 + .../r/function_highlight_html_japanese.result | 13 + ...on_highlight_html_multiple_keywords.result | 4 + .../function_highlight_html_normalizer.result | 4 + .../r/function_highlight_html_query.result | 13 + ...unction_highlight_html_query_pragma.result | 13 + .../r/function_highlight_html_record.result | 32 + .../r/function_normalize_default.result | 3 + .../r/function_normalize_normalizer.result | 3 + .../r/function_normalize_record.result | 7 + .../r/function_query_expand_multiple.result | 18 + .../r/function_query_expand_no_index.result | 15 + .../r/function_query_expand_one.result | 16 + .../r/function_query_expand_pragma.result | 17 + ...nction_snippet_html_dynamic_keyword.result | 11 + .../r/function_snippet_html_japanese.result | 9 + ...tion_snippet_html_multiple_keywords.result | 4 + ...tion_snippet_html_multiple_snippets.result | 10 + .../r/function_snippet_html_query.result | 9 + .../function_snippet_html_query_pragma.result | 9 + .../r/function_snippet_html_record.result | 30 + .../storage/r/geometry_contains.result | 15 +- ...y_strict_sql_mode_bulk_insert_null.result} | 7 +- .../geometry_strict_sql_mode_contains.result | 169 + .../storage/r/index_hash_id_primary.result | 22 +- ...dex_hash_strict_sql_mode_id_primary.result | 19 + ...column_order_by_where_equal_asc_asc.result | 40 + ...lumn_order_by_where_equal_desc_desc.result | 40 + ...lumn_primary_strict_sql_mode_update.result | 26 + ...ndex_multiple_column_primary_update.result | 39 +- ...column_range_all_used_greater_than.result} | 0 ...nge_all_used_greater_than_or_equal.result} | 0 ...le_column_range_all_used_less_than.result} | 0 ..._range_all_used_less_than_or_equal.result} | 0 ...ially_used_have_prefix_greater_than.result | 34 + ...d_have_prefix_greater_than_or_equal.result | 35 + ...artially_used_have_prefix_less_than.result | 34 + ...used_have_prefix_less_than_or_equal.result | 35 + ...rtially_used_no_prefix_greater_than.result | 29 + ...sed_no_prefix_greater_than_or_equal.result | 30 + ..._partially_used_no_prefix_less_than.result | 30 + ...y_used_no_prefix_less_than_or_equal.result | 31 + .../r/index_multiple_column_select_max.result | 20 + .../r/index_multiple_column_select_min.result | 20 + ...iple_column_unique_date_64bit_equal.result | 10 +- ...tiple_column_unique_date_index_read.result | 12 +- ..._column_unique_date_order_64bit_asc.result | 12 +- ...column_unique_date_order_64bit_desc.result | 12 +- ...e_column_unique_datetime_index_read.result | 12 +- ...le_column_unique_datetime_order_asc.result | 12 +- ...e_column_unique_datetime_order_desc.result | 12 +- ..._column_unique_timestamp_index_read.result | 4 +- ...e_column_unique_timestamp_order_asc.result | 4 +- ..._column_unique_timestamp_order_desc.result | 4 +- ...le_column_unique_timestamp_reinsert.result | 4 +- .../storage/r/index_primary_date.result | 7 - ...ry_datetime_with_fractional_seconds.result | 7 - ...datetime_without_fractional_seconds.result | 7 - ...ary_decimal_with_fractional_seconds.result | 7 - ..._decimal_without_fractional_seconds.result | 7 - ...rimary_time_with_fractional_seconds.result | 7 - ...ary_time_without_fractional_seconds.result | 7 - ...y_timestamp_with_fractional_seconds.result | 7 - ...imestamp_without_fractional_seconds.result | 7 - .../storage/r/index_primary_year.result | 7 - .../storage/r/index_unique_delete_all.result | 14 + ...formation_schema_tables_data_length.result | 9 - .../storage/r/insert_TODO_SPLIT_ME.result | 12 - ...on_duplicate_key_update_primary_key.result | 7 - ..._on_duplicate_key_update_unique_key.result | 9 - .../storage/r/insert_virtual_column.result | 13 + ...timization_count_skip_TODO_SPLIT_ME.result | 106 - .../r/optimization_count_skip_disabled.result | 8 - .../optimization_count_skip_index_and.result | 20 + ...timization_count_skip_index_between.result | 18 + ...optimization_count_skip_index_equal.result | 18 + ...ex_full_text_search_in_boolean_mode.result | 19 + ...ext_search_in_natural_language_mode.result | 19 + ...timization_count_skip_index_greater.result | 18 + ...tion_count_skip_index_greater_equal.result | 18 + .../optimization_count_skip_index_less.result | 18 + ...ization_count_skip_index_less_equal.result | 18 + ...mization_count_skip_index_not_equal.result | 18 + ...tion_count_skip_multiple_conditions.result | 17 + ...tion_count_skip_primary_key_between.result | 17 + ...zation_count_skip_primary_key_equal.result | 17 + ...tion_count_skip_primary_key_greater.result | 17 + ...ount_skip_primary_key_greater_equal.result | 17 + ...ization_count_skip_primary_key_less.result | 17 + ...n_count_skip_primary_key_less_equal.result | 17 + ...on_count_skip_primary_key_not_equal.result | 17 + ..._order_limit_not_optimized_disabled.result | 13 - ...t_optimized_multiple_match_againsts.result | 35 + ..._order_limit_not_optimized_no_limit.result | 13 - ...ization_order_limit_optimized_cp932.result | 22 + ...er_limit_optimized_datetime_between.result | 9 - ...mit_optimized_datetime_between_over.result | 9 - ...rder_limit_optimized_datetime_equal.result | 9 - ...mit_optimized_datetime_greater_than.result | 9 - ...ized_datetime_greater_than_or_equal.result | 9 - ..._limit_optimized_datetime_less_than.result | 9 - ...timized_datetime_less_than_or_equal.result | 9 - ...ion_order_limit_optimized_enum_name.result | 25 + ...on_order_limit_optimized_enum_value.result | 25 + ...er_limit_optimized_have_primary_key.result | 13 - ...ion_order_limit_optimized_int_equal.result | 13 - ...er_limit_optimized_int_greater_than.result | 13 - ...optimized_int_greater_than_or_equal.result | 13 - ...order_limit_optimized_int_less_than.result | 13 - ...it_optimized_int_less_than_or_equal.result | 13 - ...rder_limit_optimized_no_primary_key.result | 12 - ..._order_limit_optimized_order_by_asc.result | 13 - ...order_limit_optimized_order_by_desc.result | 13 - ...n_order_limit_optimized_order_by_id.result | 14 - ...it_optimized_order_by_match_against.result | 13 - ...imit_optimized_select_match_against.result | 13 - ..._order_limit_optimized_time_between.result | 9 - ...r_limit_optimized_time_between_over.result | 9 - ...on_order_limit_optimized_time_equal.result | 9 - ...r_limit_optimized_time_greater_than.result | 9 - ...ptimized_time_greater_than_or_equal.result | 9 - ...rder_limit_optimized_time_less_than.result | 9 - ...t_optimized_time_less_than_or_equal.result | 9 - ..._optimized_varchar_equal_with_index.result | 14 - ...timized_varchar_equal_without_index.result | 13 - .../r/repair_table_no_index_file.result | 11 +- .../mroonga/storage/r/replace_text.result | 8 - .../mroonga/storage/r/replace_varchar.result | 8 - .../r/select_group_by_with_index.result | 8 +- .../r/select_group_by_without_index.result | 11 +- .../storage/r/sub_query_fulltext.result | 9 - .../mroonga/storage/r/temporary_table.result | 7 - .../mroonga/storage/r/truncate.result | 13 - .../storage/r/update_binlog_row.result | 16 + .../storage/r/update_virtual_column.result | 27 +- ...ariable_default_tokenizer_new_value.result | 6 + ...riable_default_tokenizer_same_value.result | 4 + .../r/variable_dry_write_delete.result | 8 - .../r/variable_dry_write_insert.result | 8 - .../r/variable_dry_write_update.result | 8 - ..._enable_operations_recording_insert.result | 12 + ...e_match_escalation_threshold_global.result | 29 +- ..._match_escalation_threshold_session.result | 11 +- ...estimate_mysql_5_7_or_later_global.result} | 6 +- ...sql_5_7_or_later_not_found_in_limit.result | 17 + ...estimate_mysql_5_7_or_later_session.result | 22 + ...rds_for_estimate_not_found_in_limit.result | 15 + ...query_log_file_disabled_empty_value.result | 9 + ..._query_log_file_disabled_null_value.result | 9 + ..._query_log_file_enabled_empty_value.result | 10 + ...e_query_log_file_enabled_null_value.result | 10 + .../variable_query_log_file_new_value.result | 9 + .../variable_query_log_file_same_value.result | 10 + .../mysql-test/mroonga/storage/suite.pm | 2 +- .../t/alter_table_add_column_after.test | 6 +- .../t/alter_table_add_column_first.test | 6 +- .../alter_table_add_column_flags_comment.test | 2 +- ...lter_table_add_column_flags_parameter.test | 2 +- ...table_add_column_groonga_type_comment.test | 2 +- ...ble_add_column_groonga_type_parameter.test | 4 +- ...lter_table_add_column_multibyte_cp932.test | 53 + ...alter_table_add_column_multibyte_utf8.test | 53 + .../t/alter_table_add_column_multiple.test | 6 +- .../t/alter_table_add_column_plain.test | 6 +- .../alter_table_add_column_type_comment.test | 2 +- ..._index_token_filters_one_token_filter.test | 2 +- ...ter_table_add_index_unique_duplicated.test | 2 +- ...dex_unique_multiple_column_duplicated.test | 2 +- ...ble_add_key_multiple_column_with_data.test | 2 +- .../t/alter_table_add_primary_key.test | 2 +- ...change_column_comment_not_for_mroonga.test | 2 +- .../alter_table_change_column_have_index.test | 2 +- ...lter_table_change_column_rename_after.test | 8 +- ...lter_table_change_column_rename_first.test | 8 +- ...r_table_change_column_rename_multiple.test | 12 +- ...r_table_change_column_rename_no_order.test | 8 +- ...=> alter_table_change_engine_decimal.test} | 9 +- ...r_table_change_engine_fulltext_index.test} | 10 +- .../t/alter_table_change_token_filter.test | 2 +- ...er_table_disable_keys_create_fulltext.test | 2 +- ...ter_table_disable_keys_fulltext_table.test | 2 +- ...lter_table_disable_keys_fulltext_ujis.test | 2 +- ...lter_table_disable_keys_fulltext_utf8.test | 2 +- ...er_table_disable_keys_multiple_column.test | 2 +- .../t/alter_table_disable_keys_normal.test | 2 +- .../t/alter_table_disable_keys_primary.test | 2 +- .../t/alter_table_disable_keys_truncate.test | 2 +- .../t/alter_table_disable_keys_updating.test | 2 +- .../t/alter_table_drop_column_multiple.test | 6 +- .../t/alter_table_drop_column_one.test | 6 +- ...le_drop_key_multiple_column_with_data.test | 2 +- .../t/alter_table_drop_primary_key.test | 2 +- .../t/alter_table_enable_keys_fulltext.test | 2 +- ...lter_table_enable_keys_fulltext_table.test | 2 +- ...alter_table_enable_keys_fulltext_ujis.test | 2 +- ...alter_table_enable_keys_fulltext_utf8.test | 2 +- ...ter_table_enable_keys_multiple_column.test | 2 +- .../t/alter_table_enable_keys_normal.test | 2 +- .../t/alter_table_enable_keys_primary.test | 2 +- ...ter_table_fulltext_add_no_primary_key.test | 2 +- .../t/alter_table_fulltext_add_normal.test | 5 +- .../t/alter_table_fulltext_add_table.test | 2 +- .../t/alter_table_fulltext_drop_table.test | 2 +- .../t/alter_table_modify_column_after.test | 8 +- .../t/alter_table_modify_column_first.test | 8 +- .../t/alter_table_modify_column_no_order.test | 6 +- ...able_recreate_anonymous_index_at_once.test | 5 +- .../storage/t/alter_table_rename_table.test | 10 +- .../storage/t/alter_table_spatial.test | 6 +- .../t/auto_increment_TODO_SPLIT_ME.test | 2 +- .../storage/t/auto_increment_table_param.test | 2 +- .../storage/t/auto_increment_text.test | 2 +- .../storage/t/binlog_TODO_SPLIT_ME.test | 2 +- .../mroonga/storage/t/check_table_broken.test | 45 + .../storage/t/check_table_not_broken.test | 38 + .../t/collation_utf8_general_ci_french.test | 2 +- .../collation_utf8_unicode_520_ci_french.test | 4 +- ...ollation_utf8_unicode_520_ci_japanese.test | 4 +- .../t/collation_utf8_unicode_ci_french.test | 2 +- .../t/collation_utf8_unicode_ci_japanese.test | 2 +- .../column_comment_index_not_for_mroonga.test | 2 +- ...column_comment_normal_not_for_mroonga.test | 2 +- .../storage/t/column_date_with_index.test | 4 +- .../storage/t/column_date_without_index.test | 4 +- .../storage/t/column_date_zero_date.test | 4 +- .../storage/t/column_datetime_32bit_2038.test | 5 +- ...lumn_datetime_32bit_before_unix_epoch.test | 5 +- .../storage/t/column_datetime_32bit_max.test | 5 +- .../t/column_datetime_32bit_out_of_range.test | 5 +- .../storage/t/column_datetime_64bit_2038.test | 5 +- ...lumn_datetime_64bit_before_unix_epoch.test | 9 +- .../storage/t/column_datetime_64bit_max.test | 5 +- ...e_64bit_strict_sql_mode_out_of_range.test} | 9 +- ...etime_64bit_version_5_5_out_of_range.test} | 7 +- ...bit_version_5_6_or_later_out_of_range.test | 41 + ...atetime_fractional_seconds_with_index.test | 3 +- ...time_fractional_seconds_without_index.test | 3 +- ...mn_datetime_freebsd_before_unix_epoch.test | 3 +- ...time_mariadb_10_2_or_later_zero_date.test} | 8 +- ..._mariadb_10_2_or_later_zero_month_day.test | 39 + ...datetime_mysql_5_7_or_later_zero_date.test | 39 + ...ime_mysql_5_7_or_later_zero_month_day.test | 39 + .../storage/t/column_datetime_null.test | 3 +- .../storage/t/column_datetime_with_index.test | 3 +- .../t/column_datetime_without_index.test | 3 +- .../storage/t/column_datetime_zero_date.test | 16 +- .../t/column_datetime_zero_month_day.test | 39 + ...decimal_fractional_seconds_with_index.test | 3 +- ...imal_fractional_seconds_without_index.test | 3 +- .../storage/t/column_decimal_with_index.test | 3 +- .../t/column_decimal_without_index.test | 3 +- .../t/column_enum_less_with_index.test | 2 +- .../t/column_enum_many_with_index.test | 2 +- .../t/column_generated_stored_add_column.test | 42 + .../t/column_generated_stored_delete.test | 42 + .../column_generated_stored_drop_column.test | 42 + .../t/column_generated_stored_insert.test | 40 + .../t/column_generated_stored_reindex.test | 42 + .../t/column_generated_stored_update.test | 42 + .../column_generated_virtual_add_column.test | 41 + .../t/column_generated_virtual_delete.test | 41 + .../column_generated_virtual_drop_column.test | 41 + .../t/column_generated_virtual_insert.test | 39 + ...rtual_mariadb_10_2_or_later_add_index.test | 35 + ...10_2_or_later_create_table_with_index.test | 32 + ..._virtual_mysql_5_7_or_later_add_index.test | 35 + .../t/column_generated_virtual_update.test | 41 + .../storage/t/column_groonga__id__id.test | 2 +- .../t/column_groonga__id_invalid_id.test | 2 +- ...mn_groonga_index_fulltext_other_table.test | 2 +- ...nga_index_fulltext_vector_other_table.test | 2 +- .../column_groonga_index_int_other_table.test | 2 +- .../t/column_groonga_scalar_reference.test | 2 +- .../t/column_groonga_scalar_support_lz4.test | 2 +- .../t/column_groonga_scalar_support_zlib.test | 2 +- .../t/column_groonga_scalar_support_zstd.test | 37 + .../column_groonga_scalar_unsupport_lz4.test | 2 +- .../column_groonga_scalar_unsupport_zlib.test | 2 +- .../column_groonga_scalar_unsupport_zstd.test | 37 + ...a_scalar_with_not_for_mroonga_comment.test | 2 +- ...groonga_vector_order_by_with_function.test | 2 +- .../t/column_groonga_vector_reference.test | 7 +- .../t/column_int_with_index_zero_value.test | 2 +- .../mroonga/storage/t/column_json_insert.test | 37 + .../storage/t/column_multibyte_cp932.test | 51 + .../storage/t/column_multibyte_utf8.test | 51 + .../storage/t/column_set_16_with_index.test | 2 +- .../storage/t/column_set_24_with_index.test | 2 +- .../storage/t/column_set_32_with_index.test | 2 +- .../storage/t/column_set_64_with_index.test | 2 +- .../storage/t/column_set_8_with_index.test | 2 +- .../t/column_signed_bigint_with_index.test | 2 +- .../t/column_signed_int_with_index.test | 2 +- .../t/column_signed_mediumint_with_index.test | 2 +- .../t/column_signed_smallint_with_index.test | 2 +- .../t/column_signed_tinyint_with_index.test | 2 +- ...mn_time_fractional_seconds_with_index.test | 3 +- .../storage/t/column_time_with_index.test | 3 +- ...mestamp_fractional_seconds_with_index.test | 5 +- .../t/column_timestamp_with_index.test | 9 +- .../t/column_tinyint_without_index.test | 2 +- .../t/column_unsigned_bigint_with_index.test | 2 +- .../column_unsigned_bigint_without_index.test | 2 +- .../t/column_unsigned_int_with_index.test | 2 +- .../column_unsigned_mediumint_with_index.test | 2 +- .../column_unsigned_smallint_with_index.test | 2 +- .../t/column_unsigned_tinyint_with_index.test | 2 +- .../storage/t/column_year_with_index.test | 3 +- .../storage/t/column_year_without_index.test | 3 +- .../mroonga/storage/t/count_star.test | 35 + .../storage/t/create_database_name_slash.test | 2 +- .../storage/t/create_table_TODO_SPLIT_ME.test | 4 +- ...=> create_table_column_flags_comment.test} | 2 +- ... create_table_column_flags_parameter.test} | 3 +- ...te_table_column_groonga_type_comment.test} | 2 +- ...able_column_groonga_type_nonexistent.test} | 2 +- ..._table_column_groonga_type_parameter.test} | 4 +- ... => create_table_column_type_comment.test} | 2 +- ...create_table_column_type_nonexistent.test} | 2 +- .../t/create_table_comment_normal.test | 2 +- .../t/create_table_default_tokenizer.test | 2 +- .../t/create_table_index_flags_comment.test | 2 +- ...create_table_index_flags_index_medium.test | 39 + .../create_table_index_flags_index_small.test | 39 + .../t/create_table_index_flags_none.test | 2 +- .../t/create_table_index_flags_parameter.test | 2 +- .../create_table_index_index_flags_none.test | 2 +- ...x_flags_with_position_and_with_weight.test | 2 +- ...create_table_index_normalizer_comment.test | 2 +- ...e_index_normalizer_fulltext_index_bin.test | 42 + ...eate_table_index_normalizer_index_bin.test | 37 + ..._no_utf8_charset_with_utf8_normalizer.test | 2 +- .../t/create_table_index_normalizer_none.test | 2 +- ...eate_table_index_normalizer_parameter.test | 2 +- .../t/create_table_index_parser_comment.test | 4 +- .../t/create_table_index_parser_default.test | 3 +- .../t/create_table_index_parser_off.test | 4 +- ..._token_filters_multiple_token_filters.test | 2 +- ..._index_token_filters_one_token_filter.test | 2 +- ...e_table_index_token_filters_parameter.test | 2 +- .../create_table_index_tokenizer_comment.test | 3 +- .../create_table_index_tokenizer_default.test | 3 +- .../t/create_table_index_tokenizer_off.test | 3 +- ...reate_table_index_tokenizer_parameter.test | 3 +- ...create_table_table_normalizer_default.test | 2 +- .../t/create_table_table_normalizer_hash.test | 2 +- ..._token_filters_multiple_token_filters.test | 2 +- ..._table_token_filters_one_token_filter.test | 2 +- ...e_table_table_token_filters_stop_word.test | 2 +- .../storage/t/delete_fulltext_column.test | 2 +- .../t/delete_index_btree_many_records.test | 2 +- .../t/delete_index_hash_id_no_unique.test | 2 +- .../t/delete_index_hash_id_unique.test | 2 +- .../storage/t/delete_normal_column.test | 2 +- .../storage/t/delete_unsigned_bigint.test | 2 +- .../t/drop_database_TODO_SPLIT_ME.test | 2 +- .../storage/t/drop_database_no_table.test | 57 + .../storage/t/drop_table_TODO_SPLIT_ME.test | 2 +- .../mroonga/storage/t/flush_logs.test | 2 +- .../storage/t/foreign_key_alter_add.test | 46 + .../storage/t/foreign_key_alter_drop.test | 47 + .../mroonga/storage/t/foreign_key_create.test | 96 +- .../t/foreign_key_delete_existent.test | 53 + .../t/foreign_key_delete_nonexistent.test | 53 + .../t/foreign_key_insert_existent.test | 51 + .../t/foreign_key_insert_nonexistent.test | 51 + .../mroonga/storage/t/foreign_key_rename.test | 50 + .../t/foreign_key_update_existent.test | 53 + .../t/foreign_key_update_nonexistent.test | 53 + .../t/fulltext_boolean_mode_empty_query.test | 2 +- .../t/fulltext_boolean_mode_escape.test | 6 +- .../t/fulltext_boolean_mode_leading_not.test | 3 +- .../t/fulltext_boolean_mode_pragma_all.test | 2 +- ...ma_default_operator_minus_no_operator.test | 2 +- ...pragma_default_operator_minus_with_or.test | 2 +- ...agma_default_operator_minus_with_plus.test | 2 +- ...ragma_default_operator_or_no_operator.test | 2 +- ...pragma_default_operator_or_with_minus.test | 2 +- ..._pragma_default_operator_or_with_plus.test | 2 +- ...gma_default_operator_plus_no_operator.test | 2 +- ...a_default_operator_plus_with_astarisk.test | 2 +- ...agma_default_operator_plus_with_minus.test | 2 +- ..._pragma_default_operator_plus_with_or.test | 2 +- ...an_mode_pragma_syntax_script_operator.test | 43 + ...an_mode_pragma_syntax_script_selector.test | 50 + ..._boolean_mode_pragma_weight_full_spec.test | 2 +- ..._boolean_mode_pragma_weight_no_weight.test | 2 +- ...olean_mode_pragma_weight_omit_section.test | 2 +- ...de_pragma_weight_ten_or_more_sections.test | 2 +- ..._pragma_weight_three_or_more_sections.test | 2 +- ...ltext_boolean_mode_syntax_error_error.test | 6 +- ...olean_mode_syntax_error_error_and_log.test | 6 +- ...text_boolean_mode_syntax_error_ignore.test | 6 +- ...lean_mode_syntax_error_ignore_and_log.test | 6 +- .../storage/t/fulltext_charset_ascii.test | 2 +- .../storage/t/fulltext_charset_cp932.test | 2 +- .../storage/t/fulltext_charset_eucjpms.test | 2 +- .../storage/t/fulltext_charset_japanese.test | 2 +- .../storage/t/fulltext_charset_utf8mb4.test | 3 +- .../storage/t/fulltext_empty_query.test | 2 +- .../storage/t/fulltext_found_rows.test | 3 +- .../t/fulltext_groonga_varchar_vector.test | 2 +- .../storage/t/fulltext_index_recreate.test | 3 +- .../storage/t/fulltext_insert_select.test | 2 +- .../storage/t/fulltext_insert_values.test | 3 +- ...fulltext_multiple_column_index_delete.test | 3 +- ...fulltext_multiple_column_index_insert.test | 3 +- ...lltext_multiple_column_index_recreate.test | 3 +- ...fulltext_multiple_column_index_update.test | 3 +- .../storage/t/fulltext_multiple_index.test | 3 +- .../storage/t/fulltext_no_primary_key.test | 3 +- .../storage/t/fulltext_not_match_against.test | 2 +- .../mroonga/storage/t/fulltext_or.test | 2 +- ..._order_boolean_mode_different_against.test | 2 +- ...xt_order_boolean_mode_different_match.test | 2 +- .../fulltext_order_boolean_mode_no_where.test | 2 +- ...order_boolean_mode_same_match_against.test | 2 +- ...ltext_order_natural_language_mode_asc.test | 2 +- ...text_order_natural_language_mode_desc.test | 2 +- ...tural_language_mode_different_against.test | 2 +- ...natural_language_mode_different_match.test | 2 +- ..._order_natural_language_mode_no_where.test | 2 +- ...ural_language_mode_same_match_against.test | 2 +- .../storage/t/fulltext_two_inner_join.test | 2 +- ...=> fulltext_version_10_0_no_such_key.test} | 4 +- ... => fulltext_version_5_5_no_such_key.test} | 4 +- ... => fulltext_version_5_6_no_such_key.test} | 4 +- .../t/function_command_auto-escape.test | 41 + .../storage/t/function_command_select.test | 2 +- ...unction_command_special-database-name.test | 43 + ...unction_escape_error_query_is_missing.test | 2 +- ...tion_escape_error_query_is_not_string.test | 2 +- ...error_target_characters_is_not_string.test | 2 +- ...ll.test => function_escape_query_all.test} | 2 +- ...test => function_escape_query_custom.test} | 2 +- .../storage/t/function_escape_query_join.test | 54 + .../function_escape_query_match_against.test | 46 + .../t/function_escape_query_named.test | 26 + ...test => function_escape_query_nested.test} | 2 +- .../t/function_escape_script_decimal.test | 39 + .../t/function_escape_script_integer.test | 26 + .../t/function_escape_script_real.test | 39 + .../t/function_escape_script_string.test | 26 + ...nction_highlight_html_dynamic_keyword.test | 45 + .../t/function_highlight_html_japanese.test | 31 + ...tion_highlight_html_multiple_keywords.test | 25 + .../t/function_highlight_html_normalizer.test | 25 + .../t/function_highlight_html_query.test | 31 + .../function_highlight_html_query_pragma.test | 31 + .../t/function_highlight_html_record.test | 55 + .../t/function_last_insert_grn_id.test | 2 +- .../t/function_last_insert_id_reference.test | 2 +- .../t/function_last_insert_id_set.test | 2 +- .../storage/t/function_normalize_default.test | 24 + .../t/function_normalize_normalizer.test | 24 + .../storage/t/function_normalize_record.test | 40 + .../t/function_query_expand_multiple.test | 46 + .../t/function_query_expand_no_index.test | 43 + .../storage/t/function_query_expand_one.test | 44 + .../t/function_query_expand_pragma.test | 45 + .../storage/t/function_snippet_ascii.test | 2 +- .../storage/t/function_snippet_cp932.test | 2 +- .../storage/t/function_snippet_eucjpms.test | 2 +- ...function_snippet_html_dynamic_keyword.test | 45 + .../t/function_snippet_html_japanese.test | 31 + ...nction_snippet_html_multiple_keywords.test | 25 + ...nction_snippet_html_multiple_snippets.test | 29 + .../t/function_snippet_html_query.test | 31 + .../t/function_snippet_html_query_pragma.test | 31 + .../t/function_snippet_html_record.test | 55 + ...n_snippet_invalid_nonexistent_charset.test | 2 +- ...n_snippet_invalid_unsupported_charset.test | 2 +- .../storage/t/function_snippet_japanese.test | 2 +- .../storage/t/geometry_bulk_insert_null.test | 6 +- .../mroonga/storage/t/geometry_contains.test | 13 +- ...try_strict_sql_mode_bulk_insert_null.test} | 9 +- .../t/geometry_strict_sql_mode_contains.test | 152 + .../storage/t/index_btree_equal_datetime.test | 5 +- .../storage/t/index_btree_equal_time.test | 2 +- .../t/index_btree_equal_timestamp.test | 2 +- .../t/index_btree_normal_column_insert.test | 2 +- .../storage/t/index_hash_id_normal.test | 2 +- .../storage/t/index_hash_id_primary.test | 29 +- .../storage/t/index_hash_id_unique.test | 2 +- .../t/index_hash_normal_column_insert.test | 2 +- ...index_hash_strict_sql_mode_id_primary.test | 44 + .../t/index_multiple_column_delete.test | 2 +- ...dex_multiple_column_nullable_smallint.test | 2 +- ...tiple_column_nullable_unsigned_bigint.test | 2 +- ...multiple_column_nullable_unsigned_int.test | 2 +- ...ple_column_nullable_unsigned_smallint.test | 2 +- ...ndex_multiple_column_nullable_varchar.test | 2 +- ...e_column_order_by_where_equal_asc_asc.test | 49 + ...column_order_by_where_equal_desc_desc.test | 49 + .../index_multiple_column_primary_delete.test | 2 +- ...ex_multiple_column_primary_select_int.test | 2 +- ...column_primary_strict_sql_mode_update.test | 47 + .../index_multiple_column_primary_update.test | 43 +- ...e_column_range_all_used_greater_than.test} | 2 +- ...range_all_used_greater_than_or_equal.test} | 2 +- ...iple_column_range_all_used_less_than.test} | 2 +- ...mn_range_all_used_less_than_or_equal.test} | 2 +- ...rtially_used_have_prefix_greater_than.test | 50 + ...sed_have_prefix_greater_than_or_equal.test | 50 + ..._partially_used_have_prefix_less_than.test | 50 + ...y_used_have_prefix_less_than_or_equal.test | 50 + ...partially_used_no_prefix_greater_than.test | 44 + ..._used_no_prefix_greater_than_or_equal.test | 44 + ...ge_partially_used_no_prefix_less_than.test | 44 + ...lly_used_no_prefix_less_than_or_equal.test | 45 + .../t/index_multiple_column_recreate.test | 2 +- .../t/index_multiple_column_replace.test | 2 +- .../index_multiple_column_select_double.test | 2 +- .../t/index_multiple_column_select_float.test | 2 +- .../t/index_multiple_column_select_int.test | 2 +- .../t/index_multiple_column_select_max.test | 44 + .../t/index_multiple_column_select_min.test | 44 + .../index_multiple_column_select_string.test | 2 +- .../index_multiple_column_select_varchar.test | 2 +- ...ltiple_column_unique_date_32bit_equal.test | 4 +- ...ltiple_column_unique_date_64bit_equal.test | 14 +- ...ultiple_column_unique_date_index_read.test | 11 +- ...le_column_unique_date_order_32bit_asc.test | 4 +- ...e_column_unique_date_order_32bit_desc.test | 4 +- ...le_column_unique_date_order_64bit_asc.test | 12 +- ...e_column_unique_date_order_64bit_desc.test | 12 +- ..._multiple_column_unique_date_reinsert.test | 2 +- ...ple_column_unique_datetime_index_read.test | 12 +- ...me_insert_delete_insert_invalid_value.test | 5 +- ...iple_column_unique_datetime_order_asc.test | 12 +- ...ple_column_unique_datetime_order_desc.test | 12 +- ...tiple_column_unique_datetime_reinsert.test | 2 +- .../index_multiple_column_unique_decimal.test | 2 +- ...ultiple_column_unique_time_index_read.test | 2 +- ...multiple_column_unique_time_order_asc.test | 4 +- ...ultiple_column_unique_time_order_desc.test | 4 +- ..._multiple_column_unique_time_reinsert.test | 2 +- ...le_column_unique_timestamp_index_read.test | 8 +- ...ple_column_unique_timestamp_order_asc.test | 8 +- ...le_column_unique_timestamp_order_desc.test | 10 +- ...iple_column_unique_timestamp_reinsert.test | 8 +- .../index_multiple_column_unique_varchar.test | 2 +- ...ltiple_column_unique_year_32bit_equal.test | 4 +- ...ltiple_column_unique_year_64bit_equal.test | 5 +- ...ultiple_column_unique_year_index_read.test | 5 +- ...le_column_unique_year_order_32bit_asc.test | 4 +- ...e_column_unique_year_order_32bit_desc.test | 4 +- ...le_column_unique_year_order_64bit_asc.test | 5 +- ...e_column_unique_year_order_64bit_desc.test | 5 +- ..._multiple_column_unique_year_reinsert.test | 2 +- .../t/index_multiple_column_update_int.test | 2 +- .../index_multiple_column_update_string.test | 2 +- .../t/index_primary_char_exact_length.test | 2 +- .../t/index_primary_char_null_character.test | 2 +- .../storage/t/index_primary_char_short.test | 2 +- .../mroonga/storage/t/index_primary_date.test | 3 +- ...mary_datetime_with_fractional_seconds.test | 3 +- ...y_datetime_without_fractional_seconds.test | 3 +- ...imary_decimal_with_fractional_seconds.test | 3 +- ...ry_decimal_without_fractional_seconds.test | 3 +- ..._primary_time_with_fractional_seconds.test | 3 +- ...imary_time_without_fractional_seconds.test | 3 +- ...ary_timestamp_with_fractional_seconds.test | 5 +- ..._timestamp_without_fractional_seconds.test | 3 +- .../index_primary_varchar_null_character.test | 2 +- .../mroonga/storage/t/index_primary_year.test | 3 +- .../index_range_normal_greater_than_asc.test | 2 +- .../index_range_normal_greater_than_desc.test | 2 +- ...ange_normal_greater_than_or_equal_asc.test | 2 +- ...nge_normal_greater_than_or_equal_desc.test | 2 +- .../t/index_range_normal_less_than_asc.test | 2 +- .../t/index_range_normal_less_than_desc.test | 2 +- ...x_range_normal_less_than_or_equal_asc.test | 2 +- ..._range_normal_less_than_or_equal_desc.test | 2 +- .../index_range_primary_greater_than_asc.test | 2 +- ...index_range_primary_greater_than_desc.test | 2 +- ...nge_primary_greater_than_or_equal_asc.test | 2 +- ...ge_primary_greater_than_or_equal_desc.test | 2 +- .../t/index_range_primary_less_than_asc.test | 2 +- .../t/index_range_primary_less_than_desc.test | 2 +- ..._range_primary_less_than_or_equal_asc.test | 2 +- ...range_primary_less_than_or_equal_desc.test | 2 +- .../storage/t/index_read_multiple_bigint.test | 2 +- .../index_read_multiple_bigint_unsigned.test | 2 +- .../storage/t/index_read_multiple_double.test | 2 +- .../storage/t/index_read_multiple_float.test | 2 +- .../storage/t/index_read_multiple_int.test | 2 +- .../t/index_read_multiple_int_unsigned.test | 2 +- .../t/index_read_multiple_mediumint.test | 2 +- ...ndex_read_multiple_mediumint_unsigned.test | 2 +- .../t/index_read_multiple_smallint.test | 2 +- ...index_read_multiple_smallint_unsigned.test | 2 +- .../t/index_read_multiple_tinyint.test | 2 +- .../index_read_multiple_tinyint_unsigned.test | 2 +- .../t/index_read_multiple_varchar.test | 2 +- ...index_read_multiple_varchar_collation.test | 2 +- .../storage/t/index_read_normal_int.test | 2 +- .../storage/t/index_read_normal_varchar.test | 2 +- .../storage/t/index_read_primary_int.test | 2 +- .../storage/t/index_read_primary_varchar.test | 2 +- .../storage/t/index_unique_delete_all.test | 39 + .../t/index_unique_delete_by_primary_key.test | 2 +- .../t/index_unique_insert_after_error.test | 2 +- .../index_unique_search_after_duplicated.test | 2 +- .../storage/t/index_unique_varchar.test | 2 +- .../t/index_update_multiple_column.test | 2 +- .../storage/t/index_update_single_column.test | 2 +- .../storage/t/information_schema_plugins.test | 2 +- ...ion_schema_tables_auto_increment_none.test | 2 +- ...tion_schema_tables_auto_increment_use.test | 2 +- ...information_schema_tables_data_length.test | 3 +- .../storage/t/insert_TODO_SPLIT_ME.test | 18 +- .../mroonga/storage/t/insert_delayed.test | 7 +- ...e_no_primary_key_and_unique_key_twice.test | 2 +- ...t_on_duplicate_key_update_primary_key.test | 3 +- ...rt_on_duplicate_key_update_unique_key.test | 3 +- .../storage/t/insert_virtual_column.test | 42 + .../mroonga/storage/t/like_unicode_ci.test | 2 +- .../mroonga/storage/t/lock_tables_read.test | 2 +- ...optimization_count_skip_TODO_SPLIT_ME.test | 61 - ...n_count_skip_after_insert_multithread.test | 8 +- ...count_skip_after_insert_single_thread.test | 2 +- .../t/optimization_count_skip_disabled.test | 3 +- .../t/optimization_count_skip_index_and.test | 44 + ...optimization_count_skip_index_between.test | 42 + .../optimization_count_skip_index_equal.test | 42 + ...ndex_full_text_search_in_boolean_mode.test | 43 + ..._text_search_in_natural_language_mode.test | 43 + ...optimization_count_skip_index_greater.test | 42 + ...zation_count_skip_index_greater_equal.test | 42 + .../t/optimization_count_skip_index_less.test | 42 + ...imization_count_skip_index_less_equal.test | 42 + ...timization_count_skip_index_not_equal.test | 42 + .../t/optimization_count_skip_index_view.test | 2 +- ...zation_count_skip_multiple_conditions.test | 41 + ...zation_count_skip_primary_key_between.test | 41 + ...mization_count_skip_primary_key_equal.test | 41 + ...zation_count_skip_primary_key_greater.test | 41 + ..._count_skip_primary_key_greater_equal.test | 41 + ...imization_count_skip_primary_key_less.test | 41 + ...ion_count_skip_primary_key_less_equal.test | 41 + ...tion_count_skip_primary_key_not_equal.test | 41 + ...on_order_limit_not_optimized_disabled.test | 3 +- ...not_optimized_multiple_match_againsts.test | 57 + ...on_order_limit_not_optimized_no_limit.test | 3 +- ...imization_order_limit_optimized_cp932.test | 46 + ...rder_limit_optimized_datetime_between.test | 3 +- ...limit_optimized_datetime_between_over.test | 3 +- ..._order_limit_optimized_datetime_equal.test | 3 +- ...limit_optimized_datetime_greater_than.test | 3 +- ...imized_datetime_greater_than_or_equal.test | 3 +- ...er_limit_optimized_datetime_less_than.test | 3 +- ...optimized_datetime_less_than_or_equal.test | 3 +- ...optimized_duplicated_order_by_columns.test | 2 +- ...ation_order_limit_optimized_enum_name.test | 49 + ...tion_order_limit_optimized_enum_value.test | 49 + ...rder_limit_optimized_have_primary_key.test | 3 +- ...ion_order_limit_optimized_int_between.test | 2 +- ...rder_limit_optimized_int_between_over.test | 2 +- ...ation_order_limit_optimized_int_equal.test | 3 +- ...rder_limit_optimized_int_greater_than.test | 3 +- ...t_optimized_int_greater_than_or_equal.test | 3 +- ...n_order_limit_optimized_int_less_than.test | 3 +- ...imit_optimized_int_less_than_or_equal.test | 3 +- ..._order_limit_optimized_no_primary_key.test | 3 +- ...order_limit_optimized_no_where_clause.test | 2 +- ...on_order_limit_optimized_order_by_asc.test | 3 +- ...n_order_limit_optimized_order_by_desc.test | 3 +- ...ion_order_limit_optimized_order_by_id.test | 3 +- ...imit_optimized_order_by_match_against.test | 3 +- ..._limit_optimized_select_match_against.test | 3 +- ...on_order_limit_optimized_time_between.test | 3 +- ...der_limit_optimized_time_between_over.test | 3 +- ...tion_order_limit_optimized_time_equal.test | 3 +- ...der_limit_optimized_time_greater_than.test | 3 +- ..._optimized_time_greater_than_or_equal.test | 3 +- ..._order_limit_optimized_time_less_than.test | 3 +- ...mit_optimized_time_less_than_or_equal.test | 3 +- ...it_optimized_varchar_equal_with_index.test | 3 +- ...optimized_varchar_equal_without_index.test | 3 +- ...on_order_limit_optimized_year_between.test | 2 +- ...der_limit_optimized_year_between_over.test | 2 +- ...tion_order_limit_optimized_year_equal.test | 2 +- ...der_limit_optimized_year_greater_than.test | 2 +- ..._optimized_year_greater_than_or_equal.test | 2 +- ..._order_limit_optimized_year_less_than.test | 2 +- ...mit_optimized_year_less_than_or_equal.test | 2 +- .../mroonga/storage/t/partition_insert.test | 5 +- .../mroonga/storage/t/partition_update.test | 5 +- .../storage/t/repair_table_no_index_file.test | 8 +- .../mroonga/storage/t/replace_geometry.test | 4 +- .../storage/t/replace_select_varchar.test | 2 +- .../mroonga/storage/t/replace_text.test | 3 +- .../mroonga/storage/t/replace_varchar.test | 3 +- .../mroonga/storage/t/replace_vector.test | 2 +- .../storage/t/replace_without_key.test | 2 +- .../mroonga/storage/t/select_all.test | 2 +- .../t/select_empty_key_where_equal.test | 2 +- .../t/select_empty_key_where_not_equal.test | 2 +- .../storage/t/select_group_by_with_index.test | 6 +- .../t/select_group_by_without_index.test | 8 +- .../mroonga/storage/t/select_pkey.test | 2 +- .../storage/t/select_secondary_key.test | 2 +- .../t/show_create_table_TODO_SPLIT_ME.test | 2 +- .../mroonga/storage/t/sub_query_fulltext.test | 3 +- .../mroonga/storage/t/temporary_table.test | 3 +- .../mroonga/storage/t/truncate.test | 3 +- .../mroonga/storage/t/update_binlog_row.test | 38 + .../mroonga/storage/t/update_fulltext.test | 2 +- .../storage/t/update_id_hash_index.test | 2 +- .../t/update_id_unique_hash_index.test | 2 +- .../mroonga/storage/t/update_int.test | 2 +- .../storage/t/update_last_insert_grn_id.test | 2 +- .../storage/t/update_virtual_column.test | 34 +- ...oolean_mode_syntax_flags_allow_column.test | 2 +- ...n_mode_syntax_flags_allow_leading_not.test | 2 +- ...oolean_mode_syntax_flags_allow_update.test | 2 +- ...oolean_mode_syntax_flags_syntax_query.test | 2 +- ...olean_mode_syntax_flags_syntax_script.test | 2 +- .../t/variable_database_path_prefix.test | 2 +- .../t/variable_default_parser_new_value.test | 2 +- .../t/variable_default_parser_same_value.test | 2 +- .../variable_default_tokenizer_new_value.test | 25 + ...variable_default_tokenizer_same_value.test | 22 + .../storage/t/variable_dry_write_delete.test | 3 +- .../storage/t/variable_dry_write_insert.test | 3 +- .../storage/t/variable_dry_write_update.test | 3 +- ...le_enable_operations_recording_insert.test | 36 + .../t/variable_lock_timeout_disable.test | 12 +- .../t/variable_lock_timeout_invalid.test | 12 +- .../t/variable_lock_timeout_no_retry.test | 10 +- .../t/variable_lock_timeout_valid.test | 10 +- .../t/variable_log_file_new_value.test | 2 +- .../t/variable_log_file_nonexistent_path.test | 2 +- .../t/variable_log_file_same_value.test | 2 +- .../t/variable_log_level_TODO_SPLIT_ME.test | 2 +- ...ble_match_escalation_threshold_global.test | 29 +- ...le_match_escalation_threshold_session.test | 5 +- ...ble_max_n_records_for_estimate_global.test | 9 +- ...or_estimate_mysql_5_7_or_later_global.test | 60 + ...mysql_5_7_or_later_not_found_in_limit.test | 43 + ...r_estimate_mysql_5_7_or_later_session.test | 47 + ...cords_for_estimate_not_found_in_limit.test | 43 + ...le_max_n_records_for_estimate_session.test | 5 +- ...e_query_log_file_disabled_empty_value.test | 32 + ...le_query_log_file_disabled_null_value.test | 32 + ...le_query_log_file_enabled_empty_value.test | 34 + ...ble_query_log_file_enabled_null_value.test | 34 + .../t/variable_query_log_file_new_value.test | 34 + .../t/variable_query_log_file_same_value.test | 35 + .../t/variable_vector_column_delimiter.test | 2 +- .../mroonga/storage/t/variable_version.test | 2 +- .../wrapper/r/alter_table_add_column.result | 15 - ...er_table_add_column_multibyte_cp932.result | 33 + ...ter_table_add_column_multibyte_utf8.result | 33 + .../r/alter_table_change_engine.result | 30 +- .../alter_table_comment_change_engine.result | 23 +- .../wrapper/r/alter_table_drop_column.result | 15 - .../wrapper/r/alter_table_fulltext.result | 18 - .../wrapper/r/alter_table_rename_table.result | 20 - .../wrapper/r/alter_table_spatial.result | 9 - .../wrapper/r/check_table_for_upgrade.result | 18 + .../column_generated_stored_add_column.result | 15 + .../r/column_generated_stored_delete.result | 15 + ...column_generated_stored_drop_column.result | 17 + .../r/column_generated_stored_insert.result | 15 + .../r/column_generated_stored_reindex.result | 17 + .../r/column_generated_stored_update.result | 15 + ...column_generated_virtual_add_column.result | 15 + ...enerated_virtual_add_fulltext_index.result | 17 + .../column_generated_virtual_add_index.result | 19 + .../r/column_generated_virtual_delete.result | 15 + ...olumn_generated_virtual_drop_column.result | 16 + .../r/column_generated_virtual_insert.result | 15 + .../r/column_generated_virtual_update.result | 16 + .../wrapper/r/column_multibyte_cp932.result | 32 + .../wrapper/r/column_multibyte_utf8.result | 32 + .../mroonga/wrapper/r/count_star.result | 11 + ..._star_mysql_5_7_or_later_with_index.result | 30 + .../wrapper/r/count_star_with_index.result | 4 +- .../r/create_table_comment_combined.result | 14 +- .../r/create_table_flags_comment.result | 2 +- .../wrapper/r/create_table_flags_none.result | 2 +- .../r/create_table_flags_parameter.result | 2 +- .../r/create_table_index_flags_none.result | 2 +- ...flags_with_position_and_with_weight.result | 2 +- ...table_normalizer_fulltext_index_bin.result | 21 + .../r/create_table_parser_comment.result | 12 +- ...ilters_index_multiple_token_filters.result | 9 +- ...oken_filters_index_one_token_filter.result | 9 +- ...table_token_filters_index_parameter.result | 9 +- .../r/create_table_tokenizer_comment.result | 8 - .../r/create_table_tokenizer_parameter.result | 8 - .../r/drop_table_new_connection.result | 13 + .../fulltext_boolean_mode_leading_not.result | 9 - ...boolean_mode_multiple_match_against.result | 10 - .../wrapper/r/fulltext_index_recreate.result | 9 - .../wrapper/r/fulltext_insert_select.result | 6 +- .../wrapper/r/fulltext_insert_values.result | 8 - .../wrapper/r/fulltext_many_records.result | 8 - ...and_not_matched_have_where_no_order.result | 9 +- ...lltext_multiple_column_index_delete.result | 11 - ...lltext_multiple_column_index_insert.result | 11 - ...text_multiple_column_index_recreate.result | 11 - ...lltext_multiple_column_index_update.result | 11 - .../wrapper/r/fulltext_multiple_index.result | 10 - .../mroonga/wrapper/r/fulltext_myisam.result | 8 - .../r/fulltext_order_TODO_SPLIT_ME.result | 12 +- .../r/fulltext_order_transaction.result | 10 - .../wrapper/r/geometry_contains.result | 9 - .../mroonga/wrapper/r/geometry_delete.result | 9 - .../mroonga/wrapper/r/geometry_update.result | 9 - .../mroonga/wrapper/r/insert_bulk.result | 8 - ..._read_mysql_5_7_or_later_disk_sweep.result | 20 + .../wrapper/r/repair_table_no_files.result | 9 - .../r/repair_table_no_index_file.result | 11 +- .../mroonga/wrapper/r/temporary_table.result | 7 - .../transaction_rollback_delete_delete.result | 10 - .../transaction_rollback_delete_update.result | 10 - .../mroonga/wrapper/r/truncate.result | 13 - .../r/variable_dry_write_delete.result | 8 - .../r/variable_dry_write_insert.result | 8 - .../r/variable_dry_write_update.result | 8 - ...e_match_escalation_threshold_global.result | 11 +- ..._match_escalation_threshold_session.result | 11 +- .../mysql-test/mroonga/wrapper/suite.pm | 2 +- .../wrapper/t/alter_table_add_column.test | 5 +- ...lter_table_add_column_multibyte_cp932.test | 54 + ...alter_table_add_column_multibyte_utf8.test | 54 + .../t/alter_table_change_column_comment.test | 2 +- .../wrapper/t/alter_table_change_engine.test | 10 +- .../t/alter_table_comment_change_engine.test | 7 +- ...er_table_disable_keys_create_fulltext.test | 2 +- .../t/alter_table_disable_keys_fulltext.test | 2 +- ...er_table_disable_keys_multiple_column.test | 2 +- .../t/alter_table_disable_keys_normal.test | 2 +- .../t/alter_table_disable_keys_primary.test | 2 +- .../t/alter_table_disable_keys_updating.test | 2 +- .../wrapper/t/alter_table_drop_column.test | 4 +- .../t/alter_table_enable_keys_fulltext.test | 2 +- .../alter_table_enable_keys_lock_tables.test | 2 +- ...ter_table_enable_keys_multiple_column.test | 2 +- .../t/alter_table_enable_keys_normal.test | 2 +- .../t/alter_table_enable_keys_primary.test | 2 +- .../wrapper/t/alter_table_fulltext.test | 5 +- .../wrapper/t/alter_table_rename_table.test | 5 +- .../wrapper/t/alter_table_spatial.test | 6 +- .../wrapper/t/auto_increment_text.test | 2 +- .../wrapper/t/binlog_TODO_SPLIT_ME.test | 2 +- .../wrapper/t/check_table_for_upgrade.test | 44 + .../column_comment_index_not_for_mroonga.test | 2 +- .../t/column_generated_stored_add_column.test | 43 + .../t/column_generated_stored_delete.test | 43 + .../column_generated_stored_drop_column.test | 43 + .../t/column_generated_stored_insert.test | 41 + .../t/column_generated_stored_reindex.test | 43 + .../t/column_generated_stored_update.test | 43 + .../column_generated_virtual_add_column.test | 42 + ..._generated_virtual_add_fulltext_index.test | 46 + .../t/column_generated_virtual_add_index.test | 47 + .../t/column_generated_virtual_delete.test | 42 + .../column_generated_virtual_drop_column.test | 42 + .../t/column_generated_virtual_insert.test | 40 + .../t/column_generated_virtual_update.test | 42 + .../wrapper/t/column_multibyte_cp932.test | 53 + .../wrapper/t/column_multibyte_utf8.test | 53 + .../wrapper/t/column_normal_comment.test | 2 +- .../mroonga/wrapper/t/count_star.test | 36 + ...nt_star_mysql_5_7_or_later_with_index.test | 55 + .../wrapper/t/count_star_with_index.test | 7 +- .../wrapper/t/create_table_TODO_SPLIT_ME.test | 4 +- .../t/create_table_comment_combined.test | 4 +- .../wrapper/t/create_table_flags_comment.test | 2 +- .../wrapper/t/create_table_flags_none.test | 2 +- .../t/create_table_flags_parameter.test | 2 +- .../t/create_table_index_flags_none.test | 2 +- ...x_flags_with_position_and_with_weight.test | 2 +- .../t/create_table_normalizer_comment.test | 2 +- ...e_table_normalizer_fulltext_index_bin.test | 40 + .../t/create_table_normalizer_parameter.test | 2 +- .../t/create_table_parser_comment.test | 4 +- ..._filters_index_multiple_token_filters.test | 2 +- ..._token_filters_index_one_token_filter.test | 2 +- ...e_table_token_filters_index_parameter.test | 2 +- .../t/create_table_tokenizer_comment.test | 3 +- .../t/create_table_tokenizer_parameter.test | 3 +- .../wrapper/t/delete_TODO_SPLIT_ME.test | 2 +- .../mroonga/wrapper/t/delete_all.test | 2 +- .../wrapper/t/drop_table_new_connection.test | 46 + .../t/fulltext_boolean_mode_leading_not.test | 3 +- ...t_boolean_mode_multiple_match_against.test | 3 +- ...ma_default_operator_minus_no_operator.test | 2 +- ...pragma_default_operator_minus_with_or.test | 2 +- ...agma_default_operator_minus_with_plus.test | 2 +- ...ragma_default_operator_or_no_operator.test | 2 +- ...pragma_default_operator_or_with_minus.test | 2 +- ..._pragma_default_operator_or_with_plus.test | 2 +- ...gma_default_operator_plus_no_operator.test | 2 +- ...agma_default_operator_plus_with_minus.test | 2 +- ..._pragma_default_operator_plus_with_or.test | 2 +- ..._boolean_mode_pragma_weight_full_spec.test | 2 +- ..._boolean_mode_pragma_weight_no_weight.test | 2 +- ...olean_mode_pragma_weight_omit_section.test | 2 +- .../wrapper/t/fulltext_charset_ascii.test | 2 +- .../wrapper/t/fulltext_charset_cp932.test | 2 +- .../wrapper/t/fulltext_charset_eucjpms.test | 2 +- .../wrapper/t/fulltext_charset_japanese.test | 2 +- .../wrapper/t/fulltext_index_recreate.test | 3 +- .../wrapper/t/fulltext_insert_select.test | 8 +- .../wrapper/t/fulltext_insert_values.test | 3 +- .../wrapper/t/fulltext_many_records.test | 3 +- ..._not_matched_have_where_matched_order.test | 2 +- ...d_and_not_matched_have_where_no_order.test | 19 +- ...d_and_not_matched_no_where_both_order.test | 2 +- ...fulltext_multiple_column_index_delete.test | 3 +- ...fulltext_multiple_column_index_insert.test | 3 +- ...lltext_multiple_column_index_recreate.test | 3 +- ...fulltext_multiple_column_index_update.test | 3 +- .../wrapper/t/fulltext_multiple_index.test | 3 +- .../mroonga/wrapper/t/fulltext_myisam.test | 3 +- .../wrapper/t/fulltext_not_match_against.test | 2 +- .../t/fulltext_order_TODO_SPLIT_ME.test | 5 +- .../wrapper/t/fulltext_order_transaction.test | 13 +- .../t/function_last_insert_id_reference.test | 2 +- .../t/function_last_insert_id_set.test | 2 +- .../mroonga/wrapper/t/geometry_contains.test | 5 +- .../mroonga/wrapper/t/geometry_delete.test | 5 +- .../mroonga/wrapper/t/geometry_update.test | 5 +- .../wrapper/t/index_force_index_not_used.test | 2 +- .../wrapper/t/insert_TODO_SPLIT_ME.test | 2 +- .../mroonga/wrapper/t/insert_bulk.test | 3 +- ...te_multiple_column_primary_key_myisam.test | 4 +- ...e_multiple_column_unique_index_myisam.test | 4 +- .../t/multi_range_read_disk_sweep.test | 7 +- ...ge_read_mysql_5_7_or_later_disk_sweep.test | 44 + ...ptimization_order_limit_TODO_SPLIT_ME.test | 2 +- ...optimization_order_limit_no_direction.test | 2 +- ...imization_order_limit_no_where_clause.test | 2 +- ...tion_order_limit_order_by_primary_key.test | 2 +- .../mroonga/wrapper/t/performance_schema.test | 2 +- .../wrapper/t/repair_table_no_files.test | 12 +- .../wrapper/t/repair_table_no_index_file.test | 11 +- .../mroonga/wrapper/t/temporary_table.test | 3 +- .../wrapper/t/transaction_query_cache.test | 12 +- .../t/transaction_rollback_delete_delete.test | 3 +- .../t/transaction_rollback_delete_update.test | 3 +- .../mroonga/wrapper/t/truncate.test | 3 +- .../mroonga/wrapper/t/update_fulltext.test | 2 +- .../mroonga/wrapper/t/update_int.test | 2 +- .../wrapper/t/variable_dry_write_delete.test | 3 +- .../wrapper/t/variable_dry_write_insert.test | 3 +- .../wrapper/t/variable_dry_write_update.test | 3 +- ...ble_match_escalation_threshold_global.test | 11 +- ...le_match_escalation_threshold_session.test | 5 +- storage/mroonga/packages/apt/Makefile.am | 50 +- storage/mroonga/packages/apt/Vagrantfile | 35 +- storage/mroonga/packages/apt/build-deb.sh | 46 +- storage/mroonga/packages/apt/env.sh.in | 5 +- storage/mroonga/packages/apt/sign-packages.sh | 2 +- .../mroonga/packages/apt/sign-repository.sh | 2 +- .../mroonga/packages/apt/update-repository.sh | 2 +- storage/mroonga/packages/check-utility.sh | 665 - .../debian/apparmor/mysql-server-mroonga | 5 - storage/mroonga/packages/debian/changelog | 415 - storage/mroonga/packages/debian/compat | 1 - storage/mroonga/packages/debian/control.in | 51 - storage/mroonga/packages/debian/copyright | 27 - .../debian/mysql-server-mroonga-doc.install | 1 - .../debian/mysql-server-mroonga.install | 3 - .../debian/mysql-server-mroonga.postinst | 72 - .../debian/mysql-server-mroonga.postrm | 38 - .../debian/mysql-server-mroonga.prerm | 10 - storage/mroonga/packages/debian/rules | 39 - .../mroonga/packages/rpm/centos/Makefile.am | 14 +- .../rpm/centos/mariadb-mroonga.spec.in | 115 +- .../rpm/centos/mysql55-mroonga.spec.in | 128 +- .../centos/mysql56-community-mroonga.spec.in | 150 +- .../centos/percona-server-56-mroonga.spec.in | 134 +- storage/mroonga/packages/source/Makefile.am | 12 +- storage/mroonga/packages/ubuntu/Makefile.am | 41 +- storage/mroonga/packages/ubuntu/upload.rb | 135 +- storage/mroonga/packages/windows/Makefile.am | 12 +- storage/mroonga/packages/windows/README.md | 12 +- .../packages/windows/build-vc2013-msi-32.bat | 8 - .../packages/windows/build-vc2013-msi-64.bat | 8 - .../packages/windows/build-vc2013-zip-32.bat | 8 - .../packages/windows/build-vc2013-zip-64.bat | 8 - .../mroonga/packages/windows/build-vc2013.bat | 4 - .../packages/windows/build-vc2015-msi-32.bat | 2 +- .../packages/windows/build-vc2015-msi-64.bat | 2 +- .../packages/windows/build-vc2015-zip-32.bat | 7 +- .../packages/windows/build-vc2015-zip-64.bat | 7 +- .../mroonga/packages/windows/build-vc2015.bat | 4 +- storage/mroonga/packages/yum/Makefile.am | 17 +- storage/mroonga/packages/yum/Vagrantfile | 18 +- storage/mroonga/packages/yum/build-in-vm.sh | 28 +- storage/mroonga/packages/yum/build-rpm.sh | 93 +- storage/mroonga/packages/yum/env.sh.in | 4 + .../mroonga/packages/yum/update-repository.sh | 4 +- storage/mroonga/plugin_version | 2 +- storage/mroonga/required_groonga_version | 2 +- storage/mroonga/test/run-sql-test.sh | 277 +- .../test/unit/test_mrn_path_mapper.cpp | 2 +- storage/mroonga/tools/prepare-sphinx-html.rb | 8 - storage/mroonga/tools/travis/before_script.sh | 52 +- storage/mroonga/tools/travis/install.sh | 128 +- storage/mroonga/tools/travis/script.sh | 24 +- storage/mroonga/udf/mrn_udf_command.cpp | 194 +- storage/mroonga/udf/mrn_udf_escape.cpp | 196 +- .../mroonga/udf/mrn_udf_highlight_html.cpp | 494 + .../udf/mrn_udf_last_insert_grn_id.cpp | 11 +- storage/mroonga/udf/mrn_udf_normalize.cpp | 212 + storage/mroonga/udf/mrn_udf_query_expand.cpp | 282 + storage/mroonga/udf/mrn_udf_snippet.cpp | 77 +- storage/mroonga/udf/mrn_udf_snippet_html.cpp | 444 + storage/mroonga/udf/sources.am | 6 +- storage/mroonga/vendor/groonga/CMakeLists.txt | 216 +- .../vendor/groonga/CMakeLists.txt.orig | 676 + storage/mroonga/vendor/groonga/Makefile.am | 21 +- storage/mroonga/vendor/groonga/README.md | 13 + storage/mroonga/vendor/groonga/appveyor.yml | 75 +- storage/mroonga/vendor/groonga/autogen.sh | 19 +- storage/mroonga/vendor/groonga/base_version | 2 +- .../vendor/groonga/benchmark/Makefile.am | 83 +- .../benchmark/bench-between-sequential.c | 276 + .../vendor/groonga/benchmark/bench-cache.c | 155 + .../groonga/benchmark/bench-ctx-create.c | 12 +- .../groonga/benchmark/bench-geo-distance.c | 13 +- .../groonga/benchmark/bench-geo-select.c | 13 +- .../vendor/groonga/benchmark/bench-nfkc.c | 275 + .../groonga/benchmark/bench-query-optimizer.c | 12 +- .../groonga/benchmark/bench-range-select.c | 12 +- .../groonga/benchmark/bench-result-set.c | 151 + .../groonga/benchmark/bench-table-factory.c | 13 +- .../vendor/groonga/benchmark/lib/Makefile.am | 3 + .../build/ac_macros/check_functions.m4 | 2 - .../groonga/build/ac_macros/check_headers.m4 | 4 - .../vendor/groonga/build/makefiles/gettext.am | 2 - .../groonga/build/makefiles/sphinx-build.am | 13 +- .../vendor/groonga/build/makefiles/sphinx.am | 107 +- .../vendor/groonga/bundled_lz4_version | 1 + .../groonga/bundled_mecab_naist_jdic_version | 1 + .../vendor/groonga/bundled_mecab_version | 1 + .../groonga/bundled_message_pack_version | 1 + storage/mroonga/vendor/groonga/config.h.cmake | 12 +- storage/mroonga/vendor/groonga/configure.ac | 338 +- .../examples/dictionary/edict/edict-import.sh | 8 +- .../examples/dictionary/html/index.html | 2 +- .../html/js/jquery-ui-1.8.18.custom.min.js | 356 - .../vendor/groonga/groonga-arrow.pc.in | 4 + .../vendor/groonga/groonga-httpd-conf.sh.in | 6 +- .../vendor/groonga/include/Makefile.am | 4 +- .../mroonga/vendor/groonga/include/groonga.h | 39 +- .../vendor/groonga/include/groonga.hpp | 21 + .../groonga/include/groonga/Makefile.am | 27 +- .../vendor/groonga/include/groonga/accessor.h | 34 + .../vendor/groonga/include/groonga/array.h | 89 + .../vendor/groonga/include/groonga/arrow.h | 38 + .../vendor/groonga/include/groonga/arrow.hpp | 21 + .../vendor/groonga/include/groonga/cache.h | 49 + .../vendor/groonga/include/groonga/column.h | 29 + .../vendor/groonga/include/groonga/command.h | 8 +- .../vendor/groonga/include/groonga/config.h | 65 + .../vendor/groonga/include/groonga/dat.h | 100 + .../vendor/groonga/include/groonga/db.h | 68 + .../vendor/groonga/include/groonga/dump.h | 34 + .../vendor/groonga/include/groonga/error.h | 29 + .../vendor/groonga/include/groonga/expr.h | 47 +- .../groonga/include/groonga/file_reader.h | 37 + .../vendor/groonga/include/groonga/geo.h | 36 + .../vendor/groonga/include/groonga/groonga.h | 703 +- .../vendor/groonga/include/groonga/hash.h | 104 + .../vendor/groonga/include/groonga/id.h | 31 + .../vendor/groonga/include/groonga/ii.h | 42 +- .../vendor/groonga/include/groonga/nfkc.h | 11 +- .../groonga/include/groonga/normalizer.h | 8 +- .../vendor/groonga/include/groonga/obj.h | 54 +- .../vendor/groonga/include/groonga/operator.h | 49 + .../vendor/groonga/include/groonga/output.h | 30 +- .../vendor/groonga/include/groonga/pat.h | 102 + .../vendor/groonga/include/groonga/plugin.h | 83 +- .../groonga/include/groonga/portability.h | 59 +- .../include/groonga/request_canceler.h | 8 +- .../groonga/include/groonga/request_timer.h | 53 + .../vendor/groonga/include/groonga/scorer.h | 14 +- .../vendor/groonga/include/groonga/table.h | 246 + .../vendor/groonga/include/groonga/thread.h | 39 + .../vendor/groonga/include/groonga/time.h | 61 + .../vendor/groonga/include/groonga/token.h | 11 +- .../groonga/include/groonga/token_filter.h | 8 +- .../groonga/include/groonga/tokenizer.h | 8 +- .../vendor/groonga/include/groonga/type.h | 40 + .../vendor/groonga/include/groonga/util.h | 14 +- .../groonga/include/groonga/window_function.h | 73 + .../vendor/groonga/include/groonga/windows.h | 31 + .../include/groonga/windows_event_logger.h | 30 + .../mroonga/vendor/groonga/lib/CMakeLists.txt | 69 +- .../mroonga/vendor/groonga/lib/Makefile.am | 38 +- storage/mroonga/vendor/groonga/lib/alloc.c | 961 + storage/mroonga/vendor/groonga/lib/arrow.cpp | 849 + storage/mroonga/vendor/groonga/lib/cache.c | 1036 + storage/mroonga/vendor/groonga/lib/column.c | 49 + storage/mroonga/vendor/groonga/lib/com.c | 49 +- storage/mroonga/vendor/groonga/lib/command.c | 3 +- storage/mroonga/vendor/groonga/lib/config.c | 289 + storage/mroonga/vendor/groonga/lib/ctx.c | 1897 +- .../mroonga/vendor/groonga/lib/ctx_impl_mrb.c | 138 +- storage/mroonga/vendor/groonga/lib/dat.cpp | 267 +- .../mroonga/vendor/groonga/lib/dat/array.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/base.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/block.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/check.hpp | 8 +- .../vendor/groonga/lib/dat/cursor-factory.cpp | 2 - .../vendor/groonga/lib/dat/cursor-factory.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/cursor.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/dat.hpp | 9 +- .../mroonga/vendor/groonga/lib/dat/entry.hpp | 8 +- .../vendor/groonga/lib/dat/file-impl.cpp | 21 +- .../vendor/groonga/lib/dat/file-impl.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/file.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/header.hpp | 8 +- .../vendor/groonga/lib/dat/id-cursor.hpp | 8 +- .../vendor/groonga/lib/dat/key-cursor.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/key.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/node.hpp | 8 +- .../groonga/lib/dat/predictive-cursor.hpp | 8 +- .../vendor/groonga/lib/dat/prefix-cursor.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/string.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/trie.cpp | 8 + .../mroonga/vendor/groonga/lib/dat/trie.hpp | 8 +- .../mroonga/vendor/groonga/lib/dat/vector.hpp | 8 +- storage/mroonga/vendor/groonga/lib/db.c | 5789 +- storage/mroonga/vendor/groonga/lib/dump.c | 112 + storage/mroonga/vendor/groonga/lib/egn.cpp | 3245 - storage/mroonga/vendor/groonga/lib/error.c | 412 +- storage/mroonga/vendor/groonga/lib/expr.c | 3880 +- .../mroonga/vendor/groonga/lib/expr_code.c | 24 +- .../vendor/groonga/lib/expr_executor.c | 945 + .../mroonga/vendor/groonga/lib/file_lock.c | 121 + .../mroonga/vendor/groonga/lib/file_reader.c | 109 + storage/mroonga/vendor/groonga/lib/geo.c | 128 +- storage/mroonga/vendor/groonga/lib/grn.h | 141 +- .../mroonga/vendor/groonga/lib/grn_alloc.h | 163 + .../mroonga/vendor/groonga/lib/grn_cache.h | 49 + storage/mroonga/vendor/groonga/lib/grn_com.h | 14 +- .../mroonga/vendor/groonga/lib/grn_config.h | 37 + storage/mroonga/vendor/groonga/lib/grn_ctx.h | 312 +- .../mroonga/vendor/groonga/lib/grn_ctx_impl.h | 90 +- .../vendor/groonga/lib/grn_ctx_impl_mrb.h | 8 +- storage/mroonga/vendor/groonga/lib/grn_dat.h | 25 +- storage/mroonga/vendor/groonga/lib/grn_db.h | 224 +- .../vendor/groonga/lib/grn_ecmascript.c | 2759 +- .../vendor/groonga/lib/grn_ecmascript.h | 137 +- .../vendor/groonga/lib/grn_ecmascript.lemon | 212 +- storage/mroonga/vendor/groonga/lib/grn_egn.h | 90 - .../mroonga/vendor/groonga/lib/grn_egn.hpp | 318 - .../mroonga/vendor/groonga/lib/grn_error.h | 12 +- storage/mroonga/vendor/groonga/lib/grn_expr.h | 17 +- .../vendor/groonga/lib/grn_expr_code.h | 8 +- .../vendor/groonga/lib/grn_expr_executor.h | 39 + .../vendor/groonga/lib/grn_file_lock.h | 48 + storage/mroonga/vendor/groonga/lib/grn_geo.h | 15 +- storage/mroonga/vendor/groonga/lib/grn_hash.h | 30 +- storage/mroonga/vendor/groonga/lib/grn_ii.h | 68 +- .../vendor/groonga/lib/grn_index_column.h | 34 + storage/mroonga/vendor/groonga/lib/grn_io.h | 33 +- storage/mroonga/vendor/groonga/lib/grn_load.h | 47 + .../mroonga/vendor/groonga/lib/grn_logger.h | 8 +- storage/mroonga/vendor/groonga/lib/grn_mrb.h | 10 +- .../mroonga/vendor/groonga/lib/grn_msgpack.h | 8 +- storage/mroonga/vendor/groonga/lib/grn_nfkc.h | 39 + .../vendor/groonga/lib/grn_normalizer.h | 8 +- storage/mroonga/vendor/groonga/lib/grn_obj.h | 32 + .../mroonga/vendor/groonga/lib/grn_output.h | 40 +- storage/mroonga/vendor/groonga/lib/grn_pat.h | 50 +- .../mroonga/vendor/groonga/lib/grn_plugin.h | 9 +- storage/mroonga/vendor/groonga/lib/grn_proc.h | 129 +- .../vendor/groonga/lib/grn_raw_string.h | 62 + .../mroonga/vendor/groonga/lib/grn_report.h | 47 + .../vendor/groonga/lib/grn_request_canceler.h | 7 +- .../vendor/groonga/lib/grn_request_timer.h | 28 + storage/mroonga/vendor/groonga/lib/grn_rset.h | 9 +- .../mroonga/vendor/groonga/lib/grn_scanner.h | 40 + .../mroonga/vendor/groonga/lib/grn_scorer.h | 8 +- .../mroonga/vendor/groonga/lib/grn_scorers.h | 8 +- storage/mroonga/vendor/groonga/lib/grn_snip.h | 15 +- .../mroonga/vendor/groonga/lib/grn_store.h | 79 +- storage/mroonga/vendor/groonga/lib/grn_str.h | 17 +- .../mroonga/vendor/groonga/lib/grn_string.h | 26 +- storage/mroonga/vendor/groonga/lib/grn_time.h | 40 + .../vendor/groonga/lib/grn_token_cursor.h | 14 +- .../vendor/groonga/lib/grn_tokenizers.h | 9 +- storage/mroonga/vendor/groonga/lib/grn_ts.h | 48 + storage/mroonga/vendor/groonga/lib/grn_util.h | 23 +- .../vendor/groonga/lib/grn_window_function.h | 40 + .../vendor/groonga/lib/grn_window_functions.h | 26 + .../mroonga/vendor/groonga/lib/grn_windows.h | 33 + storage/mroonga/vendor/groonga/lib/hash.c | 552 +- storage/mroonga/vendor/groonga/lib/icudump.c | 24 +- storage/mroonga/vendor/groonga/lib/id.c | 36 + storage/mroonga/vendor/groonga/lib/ii.c | 7021 +- .../mroonga/vendor/groonga/lib/index_column.c | 194 + storage/mroonga/vendor/groonga/lib/io.c | 865 +- .../mroonga/vendor/groonga/lib/libgroonga.c | 8 - storage/mroonga/vendor/groonga/lib/load.c | 1229 + storage/mroonga/vendor/groonga/lib/logger.c | 302 +- .../mroonga/vendor/groonga/lib/metadata.rc.in | 28 + storage/mroonga/vendor/groonga/lib/mrb.c | 129 +- .../vendor/groonga/lib/mrb/Makefile.am | 3 +- .../vendor/groonga/lib/mrb/mrb_accessor.c | 28 + .../vendor/groonga/lib/mrb/mrb_accessor.h | 6 +- .../vendor/groonga/lib/mrb/mrb_array.c | 10 +- .../vendor/groonga/lib/mrb/mrb_array.h | 6 +- .../mroonga/vendor/groonga/lib/mrb/mrb_bulk.c | 144 +- .../mroonga/vendor/groonga/lib/mrb/mrb_bulk.h | 7 +- .../vendor/groonga/lib/mrb/mrb_cache.c | 130 + .../vendor/groonga/lib/mrb/mrb_cache.h | 33 + .../vendor/groonga/lib/mrb/mrb_column.c | 84 +- .../vendor/groonga/lib/mrb/mrb_column.h | 6 +- .../vendor/groonga/lib/mrb/mrb_command.c | 24 +- .../vendor/groonga/lib/mrb/mrb_command.h | 6 +- .../groonga/lib/mrb/mrb_command_input.h | 6 +- .../groonga/lib/mrb/mrb_command_version.c | 41 + .../groonga/lib/mrb/mrb_command_version.h | 32 + .../vendor/groonga/lib/mrb/mrb_config.c | 90 + .../vendor/groonga/lib/mrb/mrb_config.h | 31 + .../vendor/groonga/lib/mrb/mrb_content_type.h | 6 +- .../vendor/groonga/lib/mrb/mrb_converter.c | 69 +- .../vendor/groonga/lib/mrb/mrb_converter.h | 14 +- .../mroonga/vendor/groonga/lib/mrb/mrb_ctx.c | 130 +- .../mroonga/vendor/groonga/lib/mrb/mrb_ctx.h | 6 +- .../vendor/groonga/lib/mrb/mrb_database.c | 100 +- .../vendor/groonga/lib/mrb/mrb_database.h | 6 +- .../groonga/lib/mrb/mrb_double_array_trie.h | 6 +- .../vendor/groonga/lib/mrb/mrb_error.c | 8 + .../vendor/groonga/lib/mrb/mrb_error.h | 6 +- .../vendor/groonga/lib/mrb/mrb_eval_context.c | 98 + .../vendor/groonga/lib/mrb/mrb_eval_context.h | 32 + .../mroonga/vendor/groonga/lib/mrb/mrb_expr.c | 242 +- .../mroonga/vendor/groonga/lib/mrb/mrb_expr.h | 14 +- .../groonga/lib/mrb/mrb_fixed_size_column.h | 6 +- .../vendor/groonga/lib/mrb/mrb_hash_table.c | 8 +- .../vendor/groonga/lib/mrb/mrb_hash_table.h | 6 +- .../mroonga/vendor/groonga/lib/mrb/mrb_id.h | 6 +- .../vendor/groonga/lib/mrb/mrb_index_column.c | 31 + .../vendor/groonga/lib/mrb/mrb_index_column.h | 6 +- .../vendor/groonga/lib/mrb/mrb_index_cursor.c | 35 +- .../vendor/groonga/lib/mrb/mrb_index_cursor.h | 6 +- .../vendor/groonga/lib/mrb/mrb_indexable.c | 170 + .../vendor/groonga/lib/mrb/mrb_indexable.h | 32 + .../vendor/groonga/lib/mrb/mrb_logger.c | 27 +- .../vendor/groonga/lib/mrb/mrb_logger.h | 6 +- .../vendor/groonga/lib/mrb/mrb_object.c | 134 +- .../vendor/groonga/lib/mrb/mrb_object.h | 6 +- .../vendor/groonga/lib/mrb/mrb_object_flags.c | 1 + .../vendor/groonga/lib/mrb/mrb_object_flags.h | 6 +- .../vendor/groonga/lib/mrb/mrb_operator.c | 1 + .../vendor/groonga/lib/mrb/mrb_operator.h | 6 +- .../vendor/groonga/lib/mrb/mrb_options.h | 6 +- .../groonga/lib/mrb/mrb_patricia_trie.h | 6 +- .../vendor/groonga/lib/mrb/mrb_pointer.c | 77 + .../vendor/groonga/lib/mrb/mrb_pointer.h | 31 + .../vendor/groonga/lib/mrb/mrb_procedure.c | 40 +- .../vendor/groonga/lib/mrb/mrb_procedure.h | 6 +- .../vendor/groonga/lib/mrb/mrb_query_logger.c | 76 + .../vendor/groonga/lib/mrb/mrb_query_logger.h | 32 + .../vendor/groonga/lib/mrb/mrb_record.c | 162 + .../vendor/groonga/lib/mrb/mrb_record.h | 31 + .../vendor/groonga/lib/mrb/mrb_table.c | 176 +- .../vendor/groonga/lib/mrb/mrb_table.h | 6 +- .../vendor/groonga/lib/mrb/mrb_table_cursor.c | 42 +- .../vendor/groonga/lib/mrb/mrb_table_cursor.h | 6 +- .../groonga/lib/mrb/mrb_table_cursor_flags.h | 6 +- .../groonga/lib/mrb/mrb_table_group_flags.h | 6 +- .../groonga/lib/mrb/mrb_table_group_result.c | 18 +- .../groonga/lib/mrb/mrb_table_group_result.h | 7 +- .../groonga/lib/mrb/mrb_table_sort_flags.h | 7 +- .../groonga/lib/mrb/mrb_table_sort_key.c | 4 +- .../groonga/lib/mrb/mrb_table_sort_key.h | 6 +- .../vendor/groonga/lib/mrb/mrb_thread.c | 46 + .../vendor/groonga/lib/mrb/mrb_thread.h | 32 + .../mroonga/vendor/groonga/lib/mrb/mrb_type.h | 6 +- .../lib/mrb/mrb_variable_size_column.h | 6 +- .../mroonga/vendor/groonga/lib/mrb/mrb_void.h | 6 +- .../groonga/lib/mrb/mrb_window_definition.c | 164 + .../groonga/lib/mrb/mrb_window_definition.h | 32 + .../vendor/groonga/lib/mrb/mrb_writer.c | 21 +- .../vendor/groonga/lib/mrb/mrb_writer.h | 6 +- .../groonga/lib/mrb/scripts/Makefile.am | 5 +- .../groonga/lib/mrb/scripts/accessor.rb | 5 + .../vendor/groonga/lib/mrb/scripts/command.rb | 31 +- .../groonga/lib/mrb/scripts/command_input.rb | 15 + .../lib/mrb/scripts/command_line/grndb.rb | 433 +- .../lib/mrb/scripts/command_line_parser.rb | 168 + .../vendor/groonga/lib/mrb/scripts/context.rb | 33 + .../groonga/lib/mrb/scripts/context/rc.rb | 24 +- .../groonga/lib/mrb/scripts/database.rb | 64 +- .../groonga/lib/mrb/scripts/eval_context.rb | 5 + .../groonga/lib/mrb/scripts/expression.rb | 38 +- .../lib/mrb/scripts/expression_rewriter.rb | 22 + .../lib/mrb/scripts/expression_rewriters.rb | 41 + .../mrb/scripts/expression_size_estimator.rb | 168 +- .../lib/mrb/scripts/expression_tree.rb | 9 + .../mrb/scripts/expression_tree/Makefile.am | 9 + .../mrb/scripts/expression_tree/accessor.rb | 14 + .../expression_tree/binary_operation.rb | 67 + .../mrb/scripts/expression_tree/constant.rb | 22 + .../scripts/expression_tree/function_call.rb | 66 + .../scripts/expression_tree/index_column.rb | 14 + .../expression_tree/logical_operation.rb | 33 + .../mrb/scripts/expression_tree/options.rb | 14 + .../mrb/scripts/expression_tree/procedure.rb | 18 + .../mrb/scripts/expression_tree/sources.am | 10 + .../mrb/scripts/expression_tree/variable.rb | 18 + .../mrb/scripts/expression_tree_builder.rb | 111 + .../lib/mrb/scripts/fixed_size_column.rb | 5 + .../vendor/groonga/lib/mrb/scripts/id.rb | 12 + .../lib/mrb/scripts/initialize/post.rb | 9 + .../vendor/groonga/lib/mrb/scripts/logger.rb | 15 +- .../groonga/lib/mrb/scripts/logger/level.rb | 12 +- .../vendor/groonga/lib/mrb/scripts/object.rb | 7 + .../groonga/lib/mrb/scripts/query_logger.rb | 9 + .../lib/mrb/scripts/query_logger/Makefile.am | 9 + .../lib/mrb/scripts/query_logger/flag.rb | 39 + .../lib/mrb/scripts/query_logger/sources.am | 2 + .../vendor/groonga/lib/mrb/scripts/record.rb | 38 + .../vendor/groonga/lib/mrb/scripts/require.rb | 17 +- .../groonga/lib/mrb/scripts/scan_info.rb | 3 + .../lib/mrb/scripts/scan_info_builder.rb | 350 +- .../groonga/lib/mrb/scripts/scan_info_data.rb | 77 +- .../scripts/scan_info_data_size_estimator.rb | 185 + .../vendor/groonga/lib/mrb/scripts/sources.am | 13 + .../vendor/groonga/lib/mrb/scripts/table.rb | 56 +- .../groonga/lib/mrb/scripts/table_cursor.rb | 2 + .../groonga/lib/mrb/scripts/test/empty.rb | 1 - .../lib/mrb/scripts/variable_size_column.rb | 5 + .../mroonga/vendor/groonga/lib/mrb/sources.am | 20 + storage/mroonga/vendor/groonga/lib/nfkc.c | 80221 +--------------- storage/mroonga/vendor/groonga/lib/nfkc.rb | 989 +- storage/mroonga/vendor/groonga/lib/nfkc50.c | 77784 +++++++++++++++ .../mroonga/vendor/groonga/lib/normalizer.c | 8 +- storage/mroonga/vendor/groonga/lib/obj.c | 597 +- storage/mroonga/vendor/groonga/lib/operator.c | 600 +- storage/mroonga/vendor/groonga/lib/output.c | 1277 +- storage/mroonga/vendor/groonga/lib/pat.c | 1044 +- storage/mroonga/vendor/groonga/lib/plugin.c | 442 +- storage/mroonga/vendor/groonga/lib/proc.c | 5881 +- .../vendor/groonga/lib/proc/Makefile.am | 17 + .../vendor/groonga/lib/proc/proc_column.c | 1019 + .../vendor/groonga/lib/proc/proc_config.c | 139 + .../vendor/groonga/lib/proc/proc_dump.c | 1138 + .../groonga/lib/proc/proc_fuzzy_search.c | 467 + .../vendor/groonga/lib/proc/proc_highlight.c | 503 + .../vendor/groonga/lib/proc/proc_in_records.c | 519 + .../vendor/groonga/lib/proc/proc_lock.c | 172 + .../vendor/groonga/lib/proc/proc_object.c | 138 + .../groonga/lib/proc/proc_object_inspect.c | 614 + .../groonga/lib/proc/proc_object_list.c | 413 + .../vendor/groonga/lib/proc/proc_query.c | 118 + .../groonga/lib/proc/proc_query_log_flags.c | 220 + .../vendor/groonga/lib/proc/proc_schema.c | 1226 + .../vendor/groonga/lib/proc/proc_select.c | 3808 + .../vendor/groonga/lib/proc/proc_snippet.c | 319 + .../vendor/groonga/lib/proc/proc_table.c | 910 + .../vendor/groonga/lib/proc/proc_tokenize.c | 433 + .../vendor/groonga/lib/proc/sources.am | 18 + .../mroonga/vendor/groonga/lib/raw_string.c | 38 + storage/mroonga/vendor/groonga/lib/report.c | 98 + .../vendor/groonga/lib/request_canceler.c | 71 +- .../vendor/groonga/lib/request_timer.c | 88 + storage/mroonga/vendor/groonga/lib/scanner.c | 73 + storage/mroonga/vendor/groonga/lib/scorer.c | 14 +- storage/mroonga/vendor/groonga/lib/sources.am | 49 +- storage/mroonga/vendor/groonga/lib/store.c | 1245 +- storage/mroonga/vendor/groonga/lib/str.c | 259 +- storage/mroonga/vendor/groonga/lib/string.c | 3 + storage/mroonga/vendor/groonga/lib/table.c | 122 + storage/mroonga/vendor/groonga/lib/thread.c | 59 + storage/mroonga/vendor/groonga/lib/time.c | 245 + .../mroonga/vendor/groonga/lib/token_cursor.c | 51 +- .../mroonga/vendor/groonga/lib/token_filter.c | 4 +- .../mroonga/vendor/groonga/lib/tokenizer.c | 2 +- .../mroonga/vendor/groonga/lib/tokenizers.c | 21 +- storage/mroonga/vendor/groonga/lib/ts.c | 906 + .../mroonga/vendor/groonga/lib/ts/Makefile.am | 20 + .../mroonga/vendor/groonga/lib/ts/sources.am | 25 + .../mroonga/vendor/groonga/lib/ts/ts_buf.c | 244 + .../mroonga/vendor/groonga/lib/ts/ts_buf.h | 111 + .../mroonga/vendor/groonga/lib/ts/ts_cursor.c | 163 + .../mroonga/vendor/groonga/lib/ts/ts_cursor.h | 59 + .../mroonga/vendor/groonga/lib/ts/ts_expr.c | 219 + .../mroonga/vendor/groonga/lib/ts/ts_expr.h | 87 + .../vendor/groonga/lib/ts/ts_expr_builder.c | 757 + .../vendor/groonga/lib/ts/ts_expr_builder.h | 128 + .../vendor/groonga/lib/ts/ts_expr_node.c | 5374 ++ .../vendor/groonga/lib/ts/ts_expr_node.h | 128 + .../vendor/groonga/lib/ts/ts_expr_parser.c | 1329 + .../vendor/groonga/lib/ts/ts_expr_parser.h | 107 + .../mroonga/vendor/groonga/lib/ts/ts_log.h | 46 + storage/mroonga/vendor/groonga/lib/ts/ts_op.c | 131 + storage/mroonga/vendor/groonga/lib/ts/ts_op.h | 87 + .../mroonga/vendor/groonga/lib/ts/ts_plan.c | 21 + .../mroonga/vendor/groonga/lib/ts/ts_plan.h | 87 + .../mroonga/vendor/groonga/lib/ts/ts_sorter.c | 2173 + .../mroonga/vendor/groonga/lib/ts/ts_sorter.h | 98 + .../mroonga/vendor/groonga/lib/ts/ts_str.c | 191 + .../mroonga/vendor/groonga/lib/ts/ts_str.h | 106 + .../mroonga/vendor/groonga/lib/ts/ts_types.h | 168 + .../mroonga/vendor/groonga/lib/ts/ts_util.c | 129 + .../mroonga/vendor/groonga/lib/ts/ts_util.h | 61 + storage/mroonga/vendor/groonga/lib/type.c | 87 + storage/mroonga/vendor/groonga/lib/util.c | 404 +- .../vendor/groonga/lib/window_function.c | 464 + .../vendor/groonga/lib/window_functions.c | 405 + storage/mroonga/vendor/groonga/lib/windows.c | 104 + .../vendor/groonga/lib/windows_event_logger.c | 203 + storage/mroonga/vendor/groonga/nginx_version | 2 +- .../vendor/groonga/plugins/CMakeLists.txt | 3 +- .../vendor/groonga/plugins/Makefile.am | 4 +- .../CMakeLists.txt | 23 +- .../plugins/expression_rewriters/Makefile.am | 9 + .../plugins/expression_rewriters/optimizer.rb | 147 + .../plugins/expression_rewriters/sources.am | 2 + .../groonga/plugins/functions/CMakeLists.txt | 103 +- .../groonga/plugins/functions/Makefile.am | 13 + .../groonga/plugins/functions/index_column.c | 266 + .../plugins/functions/index_column_sources.am | 2 + .../vendor/groonga/plugins/functions/math.c | 141 + .../groonga/plugins/functions/math_sources.am | 2 + .../vendor/groonga/plugins/functions/number.c | 187 + .../plugins/functions/number_sources.am | 2 + .../vendor/groonga/plugins/functions/string.c | 299 + .../plugins/functions/string_sources.am | 2 + .../vendor/groonga/plugins/functions/time.c | 376 + .../groonga/plugins/functions/time_sources.am | 2 + .../vendor/groonga/plugins/functions/vector.c | 309 +- .../plugins/query_expanders/Makefile.am | 4 +- .../groonga/plugins/query_expanders/tsv.c | 55 +- .../groonga/plugins/ruby/CMakeLists.txt | 50 +- .../vendor/groonga/plugins/ruby/Makefile.am | 26 +- .../vendor/groonga/plugins/ruby/eval.c | 68 - .../vendor/groonga/plugins/ruby/eval.rb | 36 + .../groonga/plugins/ruby/eval_sources.am | 3 - .../vendor/groonga/plugins/ruby/load.c | 67 - .../groonga/plugins/ruby/load_sources.am | 3 - .../vendor/groonga/plugins/ruby/ruby_plugin.h | 76 - .../vendor/groonga/plugins/ruby/sources.am | 2 + .../vendor/groonga/plugins/sharding.rb | 5 + .../groonga/plugins/sharding/logical_count.rb | 53 +- .../plugins/sharding/logical_enumerator.rb | 79 +- .../plugins/sharding/logical_parameters.rb | 44 + .../plugins/sharding/logical_range_filter.rb | 364 +- .../plugins/sharding/logical_select.rb | 789 +- .../plugins/sharding/logical_shard_list.rb | 28 + .../plugins/sharding/logical_table_remove.rb | 307 +- .../groonga/plugins/sharding/parameters.rb | 10 + .../sharding/range_expression_builder.rb | 51 +- .../groonga/plugins/sharding/sources.am | 3 + .../groonga/plugins/suggest/CMakeLists.txt | 3 +- .../vendor/groonga/plugins/suggest/suggest.c | 21 +- .../vendor/groonga/plugins/table/Makefile.am | 24 - .../vendor/groonga/plugins/table/sources.am | 2 - .../vendor/groonga/plugins/table/table.c | 747 - .../groonga/plugins/token_filters/stem.c | 14 +- .../groonga/plugins/tokenizers/CMakeLists.txt | 11 + .../groonga/plugins/tokenizers/Makefile.am | 6 +- .../vendor/groonga/plugins/tokenizers/mecab.c | 120 +- storage/mroonga/vendor/groonga/ra.rb | 12 - .../mroonga/vendor/groonga/src/CMakeLists.txt | 14 + .../mroonga/vendor/groonga/src/Makefile.am | 4 + storage/mroonga/vendor/groonga/src/grndb.c | 64 +- storage/mroonga/vendor/groonga/src/groonga.c | 1067 +- .../vendor/groonga/src/groonga_benchmark.c | 62 +- .../vendor/groonga/src/httpd/Makefile.am | 2 +- .../nginx-module/ngx_http_groonga_module.c | 739 +- .../vendor/groonga/src/suggest/CMakeLists.txt | 3 +- .../vendor/groonga/src/suggest/Makefile.am | 3 - .../suggest/groonga_suggest_create_dataset.c | 21 +- .../src/suggest/groonga_suggest_httpd.c | 4 +- .../src/suggest/groonga_suggest_learner.c | 4 +- .../mroonga/vendor/groonga/tools/Makefile.am | 1 + .../groonga/tools/check-small-index-limit.rb | 123 + .../tools/groonga-memory-usage-analyzer.rb | 127 + .../tools/groonga-object-list-checker.rb | 104 + .../groonga/tools/travis-before-script.sh | 11 +- .../vendor/groonga/tools/travis-install.sh | 15 +- .../vendor/groonga/tools/travis-script.sh | 70 +- .../vendor/groonga/vendor/CMakeLists.txt | 5 +- .../mroonga/vendor/groonga/vendor/Makefile.am | 12 +- .../vendor/groonga/vendor/download_lz4.rb | 54 + .../vendor/groonga/vendor/download_mecab.rb | 59 + .../groonga/vendor/download_message_pack.rb | 54 + .../vendor/groonga/vendor/lz4/CMakeLists.txt | 98 + .../vendor/groonga/vendor/lz4/Makefile.am | 2 + .../groonga/vendor/mecab/CMakeLists.txt | 219 + .../vendor/groonga/vendor/mecab/Makefile.am | 4 + .../groonga/vendor/mecab/config.h.cmake | 1 + .../vendor/groonga/vendor/mecab/mecabrc.cmake | 3 + .../vendor/message_pack/CMakeLists.txt | 53 + .../groonga/vendor/message_pack/Makefile.am | 2 + .../groonga/vendor/mruby/CMakeLists.txt | 40 +- .../vendor/groonga/vendor/mruby/Makefile.am | 27 +- .../groonga/vendor/mruby/build_config.rb | 21 +- .../groonga/vendor/mruby/built_sources.am | 5 +- .../groonga/vendor/mruby/mruby_build.rb | 10 + .../vendor/groonga/vendor/mruby/version | 1 + .../groonga/vendor/onigmo/CMakeLists.txt | 72 +- .../vendor/groonga/vendor/onigmo/Makefile.am | 2 + .../groonga-normalizer-mysql/CMakeLists.txt | 8 +- .../groonga-normalizer-mysql/configure.ac | 33 +- .../groonga-normalizer-mysql/doc/text/news.md | 13 +- .../packages/apt/Makefile.am | 2 +- .../packages/apt/Vagrantfile | 12 +- .../packages/apt/sign-packages.sh | 2 +- .../packages/apt/sign-repository.sh | 2 +- .../packages/apt/update-repository.sh | 2 +- .../packages/debian/changelog | 6 + .../centos/groonga-normalizer-mysql.spec.in | 3 + .../fedora/groonga-normalizer-mysql.spec.in | 3 + .../packages/ubuntu/Makefile.am | 2 +- .../packages/yum/Makefile.am | 3 +- .../packages/yum/Vagrantfile | 6 +- .../plugins/groonga-normalizer-mysql/version | 2 +- storage/mroonga/version | 2 +- storage/mroonga/version_in_hex | 2 +- storage/mroonga/version_major | 2 +- storage/mroonga/version_micro | 2 +- 1795 files changed, 171698 insertions(+), 108720 deletions(-) create mode 100644 storage/mroonga/CMakeLists.txt.orig create mode 100644 storage/mroonga/lib/mrn_column_name.cpp create mode 100644 storage/mroonga/lib/mrn_column_name.hpp create mode 100644 storage/mroonga/lib/mrn_context_pool.cpp create mode 100644 storage/mroonga/lib/mrn_context_pool.hpp create mode 100644 storage/mroonga/lib/mrn_count_skip_checker.cpp create mode 100644 storage/mroonga/lib/mrn_count_skip_checker.hpp create mode 100644 storage/mroonga/lib/mrn_current_thread.hpp create mode 100644 storage/mroonga/lib/mrn_database.cpp create mode 100644 storage/mroonga/lib/mrn_database.hpp create mode 100644 storage/mroonga/lib/mrn_operation.cpp create mode 100644 storage/mroonga/lib/mrn_operation.hpp create mode 100644 storage/mroonga/lib/mrn_operations.cpp create mode 100644 storage/mroonga/lib/mrn_operations.hpp create mode 100644 storage/mroonga/lib/mrn_query_parser.cpp create mode 100644 storage/mroonga/lib/mrn_query_parser.hpp create mode 100644 storage/mroonga/lib/mrn_smart_bitmap.cpp create mode 100644 storage/mroonga/lib/mrn_smart_bitmap.hpp create mode 100644 storage/mroonga/lib/mrn_table_fields_offset_mover.cpp create mode 100644 storage/mroonga/lib/mrn_table_fields_offset_mover.hpp rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_64bit.inc => check_64bit.inc} (83%) create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc delete mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_100.inc => have_version_10_0.inc} (83%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_100_or_later.inc => have_version_10_0_or_later.inc} (82%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_56.inc => have_version_5_5.inc} (84%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_55.inc => have_version_5_6.inc} (90%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_56_or_later.inc => have_version_5_6_or_later.inc} (88%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{have_version_57.inc => have_version_5_7.inc} (90%) create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc rename storage/mroonga/mysql-test/mroonga/include/mroonga/{skip_mariadb_100_or_later.inc => skip_mariadb_10_0_or_later.inc} (82%) create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc rename storage/mroonga/mysql-test/mroonga/include/mroonga/{skip_mariadb_55.inc => skip_mariadb_5_5.inc} (85%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{skip_mysql_55.inc => skip_mysql_5_5.inc} (85%) rename storage/mroonga/mysql-test/mroonga/include/mroonga/{skip_mysql_57.inc => skip_mysql_5_7.inc} (91%) create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc delete mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris10.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result rename storage/mroonga/mysql-test/mroonga/storage/r/{alter_table_engine_decimal.result => alter_table_change_engine_decimal.result} (63%) rename storage/mroonga/mysql-test/mroonga/storage/r/{alter_table_change_engine.result => alter_table_change_engine_fulltext_index.result} (64%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result rename storage/mroonga/mysql-test/mroonga/storage/r/{column_datetime_64bit_version_55_out_of_range.result => column_datetime_64bit_version_5_5_out_of_range.result} (65%) rename storage/mroonga/mysql-test/mroonga/storage/r/{column_datetime_64bit_version_56_or_later_out_of_range.result => column_datetime_64bit_version_5_6_or_later_out_of_range.result} (65%) rename storage/mroonga/mysql-test/mroonga/storage/r/{column_datetime_zero_date_strict.result => column_datetime_mariadb_10_2_or_later_zero_date.result} (61%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/count_star.result rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_flags_comment.result => create_table_column_flags_comment.result} (60%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_flags_parameter.result => create_table_column_flags_parameter.result} (59%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_groonga_type_comment.result => create_table_column_groonga_type_comment.result} (70%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_groonga_type_nonexistent.result => create_table_column_groonga_type_nonexistent.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_groonga_type_parameter.result => create_table_column_groonga_type_parameter.result} (74%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_type_comment.result => create_table_column_type_comment.result} (70%) rename storage/mroonga/mysql-test/mroonga/storage/r/{create_table_field_type_nonexistent.result => create_table_column_type_nonexistent.result} (100%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result rename storage/mroonga/mysql-test/mroonga/storage/r/{fulltext_version_100_no_such_key.result => fulltext_version_10_0_no_such_key.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{fulltext_version_55_no_such_key.result => fulltext_version_5_5_no_such_key.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{fulltext_version_56_no_such_key.result => fulltext_version_5_6_no_such_key.result} (100%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result rename storage/mroonga/mysql-test/mroonga/storage/r/{function_escape_success_all.result => function_escape_query_all.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{function_escape_success_custom.result => function_escape_query_custom.result} (100%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result rename storage/mroonga/mysql-test/mroonga/storage/r/{function_escape_success_nested.result => function_escape_query_nested.result} (100%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result rename storage/mroonga/mysql-test/mroonga/storage/r/{geometry_bulk_insert_null_57.result => geometry_strict_sql_mode_bulk_insert_null.result} (58%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result rename storage/mroonga/mysql-test/mroonga/storage/r/{index_multiple_column_range_not_used_in_order_by_greater_than.result => index_multiple_column_range_all_used_greater_than.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.result => index_multiple_column_range_all_used_greater_than_or_equal.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{index_multiple_column_range_not_used_in_order_by_less_than.result => index_multiple_column_range_all_used_less_than.result} (100%) rename storage/mroonga/mysql-test/mroonga/storage/r/{index_multiple_column_range_not_used_in_order_by_less_than_or_equal.result => index_multiple_column_range_all_used_less_than_or_equal.result} (100%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result delete mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result rename storage/mroonga/mysql-test/mroonga/storage/{t/variable_max_n_records_for_estimate_global.result => r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result} (65%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test rename storage/mroonga/mysql-test/mroonga/storage/t/{alter_table_engine_decimal.test => alter_table_change_engine_decimal.test} (84%) rename storage/mroonga/mysql-test/mroonga/storage/t/{alter_table_change_engine.test => alter_table_change_engine_fulltext_index.test} (90%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test rename storage/mroonga/mysql-test/mroonga/storage/t/{column_datetime_64bit_version_56_or_later_out_of_range.test => column_datetime_64bit_strict_sql_mode_out_of_range.test} (86%) rename storage/mroonga/mysql-test/mroonga/storage/t/{column_datetime_64bit_version_55_out_of_range.test => column_datetime_64bit_version_5_5_out_of_range.test} (89%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test rename storage/mroonga/mysql-test/mroonga/storage/t/{column_datetime_zero_date_strict.test => column_datetime_mariadb_10_2_or_later_zero_date.test} (88%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/count_star.test rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_flags_comment.test => create_table_column_flags_comment.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_flags_parameter.test => create_table_column_flags_parameter.test} (97%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_groonga_type_comment.test => create_table_column_groonga_type_comment.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_groonga_type_nonexistent.test => create_table_column_groonga_type_nonexistent.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_groonga_type_parameter.test => create_table_column_groonga_type_parameter.test} (95%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_type_comment.test => create_table_column_type_comment.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{create_table_field_type_nonexistent.test => create_table_column_type_nonexistent.test} (98%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test rename storage/mroonga/mysql-test/mroonga/storage/t/{fulltext_version_56_no_such_key.test => fulltext_version_10_0_no_such_key.test} (95%) rename storage/mroonga/mysql-test/mroonga/storage/t/{fulltext_version_55_no_such_key.test => fulltext_version_5_5_no_such_key.test} (95%) rename storage/mroonga/mysql-test/mroonga/storage/t/{fulltext_version_100_no_such_key.test => fulltext_version_5_6_no_such_key.test} (95%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test rename storage/mroonga/mysql-test/mroonga/storage/t/{function_escape_success_all.test => function_escape_query_all.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{function_escape_success_custom.test => function_escape_query_custom.test} (98%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test rename storage/mroonga/mysql-test/mroonga/storage/t/{function_escape_success_nested.test => function_escape_query_nested.test} (98%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test rename storage/mroonga/mysql-test/mroonga/storage/t/{geometry_bulk_insert_null_57.test => geometry_strict_sql_mode_bulk_insert_null.test} (86%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test rename storage/mroonga/mysql-test/mroonga/storage/t/{index_multiple_column_range_not_used_in_order_by_greater_than.test => index_multiple_column_range_all_used_greater_than.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test => index_multiple_column_range_all_used_greater_than_or_equal.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{index_multiple_column_range_not_used_in_order_by_less_than.test => index_multiple_column_range_all_used_less_than.test} (98%) rename storage/mroonga/mysql-test/mroonga/storage/t/{index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test => index_multiple_column_range_all_used_less_than_or_equal.test} (98%) create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test delete mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test delete mode 100755 storage/mroonga/packages/check-utility.sh delete mode 100644 storage/mroonga/packages/debian/apparmor/mysql-server-mroonga delete mode 100644 storage/mroonga/packages/debian/changelog delete mode 100644 storage/mroonga/packages/debian/compat delete mode 100644 storage/mroonga/packages/debian/control.in delete mode 100644 storage/mroonga/packages/debian/copyright delete mode 100644 storage/mroonga/packages/debian/mysql-server-mroonga-doc.install delete mode 100644 storage/mroonga/packages/debian/mysql-server-mroonga.install delete mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.postinst delete mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.postrm delete mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.prerm delete mode 100755 storage/mroonga/packages/debian/rules delete mode 100644 storage/mroonga/packages/windows/build-vc2013-msi-32.bat delete mode 100644 storage/mroonga/packages/windows/build-vc2013-msi-64.bat delete mode 100644 storage/mroonga/packages/windows/build-vc2013-zip-32.bat delete mode 100644 storage/mroonga/packages/windows/build-vc2013-zip-64.bat delete mode 100644 storage/mroonga/packages/windows/build-vc2013.bat create mode 100644 storage/mroonga/udf/mrn_udf_highlight_html.cpp create mode 100644 storage/mroonga/udf/mrn_udf_normalize.cpp create mode 100644 storage/mroonga/udf/mrn_udf_query_expand.cpp create mode 100644 storage/mroonga/udf/mrn_udf_snippet_html.cpp create mode 100644 storage/mroonga/vendor/groonga/CMakeLists.txt.orig create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-between-sequential.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-cache.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-nfkc.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-result-set.c create mode 100644 storage/mroonga/vendor/groonga/bundled_lz4_version create mode 100644 storage/mroonga/vendor/groonga/bundled_mecab_naist_jdic_version create mode 100644 storage/mroonga/vendor/groonga/bundled_mecab_version create mode 100644 storage/mroonga/vendor/groonga/bundled_message_pack_version delete mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js create mode 100644 storage/mroonga/vendor/groonga/groonga-arrow.pc.in create mode 100644 storage/mroonga/vendor/groonga/include/groonga.hpp create mode 100644 storage/mroonga/vendor/groonga/include/groonga/accessor.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/array.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/arrow.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/arrow.hpp create mode 100644 storage/mroonga/vendor/groonga/include/groonga/cache.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/column.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/config.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/dat.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/db.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/dump.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/error.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/file_reader.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/geo.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/hash.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/id.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/operator.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/pat.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/request_timer.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/table.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/thread.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/time.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/type.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/window_function.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/windows.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/windows_event_logger.h create mode 100644 storage/mroonga/vendor/groonga/lib/alloc.c create mode 100644 storage/mroonga/vendor/groonga/lib/arrow.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/cache.c create mode 100644 storage/mroonga/vendor/groonga/lib/column.c create mode 100644 storage/mroonga/vendor/groonga/lib/config.c create mode 100644 storage/mroonga/vendor/groonga/lib/dump.c delete mode 100644 storage/mroonga/vendor/groonga/lib/egn.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/expr_executor.c create mode 100644 storage/mroonga/vendor/groonga/lib/file_lock.c create mode 100644 storage/mroonga/vendor/groonga/lib/file_reader.c create mode 100644 storage/mroonga/vendor/groonga/lib/grn_alloc.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_cache.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_config.h delete mode 100644 storage/mroonga/vendor/groonga/lib/grn_egn.h delete mode 100644 storage/mroonga/vendor/groonga/lib/grn_egn.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/grn_expr_executor.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_file_lock.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_index_column.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_load.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_nfkc.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_obj.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_raw_string.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_report.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_request_timer.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_scanner.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_time.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_ts.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_window_function.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_window_functions.h create mode 100644 storage/mroonga/vendor/groonga/lib/grn_windows.h create mode 100644 storage/mroonga/vendor/groonga/lib/id.c create mode 100644 storage/mroonga/vendor/groonga/lib/index_column.c delete mode 100644 storage/mroonga/vendor/groonga/lib/libgroonga.c create mode 100644 storage/mroonga/vendor/groonga/lib/load.c create mode 100644 storage/mroonga/vendor/groonga/lib/metadata.rc.in create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_cache.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_cache.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_command_version.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_command_version.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_config.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_config.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_eval_context.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_eval_context.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_indexable.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_indexable.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_pointer.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_pointer.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_query_logger.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_query_logger.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_record.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_record.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_thread.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_thread.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_window_definition.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_window_definition.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/accessor.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/command_input.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/command_line_parser.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_rewriter.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_rewriters.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/accessor.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/binary_operation.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/function_call.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/index_column.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/logical_operation.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/options.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/procedure.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/variable.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree_builder.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/fixed_size_column.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/id.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/query_logger.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/query_logger/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/query_logger/flag.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/query_logger/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/record.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data_size_estimator.rb delete mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/test/empty.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/variable_size_column.rb create mode 100644 storage/mroonga/vendor/groonga/lib/nfkc50.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_column.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_config.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_dump.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_fuzzy_search.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_highlight.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_in_records.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_lock.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_object.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_object_inspect.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_object_list.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_query.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_query_log_flags.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_schema.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_select.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_snippet.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_table.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/proc_tokenize.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/raw_string.c create mode 100644 storage/mroonga/vendor/groonga/lib/report.c create mode 100644 storage/mroonga/vendor/groonga/lib/request_timer.c create mode 100644 storage/mroonga/vendor/groonga/lib/scanner.c create mode 100644 storage/mroonga/vendor/groonga/lib/table.c create mode 100644 storage/mroonga/vendor/groonga/lib/thread.c create mode 100644 storage/mroonga/vendor/groonga/lib/time.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/ts/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_buf.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_buf.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_cursor.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_cursor.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_builder.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_builder.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_parser.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_expr_parser.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_log.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_op.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_op.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_plan.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_plan.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_sorter.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_sorter.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_str.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_str.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_types.h create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_util.c create mode 100644 storage/mroonga/vendor/groonga/lib/ts/ts_util.h create mode 100644 storage/mroonga/vendor/groonga/lib/type.c create mode 100644 storage/mroonga/vendor/groonga/lib/window_function.c create mode 100644 storage/mroonga/vendor/groonga/lib/window_functions.c create mode 100644 storage/mroonga/vendor/groonga/lib/windows.c create mode 100644 storage/mroonga/vendor/groonga/lib/windows_event_logger.c rename storage/mroonga/vendor/groonga/plugins/{table => expression_rewriters}/CMakeLists.txt (57%) create mode 100644 storage/mroonga/vendor/groonga/plugins/expression_rewriters/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/expression_rewriters/optimizer.rb create mode 100644 storage/mroonga/vendor/groonga/plugins/expression_rewriters/sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/index_column.c create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/index_column_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/math.c create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/math_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/number.c create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/number_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/string.c create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/string_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/time.c create mode 100644 storage/mroonga/vendor/groonga/plugins/functions/time_sources.am delete mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/eval.c create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/eval.rb delete mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/eval_sources.am delete mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/load.c delete mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/load_sources.am delete mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/ruby_plugin.h create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/sharding/logical_parameters.rb create mode 100644 storage/mroonga/vendor/groonga/plugins/sharding/logical_shard_list.rb create mode 100644 storage/mroonga/vendor/groonga/plugins/sharding/parameters.rb delete mode 100644 storage/mroonga/vendor/groonga/plugins/table/Makefile.am delete mode 100644 storage/mroonga/vendor/groonga/plugins/table/sources.am delete mode 100644 storage/mroonga/vendor/groonga/plugins/table/table.c delete mode 100755 storage/mroonga/vendor/groonga/ra.rb create mode 100755 storage/mroonga/vendor/groonga/tools/check-small-index-limit.rb create mode 100755 storage/mroonga/vendor/groonga/tools/groonga-memory-usage-analyzer.rb create mode 100755 storage/mroonga/vendor/groonga/tools/groonga-object-list-checker.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/download_lz4.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/download_mecab.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/download_message_pack.rb create mode 100644 storage/mroonga/vendor/groonga/vendor/lz4/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/lz4/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/mecab/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/mecab/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/mecab/config.h.cmake create mode 100644 storage/mroonga/vendor/groonga/vendor/mecab/mecabrc.cmake create mode 100644 storage/mroonga/vendor/groonga/vendor/message_pack/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/message_pack/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/mruby/version diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt index 39dad9ce16b6a..20b234acc09ba 100644 --- a/storage/mroonga/CMakeLists.txt +++ b/storage/mroonga/CMakeLists.txt @@ -15,7 +15,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA cmake_minimum_required(VERSION 2.6) project(mroonga) @@ -51,6 +51,14 @@ if(MSVC) endif() endif() +if(MRN_BUNDLED) + if(WITHOUT_MROONGA OR + WITHOUT_MROONGA_STORAGE_ENGINE OR + "${PLUGIN_MROONGA}" STREQUAL "NO") + return() + endif() +endif() + set(MRN_BUNDLED_GROONGA_RELATIVE_DIR "vendor/groonga") set(MRN_BUNDLED_GROONGA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${MRN_BUNDLED_GROONGA_RELATIVE_DIR}") @@ -79,6 +87,58 @@ file(READ ${MRN_SOURCE_DIR}/version_micro MRN_VERSION_MICRO) file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX) file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION) +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() + + file(READ "${MRN_BUNDLED_GROONGA_DIR}/bundled_lz4_version" + MRN_BUNDLED_LZ4_VERSION) + string(STRIP + "${MRN_BUNDLED_LZ4_VERSION}" + MRN_BUNDLED_LZ4_VERSION) + set(MRN_BUNDLED_LZ4_DIR + "${MRN_BUNDLED_GROONGA_DIR}/vendor/lz4-${MRN_BUNDLED_LZ4_VERSION}") + if(EXISTS ${MRN_BUNDLED_LZ4_DIR}) + set(GRN_WITH_BUNDLED_LZ4 ON) + set(GRN_WITH_LZ4 "yes") + else() + set(GRN_WITH_LZ4 "no") + endif() + + add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}") +else() + set(MRN_GROONGA_EMBED OFF) + + file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION) + string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION) + + file(READ + ${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version + REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) + string(STRIP + "${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}" + REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) +endif() + set(MRN_PACKAGE_STRING "${PROJECT_NAME} ${MRN_VERSION}") include(CheckCCompilerFlag) @@ -107,18 +167,7 @@ read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/udf/sources.am MRN_UDF_SOURCES) string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}udf/\\1" MRN_UDF_SOURCES "${MRN_UDF_SOURCES}") -set(MRN_ALL_SOURCES - ${MRN_SOURCES} - ${MRN_UDF_SOURCES} - ${LIBMRN_NO_MYSQL_SOURCES} - ${LIBMRN_NEED_MYSQL_SOURCES}) - if(MRN_BUNDLED) - mysql_add_plugin(mroonga ${MRN_ALL_SOURCES} STORAGE_ENGINE MODULE_ONLY) - if(NOT TARGET mroonga) - return() - endif() - set(MYSQL_SOURCE_DIR ${CMAKE_SOURCE_DIR}) set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR}) set(MYSQL_CONFIG ${CMAKE_SOURCE_DIR}/scripts/mysql_config) @@ -134,44 +183,6 @@ else() endif() find_path(MYSQL_CONFIG "${MYSQL_CONFIG}") -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}") -else() - set(MRN_GROONGA_EMBED OFF) - - file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION) - string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION) - - file(READ - ${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version - REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) - string(STRIP - "${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}" - REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) -endif() - if(EXISTS "${MYSQL_SOURCE_DIR}/storage/maria") set(MYSQL_VARIANT "MariaDB") else() @@ -194,6 +205,7 @@ if(EXISTS "${MYSQL_SOURCE_DIR}/libbinlogevents") set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR "${MYSQL_SOURCE_DIR}/libbinlogevents/export") set(MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR + "${MYSQL_BUILD_DIR}/libbinlogevents/include" "${MYSQL_SOURCE_DIR}/libbinlogevents/include") else() set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR) @@ -270,6 +282,7 @@ else() set(MRN_LIBRARY_DIRS ${MRN_LIBRARY_DIRS} ${GROONGA_LIBRARY_DIRS}) + set(MRN_LIBRARIES ${GROONGA_LIBRARIES}) endif() include_directories( @@ -291,11 +304,17 @@ link_directories( ${MRN_LIBRARY_DIRS} ${MYSQL_LIBRARY_DIRS}) +set(MRN_ALL_SOURCES + ${MRN_SOURCES} + ${MRN_UDF_SOURCES} + ${LIBMRN_NO_MYSQL_SOURCES} + ${LIBMRN_NEED_MYSQL_SOURCES}) + if(MRN_BUNDLED) - target_link_libraries(mroonga ${MRN_LIBRARIES}) - if(NOT TARGET mroonga) - return() - endif() + mysql_add_plugin(mroonga + ${MRN_ALL_SOURCES} + STORAGE_ENGINE MODULE_ONLY + LINK_LIBRARIES ${MRN_LIBRARIES}) else() add_library(mroonga MODULE ${MRN_ALL_SOURCES}) @@ -340,8 +359,12 @@ else() MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated") MY_CHECK_AND_SET_COMPILER_FLAG("-fno-implicit-templates") - MY_CHECK_AND_SET_COMPILER_FLAG("-fno-exceptions") - MY_CHECK_AND_SET_COMPILER_FLAG("-fno-rtti") + if(("${MYSQL_VARIANT}" STREQUAL "MariaDB") OR + ("${MYSQL_VARIANT}" STREQUAL "MySQL" AND + ${MYSQL_VERSION} VERSION_LESS "5.7.0")) + MY_CHECK_AND_SET_COMPILER_FLAG("-fno-exceptions") + MY_CHECK_AND_SET_COMPILER_FLAG("-fno-rtti") + endif() MY_CHECK_AND_SET_COMPILER_FLAG("-felide-constructors") endif() set_source_files_properties(${MRN_SOURCES} PROPERTIES @@ -361,10 +384,20 @@ else() install(TARGETS mroonga DESTINATION "${MYSQL_PLUGIN_DIR}") endif() +option(MRN_BUILD_FOR_EMBEDDED_SERVER + "Whether to build Mroonga for embedded server or not. You can't use Mroonga built for embedded server with non embedded server." + OFF) +if(MRN_BUILD_FOR_EMBEDDED_SERVER) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "EMBEDDED_LIBRARY") +endif() + if(GROONGA_NORMALIZER_MYSQL_FOUND) - add_definitions("-DWITH_GROONGA_NORMALIZER_MYSQL=1") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1") if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED) - add_definitions("-DMRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED") else() set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"") @@ -372,7 +405,8 @@ if(GROONGA_NORMALIZER_MYSQL_FOUND) endif() if(MRN_GROONGA_EMBED) - add_definitions("-DMRN_GROONGA_EMBEDDED") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_GROONGA_EMBEDDED") endif() set(MRN_DEFAULT_PARSER "" CACHE STRING @@ -418,6 +452,8 @@ else() set(MRN_DATA_DIR "share/${PROJECT_NAME}") endif() install(FILES + "${PROJECT_SOURCE_DIR}/AUTHORS" + "${PROJECT_SOURCE_DIR}/COPYING" "${PROJECT_BINARY_DIR}/data/install.sql" "${PROJECT_SOURCE_DIR}/data/uninstall.sql" DESTINATION "${MRN_DATA_DIR}/") diff --git a/storage/mroonga/CMakeLists.txt.orig b/storage/mroonga/CMakeLists.txt.orig new file mode 100644 index 0000000000000..84ab438dbaa61 --- /dev/null +++ b/storage/mroonga/CMakeLists.txt.orig @@ -0,0 +1,480 @@ +# -*- indent-tabs-mode: nil -*- +# +# Copyright(C) 2012-2015 Kouhei Sutou +# Copyright(C) 2013 Kentoku SHIBA +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +cmake_minimum_required(VERSION 2.6) +project(mroonga) + +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(MRN_BUNDLED FALSE) +else() + set(MRN_BUNDLED TRUE) +endif() + +include(TestBigEndian) +test_big_endian(BIG_ENDIAN) +if(BIG_ENDIAN) + set(MRN_BIG_ENDIAN_NOT_SUPPORTED_MESSAGE + "Mroonga doesn't support on big-endian") + if(MRN_BUNDLED) + message(STATUS ${MRN_BIG_ENDIAN_NOT_SUPPORTED_MESSAGE}) + return() + else() + message(FATAL_ERROR ${MRN_BIG_ENDIAN_NOT_SUPPORTED_MESSAGE}) + endif() +endif() + +if(MSVC) + if(MSVC_VERSION LESS 1800) + set(MRN_OLD_MSVC_MESSAGE "Mroonga supports only MSVC 2013 or later") + if(MRN_BUNDLED) + message(STATUS ${MRN_OLD_MSVC_MESSAGE}) + return() + else() + message(FATAL_ERROR ${MRN_OLD_MSVC_MESSAGE}) + endif() + endif() +endif() + +if(MRN_BUNDLED) + if(WITHOUT_MROONGA OR + WITHOUT_MROONGA_STORAGE_ENGINE OR + "${PLUGIN_MROONGA}" STREQUAL "NO") + return() + endif() +endif() + +set(MRN_BUNDLED_GROONGA_RELATIVE_DIR "vendor/groonga") +set(MRN_BUNDLED_GROONGA_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/${MRN_BUNDLED_GROONGA_RELATIVE_DIR}") +if(EXISTS "${MRN_BUNDLED_GROONGA_DIR}") + set(MRN_GROONGA_BUNDLED TRUE) +else() + set(MRN_GROONGA_BUNDLED FALSE) +endif() + +set(MRN_PLUGIN_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) + +if(MRN_BUNDLED) + set(MRN_SOURCE_DIR ${CMAKE_SOURCE_DIR}/storage/mroonga) +else() + set(MRN_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +endif() + +file(READ ${MRN_SOURCE_DIR}/version MRN_VERSION) +file(READ ${MRN_SOURCE_DIR}/version_major MRN_VERSION_MAJOR) +file(READ ${MRN_SOURCE_DIR}/version_minor MRN_VERSION_MINOR) +file(READ ${MRN_SOURCE_DIR}/version_micro MRN_VERSION_MICRO) +file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX) +file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION) + +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() + + file(READ "${MRN_BUNDLED_GROONGA_DIR}/bundled_lz4_version" + MRN_BUNDLED_LZ4_VERSION) + string(STRIP + "${MRN_BUNDLED_LZ4_VERSION}" + MRN_BUNDLED_LZ4_VERSION) + set(MRN_BUNDLED_LZ4_DIR + "${MRN_BUNDLED_GROONGA_DIR}/vendor/lz4-${MRN_BUNDLED_LZ4_VERSION}") + if(EXISTS ${MRN_BUNDLED_LZ4_DIR}) + set(GRN_WITH_BUNDLED_LZ4 ON) + set(GRN_WITH_LZ4 "yes") + else() + set(GRN_WITH_LZ4 "no") + endif() + + add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}") +else() + set(MRN_GROONGA_EMBED OFF) + + file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION) + string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION) + + file(READ + ${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version + REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) + string(STRIP + "${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}" + REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION) +endif() + +set(MRN_PACKAGE_STRING "${PROJECT_NAME} ${MRN_VERSION}") + +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) +include(${MRN_SOURCE_DIR}/build/cmake_modules/ReadFileList.cmake) + +set(MRN_C_COMPILE_FLAGS "") +set(MRN_CXX_COMPILE_FLAGS "") + +macro(mrn_check_cflag flag) + string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${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}") + endif() +endmacro() + +macro(mrn_check_cxxflag flag) + string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${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}") + endif() +endmacro() + +macro(mrn_build_flag flag) + mrn_check_cflag(${flag}) + mrn_check_cxxflag(${flag}) +endmacro() + +if(MRN_BUNDLED) + set(MRN_RELATIVE_DIR_PREFIX "${MRN_SOURCE_DIR}/") +else() + set(MRN_RELATIVE_DIR_PREFIX "") +endif() + +read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am MRN_SOURCES) +read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_no_mysql_sources.am + LIBMRN_NO_MYSQL_SOURCES) +string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}lib/\\1" + LIBMRN_NO_MYSQL_SOURCES "${LIBMRN_NO_MYSQL_SOURCES}") +read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_need_mysql_sources.am + LIBMRN_NEED_MYSQL_SOURCES) +string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}lib/\\1" + LIBMRN_NEED_MYSQL_SOURCES "${LIBMRN_NEED_MYSQL_SOURCES}") +read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/udf/sources.am MRN_UDF_SOURCES) +string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}udf/\\1" + MRN_UDF_SOURCES "${MRN_UDF_SOURCES}") + +if(MRN_BUNDLED) + set(MYSQL_SOURCE_DIR ${CMAKE_SOURCE_DIR}) + set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR}) + set(MYSQL_CONFIG ${CMAKE_SOURCE_DIR}/scripts/mysql_config) +else() + set(MYSQL_SOURCE_DIR "/PATH/TO/MYSQL/SOURCE/DIRECTORY/" + CACHE PATH "MySQL source directory") + if(NOT EXISTS ${MYSQL_SOURCE_DIR}) + message(FATAL_ERROR + "MySQL source directory (MYSQL_SOURCE_DIR) doesn't exist: <${MYSQL_SOURCE_DIR}>") + endif() + set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR} CACHE PATH "MySQL build directory") + set(MYSQL_CONFIG "mysql_config" CACHE PATH "mysql-config command path") +endif() +find_path(MYSQL_CONFIG "${MYSQL_CONFIG}") + +if(EXISTS "${MYSQL_SOURCE_DIR}/storage/maria") + set(MYSQL_VARIANT "MariaDB") +else() + set(MYSQL_VARIANT "MySQL") +endif() + +if(EXISTS "${MYSQL_SOURCE_DIR}/pcre") + set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/pcre") +else() + set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/regex") +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() + +if(EXISTS "${MYSQL_SOURCE_DIR}/libbinlogevents") + set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR + "${MYSQL_SOURCE_DIR}/libbinlogevents/export") + set(MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR + "${MYSQL_BUILD_DIR}/libbinlogevents/include" + "${MYSQL_SOURCE_DIR}/libbinlogevents/include") +else() + set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR) + set(MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR) +endif() + +set(MYSQL_INCLUDE_DIRS + "${MYSQL_BUILD_DIR}/include" + "${MYSQL_SOURCE_DIR}/sql" + "${MYSQL_SOURCE_DIR}/include" + "${MYSQL_REGEX_INCLUDE_DIR}" + "${MYSQL_RAPIDJSON_INCLUDE_DIR}" + "${MYSQL_LIBBINLOGEVENTS_EXPORT_DIR}" + "${MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR}" + "${MYSQL_SOURCE_DIR}") + +if(MRN_BUNDLED) + set(MYSQL_PLUGIN_DIR "${INSTALL_PLUGINDIR}") + set(MYSQL_SERVICES_LIB_DIR "${MYSQL_BUILD_DIR}/libservices") + set(MYSQL_CFLAGS "${CMAKE_C_FLAGS}") + set(MYSQL_VERSION "${MYSQL_BASE_VERSION}") +else() + macro(SET_MYSQL_CONFIG_VALUE OPTION VARIABLE) + if(NOT ${VARIABLE}) + execute_process(COMMAND "${MYSQL_CONFIG}" ${OPTION} + OUTPUT_VARIABLE MYSQL_CONFIG_OUTPUT) + string(STRIP ${MYSQL_CONFIG_OUTPUT} ${VARIABLE}) + endif() + endmacro() + + set_mysql_config_value("--plugindir" MYSQL_PLUGIN_DIR) + set_mysql_config_value("--variable=pkglibdir" MYSQL_PKG_LIB_DIR) + set(MYSQL_BUILD_LIBSERVICES_DIR "${MYSQL_BUILD_DIR}/libservices") + if(EXISTS "${MYSQL_BUILD_LIBSERVICES_DIR}/libmysqlservices.a") + set(MYSQL_SERVICES_LIB_DIR "${MYSQL_BUILD_LIBSERVICES_DIR}") + else() + set(MYSQL_SERVICES_LIB_DIR "${MYSQL_PKG_LIB_DIR}") + endif() + set_mysql_config_value("--cflags" MYSQL_CFLAGS) + set_mysql_config_value("--version" MYSQL_VERSION) +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 + ${MYSQL_VERSION} VERSION_LESS "10.0.9") + message(FATAL_ERROR + "Mroonga doesn't support MariaDB 10.0.0-10.0.8: <${MYSQL_VERSION}>") + return() +endif() + +if(MRN_GROONGA_BUNDLED) + set(GROONGA_INCLUDE_DIRS "${MRN_BUNDLED_GROONGA_DIR}/include") + set(GROONGA_LIBRARY_DIRS "${MRN_BUNDLED_GROONGA_DIR}/lib") + set(GROONGA_LIBRARIES "libgroonga") + + set(MRN_LIBRARY_DIRS ${GROONGA_LIBRARY_DIRS}) + set(MRN_LIBRARIES ${GROONGA_LIBRARIES}) + 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() +else() + include(FindPkgConfig) + pkg_check_modules(GROONGA REQUIRED "groonga >= ${REQUIRED_GROONGA_VERSION}") + pkg_check_modules(GROONGA_NORMALIZER_MYSQL + "groonga-normalizer-mysql >= ${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}") + set(MRN_LIBRARY_DIRS + ${MRN_LIBRARY_DIRS} + ${GROONGA_LIBRARY_DIRS}) + set(MRN_LIBRARIES ${GROONGA_LIBRARIES}) +endif() + +include_directories( + "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}" + "${PROJECT_SOURCE_DIR}/lib" + ${MYSQL_INCLUDE_DIRS} + ${GROONGA_INCLUDE_DIRS}) + +if(WIN32) + set(MYSQL_LIBRARY_DIRS + "${MYSQL_BUILD_DIR}/lib" + "${MYSQL_BUILD_DIR}/libmysqld") +else() + set(MYSQL_LIBRARY_DIRS + "${MYSQL_SERVICES_LIB_DIR}") +endif() +link_directories( + ${MRN_LIBRARY_DIRS} + ${MYSQL_LIBRARY_DIRS}) + +set(MRN_ALL_SOURCES + ${MRN_SOURCES} + ${MRN_UDF_SOURCES} + ${LIBMRN_NO_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") + target_link_libraries(mroonga ${GROONGA_LIBRARIES} ${MYSQL_LIBRARIES}) + + option(WITH_DEBUG "Enable debug options" OFF) + if(WITH_DEBUG) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "SAFE_MUTEX") + if(CMAKE_COMPILER_IS_GNUCXX) + set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} -g3 -O0") + set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} -g3 -O0") + endif() + else() + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "DBUG_OFF") + endif() + + option(WITH_DEBUG_FULL "Enable full debug options" OFF) + if(WITH_DEBUG_FULL) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "SAFE_MUTEX" "SAFEMALLOC") + endif() + + option(DISABLE_FAST_MUTEXES "Force disabling fast mutex" OFF) + if(DISABLE_FAST_MUTEXES) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "FORCE_FAST_MUTEX_DISABLED=1") + endif() + + option(WITH_FAST_MUTEXES "Enable fast mutex" OFF) + if(WITH_FAST_MUTEXES) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MY_PTHREAD_FASTMUTEX") + endif() + + if(CMAKE_COMPILER_IS_GNUCXX) + mrn_build_flag("-Wall") + mrn_build_flag("-Wextra") + mrn_build_flag("-Wno-unused-parameter") + mrn_build_flag("-Wno-strict-aliasing") + mrn_build_flag("-Wno-deprecated") + mrn_check_cxxflag("-fno-implicit-templates") + if(("${MYSQL_VARIANT}" STREQUAL "MariaDB") OR + ("${MYSQL_VARIANT}" STREQUAL "MySQL" AND + ${MYSQL_VERSION} VERSION_LESS "5.7.0")) + mrn_check_cxxflag("-fno-exceptions") + mrn_check_cxxflag("-fno-rtti") + endif() + mrn_check_cxxflag("-felide-constructors") + endif() + set_source_files_properties(${MRN_SOURCES} PROPERTIES + COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}") + set_source_files_properties(${LIBMRN_NEED_MYSQL_SOURCES} PROPERTIES + COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}") + set_source_files_properties(${MRN_UDF_SOURCES} PROPERTIES + COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}") + set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES + COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") + set_target_properties(mroonga PROPERTIES + PREFIX "" + OUTPUT_NAME "ha_mroonga") + + install(TARGETS mroonga DESTINATION "${MYSQL_PLUGIN_DIR}") +endif() + +option(MRN_BUILD_FOR_EMBEDDED_SERVER + "Whether to build Mroonga for embedded server or not. You can't use Mroonga built for embedded server with non embedded server." + OFF) +if(MRN_BUILD_FOR_EMBEDDED_SERVER) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "EMBEDDED_LIBRARY") +endif() + +if(GROONGA_NORMALIZER_MYSQL_FOUND) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1") + if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED") + else() + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"") + endif() +endif() + +if(MRN_GROONGA_EMBED) + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_GROONGA_EMBEDDED") +endif() + +set(MRN_DEFAULT_PARSER "" CACHE STRING + "The default fulltext parser (Deprecated. Use MRN_DEFAULT_TOKENIZER instead.)") +set(MRN_DEFAULT_TOKENIZER "" CACHE STRING + "The default tokenizer for fulltext index") +if(NOT ${MRN_DEFAULT_TOKENIZER} STREQUAL "") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_DEFAULT_TOKENIZER=\"${MRN_DEFAULT_TOKENIZER}\"") +elseif(NOT ${MRN_DEFAULT_PARSER} STREQUAL "") + set_property(TARGET mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_DEFAULT_TOKENIZER=\"${MRN_DEFAULT_PARSER}\"") +endif() + +configure_file( + "${PROJECT_SOURCE_DIR}/mrn_version.h.in" + "${PROJECT_BINARY_DIR}/mrn_version.h") + +configure_file( + "${PROJECT_SOURCE_DIR}/config.sh.in" + "${PROJECT_BINARY_DIR}/config.sh") + +set(MRN_TEST_SUITE_DIR "${CMAKE_SOURCE_DIR}/mysql-test/suite/mroonga") +if(NOT EXISTS "${MRN_TEST_SUITE_DIR}") + set(MRN_TEST_SUITE_DIR "${PROJECT_SOURCE_DIR}/mysql-test/mroonga") +endif() +configure_file( + "${MRN_TEST_SUITE_DIR}/storage/r/information_schema_plugins.result.in" + "${MRN_TEST_SUITE_DIR}/storage/r/information_schema_plugins.result" + NEWLINE_STYLE LF) +configure_file( + "${MRN_TEST_SUITE_DIR}/storage/r/variable_version.result.in" + "${MRN_TEST_SUITE_DIR}/storage/r/variable_version.result" + NEWLINE_STYLE LF) + +configure_file( + "${PROJECT_SOURCE_DIR}/data/install.sql.in" + "${PROJECT_BINARY_DIR}/data/install.sql") + +if(MRN_BUNDLED) + set(MRN_DATA_DIR "${INSTALL_MYSQLSHAREDIR}/${PROJECT_NAME}") +else() + set(MRN_DATA_DIR "share/${PROJECT_NAME}") +endif() +install(FILES + "${PROJECT_SOURCE_DIR}/AUTHORS" + "${PROJECT_SOURCE_DIR}/COPYING" + "${PROJECT_BINARY_DIR}/data/install.sql" + "${PROJECT_SOURCE_DIR}/data/uninstall.sql" + DESTINATION "${MRN_DATA_DIR}/") diff --git a/storage/mroonga/Makefile.am b/storage/mroonga/Makefile.am index d783ec883f9d7..e46d2b2dd3ac2 100644 --- a/storage/mroonga/Makefile.am +++ b/storage/mroonga/Makefile.am @@ -1,9 +1,9 @@ +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_ARGS} AUTOMAKE_OPTIONS = 1.9.7 LOCALES = ja AM_CPPFLAGS = $(MYSQL_INCLUDES) $(GROONGA_CFLAGS) -I$(top_srcdir)/lib -ACLOCAL_AMFLAGS = $$ACLOCAL_ARGS include sources.am @@ -49,7 +49,13 @@ tag: cd $(top_srcdir) && \ git tag v$(VERSION) -a -m 'Mroonga $(VERSION)!!!' -update-latest-release: misc +ensure-cutter-source-path: + @if test -z "$(CUTTER_SOURCE_PATH)"; then \ + echo "\$$(CUTTER_SOURCE_PATH) is missing"; \ + exit 1; \ + fi + +update-latest-release: ensure-cutter-source-path @if test -z "$(OLD_RELEASE)"; then \ echo "\$$(OLD_RELEASE) is missing"; \ exit 1; \ @@ -63,17 +69,38 @@ update-latest-release: misc exit 1; \ fi cd $(top_srcdir) && \ - misc/update-latest-release.rb \ + "$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \ $(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ $(VERSION) $(NEW_RELEASE_DATE) \ packages/rpm/centos/mariadb-mroonga.spec.in \ packages/rpm/centos/mysql55-mroonga.spec.in \ packages/rpm/centos/mysql56-community-mroonga.spec.in \ - packages/debian/changelog \ + packages/rpm/centos/mysql57-community-mroonga.spec.in \ + packages/rpm/centos/percona-server-56-mroonga.spec.in \ + packages/rpm/centos/percona-server-57-mroonga.spec.in \ doc/source/install/*.rst \ doc/locale/*/LC_MESSAGES/install.po \ - $(MROONGA_GITHUB_COM_PATH)/index.html \ - $(MROONGA_GITHUB_COM_PATH)/ja/index.html + $(MROONGA_GITHUB_COM_PATH)/_config.yml + cd $(top_srcdir) && \ + "$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \ + $(PACKAGE)-5.5 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ + $(VERSION) $(NEW_RELEASE_DATE) \ + packages/debian-5.5/changelog + cd $(top_srcdir) && \ + "$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \ + $(PACKAGE)-5.6 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ + $(VERSION) $(NEW_RELEASE_DATE) \ + packages/debian-5.6/changelog + cd $(top_srcdir) && \ + "$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \ + $(PACKAGE)-5.7 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ + $(VERSION) $(NEW_RELEASE_DATE) \ + packages/debian-5.7/changelog + cd $(top_srcdir) && \ + "$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \ + $(PACKAGE)-mariadb-10.0 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ + $(VERSION) $(NEW_RELEASE_DATE) \ + packages/debian-mariadb-10.0/changelog update-po: @for lang in $(LOCALES); do \ @@ -144,10 +171,3 @@ upload-to-github: echo-cutter: echo $(CUTTER) - -misc: - @if test -z "$(CUTTER_SOURCE_PATH)"; then \ - echo "\$$(CUTTER_SOURCE_PATH) is missing"; \ - exit 1; \ - fi - ln -s "$(CUTTER_SOURCE_PATH)/misc" misc diff --git a/storage/mroonga/appveyor.yml b/storage/mroonga/appveyor.yml index 038d590054ead..3cf8ff8d3318a 100644 --- a/storage/mroonga/appveyor.yml +++ b/storage/mroonga/appveyor.yml @@ -1,54 +1,63 @@ version: "{build}" clone_depth: 10 +environment: + global: + MARIADB_VERSION: 10.1.26 + matrix: + - CMAKE_GENERATOR_NAME: "Visual Studio 14 2015" + - CMAKE_GENERATOR_NAME: "Visual Studio 14 2015 Win64" + install: - cd .. - choco install -y curl 7zip.commandline - - curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-10.0.20/source/mariadb-10.0.20.tar.gz - - 7z x mariadb-10.0.20.tar.gz - - 7z x mariadb-10.0.20.tar > nul - - cd mariadb-10.0.20 + - curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-%MARIADB_VERSION%/source/mariadb-%MARIADB_VERSION%.tar.gz + - 7z x mariadb-%MARIADB_VERSION%.tar.gz + - 7z x mariadb-%MARIADB_VERSION%.tar > nul + - cd mariadb-%MARIADB_VERSION% - rmdir /S /Q storage\mroonga\ - move ..\mroonga storage\mroonga - - git clone --quiet --depth 1 https://github.com/groonga/groonga.git ..\groonga - - cd ..\groonga - - git submodule update --init - - cd ..\mariadb-10.0.20 + - git clone --quiet --depth 1 --recursive https://github.com/groonga/groonga.git ..\groonga - rmdir /S /Q ..\groonga\test\ + - cd ..\groonga\vendor + - c:\Ruby22-x64\bin\ruby -v download_lz4.rb + - c:\Ruby22-x64\bin\ruby -v download_mecab.rb + - cd ..\..\mariadb-%MARIADB_VERSION% - 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" + - cmake . -G "%CMAKE_GENERATOR_NAME%" -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 + -DPLUGIN_ARCHIVE=NO + -DPLUGIN_BLACKHOLE=NO + -DPLUGIN_CASSANDRA=NO + -DPLUGIN_CONNECT=NO + -DPLUGIN_CSV=NO + -DPLUGIN_EXAMPLE=NO + -DPLUGIN_FEDERATED=NO + -DPLUGIN_FEDERATEDX=NO + -DPLUGIN_HEAP=NO + -DPLUGIN_INNOBASE=NO + -DPLUGIN_MYISAM=NO + -DPLUGIN_MYISAMMRG=NO + -DPLUGIN_OQGRAPH=NO + -DPLUGIN_PERFSCHEMA=NO + -DPLUGIN_SEQUENCE=NO + -DPLUGIN_SPHINX=NO + -DPLUGIN_SPIDER=NO + -DPLUGIN_TEST_SQL_DISCOVERY=NO + -DPLUGIN_TOKUDB=NO + -DPLUGIN_XTRADB=NO -DWITH_UNIT_TESTS=OFF + -DWITH_MARIABACKUP=OFF + -DGRN_WITH_BUNDLED_MECAB=ON - 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 diff --git a/storage/mroonga/autogen.sh b/storage/mroonga/autogen.sh index 7a1d38635d498..f795ad000ec2f 100755 --- a/storage/mroonga/autogen.sh +++ b/storage/mroonga/autogen.sh @@ -1,116 +1,11 @@ #!/bin/sh -warn() { - echo " WARNING: $@" 1>&2 -} - -# init - -LIBTOOLIZE=libtoolize -ACLOCAL=aclocal -AUTOCONF=autoconf -AUTOHEADER=autoheader -AUTOMAKE=automake - -case `uname -s` in -Darwin) - LIBTOOLIZE=glibtoolize - ;; +case $(uname -s) in FreeBSD) - ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/" - ;; + ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/" + ;; esac +mkdir -p m4 -# libtoolize -echo "Searching libtoolize..." -if [ `which $LIBTOOLIZE` ] ; then - echo " FOUND: libtoolize -> $LIBTOOLIZE" -else - warn "Cannot Found libtoolize... input libtool command" - read LIBTOOLIZE - LIBTOOLIZE=`which $LIBTOOLIZE` - if [ `which $LIBTOOLIZE` ] ; then - echo " SET: libtoolize -> $LIBTOOLIZE" - else - warn "$LIBTOOLIZE: Command not found." - exit 1; - fi -fi - -# aclocal -echo "Searching aclocal..." -if [ `which $ACLOCAL` ] ; then - echo " FOUND: aclocal -> $ACLOCAL" -else - warn "Cannot Found aclocal... input aclocal command" - read ACLOCAL - ACLOCAL=`which $ACLOCAL` - if [ `which $ACLOCAL` ] ; then - echo " SET: aclocal -> $ACLOCAL" - else - warn "$ACLOCAL: Command not found." - exit 1; - fi -fi - -# automake -echo "Searching automake..." -if [ `which $AUTOMAKE` ] ; then - echo " FOUND: automake -> $AUTOMAKE" -else - warn "Cannot Found automake... input automake command" - read AUTOMAKE - ACLOCAL=`which $AUTOMAKE` - if [ `which $AUTOMAKE` ] ; then - echo " SET: automake -> $AUTOMAKE" - else - warn "$AUTOMAKE: Command not found." - exit 1; - fi -fi - -# autoheader -echo "Searching autoheader..." -if [ `which $AUTOHEADER` ] ; then - echo " FOUND: autoheader -> $AUTOHEADER" -else - warn "Cannot Found autoheader... input autoheader command" - read AUTOHEADER - ACLOCAL=`which $AUTOHEADER` - if [ `which $AUTOHEADER` ] ; then - echo " SET: autoheader -> $AUTOHEADER" - else - warn "$AUTOHEADER: Command not found." - exit 1; - fi -fi - -# autoconf -echo "Searching autoconf..." -if [ `which $AUTOCONF` ] ; then - echo " FOUND: autoconf -> $AUTOCONF" -else - warn "Cannot Found autoconf... input autoconf command" - read AUTOCONF - ACLOCAL=`which $AUTOCONF` - if [ `which $AUTOCONF` ] ; then - echo " SET: autoconf -> $AUTOCONF" - else - warn "$AUTOCONF: Command not found." - exit 1; - fi -fi - -set -e - -echo "Running libtoolize ..." -$LIBTOOLIZE --force --copy -echo "Running aclocal ..." -$ACLOCAL ${ACLOCAL_ARGS} -echo "Running autoheader..." -$AUTOHEADER -echo "Running automake ..." -$AUTOMAKE --add-missing --copy -echo "Running autoconf ..." -$AUTOCONF +${AUTORECONF:-autoreconf} --force --install "$@" diff --git a/storage/mroonga/build/makefiles/sphinx-build.am b/storage/mroonga/build/makefiles/sphinx-build.am index e237377ba8033..57bbcd614e15d 100644 --- a/storage/mroonga/build/makefiles/sphinx-build.am +++ b/storage/mroonga/build/makefiles/sphinx-build.am @@ -10,10 +10,8 @@ PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR) -SPHINX_DIR = $(abs_top_builddir)/doc/sphinx SPHINX_BUILD_COMMAND = \ DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \ DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \ LOCALE="$(LOCALE)" \ - PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \ $(SPHINX_BUILD) diff --git a/storage/mroonga/config.sh.in b/storage/mroonga/config.sh.in index e86973bdf8812..32e88fd5c3dc0 100644 --- a/storage/mroonga/config.sh.in +++ b/storage/mroonga/config.sh.in @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_SOURCE_DIR="@MYSQL_SOURCE_DIR@" MYSQL_BUILD_DIR="@MYSQL_BUILD_DIR@" diff --git a/storage/mroonga/configure.ac b/storage/mroonga/configure.ac index f60b481e0ea23..b1e66904f75f2 100644 --- a/storage/mroonga/configure.ac +++ b/storage/mroonga/configure.ac @@ -8,6 +8,7 @@ m4_define([mrn_version_in_hex], m4_include(version_in_hex)) m4_define([mrn_plugin_version], m4_include(plugin_version)) AC_INIT([mroonga], [mrn_version], [groonga-talk@lists.sourceforge.net]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([tar-pax foreign subdir-objects]) @@ -173,18 +174,27 @@ AC_DEFUN([CONFIG_OPTION_MYSQL],[ MYSQL_INCLUDES="" MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/include" MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql" + if test -d "$ac_mysql_source_dir/sql/auth"; then + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql/auth" + fi 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 - mysql_regex_include_dir="$ac_mysql_source_dir/pcre" + if test -d "$ac_mysql_source_dir/extra/regex"; then + mysql_regex_include_dir="$ac_mysql_source_dir/extra/regex" + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$mysql_regex_include_dir" else - mysql_regex_include_dir="$ac_mysql_source_dir/regex" + if test -d "$ac_mysql_source_dir/pcre"; then + mysql_regex_include_dir="$ac_mysql_source_dir/pcre" + else + mysql_regex_include_dir="$ac_mysql_source_dir/regex" + fi + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$mysql_regex_include_dir" fi - MYSQL_INCLUDES="$MYSQL_INCLUDES -I$mysql_regex_include_dir" if test -d "$ac_mysql_source_dir/libbinlogevents"; then + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/libbinlogevents/include" MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/libbinlogevents/export" MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/libbinlogevents/include" fi @@ -199,7 +209,7 @@ AC_DEFUN([CONFIG_OPTION_MYSQL],[ MYSQL_CXXFLAGS="-fno-implicit-templates -felide-constructors" case "$MYSQL_MAJOR_MINOR_VERSION" in - 5.7) + 5.7|8.*) : ;; *) @@ -381,6 +391,13 @@ AC_ARG_WITH(rsync-path, [RSYNC_PATH="packages@packages.groonga.org:public"]) AC_SUBST(RSYNC_PATH) +AC_ARG_WITH(launchpad-ppa, + [AS_HELP_STRING([--with-launchpad-ppa=PPA], + [specify Launchpad Personal Package Archive. [default=groonga-ppa]])], + [LAUNCHPAD_PPA="$withval"], + [LAUNCHPAD_PPA="groonga-ppa"]) +AC_SUBST(LAUNCHPAD_PPA) + AC_ARG_WITH(launchpad-uploader-pgp-key, [AS_HELP_STRING([--with-launchpad-uploader-pgp-key=KEY], [specify PGP key UID to upload Groonga packages to Launchpad.])], @@ -429,7 +446,7 @@ if test x"$enable_document" != x"no"; then AC_PATH_PROG(SPHINX_BUILD, sphinx-build, []) if test -n "$SPHINX_BUILD"; then sphinx_build_version=`"$SPHINX_BUILD" --version` - if ! echo "$sphinx_build_version" | grep -q ' 1\.[[23]]'; then + if ! echo "$sphinx_build_version" | grep -q ' 1\.[[2-6]]'; then AC_MSG_ERROR([ sphinx-build is old: $sphinx_build_version Sphinx 1.2 or later is required.]) @@ -509,12 +526,19 @@ AC_OUTPUT([ mrn_version.h mysql-test/mroonga/storage/information_schema/r/plugins.result mysql-test/mroonga/storage/variable/r/version.result - packages/debian/control + packages/debian-5.5/control + packages/debian-5.6/control + packages/debian-5.7/control + packages/debian-mariadb-10.0/control packages/apt/env.sh packages/rpm/centos/mysql55-mroonga.spec packages/rpm/centos/mysql56-community-mroonga.spec + packages/rpm/centos/mysql57-community-mroonga.spec packages/rpm/centos/mariadb-mroonga.spec + packages/rpm/centos/mariadb-10.1-mroonga.spec + packages/rpm/centos/mariadb-10.2-mroonga.spec packages/rpm/centos/percona-server-56-mroonga.spec + packages/rpm/centos/percona-server-57-mroonga.spec packages/yum/env.sh data/install.sql ]) diff --git a/storage/mroonga/data/install.sql.in b/storage/mroonga/data/install.sql.in index b0c930c8144e4..d7d5f3c4ad6e0 100644 --- a/storage/mroonga/data/install.sql.in +++ b/storage/mroonga/data/install.sql.in @@ -17,3 +17,19 @@ CREATE FUNCTION mroonga_command RETURNS STRING DROP FUNCTION IF EXISTS mroonga_escape; CREATE FUNCTION mroonga_escape RETURNS STRING SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_snippet_html; +CREATE FUNCTION mroonga_snippet_html RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_normalize; +CREATE FUNCTION mroonga_normalize RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_highlight_html; +CREATE FUNCTION mroonga_highlight_html RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_query_expand; +CREATE FUNCTION mroonga_query_expand RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; diff --git a/storage/mroonga/data/uninstall.sql b/storage/mroonga/data/uninstall.sql index b79e6c03d1802..5713e07422432 100644 --- a/storage/mroonga/data/uninstall.sql +++ b/storage/mroonga/data/uninstall.sql @@ -2,6 +2,10 @@ DROP FUNCTION IF EXISTS last_insert_grn_id; DROP FUNCTION IF EXISTS mroonga_snippet; DROP FUNCTION IF EXISTS mroonga_command; DROP FUNCTION IF EXISTS mroonga_escape; +DROP FUNCTION IF EXISTS mroonga_snippet_html; +DROP FUNCTION IF EXISTS mroonga_normalize; +DROP FUNCTION IF EXISTS mroonga_highlight_html; +DROP FUNCTION IF EXISTS mroonga_query_expand; UNINSTALL PLUGIN Mroonga; diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 597ec4690cff0..96f506f9e3691 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -2,7 +2,7 @@ /* Copyright(C) 2010 Tetsuro IKEDA Copyright(C) 2010-2013 Kentoku SHIBA - Copyright(C) 2011-2015 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou Copyright(C) 2013 Kenji Maruyama This library is free software; you can redistribute it and/or @@ -66,14 +66,9 @@ # include #endif -#define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \ - type *variable_name = \ - (type *)mrn_my_malloc(sizeof(type) * (variable_size), MYF(MY_WME)) -#define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) \ - my_free(variable_name) - #include "mrn_err.h" #include "mrn_table.hpp" +#include #include "ha_mroonga.hpp" #include #include @@ -91,9 +86,17 @@ #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include #ifdef MRN_SUPPORT_FOREIGN_KEYS # include @@ -143,10 +146,18 @@ static mysql_mutex_t *mrn_LOCK_open; # define MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK #endif -#if MYSQL_VERSION_ID >= 50603 && !defined(MRN_MARIADB_P) -# define MRN_ORDER_IS_ASC(order) ((order)->direction == ORDER::ORDER_ASC) +#ifdef MRN_MARIADB_P +# if MYSQL_VERSION_ID >= 100200 +# define MRN_ORDER_IS_ASC(order) ((order)->direction == ORDER::ORDER_ASC) +# else +# define MRN_ORDER_IS_ASC(order) ((order)->asc) +# endif #else -# define MRN_ORDER_IS_ASC(order) ((order)->asc) +# if MYSQL_VERSION_ID >= 50603 +# define MRN_ORDER_IS_ASC(order) ((order)->direction == ORDER::ORDER_ASC) +# else +# define MRN_ORDER_IS_ASC(order) ((order)->asc) +# endif #endif #define MRN_STRINGIFY(macro_or_string) MRN_STRINGIFY_ARG(macro_or_string) @@ -199,22 +210,6 @@ static mysql_mutex_t *mrn_LOCK_open; calculate_key_len(table, key_index, buffer, keypart_map) #endif -#if MYSQL_VERSION_ID >= 50706 && !defined(MRN_MARIADB_P) -# define MRN_SELECT_LEX_GET_WHERE_COND(select_lex) \ - ((select_lex)->where_cond()) -# define MRN_SELECT_LEX_GET_HAVING_COND(select_lex) \ - ((select_lex)->having_cond()) -# define MRN_SELECT_LEX_GET_ACTIVE_OPTIONS(select_lex) \ - ((select_lex)->active_options()) -#else -# define MRN_SELECT_LEX_GET_WHERE_COND(select_lex) \ - ((select_lex)->where) -# define MRN_SELECT_LEX_GET_HAVING_COND(select_lex) \ - ((select_lex)->having) -# define MRN_SELECT_LEX_GET_ACTIVE_OPTIONS(select_lex) \ - ((select_lex)->options) -#endif - #if MYSQL_VERSION_ID >= 50706 && !defined(MRN_MARIADB_P) # define MRN_TABLE_LIST_GET_DERIVED(table_list) NULL #else @@ -249,10 +244,6 @@ static const char *MRN_PLUGIN_AUTHOR = "The Mroonga project"; extern "C" { #endif -/* groonga's internal functions */ -int grn_atoi(const char *nptr, const char *end, const char **rest); -uint grn_atoui(const char *nptr, const char *end, const char **rest); - #ifdef HAVE_PSI_INTERFACE # ifdef WIN32 # ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE @@ -266,18 +257,41 @@ static PSI_mutex_key mrn_allocated_thds_mutex_key; PSI_mutex_key mrn_share_mutex_key; PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key; static PSI_mutex_key mrn_log_mutex_key; +static PSI_mutex_key mrn_query_log_mutex_key; static PSI_mutex_key mrn_db_manager_mutex_key; +static PSI_mutex_key mrn_context_pool_mutex_key; +static PSI_mutex_key mrn_operations_mutex_key; + +# if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# define MRN_MUTEXT_INFO_ENTRY(key, name, flags, volatility) \ + {key, name, flags, volatility} +# else +# define MRN_MUTEXT_INFO_ENTRY(key, name, flags, volatility) \ + {key, name, flags} +# endif static PSI_mutex_info mrn_mutexes[] = { - {&mrn_open_tables_mutex_key, "open_tables", PSI_FLAG_GLOBAL}, - {&mrn_long_term_share_mutex_key, "long_term_share", PSI_FLAG_GLOBAL}, - {&mrn_allocated_thds_mutex_key, "allocated_thds", PSI_FLAG_GLOBAL}, - {&mrn_share_mutex_key, "share", 0}, - {&mrn_long_term_share_auto_inc_mutex_key, - "long_term_share::auto_inc", 0}, - {&mrn_log_mutex_key, "log", PSI_FLAG_GLOBAL}, - {&mrn_db_manager_mutex_key, "DatabaseManager", PSI_FLAG_GLOBAL} + MRN_MUTEXT_INFO_ENTRY(&mrn_open_tables_mutex_key, + "mrn::open_tables", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_long_term_share_mutex_key, + "mrn::long_term_share", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_allocated_thds_mutex_key, + "mrn::allocated_thds", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_share_mutex_key, + "mrn::share", 0, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_long_term_share_auto_inc_mutex_key, + "mrn::long_term_share::auto_inc", 0, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_log_mutex_key, + "mrn::log", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_query_log_mutex_key, + "mrn::query_log", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_db_manager_mutex_key, + "mrn::DatabaseManager", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_context_pool_mutex_key, + "mrn::ContextPool", PSI_FLAG_GLOBAL, 0), + MRN_MUTEXT_INFO_ENTRY(&mrn_operations_mutex_key, + "mrn::Operations", PSI_FLAG_GLOBAL, 0) }; #endif @@ -294,10 +308,14 @@ mysql_mutex_t mrn_allocated_thds_mutex; /* internal variables */ static grn_ctx mrn_ctx; static mysql_mutex_t mrn_log_mutex; +static mysql_mutex_t mrn_query_log_mutex; static grn_obj *mrn_db; static grn_ctx mrn_db_manager_ctx; static mysql_mutex_t mrn_db_manager_mutex; mrn::DatabaseManager *mrn_db_manager = NULL; +static mysql_mutex_t mrn_context_pool_mutex; +mrn::ContextPool *mrn_context_pool = NULL; +static mysql_mutex_t mrn_operations_mutex; #ifdef WIN32 @@ -539,6 +557,26 @@ static const char *mrn_inspect_extra_function(enum ha_extra_function operation) case HA_EXTRA_PREPARE_FOR_FORCED_CLOSE: inspected = "HA_EXTRA_PREPARE_FOR_FORCED_CLOSE"; break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_SKIP_SERIALIZABLE_DD_VIEW + case HA_EXTRA_SKIP_SERIALIZABLE_DD_VIEW: + inspected = "HA_EXTRA_SKIP_SERIALIZABLE_DD_VIEW"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_BEGIN_ALTER_COPY + case HA_EXTRA_BEGIN_ALTER_COPY: + inspected = "HA_EXTRA_BEGIN_ALTER_COPY"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_END_ALTER_COPY + case HA_EXTRA_END_ALTER_COPY: + inspected = "HA_EXTRA_END_ALTER_COPY"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_NO_AUTOINC_LOCKING + case HA_EXTRA_NO_AUTOINC_LOCKING: + inspected = "HA_EXTRA_NO_AUTOINC_LOCKING"; + break; #endif } return inspected; @@ -576,6 +614,7 @@ static FILE *mrn_log_file = NULL; static bool mrn_log_file_opened = false; static grn_log_level mrn_log_level_default = GRN_LOG_DEFAULT_LEVEL; static ulong mrn_log_level = mrn_log_level_default; +static char *mrn_query_log_file_path = NULL; char *mrn_default_tokenizer = NULL; char *mrn_default_wrapper_engine = NULL; @@ -583,16 +622,10 @@ static int mrn_lock_timeout = grn_get_lock_timeout(); static char *mrn_libgroonga_version = const_cast(grn_get_version()); static char *mrn_version = const_cast(MRN_VERSION); static char *mrn_vector_column_delimiter = NULL; -static my_bool mrn_libgroonga_support_zlib = FALSE; -static my_bool mrn_libgroonga_support_lz4 = FALSE; -typedef enum { - MRN_BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT = (1 << 0), - MRN_BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_QUERY = (1 << 1), - MRN_BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_SCRIPT = (1 << 2), - MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_COLUMN = (1 << 3), - MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_UPDATE = (1 << 4), - MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_LEADING_NOT = (1 << 5) -} mrn_boolean_mode_syntax_flag; +static mrn_bool mrn_libgroonga_support_zlib = false; +static mrn_bool mrn_libgroonga_support_lz4 = false; +static mrn_bool mrn_libgroonga_support_zstd = false; +static mrn_bool mrn_enable_operations_recording = true; #ifdef MRN_SUPPORT_THDVAR_SET static const char *mrn_boolean_mode_sytnax_flag_names[] = { "DEFAULT", @@ -611,28 +644,13 @@ static TYPELIB mrn_boolean_mode_syntax_flags_typelib = { }; #endif #ifdef MRN_GROONGA_EMBEDDED -static my_bool mrn_libgroonga_embedded = TRUE; +static mrn_bool mrn_libgroonga_embedded = true; #else -static my_bool mrn_libgroonga_embedded = FALSE; +static mrn_bool mrn_libgroonga_embedded = false; #endif -typedef enum { - MRN_ACTION_ON_ERROR_ERROR, - MRN_ACTION_ON_ERROR_ERROR_AND_LOG, - MRN_ACTION_ON_ERROR_IGNORE, - MRN_ACTION_ON_ERROR_IGNORE_AND_LOG, -} mrn_action_on_error; - -static const char *mrn_action_on_error_names[] = { - "ERROR", - "ERROR_AND_LOG", - "IGNORE", - "IGNORE_AND_LOG", - NullS, -}; - -static mrn_action_on_error mrn_action_on_fulltext_query_error_default = - MRN_ACTION_ON_ERROR_ERROR_AND_LOG; +static mrn::variables::ActionOnError mrn_action_on_fulltext_query_error_default = + mrn::variables::ACTION_ON_ERROR_ERROR_AND_LOG; static void mrn_logger_log(grn_ctx *ctx, grn_log_level level, const char *timestamp, const char *title, @@ -749,20 +767,19 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var, const char *new_value = *((const char **)save); char **old_value_ptr = (char **)var_ptr; - grn_ctx ctx; - grn_ctx_init(&ctx, 0); - mrn_change_encoding(&ctx, system_charset_info); + grn_ctx *ctx = &mrn_ctx; + mrn_change_encoding(ctx, system_charset_info); const char *new_log_file_name; new_log_file_name = *old_value_ptr; if (strcmp(*old_value_ptr, new_value) == 0) { - GRN_LOG(&ctx, GRN_LOG_NOTICE, + GRN_LOG(ctx, GRN_LOG_NOTICE, "log file isn't changed " "because the requested path isn't different: <%s>", new_value); } else { - GRN_LOG(&ctx, GRN_LOG_NOTICE, + GRN_LOG(ctx, GRN_LOG_NOTICE, "log file is changed: <%s> -> <%s>", *old_value_ptr, new_value); @@ -783,18 +800,18 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var, } if (log_file_open_errno == 0) { - GRN_LOG(&ctx, GRN_LOG_NOTICE, + GRN_LOG(ctx, GRN_LOG_NOTICE, "log file is changed: <%s> -> <%s>", *old_value_ptr, new_value); new_log_file_name = new_value; } else { if (mrn_log_file) { - GRN_LOG(&ctx, GRN_LOG_ERROR, + GRN_LOG(ctx, GRN_LOG_ERROR, "log file isn't changed " "because the requested path can't be opened: <%s>: <%s>", new_value, strerror(log_file_open_errno)); } else { - GRN_LOG(&ctx, GRN_LOG_ERROR, + GRN_LOG(ctx, GRN_LOG_ERROR, "log file can't be opened: <%s>: <%s>", new_value, strerror(log_file_open_errno)); } @@ -809,8 +826,6 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var, *old_value_ptr = mrn_my_strdup(new_log_file_name, MYF(MY_WME)); #endif - grn_ctx_fin(&ctx); - DBUG_VOID_RETURN; } @@ -821,23 +836,100 @@ static MYSQL_SYSVAR_STR(log_file, mrn_log_file_path, mrn_log_file_update, MRN_LOG_FILE_PATH); +static void mrn_query_log_file_update(THD *thd, struct st_mysql_sys_var *var, + void *var_ptr, const void *save) +{ + MRN_DBUG_ENTER_FUNCTION(); + const char *new_value = *((const char **)save); + char **old_value_ptr = (char **)var_ptr; + const char *normalized_new_value = NULL; + + grn_ctx *ctx = &mrn_ctx; + mrn_change_encoding(ctx, system_charset_info); + + const char *new_query_log_file_name; + new_query_log_file_name = *old_value_ptr; + + bool need_update = false; + if (!*old_value_ptr) { + if (new_value && new_value[0] != '\0') { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "query log is enabled: <%s>", + new_value); + need_update = true; + normalized_new_value = new_value; + } else { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "query log file is still disabled"); + } + } else { + if (!new_value || new_value[0] == '\0') { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "query log file is disabled: <%s>", + *old_value_ptr); + need_update = true; + normalized_new_value = NULL; + } else if (strcmp(*old_value_ptr, new_value) == 0) { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "query log file isn't changed " + "because the requested path isn't different: <%s>", + new_value); + } else { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "query log file is changed: <%s> -> <%s>", + *old_value_ptr, new_value); + need_update = true; + normalized_new_value = new_value; + } + } + + if (need_update) { + { // TODO: Remove me when Groonga 7.0.5 is released. + mrn::Lock lock(&mrn_query_log_mutex); + grn_default_query_logger_set_path(normalized_new_value); + } + grn_query_logger_reopen(ctx); + new_query_log_file_name = normalized_new_value; + } + +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + char *old_query_log_file_name = *old_value_ptr; +#endif + if (new_query_log_file_name) { + *old_value_ptr = mrn_my_strdup(new_query_log_file_name, MYF(0)); + } else { + *old_value_ptr = NULL; + } +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + my_free(old_query_log_file_name); +#endif + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_STR(query_log_file, mrn_query_log_file_path, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "query log file for " MRN_PLUGIN_NAME_STRING, + NULL, + mrn_query_log_file_update, + NULL); + static void mrn_default_tokenizer_update(THD *thd, struct st_mysql_sys_var *var, void *var_ptr, const void *save) { MRN_DBUG_ENTER_FUNCTION(); const char *new_value = *((const char **)save); char **old_value_ptr = (char **)var_ptr; - grn_ctx ctx; + grn_ctx *ctx = &mrn_ctx; - grn_ctx_init(&ctx, 0); - mrn_change_encoding(&ctx, system_charset_info); + mrn_change_encoding(ctx, system_charset_info); if (strcmp(*old_value_ptr, new_value) == 0) { - GRN_LOG(&ctx, GRN_LOG_NOTICE, + GRN_LOG(ctx, GRN_LOG_NOTICE, "default tokenizer for fulltext index isn't changed " "because the requested default tokenizer isn't different: <%s>", new_value); } else { - GRN_LOG(&ctx, GRN_LOG_NOTICE, + GRN_LOG(ctx, GRN_LOG_NOTICE, "default tokenizer for fulltext index is changed: <%s> -> <%s>", *old_value_ptr, new_value); } @@ -849,8 +941,6 @@ static void mrn_default_tokenizer_update(THD *thd, struct st_mysql_sys_var *var, *old_value_ptr = (char *)new_value; #endif - grn_ctx_fin(&ctx); - DBUG_VOID_RETURN; } @@ -956,6 +1046,14 @@ static MYSQL_SYSVAR_STR(default_wrapper_engine, mrn_default_wrapper_engine, NULL, NULL); +static const char *mrn_action_on_error_names[] = { + "ERROR", + "ERROR_AND_LOG", + "IGNORE", + "IGNORE_AND_LOG", + NullS, +}; + static TYPELIB mrn_action_on_error_typelib = { array_elements(mrn_action_on_error_names) - 1, @@ -1010,7 +1108,7 @@ static MYSQL_SYSVAR_STR(version, mrn_version, NULL, MRN_VERSION); -static my_bool grn_check_zlib_support() +static mrn_bool grn_check_zlib_support() { bool is_zlib_support = false; grn_obj grn_support_p; @@ -1023,7 +1121,14 @@ static my_bool grn_check_zlib_support() return is_zlib_support; } -static my_bool grn_check_lz4_support() +static MYSQL_SYSVAR_BOOL(libgroonga_support_zlib, mrn_libgroonga_support_zlib, + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, + "The status of libgroonga supports zlib", + NULL, + NULL, + grn_check_zlib_support()); + +static mrn_bool grn_check_lz4_support() { bool is_lz4_support = false; grn_obj grn_support_p; @@ -1036,19 +1141,51 @@ static my_bool grn_check_lz4_support() return is_lz4_support; } -static MYSQL_SYSVAR_BOOL(libgroonga_support_zlib, mrn_libgroonga_support_zlib, +static MYSQL_SYSVAR_BOOL(libgroonga_support_lz4, mrn_libgroonga_support_lz4, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, - "The status of libgroonga supports zlib", + "The status of libgroonga supports LZ4", NULL, NULL, - grn_check_zlib_support()); + grn_check_lz4_support()); -static MYSQL_SYSVAR_BOOL(libgroonga_support_lz4, mrn_libgroonga_support_lz4, +static mrn_bool grn_check_zstd_support() +{ + bool is_zstd_support = false; + grn_obj grn_support_p; + + GRN_BOOL_INIT(&grn_support_p, 0); + grn_obj_get_info(&mrn_ctx, NULL, GRN_INFO_SUPPORT_ZSTD, &grn_support_p); + is_zstd_support = (GRN_BOOL_VALUE(&grn_support_p)); + grn_obj_unlink(&mrn_ctx, &grn_support_p); + + return is_zstd_support; +} + +static MYSQL_SYSVAR_BOOL(libgroonga_support_zstd, mrn_libgroonga_support_zstd, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, - "The status of libgroonga supports LZ4", + "The status of libgroonga supports Zstandard", NULL, NULL, - grn_check_lz4_support()); + grn_check_zstd_support()); + +static void mrn_enable_operations_recording_update(THD *thd, struct st_mysql_sys_var *var, + void *var_ptr, const void *save) +{ + MRN_DBUG_ENTER_FUNCTION(); + const bool new_value = *static_cast(save); + bool *old_value_ptr = static_cast(var_ptr); + + *old_value_ptr = new_value; + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_BOOL(enable_operations_recording, mrn_enable_operations_recording, + PLUGIN_VAR_RQCMDARG, + "Whether recording operations for recovery is enabled or not", + NULL, + mrn_enable_operations_recording_update, + true); #ifdef MRN_SUPPORT_THDVAR_SET static MYSQL_THDVAR_SET(boolean_mode_syntax_flags, @@ -1060,7 +1197,7 @@ static MYSQL_THDVAR_SET(boolean_mode_syntax_flags, "ALLOW_COLUMN, ALLOW_UPDATE and ALLOW_LEADING_NOT", NULL, NULL, - MRN_BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT, + mrn::variables::BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT, &mrn_boolean_mode_syntax_flags_typelib); #endif @@ -1102,11 +1239,14 @@ static struct st_mysql_sys_var *mrn_system_variables[] = MYSQL_SYSVAR(vector_column_delimiter), MYSQL_SYSVAR(libgroonga_support_zlib), MYSQL_SYSVAR(libgroonga_support_lz4), + MYSQL_SYSVAR(libgroonga_support_zstd), #ifdef MRN_SUPPORT_THDVAR_SET MYSQL_SYSVAR(boolean_mode_syntax_flags), #endif MYSQL_SYSVAR(max_n_records_for_estimate), MYSQL_SYSVAR(libgroonga_embedded), + MYSQL_SYSVAR(query_log_file), + MYSQL_SYSVAR(enable_operations_recording), NULL }; @@ -1188,6 +1328,9 @@ struct st_mysql_plugin i_s_mrn_stats = "Statistics for " MRN_PLUGIN_NAME_STRING, PLUGIN_LICENSE_GPL, i_s_mrn_stats_init, +#ifdef MRN_ST_MYSQL_PLUGIN_HAVE_CHECK_UNINSTALL + NULL, +#endif i_s_mrn_stats_deinit, MRN_VERSION_IN_HEX, NULL, @@ -1196,7 +1339,12 @@ struct st_mysql_plugin i_s_mrn_stats = }; /* End of mroonga information schema implementations */ -static handler *mrn_handler_create(handlerton *hton, TABLE_SHARE *share, MEM_ROOT *root) +static handler *mrn_handler_create(handlerton *hton, + TABLE_SHARE *share, +#ifdef MRN_HANDLERTON_CREATE_HAVE_PARTITIONED + bool partitioned, +#endif + MEM_ROOT *root) { MRN_DBUG_ENTER_FUNCTION(); handler *new_handler = new (root) ha_mroonga(hton, share); @@ -1407,6 +1555,11 @@ static grn_builtin_type mrn_grn_type_from_field(grn_ctx *ctx, Field *field, case MYSQL_TYPE_GEOMETRY: // case-by-case type = GRN_DB_WGS84_GEO_POINT; // 8bytes break; +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + case MYSQL_TYPE_JSON: + type = GRN_DB_TEXT; + break; +#endif } return type; } @@ -1457,6 +1610,17 @@ static bool mrn_parse_grn_column_create_flags(THD *thd, "COMPRESS_LZ4"); } flag_names += 12; + } else if (rest_length >= 13 && !memcmp(flag_names, "COMPRESS_ZSTD", 13)) { + if (mrn_libgroonga_support_zstd) { + *column_flags |= GRN_OBJ_COMPRESS_ZSTD; + found = true; + } else { + push_warning_printf(thd, MRN_SEVERITY_WARNING, + ER_MRN_UNSUPPORTED_COLUMN_FLAG_NUM, + ER_MRN_UNSUPPORTED_COLUMN_FLAG_STR, + "COMPRESS_ZSTD"); + } + flag_names += 13; } else { char invalid_flag_name[MRN_MESSAGE_BUFFER_SIZE]; snprintf(invalid_flag_name, MRN_MESSAGE_BUFFER_SIZE, @@ -1477,7 +1641,7 @@ static bool mrn_parse_grn_index_column_flags(THD *thd, grn_ctx *ctx, const char *flag_names, uint flag_names_length, - grn_obj_flags *index_column_flags) + grn_column_flags *index_column_flags) { const char *flag_names_end = flag_names + flag_names_length; bool found = false; @@ -1504,6 +1668,14 @@ static bool mrn_parse_grn_index_column_flags(THD *thd, *index_column_flags |= GRN_OBJ_WITH_WEIGHT; flag_names += 11; found = true; + } else if (rest_length >= 11 && !memcmp(flag_names, "INDEX_SMALL", 11)) { + *index_column_flags |= GRN_OBJ_INDEX_SMALL; + flag_names += 11; + found = true; + } else if (rest_length >= 12 && !memcmp(flag_names, "INDEX_MEDIUM", 12)) { + *index_column_flags |= GRN_OBJ_INDEX_MEDIUM; + flag_names += 12; + found = true; } else { char invalid_flag_name[MRN_MESSAGE_BUFFER_SIZE]; snprintf(invalid_flag_name, MRN_MESSAGE_BUFFER_SIZE, @@ -1615,8 +1787,7 @@ static int mrn_init(void *p) { // init handlerton grn_ctx *ctx = NULL; - handlerton *hton; - hton = (handlerton *)p; + handlerton *hton = static_cast(p); hton->state = SHOW_OPTION_YES; hton->create = mrn_handler_create; hton->flags = HTON_NO_FLAGS; @@ -1671,7 +1842,7 @@ static int mrn_init(void *p) # endif #endif -#ifdef HAVE_PSI_INTERFACE +#ifdef MRN_HAVE_PSI_SERVER if (PSI_server) { const char *category = "mroonga"; int n_mutexes = array_elements(mrn_mutexes); @@ -1679,6 +1850,8 @@ static int mrn_init(void *p) } #endif + grn_default_query_logger_set_path(mrn_query_log_file_path); + if (grn_init() != GRN_SUCCESS) { goto err_grn_init; } @@ -1705,6 +1878,11 @@ static int mrn_init(void *p) MY_MUTEX_INIT_FAST) != 0) { goto err_log_mutex_init; } + if (mysql_mutex_init(mrn_query_log_mutex_key, + &mrn_query_log_mutex, + MY_MUTEX_INIT_FAST) != 0) { + goto err_query_log_mutex_init; + } mrn_logger.max_level = static_cast(mrn_log_level); grn_logger_set(ctx, &mrn_logger); @@ -1737,13 +1915,31 @@ static int mrn_init(void *p) if (!mrn_db_manager->init()) { goto err_db_manager_init; } + + if (mysql_mutex_init(mrn_context_pool_mutex_key, + &mrn_context_pool_mutex, + MY_MUTEX_INIT_FAST) != 0) { + GRN_LOG(ctx, GRN_LOG_ERROR, + "failed to initialize mutex for context pool"); + goto error_context_pool_mutex_init; + } + mrn_context_pool = new mrn::ContextPool(&mrn_context_pool_mutex); + + if (mysql_mutex_init(mrn_operations_mutex_key, + &mrn_operations_mutex, + MY_MUTEX_INIT_FAST) != 0) { + GRN_LOG(ctx, GRN_LOG_ERROR, + "failed to initialize mutex for operations"); + goto error_operations_mutex_init; + } + if ((mysql_mutex_init(mrn_allocated_thds_mutex_key, &mrn_allocated_thds_mutex, MY_MUTEX_INIT_FAST) != 0)) { goto err_allocated_thds_mutex_init; } - if (my_hash_init(&mrn_allocated_thds, system_charset_info, 32, 0, 0, - mrn_allocated_thds_get_key, 0, 0)) { + if (mrn_my_hash_init(&mrn_allocated_thds, system_charset_info, 32, 0, 0, + mrn_allocated_thds_get_key, 0, 0)) { goto error_allocated_thds_hash_init; } if ((mysql_mutex_init(mrn_open_tables_mutex_key, @@ -1751,8 +1947,8 @@ static int mrn_init(void *p) MY_MUTEX_INIT_FAST) != 0)) { goto err_allocated_open_tables_mutex_init; } - if (my_hash_init(&mrn_open_tables, system_charset_info, 32, 0, 0, - mrn_open_tables_get_key, 0, 0)) { + if (mrn_my_hash_init(&mrn_open_tables, system_charset_info, 32, 0, 0, + mrn_open_tables_get_key, 0, 0)) { goto error_allocated_open_tables_hash_init; } if ((mysql_mutex_init(mrn_long_term_share_mutex_key, @@ -1760,8 +1956,8 @@ static int mrn_init(void *p) MY_MUTEX_INIT_FAST) != 0)) { goto error_allocated_long_term_share_mutex_init; } - if (my_hash_init(&mrn_long_term_share, system_charset_info, 32, 0, 0, - mrn_long_term_share_get_key, 0, 0)) { + if (mrn_my_hash_init(&mrn_long_term_share, system_charset_info, 32, 0, 0, + mrn_long_term_share_get_key, 0, 0)) { goto error_allocated_long_term_share_hash_init; } @@ -1782,6 +1978,11 @@ static int mrn_init(void *p) error_allocated_thds_hash_init: mysql_mutex_destroy(&mrn_allocated_thds_mutex); err_allocated_thds_mutex_init: + mysql_mutex_destroy(&mrn_operations_mutex); +error_operations_mutex_init: + delete mrn_context_pool; + mysql_mutex_destroy(&mrn_context_pool_mutex); +error_context_pool_mutex_init: err_db_manager_init: delete mrn_db_manager; mysql_mutex_destroy(&mrn_db_manager_mutex); @@ -1794,6 +1995,8 @@ static int mrn_init(void *p) mrn_log_file_opened = false; } err_log_file_open: + mysql_mutex_destroy(&mrn_query_log_mutex); +err_query_log_mutex_init: mysql_mutex_destroy(&mrn_log_mutex); err_log_mutex_init: err_mrn_change_encoding: @@ -1838,6 +2041,9 @@ static int mrn_deinit(void *p) mysql_mutex_destroy(&mrn_open_tables_mutex); my_hash_free(&mrn_allocated_thds); mysql_mutex_destroy(&mrn_allocated_thds_mutex); + mysql_mutex_destroy(&mrn_operations_mutex); + delete mrn_context_pool; + mysql_mutex_destroy(&mrn_context_pool_mutex); delete mrn_db_manager; mysql_mutex_destroy(&mrn_db_manager_mutex); grn_ctx_fin(&mrn_db_manager_ctx); @@ -1850,6 +2056,7 @@ static int mrn_deinit(void *p) fclose(mrn_log_file); mrn_log_file_opened = false; } + mysql_mutex_destroy(&mrn_query_log_mutex); mysql_mutex_destroy(&mrn_log_mutex); return 0; @@ -2336,7 +2543,8 @@ ha_mroonga::ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg) ignoring_no_key_columns(false), replacing_(false), written_by_row_based_binlog(0), - current_ft_item(NULL) + current_ft_item(NULL), + operations_(NULL) { MRN_DBUG_ENTER_METHOD(); grn_ctx_init(ctx, 0); @@ -2355,6 +2563,9 @@ ha_mroonga::ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg) ha_mroonga::~ha_mroonga() { MRN_DBUG_ENTER_METHOD(); + + delete operations_; + if (analyzed_for_create) { if (wrap_handler_for_create) { delete wrap_handler_for_create; @@ -2619,6 +2830,12 @@ ulonglong ha_mroonga::wrapper_table_flags() const #endif #ifdef HA_CAN_FULLTEXT_EXT table_flags |= HA_CAN_FULLTEXT_EXT; +#endif +#ifdef HA_GENERATED_COLUMNS + table_flags |= HA_GENERATED_COLUMNS; +#endif +#ifdef HA_CAN_VIRTUAL_COLUMNS + table_flags |= HA_CAN_VIRTUAL_COLUMNS; #endif DBUG_RETURN(table_flags); } @@ -2648,6 +2865,12 @@ ulonglong ha_mroonga::storage_table_flags() const #endif #ifdef HA_CAN_FULLTEXT_EXT flags |= HA_CAN_FULLTEXT_EXT; +#endif +#ifdef HA_GENERATED_COLUMNS + flags |= HA_GENERATED_COLUMNS; +#endif +#ifdef HA_CAN_VIRTUAL_COLUMNS + flags |= HA_CAN_VIRTUAL_COLUMNS; #endif DBUG_RETURN(flags); } @@ -2713,7 +2936,7 @@ ulong ha_mroonga::storage_index_flags(uint idx, uint part, bool all_parts) const part = 0; } Field *field = &(key->key_part[part].field[0]); - if (field && should_normalize(field)) { + if (field && (have_custom_normalizer(key) || should_normalize(field))) { need_normalize_p = true; } if (!need_normalize_p) { @@ -2737,7 +2960,7 @@ ulong ha_mroonga::index_flags(uint idx, uint part, bool all_parts) const DBUG_RETURN(HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); } if (mrn_is_geo_key(key)) { - DBUG_RETURN(HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); + DBUG_RETURN(HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR | HA_READ_RANGE); } int error = 0; @@ -2854,9 +3077,11 @@ int ha_mroonga::wrapper_create(const char *name, TABLE *table, DBUG_RETURN(ER_REQUIRES_PRIMARY_KEY); } - mrn::PathMapper mapper(name); - error = wrapper_create_index(name, table, info, tmp_share, - mapper.table_name()); + error = ensure_database_open(name); + if (error) + DBUG_RETURN(error); + + error = wrapper_create_index(name, table, tmp_share); if (error) DBUG_RETURN(error); @@ -2904,6 +3129,7 @@ int ha_mroonga::wrapper_create(const char *name, TABLE *table, delete hnd; if (error) { + mrn::PathMapper mapper(name); generic_delete_table(name, mapper.table_name()); } @@ -2967,7 +3193,7 @@ int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name, GRN_OBJ_PERSISTENT; grn_obj *index_table; - grn_obj_flags index_column_flags = GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; + grn_column_flags index_column_flags = GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; if (!find_index_column_flags(key_info, &index_column_flags)) { index_column_flags |= GRN_OBJ_WITH_POSITION; @@ -3014,7 +3240,8 @@ int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name, grn_obj_unlink(ctx, &token_filters); } - if (should_normalize(&key_info->key_part->field[0])) { + if (have_custom_normalizer(key_info) || + should_normalize(&key_info->key_part->field[0])) { grn_info_type info_type = GRN_INFO_NORMALIZER; grn_obj *normalizer = find_normalizer(key_info); if (normalizer) { @@ -3103,22 +3330,18 @@ int ha_mroonga::wrapper_create_index_geo(const char *grn_table_name, } int ha_mroonga::wrapper_create_index(const char *name, TABLE *table, - HA_CREATE_INFO *info, - MRN_SHARE *tmp_share, - const char *grn_table_name) + MRN_SHARE *tmp_share) { MRN_DBUG_ENTER_METHOD(); int error = 0; - error = ensure_database_open(name); - if (error) - DBUG_RETURN(error); - error = mrn_change_encoding(ctx, system_charset_info); if (error) DBUG_RETURN(error); grn_obj *grn_index_table; + mrn::PathMapper mapper(name); + const char *grn_table_name = mapper.table_name(); char *grn_table_path = NULL; // we don't specify path grn_obj *pkey_type = grn_ctx_at(ctx, GRN_DB_SHORT_TEXT); grn_obj *pkey_value_type = NULL; // we don't use this @@ -3307,10 +3530,9 @@ int ha_mroonga::storage_create(const char *name, TABLE *table, uint n_columns = table->s->fields; for (uint i = 0; i < n_columns; i++) { Field *field = table->s->field[i]; - const char *column_name = field->field_name; - int column_name_size = strlen(column_name); + mrn::ColumnName column_name(field->field_name); - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (strcmp(MRN_COLUMN_NAME_ID, column_name.mysql_name()) == 0) { continue; } @@ -3325,6 +3547,12 @@ int ha_mroonga::storage_create(const char *name, TABLE *table, } #endif +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif + grn_obj_flags col_flags = GRN_OBJ_PERSISTENT; if (!find_column_flags(field, tmp_share, i, &col_flags)) { col_flags |= GRN_OBJ_COLUMN_SCALAR; @@ -3341,12 +3569,13 @@ int ha_mroonga::storage_create(const char *name, TABLE *table, } char *col_path = NULL; // we don't specify path - grn_column_create(ctx, table_obj, column_name, column_name_size, + grn_column_create(ctx, table_obj, + column_name.c_str(), column_name.length(), col_path, col_flags, col_type); if (ctx->rc) { - grn_obj_remove(ctx, table_obj); error = ER_CANT_CREATE_TABLE; my_message(error, ctx->errbuf, MYF(0)); + grn_obj_remove(ctx, table_obj); DBUG_RETURN(error); } } @@ -3484,7 +3713,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, if (!grn_table_ref) { error = ER_CANT_CREATE_TABLE; char err_msg[MRN_BUFFER_SIZE]; - sprintf(err_msg, "refference table [%s.%s] is not mroonga table", + sprintf(err_msg, "reference table [%s.%s] is not mroonga table", table->s->db.str, ref_table_name.str); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); @@ -3503,7 +3732,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, grn_obj_unlink(ctx, grn_table_ref); error = ER_CANT_CREATE_TABLE; char err_msg[MRN_BUFFER_SIZE]; - sprintf(err_msg, "refference table [%s.%s] is not found", + sprintf(err_msg, "reference table [%s.%s] is not found", table->s->db.str, ref_table_name.str); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); @@ -3516,7 +3745,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, grn_obj_unlink(ctx, grn_table_ref); error = ER_CANT_CREATE_TABLE; char err_msg[MRN_BUFFER_SIZE]; - sprintf(err_msg, "refference table [%s.%s] has no primary key", + sprintf(err_msg, "reference table [%s.%s] has no primary key", table->s->db.str, ref_table_name.str); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); @@ -3531,7 +3760,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, error = ER_CANT_CREATE_TABLE; char err_msg[MRN_BUFFER_SIZE]; sprintf(err_msg, - "refference table [%s.%s] primary key is multiple column", + "reference table [%s.%s] primary key is multiple column", table->s->db.str, ref_table_name.str); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); @@ -3545,7 +3774,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, error = ER_CANT_CREATE_TABLE; char err_msg[MRN_BUFFER_SIZE]; sprintf(err_msg, - "refference column [%s.%s.%s] is not used for primary key", + "reference column [%s.%s.%s] is not used for primary key", table->s->db.str, ref_table_name.str, ref_field_name.str); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); @@ -3721,11 +3950,14 @@ int ha_mroonga::storage_create_index_table(TABLE *table, grn_obj *normalizer = NULL; Field *field = &(key_info->key_part->field[0]); if (key_info->flags & HA_FULLTEXT) { - if (should_normalize(field)) { + if (have_custom_normalizer(key_info) || + should_normalize(field)) { normalizer = find_normalizer(key_info); } } else if (key_alg != HA_KEY_ALG_HASH) { - if (!is_multiple_column_index && should_normalize(field)) { + if (!is_multiple_column_index && + (have_custom_normalizer(key_info) || + should_normalize(field))) { normalizer = find_normalizer(key_info); } } @@ -3748,19 +3980,48 @@ int ha_mroonga::storage_create_index(TABLE *table, const char *grn_table_name, { MRN_DBUG_ENTER_METHOD(); int error = 0; - grn_obj *index_table, *index_column; - const char *column_name = NULL; - int column_name_size = 0; + grn_obj *index_column; bool is_multiple_column_index = KEY_N_KEY_PARTS(key_info) > 1; if (!is_multiple_column_index) { Field *field = key_info->key_part[0].field; - column_name = field->field_name; - column_name_size = strlen(column_name); - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (strcmp(MRN_COLUMN_NAME_ID, field->field_name) == 0) { // skipping _id virtual column DBUG_RETURN(0); } + + if (is_foreign_key_field(table->s->table_name.str, + field->field_name)) { + DBUG_RETURN(0); + } + +#ifdef HA_CAN_VIRTUAL_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: storage: failed to create index: " + ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_STR, + field->field_name); + error = ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_NUM; + my_message(error, error_message, MYF(0)); + DBUG_RETURN(error); + } + } else { + int j, n_key_parts = KEY_N_KEY_PARTS(key_info); + for (j = 0; j < n_key_parts; j++) { + Field *field = key_info->key_part[j].field; + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: storage: failed to create index: " + ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_STR, + field->field_name); + error = ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_NUM; + my_message(error, error_message, MYF(0)); + DBUG_RETURN(error); + } + } +#endif } error = mrn_change_encoding(ctx, system_charset_info); @@ -3773,16 +4034,21 @@ int ha_mroonga::storage_create_index(TABLE *table, const char *grn_table_name, if (error) DBUG_RETURN(error); - grn_obj_flags index_column_flags = GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; + grn_obj *index_table = index_tables[i]; + + grn_column_flags index_column_flags = GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; if (!find_index_column_flags(key_info, &index_column_flags)) { - index_column_flags |= GRN_OBJ_WITH_POSITION; - if (is_multiple_column_index) { + grn_obj *tokenizer = grn_obj_get_info(ctx, index_table, + GRN_INFO_DEFAULT_TOKENIZER, NULL); + if (tokenizer) { + index_column_flags |= GRN_OBJ_WITH_POSITION; + } + if (is_multiple_column_index && (key_info->flags & HA_FULLTEXT)) { index_column_flags |= GRN_OBJ_WITH_SECTION; } } - index_table = index_tables[i]; const char *index_column_name; if (tmp_share->index_table && tmp_share->index_table[i]) { index_column_name = key_info->name; @@ -3813,10 +4079,11 @@ int ha_mroonga::storage_create_index(TABLE *table, const char *grn_table_name, int j, n_key_parts = KEY_N_KEY_PARTS(key_info); for (j = 0; j < n_key_parts; j++) { Field *field = key_info->key_part[j].field; - const char *column_name = field->field_name; - int column_name_size = strlen(column_name); - grn_obj *source_column = grn_obj_column(ctx, grn_table, - column_name, column_name_size); + mrn::ColumnName column_name(field->field_name); + grn_obj *source_column = grn_obj_column(ctx, + grn_table, + column_name.c_str(), + column_name.length()); grn_id source_id = grn_obj_id(ctx, source_column); GRN_UINT32_PUT(ctx, &source_ids, source_id); grn_obj_unlink(ctx, source_column); @@ -3826,8 +4093,13 @@ int ha_mroonga::storage_create_index(TABLE *table, const char *grn_table_name, grn_obj_unlink(ctx, &source_ids); } } else { + Field *field = key_info->key_part[0].field; + mrn::ColumnName column_name(field->field_name); grn_obj *column; - column = grn_obj_column(ctx, grn_table, column_name, column_name_size); + column = grn_obj_column(ctx, + grn_table, + column_name.c_str(), + column_name.length()); if (column) { grn_obj source_ids; grn_id source_id = grn_obj_id(ctx, column); @@ -3887,18 +4159,31 @@ int ha_mroonga::storage_create_indexes(TABLE *table, const char *grn_table_name, DBUG_RETURN(error); } -int ha_mroonga::ensure_database_open(const char *name) +int ha_mroonga::ensure_database_open(const char *name, mrn::Database **db) { int error; MRN_DBUG_ENTER_METHOD(); - grn_obj *db; - error = mrn_db_manager->open(name, &db); + if (db) + *db = NULL; + + mrn::Database *local_db; + error = mrn_db_manager->open(name, &local_db); if (error) DBUG_RETURN(error); - grn_ctx_use(ctx, db); + if (db) + *db = local_db; + grn_ctx_use(ctx, local_db->get()); + + delete operations_; + operations_ = new mrn::Operations(ctx); + if (mrn_enable_operations_recording) { + operations_->enable_recording(); + } else { + operations_->disable_recording(); + } DBUG_RETURN(error); } @@ -3913,6 +4198,9 @@ int ha_mroonga::ensure_database_remove(const char *name) if (error) DBUG_RETURN(error); + delete operations_; + operations_ = NULL; + mrn_db_manager->close(name); mrn::PathMapper mapper(name); @@ -3922,7 +4210,14 @@ int ha_mroonga::ensure_database_remove(const char *name) } -int ha_mroonga::create(const char *name, TABLE *table, HA_CREATE_INFO *info) +int ha_mroonga::create(const char *name, + TABLE *table, + HA_CREATE_INFO *info +#ifdef MRN_HANDLER_CREATE_HAVE_TABLE_DEFINITION + , + dd::Table *table_def +#endif + ) { int error = 0; MRN_SHARE *tmp_share; @@ -3954,26 +4249,17 @@ int ha_mroonga::create(const char *name, TABLE *table, HA_CREATE_INFO *info) DBUG_RETURN(error); } -int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked) +int ha_mroonga::wrapper_open(const char *name, int mode, uint open_options) { int error = 0; MRN_DBUG_ENTER_METHOD(); - if (thd_sql_command(ha_thd()) == SQLCOM_REPAIR) { - error = ensure_database_remove(name); - if (error) - DBUG_RETURN(error); - error = ensure_database_open(name); - if (error) - DBUG_RETURN(error); - grn_table = NULL; - grn_index_tables = NULL; - grn_index_columns = NULL; - } else { - error = ensure_database_open(name); - if (error) - DBUG_RETURN(error); + mrn::Database *db = NULL; + error = ensure_database_open(name, &db); + if (error) + DBUG_RETURN(error); + if (!(open_options & HA_OPEN_FOR_REPAIR)) { error = open_table(name); if (error) DBUG_RETURN(error); @@ -4012,7 +4298,7 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked) #ifdef MRN_HANDLER_HAVE_SET_HA_SHARE_REF wrap_handler->set_ha_share_ref(&table->s->ha_share); #endif - error = wrap_handler->ha_open(table, name, mode, test_if_locked); + error = wrap_handler->ha_open(table, name, mode, open_options); } else { if (!(wrap_handler = parent_for_clone->wrap_handler->clone(name, mem_root_for_clone))) @@ -4039,6 +4325,39 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked) pk_keypart_map = make_prev_keypart_map( KEY_N_KEY_PARTS(&(table->key_info[table_share->primary_key]))); + if (!error) { + if (open_options & HA_OPEN_FOR_REPAIR) { + // TODO: How to check whether is DISABLE KEYS used or not? + error = wrapper_recreate_indexes(ha_thd()); + } else if (db) { + mrn::Lock lock(&mrn_operations_mutex); + mrn::PathMapper mapper(name); + const char *table_name = mapper.table_name(); + size_t table_name_size = strlen(table_name); + if (db->is_broken_table(table_name, table_name_size)) { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "Auto repair is started: <%s>", + name); + error = operations_->clear(table_name, table_name_size); + if (!error) { + db->mark_table_repaired(table_name, table_name_size); + if (!share->disable_keys) { + // TODO: implemented by "reindex" instead of "remove and recreate". + // Because "remove and recreate" invalidates opened indexes by + // other threads. + error = wrapper_disable_indexes_mroonga(HA_KEY_SWITCH_ALL); + if (!error) { + error = wrapper_enable_indexes_mroonga(HA_KEY_SWITCH_ALL); + } + } + } + GRN_LOG(ctx, GRN_LOG_NOTICE, + "Auto repair is done: <%s>: %s", + name, error == 0 ? "success" : "failure"); + } + } + } + if (error) { grn_obj_unlink(ctx, grn_table); @@ -4098,6 +4417,11 @@ int ha_mroonga::wrapper_open_indexes(const char *name) grn_index_tables[i] = grn_ctx_get(ctx, index_table_name.c_str(), index_table_name.length()); + if (ctx->rc == GRN_SUCCESS && !grn_index_tables[i]) { + grn_index_tables[i] = grn_ctx_get(ctx, + index_table_name.old_c_str(), + index_table_name.old_length()); + } if (ctx->rc) { DBUG_PRINT("info", ("mroonga: sql_command=%u", thd_sql_command(ha_thd()))); @@ -4160,8 +4484,16 @@ void ha_mroonga::wrapper_overwrite_index_bits() { Field *field = table_share->field[i]; field->part_of_key.clear_all(); +#ifdef MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED field->part_of_key_not_clustered.clear_all(); +#endif field->part_of_sortkey.clear_all(); + /* + TODO: We may need to update field->part_of_key_not_extended for + MySQL >= 5.7.18. If users report "raw InnoDB can use index for + this case but Mroonga wrapper mode for InnoDB can't use index + for the same case", we'll reconsider it again. + */ } for (i = 0; i < table_share->keys; i++) { KEY *key_info = &table->s->key_info[i]; @@ -4176,7 +4508,9 @@ void ha_mroonga::wrapper_overwrite_index_bits() { table_share->keys_for_keyread.set_bit(i); field->part_of_key.set_bit(i); +#ifdef MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED field->part_of_key_not_clustered.set_bit(i); +#endif } if (index_flags(i, j, 1) & HA_READ_ORDER) field->part_of_sortkey.set_bit(i); @@ -4195,12 +4529,93 @@ void ha_mroonga::wrapper_overwrite_index_bits() DBUG_VOID_RETURN; } -int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked) +int ha_mroonga::storage_reindex() { int error = 0; MRN_DBUG_ENTER_METHOD(); - error = ensure_database_open(name); + uint n_keys = table_share->keys; + KEY *key_info = table->key_info; + + bool have_multiple_column_index = false; + bitmap_clear_all(table->read_set); + for (uint i = 0; i < n_keys; ++i) { + if (!grn_index_columns[i]) + continue; + + grn_hash *columns = grn_hash_create(ctx, NULL, sizeof(grn_id), 0, + GRN_OBJ_TABLE_HASH_KEY); + grn_table_columns(ctx, grn_index_tables[i], NULL, 0, + reinterpret_cast(columns)); + unsigned int n_columns = + grn_table_size(ctx, reinterpret_cast(columns)); + grn_hash_close(ctx, columns); + + bool is_multiple_column_index = + (KEY_N_KEY_PARTS(&(key_info[i])) != 1 && + !(key_info[i].flags & HA_FULLTEXT)); + + if (n_columns == 1 || is_multiple_column_index) { + grn_table_truncate(ctx, grn_index_tables[i]); + if (ctx->rc != GRN_SUCCESS) { + error = ER_ERROR_ON_WRITE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + char index_table_name[GRN_TABLE_MAX_KEY_SIZE]; + int index_table_name_size; + index_table_name_size = + grn_obj_name(ctx, grn_index_tables[i], + index_table_name, GRN_TABLE_MAX_KEY_SIZE); + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: reindex: failed to truncate index table: " + "<%.*s>: <%s>(%d)", + index_table_name_size, index_table_name, + ctx->errbuf, ctx->rc); + my_message(error, error_message, MYF(0)); + break; + } + } + + if (is_multiple_column_index) { + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); + have_multiple_column_index = true; + } else { + grn_obj_reindex(ctx, grn_index_columns[i]); + if (ctx->rc != GRN_SUCCESS) { + error = ER_ERROR_ON_WRITE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + char index_column_name[GRN_TABLE_MAX_KEY_SIZE]; + int index_column_name_size; + index_column_name_size = + grn_obj_name(ctx, grn_index_columns[i], + index_column_name, GRN_TABLE_MAX_KEY_SIZE); + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: reindex: failed to reindex: " + "<%.*s>: <%s>(%d)", + index_column_name_size, index_column_name, + ctx->errbuf, ctx->rc); + my_message(error, error_message, MYF(0)); + break; + } + } + } + + if (!error && have_multiple_column_index) + error = storage_add_index_multiple_columns(key_info, n_keys, + grn_index_tables, + grn_index_columns, + false); + bitmap_set_all(table->read_set); + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_open(const char *name, int mode, uint open_options) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + + mrn::Database *db; + error = ensure_database_open(name, &db); if (error) DBUG_RETURN(error); @@ -4215,19 +4630,38 @@ int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked) DBUG_RETURN(error); } - if (!(ha_thd()->open_options & HA_OPEN_FOR_REPAIR)) { + if (!(open_options & HA_OPEN_FOR_REPAIR)) { error = storage_open_indexes(name); if (error) { + storage_close_columns(); grn_obj_unlink(ctx, grn_table); grn_table = NULL; - // TODO: unlink elements - free(grn_columns); - // TODO: unlink elements - free(grn_column_ranges); DBUG_RETURN(error); } storage_set_keys_in_use(); + + { + mrn::Lock lock(&mrn_operations_mutex); + mrn::PathMapper mapper(name); + const char *table_name = mapper.table_name(); + size_t table_name_size = strlen(table_name); + if (db->is_broken_table(table_name, table_name_size)) { + GRN_LOG(ctx, GRN_LOG_NOTICE, + "Auto repair is started: <%s>", + name); + error = operations_->repair(table_name, table_name_size); + if (!error) + db->mark_table_repaired(table_name, table_name_size); + if (!share->disable_keys) { + if (!error) + error = storage_reindex(); + } + GRN_LOG(ctx, GRN_LOG_NOTICE, + "Auto repair is done: <%s>: %s", + name, error == 0 ? "success" : "failure"); + } + } } ref_length = sizeof(grn_id); @@ -4294,18 +4728,26 @@ int ha_mroonga::storage_open_columns(void) for (int i = 0; i < n_columns; i++) { Field *field = table->field[i]; - const char *column_name = field->field_name; - int column_name_size = strlen(column_name); + mrn::ColumnName column_name(field->field_name); if (table_share->blob_fields) { blob_buffers[i].set_charset(field->charset()); } - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (strcmp(MRN_COLUMN_NAME_ID, column_name.mysql_name()) == 0) { continue; } +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + grn_columns[i] = NULL; + grn_column_ranges[i] = NULL; + continue; + } +#endif - grn_columns[i] = grn_obj_column(ctx, grn_table, - column_name, column_name_size); + grn_columns[i] = grn_obj_column(ctx, + grn_table, + column_name.c_str(), + column_name.length()); if (!grn_columns[i]) { error = ER_CANT_OPEN_FILE; my_message(error, ctx->errbuf, MYF(0)); @@ -4322,25 +4764,31 @@ int ha_mroonga::storage_open_columns(void) } if (error != 0) { - for (int i = 0; i < n_columns; i++) { - grn_obj *column = grn_columns[i]; - if (column) { - grn_obj_unlink(ctx, column); - } + storage_close_columns(); + } - grn_obj *range = grn_column_ranges[i]; - if (range) { - grn_obj_unlink(ctx, range); - } + DBUG_RETURN(error); +} + +void ha_mroonga::storage_close_columns(void) +{ + int n_columns = table->s->fields; + for (int i = 0; i < n_columns; i++) { + grn_obj *column = grn_columns[i]; + if (column) { + grn_obj_unlink(ctx, column); } - free(grn_columns); - grn_columns = NULL; - free(grn_column_ranges); - grn_column_ranges = NULL; + grn_obj *range = grn_column_ranges[i]; + if (range) { + grn_obj_unlink(ctx, range); + } } - DBUG_RETURN(error); + free(grn_columns); + grn_columns = NULL; + free(grn_column_ranges); + grn_column_ranges = NULL; } int ha_mroonga::storage_open_indexes(const char *name) @@ -4400,6 +4848,11 @@ int ha_mroonga::storage_open_indexes(const char *name) grn_index_tables[i] = grn_ctx_get(ctx, index_table_name.c_str(), index_table_name.length()); + if (ctx->rc == GRN_SUCCESS && !grn_index_tables[i]) { + grn_index_tables[i] = grn_ctx_get(ctx, + index_table_name.old_c_str(), + index_table_name.old_length()); + } if (ctx->rc == GRN_SUCCESS) { grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i], @@ -4458,7 +4911,14 @@ int ha_mroonga::storage_open_indexes(const char *name) DBUG_RETURN(error); } -int ha_mroonga::open(const char *name, int mode, uint test_if_locked) +int ha_mroonga::open(const char *name, + int mode, + uint open_options +#ifdef MRN_HANDLER_OPEN_HAVE_TABLE_DEFINITION + , + const dd::Table *table_def +#endif + ) { int error = 0; MRN_DBUG_ENTER_METHOD(); @@ -4476,9 +4936,9 @@ int ha_mroonga::open(const char *name, int mode, uint test_if_locked) if (share->wrapper_mode) { - error = wrapper_open(name, mode, test_if_locked); + error = wrapper_open(name, mode, open_options); } else { - error = storage_open(name, mode, test_if_locked); + error = storage_open(name, mode, open_options); } if (error) @@ -4546,7 +5006,10 @@ int ha_mroonga::close() DBUG_RETURN(error); } - error = add_wrap_hton(share->table_name, share->hton); + if (thd) + { + error = add_wrap_hton(share->table_name, share->hton); + } bitmap_free(&multiple_column_key_bitmap); if (share->use_count == 1) { mrn_free_long_term_share(share->long_term_share); @@ -4605,7 +5068,7 @@ int ha_mroonga::generic_delete_table(const char *name, const char *table_name) error = drop_indexes(table_name); grn_obj *table_obj = grn_ctx_get(ctx, table_name, strlen(table_name)); - if (!ctx->rc) { + if (table_obj) { grn_obj_remove(ctx, table_obj); } if (ctx->rc) { @@ -4648,6 +5111,46 @@ int ha_mroonga::delete_table(const char *name) } } + if (!wrap_handlerton) { + bool open_table_to_get_wrap_handlerton = true; + if (mapper.is_internal_table_name()) { + open_table_to_get_wrap_handlerton = false; + } + if (open_table_to_get_wrap_handlerton) { + TABLE_LIST table_list; + table_list.init_one_table(mapper.db_name(), strlen(mapper.db_name()), + mapper.mysql_table_name(), + strlen(mapper.mysql_table_name()), + mapper.mysql_table_name(), + TL_WRITE); + mrn_open_mutex_lock(NULL); + TABLE_SHARE *tmp_table_share = + mrn_create_tmp_table_share(&table_list, name, &error); + error = 0; + mrn_open_mutex_unlock(NULL); + if (tmp_table_share) { + TABLE tmp_table; + tmp_table.s = tmp_table_share; +#ifdef WITH_PARTITION_STORAGE_ENGINE + tmp_table.part_info = NULL; +#endif + MRN_SHARE *tmp_share = mrn_get_share(name, &tmp_table, &error); + if (tmp_share) { + wrap_handlerton = tmp_share->hton; + mrn_free_long_term_share(tmp_share->long_term_share); + tmp_share->long_term_share = NULL; + mrn_free_share(tmp_share); + } + mrn_open_mutex_lock(NULL); + mrn_free_tmp_table_share(tmp_table_share); + mrn_open_mutex_unlock(NULL); + if (error) { + DBUG_RETURN(error); + } + } + } + } + if (wrap_handlerton) { error = wrapper_delete_table(name, wrap_handlerton, mapper.table_name()); @@ -4658,8 +5161,8 @@ int ha_mroonga::delete_table(const char *name) error = generic_delete_table(name, mapper.table_name()); } - if (!error && is_temporary_table_name(name)) { - mrn_db_manager->drop(name); + if (!error) { + error = operations_->clear(name, strlen(name)); } DBUG_RETURN(error); @@ -5032,6 +5535,70 @@ int ha_mroonga::rnd_end() DBUG_RETURN(error); } +#ifdef MRN_HANDLER_RECORDS_RETURN_ERROR +int ha_mroonga::wrapper_records(ha_rows *num_rows) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + error = wrap_handler->ha_records(num_rows); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_records(ha_rows *num_rows) +{ + MRN_DBUG_ENTER_METHOD(); + int error = handler::records(num_rows); + DBUG_RETURN(error); +} + +int ha_mroonga::records(ha_rows *num_rows) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) { + error = wrapper_records(num_rows); + } else { + error = storage_records(num_rows); + } + DBUG_RETURN(error); +} +#else +ha_rows ha_mroonga::wrapper_records() +{ + ha_rows num_rows; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + num_rows = wrap_handler->records(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(num_rows); +} + +ha_rows ha_mroonga::storage_records() +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows num_rows = handler::records(); + DBUG_RETURN(num_rows); +} + +ha_rows ha_mroonga::records() +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows num_rows; + if (share->wrapper_mode) { + num_rows = wrapper_records(); + } else { + num_rows = storage_records(); + } + DBUG_RETURN(num_rows); +} +#endif + int ha_mroonga::wrapper_rnd_next(uchar *buf) { int error = 0; @@ -5273,7 +5840,15 @@ int ha_mroonga::wrapper_write_row(uchar *buf) { int error = 0; THD *thd = ha_thd(); + MRN_DBUG_ENTER_METHOD(); + + mrn::Operation operation(operations_, + "write", + table->s->table_name.str, + table->s->table_name.length); + + operation.record_target(record_id); MRN_SET_WRAP_SHARE_KEY(share, table->s); MRN_SET_WRAP_TABLE_KEY(this, table); tmp_disable_binlog(thd); @@ -5388,6 +5963,11 @@ int ha_mroonga::storage_write_row(uchar *buf) DBUG_RETURN(error); } + mrn::Operation operation(operations_, + "write", + table->s->table_name.str, + table->s->table_name.length); + THD *thd = ha_thd(); int i; int n_columns = table->s->fields; @@ -5401,11 +5981,17 @@ int ha_mroonga::storage_write_row(uchar *buf) mrn::DebugColumnAccess debug_column_access(table, table->read_set); for (i = 0; i < n_columns; i++) { Field *field = table->field[i]; - const char *column_name = field->field_name; + +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif if (field->is_null()) continue; - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + mrn::ColumnName column_name(field->field_name); + if (strcmp(MRN_COLUMN_NAME_ID, column_name.c_str()) == 0) { push_warning_printf(thd, MRN_SEVERITY_WARNING, WARN_DATA_TRUNCATED, MRN_GET_ERR_MSG(WARN_DATA_TRUNCATED), @@ -5489,17 +6075,25 @@ int ha_mroonga::storage_write_row(uchar *buf) } DBUG_RETURN(error); } + operation.record_target(record_id); } grn_obj colbuf; GRN_VOID_INIT(&colbuf); for (i = 0; i < n_columns; i++) { Field *field = table->field[i]; - const char *column_name = field->field_name; if (field->is_null()) continue; +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif + + mrn::ColumnName column_name(field->field_name); + #ifdef MRN_HAVE_SPATIAL bool is_null_geometry_value = field->real_type() == MYSQL_TYPE_GEOMETRY && @@ -5509,39 +6103,63 @@ int ha_mroonga::storage_write_row(uchar *buf) } #endif - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (strcmp(MRN_COLUMN_NAME_ID, column_name.c_str()) == 0) { continue; } error = mrn_change_encoding(ctx, field->charset()); if (error) { - grn_obj_unlink(ctx, &colbuf); + GRN_OBJ_FIN(ctx, &colbuf); goto err; } error = generic_store_bulk(field, &colbuf); if (error) { - grn_obj_unlink(ctx, &colbuf); + GRN_OBJ_FIN(ctx, &colbuf); goto err; } - if (added && is_grn_zero_column_value(grn_columns[i], &colbuf)) { - // WORKAROUND: groonga can't index newly added '0' value for - // fix size column. So we add non-'0' value first then add - // real '0' value again. It will be removed when groonga - // supports 'null' value. - char *bytes = GRN_BULK_HEAD(&colbuf); - bytes[0] = '\1'; - grn_obj_set_value(ctx, grn_columns[i], record_id, &colbuf, GRN_OBJ_SET); - bytes[0] = '\0'; + + grn_obj *column = grn_columns[i]; + if (is_foreign_key_field(table->s->table_name.str, field->field_name)) { + grn_obj value; + GRN_RECORD_INIT(&value, 0, grn_obj_get_range(ctx, column)); + grn_rc cast_rc = grn_obj_cast(ctx, &colbuf, &value, GRN_FALSE); + if (cast_rc != GRN_SUCCESS) { + grn_obj inspected; + GRN_TEXT_INIT(&inspected, 0); + grn_inspect(ctx, &inspected, &colbuf); + error = HA_ERR_NO_REFERENCED_ROW; + GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, + "foreign record doesn't exist: <%s>:<%.*s>", + field->field_name, + static_cast(GRN_TEXT_LEN(&inspected)), + GRN_TEXT_VALUE(&inspected)); + GRN_OBJ_FIN(ctx, &value); + GRN_OBJ_FIN(ctx, &colbuf); + GRN_OBJ_FIN(ctx, &inspected); + goto err; + } + grn_obj_set_value(ctx, column, record_id, &value, GRN_OBJ_SET); + } else { + if (added && is_grn_zero_column_value(column, &colbuf)) { + // WORKAROUND: groonga can't index newly added '0' value for + // fix size column. So we add non-'0' value first then add + // real '0' value again. It will be removed when groonga + // supports 'null' value. + char *bytes = GRN_BULK_HEAD(&colbuf); + bytes[0] = '\1'; + grn_obj_set_value(ctx, column, record_id, &colbuf, GRN_OBJ_SET); + bytes[0] = '\0'; + } + grn_obj_set_value(ctx, column, record_id, &colbuf, GRN_OBJ_SET); } - grn_obj_set_value(ctx, grn_columns[i], record_id, &colbuf, GRN_OBJ_SET); if (ctx->rc) { - grn_obj_unlink(ctx, &colbuf); + GRN_OBJ_FIN(ctx, &colbuf); my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); error = ER_ERROR_ON_WRITE; goto err; } } - grn_obj_unlink(ctx, &colbuf); + GRN_OBJ_FIN(ctx, &colbuf); error = storage_write_row_multiple_column_indexes(buf, record_id); if (error) { @@ -5862,6 +6480,12 @@ int ha_mroonga::wrapper_update_row(const uchar *old_data, uchar *new_data) int error = 0; THD *thd = ha_thd(); + + mrn::Operation operation(operations_, + "update", + table->s->table_name.str, + table->s->table_name.length); + MRN_SET_WRAP_SHARE_KEY(share, table->s); MRN_SET_WRAP_TABLE_KEY(this, table); tmp_disable_binlog(thd); @@ -5999,6 +6623,12 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) DBUG_RETURN(error); } + mrn::Operation operation(operations_, + "update", + table->s->table_name.str, + table->s->table_name.length); + operation.record_target(record_id); + grn_obj colbuf; int i; uint j; @@ -6007,11 +6637,22 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) for (i = 0; i < n_columns; i++) { Field *field = table->field[i]; - const char *column_name = field->field_name; - if (bitmap_is_set(table->write_set, field->field_index)) { - if (field->is_null()) continue; - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif + + if (!bitmap_is_set(table->write_set, field->field_index)) + continue; + + if (field->is_null()) + continue; + + { + mrn::ColumnName column_name(field->field_name); + if (strcmp(MRN_COLUMN_NAME_ID, column_name.c_str()) == 0) { push_warning_printf(thd, MRN_SEVERITY_WARNING, WARN_DATA_TRUNCATED, MRN_GET_ERR_MSG(WARN_DATA_TRUNCATED), MRN_COLUMN_NAME_ID, @@ -6021,6 +6662,38 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) } } } + + if (!is_foreign_key_field(table->s->table_name.str, field->field_name)) + continue; + + { + grn_obj *column = grn_columns[i]; + grn_obj new_value; + GRN_VOID_INIT(&new_value); + { + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + generic_store_bulk(field, &new_value); + } + grn_obj casted_value; + GRN_RECORD_INIT(&casted_value, 0, grn_obj_get_range(ctx, column)); + grn_rc cast_rc = grn_obj_cast(ctx, &new_value, &casted_value, GRN_FALSE); + GRN_OBJ_FIN(ctx, &casted_value); + if (cast_rc != GRN_SUCCESS) { + grn_obj inspected; + GRN_TEXT_INIT(&inspected, 0); + grn_inspect(ctx, &inspected, &new_value); + GRN_OBJ_FIN(ctx, &new_value); + error = HA_ERR_NO_REFERENCED_ROW; + GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, + "foreign record doesn't exist: <%s>:<%.*s>", + field->field_name, + static_cast(GRN_TEXT_LEN(&inspected)), + GRN_TEXT_VALUE(&inspected)); + GRN_OBJ_FIN(ctx, &inspected); + DBUG_RETURN(error); + } + GRN_OBJ_FIN(ctx, &new_value); + } } KEY *pkey_info = NULL; @@ -6044,14 +6717,21 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) GRN_VOID_INIT(&colbuf); for (i = 0; i < n_columns; i++) { Field *field = table->field[i]; - const char *column_name = field->field_name; + +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif + if (bitmap_is_set(table->write_set, field->field_index)) { mrn::DebugColumnAccess debug_column_access(table, table->read_set); DBUG_PRINT("info", ("mroonga: update column %d(%d)",i,field->field_index)); if (field->is_null()) continue; - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + mrn::ColumnName column_name(field->field_name); + if (strcmp(MRN_COLUMN_NAME_ID, column_name.c_str()) == 0) { continue; } @@ -6059,30 +6739,43 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) if (error) goto err; + bool is_pkey = false; bool on_duplicate_key_update = (inserting_with_update && ignoring_duplicated_key); - if (!on_duplicate_key_update && pkey_info) { - bool have_pkey = false; + if (pkey_info && !on_duplicate_key_update) { for (j = 0; j < KEY_N_KEY_PARTS(pkey_info); j++) { Field *pkey_field = pkey_info->key_part[j].field; - if (strcmp(pkey_field->field_name, column_name) == 0) { - if (!replacing_) { - char message[MRN_BUFFER_SIZE]; - snprintf(message, MRN_BUFFER_SIZE, - "data truncated for primary key column: <%s>", - column_name); - push_warning(thd, MRN_SEVERITY_WARNING, - WARN_DATA_TRUNCATED, message); - } - have_pkey = true; + if (strcmp(pkey_field->field_name, column_name.c_str()) == 0) { + is_pkey = true; + break; } } - if (have_pkey) { - continue; - } } generic_store_bulk(field, &colbuf); + if (is_pkey) { + bool is_multiple_column_index = KEY_N_KEY_PARTS(pkey_info) > 1; + bool is_same_value; + if (is_multiple_column_index) { + is_same_value = false; + } else { + grn_id found_record_id = grn_table_get(ctx, + grn_table, + GRN_BULK_HEAD(&colbuf), + GRN_BULK_VSIZE(&colbuf)); + is_same_value = (record_id == found_record_id); + } + if (!is_same_value && !replacing_) { + char message[MRN_BUFFER_SIZE]; + snprintf(message, MRN_BUFFER_SIZE, + "data truncated for primary key column: <%s>", + column_name.c_str()); + push_warning(thd, MRN_SEVERITY_WARNING, + WARN_DATA_TRUNCATED, message); + } + continue; + } + grn_obj_set_value(ctx, grn_columns[i], record_id, &colbuf, GRN_OBJ_SET); if (ctx->rc) { grn_obj_unlink(ctx, &colbuf); @@ -6340,6 +7033,12 @@ int ha_mroonga::wrapper_delete_row(const uchar *buf) int error = 0; THD *thd= ha_thd(); + + mrn::Operation operation(operations_, + "delete", + table->s->table_name.str, + table->s->table_name.length); + MRN_SET_WRAP_SHARE_KEY(share, table->s); MRN_SET_WRAP_TABLE_KEY(this, table); tmp_disable_binlog(thd); @@ -6429,6 +7128,69 @@ int ha_mroonga::storage_delete_row(const uchar *buf) DBUG_RETURN(0); } + mrn::Operation operation(operations_, + "delete", + table->s->table_name.str, + table->s->table_name.length); + operation.record_target(record_id); + + { + grn_id referencing_child_table_id = GRN_ID_NIL; + grn_hash *columns = grn_hash_create(ctx, NULL, sizeof(grn_id), 0, + GRN_OBJ_TABLE_HASH_KEY|GRN_HASH_TINY); + grn_table_columns(ctx, grn_table, "", 0, + reinterpret_cast(columns)); + GRN_HASH_EACH_BEGIN(ctx, columns, cursor, id) { + void *key; + grn_hash_cursor_get_key(ctx, cursor, &key); + grn_id column_id = *static_cast(key); + grn_obj *column = grn_ctx_at(ctx, column_id); + if (!column) + continue; + + if (column->header.type != GRN_COLUMN_INDEX) + continue; + + grn_ii_cursor *ii_cursor = + grn_ii_cursor_open(ctx, + reinterpret_cast(column), + record_id, + GRN_ID_NIL, + GRN_ID_MAX, + 0, + 0); + if (!ii_cursor) + continue; + + if (grn_ii_cursor_next(ctx, ii_cursor)) { + referencing_child_table_id = grn_obj_get_range(ctx, column); + } + + grn_ii_cursor_close(ctx, ii_cursor); + + if (referencing_child_table_id != GRN_ID_NIL) + break; + } GRN_HASH_EACH_END(ctx, cursor); + grn_hash_close(ctx, columns); + + if (referencing_child_table_id != GRN_ID_NIL) { + grn_obj *referencing_child_table = + grn_ctx_at(ctx, referencing_child_table_id); + char name[GRN_TABLE_MAX_KEY_SIZE]; + int name_size; + name_size = grn_obj_name(ctx, + referencing_child_table, + name, + GRN_TABLE_MAX_KEY_SIZE); + error = HA_ERR_ROW_IS_REFERENCED; + GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, + "one or more child rows exist in <%.*s>", + name_size, + name); + DBUG_RETURN(error); + } + } + storage_store_fields_for_prep_update(buf, NULL, record_id); { mrn::Lock lock(&(share->record_mutex), have_unique_index()); @@ -6799,6 +7561,13 @@ ha_rows ha_mroonga::storage_records_in_range(uint key_nr, key_range *range_min, grn_ii *ii = reinterpret_cast(index_column); row_count = grn_ii_estimate_size_for_lexicon_cursor(ctx, ii, cursor); grn_table_cursor_close(ctx, cursor); + + unsigned int max_n_lexicon_records = + grn_table_size(ctx, grn_index_tables[key_nr]); + if (cursor_limit >= 0 && + static_cast(cursor_limit) < max_n_lexicon_records) { + row_count++; + } } DBUG_RETURN(row_count); } @@ -6960,7 +7729,7 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, enum ha_rkey_function find_flag) { MRN_DBUG_ENTER_METHOD(); - check_count_skip(keypart_map, 0, false); + check_count_skip(keypart_map); int error = 0; @@ -6976,6 +7745,29 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, clear_cursor_geo(); clear_empty_value_records(); + switch (find_flag) { + case HA_READ_BEFORE_KEY: + flags |= GRN_CURSOR_LT | GRN_CURSOR_DESCENDING; + break; + case HA_READ_PREFIX_LAST: + flags |= GRN_CURSOR_PREFIX | GRN_CURSOR_DESCENDING; + break; + case HA_READ_PREFIX_LAST_OR_PREV: + flags |= GRN_CURSOR_LE | GRN_CURSOR_DESCENDING; + break; + case HA_READ_AFTER_KEY: + flags |= GRN_CURSOR_GT | GRN_CURSOR_ASCENDING; + break; + case HA_READ_KEY_OR_NEXT: + flags |= GRN_CURSOR_GE | GRN_CURSOR_ASCENDING; + break; + case HA_READ_KEY_EXACT: + flags |= GRN_CURSOR_LE | GRN_CURSOR_GE; + break; + default: + break; + } + bool is_multiple_column_index = KEY_N_KEY_PARTS(key_info) > 1; if (is_multiple_column_index) { mrn_change_encoding(ctx, NULL); @@ -6987,13 +7779,21 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, "multiple column index key length=<%u>", key_length, key_info->key_length)); if (key_length == key_info->key_length) { - if (find_flag == HA_READ_BEFORE_KEY || - find_flag == HA_READ_PREFIX_LAST_OR_PREV) { + switch (find_flag) { + case HA_READ_BEFORE_KEY: + case HA_READ_PREFIX_LAST_OR_PREV: key_max = key_max_entity; storage_encode_multiple_column_key(key_info, key, key_length, key_max, &size_max); - } else { + break; + case HA_READ_PREFIX_LAST: + key_min = key_min_entity; + storage_encode_multiple_column_key(key_info, + key, key_length, + key_min, &size_min); + break; + default: key_min = key_min_entity; storage_encode_multiple_column_key(key_info, key, key_length, @@ -7002,13 +7802,102 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, key_max = key_min; size_max = size_min; } + break; } } else { - flags |= GRN_CURSOR_PREFIX; - key_min = key_min_entity; - storage_encode_multiple_column_key(key_info, - key, key_length, - key_min, &size_min); + const uchar *prev_key = NULL; + uint prev_key_length = 0; + if ((keypart_map >> 1) > 0) { + prev_key = key; + prev_key_length = + mrn_calculate_key_len(table, active_index, key, keypart_map >> 1); + } + switch (find_flag) { + case HA_READ_BEFORE_KEY: + if (prev_key) { + flags |= GRN_CURSOR_GE; + key_min = key_min_entity; + storage_encode_multiple_column_key_range(key_info, + prev_key, prev_key_length, + NULL, 0, + key_min, &size_min, + NULL, NULL); + } + key_max = key_max_entity; + storage_encode_multiple_column_key_range(key_info, + key, key_length, + NULL, 0, + key_max, &size_max, + NULL, NULL); + break; + case HA_READ_PREFIX_LAST: + key_min = key_min_entity; + storage_encode_multiple_column_key(key_info, + key, key_length, + key_min, &size_min); + break; + case HA_READ_PREFIX_LAST_OR_PREV: + if (prev_key) { + flags |= GRN_CURSOR_GE; + key_min = key_min_entity; + storage_encode_multiple_column_key_range(key_info, + prev_key, prev_key_length, + NULL, 0, + key_min, &size_min, + NULL, NULL); + } + key_max = key_max_entity; + storage_encode_multiple_column_key_range(key_info, + NULL, 0, + key, key_length, + NULL, NULL, + key_max, &size_max); + break; + case HA_READ_AFTER_KEY: + key_min = key_min_entity; + storage_encode_multiple_column_key_range(key_info, + NULL, 0, + key, key_length, + NULL, NULL, + key_min, &size_min); + if (prev_key) { + flags |= GRN_CURSOR_LE; + key_max = key_max_entity; + storage_encode_multiple_column_key_range(key_info, + NULL, 0, + prev_key, prev_key_length, + NULL, NULL, + key_max, &size_max); + } + break; + case HA_READ_KEY_OR_NEXT: + key_min = key_min_entity; + storage_encode_multiple_column_key_range(key_info, + key, key_length, + NULL, 0, + key_min, &size_min, + NULL, NULL); + if (prev_key) { + flags |= GRN_CURSOR_LE; + key_max = key_max_entity; + storage_encode_multiple_column_key_range(key_info, + NULL, 0, + prev_key, prev_key_length, + NULL, NULL, + key_max, &size_max); + } + break; + case HA_READ_KEY_EXACT: + key_min = key_min_entity; + key_max = key_max_entity; + storage_encode_multiple_column_key_range(key_info, + key, key_length, + key, key_length, + key_min, &size_min, + key_max, &size_max); + default: + break; + } } } else if (mrn_is_geo_key(key_info)) { error = mrn_change_encoding(ctx, key_info->key_part->field->charset()); @@ -7055,23 +7944,6 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, } } - switch (find_flag) { - case HA_READ_BEFORE_KEY: - flags |= GRN_CURSOR_LT | GRN_CURSOR_DESCENDING; - break; - case HA_READ_PREFIX_LAST_OR_PREV: - flags |= GRN_CURSOR_LE | GRN_CURSOR_DESCENDING; - break; - case HA_READ_AFTER_KEY: - flags |= GRN_CURSOR_GT | GRN_CURSOR_ASCENDING; - break; - case HA_READ_KEY_OR_NEXT: - flags |= GRN_CURSOR_GE | GRN_CURSOR_ASCENDING; - break; - default: - break; - } - uint pkey_nr = table->s->primary_key; if (key_nr == pkey_nr) { DBUG_PRINT("info", ("mroonga: use primary key")); @@ -7509,222 +8381,6 @@ int ha_mroonga::index_next_same(uchar *buf, const uchar *key, uint keylen) DBUG_RETURN(error); } -int ha_mroonga::wrapper_read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted) -{ - int error = 0; - MRN_DBUG_ENTER_METHOD(); - KEY *key_info = &(table->key_info[active_index]); - if (mrn_is_geo_key(key_info)) { - clear_cursor_geo(); - error = generic_geo_open_cursor(start_key->key, start_key->flag); - if (!error) { - error = wrapper_get_next_geo_record(table->record[0]); - } - DBUG_RETURN(error); - } - MRN_SET_WRAP_SHARE_KEY(share, table->s); - MRN_SET_WRAP_TABLE_KEY(this, table); - if (fulltext_searching) - set_pk_bitmap(); - error = wrap_handler->read_range_first(start_key, end_key, eq_range, - sorted); - MRN_SET_BASE_SHARE_KEY(share, table->s); - MRN_SET_BASE_TABLE_KEY(this, table); - DBUG_RETURN(error); -} - -int ha_mroonga::storage_read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted) -{ - MRN_DBUG_ENTER_METHOD(); - check_count_skip(start_key ? start_key->keypart_map : 0, - end_key ? end_key->keypart_map : 0, false); - int flags = 0, error; - uint size_min = 0, size_max = 0; - uchar *key_min = NULL, *key_max = NULL; - uchar key_min_entity[MRN_MAX_KEY_SIZE]; - uchar key_max_entity[MRN_MAX_KEY_SIZE]; - KEY *key_info = &(table->s->key_info[active_index]); - - clear_cursor(); - - bool is_multiple_column_index = KEY_N_KEY_PARTS(key_info) > 1; - if (is_multiple_column_index) { - mrn_change_encoding(ctx, NULL); - if (start_key && end_key && - start_key->length == end_key->length && - memcmp(start_key->key, end_key->key, start_key->length) == 0) { - flags |= GRN_CURSOR_PREFIX; - key_min = key_min_entity; - storage_encode_multiple_column_key(key_info, - start_key->key, start_key->length, - key_min, &size_min); - } else { - key_min = key_min_entity; - key_max = key_max_entity; - storage_encode_multiple_column_key_range(key_info, - start_key, end_key, - key_min, &size_min, - key_max, &size_max); - if (size_min == 0) { - key_min = NULL; - } - if (size_max == 0) { - key_max = NULL; - } - } - } else { - Field *field = key_info->key_part[0].field; - const char *column_name = field->field_name; - error = mrn_change_encoding(ctx, field->charset()); - if (error) - DBUG_RETURN(error); - if (start_key) { - key_min = key_min_entity; - storage_encode_key(field, start_key->key, key_min_entity, - &size_min); - if (start_key->flag == HA_READ_KEY_EXACT) { - // for _id - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { - grn_id found_record_id = *((grn_id *)key_min); - if (grn_table_at(ctx, grn_table, found_record_id) != GRN_ID_NIL) { // found - storage_store_fields(table->record[0], found_record_id); - table->status = 0; - cursor = NULL; - record_id = found_record_id; - DBUG_RETURN(0); - } else { - table->status = STATUS_NOT_FOUND; - cursor = NULL; - record_id = GRN_ID_NIL; - DBUG_RETURN(HA_ERR_END_OF_FILE); - } - } - } - } - if (end_key) { - key_max = key_max_entity; - storage_encode_key(field, end_key->key, key_max, &size_max); - } - } - - if (start_key) { - switch (start_key->flag) { - case HA_READ_AFTER_KEY: - flags |= GRN_CURSOR_GT | GRN_CURSOR_ASCENDING; - break; - case HA_READ_KEY_OR_NEXT: - flags |= GRN_CURSOR_GE | GRN_CURSOR_ASCENDING; - break; - default: - break; - } - } - if (end_key) { - switch (end_key->flag) { - case HA_READ_BEFORE_KEY: - flags |= GRN_CURSOR_LT | GRN_CURSOR_ASCENDING; - break; - case HA_READ_AFTER_KEY: - flags |= GRN_CURSOR_GE | GRN_CURSOR_ASCENDING; - break; - default: - break; - } - } - - uint pkey_nr = table->s->primary_key; - if (active_index == pkey_nr) { - DBUG_PRINT("info", ("mroonga: use primary key")); - cursor = grn_table_cursor_open(ctx, grn_table, - key_min, size_min, key_max, size_max, - 0, -1, flags); - } else { - if (is_multiple_column_index) { - DBUG_PRINT("info", ("mroonga: use multiple column key%u", active_index)); - } else { - DBUG_PRINT("info", ("mroonga: use key%u", active_index)); - } - index_table_cursor = grn_table_cursor_open(ctx, - grn_index_tables[active_index], - key_min, size_min, - key_max, size_max, - 0, -1, flags); - cursor = grn_index_cursor_open(ctx, index_table_cursor, - grn_index_columns[active_index], - 0, GRN_ID_MAX, 0); - } - if (ctx->rc) { - my_message(ER_ERROR_ON_READ, ctx->errbuf, MYF(0)); - DBUG_RETURN(ER_ERROR_ON_READ); - } - error = storage_get_next_record(table->record[0]); - DBUG_RETURN(error); -} - -int ha_mroonga::read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted) -{ - MRN_DBUG_ENTER_METHOD(); - int error = 0; - if (share->wrapper_mode) - { - error = wrapper_read_range_first(start_key, end_key, eq_range, - sorted); - } else { - error = storage_read_range_first(start_key, end_key, eq_range, sorted); - } - DBUG_RETURN(error); -} - -int ha_mroonga::wrapper_read_range_next() -{ - int error = 0; - MRN_DBUG_ENTER_METHOD(); - KEY *key_info = &(table->key_info[active_index]); - if (mrn_is_geo_key(key_info)) { - error = wrapper_get_next_geo_record(table->record[0]); - DBUG_RETURN(error); - } - MRN_SET_WRAP_SHARE_KEY(share, table->s); - MRN_SET_WRAP_TABLE_KEY(this, table); - if (fulltext_searching) - set_pk_bitmap(); - error = wrap_handler->read_range_next(); - MRN_SET_BASE_SHARE_KEY(share, table->s); - MRN_SET_BASE_TABLE_KEY(this, table); - DBUG_RETURN(error); -} - -int ha_mroonga::storage_read_range_next() -{ - MRN_DBUG_ENTER_METHOD(); - - if (cursor == NULL) { - DBUG_RETURN(HA_ERR_END_OF_FILE); - } - int error = storage_get_next_record(count_skip ? NULL : table->record[0]); - - DBUG_RETURN(error); -} - -int ha_mroonga::read_range_next() -{ - MRN_DBUG_ENTER_METHOD(); - int error = 0; - if (share->wrapper_mode) - { - error = wrapper_read_range_next(); - } else { - error = storage_read_range_next(); - } - DBUG_RETURN(error); -} - int ha_mroonga::generic_ft_init() { MRN_DBUG_ENTER_METHOD(); @@ -7749,257 +8405,63 @@ int ha_mroonga::generic_ft_init() if (sorted_result) { if (grn_table->header.type == GRN_TABLE_NO_KEY) { mrn_ft_info->id_accessor = grn_obj_column(ctx, sorted_result, - MRN_COLUMN_NAME_ID, - strlen(MRN_COLUMN_NAME_ID)); - } else { - mrn_ft_info->key_accessor = grn_obj_column(ctx, sorted_result, - MRN_COLUMN_NAME_KEY, - strlen(MRN_COLUMN_NAME_KEY)); - } - } else { - mrn_ft_info->key_accessor = grn_obj_column(ctx, mrn_ft_info->result, - MRN_COLUMN_NAME_KEY, - strlen(MRN_COLUMN_NAME_KEY)); - } - } - DBUG_RETURN(error); -} - -int ha_mroonga::wrapper_ft_init() -{ - MRN_DBUG_ENTER_METHOD(); - int error = generic_ft_init(); - DBUG_RETURN(error); -} - -int ha_mroonga::storage_ft_init() -{ - MRN_DBUG_ENTER_METHOD(); - int error = generic_ft_init(); - record_id = GRN_ID_NIL; - DBUG_RETURN(error); -} - -int ha_mroonga::ft_init() -{ - MRN_DBUG_ENTER_METHOD(); - int error = 0; - if (share->wrapper_mode) - { - error = wrapper_ft_init(); - } else { - error = storage_ft_init(); - } - DBUG_RETURN(error); -} - -void ha_mroonga::generic_ft_init_ext_add_conditions_fast_order_limit( - struct st_mrn_ft_info *info, grn_obj *expression) -{ - MRN_DBUG_ENTER_METHOD(); - - Item *where = - MRN_SELECT_LEX_GET_WHERE_COND(table->pos_in_table_list->select_lex); - - bool is_storage_mode = !(share->wrapper_mode); - mrn::ConditionConverter converter(info->ctx, grn_table, is_storage_mode); - converter.convert(where, expression); - - DBUG_VOID_RETURN; -} - -bool ha_mroonga::generic_ft_init_ext_parse_pragma_d(struct st_mrn_ft_info *info, - const char *keyword, - uint keyword_length, - grn_operator *default_operator, - uint *consumed_keyword_length) -{ - MRN_DBUG_ENTER_METHOD(); - - grn_bool succeeded = true; - if (keyword_length >= 1 && keyword[0] == '+') { - *default_operator = GRN_OP_AND; - *consumed_keyword_length = 1; - } else if (keyword_length >= 1 && keyword[0] == '-') { - *default_operator = GRN_OP_AND_NOT; - *consumed_keyword_length = 1; - } else if (keyword_length >= 2 && memcmp(keyword, "OR", 2) == 0) { - *default_operator = GRN_OP_OR; - *consumed_keyword_length = 2; - } else { - succeeded = false; - } - - DBUG_RETURN(succeeded); -} - -void ha_mroonga::generic_ft_init_ext_parse_pragma_w_append_section( - struct st_mrn_ft_info *info, - grn_obj *index_column, - grn_obj *match_columns, - uint section, - grn_obj *section_value_buffer, - int weight, - uint n_weights) -{ - MRN_DBUG_ENTER_METHOD(); - - grn_expr_append_obj(info->ctx, match_columns, index_column, GRN_OP_PUSH, 1); - GRN_UINT32_SET(info->ctx, section_value_buffer, section); - grn_expr_append_const(info->ctx, match_columns, section_value_buffer, - GRN_OP_PUSH, 1); - grn_expr_append_op(info->ctx, match_columns, GRN_OP_GET_MEMBER, 2); - - if (weight != 1) { - grn_expr_append_const_int(info->ctx, match_columns, weight, - GRN_OP_PUSH, 1); - grn_expr_append_op(info->ctx, match_columns, GRN_OP_STAR, 2); - } - - if (n_weights >= 2) { - grn_expr_append_op(info->ctx, match_columns, GRN_OP_OR, 2); - } - - DBUG_VOID_RETURN; -} - -bool ha_mroonga::generic_ft_init_ext_parse_pragma_w(struct st_mrn_ft_info *info, - const char *keyword, - uint keyword_length, - grn_obj *index_column, - grn_obj *match_columns, - uint *consumed_keyword_length, - grn_obj *tmp_objects) -{ - MRN_DBUG_ENTER_METHOD(); - - *consumed_keyword_length = 0; - - uint n_sections = KEY_N_KEY_PARTS(info->key_info); - - grn_obj section_value_buffer; - GRN_UINT32_INIT(§ion_value_buffer, 0); - - MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(bool, specified_sections, n_sections); - for (uint i = 0; i < n_sections; ++i) { - specified_sections[i] = false; - } - - uint n_weights = 0; - while (keyword_length >= 1) { - if (n_weights >= 1) { - if (keyword[0] != ',') { - break; - } - uint n_used_keyword_length = 1; - *consumed_keyword_length += n_used_keyword_length; - keyword_length -= n_used_keyword_length; - keyword += n_used_keyword_length; - if (keyword_length == 0) { - break; - } - } - - uint section = 0; - if ('1' <= keyword[0] && keyword[0] <= '9') { - const char *section_start = keyword; - const char *keyword_end = keyword + keyword_length; - const char *keyword_rest; - section = grn_atoui(section_start, keyword_end, &keyword_rest); - if (section_start == keyword_rest) { - break; - } - if (!(0 < section && section <= n_sections)) { - break; + MRN_COLUMN_NAME_ID, + strlen(MRN_COLUMN_NAME_ID)); + } else { + mrn_ft_info->key_accessor = grn_obj_column(ctx, sorted_result, + MRN_COLUMN_NAME_KEY, + strlen(MRN_COLUMN_NAME_KEY)); } - section -= 1; - specified_sections[section] = true; - uint n_used_keyword_length = keyword_rest - keyword; - *consumed_keyword_length += n_used_keyword_length; - keyword_length -= n_used_keyword_length; - keyword += n_used_keyword_length; } else { - break; - } - - int weight = 1; - if (keyword_length >= 2 && keyword[0] == ':') { - const char *weight_start = keyword + 1; - const char *keyword_end = keyword + keyword_length; - const char *keyword_rest; - weight = grn_atoi(weight_start, keyword_end, &keyword_rest); - if (weight_start == keyword_rest) { - break; - } - uint n_used_keyword_length = keyword_rest - keyword; - *consumed_keyword_length += n_used_keyword_length; - keyword_length -= n_used_keyword_length; - keyword += n_used_keyword_length; + mrn_ft_info->key_accessor = grn_obj_column(ctx, mrn_ft_info->result, + MRN_COLUMN_NAME_KEY, + strlen(MRN_COLUMN_NAME_KEY)); } - - n_weights++; - - generic_ft_init_ext_parse_pragma_w_append_section(info, - index_column, - match_columns, - section, - §ion_value_buffer, - weight, - n_weights); } + DBUG_RETURN(error); +} - for (uint section = 0; section < n_sections; ++section) { - if (specified_sections[section]) { - continue; - } +int ha_mroonga::wrapper_ft_init() +{ + MRN_DBUG_ENTER_METHOD(); + int error = generic_ft_init(); + DBUG_RETURN(error); +} - ++n_weights; +int ha_mroonga::storage_ft_init() +{ + MRN_DBUG_ENTER_METHOD(); + int error = generic_ft_init(); + record_id = GRN_ID_NIL; + DBUG_RETURN(error); +} - int default_weight = 1; - generic_ft_init_ext_parse_pragma_w_append_section(info, - index_column, - match_columns, - section, - §ion_value_buffer, - default_weight, - n_weights); +int ha_mroonga::ft_init() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_ft_init(); + } else { + error = storage_ft_init(); } - MRN_FREE_VARIABLE_LENGTH_ARRAYS(specified_sections); - - GRN_OBJ_FIN(info->ctx, §ion_value_buffer); - - DBUG_RETURN(n_weights > 0); + DBUG_RETURN(error); } -grn_expr_flags ha_mroonga::expr_flags_in_boolean_mode() +void ha_mroonga::generic_ft_init_ext_add_conditions_fast_order_limit( + struct st_mrn_ft_info *info, grn_obj *expression) { MRN_DBUG_ENTER_METHOD(); - ulonglong syntax_flags = MRN_BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT; -#ifdef MRN_SUPPORT_THDVAR_SET - syntax_flags = THDVAR(ha_thd(), boolean_mode_syntax_flags); -#endif - grn_expr_flags expression_flags = 0; - if (syntax_flags == MRN_BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT) { - expression_flags = GRN_EXPR_SYNTAX_QUERY | GRN_EXPR_ALLOW_LEADING_NOT; - } else { - if (syntax_flags & MRN_BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_SCRIPT) { - expression_flags |= GRN_EXPR_SYNTAX_SCRIPT; - } else { - expression_flags |= GRN_EXPR_SYNTAX_QUERY; - } - if (syntax_flags & MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_COLUMN) { - expression_flags |= GRN_EXPR_ALLOW_COLUMN; - } - if (syntax_flags & MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_UPDATE) { - expression_flags |= GRN_EXPR_ALLOW_UPDATE; - } - if (syntax_flags & MRN_BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_LEADING_NOT) { - expression_flags |= GRN_EXPR_ALLOW_LEADING_NOT; - } - } + Item *where = + MRN_SELECT_LEX_GET_WHERE_COND(table->pos_in_table_list->select_lex); + + bool is_storage_mode = !(share->wrapper_mode); + mrn::ConditionConverter converter(info->ctx, grn_table, is_storage_mode); + converter.convert(where, expression); - DBUG_RETURN(expression_flags); + DBUG_VOID_RETURN; } grn_rc ha_mroonga::generic_ft_init_ext_prepare_expression_in_boolean_mode( @@ -8007,107 +8469,17 @@ grn_rc ha_mroonga::generic_ft_init_ext_prepare_expression_in_boolean_mode( String *key, grn_obj *index_column, grn_obj *match_columns, - grn_obj *expression, - grn_obj *tmp_objects) + grn_obj *expression) { MRN_DBUG_ENTER_METHOD(); - grn_rc rc = GRN_SUCCESS; - - const char *keyword, *keyword_original; - uint keyword_length, keyword_length_original; - grn_operator default_operator = GRN_OP_OR; - grn_bool weight_specified = false; - keyword = keyword_original = key->ptr(); - keyword_length = keyword_length_original = key->length(); - // WORKAROUND: support only "D" and "W" pragmas. - if (keyword_length >= 2 && keyword[0] == '*') { - bool parsed = false; - bool done = false; - keyword++; - keyword_length--; - while (!done) { - uint consumed_keyword_length = 0; - switch (keyword[0]) { - case 'D': - if (generic_ft_init_ext_parse_pragma_d(info, - keyword + 1, - keyword_length - 1, - &default_operator, - &consumed_keyword_length)) { - parsed = true; - consumed_keyword_length += 1; - keyword += consumed_keyword_length; - keyword_length -= consumed_keyword_length; - } else { - done = true; - } - break; - case 'W': - if (generic_ft_init_ext_parse_pragma_w(info, - keyword + 1, - keyword_length - 1, - index_column, - match_columns, - &consumed_keyword_length, - tmp_objects)) { - parsed = true; - weight_specified = true; - consumed_keyword_length += 1; - keyword += consumed_keyword_length; - keyword_length -= consumed_keyword_length; - } else { - done = true; - } - break; - default: - done = true; - break; - } - } - if (!parsed) { - keyword = keyword_original; - keyword_length = keyword_length_original; - } - } - // WORKAROUND: ignore the first '+' to support "+apple macintosh" pattern. - while (keyword_length > 0 && keyword[0] == ' ') { - keyword++; - keyword_length--; - } - if (keyword_length > 0 && keyword[0] == '+') { - keyword++; - keyword_length--; - } - if (!weight_specified) { - grn_expr_append_obj(info->ctx, match_columns, index_column, GRN_OP_PUSH, 1); - } - rc = grn_expr_parse(info->ctx, expression, - keyword, keyword_length, - match_columns, GRN_OP_MATCH, default_operator, - expr_flags_in_boolean_mode()); - if (rc) { - char error_message[MRN_MESSAGE_BUFFER_SIZE]; - snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, - "failed to parse fulltext search keyword: <%.*s>: <%s>", - keyword_length_original, keyword_original, - info->ctx->errbuf); - ulong action = THDVAR(ha_thd(), action_on_fulltext_query_error); - switch (static_cast(action)) { - case MRN_ACTION_ON_ERROR_ERROR: - my_message(ER_PARSE_ERROR, error_message, MYF(0)); - break; - case MRN_ACTION_ON_ERROR_ERROR_AND_LOG: - my_message(ER_PARSE_ERROR, error_message, MYF(0)); - GRN_LOG(info->ctx, GRN_LOG_ERROR, "%s", error_message); - break; - case MRN_ACTION_ON_ERROR_IGNORE: - break; - case MRN_ACTION_ON_ERROR_IGNORE_AND_LOG: - GRN_LOG(info->ctx, GRN_LOG_ERROR, "%s", error_message); - break; - } - } + mrn::QueryParser query_parser(info->ctx, + ha_thd(), + expression, + index_column, + KEY_N_KEY_PARTS(info->key_info), + match_columns); + grn_rc rc = query_parser.parse(key->ptr(), key->length()); DBUG_RETURN(rc); } @@ -8117,8 +8489,7 @@ grn_rc ha_mroonga::generic_ft_init_ext_prepare_expression_in_normal_mode( String *key, grn_obj *index_column, grn_obj *match_columns, - grn_obj *expression, - grn_obj *tmp_objects) + grn_obj *expression) { MRN_DBUG_ENTER_METHOD(); @@ -8152,6 +8523,18 @@ struct st_mrn_ft_info *ha_mroonga::generic_ft_init_ext_select(uint flags, info->result = grn_table_create(info->ctx, NULL, 0, NULL, GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, grn_table, 0); + if (!info->result) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "[mroonga][ft-init] failed to create a table " + "to store matched records for one search: <%s>", + ctx->errbuf); + my_message(ER_ERROR_ON_READ, error_message, MYF(0)); + GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message); + delete info; + DBUG_RETURN(NULL); + } + info->score_column = grn_obj_column(info->ctx, info->result, MRN_COLUMN_NAME_SCORE, strlen(MRN_COLUMN_NAME_SCORE)); @@ -8177,8 +8560,6 @@ struct st_mrn_ft_info *ha_mroonga::generic_ft_init_ext_select(uint flags, grn_obj *expression, *expression_variable; GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->table, expression, expression_variable); - grn_obj tmp_objects; - GRN_PTR_INIT(&tmp_objects, GRN_OBJ_VECTOR, GRN_ID_NIL); grn_rc rc = GRN_SUCCESS; if (flags & FT_BOOL) { @@ -8186,15 +8567,13 @@ struct st_mrn_ft_info *ha_mroonga::generic_ft_init_ext_select(uint flags, key, index_column, match_columns, - expression, - &tmp_objects); + expression); } else { rc = generic_ft_init_ext_prepare_expression_in_normal_mode(info, key, index_column, match_columns, - expression, - &tmp_objects); + expression); } if (rc == GRN_SUCCESS) { @@ -8210,12 +8589,6 @@ struct st_mrn_ft_info *ha_mroonga::generic_ft_init_ext_select(uint flags, grn_obj_unlink(info->ctx, expression); grn_obj_unlink(info->ctx, match_columns); - uint n_tmp_objects = GRN_BULK_VSIZE(&tmp_objects) / sizeof(grn_obj *); - for (uint i = 0; i < n_tmp_objects; ++i) { - grn_obj_unlink(info->ctx, GRN_PTR_VALUE_AT(&tmp_objects, i)); - } - grn_obj_unlink(info->ctx, &tmp_objects); - DBUG_RETURN(info); } @@ -8223,7 +8596,7 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) { MRN_DBUG_ENTER_METHOD(); - check_count_skip(0, 0, true); + check_count_skip(0); mrn_change_encoding(ctx, system_charset_info); grn_operator operation = GRN_OP_OR; @@ -8231,6 +8604,16 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) matched_record_keys = grn_table_create(ctx, NULL, 0, NULL, GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, grn_table, 0); + if (!matched_record_keys) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "[mroonga][ft-init] " + "failed to create a table to store all matched records: <%s>", + ctx->errbuf); + my_message(ER_ERROR_ON_READ, error_message, MYF(0)); + GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message); + DBUG_RETURN(NULL); + } } grn_table_sort_key *sort_keys = NULL; @@ -8238,8 +8621,10 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) longlong limit = -1; check_fast_order_limit(&sort_keys, &n_sort_keys, &limit); - struct st_mrn_ft_info *info = - generic_ft_init_ext_select(flags, key_nr, key); + struct st_mrn_ft_info *info = generic_ft_init_ext_select(flags, key_nr, key); + if (!info) { + DBUG_RETURN(NULL); + } grn_rc rc; rc = grn_table_setoperation(ctx, matched_record_keys, info->result, @@ -8253,6 +8638,9 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message); } if (fast_order_limit) { + if (sorted_result) { + grn_obj_close(ctx, sorted_result); + } sorted_result = grn_table_create(ctx, NULL, 0, NULL, GRN_OBJ_TABLE_NO_KEY, NULL, @@ -8291,20 +8679,31 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) FT_INFO *ha_mroonga::wrapper_ft_init_ext(uint flags, uint key_nr, String *key) { MRN_DBUG_ENTER_METHOD(); + FT_INFO *info = generic_ft_init_ext(flags, key_nr, key); + if (!info) { + DBUG_RETURN(NULL); + } + struct st_mrn_ft_info *mrn_ft_info = (struct st_mrn_ft_info *)info; mrn_ft_info->please = &mrn_wrapper_ft_vft; #ifdef HA_CAN_FULLTEXT_EXT mrn_ft_info->could_you = &mrn_wrapper_ft_vft_ext; #endif ++wrap_ft_init_count; + DBUG_RETURN(info); } FT_INFO *ha_mroonga::storage_ft_init_ext(uint flags, uint key_nr, String *key) { MRN_DBUG_ENTER_METHOD(); + FT_INFO *info = generic_ft_init_ext(flags, key_nr, key); + if (!info) { + DBUG_RETURN(NULL); + } + struct st_mrn_ft_info *mrn_ft_info = (struct st_mrn_ft_info *)info; mrn_ft_info->please = &mrn_storage_ft_vft; #ifdef HA_CAN_FULLTEXT_EXT @@ -8453,7 +8852,8 @@ const Item *ha_mroonga::storage_cond_push(const Item *cond) const Item *reminder_cond = cond; if (!pushed_cond) { mrn::ConditionConverter converter(ctx, grn_table, true); - if (converter.find_match_against(cond) && converter.is_convertable(cond)) { + if (converter.count_match_against(cond) == 1 && + converter.is_convertable(cond)) { reminder_cond = NULL; } } @@ -8566,6 +8966,47 @@ bool ha_mroonga::have_unique_index() DBUG_RETURN(false); } +bool ha_mroonga::is_foreign_key_field(const char *table_name, + const char *field_name) +{ + MRN_DBUG_ENTER_METHOD(); + + grn_obj *table = grn_ctx_get(ctx, table_name, -1); + if (!table) { + DBUG_RETURN(false); + } + + mrn::ColumnName column_name(field_name); + grn_obj *column = grn_obj_column(ctx, + table, + column_name.c_str(), + column_name.length()); + if (!column) { + DBUG_RETURN(false); + } + + grn_obj *range = grn_ctx_at(ctx, grn_obj_get_range(ctx, column)); + if (!range) { + DBUG_RETURN(false); + } + + if (!mrn::grn::is_table(range)) { + DBUG_RETURN(false); + } + + grn_obj *foreign_index_column; + mrn::IndexColumnName index_column_name(table_name, field_name); + foreign_index_column = grn_obj_column(ctx, range, + index_column_name.c_str(), + index_column_name.length()); + if (foreign_index_column) { + grn_obj_unlink(ctx, foreign_index_column); + DBUG_RETURN(true); + } + + DBUG_RETURN(false); +} + void ha_mroonga::push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag) { char search_name[MRN_BUFFER_SIZE]; @@ -8745,7 +9186,7 @@ void ha_mroonga::remove_related_files(const char *base_path) if (stat(entry->d_name, &file_status) != 0) { continue; } - if (!((file_status.st_mode & S_IFMT) & S_IFREG)) { + if (!((file_status.st_mode & S_IFMT) && S_IFREG)) { continue; } if (strncmp(entry->d_name, base_path, base_path_length) == 0) { @@ -8806,6 +9247,11 @@ int ha_mroonga::drop_index(MRN_SHARE *target_share, uint key_index) grn_obj *index_table = grn_ctx_get(ctx, index_table_name.c_str(), index_table_name.length()); + if (!index_table) { + index_table = grn_ctx_get(ctx, + index_table_name.old_c_str(), + index_table_name.old_length()); + } if (index_table) { target_name_length = grn_obj_name(ctx, index_table, target_name, GRN_TABLE_MAX_KEY_SIZE); @@ -8953,7 +9399,9 @@ int ha_mroonga::drop_indexes_normal(const char *table_name, grn_obj *table) DBUG_RETURN(error); } -int ha_mroonga::drop_indexes_multiple(const char *table_name, grn_obj *table) +int ha_mroonga::drop_indexes_multiple(const char *table_name, + grn_obj *table, + const char *index_table_name_separator) { MRN_DBUG_ENTER_METHOD(); @@ -8961,7 +9409,7 @@ int ha_mroonga::drop_indexes_multiple(const char *table_name, grn_obj *table) char index_table_name_prefix[GRN_TABLE_MAX_KEY_SIZE]; snprintf(index_table_name_prefix, GRN_TABLE_MAX_KEY_SIZE, - "%s%s", table_name, mrn::IndexTableName::SEPARATOR); + "%s%s", table_name, index_table_name_separator); grn_table_cursor *cursor = grn_table_cursor_open(ctx, grn_ctx_db(ctx), @@ -9050,7 +9498,12 @@ int ha_mroonga::drop_indexes(const char *table_name) error = drop_indexes_normal(table_name, table.get()); if (error == 0) { - error = drop_indexes_multiple(table_name, table.get()); + error = drop_indexes_multiple(table_name, table.get(), + mrn::IndexTableName::SEPARATOR); + } + if (error == 0) { + error = drop_indexes_multiple(table_name, table.get(), + mrn::IndexTableName::OLD_SEPARATOR); } DBUG_RETURN(error); @@ -9177,6 +9630,26 @@ grn_obj *ha_mroonga::find_tokenizer(const char *name, int name_length) DBUG_RETURN(tokenizer); } +bool ha_mroonga::have_custom_normalizer(KEY *key) const +{ + MRN_DBUG_ENTER_METHOD(); + +#ifdef MRN_SUPPORT_CUSTOM_OPTIONS + if (key->option_struct && key->option_struct->normalizer) { + DBUG_RETURN(true); + } +#endif + + if (key->comment.length > 0) { + mrn::ParametersParser parser(key->comment.str, + key->comment.length); + parser.parse(); + DBUG_RETURN(parser["normalizer"] != NULL); + } + + DBUG_RETURN(false); +} + grn_obj *ha_mroonga::find_normalizer(KEY *key) { MRN_DBUG_ENTER_METHOD(); @@ -9223,7 +9696,7 @@ grn_obj *ha_mroonga::find_normalizer(KEY *key, const char *name) DBUG_RETURN(normalizer); } -bool ha_mroonga::find_index_column_flags(KEY *key, grn_obj_flags *index_column_flags) +bool ha_mroonga::find_index_column_flags(KEY *key, grn_column_flags *index_column_flags) { MRN_DBUG_ENTER_METHOD(); bool found = false; @@ -9604,154 +10077,51 @@ bool ha_mroonga::should_normalize(Field *field) const DBUG_RETURN(need_normalize_p); } -bool ha_mroonga::is_temporary_table_name(const char *name) const -{ - MRN_DBUG_ENTER_METHOD(); - DBUG_PRINT("info", ("mroonga: table name = %s", name)); -#ifdef MRN_USE_MYSQL_DATA_HOME - bool temporary_table_name_p = false; - if (name[0] != '.') { - int len = strlen(name); - int mysql_data_home_len = strlen(mysql_data_home); - if (len < mysql_data_home_len || - strncmp(name, mysql_data_home, mysql_data_home_len) || - !strchr(&name[mysql_data_home_len], FN_LIBCHAR)) { - temporary_table_name_p = true; - } - } -#else - bool temporary_table_name_p = (name[0] != '.'); -#endif - DBUG_RETURN(temporary_table_name_p); -} - -void ha_mroonga::check_count_skip(key_part_map start_key_part_map, - key_part_map end_key_part_map, bool fulltext) +void ha_mroonga::check_count_skip(key_part_map target_key_part_map) { MRN_DBUG_ENTER_METHOD(); if (!is_enable_optimization()) { - DBUG_PRINT("info", ("mroonga: count skip: optimization is disabled")); + GRN_LOG(ctx, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] optimization is disabled"); count_skip = false; DBUG_VOID_RETURN; } - st_select_lex *select_lex = table->pos_in_table_list->select_lex; - - if ( - thd_sql_command(ha_thd()) == SQLCOM_SELECT && - select_lex->item_list.elements == 1 && - !select_lex->group_list.elements && - !MRN_SELECT_LEX_GET_HAVING_COND(select_lex) && - select_lex->table_list.elements == 1 - ) { - Item *info = (Item *) select_lex->item_list.first_node()->info; - if ( - info->type() != Item::SUM_FUNC_ITEM || - ((Item_sum *) info)->sum_func() != Item_sum::COUNT_FUNC || - ((Item_sum *) info)->nest_level || - ((Item_sum *) info)->aggr_level || - ((Item_sum *) info)->max_arg_level != -1 || - ((Item_sum *) info)->max_sum_func_level != -1 - ) { - DBUG_PRINT("info", ("mroonga: count skip: sum func is not match")); - count_skip = false; - DBUG_VOID_RETURN; - } + if (thd_sql_command(ha_thd()) != SQLCOM_SELECT) { + GRN_LOG(ctx, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not SELECT"); + count_skip = false; + DBUG_VOID_RETURN; + } - uint i = 0; - Item *where; - if (fulltext) { - DBUG_PRINT("info", ("mroonga: count skip: fulltext")); - where = MRN_SELECT_LEX_GET_WHERE_COND(select_lex); - if (!where || - where->type() != Item::FUNC_ITEM || - ((Item_func *)where)->functype() != Item_func::FT_FUNC) { - DBUG_PRINT("info", ("mroonga: count skip: ft func is not match")); - count_skip = false; - DBUG_VOID_RETURN; - } - if (select_lex->select_n_where_fields != 1) { - DBUG_PRINT("info", - ("mroonga: count skip: " - "where clause is not fulltext search only")); - count_skip = false; - DBUG_VOID_RETURN; - } - if (share->wrapper_mode && - !(wrap_handler->ha_table_flags() & HA_NO_TRANSACTIONS)) { - DBUG_PRINT("info", ("mroonga: count skip: transactional wrapper mode")); - count_skip = false; - DBUG_VOID_RETURN; - } - DBUG_PRINT("info", ("mroonga: count skip: skip enabled")); - count_skip = true; - mrn_count_skip++; - DBUG_VOID_RETURN; - } else if (share->wrapper_mode) { - DBUG_PRINT("info", ("mroonga: count skip: wrapper mode")); - count_skip = false; - DBUG_VOID_RETURN; - } else { - DBUG_PRINT("info", ("mroonga: count skip: without fulltext")); - uint key_nr = active_index; - KEY *key_info = &(table->key_info[key_nr]); - KEY_PART_INFO *key_part = key_info->key_part; - for (where = MRN_SELECT_LEX_GET_WHERE_COND(select_lex); - where; - where = where->next) { - Item *target = where; - - if (where->type() == Item::FUNC_ITEM) { - Item_func *func_item = static_cast(where); - if (func_item->argument_count() == 0) { - break; - } - target = func_item->key_item(); - where = where->next; - if (func_item->arguments()[0] == where) { - uint n_args = func_item->argument_count(); - for (; n_args > 0; --n_args) { - where = where->next; - } - } - } + if (share->wrapper_mode && + !(wrap_handler->ha_table_flags() & HA_NO_TRANSACTIONS)) { + GRN_LOG(ctx, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] wrapped engine is transactional"); + count_skip = false; + DBUG_VOID_RETURN; + } - if (target->type() == Item::FIELD_ITEM) - { - Field *field = ((Item_field *)target)->field; - if (!field) - break; - if (field->table != table) - break; - uint j; - for (j = 0; j < KEY_N_KEY_PARTS(key_info); j++) { - if (key_part[j].field == field) - { - if (!(start_key_part_map >> j) && !(end_key_part_map >> j)) - j = KEY_N_KEY_PARTS(key_info); - else - i++; - break; - } - } - if (j >= KEY_N_KEY_PARTS(key_info)) - break; - } - if (i >= select_lex->select_n_where_fields) - { - DBUG_PRINT("info", ("mroonga: count skip: skip enabled")); - count_skip = true; - mrn_count_skip++; - DBUG_VOID_RETURN; - } - } - DBUG_PRINT("info", ("mroonga: count skip: skip disabled")); - } + st_select_lex *select_lex = table->pos_in_table_list->select_lex; + KEY *key_info = NULL; + if (active_index != MAX_KEY) { + key_info = &(table->key_info[active_index]); + } + mrn::CountSkipChecker checker(ctx, + table, + select_lex, + key_info, + target_key_part_map, + !share->wrapper_mode); + if (checker.check()) { + count_skip = true; + mrn_count_skip++; + DBUG_VOID_RETURN; + } else { + count_skip = false; + DBUG_VOID_RETURN; } - DBUG_PRINT("info", ("mroonga: count skip: select type is not match")); - count_skip = false; - DBUG_VOID_RETURN; } bool ha_mroonga::is_grn_zero_column_value(grn_obj *column, grn_obj *value) @@ -9861,15 +10231,22 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys, if (!converter.is_convertable(where)) { DBUG_PRINT("info", ("mroonga: fast_order_limit = false: " - "not groonga layer condition search")); + "not Groonga layer condition search")); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + unsigned int n_match_againsts = converter.count_match_against(where); + if (n_match_againsts == 0) { + DBUG_PRINT("info", + ("mroonga: fast_order_limit = false: " + "Groonga layer condition but not fulltext search")); fast_order_limit = false; DBUG_VOID_RETURN; } - match_against = converter.find_match_against(where); - if (!match_against) { + if (n_match_againsts > 1) { DBUG_PRINT("info", ("mroonga: fast_order_limit = false: " - "groonga layer condition but not fulltext search")); + "MATCH AGAINST must be only one")); fast_order_limit = false; DBUG_VOID_RETURN; } @@ -9890,8 +10267,7 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys, if (item->type() == Item::FIELD_ITEM) { Field *field = static_cast(item)->field; - const char *column_name = field->field_name; - int column_name_size = strlen(column_name); + mrn::ColumnName column_name(field->field_name); if (should_normalize(field)) { @@ -9906,7 +10282,8 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys, if (is_storage_mode) { (*sort_keys)[i].key = grn_obj_column(ctx, matched_record_keys, - column_name, column_name_size); + column_name.c_str(), + column_name.length()); } else { if (is_primary_key_field(field)) { (*sort_keys)[i].key = grn_obj_column(ctx, matched_record_keys, @@ -10365,6 +10742,20 @@ int ha_mroonga::generic_store_bulk_geometry(Field *field, grn_obj *buf) DBUG_RETURN(error); } +#ifdef MRN_HAVE_MYSQL_TYPE_JSON +int ha_mroonga::generic_store_bulk_json(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + String buffer; + Field_json *json = static_cast(field); + String *value = json->val_str(&buffer, NULL); + grn_obj_reinit(ctx, buf, GRN_DB_TEXT, 0); + GRN_TEXT_SET(ctx, buf, value->ptr(), value->length()); + DBUG_RETURN(error); +} +#endif + int ha_mroonga::generic_store_bulk(Field *field, grn_obj *buf) { MRN_DBUG_ENTER_METHOD(); @@ -10455,6 +10846,11 @@ int ha_mroonga::generic_store_bulk(Field *field, grn_obj *buf) case MYSQL_TYPE_GEOMETRY: error = generic_store_bulk_geometry(field, buf); break; +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + case MYSQL_TYPE_JSON: + error = generic_store_bulk_json(field, buf); + break; +#endif default: error = HA_ERR_UNSUPPORTED; break; @@ -10815,6 +11211,18 @@ void ha_mroonga::storage_store_field_geometry(Field *field, DBUG_VOID_RETURN; } +#ifdef MRN_HAVE_MYSQL_TYPE_JSON +void ha_mroonga::storage_store_field_json(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + Field_json *json = static_cast(field); + json->store(value, value_length, field->charset()); + DBUG_VOID_RETURN; +} +#endif + void ha_mroonga::storage_store_field(Field *field, const char *value, uint value_length) { @@ -10898,6 +11306,11 @@ void ha_mroonga::storage_store_field(Field *field, case MYSQL_TYPE_GEOMETRY: storage_store_field_geometry(field, value, value_length); break; +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + case MYSQL_TYPE_JSON: + storage_store_field_json(field, value, value_length); + break; +#endif } } @@ -10906,6 +11319,10 @@ void ha_mroonga::storage_store_field_column(Field *field, bool is_primary_key, { MRN_DBUG_ENTER_METHOD(); + if (!grn_columns[nth_column]) { + DBUG_VOID_RETURN; + } + grn_obj *column = grn_columns[nth_column]; grn_id range_id = grn_obj_get_range(ctx, column); grn_obj *range = grn_column_ranges[nth_column]; @@ -11041,6 +11458,11 @@ void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data, for (i = 0; i < n_columns; i++) { Field *field = table->field[i]; +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif if ( !bitmap_is_set(table->read_set, field->field_index) && !bitmap_is_set(table->write_set, field->field_index) && @@ -11658,8 +12080,10 @@ int ha_mroonga::storage_encode_multiple_column_key(KEY *key_info, } int ha_mroonga::storage_encode_multiple_column_key_range(KEY *key_info, - const key_range *start, - const key_range *end, + const uchar *start, + uint start_size, + const uchar *end, + uint end_size, uchar *min_buffer, uint *min_encoded_size, uchar *max_buffer, @@ -11671,14 +12095,14 @@ int ha_mroonga::storage_encode_multiple_column_key_range(KEY *key_info, uint encoded_key_size = codec.size(); if (start) { memset(min_buffer, 0, encoded_key_size); - error = codec.encode(start->key, start->length, + error = codec.encode(start, start_size, min_buffer, min_encoded_size); // TODO: handle error? *min_encoded_size = encoded_key_size; } if (end) { memset(max_buffer, 0xff, encoded_key_size); - error = codec.encode(end->key, end->length, + error = codec.encode(end, end_size, max_buffer, max_encoded_size); // TODO: handle error? *max_encoded_size = encoded_key_size; @@ -11686,6 +12110,40 @@ int ha_mroonga::storage_encode_multiple_column_key_range(KEY *key_info, DBUG_RETURN(error); } +int ha_mroonga::storage_encode_multiple_column_key_range(KEY *key_info, + const key_range *start, + const key_range *end, + uchar *min_buffer, + uint *min_encoded_size, + uchar *max_buffer, + uint *max_encoded_size) +{ + MRN_DBUG_ENTER_METHOD(); + + const uchar *start_data = NULL; + uint start_size = 0; + const uchar *end_data = NULL; + uint end_size = 0; + if (start) { + start_data = start->key; + start_size = start->length; + } + if (end) { + end_data = end->key; + end_size = end->length; + } + + int error = storage_encode_multiple_column_key_range(key_info, + start_data, start_size, + end_data, end_size, + min_buffer, + min_encoded_size, + max_buffer, + max_encoded_size); + + DBUG_RETURN(error); +} + int ha_mroonga::generic_reset() { MRN_DBUG_ENTER_METHOD(); @@ -12349,6 +12807,29 @@ int ha_mroonga::storage_delete_all_rows() { MRN_DBUG_ENTER_METHOD(); int error = generic_delete_all_rows(grn_table, __FUNCTION__); + if (!error) { + uint n_keys = table->s->keys; + for (uint i = 0; i < n_keys; i++) { + if (i == table->s->primary_key) { + continue; + } + + KEY *key_info = &(table->key_info[i]); + if (!(key_info->flags & HA_NOSAME)) { + continue; + } + + grn_obj *index_table = grn_index_tables[i]; + if (!index_table) { + continue; + } + + error = generic_delete_all_rows(index_table, __FUNCTION__); + if (error) { + break; + } + } + } DBUG_RETURN(error); } @@ -12512,6 +12993,10 @@ int ha_mroonga::truncate() } else { error = storage_truncate(); } + if (!error) { + operations_->clear(table->s->table_name.str, + table->s->table_name.length); + } DBUG_RETURN(error); } @@ -12592,6 +13077,7 @@ double ha_mroonga::read_time(uint index, uint ranges, ha_rows rows) DBUG_RETURN(time); } +#ifdef MRN_HANDLER_HAVE_KEYS_TO_USE_FOR_SCANNING const key_map *ha_mroonga::wrapper_keys_to_use_for_scanning() { const key_map *res; @@ -12622,6 +13108,7 @@ const key_map *ha_mroonga::keys_to_use_for_scanning() } DBUG_RETURN(key_map); } +#endif ha_rows ha_mroonga::wrapper_estimate_rows_upper_bound() { @@ -12776,11 +13263,16 @@ int ha_mroonga::wrapper_rename_index(const char *from, const char *to, for (i = 0; i < tmp_table_share->keys; i++) { const char *mysql_index_name = tmp_table_share->key_info[i].name; mrn::IndexTableName from_index_table_name(from_table_name, mysql_index_name); - mrn::IndexTableName to_index_table_name(to_table_name, mysql_index_name); + mrn::IndexTableName to_index_table_name(to_table_name, mysql_index_name); grn_obj *index_table; index_table = grn_ctx_get(ctx, from_index_table_name.c_str(), from_index_table_name.length()); + if (!index_table) { + index_table = grn_ctx_get(ctx, + from_index_table_name.old_c_str(), + from_index_table_name.old_length()); + } if (index_table) { rc = grn_table_rename(ctx, index_table, to_index_table_name.c_str(), @@ -12846,6 +13338,11 @@ int ha_mroonga::storage_rename_table(const char *from, const char *to, index_table = grn_ctx_get(ctx, from_index_table_name.c_str(), from_index_table_name.length()); + if (!index_table) { + index_table = grn_ctx_get(ctx, + from_index_table_name.old_c_str(), + from_index_table_name.old_length()); + } if (index_table) { rc = grn_table_rename(ctx, index_table, to_index_table_name.c_str(), @@ -12899,34 +13396,32 @@ int ha_mroonga::storage_rename_foreign_key(MRN_SHARE *tmp_share, MRN_DBUG_ENTER_METHOD(); for (i = 0; i < n_columns; ++i) { Field *field = tmp_table_share->field[i]; - const char *column_name = field->field_name; - uint column_name_size = strlen(column_name); - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (!is_foreign_key_field(from_table_name, field->field_name)) { continue; } - column = grn_obj_column(ctx, grn_table, - column_name, column_name_size); + grn_obj *grn_from_table = grn_ctx_get(ctx, from_table_name, -1); + mrn::ColumnName column_name(field->field_name); + column = grn_obj_column(ctx, + grn_from_table, + column_name.c_str(), + column_name.length()); if (!column) { continue; } grn_id ref_table_id = grn_obj_get_range(ctx, column); grn_obj *ref_table = grn_ctx_at(ctx, ref_table_id); - if (ref_table->header.type != GRN_TABLE_NO_KEY && - ref_table->header.type != GRN_TABLE_HASH_KEY && - ref_table->header.type != GRN_TABLE_PAT_KEY && - ref_table->header.type != GRN_TABLE_DAT_KEY) { - continue; - } - mrn::IndexColumnName from_index_column_name(from_table_name, column_name); + mrn::IndexColumnName from_index_column_name(from_table_name, + column_name.c_str()); ref_column = grn_obj_column(ctx, ref_table, from_index_column_name.c_str(), from_index_column_name.length()); if (!ref_column) { continue; } - mrn::IndexColumnName to_index_column_name(to_table_name, column_name); + mrn::IndexColumnName to_index_column_name(to_table_name, + column_name.c_str()); rc = grn_column_rename(ctx, ref_column, to_index_column_name.c_str(), to_index_column_name.length()); @@ -13109,6 +13604,11 @@ int ha_mroonga::generic_disable_index(int i, KEY *key_info) grn_obj *index_table = grn_ctx_get(ctx, index_table_name.c_str(), index_table_name.length()); + if (!index_table) { + index_table = grn_ctx_get(ctx, + index_table_name.old_c_str(), + index_table_name.old_length()); + } if (index_table) { grn_obj_remove(ctx, index_table); } @@ -13125,6 +13625,42 @@ int ha_mroonga::generic_disable_index(int i, KEY *key_info) DBUG_RETURN(error); } +int ha_mroonga::wrapper_disable_indexes_mroonga(uint mode) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE || mode == HA_KEY_SWITCH_ALL) { + uint i; + for (i = 0; i < table_share->keys; i++) { + if (i == table->s->primary_key) { + continue; + } + if (share->wrap_key_nr[i] < MAX_KEY) { + continue; + } + if (!grn_index_tables[i]) { + DBUG_PRINT("info", ("mroonga: keys are disabled already %u", i)); + DBUG_RETURN(0); + } + } + KEY *key_info = table_share->key_info; + for (i = 0; i < table_share->keys; i++) { + if (!(key_info[i].flags & HA_FULLTEXT) && + !mrn_is_geo_key(&key_info[i])) { + continue; + } + + int sub_error = generic_disable_index(i, key_info); + if (error != 0 && sub_error != 0) { + error = sub_error; + } + } + } else { + error = HA_ERR_WRONG_COMMAND; + } + DBUG_RETURN(error); +} + int ha_mroonga::wrapper_disable_indexes(uint mode) { int error = 0; @@ -13138,35 +13674,7 @@ int ha_mroonga::wrapper_disable_indexes(uint mode) error = 0; } if (!error) { - if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE || mode == HA_KEY_SWITCH_ALL) { - uint i; - for (i = 0; i < table_share->keys; i++) { - if (i == table->s->primary_key) { - continue; - } - if (share->wrap_key_nr[i] < MAX_KEY) { - continue; - } - if (!grn_index_tables[i]) { - DBUG_PRINT("info", ("mroonga: keys are disabled already %u", i)); - DBUG_RETURN(0); - } - } - KEY *key_info = table_share->key_info; - for (i = 0; i < table_share->keys; i++) { - if (!(key_info[i].flags & HA_FULLTEXT) && - !mrn_is_geo_key(&key_info[i])) { - continue; - } - - int sub_error = generic_disable_index(i, key_info); - if (error != 0 && sub_error != 0) { - error = sub_error; - } - } - } else { - error = HA_ERR_WRONG_COMMAND; - } + error = wrapper_disable_indexes_mroonga(mode); } DBUG_RETURN(error); } @@ -13220,9 +13728,9 @@ int ha_mroonga::disable_indexes(uint mode) DBUG_RETURN(error); } -int ha_mroonga::wrapper_enable_indexes(uint mode) +int ha_mroonga::wrapper_enable_indexes_mroonga(uint mode) { - int error = 0, tmp_error = 0; + int error = 0; MRN_DBUG_ENTER_METHOD(); if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE || mode == HA_KEY_SWITCH_ALL) { uint i, j; @@ -13293,8 +13801,17 @@ int ha_mroonga::wrapper_enable_indexes(uint mode) MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); } else { - tmp_error = HA_ERR_WRONG_COMMAND; + error = HA_ERR_WRONG_COMMAND; } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_enable_indexes(uint mode) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + + int mroonga_error = wrapper_enable_indexes_mroonga(mode); MRN_SET_WRAP_SHARE_KEY(share, table->s); MRN_SET_WRAP_TABLE_KEY(this, table); @@ -13302,7 +13819,7 @@ int ha_mroonga::wrapper_enable_indexes(uint mode) MRN_SET_BASE_SHARE_KEY(share, table->s); MRN_SET_BASE_TABLE_KEY(this, table); if (error == HA_ERR_WRONG_COMMAND) { - error = tmp_error; + error = mroonga_error; } DBUG_RETURN(error); } @@ -13416,10 +13933,10 @@ int ha_mroonga::storage_check(THD* thd, HA_CHECK_OPT* check_opt) { MRN_DBUG_ENTER_METHOD(); mrn::DatabaseRepairer repairer(ctx, thd); - if (repairer.repair()) { - DBUG_RETURN(HA_ADMIN_OK); - } else { + if (repairer.is_corrupt()) { DBUG_RETURN(HA_ADMIN_CORRUPT); + } else { + DBUG_RETURN(HA_ADMIN_OK); } } @@ -13575,10 +14092,16 @@ int ha_mroonga::wrapper_recreate_indexes(THD *thd) "%s.%s", index_table_name.c_str(), INDEX_COLUMN_NAME); remove_grn_obj_force(index_column_full_name); remove_grn_obj_force(index_table_name.c_str()); + + char index_column_full_old_name[MRN_MAX_PATH_SIZE]; + snprintf(index_column_full_old_name, MRN_MAX_PATH_SIZE, + "%s.%s", index_table_name.old_c_str(), INDEX_COLUMN_NAME); + remove_grn_obj_force(index_column_full_old_name); + remove_grn_obj_force(index_table_name.old_c_str()); + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); } - error = wrapper_create_index(table_share->normalized_path.str, table, - NULL, share, mapper.table_name()); + error = wrapper_create_index(table_share->normalized_path.str, table, share); if (error) DBUG_RETURN(error); error = wrapper_open_indexes(table_share->normalized_path.str); @@ -13627,6 +14150,12 @@ int ha_mroonga::storage_recreate_indexes(THD *thd) "%s.%s", index_table_name.c_str(), INDEX_COLUMN_NAME); remove_grn_obj_force(index_column_full_name); remove_grn_obj_force(index_table_name.c_str()); + + char index_column_full_old_name[MRN_MAX_PATH_SIZE]; + snprintf(index_column_full_old_name, MRN_MAX_PATH_SIZE, + "%s.%s", index_table_name.old_c_str(), INDEX_COLUMN_NAME); + remove_grn_obj_force(index_column_full_old_name); + remove_grn_obj_force(index_table_name.old_c_str()); } int error; @@ -13969,8 +14498,8 @@ enum_alter_inplace_result ha_mroonga::wrapper_check_if_supported_inplace_alter( ( Alter_inplace_info::ADD_COLUMN | Alter_inplace_info::DROP_COLUMN | - Alter_inplace_info::ALTER_COLUMN_TYPE | - Alter_inplace_info::ALTER_COLUMN_ORDER | + MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_TYPE | + MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::ALTER_COLUMN_NULLABLE | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE | Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE | @@ -14082,15 +14611,22 @@ enum_alter_inplace_result ha_mroonga::storage_check_if_supported_inplace_alter( Alter_inplace_info *ha_alter_info) { MRN_DBUG_ENTER_METHOD(); + Alter_inplace_info::HA_ALTER_FLAGS explicitly_unsupported_flags = + Alter_inplace_info::ADD_FOREIGN_KEY | + Alter_inplace_info::DROP_FOREIGN_KEY; Alter_inplace_info::HA_ALTER_FLAGS supported_flags = Alter_inplace_info::ADD_INDEX | Alter_inplace_info::DROP_INDEX | Alter_inplace_info::ADD_UNIQUE_INDEX | Alter_inplace_info::DROP_UNIQUE_INDEX | - Alter_inplace_info::ADD_COLUMN | + MRN_ALTER_INPLACE_INFO_ADD_VIRTUAL_COLUMN | + MRN_ALTER_INPLACE_INFO_ADD_STORED_BASE_COLUMN | + MRN_ALTER_INPLACE_INFO_ADD_STORED_GENERATED_COLUMN | Alter_inplace_info::DROP_COLUMN | Alter_inplace_info::ALTER_COLUMN_NAME; - if (ha_alter_info->handler_flags & supported_flags) { + if (ha_alter_info->handler_flags & explicitly_unsupported_flags) { + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } else if (ha_alter_info->handler_flags & supported_flags) { DBUG_RETURN(HA_ALTER_INPLACE_EXCLUSIVE_LOCK); } else { DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); @@ -14284,18 +14820,11 @@ bool ha_mroonga::wrapper_inplace_alter_table( need_fill_index = true; } if (!error && need_fill_index) { - my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(table->record[0], altered_table->record[0]); - uint n_columns = altered_table->s->fields; - for (i = 0; i < n_columns; ++i) { - Field *field = altered_table->field[i]; - field->move_field_offset(ptr_diff); - } + my_ptrdiff_t diff = + PTR_BYTE_DIFF(table->record[0], altered_table->record[0]); + mrn::TableFieldsOffsetMover mover(altered_table, diff); error = wrapper_fill_indexes(ha_thd(), altered_table->key_info, index_columns, ha_alter_info->key_count); - for (i = 0; i < n_columns; ++i) { - Field *field = altered_table->field[i]; - field->move_field_offset(-ptr_diff); - } } bitmap_set_all(table->read_set); @@ -14354,31 +14883,12 @@ bool ha_mroonga::wrapper_inplace_alter_table( DBUG_RETURN(result); } -bool ha_mroonga::storage_inplace_alter_table_index( +bool ha_mroonga::storage_inplace_alter_table_add_index( TABLE *altered_table, Alter_inplace_info *ha_alter_info) { MRN_DBUG_ENTER_METHOD(); - bool have_error = false; - int error = 0; - uint n_keys; - uint i, j = 0; - KEY *key_info = table_share->key_info; - mrn::PathMapper mapper(share->table_name); - n_keys = ha_alter_info->index_drop_count; - for (i = 0; i < n_keys; ++i) { - KEY *key = ha_alter_info->index_drop_buffer[i]; - while (strcmp(key_info[j].name, key->name)) { - ++j; - } - error = drop_index(share, j); - if (error) - DBUG_RETURN(true); - grn_index_tables[j] = NULL; - grn_index_columns[j] = NULL; - } - MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, ha_alter_info->key_count); MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_columns, @@ -14424,11 +14934,11 @@ bool ha_mroonga::storage_inplace_alter_table_index( KEY *p_key_info = &table->key_info[table_share->primary_key]; mrn_set_bitmap_by_key(table->read_set, p_key_info); } - n_keys = ha_alter_info->index_add_count; - for (i = 0; i < n_keys; ++i) { + int error = 0; + uint n_keys = ha_alter_info->index_add_count; + for (uint i = 0; i < n_keys; ++i) { uint key_pos = ha_alter_info->index_add_buffer[i]; - KEY *key = - &altered_table->key_info[key_pos]; + KEY *key = &altered_table->key_info[key_pos]; if (share->disable_keys && !(key->flags & HA_NOSAME)) { continue; // key is disabled } @@ -14437,6 +14947,7 @@ bool ha_mroonga::storage_inplace_alter_table_index( break; } DBUG_PRINT("info", ("mroonga: add key pos=%u", key_pos)); + mrn::PathMapper mapper(share->table_name); if ((error = storage_create_index(table, mapper.table_name(), grn_table, tmp_share, key, index_tables, index_columns, key_pos))) @@ -14464,12 +14975,9 @@ bool ha_mroonga::storage_inplace_alter_table_index( } } if (!error && have_multiple_column_index) { - my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(table->record[0], altered_table->record[0]); - uint n_columns = altered_table->s->fields; - for (i = 0; i < n_columns; ++i) { - Field *field = altered_table->field[i]; - field->move_field_offset(ptr_diff); - } + my_ptrdiff_t diff = + PTR_BYTE_DIFF(table->record[0], altered_table->record[0]); + mrn::TableFieldsOffsetMover mover(altered_table, diff); error = storage_add_index_multiple_columns(altered_table->key_info, ha_alter_info->key_count, index_tables, @@ -14480,17 +14988,14 @@ bool ha_mroonga::storage_inplace_alter_table_index( } else if (error) { my_message(error, "failed to create multiple column index", MYF(0)); } - for (i = 0; i < n_columns; ++i) { - Field *field = altered_table->field[i]; - field->move_field_offset(-ptr_diff); - } } bitmap_set_all(table->read_set); + bool have_error = false; if (error) { n_keys = ha_alter_info->index_add_count; - for (i = 0; i < n_keys; ++i) { + for (uint i = 0; i < n_keys; ++i) { uint key_pos = ha_alter_info->index_add_buffer[i]; KEY *key = &altered_table->key_info[key_pos]; @@ -14513,6 +15018,33 @@ bool ha_mroonga::storage_inplace_alter_table_index( DBUG_RETURN(have_error); } +bool ha_mroonga::storage_inplace_alter_table_drop_index( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_error = false; + uint n_keys; + uint i, j = 0; + KEY *key_info = table_share->key_info; + mrn::PathMapper mapper(share->table_name); + n_keys = ha_alter_info->index_drop_count; + for (i = 0; i < n_keys; ++i) { + KEY *key = ha_alter_info->index_drop_buffer[i]; + while (strcmp(key_info[j].name, key->name) != 0) { + ++j; + } + int error = drop_index(share, j); + if (error != 0) + DBUG_RETURN(true); + grn_index_tables[j] = NULL; + grn_index_columns[j] = NULL; + } + + DBUG_RETURN(have_error); +} + bool ha_mroonga::storage_inplace_alter_table_add_column( TABLE *altered_table, Alter_inplace_info *ha_alter_info) @@ -14566,9 +15098,14 @@ bool ha_mroonga::storage_inplace_alter_table_add_column( } Field *field = altered_table->s->field[i]; - const char *column_name = field->field_name; - int column_name_size = strlen(column_name); +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field)) { + continue; + } +#endif + + mrn::ColumnName column_name(field->field_name); int error = mrn_add_column_param(tmp_share, field, i); if (error) { have_error = true; @@ -14593,20 +15130,114 @@ bool ha_mroonga::storage_inplace_alter_table_add_column( char *col_path = NULL; // we don't specify path grn_obj *column_obj = - grn_column_create(ctx, table_obj, column_name, column_name_size, + grn_column_create(ctx, table_obj, + column_name.c_str(), + column_name.length(), col_path, col_flags, col_type); if (ctx->rc) { error = ER_WRONG_COLUMN_NAME; my_message(error, ctx->errbuf, MYF(0)); have_error = true; - } - if (column_obj) { - grn_obj_unlink(ctx, column_obj); + break; } - if (have_error) { - break; +#ifdef MRN_SUPPORT_GENERATED_COLUMNS + if (MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field)) { +# ifndef MRN_MARIADB_P + MY_BITMAP generated_column_bitmap; + if (bitmap_init(&generated_column_bitmap, NULL, + altered_table->s->fields, false)) { + error = HA_ERR_OUT_OF_MEM; + my_message(ER_OUTOFMEMORY, + "mroonga: storage: " + "failed to allocate memory for getting generated value", + MYF(0)); + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } + mrn::SmartBitmap smart_generated_column_bitmap(&generated_column_bitmap); + bitmap_set_bit(&generated_column_bitmap, field->field_index); +# endif + + my_ptrdiff_t diff = + PTR_BYTE_DIFF(table->record[0], altered_table->record[0]); + mrn::TableFieldsOffsetMover mover(altered_table, diff); + + error = storage_rnd_init(true); + if (error) { + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } + + Field *altered_field = altered_table->field[i]; + grn_obj new_value; + GRN_VOID_INIT(&new_value); + mrn::SmartGrnObj smart_new_value(ctx, &new_value); + while (!have_error) { + int next_error = storage_rnd_next(table->record[0]); + if (next_error == HA_ERR_END_OF_FILE) { + break; + } else if (next_error != 0) { + error = next_error; + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } + +# ifdef MRN_MARIADB_P + MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(altered_table, altered_field); +# else + if (update_generated_write_fields(&generated_column_bitmap, altered_table)) { + error = ER_ERROR_ON_WRITE; + my_message(error, + "mroonga: storage: " + "failed to update generated value for updating column", + MYF(0)); + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } +# endif + + error = mrn_change_encoding(ctx, altered_field->charset()); + if (error) { + my_message(error, + "mroonga: storage: " + "failed to change encoding to store generated value", + MYF(0)); + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } + error = generic_store_bulk(altered_field, &new_value); + if (error) { + my_message(error, + "mroonga: storage: " + "failed to get generated value for updating column", + MYF(0)); + have_error = true; + grn_obj_remove(ctx, column_obj); + break; + } + + grn_obj_set_value(ctx, column_obj, record_id, &new_value, GRN_OBJ_SET); + if (ctx->rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + break; + } + } + + int end_error = storage_rnd_end(); + if (end_error != 0 && error == 0) { + error = end_error; + grn_obj_remove(ctx, column_obj); + break; + } } +#endif } grn_obj_unlink(ctx, table_obj); @@ -14736,16 +15367,14 @@ bool ha_mroonga::storage_inplace_alter_table( have_error = true; } - Alter_inplace_info::HA_ALTER_FLAGS index_related_flags = - Alter_inplace_info::ADD_INDEX | + Alter_inplace_info::HA_ALTER_FLAGS drop_index_related_flags = Alter_inplace_info::DROP_INDEX | - Alter_inplace_info::ADD_UNIQUE_INDEX | Alter_inplace_info::DROP_UNIQUE_INDEX | - Alter_inplace_info::ADD_PK_INDEX | Alter_inplace_info::DROP_PK_INDEX; if (!have_error && - (ha_alter_info->handler_flags & index_related_flags)) { - have_error = storage_inplace_alter_table_index(altered_table, ha_alter_info); + (ha_alter_info->handler_flags & drop_index_related_flags)) { + have_error = storage_inplace_alter_table_drop_index(altered_table, + ha_alter_info); } Alter_inplace_info::HA_ALTER_FLAGS add_column_related_flags = @@ -14769,6 +15398,16 @@ bool ha_mroonga::storage_inplace_alter_table( have_error = storage_inplace_alter_table_rename_column(altered_table, ha_alter_info); } + Alter_inplace_info::HA_ALTER_FLAGS add_index_related_flags = + Alter_inplace_info::ADD_INDEX | + Alter_inplace_info::ADD_UNIQUE_INDEX | + Alter_inplace_info::ADD_PK_INDEX; + if (!have_error && + (ha_alter_info->handler_flags & add_index_related_flags)) { + have_error = storage_inplace_alter_table_add_index(altered_table, + ha_alter_info); + } + DBUG_RETURN(have_error); } @@ -15874,26 +16513,22 @@ char *ha_mroonga::storage_get_foreign_key_create_info() create_info_str.length(0); for (i = 0; i < n_columns; ++i) { Field *field = table_share->field[i]; - const char *column_name = field->field_name; - uint column_name_size = strlen(column_name); - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (!is_foreign_key_field(table_share->table_name.str, + field->field_name)) { continue; } - column = grn_obj_column(ctx, grn_table, - column_name, column_name_size); + mrn::ColumnName column_name(field->field_name); + column = grn_obj_column(ctx, + grn_table, + column_name.c_str(), + column_name.length()); if (!column) { continue; } grn_id ref_table_id = grn_obj_get_range(ctx, column); grn_obj *ref_table = grn_ctx_at(ctx, ref_table_id); - if (ref_table->header.type != GRN_TABLE_NO_KEY && - ref_table->header.type != GRN_TABLE_HASH_KEY && - ref_table->header.type != GRN_TABLE_PAT_KEY && - ref_table->header.type != GRN_TABLE_DAT_KEY) { - continue; - } char ref_table_buff[NAME_LEN + 1]; int ref_table_name_length = grn_obj_name(ctx, ref_table, ref_table_buff, NAME_LEN); @@ -15903,14 +16538,18 @@ char *ha_mroonga::storage_get_foreign_key_create_info() DBUG_RETURN(NULL); } create_info_str.q_append(",\n CONSTRAINT ", 15); - append_identifier(ha_thd(), &create_info_str, column_name, - column_name_size); + append_identifier(ha_thd(), + &create_info_str, + column_name.c_str(), + column_name.length()); if (create_info_str.reserve(14)) { DBUG_RETURN(NULL); } create_info_str.q_append(" FOREIGN KEY (", 14); - append_identifier(ha_thd(), &create_info_str, column_name, - column_name_size); + append_identifier(ha_thd(), + &create_info_str, + column_name.c_str(), + column_name.length()); if (create_info_str.reserve(13)) { DBUG_RETURN(NULL); } @@ -16081,37 +16720,35 @@ int ha_mroonga::storage_get_foreign_key_list(THD *thd, MRN_DBUG_ENTER_METHOD(); for (i = 0; i < n_columns; ++i) { Field *field = table_share->field[i]; - const char *column_name = field->field_name; - uint column_name_size = strlen(column_name); - if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (!is_foreign_key_field(table_share->table_name.str, field->field_name)) { continue; } - column = grn_obj_column(ctx, grn_table, - column_name, column_name_size); + mrn::ColumnName column_name(field->field_name); + column = grn_obj_column(ctx, + grn_table, + column_name.c_str(), + column_name.length()); if (!column) { continue; } grn_id ref_table_id = grn_obj_get_range(ctx, column); grn_obj *ref_table = grn_ctx_at(ctx, ref_table_id); - if (ref_table->header.type != GRN_TABLE_NO_KEY && - ref_table->header.type != GRN_TABLE_HASH_KEY && - ref_table->header.type != GRN_TABLE_PAT_KEY && - ref_table->header.type != GRN_TABLE_DAT_KEY) { - continue; - } FOREIGN_KEY_INFO f_key_info; - f_key_info.foreign_id = thd_make_lex_string(thd, NULL, column_name, - column_name_size, TRUE); + f_key_info.foreign_id = thd_make_lex_string(thd, + NULL, + column_name.c_str(), + column_name.length(), + TRUE); f_key_info.foreign_db = thd_make_lex_string(thd, NULL, - table_share->db.str, - table_share->db.length, - TRUE); + table_share->db.str, + table_share->db.length, + TRUE); f_key_info.foreign_table = thd_make_lex_string(thd, NULL, - table_share->table_name.str, - table_share->table_name.length, - TRUE); + table_share->table_name.str, + table_share->table_name.length, + TRUE); f_key_info.referenced_db = f_key_info.foreign_db; char ref_table_buff[NAME_LEN + 1]; @@ -16124,14 +16761,22 @@ int ha_mroonga::storage_get_foreign_key_list(THD *thd, ref_table_buff, ref_table_name_length, TRUE); +#ifdef MRN_FOREIGN_KEY_USE_METHOD_ENUM + f_key_info.update_method = FK_OPTION_RESTRICT; + f_key_info.delete_method = FK_OPTION_RESTRICT; +#else f_key_info.update_method = thd_make_lex_string(thd, NULL, "RESTRICT", 8, TRUE); f_key_info.delete_method = thd_make_lex_string(thd, NULL, "RESTRICT", 8, TRUE); +#endif f_key_info.referenced_key_name = thd_make_lex_string(thd, NULL, "PRIMARY", 7, TRUE); - LEX_STRING *field_name = thd_make_lex_string(thd, NULL, column_name, - column_name_size, TRUE); + LEX_STRING *field_name = thd_make_lex_string(thd, + NULL, + column_name.c_str(), + column_name.length(), + TRUE); f_key_info.foreign_fields.push_back(field_name); char ref_path[FN_REFLEN + 1]; @@ -16333,6 +16978,7 @@ void ha_mroonga::free_foreign_key_create_info(char* str) DBUG_VOID_RETURN; } +#ifdef MRN_RBR_UPDATE_NEED_ALL_COLUMNS bool ha_mroonga::check_written_by_row_based_binlog() { MRN_DBUG_ENTER_METHOD(); @@ -16366,6 +17012,7 @@ bool ha_mroonga::check_written_by_row_based_binlog() DBUG_RETURN(true); } +#endif #ifdef MRN_HAVE_HA_REBIND_PSI void ha_mroonga::wrapper_unbind_psi() @@ -16495,3 +17142,20 @@ my_bool ha_mroonga::register_query_cache_table(THD *thd, #ifdef __cplusplus } #endif + +namespace mrn { + namespace variables { + ulonglong get_boolean_mode_syntax_flags(THD *thd) { + ulonglong flags = BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT; +#ifdef MRN_SUPPORT_THDVAR_SET + flags = THDVAR(thd, boolean_mode_syntax_flags); +#endif + return flags; + } + + ActionOnError get_action_on_fulltext_query_error(THD *thd) { + ulong action = THDVAR(thd, action_on_fulltext_query_error); + return static_cast(action); + } + } +} diff --git a/storage/mroonga/ha_mroonga.def b/storage/mroonga/ha_mroonga.def index 5770cde72e74f..7f8394fe4ca33 100644 --- a/storage/mroonga/ha_mroonga.def +++ b/storage/mroonga/ha_mroonga.def @@ -13,3 +13,6 @@ EXPORTS mroonga_escape mroonga_escape_init mroonga_escape_deinit + mroonga_normalize + mroonga_normalize_init + mroonga_normalize_deinit diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp index 37059210dd110..2533913961e1f 100644 --- a/storage/mroonga/ha_mroonga.hpp +++ b/storage/mroonga/ha_mroonga.hpp @@ -32,6 +32,14 @@ extern "C" { #include #include "mrn_mysql_compat.h" +#include +#include + +#if __cplusplus >= 201402 +# define mrn_override override +#else +# define mrn_override +#endif #if (MYSQL_VERSION_ID >= 50514 && MYSQL_VERSION_ID < 50600) # define MRN_HANDLER_HAVE_FINAL_ADD_INDEX 1 @@ -102,6 +110,13 @@ extern "C" { # define MRN_HAVE_HA_EXTRA_PREPARE_FOR_FORCED_CLOSE #endif +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +#define MRN_HAVE_HA_EXTRA_SKIP_SERIALIZABLE_DD_VIEW +#define MRN_HAVE_HA_EXTRA_BEGIN_ALTER_COPY +#define MRN_HAVE_HA_EXTRA_END_ALTER_COPY +#define MRN_HAVE_HA_EXTRA_NO_AUTOINC_LOCKING +#endif + #if MYSQL_VERSION_ID >= 50607 && \ (!defined(MRN_MARIADB_P) || MYSQL_VERSION_ID < 100008) # define MRN_HAVE_HA_EXTRA_EXPORT @@ -196,6 +211,10 @@ extern "C" { # define MRN_FOREIGN_KEY_USE_CONST_STRING #endif +#if MYSQL_VERSION_ID >= 100203 && defined(MRN_MARIADB_P) +# define MRN_FOREIGN_KEY_USE_METHOD_ENUM +#endif + #if MYSQL_VERSION_ID < 50706 || defined(MRN_MARIADB_P) # define MRN_HANDLER_IS_FATAL_ERROR_HAVE_FLAGS #endif @@ -204,6 +223,45 @@ extern "C" { # define MRN_HANDLER_HAVE_RESET_AUTO_INCREMENT #endif +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50709) || \ + (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100203) +# define MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_TYPE \ + Alter_inplace_info::ALTER_STORED_COLUMN_TYPE +# define MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_ORDER \ + Alter_inplace_info::ALTER_STORED_COLUMN_ORDER +#else +# define MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_TYPE \ + Alter_inplace_info::ALTER_COLUMN_TYPE +# define MRN_ALTER_INPLACE_INFO_ALTER_STORED_COLUMN_ORDER \ + Alter_inplace_info::ALTER_COLUMN_ORDER +#endif + +#if MYSQL_VERSION_ID >= 50700 && !defined(MRN_MARIADB_P) +# define MRN_HANDLER_RECORDS_RETURN_ERROR +#endif + +#if MYSQL_VERSION_ID < 80002 || defined(MRN_MARIADB_P) +# define MRN_HANDLER_HAVE_KEYS_TO_USE_FOR_SCANNING +#endif + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# define MRN_ST_MYSQL_PLUGIN_HAVE_CHECK_UNINSTALL +#endif + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# define MRN_HANDLER_OPEN_HAVE_TABLE_DEFINITION +# define MRN_HANDLER_CREATE_HAVE_TABLE_DEFINITION +#endif + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# define MRN_HANDLERTON_CREATE_HAVE_PARTITIONED +#endif + +#if defined(HAVE_PSI_INTERFACE) && \ + (MYSQL_VERSION_ID < 80002 || defined(MRN_MARIADB_P)) +# define MRN_HAVE_PSI_SERVER +#endif + class ha_mroonga; /* structs */ @@ -347,6 +405,8 @@ class ha_mroonga: public handler // for ft in where clause test Item_func_match *current_ft_item; + mrn::Operations *operations_; + public: ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg); ~ha_mroonga(); @@ -357,8 +417,20 @@ class ha_mroonga: public handler ulonglong table_flags() const; // required ulong index_flags(uint idx, uint part, bool all_parts) const; // required - int create(const char *name, TABLE *form, HA_CREATE_INFO *info); // required - int open(const char *name, int mode, uint test_if_locked); // required + // required + int create(const char *name, TABLE *form, HA_CREATE_INFO *info +#ifdef MRN_HANDLER_CREATE_HAVE_TABLE_DEFINITION + , + dd::Table *table_def +#endif + ) mrn_override; + // required + int open(const char *name, int mode, uint open_options +#ifdef MRN_HANDLER_OPEN_HAVE_TABLE_DEFINITION + , + const dd::Table *table_def +#endif + ) mrn_override; #ifndef MRN_HANDLER_HAVE_HA_CLOSE int close(); // required #endif @@ -419,11 +491,6 @@ class ha_mroonga: public handler #endif int index_next_same(uchar *buf, const uchar *key, uint keylen); - int read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted); - int read_range_next(); - int ft_init(); FT_INFO *ft_init_ext(uint flags, uint inx, String *key); int ft_read(uchar *buf); @@ -469,7 +536,9 @@ class ha_mroonga: public handler int truncate(); double scan_time(); double read_time(uint index, uint ranges, ha_rows rows); +#ifdef MRN_HANDLER_HAVE_KEYS_TO_USE_FOR_SCANNING const key_map *keys_to_use_for_scanning(); +#endif ha_rows estimate_rows_upper_bound(); void update_create_info(HA_CREATE_INFO* create_info); int rename_table(const char *from, const char *to); @@ -518,6 +587,11 @@ class ha_mroonga: public handler int start_stmt(THD *thd, thr_lock_type lock_type); protected: +#ifdef MRN_HANDLER_RECORDS_RETURN_ERROR + int records(ha_rows *num_rows); +#else + ha_rows records(); +#endif #ifdef MRN_HANDLER_HAVE_HA_RND_NEXT int rnd_next(uchar *buf); #endif @@ -580,6 +654,9 @@ class ha_mroonga: public handler bool have_unique_index(); + bool is_foreign_key_field(const char *table_name, + const char *field_name); + void push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag); void clear_cursor(); void clear_cursor_geo(); @@ -592,7 +669,8 @@ class ha_mroonga: public handler void remove_grn_obj_force(const char *name); int drop_index(MRN_SHARE *target_share, uint key_index); int drop_indexes_normal(const char *table_name, grn_obj *table); - int drop_indexes_multiple(const char *table_name, grn_obj *table); + int drop_indexes_multiple(const char *table_name, grn_obj *table, + const char *index_table_name_separator); int drop_indexes(const char *table_name); bool find_column_flags(Field *field, MRN_SHARE *mrn_share, int i, grn_obj_flags *column_flags); @@ -600,9 +678,10 @@ class ha_mroonga: public handler int error_code); grn_obj *find_tokenizer(KEY *key, MRN_SHARE *mrn_share, int i); grn_obj *find_tokenizer(const char *name, int name_length); + bool have_custom_normalizer(KEY *key) const; grn_obj *find_normalizer(KEY *key); grn_obj *find_normalizer(KEY *key, const char *name); - bool find_index_column_flags(KEY *key, grn_obj_flags *index_column_flags); + bool find_index_column_flags(KEY *key, grn_column_flags *index_column_flags); bool find_token_filters(KEY *key, grn_obj *token_filters); bool find_token_filters_put(grn_obj *token_filters, const char *token_filter_name, @@ -622,9 +701,7 @@ class ha_mroonga: public handler bool is_dry_write(); bool is_enable_optimization(); bool should_normalize(Field *field) const; - bool is_temporary_table_name(const char *name) const; - void check_count_skip(key_part_map start_key_part_map, - key_part_map end_key_part_map, bool fulltext); + void check_count_skip(key_part_map target_key_part_map); bool is_grn_zero_column_value(grn_obj *column, grn_obj *value); bool is_primary_key_field(Field *field) const; void check_fast_order_limit(grn_table_sort_key **sort_keys, int *n_sort_keys, @@ -652,6 +729,9 @@ class ha_mroonga: public handler int generic_store_bulk_new_decimal(Field *field, grn_obj *buf); int generic_store_bulk_blob(Field *field, grn_obj *buf); int generic_store_bulk_geometry(Field *field, grn_obj *buf); +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + int generic_store_bulk_json(Field *field, grn_obj *buf); +#endif int generic_store_bulk(Field *field, grn_obj *buf); void storage_store_field_string(Field *field, @@ -687,6 +767,10 @@ class ha_mroonga: public handler const char *value, uint value_length); void storage_store_field_geometry(Field *field, const char *value, uint value_length); +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + void storage_store_field_json(Field *field, + const char *value, uint value_length); +#endif void storage_store_field(Field *field, const char *value, uint value_length); void storage_store_field_column(Field *field, bool is_primary_key, int nth_column, grn_id record_id); @@ -731,6 +815,15 @@ class ha_mroonga: public handler int storage_encode_multiple_column_key(KEY *key_info, const uchar *key, uint key_length, uchar *buffer, uint *encoded_length); + int storage_encode_multiple_column_key_range(KEY *key_info, + const uchar *start, + uint start_size, + const uchar *end, + uint end_size, + uchar *min_buffer, + uint *min_encoded_size, + uchar *max_buffer, + uint *max_encoded_size); int storage_encode_multiple_column_key_range(KEY *key_info, const key_range *start, const key_range *end, @@ -758,9 +851,7 @@ class ha_mroonga: public handler grn_obj **index_tables, grn_obj **index_columns, MRN_SHARE *tmp_share); - int wrapper_create_index(const char *name, TABLE *table, - HA_CREATE_INFO *info, MRN_SHARE *tmp_share, - const char *grn_table_name); + int wrapper_create_index(const char *name, TABLE *table, MRN_SHARE *tmp_share); int storage_create_validate_pseudo_column(TABLE *table); #ifdef MRN_SUPPORT_FOREIGN_KEYS bool storage_create_foreign_key(TABLE *table, const char *grn_table_name, @@ -778,16 +869,18 @@ class ha_mroonga: public handler int storage_create_indexes(TABLE *table, const char *grn_table_name, grn_obj *grn_table, MRN_SHARE *tmp_share); int close_databases(); - int ensure_database_open(const char *name); + int ensure_database_open(const char *name, mrn::Database **db=NULL); int ensure_database_remove(const char *name); int wrapper_delete_table(const char *name, handlerton *wrap_handlerton, const char *table_name); int generic_delete_table(const char *name, const char *table_name); - int wrapper_open(const char *name, int mode, uint test_if_locked); + int wrapper_open(const char *name, int mode, uint open_options); int wrapper_open_indexes(const char *name); - int storage_open(const char *name, int mode, uint test_if_locked); + int storage_reindex(); + int storage_open(const char *name, int mode, uint open_options); int open_table(const char *name); int storage_open_columns(void); + void storage_close_columns(void); int storage_open_indexes(const char *name); void wrapper_overwrite_index_bits(); int wrapper_close(); @@ -872,6 +965,13 @@ class ha_mroonga: public handler void storage_info_variable(); void storage_info_variable_records(); void storage_info_variable_data_file_length(); +#ifdef MRN_HANDLER_RECORDS_RETURN_ERROR + int wrapper_records(ha_rows *num_rows); + int storage_records(ha_rows *num_rows); +#else + ha_rows wrapper_records(); + ha_rows storage_records(); +#endif int wrapper_rnd_init(bool scan); int storage_rnd_init(bool scan); int wrapper_rnd_end(); @@ -914,14 +1014,6 @@ class ha_mroonga: public handler int storage_index_last(uchar *buf); int wrapper_index_next_same(uchar *buf, const uchar *key, uint keylen); int storage_index_next_same(uchar *buf, const uchar *key, uint keylen); - int wrapper_read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted); - int storage_read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted); - int wrapper_read_range_next(); - int storage_read_range_next(); int generic_ft_init(); int wrapper_ft_init(); int storage_ft_init(); @@ -929,41 +1021,18 @@ class ha_mroonga: public handler FT_INFO *storage_ft_init_ext(uint flags, uint key_nr, String *key); void generic_ft_init_ext_add_conditions_fast_order_limit( struct st_mrn_ft_info *info, grn_obj *expression); - bool generic_ft_init_ext_parse_pragma_d(struct st_mrn_ft_info *info, - const char *keyword, - uint keyword_length, - grn_operator *default_operator, - uint *consumed_keyword_length); - void generic_ft_init_ext_parse_pragma_w_append_section( - struct st_mrn_ft_info *info, - grn_obj *index_column, - grn_obj *match_columns, - uint section, - grn_obj *section_value_buffer, - int weight, - uint n_weights); - bool generic_ft_init_ext_parse_pragma_w(struct st_mrn_ft_info *info, - const char *keyword, - uint keyword_length, - grn_obj *index_column, - grn_obj *match_columns, - uint *consumed_keyword_length, - grn_obj *tmp_objects); - grn_expr_flags expr_flags_in_boolean_mode(); grn_rc generic_ft_init_ext_prepare_expression_in_boolean_mode( struct st_mrn_ft_info *info, String *key, grn_obj *index_column, grn_obj *match_columns, - grn_obj *expression, - grn_obj *tmp_objects); + grn_obj *expression); grn_rc generic_ft_init_ext_prepare_expression_in_normal_mode( struct st_mrn_ft_info *info, String *key, grn_obj *index_column, grn_obj *match_columns, - grn_obj *expression, - grn_obj *tmp_objects); + grn_obj *expression); struct st_mrn_ft_info *generic_ft_init_ext_select(uint flags, uint key_nr, String *key); @@ -1041,8 +1110,10 @@ class ha_mroonga: public handler double storage_scan_time(); double wrapper_read_time(uint index, uint ranges, ha_rows rows); double storage_read_time(uint index, uint ranges, ha_rows rows); +#ifdef MRN_HANDLER_HAVE_KEYS_TO_USE_FOR_SCANNING const key_map *wrapper_keys_to_use_for_scanning(); const key_map *storage_keys_to_use_for_scanning(); +#endif ha_rows wrapper_estimate_rows_upper_bound(); ha_rows storage_estimate_rows_upper_bound(); void wrapper_update_create_info(HA_CREATE_INFO* create_info); @@ -1069,8 +1140,10 @@ class ha_mroonga: public handler bool wrapper_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_mroonga(uint mode); int wrapper_disable_indexes(uint mode); int storage_disable_indexes(uint mode); + int wrapper_enable_indexes_mroonga(uint mode); int wrapper_enable_indexes(uint mode); int storage_enable_indexes(uint mode); int wrapper_check(THD* thd, HA_CHECK_OPT* check_opt); @@ -1111,8 +1184,10 @@ class ha_mroonga: public handler Alter_inplace_info *ha_alter_info); bool wrapper_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info); - bool storage_inplace_alter_table_index(TABLE *altered_table, - Alter_inplace_info *ha_alter_info); + bool storage_inplace_alter_table_add_index(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool storage_inplace_alter_table_drop_index(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); bool storage_inplace_alter_table_add_column(TABLE *altered_table, Alter_inplace_info *ha_alter_info); bool storage_inplace_alter_table_drop_column(TABLE *altered_table, @@ -1208,7 +1283,9 @@ class ha_mroonga: public handler void storage_free_foreign_key_create_info(char* str); void wrapper_set_keys_in_use(); void storage_set_keys_in_use(); +#ifdef MRN_RBR_UPDATE_NEED_ALL_COLUMNS bool check_written_by_row_based_binlog(); +#endif #ifdef MRN_HAVE_HA_REBIND_PSI void wrapper_unbind_psi(); void storage_unbind_psi(); diff --git a/storage/mroonga/lib/libmrn_need_mysql_sources.am b/storage/mroonga/lib/libmrn_need_mysql_sources.am index 575f38adbd1af..e8c03c63a92c5 100644 --- a/storage/mroonga/lib/libmrn_need_mysql_sources.am +++ b/storage/mroonga/lib/libmrn_need_mysql_sources.am @@ -28,4 +28,23 @@ libmrn_need_mysql_la_SOURCES = \ mrn_value_decoder.cpp \ mrn_value_decoder.hpp \ mrn_database_repairer.cpp \ - mrn_database_repairer.hpp + mrn_database_repairer.hpp \ + mrn_context_pool.cpp \ + mrn_context_pool.hpp \ + mrn_operations.cpp \ + mrn_operations.hpp \ + mrn_operation.cpp \ + mrn_operation.hpp \ + mrn_database.cpp \ + mrn_database.hpp \ + mrn_column_name.cpp \ + mrn_column_name.hpp \ + mrn_count_skip_checker.cpp \ + mrn_count_skip_checker.hpp \ + mrn_query_parser.cpp \ + mrn_query_parser.hpp \ + mrn_current_thread.hpp \ + mrn_smart_bitmap.cpp \ + mrn_smart_bitmap.hpp \ + mrn_table_fields_offset_mover.cpp \ + mrn_table_fields_offset_mover.hpp diff --git a/storage/mroonga/lib/mrn_column_name.cpp b/storage/mroonga/lib/mrn_column_name.cpp new file mode 100644 index 0000000000000..e469ad2fd1935 --- /dev/null +++ b/storage/mroonga/lib/mrn_column_name.cpp @@ -0,0 +1,63 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2016 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include "mrn_column_name.hpp" + +#include + +#include + +// for debug +#define MRN_CLASS_NAME "mrn::ColumnName" + +namespace mrn { + ColumnName::ColumnName(const char *mysql_name) + : mysql_name_(mysql_name) { + encode(); + } + + const char *ColumnName::mysql_name() { + return mysql_name_; + } + + const char *ColumnName::c_str() { + return name_; + } + + size_t ColumnName::length() { + return length_; + } + + void ColumnName::encode() { + MRN_DBUG_ENTER_METHOD(); + uint errors; + length_ = mrn_strconvert(system_charset_info, + mysql_name_, + strlen(mysql_name_), + &my_charset_filename, + name_, + MRN_MAX_PATH_SIZE, + &errors); + name_[length_] = '\0'; + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_column_name.hpp b/storage/mroonga/lib/mrn_column_name.hpp new file mode 100644 index 0000000000000..ed8fb67e50609 --- /dev/null +++ b/storage/mroonga/lib/mrn_column_name.hpp @@ -0,0 +1,38 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2016 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +namespace mrn { + class ColumnName { + public: + ColumnName(const char *mysql_name); + const char *mysql_name(); + const char *c_str(); + size_t length(); + private: + const char *mysql_name_; + char name_[MRN_MAX_PATH_SIZE]; + size_t length_; + + void encode(); + }; +} diff --git a/storage/mroonga/lib/mrn_condition_converter.cpp b/storage/mroonga/lib/mrn_condition_converter.cpp index 1527a54693843..6df601d62506a 100644 --- a/storage/mroonga/lib/mrn_condition_converter.cpp +++ b/storage/mroonga/lib/mrn_condition_converter.cpp @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* - Copyright(C) 2013-2014 Kouhei Sutou + Copyright(C) 2013-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -175,7 +175,7 @@ namespace mrn { bool convertable = false; - enum_field_types field_type = field_item->field_type(); + enum_field_types field_type = field_item->field->real_type(); NormalizedType normalized_type = normalize_field_type(field_type); switch (normalized_type) { case STRING_TYPE: @@ -185,7 +185,12 @@ namespace mrn { } break; case INT_TYPE: - convertable = value_item->type() == Item::INT_ITEM; + if (field_type == MYSQL_TYPE_ENUM) { + convertable = (value_item->type() == Item::STRING_ITEM || + value_item->type() == Item::INT_ITEM); + } else { + convertable = value_item->type() == Item::INT_ITEM; + } break; case TIME_TYPE: if (is_valid_time_value(field_item, value_item)) { @@ -206,7 +211,7 @@ namespace mrn { bool convertable = false; - enum_field_types field_type = field_item->field_type(); + enum_field_types field_type = field_item->field->type(); NormalizedType normalized_type = normalize_field_type(field_type); switch (normalized_type) { case STRING_TYPE: @@ -251,7 +256,7 @@ namespace mrn { bool error; Item *real_value_item = value_item->real_item(); - switch (field_item->field_type()) { + switch (field_item->field->type()) { case MYSQL_TYPE_TIME: error = real_value_item->get_time(mysql_time); break; @@ -352,6 +357,11 @@ namespace mrn { case MYSQL_TYPE_GEOMETRY: type = UNSUPPORTED_TYPE; break; +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + case MYSQL_TYPE_JSON: + type = STRING_TYPE; + break; +#endif } DBUG_RETURN(type); @@ -404,11 +414,11 @@ namespace mrn { DBUG_RETURN(have); } - const Item_func *ConditionConverter::find_match_against(const Item *item) { + unsigned int ConditionConverter::count_match_against(const Item *item) { MRN_DBUG_ENTER_METHOD(); if (!item) { - DBUG_RETURN(NULL); + DBUG_RETURN(0); } switch (item->type()) { @@ -416,14 +426,13 @@ namespace mrn { if (is_storage_mode_) { Item_cond *cond_item = (Item_cond *)item; if (cond_item->functype() == Item_func::COND_AND_FUNC) { + unsigned int n_match_againsts = 0; List_iterator iterator(*((cond_item)->argument_list())); const Item *sub_item; while ((sub_item = iterator++)) { - const Item_func *match_against = find_match_against(sub_item); - if (match_against) { - DBUG_RETURN(match_against); - } + n_match_againsts += count_match_against(sub_item); } + DBUG_RETURN(n_match_againsts); } } break; @@ -432,7 +441,7 @@ namespace mrn { const Item_func *func_item = (const Item_func *)item; switch (func_item->functype()) { case Item_func::FT_FUNC: - DBUG_RETURN(func_item); + DBUG_RETURN(1); break; default: break; @@ -443,7 +452,7 @@ namespace mrn { break; } - DBUG_RETURN(NULL); + DBUG_RETURN(0); } void ConditionConverter::convert(const Item *where, grn_obj *expression) { @@ -560,7 +569,7 @@ namespace mrn { grn_obj *expression) { MRN_DBUG_ENTER_METHOD(); - enum_field_types field_type = field_item->field_type(); + enum_field_types field_type = field_item->field->real_type(); NormalizedType normalized_type = normalize_field_type(field_type); switch (normalized_type) { @@ -574,7 +583,21 @@ namespace mrn { break; case INT_TYPE: grn_obj_reinit(ctx_, &value_, GRN_DB_INT64, 0); - GRN_INT64_SET(ctx_, &value_, const_item->val_int()); + if (field_type == MYSQL_TYPE_ENUM) { + if (const_item->type() == Item::STRING_ITEM) { + String *string; + string = const_item->val_str(NULL); + Field_enum *enum_field = static_cast(field_item->field); + int enum_value = find_type(string->c_ptr(), + enum_field->typelib, + FIND_TYPE_BASIC); + GRN_INT64_SET(ctx_, &value_, enum_value); + } else { + GRN_INT64_SET(ctx_, &value_, const_item->val_int()); + } + } else { + GRN_INT64_SET(ctx_, &value_, const_item->val_int()); + } break; case TIME_TYPE: grn_obj_reinit(ctx_, &value_, GRN_DB_TIME, 0); diff --git a/storage/mroonga/lib/mrn_condition_converter.hpp b/storage/mroonga/lib/mrn_condition_converter.hpp index 3a7fbd048dc51..f8a48b6209abd 100644 --- a/storage/mroonga/lib/mrn_condition_converter.hpp +++ b/storage/mroonga/lib/mrn_condition_converter.hpp @@ -33,7 +33,7 @@ namespace mrn { ~ConditionConverter(); bool is_convertable(const Item *item); - const Item_func *find_match_against(const Item *item); + unsigned int count_match_against(const Item *item); // caller must check "where" can be convertable by // is_convertable(). This method doesn't validate "where". void convert(const Item *where, grn_obj *expression); diff --git a/storage/mroonga/lib/mrn_context_pool.cpp b/storage/mroonga/lib/mrn_context_pool.cpp new file mode 100644 index 0000000000000..d297ee9a33893 --- /dev/null +++ b/storage/mroonga/lib/mrn_context_pool.cpp @@ -0,0 +1,120 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "mrn_context_pool.hpp" +#include "mrn_lock.hpp" + +#include + +namespace mrn { + // for debug +#define MRN_CLASS_NAME "mrn::ContextPool::Impl" + + class ContextPool::Impl { + public: + Impl(mysql_mutex_t *mutex) + : mutex_(mutex), + pool_(NULL), + last_pull_time_(0) { + } + + ~Impl(void) { + clear(); + } + + grn_ctx *pull(void) { + MRN_DBUG_ENTER_METHOD(); + grn_ctx *ctx = NULL; + + { + time_t now; + time(&now); + + mrn::Lock lock(mutex_); + if (pool_) { + ctx = static_cast(pool_->data); + list_pop(pool_); + if ((now - last_pull_time_) >= CLEAR_THREATHOLD_IN_SECONDS) { + clear(); + } + } + last_pull_time_ = now; + } + + if (!ctx) { + ctx = grn_ctx_open(0); + } + + DBUG_RETURN(ctx); + } + + void release(grn_ctx *ctx) { + MRN_DBUG_ENTER_METHOD(); + + { + mrn::Lock lock(mutex_); + list_push(pool_, ctx); + grn_ctx_use(ctx, NULL); + } + + DBUG_VOID_RETURN; + } + + private: + static const unsigned int CLEAR_THREATHOLD_IN_SECONDS = 60 * 5; + + mysql_mutex_t *mutex_; + LIST *pool_; + time_t last_pull_time_; + + void clear(void) { + MRN_DBUG_ENTER_METHOD(); + while (pool_) { + grn_ctx *ctx = static_cast(pool_->data); + grn_ctx_close(ctx); + list_pop(pool_); + } + DBUG_VOID_RETURN; + } + }; + + // For debug +#undef MRN_CLASS_NAME +#define MRN_CLASS_NAME "mrn::ContextPool" + + ContextPool::ContextPool(mysql_mutex_t *mutex) + : impl_(new Impl(mutex)) { + } + + ContextPool::~ContextPool(void) { + delete impl_; + } + + grn_ctx *ContextPool::pull(void) { + MRN_DBUG_ENTER_METHOD(); + grn_ctx *ctx = impl_->pull(); + DBUG_RETURN(ctx); + } + + void ContextPool::release(grn_ctx *ctx) { + MRN_DBUG_ENTER_METHOD(); + impl_->release(ctx); + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_context_pool.hpp b/storage/mroonga/lib/mrn_context_pool.hpp new file mode 100644 index 0000000000000..4c64933ac81b6 --- /dev/null +++ b/storage/mroonga/lib/mrn_context_pool.hpp @@ -0,0 +1,41 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MRN_CONTEXT_POOL_HPP_ +#define MRN_CONTEXT_POOL_HPP_ + +#include + +#include + +namespace mrn { + class ContextPool { + public: + ContextPool(mysql_mutex_t *mutex); + ~ContextPool(void); + grn_ctx *pull(void); + void release(grn_ctx *context); + + private: + class Impl; + Impl *impl_; + }; +} + +#endif /* MRN_CONTEXT_POOL_HPP_ */ diff --git a/storage/mroonga/lib/mrn_count_skip_checker.cpp b/storage/mroonga/lib/mrn_count_skip_checker.cpp new file mode 100644 index 0000000000000..216f3b7b7b568 --- /dev/null +++ b/storage/mroonga/lib/mrn_count_skip_checker.cpp @@ -0,0 +1,303 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "mrn_count_skip_checker.hpp" + +#include + +// for debug +#define MRN_CLASS_NAME "mrn::CountSkipChecker" + +namespace mrn { + CountSkipChecker::CountSkipChecker(grn_ctx *ctx, + TABLE *table, + SELECT_LEX *select_lex, + KEY *key_info, + key_part_map target_key_part_map, + bool is_storage_mode) + : ctx_(ctx), + table_(table), + select_lex_(select_lex), + key_info_(key_info), + target_key_part_map_(target_key_part_map), + is_storage_mode_(is_storage_mode) { + } + + CountSkipChecker::~CountSkipChecker() { + } + + bool CountSkipChecker::check() { + MRN_DBUG_ENTER_METHOD(); + + if (select_lex_->item_list.elements != 1) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not only one item: %u", + select_lex_->item_list.elements); + DBUG_RETURN(false); + } + if (select_lex_->group_list.elements > 0) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] have groups: %u", + select_lex_->group_list.elements); + DBUG_RETURN(false); + } + if (MRN_SELECT_LEX_GET_HAVING_COND(select_lex_)) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] have HAVING"); + DBUG_RETURN(false); + } + if (select_lex_->table_list.elements != 1) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not only one table: %u", + select_lex_->table_list.elements); + DBUG_RETURN(false); + } + + Item *info = static_cast(select_lex_->item_list.first_node()->info); + if (info->type() != Item::SUM_FUNC_ITEM) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] item isn't sum function: %u", + info->type()); + DBUG_RETURN(false); + } + Item_sum *sum_item = static_cast(info); + if (sum_item->sum_func() != Item_sum::COUNT_FUNC) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not COUNT: %u", + sum_item->sum_func()); + DBUG_RETURN(false); + } + if (ITEM_SUM_GET_NEST_LEVEL(sum_item) != 0 || + ITEM_SUM_GET_AGGR_LEVEL(sum_item) != 0 || + ITEM_SUM_GET_MAX_AGGR_LEVEL(sum_item) != -1 || + sum_item->max_sum_func_level != -1) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not simple COUNT(*): %d:%d:%d:%d", + ITEM_SUM_GET_NEST_LEVEL(sum_item), + ITEM_SUM_GET_AGGR_LEVEL(sum_item), + ITEM_SUM_GET_MAX_AGGR_LEVEL(sum_item), + sum_item->max_sum_func_level); + DBUG_RETURN(false); + } + + Item *where = MRN_SELECT_LEX_GET_WHERE_COND(select_lex_); + if (!where) { + if (is_storage_mode_) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][true] no condition"); + DBUG_RETURN(true); + } else { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] no condition with wrapper mode"); + DBUG_RETURN(false); + } + } + + bool skippable = is_skippable(where); + DBUG_RETURN(skippable); + } + + bool CountSkipChecker::is_skippable(Item *where) { + MRN_DBUG_ENTER_METHOD(); + + bool skippable = false; + switch (where->type()) { + case Item::COND_ITEM: + { + Item_cond *cond_item = static_cast(where); + skippable = is_skippable(cond_item); + if (skippable) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][true] skippable multiple conditions"); + } + } + break; + case Item::FUNC_ITEM: + { + Item_func *func_item = static_cast(where); + if (func_item->functype() == Item_func::FT_FUNC) { + if (select_lex_->select_n_where_fields == 1) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][true] " + "only one full text search condition"); + DBUG_RETURN(true); + } else { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] " + "full text search condition and more conditions: %u", + select_lex_->select_n_where_fields); + DBUG_RETURN(false); + } + } else { + skippable = is_skippable(func_item); + if (skippable) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][true] skippable condition"); + } + } + } + break; + default: + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] unsupported top level item: %u", + where->type()); + break; + } + + DBUG_RETURN(skippable); + } + + bool CountSkipChecker::is_skippable(Item_cond *cond_item) { + MRN_DBUG_ENTER_METHOD(); + + List_iterator iterator(*(cond_item->argument_list())); + Item *sub_item; + while ((sub_item = iterator++)) { + if (sub_item->type() != Item::FUNC_ITEM) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] " + "sub condition isn't function item: %u", + sub_item->type()); + DBUG_RETURN(false); + } + if (!is_skippable(static_cast(sub_item))) { + DBUG_RETURN(false); + } + } + DBUG_RETURN(true); + } + + bool CountSkipChecker::is_skippable(Item_func *func_item) { + MRN_DBUG_ENTER_METHOD(); + + switch (func_item->functype()) { + case Item_func::EQ_FUNC: + case Item_func::EQUAL_FUNC: + case Item_func::NE_FUNC: + case Item_func::LT_FUNC: + case Item_func::LE_FUNC: + case Item_func::GE_FUNC: + case Item_func::GT_FUNC: + { + Item **arguments = func_item->arguments(); + Item *left_item = arguments[0]; + if (left_item->type() != Item::FIELD_ITEM) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] not field: %u:%u", + func_item->functype(), + left_item->type()); + DBUG_RETURN(false); + } + + bool skippable = is_skippable(static_cast(left_item)); + DBUG_RETURN(skippable); + } + break; + case Item_func::BETWEEN: + { + Item **arguments = func_item->arguments(); + Item *target_item = arguments[0]; + if (target_item->type() != Item::FIELD_ITEM) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] BETWEEN target isn't field: %u", + target_item->type()); + DBUG_RETURN(false); + } + + bool skippable = is_skippable(static_cast(target_item)); + DBUG_RETURN(skippable); + } + break; + case Item_func::MULT_EQUAL_FUNC: +#ifdef MRN_HAVE_ITEM_EQUAL_FIELDS_ITERATOR + { + Item_equal *equal_item = static_cast(func_item); + Item_equal_fields_iterator iterator(*equal_item); + Item *field_item; + while ((field_item = iterator++)) { + bool skippable = is_skippable(static_cast(field_item)); + if (!skippable) { + DBUG_RETURN(skippable); + } + } + DBUG_RETURN(true); + } +#endif + break; + default: + break; + } + + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] unsupported function item: %u", + func_item->functype()); + DBUG_RETURN(false); + } + + bool CountSkipChecker::is_skippable(Item_field *field_item) { + MRN_DBUG_ENTER_METHOD(); + + Field *field = field_item->field; + if (!field) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] field is missing"); + DBUG_RETURN(false); + } + + if (field->table != table_) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] external table's field"); + DBUG_RETURN(false); + } + + if (!key_info_) { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] no active index: <%s>:<%s>", + *(field->table_name), + field->field_name); + DBUG_RETURN(false); + } + + uint i; + KEY_PART_INFO *key_part = key_info_->key_part; + for (i = 0; i < KEY_N_KEY_PARTS(key_info_); i++) { + if (key_part[i].field == field) { + if ((target_key_part_map_ >> i) & 1) { + DBUG_RETURN(true); + } else { + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] " + "field's index are out of key part map: %u:%lu: <%s>:<%s>", + i, + target_key_part_map_, + *(field->table_name), + field->field_name); + DBUG_RETURN(false); + } + } + } + + GRN_LOG(ctx_, GRN_LOG_DEBUG, + "[mroonga][count-skip][false] field isn't indexed: <%s>:<%s>", + *(field->table_name), + field->field_name); + DBUG_RETURN(false); + } +} diff --git a/storage/mroonga/lib/mrn_count_skip_checker.hpp b/storage/mroonga/lib/mrn_count_skip_checker.hpp new file mode 100644 index 0000000000000..b813ecdcc08f2 --- /dev/null +++ b/storage/mroonga/lib/mrn_count_skip_checker.hpp @@ -0,0 +1,57 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2016 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MRN_COUNT_SKIP_CHECKER_HPP_ +#define MRN_COUNT_SKIP_CHECKER_HPP_ + +#include + +#include + +#include + +namespace mrn { + class CountSkipChecker { + public: + CountSkipChecker(grn_ctx *ctx, + TABLE *table, + SELECT_LEX *select_lex, + KEY *key_info, + key_part_map target_key_part_map, + bool is_storage_mode); + ~CountSkipChecker(); + + bool check(); + + private: + grn_ctx *ctx_; + TABLE *table_; + SELECT_LEX *select_lex_; + KEY *key_info_; + key_part_map target_key_part_map_; + bool is_storage_mode_; + + bool is_skippable(Item *where); + bool is_skippable(Item_cond *cond_item); + bool is_skippable(Item_func *func_item); + bool is_skippable(Item_field *field_item); + }; +} + +#endif /* MRN_COUNT_SKIP_CHECKER_HPP_ */ diff --git a/storage/mroonga/lib/mrn_current_thread.hpp b/storage/mroonga/lib/mrn_current_thread.hpp new file mode 100644 index 0000000000000..367057fce66c9 --- /dev/null +++ b/storage/mroonga/lib/mrn_current_thread.hpp @@ -0,0 +1,27 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# include +#endif diff --git a/storage/mroonga/lib/mrn_database.cpp b/storage/mroonga/lib/mrn_database.cpp new file mode 100644 index 0000000000000..52e315e1b77f4 --- /dev/null +++ b/storage/mroonga/lib/mrn_database.cpp @@ -0,0 +1,89 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "mrn_database.hpp" +#include "mrn_operations.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::Database" + +namespace mrn { + Database::Database(grn_ctx *ctx, grn_obj *db) + : ctx_(ctx), + db_(db), + broken_table_names_(NULL), + is_broken_(false) { + Operations operations(ctx_); + broken_table_names_ = operations.collect_processing_table_names(); + is_broken_ = operations.is_locked(); + } + + Database::~Database(void) { + close(); + } + + void Database::close() { + MRN_DBUG_ENTER_METHOD(); + if (db_) { + grn_hash_close(ctx_, broken_table_names_); + broken_table_names_ = NULL; + grn_obj_close(ctx_, db_); + db_ = NULL; + } + DBUG_VOID_RETURN; + } + + grn_rc Database::remove() { + MRN_DBUG_ENTER_METHOD(); + grn_rc rc = GRN_SUCCESS; + if (db_) { + grn_hash_close(ctx_, broken_table_names_); + broken_table_names_ = NULL; + rc = grn_obj_remove(ctx_, db_); + if (rc == GRN_SUCCESS) { + db_ = NULL; + } + } + DBUG_RETURN(rc); + } + + grn_obj *Database::get() { + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(db_); + } + + bool Database::is_broken() { + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(is_broken_); + } + + bool Database::is_broken_table(const char *name, size_t name_size) { + MRN_DBUG_ENTER_METHOD(); + grn_id id = grn_hash_get(ctx_, broken_table_names_, name, name_size, NULL); + DBUG_RETURN(id != GRN_ID_NIL); + } + + void Database::mark_table_repaired(const char *name, size_t name_size) { + MRN_DBUG_ENTER_METHOD(); + grn_hash_delete(ctx_, broken_table_names_, name, name_size, NULL); + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_database.hpp b/storage/mroonga/lib/mrn_database.hpp new file mode 100644 index 0000000000000..c2c7e460b581f --- /dev/null +++ b/storage/mroonga/lib/mrn_database.hpp @@ -0,0 +1,47 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MRN_DATABASE_HPP_ +#define MRN_DATABASE_HPP_ + +#include + +namespace mrn { + class Database { + public: + Database(grn_ctx *ctx, grn_obj *db); + ~Database(void); + + void close(); + grn_rc remove(); + grn_obj *get(); + + bool is_broken(); + bool is_broken_table(const char *name, size_t name_size); + void mark_table_repaired(const char *name, size_t name_size); + + private: + grn_ctx *ctx_; + grn_obj *db_; + grn_hash *broken_table_names_; + bool is_broken_; + }; +} + +#endif /* MRN_DATABASE_HPP_ */ diff --git a/storage/mroonga/lib/mrn_database_manager.cpp b/storage/mroonga/lib/mrn_database_manager.cpp index 753d1551ff475..d52d2639d7daa 100644 --- a/storage/mroonga/lib/mrn_database_manager.cpp +++ b/storage/mroonga/lib/mrn_database_manager.cpp @@ -56,9 +56,9 @@ namespace mrn { if (cache_) { void *db_address; GRN_HASH_EACH(ctx_, cache_, id, NULL, 0, &db_address, { - grn_obj *db; + Database *db; memcpy(&db, db_address, sizeof(grn_obj *)); - grn_obj_unlink(ctx_, db); + delete db; }); grn_hash_close(ctx_, cache_); } @@ -80,7 +80,7 @@ namespace mrn { DBUG_RETURN(true); } - int DatabaseManager::open(const char *path, grn_obj **db) { + int DatabaseManager::open(const char *path, Database **db) { MRN_DBUG_ENTER_METHOD(); int error = 0; @@ -100,36 +100,54 @@ namespace mrn { mapper.db_name(), strlen(mapper.db_name()), &db_address); if (id == GRN_ID_NIL) { + grn_obj *grn_db; struct stat db_stat; if (stat(mapper.db_path(), &db_stat)) { GRN_LOG(ctx_, GRN_LOG_INFO, "database not found. creating...: <%s>", mapper.db_path()); if (path[0] == FN_CURLIB && - (path[1] == FN_LIBCHAR || path[1] == FN_LIBCHAR2)) { + mrn_is_directory_separator(path[1])) { ensure_database_directory(); } - *db = grn_db_create(ctx_, mapper.db_path(), NULL); + grn_db = grn_db_create(ctx_, mapper.db_path(), NULL); if (ctx_->rc) { error = ER_CANT_CREATE_TABLE; my_message(error, ctx_->errbuf, MYF(0)); DBUG_RETURN(error); } } else { - *db = grn_db_open(ctx_, mapper.db_path()); + grn_db = grn_db_open(ctx_, mapper.db_path()); if (ctx_->rc) { error = ER_CANT_OPEN_FILE; my_message(error, ctx_->errbuf, MYF(0)); DBUG_RETURN(error); } } + *db = new Database(ctx_, grn_db); grn_hash_add(ctx_, cache_, mapper.db_name(), strlen(mapper.db_name()), &db_address, NULL); - memcpy(db_address, db, sizeof(grn_obj *)); - error = ensure_normalizers_registered(*db); + memcpy(db_address, db, sizeof(Database *)); + error = ensure_normalizers_registered((*db)->get()); + if (!error) { + if ((*db)->is_broken()) { + error = ER_CANT_OPEN_FILE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: database: open: " + "The database maybe broken. " + "We recommend you to recreate the database. " + "If the database isn't broken, " + "you can remove this error by running " + "'groonga %s table_remove mroonga_operations' " + "on server. But the latter isn't recommended.", + mapper.db_path()); + my_message(error, error_message, MYF(0)); + } + } } else { - memcpy(db, db_address, sizeof(grn_obj *)); - grn_ctx_use(ctx_, *db); + memcpy(db, db_address, sizeof(Database *)); + grn_ctx_use(ctx_, (*db)->get()); } DBUG_RETURN(error); @@ -150,10 +168,11 @@ namespace mrn { DBUG_VOID_RETURN; } - grn_obj *db = NULL; - memcpy(&db, db_address, sizeof(grn_obj *)); + Database *db = NULL; + memcpy(&db, db_address, sizeof(Database *)); + grn_ctx_use(ctx_, db->get()); if (db) { - grn_obj_close(ctx_, db); + delete db; } grn_hash_delete_by_id(ctx_, cache_, id, NULL); @@ -173,29 +192,35 @@ namespace mrn { mapper.db_name(), strlen(mapper.db_name()), &db_address); - grn_obj *db = NULL; + Database *db = NULL; if (id == GRN_ID_NIL) { struct stat dummy; if (stat(mapper.db_path(), &dummy) == 0) { - db = grn_db_open(ctx_, mapper.db_path()); + grn_obj *grn_db = grn_db_open(ctx_, mapper.db_path()); + db = new Database(ctx_, grn_db); } } else { - memcpy(&db, db_address, sizeof(grn_obj *)); + memcpy(&db, db_address, sizeof(Database *)); + grn_ctx_use(ctx_, db->get()); } if (!db) { DBUG_RETURN(false); } - if (grn_obj_remove(ctx_, db) == GRN_SUCCESS) { + if (db->remove() == GRN_SUCCESS) { if (id != GRN_ID_NIL) { grn_hash_delete_by_id(ctx_, cache_, id, NULL); } + delete db; DBUG_RETURN(true); } else { GRN_LOG(ctx_, GRN_LOG_ERROR, "failed to drop database: <%s>: <%s>", mapper.db_path(), ctx_->errbuf); + if (id == GRN_ID_NIL) { + delete db; + } DBUG_RETURN(false); } } @@ -223,22 +248,28 @@ namespace mrn { break; } void *db_address; - grn_obj *db; + Database *db; grn_hash_cursor_get_value(ctx_, cursor, &db_address); - memcpy(&db, db_address, sizeof(grn_obj *)); + memcpy(&db, db_address, sizeof(Database *)); + grn_ctx_use(ctx_, db->get()); grn_rc rc = grn_hash_cursor_delete(ctx_, cursor, NULL); if (rc) { error = ER_ERROR_ON_READ; my_message(error, ctx_->errbuf, MYF(0)); break; } - grn_obj_close(ctx_, db); + delete db; } grn_hash_cursor_close(ctx_, cursor); DBUG_RETURN(error); } + const char *DatabaseManager::error_message() { + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(ctx_->errbuf); + } + void DatabaseManager::mkdir_p(const char *directory) { MRN_DBUG_ENTER_METHOD(); @@ -246,8 +277,7 @@ namespace mrn { char sub_directory[MRN_MAX_PATH_SIZE]; sub_directory[0] = '\0'; while (true) { - if (directory[i] == FN_LIBCHAR || - directory[i] == FN_LIBCHAR2 || + if (mrn_is_directory_separator(directory[i]) || directory[i] == '\0') { sub_directory[i] = '\0'; struct stat directory_status; @@ -290,8 +320,10 @@ namespace mrn { const char *last_path_separator; last_path_separator = strrchr(path_prefix, FN_LIBCHAR); +#ifdef FN_LIBCHAR2 if (!last_path_separator) last_path_separator = strrchr(path_prefix, FN_LIBCHAR2); +#endif if (!last_path_separator) DBUG_VOID_RETURN; if (path_prefix == last_path_separator) diff --git a/storage/mroonga/lib/mrn_database_manager.hpp b/storage/mroonga/lib/mrn_database_manager.hpp index 76c76dab6d5d8..877b7ca889ac4 100644 --- a/storage/mroonga/lib/mrn_database_manager.hpp +++ b/storage/mroonga/lib/mrn_database_manager.hpp @@ -22,6 +22,8 @@ #ifndef MRN_DATABASE_MANAGER_HPP_ #define MRN_DATABASE_MANAGER_HPP_ +#include "mrn_database.hpp" + #include namespace mrn { @@ -30,10 +32,11 @@ namespace mrn { DatabaseManager(grn_ctx *ctx, mysql_mutex_t *mutex); ~DatabaseManager(void); bool init(void); - int open(const char *path, grn_obj **db); + int open(const char *path, Database **db); void close(const char *path); bool drop(const char *path); int clear(void); + const char *error_message(); private: grn_ctx *ctx_; diff --git a/storage/mroonga/lib/mrn_database_repairer.cpp b/storage/mroonga/lib/mrn_database_repairer.cpp index f04c027f8bbfe..47badbd8b93af 100644 --- a/storage/mroonga/lib/mrn_database_repairer.cpp +++ b/storage/mroonga/lib/mrn_database_repairer.cpp @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* - Copyright(C) 2015 Kouhei Sutou + Copyright(C) 2015-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -36,6 +36,16 @@ #endif namespace mrn { + struct CheckResult { + CheckResult() : + is_crashed(false), + is_corrupt(false) { + } + + bool is_crashed; + bool is_corrupt; + }; + DatabaseRepairer::DatabaseRepairer(grn_ctx *ctx, THD *thd) : ctx_(ctx), thd_(thd), @@ -53,10 +63,19 @@ namespace mrn { bool DatabaseRepairer::is_crashed(void) { MRN_DBUG_ENTER_METHOD(); - bool is_crashed = false; - each_database(&DatabaseRepairer::is_crashed_body, &is_crashed); + CheckResult result; + each_database(&DatabaseRepairer::check_body, &result); + + DBUG_RETURN(result.is_crashed); + } + + bool DatabaseRepairer::is_corrupt(void) { + MRN_DBUG_ENTER_METHOD(); + + CheckResult result; + each_database(&DatabaseRepairer::check_body, &result); - DBUG_RETURN(is_crashed); + DBUG_RETURN(result.is_corrupt); } bool DatabaseRepairer::repair(void) { @@ -81,9 +100,19 @@ namespace mrn { DBUG_VOID_RETURN; } - do { - each_database_body(data.cFileName, each_body_func, user_data); - } while (FindNextFile(finder, &data) != 0); + grn_ctx ctx; + grn_rc rc = grn_ctx_init(&ctx, 0); + if (rc == GRN_SUCCESS) { + do { + each_database_body(data.cFileName, &ctx, each_body_func, user_data); + } while (FindNextFile(finder, &data) != 0); + grn_ctx_fin(&ctx); + } else { + GRN_LOG(ctx_, GRN_LOG_WARNING, + "[mroonga][database][repairer][each] " + "failed to initialize grn_ctx: %d: %s", + rc, grn_rc_to_string(rc)); + } FindClose(finder); #else DIR *dir = opendir(base_directory_); @@ -91,8 +120,18 @@ namespace mrn { DBUG_VOID_RETURN; } - while (struct dirent *entry = readdir(dir)) { - each_database_body(entry->d_name, each_body_func, user_data); + grn_ctx ctx; + grn_rc rc = grn_ctx_init(&ctx, 0); + if (rc == GRN_SUCCESS) { + while (struct dirent *entry = readdir(dir)) { + each_database_body(entry->d_name, &ctx, each_body_func, user_data); + } + grn_ctx_fin(&ctx); + } else { + GRN_LOG(ctx_, GRN_LOG_WARNING, + "[mroonga][database][repairer][each] " + "failed to initialize grn_ctx: %d: %s", + rc, grn_rc_to_string(rc)); } closedir(dir); #endif @@ -101,6 +140,7 @@ namespace mrn { } void DatabaseRepairer::each_database_body(const char *base_path, + grn_ctx *ctx, EachBodyFunc each_body_func, void *user_data) { MRN_DBUG_ENTER_METHOD(); @@ -123,14 +163,14 @@ namespace mrn { char db_path[MRN_MAX_PATH_SIZE]; snprintf(db_path, MRN_MAX_PATH_SIZE, "%s%c%s", base_directory_, FN_LIBCHAR, base_path); - grn_obj *db = grn_db_open(ctx_, db_path); + grn_obj *db = grn_db_open(ctx, db_path); if (!db) { DBUG_VOID_RETURN; } - (this->*each_body_func)(db, db_path, user_data); + (this->*each_body_func)(ctx, db, db_path, user_data); - grn_obj_close(ctx_, db); + grn_obj_close(ctx, db); DBUG_VOID_RETURN; } @@ -150,8 +190,7 @@ namespace mrn { size_t raw_path_prefix_length = strlen(raw_path_prefix); size_t separator_position = raw_path_prefix_length; for (; separator_position > 0; separator_position--) { - if (base_directory_buffer_[separator_position] == FN_LIBCHAR || - base_directory_buffer_[separator_position] == FN_LIBCHAR2) { + if (mrn_is_directory_separator(base_directory_buffer_[separator_position])) { break; } } @@ -169,34 +208,46 @@ namespace mrn { DBUG_VOID_RETURN; } - void DatabaseRepairer::is_crashed_body(grn_obj *db, - const char *db_path, - void *user_data) { + void DatabaseRepairer::check_body(grn_ctx *ctx, + grn_obj *db, + const char *db_path, + void *user_data) { MRN_DBUG_ENTER_METHOD(); - bool *is_crashed = static_cast(user_data); + CheckResult *result = static_cast(user_data); - if (grn_obj_is_locked(ctx_, db)) { - *is_crashed = true; + if (grn_obj_is_locked(ctx, db)) { + result->is_crashed = true; + result->is_corrupt = true; DBUG_VOID_RETURN; } grn_table_cursor *cursor; - cursor = grn_table_cursor_open(ctx_, db, + cursor = grn_table_cursor_open(ctx, db, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); if (!cursor) { - *is_crashed = true; + result->is_crashed = true; + result->is_corrupt = true; DBUG_VOID_RETURN; } grn_id id; - while ((id = grn_table_cursor_next(ctx_, cursor)) != GRN_ID_NIL) { - grn_obj *object = grn_ctx_at(ctx_, id); + while ((id = grn_table_cursor_next(ctx, cursor)) != GRN_ID_NIL) { + if (grn_id_is_builtin(ctx, id)) { + continue; + } + + grn_obj *object = grn_ctx_at(ctx, id); if (!object) { - continue; + if (ctx->rc == GRN_SUCCESS) { + continue; + } else { + result->is_corrupt = true; + break; + } } switch (object->header.type) { @@ -207,37 +258,40 @@ namespace mrn { case GRN_COLUMN_FIX_SIZE: case GRN_COLUMN_VAR_SIZE: case GRN_COLUMN_INDEX: - grn_obj_is_locked(ctx_, object); - *is_crashed = true; + if (grn_obj_is_locked(ctx_, object)) { + result->is_crashed = true; + result->is_corrupt = true; + } break; default: break; } - grn_obj_unlink(ctx_, object); + grn_obj_unlink(ctx, object); - if (*is_crashed) { + if (result->is_crashed || result->is_corrupt) { break; } } - grn_table_cursor_close(ctx_, cursor); + grn_table_cursor_close(ctx, cursor); DBUG_VOID_RETURN; } - void DatabaseRepairer::repair_body(grn_obj *db, + void DatabaseRepairer::repair_body(grn_ctx *ctx, + grn_obj *db, const char *db_path, void *user_data) { MRN_DBUG_ENTER_METHOD(); bool *succeeded = static_cast(user_data); - if (grn_db_recover(ctx_, db) != GRN_SUCCESS) { + if (grn_db_recover(ctx, db) != GRN_SUCCESS) { push_warning_printf(thd_, MRN_SEVERITY_WARNING, ER_NOT_KEYFILE, "mroonga: repair: " "Failed to recover database: <%s>: <%s>", - db_path, ctx_->errbuf); + db_path, ctx->errbuf); *succeeded = false; } diff --git a/storage/mroonga/lib/mrn_database_repairer.hpp b/storage/mroonga/lib/mrn_database_repairer.hpp index 12e2bbc9c798e..d46ae83807254 100644 --- a/storage/mroonga/lib/mrn_database_repairer.hpp +++ b/storage/mroonga/lib/mrn_database_repairer.hpp @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* - Copyright(C) 2015 Kouhei Sutou + Copyright(C) 2015-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ namespace mrn { DatabaseRepairer(grn_ctx *ctx, THD *thd); ~DatabaseRepairer(void); bool is_crashed(void); + bool is_corrupt(void); bool repair(void); private: @@ -40,18 +41,26 @@ namespace mrn { size_t path_prefix_length_; size_t mrn_db_file_suffix_length_; - typedef void (DatabaseRepairer::*EachBodyFunc)(grn_obj *db, + typedef void (DatabaseRepairer::*EachBodyFunc)(grn_ctx *ctx, + grn_obj *db, const char *db_path, void *user_data); void each_database(EachBodyFunc each_body_func, void *user_data); void each_database_body(const char *base_path, + grn_ctx *ctx, EachBodyFunc each_body_func, void *user_data); void detect_paths(void); - void is_crashed_body(grn_obj *db, const char *db_path, void *user_data); - void repair_body(grn_obj *db, const char *db_path, void *user_data); + void check_body(grn_ctx *ctx, + grn_obj *db, + const char *db_path, + void *user_data); + void repair_body(grn_ctx *ctx, + grn_obj *db, + const char *db_path, + void *user_data); }; } diff --git a/storage/mroonga/lib/mrn_index_table_name.cpp b/storage/mroonga/lib/mrn_index_table_name.cpp index a4a687c7996b1..1cc510ad7dbae 100644 --- a/storage/mroonga/lib/mrn_index_table_name.cpp +++ b/storage/mroonga/lib/mrn_index_table_name.cpp @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2011 Kentoku SHIBA - Copyright(C) 2011-2012 Kouhei Sutou + Copyright(C) 2011-2015 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,8 @@ #define MRN_CLASS_NAME "mrn::IndexTableName" namespace mrn { - const char *IndexTableName::SEPARATOR = "-"; + const char *IndexTableName::SEPARATOR = "#"; + const char *IndexTableName::OLD_SEPARATOR = "-"; bool IndexTableName::is_custom_name(const char *table_name, size_t table_name_length, @@ -43,9 +44,12 @@ namespace mrn { DBUG_RETURN(true); } - if (strncmp(SEPARATOR, - index_table_name + table_name_length, - strlen(SEPARATOR)) != 0) { + if ((strncmp(OLD_SEPARATOR, + index_table_name + table_name_length, + strlen(OLD_SEPARATOR)) != 0) && + (strncmp(SEPARATOR, + index_table_name + table_name_length, + strlen(SEPARATOR)) != 0)) { DBUG_RETURN(true); } @@ -63,6 +67,12 @@ namespace mrn { encoded_mysql_index_name_multibyte + MRN_MAX_KEY_SIZE, mysql_index_name_multibyte, mysql_index_name_multibyte + strlen(mysql_index_name_)); + snprintf(old_name_, MRN_MAX_KEY_SIZE, + "%s%s%s", + table_name_, + OLD_SEPARATOR, + encoded_mysql_index_name_multibyte); + old_length_ = strlen(old_name_); snprintf(name_, MRN_MAX_KEY_SIZE, "%s%s%s", table_name_, @@ -79,6 +89,14 @@ namespace mrn { return length_; } + const char *IndexTableName::old_c_str() { + return old_name_; + } + + size_t IndexTableName::old_length() { + return old_length_; + } + uint IndexTableName::encode(uchar *encoded_start, uchar *encoded_end, const uchar *mysql_string_start, diff --git a/storage/mroonga/lib/mrn_index_table_name.hpp b/storage/mroonga/lib/mrn_index_table_name.hpp index c4f1622861056..abaccfae220cb 100644 --- a/storage/mroonga/lib/mrn_index_table_name.hpp +++ b/storage/mroonga/lib/mrn_index_table_name.hpp @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2011 Kentoku SHIBA - Copyright(C) 2011-2012 Kouhei Sutou + Copyright(C) 2011-2015 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ namespace mrn { class IndexTableName { public: static const char *SEPARATOR; + static const char *OLD_SEPARATOR; static bool is_custom_name(const char *table_name, size_t table_name_length, @@ -36,9 +37,13 @@ namespace mrn { IndexTableName(const char *table_name, const char *mysql_index_name); const char *c_str(); size_t length(); + const char *old_c_str(); + size_t old_length(); private: const char *table_name_; const char *mysql_index_name_; + char old_name_[MRN_MAX_KEY_SIZE]; + size_t old_length_; char name_[MRN_MAX_KEY_SIZE]; size_t length_; diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp index c7ef9dd5851bf..0038a7fe34f92 100644 --- a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp @@ -288,6 +288,7 @@ namespace mrn { decode_long_long_int(current_grn_key, &grn_time); TimeConverter time_converter; MYSQL_TIME mysql_time; + mysql_time.neg = FALSE; mysql_time.time_type = MYSQL_TIMESTAMP_DATETIME; time_converter.grn_time_to_mysql_time(grn_time, &mysql_time); long long int mysql_datetime_packed = @@ -518,6 +519,14 @@ namespace mrn { *data_type = TYPE_BYTE_SEQUENCE; *data_size = key_part->length; break; +#ifdef MRN_HAVE_MYSQL_TYPE_JSON + case MYSQL_TYPE_JSON: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_JSON")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; +#endif } DBUG_VOID_RETURN; } diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp index 2b3f935d4e414..14003cda9f58f 100644 --- a/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp @@ -20,11 +20,11 @@ #ifndef MRN_MULTIPLE_COLUMN_KEY_CODEC_HPP_ #define MRN_MULTIPLE_COLUMN_KEY_CODEC_HPP_ -#include - #include #include +#include + namespace mrn { class MultipleColumnKeyCodec { public: diff --git a/storage/mroonga/lib/mrn_operation.cpp b/storage/mroonga/lib/mrn_operation.cpp new file mode 100644 index 0000000000000..2dab41108a72d --- /dev/null +++ b/storage/mroonga/lib/mrn_operation.cpp @@ -0,0 +1,51 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "mrn_operation.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::Operation" + +namespace mrn { + Operation::Operation(mrn::Operations *operations, + const char *type, + const char *table_name, + size_t table_name_size) + : operations_(operations), + id_(operations_->start(type, table_name, table_name_size)) { + } + + Operation::~Operation() { + MRN_DBUG_ENTER_METHOD(); + + operations_->finish(id_); + + DBUG_VOID_RETURN; + } + + void Operation::record_target(grn_id record_id) { + MRN_DBUG_ENTER_METHOD(); + + operations_->record_target(id_, record_id); + + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_operation.hpp b/storage/mroonga/lib/mrn_operation.hpp new file mode 100644 index 0000000000000..899c92e950863 --- /dev/null +++ b/storage/mroonga/lib/mrn_operation.hpp @@ -0,0 +1,42 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MRN_OPERATION_HPP_ +#define MRN_OPERATION_HPP_ + +#include + +namespace mrn { + class Operation { + public: + Operation(mrn::Operations *operations, + const char *type, + const char *table_name, + size_t table_name_size); + ~Operation(); + + void record_target(grn_id record_id); + + private: + mrn::Operations *operations_; + grn_id id_; + }; +} + +#endif /* MRN_OPERATION_HPP_ */ diff --git a/storage/mroonga/lib/mrn_operations.cpp b/storage/mroonga/lib/mrn_operations.cpp new file mode 100644 index 0000000000000..572907cdc5536 --- /dev/null +++ b/storage/mroonga/lib/mrn_operations.cpp @@ -0,0 +1,401 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include + +#include "mrn_operations.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::Operations" + +#define TABLE_NAME "mroonga_operations" +#define COLUMN_TYPE_NAME "type" +#define COLUMN_TABLE_NAME "table" +#define COLUMN_RECORD_NAME "record" + +namespace mrn { + Operations::Operations(grn_ctx *ctx) + : ctx_(ctx) { + MRN_DBUG_ENTER_METHOD(); + + GRN_TEXT_INIT(&text_buffer_, GRN_OBJ_DO_SHALLOW_COPY); + GRN_UINT32_INIT(&id_buffer_, 0); + + table_ = grn_ctx_get(ctx_, TABLE_NAME, -1); + if (!table_) { + table_ = grn_table_create(ctx_, + TABLE_NAME, strlen(TABLE_NAME), + NULL, + GRN_OBJ_TABLE_NO_KEY | GRN_OBJ_PERSISTENT, + NULL, NULL); + columns_.type_ = + grn_column_create(ctx_, table_, + COLUMN_TYPE_NAME, strlen(COLUMN_TYPE_NAME), + NULL, + GRN_OBJ_COLUMN_SCALAR | GRN_OBJ_PERSISTENT, + grn_ctx_at(ctx_, GRN_DB_SHORT_TEXT)); + columns_.table_ = + grn_column_create(ctx_, table_, + COLUMN_TABLE_NAME, strlen(COLUMN_TABLE_NAME), + NULL, + GRN_OBJ_COLUMN_SCALAR | GRN_OBJ_PERSISTENT, + grn_ctx_at(ctx_, GRN_DB_SHORT_TEXT)); + columns_.record_ = + grn_column_create(ctx_, table_, + COLUMN_RECORD_NAME, strlen(COLUMN_RECORD_NAME), + NULL, + GRN_OBJ_COLUMN_SCALAR | GRN_OBJ_PERSISTENT, + grn_ctx_at(ctx_, GRN_DB_UINT32)); + } else { + columns_.type_ = grn_ctx_get(ctx_, TABLE_NAME "." COLUMN_TYPE_NAME, -1); + columns_.table_ = grn_ctx_get(ctx_, TABLE_NAME "." COLUMN_TABLE_NAME, -1); + columns_.record_ = grn_ctx_get(ctx_, TABLE_NAME "." COLUMN_RECORD_NAME, -1); + } + + is_enabled_recording_ = true; + + DBUG_VOID_RETURN; + } + + Operations::~Operations() { + MRN_DBUG_ENTER_METHOD(); + + GRN_OBJ_FIN(ctx_, &id_buffer_); + GRN_OBJ_FIN(ctx_, &text_buffer_); + + DBUG_VOID_RETURN; + } + + bool Operations::is_locked() { + MRN_DBUG_ENTER_METHOD(); + + if (grn_obj_is_locked(ctx_, table_) > 0) + DBUG_RETURN(true); + + if (grn_obj_is_locked(ctx_, columns_.type_) > 0) + DBUG_RETURN(true); + + if (grn_obj_is_locked(ctx_, columns_.table_) > 0) + DBUG_RETURN(true); + + if (grn_obj_is_locked(ctx_, columns_.record_) > 0) + DBUG_RETURN(true); + + DBUG_RETURN(false); + } + + grn_id Operations::start(const char *type, + const char *table_name, size_t table_name_size) { + MRN_DBUG_ENTER_METHOD(); + + if (!is_enabled_recording_) { + DBUG_RETURN(GRN_ID_NIL); + } + + grn_id id = grn_table_add(ctx_, table_, NULL, 0, NULL); + + GRN_TEXT_SETS(ctx_, &text_buffer_, type); + grn_obj_set_value(ctx_, columns_.type_, id, &text_buffer_, GRN_OBJ_SET); + + GRN_TEXT_SET(ctx_, &text_buffer_, table_name, table_name_size); + grn_obj_set_value(ctx_, columns_.table_, id, &text_buffer_, GRN_OBJ_SET); + + DBUG_RETURN(id); + } + + void Operations::record_target(grn_id id, grn_id record_id) { + MRN_DBUG_ENTER_METHOD(); + + if (!is_enabled_recording_) { + DBUG_VOID_RETURN; + } + + GRN_UINT32_SET(ctx_, &id_buffer_, record_id); + grn_obj_set_value(ctx_, columns_.record_, id, &id_buffer_, GRN_OBJ_SET); + + DBUG_VOID_RETURN; + } + + void Operations::finish(grn_id id) { + MRN_DBUG_ENTER_METHOD(); + + if (!is_enabled_recording_) { + DBUG_VOID_RETURN; + } + + grn_table_delete_by_id(ctx_, table_, id); + + DBUG_VOID_RETURN; + } + + void Operations::enable_recording() { + MRN_DBUG_ENTER_METHOD(); + + is_enabled_recording_ = true; + + DBUG_VOID_RETURN; + } + + void Operations::disable_recording() { + MRN_DBUG_ENTER_METHOD(); + + is_enabled_recording_ = false; + + DBUG_VOID_RETURN; + } + + grn_hash *Operations::collect_processing_table_names() { + MRN_DBUG_ENTER_METHOD(); + + grn_hash *table_names = + grn_hash_create(ctx_, NULL, GRN_TABLE_MAX_KEY_SIZE, 0, + GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_KEY_VAR_SIZE); + + grn_table_cursor *cursor; + cursor = grn_table_cursor_open(ctx_, table_, NULL, 0, NULL, 0, 0, -1, 0); + if (!cursor) { + GRN_LOG(ctx_, GRN_LOG_NOTICE, + "[operations] failed to open cursor: %s", + ctx_->errbuf); + DBUG_RETURN(table_names); + } + + grn_id id; + while ((id = grn_table_cursor_next(ctx_, cursor))) { + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.table_, id, &text_buffer_); + if (GRN_TEXT_LEN(&text_buffer_) > 0) { + grn_hash_add(ctx_, table_names, + GRN_TEXT_VALUE(&text_buffer_), + GRN_TEXT_LEN(&text_buffer_), + NULL, + NULL); + } + } + grn_table_cursor_close(ctx_, cursor); + + DBUG_RETURN(table_names); + } + + int Operations::repair(const char *table_name, size_t table_name_size) { + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + grn_table_cursor *cursor; + cursor = grn_table_cursor_open(ctx_, table_, NULL, 0, NULL, 0, 0, -1, 0); + if (!cursor) { + error = HA_ERR_CRASHED_ON_USAGE; + if (ctx_->rc) { + my_message(error, ctx_->errbuf, MYF(0)); + } else { + my_message(error, + "mroonga: repair: " + "failed to open cursor for operations table", + MYF(0)); + } + DBUG_RETURN(error); + } + + grn_obj *target_table = grn_ctx_get(ctx_, table_name, table_name_size); + if (!target_table) { + GRN_LOG(ctx_, GRN_LOG_WARNING, + "table doesn't exist for auto repair: <%.*s>", + static_cast(table_name_size), table_name); + } + + grn_id id; + while ((id = grn_table_cursor_next(ctx_, cursor))) { + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.table_, id, &text_buffer_); + if (!((static_cast(GRN_TEXT_LEN(&text_buffer_)) == + table_name_size) && + memcmp(GRN_TEXT_VALUE(&text_buffer_), + table_name, + table_name_size) == 0)) { + continue; + } + + if (!target_table) { + grn_rc rc = grn_table_cursor_delete(ctx_, cursor); + if (rc != GRN_SUCCESS) { + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.type_, id, &text_buffer_); + GRN_TEXT_PUTC(ctx_, &text_buffer_, '\0'); + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: repair: failed to delete an orphan operation: " + "[%u]: <%.*s>[%s]: <%s>(%d)", + id, + static_cast(table_name_size), table_name, + GRN_TEXT_VALUE(&text_buffer_), + ctx_->errbuf, + rc); + my_message(error, error_message, MYF(0)); + break; + } + continue; + } + + GRN_BULK_REWIND(&id_buffer_); + grn_obj_get_value(ctx_, columns_.record_, id, &id_buffer_); + grn_id record_id = GRN_UINT32_VALUE(&id_buffer_); + if (record_id == GRN_ID_NIL) { + grn_rc rc = grn_table_cursor_delete(ctx_, cursor); + if (rc != GRN_SUCCESS) { + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.type_, id, &text_buffer_); + GRN_TEXT_PUTC(ctx_, &text_buffer_, '\0'); + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: repair: " + "failed to delete an operation that has no related record: " + "[%u]: <%.*s>[%s]: <%s>(%d)", + id, + static_cast(table_name_size), table_name, + GRN_TEXT_VALUE(&text_buffer_), + ctx_->errbuf, + rc); + my_message(error, error_message, MYF(0)); + break; + } + continue; + } + + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.type_, id, &text_buffer_); + GRN_TEXT_PUTC(ctx_, &text_buffer_, '\0'); + if (strcmp(GRN_TEXT_VALUE(&text_buffer_), "write") == 0 || + strcmp(GRN_TEXT_VALUE(&text_buffer_), "delete") == 0) { + grn_rc rc = grn_table_delete_by_id(ctx_, target_table, record_id); + if (rc != GRN_SUCCESS) { + error = HA_ERR_CRASHED_ON_USAGE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: repair: failed to delete an incomplete record: " + "[%u]: <%.*s>[%u]: <%s>(%d)", + id, + static_cast(table_name_size), table_name, + record_id, + ctx_->errbuf, + rc); + my_message(error, error_message, MYF(0)); + break; + } + + rc = grn_table_cursor_delete(ctx_, cursor); + if (rc != GRN_SUCCESS) { + error = HA_ERR_CRASHED_ON_USAGE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: repair: failed to delete an incomplete operation: " + "[%u]: <%.*s>[%u][%s]: <%s>(%d)", + id, + static_cast(table_name_size), table_name, + record_id, + GRN_TEXT_VALUE(&text_buffer_), + ctx_->errbuf, + rc); + my_message(error, error_message, MYF(0)); + break; + } + } else if (strcmp(GRN_TEXT_VALUE(&text_buffer_), "update") == 0) { + error = HA_ERR_CRASHED_ON_USAGE; + my_message(error, + "mroonga: repair: can't recover from crash while updating", + MYF(0)); + break; + } else { + error = HA_ERR_CRASHED_ON_USAGE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: repair: unknown operation type: " + "[%u]: <%.*s>[%u]: <%s>", + id, + static_cast(table_name_size), table_name, + record_id, + GRN_TEXT_VALUE(&text_buffer_)); + my_message(error, error_message, MYF(0)); + break; + } + } + grn_table_cursor_close(ctx_, cursor); + + DBUG_RETURN(error); + } + + int Operations::clear(const char *table_name, size_t table_name_size) { + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + grn_table_cursor *cursor; + cursor = grn_table_cursor_open(ctx_, table_, NULL, 0, NULL, 0, 0, -1, 0); + if (!cursor) { + error = HA_ERR_CRASHED_ON_USAGE; + if (ctx_->rc) { + my_message(error, ctx_->errbuf, MYF(0)); + } else { + my_message(error, + "mroonga: clear: " + "failed to open cursor for operations table", + MYF(0)); + } + DBUG_RETURN(error); + } + + grn_id id; + while ((id = grn_table_cursor_next(ctx_, cursor))) { + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.table_, id, &text_buffer_); + if ((static_cast(GRN_TEXT_LEN(&text_buffer_)) == + table_name_size) && + memcmp(GRN_TEXT_VALUE(&text_buffer_), + table_name, + table_name_size) == 0) { + grn_rc rc = grn_table_cursor_delete(ctx_, cursor); + if (rc != GRN_SUCCESS) { + error = HA_ERR_CRASHED_ON_USAGE; + GRN_BULK_REWIND(&id_buffer_); + grn_obj_get_value(ctx_, columns_.record_, id, &id_buffer_); + GRN_BULK_REWIND(&text_buffer_); + grn_obj_get_value(ctx_, columns_.type_, id, &text_buffer_); + GRN_TEXT_PUTC(ctx_, &text_buffer_, '\0'); + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: clear: failed to delete an operation: " + "[%u]: <%.*s>[%u][%s]: <%s>(%d)", + id, + static_cast(table_name_size), table_name, + GRN_UINT32_VALUE(&id_buffer_), + GRN_TEXT_VALUE(&text_buffer_), + ctx_->errbuf, + rc); + my_message(error, error_message, MYF(0)); + break; + } + } + } + grn_table_cursor_close(ctx_, cursor); + + DBUG_RETURN(error); + } +} diff --git a/storage/mroonga/lib/mrn_operations.hpp b/storage/mroonga/lib/mrn_operations.hpp new file mode 100644 index 0000000000000..762a5ee9d434c --- /dev/null +++ b/storage/mroonga/lib/mrn_operations.hpp @@ -0,0 +1,60 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2015 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MRN_OPERATIONS_HPP_ +#define MRN_OPERATIONS_HPP_ + +#include + +namespace mrn { + class Operations { + public: + Operations(grn_ctx *ctx); + ~Operations(); + + bool is_locked(); + + grn_id start(const char *type, + const char *table_name, size_t table_name_size); + void record_target(grn_id id, grn_id target_id); + void finish(grn_id id); + + void enable_recording(); + void disable_recording(); + + grn_hash *collect_processing_table_names(); + + int repair(const char *table_name, size_t table_name_size); + int clear(const char *table_name, size_t table_name_size); + + private: + grn_ctx *ctx_; + grn_obj text_buffer_; + grn_obj id_buffer_; + grn_obj *table_; + struct { + grn_obj *type_; + grn_obj *table_; + grn_obj *record_; + } columns_; + bool is_enabled_recording_; + }; +} + +#endif /* MRN_OPERATIONS_HPP_ */ diff --git a/storage/mroonga/lib/mrn_path_mapper.cpp b/storage/mroonga/lib/mrn_path_mapper.cpp index 7a595986f01a5..43f276f4e82a0 100644 --- a/storage/mroonga/lib/mrn_path_mapper.cpp +++ b/storage/mroonga/lib/mrn_path_mapper.cpp @@ -222,4 +222,8 @@ namespace mrn { mysql_path_[i] = '\0'; return mysql_path_; } + + bool PathMapper::is_internal_table_name() { + return mysql_table_name()[0] == '#'; + } } diff --git a/storage/mroonga/lib/mrn_path_mapper.hpp b/storage/mroonga/lib/mrn_path_mapper.hpp index 607bfe4cdce4c..9849d5e28efeb 100644 --- a/storage/mroonga/lib/mrn_path_mapper.hpp +++ b/storage/mroonga/lib/mrn_path_mapper.hpp @@ -38,6 +38,8 @@ namespace mrn { const char *table_name(); const char *mysql_table_name(); const char *mysql_path(); + bool is_internal_table_name(); + bool is_temporary_table_name(); private: const char *original_mysql_path_; const char *path_prefix_; diff --git a/storage/mroonga/lib/mrn_query_parser.cpp b/storage/mroonga/lib/mrn_query_parser.cpp new file mode 100644 index 0000000000000..4e05069a3a9ec --- /dev/null +++ b/storage/mroonga/lib/mrn_query_parser.cpp @@ -0,0 +1,361 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "mrn_query_parser.hpp" + +#include + +extern "C" { + /* Groonga's internal functions */ + int grn_atoi(const char *nptr, const char *end, const char **rest); + uint grn_atoui(const char *nptr, const char *end, const char **rest); +} + +#define MRN_CLASS_NAME "mrn::QueryParser" + +namespace mrn { + QueryParser::QueryParser(grn_ctx *ctx, + THD *thd, + grn_obj *expression, + grn_obj *default_column, + uint n_sections, + grn_obj *match_columns) + : ctx_(ctx), + thd_(thd), + expression_(expression), + default_column_(default_column), + n_sections_(n_sections), + match_columns_(match_columns) { + } + + QueryParser::~QueryParser() { + } + + grn_rc QueryParser::parse(const char *query, size_t query_length) { + MRN_DBUG_ENTER_METHOD(); + + const char *raw_query = NULL; + size_t raw_query_length = 0; + grn_operator default_operator = GRN_OP_OR; + grn_expr_flags expression_flags = 0; + parse_pragma(query, + query_length, + &raw_query, + &raw_query_length, + &default_operator, + &expression_flags); + + grn_obj *default_column = default_column_; + if (match_columns_) { + default_column = match_columns_; + } + grn_rc rc = grn_expr_parse(ctx_, + expression_, + raw_query, + raw_query_length, + default_column, + GRN_OP_MATCH, + default_operator, + expression_flags); + if (rc != GRN_SUCCESS) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to parse fulltext search keyword: <%.*s>: <%s>", + static_cast(query_length), + query, + ctx_->errbuf); + variables::ActionOnError action = + variables::get_action_on_fulltext_query_error(thd_); + switch (action) { + case variables::ACTION_ON_ERROR_ERROR: + my_message(ER_PARSE_ERROR, error_message, MYF(0)); + break; + case variables::ACTION_ON_ERROR_ERROR_AND_LOG: + my_message(ER_PARSE_ERROR, error_message, MYF(0)); + GRN_LOG(ctx_, GRN_LOG_ERROR, "%s", error_message); + break; + case variables::ACTION_ON_ERROR_IGNORE: + break; + case variables::ACTION_ON_ERROR_IGNORE_AND_LOG: + GRN_LOG(ctx_, GRN_LOG_ERROR, "%s", error_message); + break; + } + } + + DBUG_RETURN(rc); + } + + void QueryParser::parse_pragma(const char *query, + size_t query_length, + const char **raw_query, + size_t *raw_query_length, + grn_operator *default_operator, + grn_expr_flags *flags) { + MRN_DBUG_ENTER_METHOD(); + + const char *current_query = query; + size_t current_query_length = query_length; + + *default_operator = GRN_OP_OR; + + if (current_query_length >= 4 && memcmp(current_query, "*SS ", 4) == 0) { + *raw_query = current_query + 4; + *raw_query_length = current_query_length - 4; + *flags = GRN_EXPR_SYNTAX_SCRIPT; + DBUG_VOID_RETURN; + } + + bool weight_specified = false; + *raw_query = query; + *raw_query_length = query_length; + *flags = default_expression_flags(); + if (current_query_length >= 2 && current_query[0] == '*') { + bool parsed = false; + bool done = false; + current_query++; + current_query_length--; + while (!done) { + size_t consumed_query_length = 0; + switch (current_query[0]) { + case 'D': + if (parse_pragma_d(current_query + 1, + current_query_length - 1, + default_operator, + &consumed_query_length)) { + parsed = true; + consumed_query_length += 1; + current_query += consumed_query_length; + current_query_length -= consumed_query_length; + } else { + done = true; + } + break; + case 'W': + if (parse_pragma_w(current_query + 1, + current_query_length - 1, + &consumed_query_length)) { + parsed = true; + weight_specified = true; + consumed_query_length += 1; + current_query += consumed_query_length; + current_query_length -= consumed_query_length; + } else { + done = true; + } + break; + default: + done = true; + break; + } + } + if (parsed) { + *raw_query = current_query; + *raw_query_length = current_query_length; + } + } + + // WORKAROUND: ignore the first '+' to support "+apple macintosh" pattern. + while (*raw_query_length > 0 && (*raw_query)[0] == ' ') { + (*raw_query)++; + (*raw_query_length)--; + } + if (*raw_query_length > 0 && (*raw_query)[0] == '+') { + (*raw_query)++; + (*raw_query_length)--; + } + if (!weight_specified && match_columns_) { + grn_expr_append_obj(ctx_, match_columns_, default_column_, GRN_OP_PUSH, 1); + } + + DBUG_VOID_RETURN; + } + + bool QueryParser::parse_pragma_w(const char *query, + size_t query_length, + size_t *consumed_query_length) { + MRN_DBUG_ENTER_METHOD(); + + *consumed_query_length = 0; + + grn_obj section_value_buffer; + GRN_UINT32_INIT(§ion_value_buffer, 0); + + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(bool, specified_sections, n_sections_); + for (uint i = 0; i < n_sections_; ++i) { + specified_sections[i] = false; + } + + uint n_weights = 0; + while (query_length >= 1) { + if (n_weights >= 1) { + if (query[0] != ',') { + break; + } + size_t n_used_query_length = 1; + *consumed_query_length += n_used_query_length; + query_length -= n_used_query_length; + query += n_used_query_length; + if (query_length == 0) { + break; + } + } + + uint section = 0; + if ('1' <= query[0] && query[0] <= '9') { + const char *section_start = query; + const char *query_end = query + query_length; + const char *query_rest; + section = grn_atoui(section_start, query_end, &query_rest); + if (section_start == query_rest) { + break; + } + if (!(0 < section && section <= n_sections_)) { + break; + } + section -= 1; + specified_sections[section] = true; + size_t n_used_query_length = query_rest - query; + *consumed_query_length += n_used_query_length; + query_length -= n_used_query_length; + query += n_used_query_length; + } else { + break; + } + + int weight = 1; + if (query_length >= 2 && query[0] == ':') { + const char *weight_start = query + 1; + const char *query_end = query + query_length; + const char *query_rest; + weight = grn_atoi(weight_start, query_end, &query_rest); + if (weight_start == query_rest) { + break; + } + size_t n_used_query_length = query_rest - query; + *consumed_query_length += n_used_query_length; + query_length -= n_used_query_length; + query += n_used_query_length; + } + + n_weights++; + + append_section(section, + §ion_value_buffer, + weight, + n_weights); + } + + for (uint section = 0; section < n_sections_; ++section) { + if (specified_sections[section]) { + continue; + } + + ++n_weights; + + int default_weight = 1; + append_section(section, + §ion_value_buffer, + default_weight, + n_weights); + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(specified_sections); + + GRN_OBJ_FIN(ctx_, §ion_value_buffer); + + DBUG_RETURN(n_weights > 0); + } + + void QueryParser::append_section(uint section, + grn_obj *section_value_buffer, + int weight, + uint n_weights) { + MRN_DBUG_ENTER_METHOD(); + + if (!match_columns_) { + DBUG_VOID_RETURN; + } + + grn_expr_append_obj(ctx_, match_columns_, default_column_, GRN_OP_PUSH, 1); + GRN_UINT32_SET(ctx_, section_value_buffer, section); + grn_expr_append_const(ctx_, match_columns_, section_value_buffer, + GRN_OP_PUSH, 1); + grn_expr_append_op(ctx_, match_columns_, GRN_OP_GET_MEMBER, 2); + + if (weight != 1) { + grn_expr_append_const_int(ctx_, match_columns_, weight, GRN_OP_PUSH, 1); + grn_expr_append_op(ctx_, match_columns_, GRN_OP_STAR, 2); + } + + if (n_weights >= 2) { + grn_expr_append_op(ctx_, match_columns_, GRN_OP_OR, 2); + } + + DBUG_VOID_RETURN; + } + + bool QueryParser::parse_pragma_d(const char *query, + size_t query_length, + grn_operator *default_operator, + size_t *consumed_query_length) { + MRN_DBUG_ENTER_METHOD(); + + bool succeeded = true; + if (query_length >= 1 && query[0] == '+') { + *default_operator = GRN_OP_AND; + *consumed_query_length = 1; + } else if (query_length >= 1 && query[0] == '-') { + *default_operator = GRN_OP_AND_NOT; + *consumed_query_length = 1; + } else if (query_length >= 2 && memcmp(query, "OR", 2) == 0) { + *default_operator = GRN_OP_OR; + *consumed_query_length = 2; + } else { + succeeded = false; + } + + DBUG_RETURN(succeeded); + } + + grn_expr_flags QueryParser::default_expression_flags() { + MRN_DBUG_ENTER_METHOD(); + + ulonglong syntax_flags = variables::get_boolean_mode_syntax_flags(thd_); + grn_expr_flags expression_flags = 0; + if (syntax_flags == variables::BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT) { + expression_flags = GRN_EXPR_SYNTAX_QUERY | GRN_EXPR_ALLOW_LEADING_NOT; + } else { + if (syntax_flags & variables::BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_SCRIPT) { + expression_flags |= GRN_EXPR_SYNTAX_SCRIPT; + } else { + expression_flags |= GRN_EXPR_SYNTAX_QUERY; + } + if (syntax_flags & variables::BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_COLUMN) { + expression_flags |= GRN_EXPR_ALLOW_COLUMN; + } + if (syntax_flags & variables::BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_UPDATE) { + expression_flags |= GRN_EXPR_ALLOW_UPDATE; + } + if (syntax_flags & variables::BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_LEADING_NOT) { + expression_flags |= GRN_EXPR_ALLOW_LEADING_NOT; + } + } + + DBUG_RETURN(expression_flags); + } +} diff --git a/storage/mroonga/lib/mrn_query_parser.hpp b/storage/mroonga/lib/mrn_query_parser.hpp new file mode 100644 index 0000000000000..8b3c4084c8d0b --- /dev/null +++ b/storage/mroonga/lib/mrn_query_parser.hpp @@ -0,0 +1,67 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include + +#include + +namespace mrn { + class QueryParser { + public: + QueryParser(grn_ctx *ctx, + THD *thd, + grn_obj *expression, + grn_obj *default_column, + uint n_sections, + grn_obj *match_columns=NULL); + ~QueryParser(); + + grn_rc parse(const char *query, size_t query_length); + void parse_pragma(const char *query, + size_t query_length, + const char **raw_query, + size_t *raw_query_length, + grn_operator *default_operator, + grn_expr_flags *flags); + + private: + grn_ctx *ctx_; + THD *thd_; + grn_obj *expression_; + grn_obj *default_column_; + uint n_sections_; + grn_obj *match_columns_; + + bool parse_pragma_w(const char *query, + size_t query_length, + size_t *consumed_query_length); + void append_section(uint section, + grn_obj *section_value_buffer, + int weight, + uint n_weights); + bool parse_pragma_d(const char *query, + size_t query_length, + grn_operator *default_operator, + size_t *consumed_query_length); + grn_expr_flags default_expression_flags(); + }; +} diff --git a/storage/mroonga/lib/mrn_smart_bitmap.cpp b/storage/mroonga/lib/mrn_smart_bitmap.cpp new file mode 100644 index 0000000000000..9dc91ff29d5e5 --- /dev/null +++ b/storage/mroonga/lib/mrn_smart_bitmap.cpp @@ -0,0 +1,42 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "mrn_smart_bitmap.hpp" + +namespace mrn { + SmartBitmap::SmartBitmap(MY_BITMAP *bitmap) + : bitmap_(bitmap) { + } + + SmartBitmap::~SmartBitmap() { + if (bitmap_) { + bitmap_free(bitmap_); + } + } + + MY_BITMAP *SmartBitmap::get() { + return bitmap_; + } + + MY_BITMAP *SmartBitmap::release() { + MY_BITMAP *bitmap = bitmap_; + bitmap_ = NULL; + return bitmap; + } +} diff --git a/storage/mroonga/lib/mrn_smart_bitmap.hpp b/storage/mroonga/lib/mrn_smart_bitmap.hpp new file mode 100644 index 0000000000000..dfb569560242f --- /dev/null +++ b/storage/mroonga/lib/mrn_smart_bitmap.hpp @@ -0,0 +1,36 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include + +namespace mrn { + class SmartBitmap { + public: + SmartBitmap(MY_BITMAP *bitmap); + ~SmartBitmap(); + + MY_BITMAP *get(); + MY_BITMAP *release(); + private: + MY_BITMAP *bitmap_; + }; +} diff --git a/storage/mroonga/lib/mrn_table_fields_offset_mover.cpp b/storage/mroonga/lib/mrn_table_fields_offset_mover.cpp new file mode 100644 index 0000000000000..7f1dae266c7e4 --- /dev/null +++ b/storage/mroonga/lib/mrn_table_fields_offset_mover.cpp @@ -0,0 +1,41 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "mrn_table_fields_offset_mover.hpp" + +namespace mrn { + TableFieldsOffsetMover::TableFieldsOffsetMover(TABLE *table, + my_ptrdiff_t diff) + : table_(table), + diff_(diff) { + uint n_columns = table_->s->fields; + for (uint i = 0; i < n_columns; ++i) { + Field *field = table_->field[i]; + field->move_field_offset(diff_); + } + } + + TableFieldsOffsetMover::~TableFieldsOffsetMover() { + uint n_columns = table_->s->fields; + for (uint i = 0; i < n_columns; ++i) { + Field *field = table_->field[i]; + field->move_field_offset(-diff_); + } + } +} diff --git a/storage/mroonga/lib/mrn_table_fields_offset_mover.hpp b/storage/mroonga/lib/mrn_table_fields_offset_mover.hpp new file mode 100644 index 0000000000000..a8d12be19eddf --- /dev/null +++ b/storage/mroonga/lib/mrn_table_fields_offset_mover.hpp @@ -0,0 +1,33 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +namespace mrn { + class TableFieldsOffsetMover { + public: + TableFieldsOffsetMover(TABLE *table, my_ptrdiff_t diff); + ~TableFieldsOffsetMover(); + private: + TABLE *table_; + my_ptrdiff_t diff_; + }; +} diff --git a/storage/mroonga/mrn_err.h b/storage/mroonga/mrn_err.h index d109f87bb4890..95b1b047c7963 100644 --- a/storage/mroonga/mrn_err.h +++ b/storage/mroonga/mrn_err.h @@ -39,5 +39,8 @@ #define ER_MRN_INVALID_INDEX_FLAG_NUM 16508 #define ER_MRN_INVALID_INDEX_FLAG_STR \ "The index flag '%-.64s' is invalid. It is ignored" +#define ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_NUM 16509 +#define ER_MRN_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN_STR \ + "Index for virtual generated column is not supported: %s" #endif /* MRN_ERR_H_ */ diff --git a/storage/mroonga/mrn_mysql.h b/storage/mroonga/mrn_mysql.h index 644825dcf3904..086d1ea2e3fe4 100644 --- a/storage/mroonga/mrn_mysql.h +++ b/storage/mroonga/mrn_mysql.h @@ -43,21 +43,18 @@ #define MYSQL_SERVER 1 #include -#if MYSQL_VERSION_ID < 50500 -# include -# include -#else -# include -# include -# include -# include -#endif -#include - #ifdef MARIADB_BASE_VERSION # define MRN_MARIADB_P 1 #endif +#include +#include +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID < 80002) +# include +#endif +#include +#include + #define MRN_MESSAGE_BUFFER_SIZE 1024 #define MRN_DBUG_ENTER_FUNCTION() DBUG_ENTER(__FUNCTION__) diff --git a/storage/mroonga/mrn_mysql_compat.h b/storage/mroonga/mrn_mysql_compat.h index 660c72b4d256c..d33a8c88d879b 100644 --- a/storage/mroonga/mrn_mysql_compat.h +++ b/storage/mroonga/mrn_mysql_compat.h @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* - Copyright(C) 2011-2015 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,10 @@ # define MRN_HAVE_MYSQL_TYPE_TIME2 #endif +#if MYSQL_VERSION_ID >= 50709 && !defined(MRN_MARIADB_P) +# define MRN_HAVE_MYSQL_TYPE_JSON +#endif + #if MYSQL_VERSION_ID < 50603 typedef MYSQL_ERROR Sql_condition; #endif @@ -42,6 +46,10 @@ typedef char *range_id_t; #endif +#if defined(MRN_MARIADB_P) || MYSQL_VERSION_ID < 80002 + typedef st_select_lex SELECT_LEX; +#endif + #if MYSQL_VERSION_ID >= 50609 # define MRN_KEY_HAS_USER_DEFINED_KEYPARTS #endif @@ -99,6 +107,9 @@ #if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100009 # define MRN_HAVE_TDC_ACQUIRE_SHARE +# if MYSQL_VERSION_ID < 100200 +# define MRN_TDC_ACQUIRE_SHARE_REQUIRE_KEY +# endif #endif #if MYSQL_VERSION_ID >= 50613 @@ -206,6 +217,26 @@ # define MRN_SUPPORT_CUSTOM_OPTIONS #endif +#ifdef MRN_MARIADB_P +# define MRN_HAVE_ITEM_EQUAL_FIELDS_ITERATOR +#endif + +#if MYSQL_VERSION_ID >= 50706 && !defined(MRN_MARIADB_P) +# define MRN_SELECT_LEX_GET_WHERE_COND(select_lex) \ + ((select_lex)->where_cond()) +# define MRN_SELECT_LEX_GET_HAVING_COND(select_lex) \ + ((select_lex)->having_cond()) +# define MRN_SELECT_LEX_GET_ACTIVE_OPTIONS(select_lex) \ + ((select_lex)->active_options()) +#else +# define MRN_SELECT_LEX_GET_WHERE_COND(select_lex) \ + ((select_lex)->where) +# define MRN_SELECT_LEX_GET_HAVING_COND(select_lex) \ + ((select_lex)->having) +# define MRN_SELECT_LEX_GET_ACTIVE_OPTIONS(select_lex) \ + ((select_lex)->options) +#endif + #if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100000 # if MYSQL_VERSION_ID >= 100104 # define mrn_init_sql_alloc(thd, mem_root) \ @@ -221,17 +252,25 @@ MYF(0)) # endif #else +# if MYSQL_VERSION_ID >= 50709 +# define mrn_init_sql_alloc(thd, mem_root) \ + init_sql_alloc(mrn_memory_key, \ + mem_root, \ + TABLE_ALLOC_BLOCK_SIZE, \ + 0) +# else # define mrn_init_sql_alloc(thd, mem_root) \ init_sql_alloc(mem_root, \ TABLE_ALLOC_BLOCK_SIZE, \ 0) +# endif #endif #ifdef MRN_MARIADB_P # define MRN_ABORT_ON_WARNING(thd) thd->abort_on_warning #else # if MYSQL_VERSION_ID >= 50706 -# define MRN_ABORT_ON_WARNING(thd) false +# define MRN_ABORT_ON_WARNING(thd) thd->is_strict_mode() # else # define MRN_ABORT_ON_WARNING(thd) thd->abort_on_warning # endif @@ -240,4 +279,204 @@ #define MRN_ERROR_CODE_DATA_TRUNCATE(thd) \ (MRN_ABORT_ON_WARNING(thd) ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED) +#if MYSQL_VERSION_ID >= 50709 && !defined(MRN_MARIADB_P) +# define mrn_my_hash_init(hash, \ + charset, \ + default_array_elements, \ + key_offset, \ + key_length, \ + get_key, \ + free_element, \ + flags) \ + my_hash_init(hash, \ + charset, \ + default_array_elements, \ + key_offset, \ + key_length, \ + get_key, \ + free_element, \ + flags, \ + mrn_memory_key) +#else +# define mrn_my_hash_init(hash, \ + charset, \ + default_array_elements, \ + key_offset, \ + key_length, \ + get_key, \ + free_element, \ + flags) \ + my_hash_init(hash, \ + charset, \ + default_array_elements, \ + key_offset, \ + key_length, \ + get_key, \ + free_element, \ + flags) +#endif + +#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100000 +# define mrn_strconvert(from_cs, \ + from, \ + from_length, \ + to_cs, \ + to, \ + to_length, \ + errors) \ + strconvert((from_cs), \ + (from), \ + (from_length), \ + (to_cs), \ + (to), \ + (to_length), \ + (errors)) +#else +# define mrn_strconvert(from_cs, \ + from, \ + from_length, \ + to_cs, \ + to, \ + to_length, \ + errors) \ + strconvert((from_cs), \ + (from), \ + (to_cs), \ + (to), \ + (to_length), \ + (errors)) +#endif + +#if MYSQL_VERSION_ID >= 50717 && !defined(MRN_MARIADB_P) +# define mrn_is_directory_separator(c) \ + is_directory_separator((c)) +#else +# define mrn_is_directory_separator(c) \ + (c == FN_LIBCHAR || c == FN_LIBCHAR2) +#endif + +#if ((MYSQL_VERSION_ID < 50636) || \ + (MYSQL_VERSION_ID >= 50700 && MYSQL_VERSION_ID < 50718)) && !defined(MRN_MARIADB_P) +# define MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED +#endif + +#if defined(MRN_MARIADB_P) && \ + ((MYSQL_VERSION_ID >= 100207) || \ + ((MYSQL_VERSION_ID >= 100126) && (MYSQL_VERSION_ID < 100200)) || \ + ((MYSQL_VERSION_ID >= 100032) && (MYSQL_VERSION_ID < 100100)) || \ + ((MYSQL_VERSION_ID >= 50557) && (MYSQL_VERSION_ID < 100000))) +# define mrn_create_partition_name(out, \ + out_length, \ + in1, \ + in2, \ + name_variant, \ + translate) \ + create_partition_name(out, out_length, in1, in2, name_variant, translate) +# define mrn_create_subpartition_name(out, \ + out_length, \ + in1, \ + in2, \ + in3, \ + name_variant) \ + create_subpartition_name(out, out_length, in1, in2, in3, name_variant) +#else +# define mrn_create_partition_name(out, \ + out_length, \ + in1, \ + in2, \ + name_variant, \ + translate) \ + (create_partition_name(out, in1, in2, name_variant, translate), 0) +# define mrn_create_subpartition_name(out, \ + out_length, \ + in1, \ + in2, \ + in3, \ + name_variant) \ + (create_subpartition_name(out, in1, in2, in3, name_variant), 0) +#endif + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) +# define ITEM_SUM_GET_NEST_LEVEL(sum_item) (sum_item)->base_select->nest_level +# define ITEM_SUM_GET_AGGR_LEVEL(sum_item) (sum_item)->aggr_select->nest_level +# define ITEM_SUM_GET_MAX_AGGR_LEVEL(sum_item) (sum_item)->max_aggr_level +#else +# define ITEM_SUM_GET_NEST_LEVEL(sum_item) (sum_item)->nest_level +# define ITEM_SUM_GET_AGGR_LEVEL(sum_item) (sum_item)->aggr_level +# define ITEM_SUM_GET_MAX_AGGR_LEVEL(sum_item) (sum_item)->max_arg_level +#endif + +#if (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 80002) + typedef bool mrn_bool; +#else + typedef my_bool mrn_bool; +#endif + +#define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \ + type *variable_name = \ + (type *)mrn_my_malloc(sizeof(type) * (variable_size), MYF(MY_WME)) +#define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) \ + my_free(variable_name) + +#if ((defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100203)) || \ + (!defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50711) +# define MRN_ALTER_INPLACE_INFO_ADD_VIRTUAL_COLUMN \ + Alter_inplace_info::ADD_VIRTUAL_COLUMN +# define MRN_ALTER_INPLACE_INFO_ADD_STORED_BASE_COLUMN \ + Alter_inplace_info::ADD_STORED_BASE_COLUMN +# define MRN_ALTER_INPLACE_INFO_ADD_STORED_GENERATED_COLUMN \ + Alter_inplace_info::ADD_STORED_GENERATED_COLUMN +#else +# define MRN_ALTER_INPLACE_INFO_ADD_VIRTUAL_COLUMN 0 +# define MRN_ALTER_INPLACE_INFO_ADD_STORED_BASE_COLUMN \ + Alter_inplace_info::ADD_COLUMN +# define MRN_ALTER_INPLACE_INFO_ADD_STORED_GENERATED_COLUMN 0 +#endif + +#if (defined(HA_CAN_VIRTUAL_COLUMNS) || defined(HA_GENERATED_COLUMNS)) +# define MRN_SUPPORT_GENERATED_COLUMNS +#endif + +#ifdef MRN_MARIADB_P +# if (MYSQL_VERSION_ID >= 100200) +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) \ + (!field->stored_in_db()) +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) \ + (field->vcol_info && field->vcol_info->is_stored()) +# elif (MYSQL_VERSION_ID >= 50500) +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) \ + (!field->stored_in_db) +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) \ + (field->vcol_info && field->vcol_info->is_stored()) +# else +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) false +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) false +# endif +#else +# if (MYSQL_VERSION_ID >= 50708) +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) \ + (field->is_virtual_gcol()) +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) \ + (field->is_gcol() && !field->is_virtual_gcol()) +# elif (MYSQL_VERSION_ID >= 50706) +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) \ + (!field->stored_in_db) +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) \ + (field->gcol_info && field->gcol_info->get_field_stored()) +# else +# define MRN_GENERATED_COLUMNS_FIELD_IS_VIRTUAL(field) false +# define MRN_GENERATED_COLUMNS_FIELD_IS_STORED(field) false +# endif +#endif + +#ifdef MRN_MARIADB_P +# if (MYSQL_VERSION_ID >= 100203) +# define MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(table, field) \ + (table->update_virtual_field(field)) +# else +# define MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(table, field) \ + (field->vcol_info->expr_item->save_in_field(field, 0)) +# endif +#endif + #endif /* MRN_MYSQL_COMPAT_H_ */ diff --git a/storage/mroonga/mrn_table.cpp b/storage/mroonga/mrn_table.cpp index 3320fb8ff305e..c20f688fa6dc4 100644 --- a/storage/mroonga/mrn_table.cpp +++ b/storage/mroonga/mrn_table.cpp @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2011-2013 Kentoku SHIBA - Copyright(C) 2011-2015 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -202,7 +202,6 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length, const TABLE *table, partition_element **part_elem, partition_element **sub_elem) { - char tmp_name[FN_REFLEN + 1]; partition_info *part_info = table->part_info; partition_element *tmp_part_elem = NULL, *tmp_sub_elem = NULL; bool tmp_flg = FALSE, tmp_find_flg = FALSE; @@ -224,18 +223,24 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length, List_iterator sub_it((*part_elem)->subpartitions); while ((*sub_elem = sub_it++)) { - if (create_subpartition_name(tmp_name, sizeof(tmp_name), table->s->path.str, - (*part_elem)->partition_name, (*sub_elem)->partition_name, - NORMAL_PART_NAME)) + char subpartition_name[FN_REFLEN + 1]; + int error = mrn_create_subpartition_name(subpartition_name, + sizeof(subpartition_name), + table->s->path.str, + (*part_elem)->partition_name, + (*sub_elem)->partition_name, + NORMAL_PART_NAME); + if (error != 0) DBUG_VOID_RETURN; - DBUG_PRINT("info", ("mroonga tmp_name=%s", tmp_name)); - if (table_name && !memcmp(table_name, tmp_name, table_name_length + 1)) + DBUG_PRINT("info", ("mroonga subpartition name=%s", subpartition_name)); + if (table_name && + memcmp(table_name, subpartition_name, table_name_length + 1) == 0) DBUG_VOID_RETURN; if ( tmp_flg && table_name && - *(tmp_name + table_name_length - 5) == '\0' && - !memcmp(table_name, tmp_name, table_name_length - 5) + *(subpartition_name + table_name_length - 5) == '\0' && + memcmp(table_name, subpartition_name, table_name_length - 5) == 0 ) { tmp_part_elem = *part_elem; tmp_sub_elem = *sub_elem; @@ -244,17 +249,24 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length, } } } else { - if (create_partition_name(tmp_name, sizeof(tmp_name), table->s->path.str, - (*part_elem)->partition_name, NORMAL_PART_NAME, TRUE)) + char partition_name[FN_REFLEN + 1]; + int error = mrn_create_partition_name(partition_name, + sizeof(partition_name), + table->s->path.str, + (*part_elem)->partition_name, + NORMAL_PART_NAME, + TRUE); + if (error != 0) DBUG_VOID_RETURN; - DBUG_PRINT("info", ("mroonga tmp_name=%s", tmp_name)); - if (table_name && !memcmp(table_name, tmp_name, table_name_length + 1)) + DBUG_PRINT("info", ("mroonga partition name=%s", partition_name)); + if (table_name && + memcmp(table_name, partition_name, table_name_length + 1) == 0) DBUG_VOID_RETURN; if ( tmp_flg && table_name && - *(tmp_name + table_name_length - 5) == '\0' && - !memcmp(table_name, tmp_name, table_name_length - 5) + *(partition_name + table_name_length - 5) == '\0' && + memcmp(table_name, partition_name, table_name_length - 5) == 0 ) { tmp_part_elem = *part_elem; tmp_flg = FALSE; @@ -518,6 +530,7 @@ int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i) char *sprit_ptr[2]; char *tmp_ptr, *start_ptr; #endif + THD *thd = current_thd; MRN_DBUG_ENTER_FUNCTION(); #if MYSQL_VERSION_ID >= 50500 @@ -580,6 +593,10 @@ int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i) MRN_PARAM_STR_LIST("table", index_table, i); break; case 6: + push_warning_printf(thd, MRN_SEVERITY_WARNING, + ER_WARN_DEPRECATED_SYNTAX, + ER(ER_WARN_DEPRECATED_SYNTAX), + "parser", "tokenizer"); MRN_PARAM_STR_LIST("parser", key_tokenizer, i); break; case 9: @@ -1000,29 +1017,34 @@ int mrn_free_share(MRN_SHARE *share) TABLE_SHARE *mrn_get_table_share(TABLE_LIST *table_list, int *error) { - uint key_length; TABLE_SHARE *share; THD *thd = current_thd; MRN_DBUG_ENTER_FUNCTION(); -#ifdef MRN_HAVE_GET_TABLE_DEF_KEY +#if defined(MRN_HAVE_TDC_ACQUIRE_SHARE) && \ + !defined(MRN_TDC_ACQUIRE_SHARE_REQUIRE_KEY) + share = tdc_acquire_share(thd, table_list, GTS_TABLE); +#else + uint key_length; +# ifdef MRN_HAVE_GET_TABLE_DEF_KEY const char *key; key_length = get_table_def_key(table_list, &key); -#else +# else char key[MAX_DBKEY_LENGTH]; key_length = create_table_def_key(thd, key, table_list, FALSE); -#endif -#ifdef MRN_HAVE_TABLE_DEF_CACHE +# endif +# ifdef MRN_HAVE_TABLE_DEF_CACHE my_hash_value_type hash_value; hash_value = my_calc_hash(mrn_table_def_cache, (uchar*) key, key_length); share = get_table_share(thd, table_list, key, key_length, 0, error, hash_value); -#elif defined(MRN_HAVE_TDC_ACQUIRE_SHARE) +# elif defined(MRN_HAVE_TDC_ACQUIRE_SHARE) share = tdc_acquire_share(thd, table_list->db, table_list->table_name, key, key_length, table_list->mdl_request.key.tc_hash_value(), GTS_TABLE, NULL); -#else +# else share = get_table_share(thd, table_list, key, key_length, 0, error); +# endif #endif DBUG_RETURN(share); } @@ -1053,7 +1075,7 @@ TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path *error = ER_CANT_OPEN_FILE; DBUG_RETURN(NULL); } - share->tmp_table = INTERNAL_TMP_TABLE; // TODO: is this right? + share->tmp_table = NO_TMP_TABLE; // TODO: is this right? share->path.str = (char *) path; share->path.length = strlen(share->path.str); share->normalized_path.str = mrn_my_strdup(path, MYF(MY_WME)); diff --git a/storage/mroonga/mrn_variables.hpp b/storage/mroonga/mrn_variables.hpp index 6bc948a1cacbc..0866403e54caa 100644 --- a/storage/mroonga/mrn_variables.hpp +++ b/storage/mroonga/mrn_variables.hpp @@ -26,4 +26,28 @@ extern PSI_memory_key mrn_memory_key; #endif +namespace mrn { + namespace variables { + enum BooleanModeSyntaxFlag { + BOOLEAN_MODE_SYNTAX_FLAG_DEFAULT = (1 << 0), + BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_QUERY = (1 << 1), + BOOLEAN_MODE_SYNTAX_FLAG_SYNTAX_SCRIPT = (1 << 2), + BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_COLUMN = (1 << 3), + BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_UPDATE = (1 << 4), + BOOLEAN_MODE_SYNTAX_FLAG_ALLOW_LEADING_NOT = (1 << 5) + }; + + ulonglong get_boolean_mode_syntax_flags(THD *thd); + + enum ActionOnError { + ACTION_ON_ERROR_ERROR, + ACTION_ON_ERROR_ERROR_AND_LOG, + ACTION_ON_ERROR_IGNORE, + ACTION_ON_ERROR_IGNORE_AND_LOG, + }; + + ActionOnError get_action_on_fulltext_query_error(THD *thd); + } +} + #endif /* MRN_VARIABLES_HPP_ */ diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc similarity index 83% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc index 1b3cf9c0942f3..06b5361f3bd85 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc @@ -12,14 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA disable_query_log; disable_warnings; -let $VERSION_COMPILE_64BIT= - `SELECT IF(@@version_compile_machine like '%64%', 1, 0)`; +let $version_compile_64bit= + `SELECT IF(@@version_compile_machine LIKE '%64%', 1, 0)`; enable_warnings; enable_query_log; -if (!$VERSION_COMPILE_64BIT) { - skip Need a 64 binary; -} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc index 39503a9c68d44..7449724b5defa 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log -let $VERSION_COMPILE_OS_FREEBSD=`SELECT IF(@@version_compile_os like 'FREEBSD%', 1, 0);`; +let $version_compile_os_freebsd= + `SELECT IF(@@version_compile_os LIKE '%freebsd%', 1, 0);`; --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc index b2212fd94a8ba..7063c1d1b3d22 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_windows.inc diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc index 6f89f05b869f3..f608f5f220f08 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $libgroonga_embedded = `SELECT @@mroonga_libgroonga_embedded;`; diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc index 076be2582ba3a..a61058b92ffdf 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $libgroonga_support_lz4 = diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc index 5d4862957ae19..8f79d05af295a 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $libgroonga_support_zlib = diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc new file mode 100644 index 0000000000000..1038fe9eea625 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc @@ -0,0 +1,20 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--disable_query_log +let $libgroonga_support_zstd = + `SELECT @@mroonga_libgroonga_support_zstd;`; +--enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc index 0ef2199b70433..50ee66d64c65e 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $mariadb = `SELECT LOCATE('MariaDB', @@global.version) > 0`; diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc index a664a9c51f421..2808e107bc8e6 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc @@ -1,4 +1,5 @@ # Copyright(C) 2014 Toshihisa Tashiro +# Copyright(C) 2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +13,19 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log -let $VERSION_COMPILE_OS_OSX=`SELECT IF(@@version_compile_os like 'osx%', 1, 0);`; +let $version_compile_os_osx=`SELECT IF(@@version_compile_os like 'osx%', 1, 0);`; +if ($version_compile_os_osx) { + let $version_compile_os_osx_10_8_or_later= + `SELECT IF(@@version_compile_os = 'osx10.6', 0, 1);`; + if ($version_compile_os_osx_10_8_or_later) { + let $version_compile_os_osx_10_8_or_later= + `SELECT IF(@@version_compile_os = 'osx10.7', 0, 1);`; + } +} +if (!$version_comiple_os_osx) { + let $version_compile_os_osx_10_8_or_later=0; +} --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc new file mode 100644 index 0000000000000..cad909d022a4d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc @@ -0,0 +1,20 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--disable_query_log +let $version_compile_os_solaris= + `SELECT IF(@@version_compile_os LIKE 'sun-solaris%', 1, 0);`; +--enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc new file mode 100644 index 0000000000000..88dfd6602e96b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--disable_query_log +let $strict_sql_mode = + `SELECT @@sql_mode LIKE '%STRICT_TRANS_TABLES%' OR + @@sql_mode LIKE '%STRICT_ALL_TABLES%'`; +--enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc index cfa7c008e5127..8e583cb738e0a 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2012-2015 Kouhei Sutou +# Copyright(C) 2012-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,19 +12,21 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $version_major_minor = `SELECT CAST(SUBSTRING_INDEX(@@global.version, '.', 2) AS DECIMAL(4, 2))`; -let $version_55 = `SELECT $version_major_minor = 5.5`; -let $version_56 = `SELECT $version_major_minor = 5.6`; -let $version_57 = `SELECT $version_major_minor = 5.7`; -let $version_100 = `SELECT $version_major_minor = 10.0`; +let $version_5_5 = `SELECT $version_major_minor = 5.5`; +let $version_5_6 = `SELECT $version_major_minor = 5.6`; +let $version_5_7 = `SELECT $version_major_minor = 5.7`; +let $version_10_0 = `SELECT $version_major_minor = 10.0`; +let $version_10_2 = `SELECT $version_major_minor = 10.2`; -let $version_55_or_later = `SELECT $version_major_minor >= 5.5`; -let $version_56_or_later = `SELECT $version_major_minor >= 5.6`; -let $version_57_or_later = `SELECT $version_major_minor >= 5.7`; -let $version_100_or_later = `SELECT $version_major_minor >= 10.0`; +let $version_5_5_or_later = `SELECT $version_major_minor >= 5.5`; +let $version_5_6_or_later = `SELECT $version_major_minor >= 5.6`; +let $version_5_7_or_later = `SELECT $version_major_minor >= 5.7`; +let $version_10_0_or_later = `SELECT $version_major_minor >= 10.0`; +let $version_10_2_or_later = `SELECT $version_major_minor >= 10.2`; --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc index b258225fa9fb3..179e0329600fc 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log let $VERSION_COMPILE_OS_WIN=`SELECT IF(@@version_compile_os like 'Win%', 1, 0)`; diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc deleted file mode 100644 index ae44649df9e70..0000000000000 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright(C) 2013 Kentoku SHIBA -# Copyright(C) 2014 Toshihisa Tashiro -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - ---source ../../include/mroonga/skip_osx.inc - -disable_query_log; -disable_warnings; -let $VERSION_COMPILE_64BIT= - `SELECT IF(@@version_compile_machine like '%64%', 1, 0)`; -enable_warnings; -enable_query_log; -if ($VERSION_COMPILE_64BIT) { - skip Need a 32 bit machine/binary; -} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc index 90a203c91ef0d..88f8594c352a0 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_mariadb.inc --source ../../include/mroonga/check_version.inc @@ -22,11 +22,11 @@ if ($mariadb) { } if (!$mariadb) { - if ($version_56) { + if ($version_5_6) { let $fractional_seconds = `SELECT @@global.version >= '5.6'`; } } if (!$fractional_seconds) { - skip fractional seconds in time values are available in MySQL version 5.6 or later or MariaDB; + --skip fractional seconds in time values are available in MySQL version 5.6 or later or MariaDB } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc index fc6cddc5b14c4..3daf0e7c37919 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_freebsd.inc -if (!$VERSION_COMPILE_OS_FREEBSD) { - skip Need OS FreeBSD; +if (!$version_compile_os_freebsd) { + --skip Need OS FreeBSD } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc index dfd3ae12c93da..19b52287cc1f4 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_libgroonga_embedded.inc if ($libgroonga_embedded) { --source ../../include/mroonga/have_mroonga_deinit.inc - skip "This test requires plugin_register of Groonga. libgroonga embedded build doesn't support it."; + --skip This test requires plugin_register of Groonga. libgroonga embedded build doesn't support it. } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc index 7f76ef05021fc..5f38c66c2c55d 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_mariadb.inc if (!$mariadb) { - skip This test is for MariaDB; + --skip This test is for MariaDB } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc new file mode 100644 index 0000000000000..e11c15ec7963e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc @@ -0,0 +1,26 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if (!$mariadb) { + --skip This test is for MariaDB version 10.2.x or later +} + +if (!$version_10_2_or_later) { + --skip This test is for MariaDB version 10.2.x or later +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc index 7bb3ca8b371c1..b88839e55fe68 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_ha_mroonga_so.inc diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc index bd5e4cf7f9fea..bd5242c8d348b 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA disable_query_log; diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc index f0bad1a490d33..f78a760a5636a 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc @@ -12,6 +12,6 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc index e2a791aff5e33..f3c2129203e9c 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_mariadb.inc if ($mariadb) { - skip This test is for MySQL; + --skip This test is for MySQL } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc new file mode 100644 index 0000000000000..cf638a9c73a96 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc @@ -0,0 +1,26 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($mariadb) { + --skip This test is for MySQL version 5.7.x or later +} + +if (!$version_5_7_or_later) { + --skip This test is for MySQL version 5.7.x or later +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc new file mode 100644 index 0000000000000..90eca856e5e66 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc @@ -0,0 +1,28 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_64bit.inc +--source ../../include/mroonga/check_osx.inc + +if (!$version_compile_64bit) { + --skip Need a 64 binary for signed 64bit time_t +} + +if ($version_compile_os_osx) { + if (!$version_compile_os_osx_10_8_or_later) { + --skip Need OS X 10.8 or later for signed 64bit time_t + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc new file mode 100644 index 0000000000000..fc89e733f0ecd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_solaris.inc + +if (!$version_compile_os_solaris) { + --skip Need Solaris +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc new file mode 100644 index 0000000000000..678ba6ab46047 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_strict_sql_mode.inc + +if (!$strict_sql_mode) { + --skip This test is for STRICT_ALL_TABLES or STRICT_TRANS_TABLES +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc similarity index 83% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc index b48d4e9d1bbe9..356b2295743fb 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_100) { - skip This test is for MariaDB version 10.0.x; +if (!$version_10_0) { + --skip This test is for MariaDB version 10.0.x } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc similarity index 82% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100_or_later.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc index 09e5acc018796..1a8883f0478c0 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100_or_later.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_100_or_later) { - skip This test is for MariaDB version 10.0.x or later; +if (!$version_10_0_or_later) { + --skip This test is for MariaDB version 10.0.x or later } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc similarity index 84% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc index fbb4152fc4a7b..b1708abe195b5 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_56) { - skip This test is for MySQL version 5.6.x; +if (!$version_5_5) { + --skip This test is for MySQL version 5.5.x } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc similarity index 90% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc index a08d789d6f2f8..cfa3c7ac60d4a 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_55) { - skip This test is for MySQL version 5.5.x; +if (!$version_5_6) { + --skip This test is for MySQL version 5.6.x } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc similarity index 88% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56_or_later.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc index 350f51616ba15..b9481afdee825 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56_or_later.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_56_or_later) { - skip This test is for MySQL version 5.6.x or later; +if (!$version_5_6_or_later) { + --skip This test is for MySQL version 5.6.x or later } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc similarity index 90% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc index ca2d06ae617b1..4b65def946367 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc -if (!$version_57) { - skip This test is for MySQL version 5.7.x; +if (!$version_5_7) { + --skip This test is for MySQL version 5.7.x } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc new file mode 100644 index 0000000000000..1b18b5749ca63 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2015-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_5_7_or_later) { + --skip This test is for MySQL version 5.7.x or later or MariaDB 10.0.x or later +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc index 6e563721fc72d..9ca1b0d116841 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_ha_mroonga_so.inc @@ -21,4 +21,8 @@ eval CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME $ha_mroonga_so; eval CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME $ha_mroonga_so; eval CREATE FUNCTION mroonga_command RETURNS STRING SONAME $ha_mroonga_so; eval CREATE FUNCTION mroonga_escape RETURNS STRING SONAME $ha_mroonga_so; +eval CREATE FUNCTION mroonga_snippet_html RETURNS STRING SONAME $ha_mroonga_so; +eval CREATE FUNCTION mroonga_normalize RETURNS STRING SONAME $ha_mroonga_so; +eval CREATE FUNCTION mroonga_highlight_html RETURNS STRING SONAME $ha_mroonga_so; +eval CREATE FUNCTION mroonga_query_expand RETURNS STRING SONAME $ha_mroonga_so; --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc index ed13b737fb504..bf0bed98480b1 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_freebsd.inc -if ($VERSION_COMPILE_OS_FREEBSD) { - skip This test is not for FreeBSD; +if ($version_compile_os_freebsd) { + --skip This test is not for FreeBSD } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc similarity index 82% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc index 9fbfd222df4e9..5fd84f1b2a8fd 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2012-2015 Kouhei Sutou +# Copyright(C) 2012-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,13 +12,13 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc --source ../../include/mroonga/check_mariadb.inc -if ($version_100_or_later) { - if ($mariadb) { - skip This test is not for MariaDB 10.x; +if ($mariadb) { + if ($version_10_0_or_later) { + --skip This test is not for MariaDB 10.x } } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc new file mode 100644 index 0000000000000..2af6f2adb0d73 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($mariadb) { + if (!$version_10_2_or_later) { + --skip This test is not for MariaDB 5.x, MariaDB 10.0.x nor 10.1.x + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc new file mode 100644 index 0000000000000..5f67748a17978 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($mariadb) { + if ($version_10_2_or_later) { + --skip This test is not for MariaDB 10.2.x or later + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc similarity index 85% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc index 93eead8791eb4..0695b96fa23ec 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2012-2013 Kouhei Sutou +# Copyright(C) 2012-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,13 +12,13 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc --source ../../include/mroonga/check_mariadb.inc -if ($version_55) { +if ($version_5_5) { if ($mariadb) { - skip This test is not for MariaDB 5.5.x; + --skip This test is not for MariaDB 5.5.x } } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc similarity index 85% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc index e29fae84d46bd..633450e9c0da9 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,13 +12,13 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc --source ../../include/mroonga/check_mariadb.inc -if ($version_55) { +if ($version_5_5) { if (!$mariadb) { - skip This test is not for MySQL 5.5.x; + --skip This test is not for MySQL 5.5.x } } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc similarity index 91% rename from storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc rename to storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc index 39ee22834e794..e984d60f76094 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc @@ -12,13 +12,13 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_version.inc --source ../../include/mroonga/check_mariadb.inc -if ($version_57) { +if ($version_5_7) { if (!$mariadb) { - skip This test is not for MySQL 5.7.x; + --skip This test is not for MySQL 5.7.x } } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc new file mode 100644 index 0000000000000..075e60441970d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($version_5_7_or_later) { + if (!$mariadb) { + --skip This test is not for MySQL 5.7.x or later + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc index 45a70d34ad748..c29795892114a 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/check_osx.inc if ($VERSION_COMPILE_OS_OSX) { - skip This test is not for OSX; + --skip This test is not for OSX } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc new file mode 100644 index 0000000000000..1ba1d09be60db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc @@ -0,0 +1,28 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_64bit.inc +--source ../../include/mroonga/check_osx.inc + +if ($version_compile_64bit) { + --skip This test is for environment that doesn't have signed 64bit time_t +} + +if ($version_compile_os_osx) { + if (!$version_compile_os_osx_10_8_or_later) { + --skip This test is not for OS X 10.7 or earlier that isn't detected signed 64bit time_t availability + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc new file mode 100644 index 0000000000000..6bf7422492350 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_solaris.inc + +if ($version_compile_os_solaris) { + --skip This test is not for Solaris +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris10.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris10.inc deleted file mode 100644 index 7cee5c38c5314..0000000000000 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris10.inc +++ /dev/null @@ -1,3 +0,0 @@ -if (`SELECT @@version_compile_os='solaris10'`) { - skip This test is not for Solaris 10; -} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc new file mode 100644 index 0000000000000..fc0d665b3022c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_strict_sql_mode.inc + +if ($strict_sql_mode) { + --skip This test is not for STRICT_ALL_TABLES nor STRICT_TRANS_TABLES +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc index 5e21a446f1b29..249c6b59b17de 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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"; + --skip This test is for libgroonga supports lz4 } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc index d04826aa7dd7b..fd8b9e998a038 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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"; + --skip This test is for libgroonga supports zlib } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc new file mode 100644 index 0000000000000..0e7ca4460205c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc @@ -0,0 +1,22 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_libgroonga_support_zstd.inc + +if (!$libgroonga_support_zstd) { + --source ../../include/mroonga/have_mroonga_deinit.inc + --skip This test is for libgroonga supports zstd +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc index 8d0d13f91256f..cbe345a7e045f 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,11 +12,15 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --disable_query_log DROP FUNCTION last_insert_grn_id; DROP FUNCTION mroonga_snippet; DROP FUNCTION mroonga_command; DROP FUNCTION mroonga_escape; +DROP FUNCTION mroonga_snippet_html; +DROP FUNCTION mroonga_normalize; +DROP FUNCTION mroonga_highlight_html; +DROP FUNCTION mroonga_query_expand; --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc index dcc049078f8b5..210058edc3c29 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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"; + --skip This test is for libgroonga doesn't support lz4 } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc index 7533f786f22ef..cb00da15a8790 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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"; + --skip This test is for libgroonga doesn't support zlib } diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc new file mode 100644 index 0000000000000..037e66a9e7c40 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc @@ -0,0 +1,22 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/check_libgroonga_support_zstd.inc + +if ($libgroonga_support_zstd) { + --source ../../include/mroonga/have_mroonga_deinit.inc + --skip This test is for libgroonga doesn't support zstd +} diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result index 52a72155af328..15cd3499d4ca2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result @@ -1,22 +1,22 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -body TEXT +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -ALTER TABLE diaries ADD title TEXT AFTER id; +ALTER TABLE diaries ADD title VARCHAR(40) AFTER id; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result index 81feeefc58918..8b3de1bf7de40 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result @@ -1,22 +1,22 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -body TEXT +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -ALTER TABLE diaries ADD title TEXT FIRST; +ALTER TABLE diaries ADD title VARCHAR(40) FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `title` text, + `title` varchar(40) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result index e441df32c922f..de0482e626c4c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result @@ -4,6 +4,11 @@ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ALTER TABLE tags ADD COLUMN name VARCHAR(64) COMMENT 'flags "COLUMN_VECTOR"'; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + table_create tags TABLE_PAT_KEY UInt32 column_create tags id COLUMN_SCALAR UInt32 column_create tags name COLUMN_VECTOR ShortText diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result index 6f2a1870ac771..b3c9875faeb1c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result @@ -11,6 +11,11 @@ tags CREATE TABLE `tags` ( ) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + table_create tags TABLE_PAT_KEY UInt32 column_create tags id COLUMN_SCALAR UInt32 column_create tags name COLUMN_VECTOR ShortText diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result index 0bd8985f2e870..8a1c18b731d9e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result @@ -7,12 +7,17 @@ id INT UNSIGNED PRIMARY KEY ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'groonga_type "tags"'; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY UInt32 -column_create tags id COLUMN_SCALAR UInt32 - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY UInt32 +column_create tags id COLUMN_SCALAR UInt32 + column_create bugs name COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result index fe48437299911..85330471c443d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result @@ -10,17 +10,21 @@ Table Create Table bugs CREATE TABLE `bugs` ( `id` int(10) unsigned NOT NULL, `name` varchar(64) DEFAULT NULL `GROONGA_TYPE`='tags', - PRIMARY KEY (`id`), - CONSTRAINT `name` FOREIGN KEY (`name`) REFERENCES `test`.`tags` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT + PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY UInt32 -column_create tags id COLUMN_SCALAR UInt32 - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY UInt32 +column_create tags id COLUMN_SCALAR UInt32 + column_create bugs name COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result new file mode 100644 index 0000000000000..6fb1a1071f87f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS users; +SET NAMES cp932; +CREATE TABLE users ( +id int PRIMARY KEY +) DEFAULT CHARSET=cp932; +ALTER TABLE users +ADD COLUMN –¼‘O text, +ADD FULLTEXT INDEX (–¼‘O); +INSERT INTO users VALUES (1, "‚â‚Ü‚¾"); +INSERT INTO users VALUES (2, "‚½‚È‚©"); +INSERT INTO users VALUES (3, "‚·‚¸‚«"); +SELECT * FROM users; +id –¼‘O +1 ‚â‚Ü‚¾ +2 ‚½‚È‚© +3 ‚·‚¸‚« +SELECT * FROM users +WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); +id –¼‘O +2 ‚½‚È‚© +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_PAT_KEY Int32 +column_create users @540d@524d COLUMN_SCALAR LongText +column_create users id COLUMN_SCALAR Int32 + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result new file mode 100644 index 0000000000000..70c9ea0c546ec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +id int PRIMARY KEY +) DEFAULT CHARSET=utf8; +ALTER TABLE users +ADD COLUMN åå‰ text, +ADD FULLTEXT INDEX (åå‰); +INSERT INTO users VALUES (1, "ã‚„ã¾ã "); +INSERT INTO users VALUES (2, "ãŸãªã‹"); +INSERT INTO users VALUES (3, "ã™ãšã"); +SELECT * FROM users; +id åå‰ +1 ã‚„ã¾ã  +2 ãŸãªã‹ +3 ã™ãšã +SELECT * FROM users +WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); +id åå‰ +2 ãŸãªã‹ +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_PAT_KEY Int32 +column_create users @540d@524d COLUMN_SCALAR LongText +column_create users id COLUMN_SCALAR Int32 + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result index bb157539ac958..6c6024e47731b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result @@ -1,13 +1,13 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT +title VARCHAR(40) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("survey"); @@ -15,7 +15,7 @@ SELECT * FROM diaries; id title 1 survey ALTER TABLE diaries -ADD COLUMN body TEXT FIRST, +ADD COLUMN body VARCHAR(140) FIRST, ADD COLUMN published BOOLEAN AFTER id, ADD COLUMN created_at DATETIME; UPDATE diaries SET body = "will start groonga!"; @@ -34,10 +34,10 @@ started groonga. 3 0 groonga (2) 2014-02-09 12:19:00 SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `body` text, + `body` varchar(140) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `published` tinyint(1) DEFAULT NULL, - `title` text, + `title` varchar(40) DEFAULT NULL, `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result index df5a15568d859..5a5d3715621e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result @@ -1,20 +1,20 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT +title VARCHAR(40) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; id title 1 survey -ALTER TABLE diaries ADD COLUMN body TEXT; +ALTER TABLE diaries ADD COLUMN body VARCHAR(140); UPDATE diaries SET body = "will start groonga!"; SELECT * FROM diaries; id title body @@ -30,8 +30,8 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result index b4c3044c7d5de..5136282687cb3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result @@ -7,12 +7,17 @@ id INT UNSIGNED PRIMARY KEY ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'type "tags"'; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY UInt32 -column_create tags id COLUMN_SCALAR UInt32 - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY UInt32 +column_create tags id COLUMN_SCALAR UInt32 + column_create bugs name COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result index 65e608dddeba5..373c70e81be6a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result @@ -11,7 +11,12 @@ mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos content +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result index 19d5d017fb23c..a9b192e999e37 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result @@ -1,24 +1,24 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -ALTER TABLE diaries CHANGE body description TEXT AFTER id; +ALTER TABLE diaries CHANGE body description VARCHAR(140) AFTER id; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` text, - `title` text, + `description` varchar(140) DEFAULT NULL, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result index cf2bcc0fc2c79..4faf39ad1adbe 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result @@ -1,24 +1,24 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -ALTER TABLE diaries CHANGE body description TEXT FIRST; +ALTER TABLE diaries CHANGE body description VARCHAR(140) FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `description` text, + `description` varchar(140) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result index c73030805c832..6c87244ba47fa 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result @@ -1,34 +1,32 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 ALTER TABLE diaries -CHANGE body description TEXT FIRST, -CHANGE title subject TEXT AFTER internal_id, -CHANGE id internal_id INT; +CHANGE body description VARCHAR(140) FIRST, +CHANGE title subject VARCHAR(40) AFTER internal_id, +CHANGE id internal_id INT AUTO_INCREMENT; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `description` text, - `internal_id` int(11) NOT NULL, - `subject` text, + `description` varchar(140) DEFAULT NULL, + `internal_id` int(11) NOT NULL AUTO_INCREMENT, + `subject` varchar(40) DEFAULT NULL, PRIMARY KEY (`internal_id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (subject, description) VALUES ("groonga (1)", "starting groonga."); -Warnings: -Warning 1364 Field 'internal_id' doesn't have a default value SELECT * FROM diaries; description internal_id subject -starting groonga. 0 groonga (1) +starting groonga. 1 groonga (1) DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result index 6d60200e5ce0c..d49acc5261166 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result @@ -1,24 +1,24 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 -ALTER TABLE diaries CHANGE body description TEXT; +ALTER TABLE diaries CHANGE body description VARCHAR(140); SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `description` text, + `title` varchar(40) DEFAULT NULL, + `description` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result similarity index 63% rename from storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result rename to storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result index 6bbedd41e95e3..dc2ae02533665 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result @@ -1,37 +1,34 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, temperature DECIMAL(6, 3) ) ENGINE InnoDB DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 -INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); +INSERT INTO diaries (temperature) VALUES (21.281); SELECT * FROM diaries; -id title temperature -1 clear day 21.281 +id temperature +1 21.281 ALTER TABLE diaries ENGINE = mroonga; SELECT * FROM diaries; -id title temperature -1 clear day 21.281 -INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); -INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); +id temperature +1 21.281 +INSERT INTO diaries (temperature) VALUES (14.213); +INSERT INTO diaries (temperature) VALUES (17.821); SELECT * FROM diaries; -id title temperature -1 clear day 21.281 -2 rainy day 14.213 -3 cloudy day 17.821 +id temperature +1 21.281 +2 14.213 +3 17.821 SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, `temperature` decimal(6,3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result similarity index 64% rename from storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result rename to storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result index 3a7413e389b01..706764a5105ec 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result @@ -6,16 +6,11 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) ENGINE MyISAM DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SELECT table_name, engine +FROM information_schema.tables +WHERE table_name = 'diaries'; +table_name engine +diaries MyISAM INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); SELECT * FROM diaries @@ -24,16 +19,11 @@ MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); id title body 1 survey will start groonga! ALTER TABLE diaries ENGINE = mroonga; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 +SELECT table_name, engine +FROM information_schema.tables +WHERE table_name = 'diaries'; +table_name engine +diaries Mroonga SELECT * FROM diaries WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result index 60d302cc6a5da..9fc3b408474d7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result @@ -12,14 +12,19 @@ FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI -column_create terms is_stop_word COLUMN_SCALAR Int8 -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI +column_create terms is_stop_word COLUMN_SCALAR Int8 +column_create terms term COLUMN_SCALAR ShortText + column_create terms content COLUMN_INDEX|WITH_POSITION memos content ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"'; SELECT mroonga_command("dump --dump_plugins no"); @@ -28,6 +33,11 @@ table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText @@ -39,6 +49,11 @@ table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result index ba6cf6c24ed16..7416481e3902f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result @@ -10,22 +10,32 @@ FULLTEXT INDEX content_index (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto +column_create terms term COLUMN_SCALAR ShortText + column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content ALTER TABLE memos DISABLE KEYS; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -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 + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto +column_create terms term COLUMN_SCALAR ShortText DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result index 6475de51b219c..a8b8edf2f6356 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result @@ -1,15 +1,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result index cbc94cebccf20..569bba2f557a2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result @@ -1,15 +1,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); @@ -21,7 +21,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result index 452caa574f945..7b3b2863e5f54 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result @@ -11,22 +11,32 @@ FULLTEXT INDEX content_index (content) COMMENT 'table "terms"' ALTER TABLE memos DISABLE KEYS; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -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 + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto +column_create terms term COLUMN_SCALAR ShortText ALTER TABLE memos ENABLE KEYS; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto +column_create terms term COLUMN_SCALAR ShortText + column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result index d98dc431a0b4f..cf6840a989741 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result @@ -7,15 +7,7 @@ INSERT INTO memos (content) values ("Starting Groonga..."); INSERT INTO memos (content) values ("Started Groonga."); INSERT INTO memos (content) values ("Starting Mroonga..."); ALTER TABLE memos ADD FULLTEXT INDEX content_index (content); -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content_index` (`content`) -) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 -SELECT * FROM memos WHERE MATCH(content) AGAINST("groonga"); +SELECT * FROM memos WHERE MATCH(content) AGAINST("+groonga" IN BOOLEAN MODE); id content 1 Starting Groonga... 2 Started Groonga. diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result index d831d02d76aaa..9b7040bd5c887 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result @@ -1,28 +1,28 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); SELECT * FROM diaries; id title body 1 groonga (1) starting groonga. -ALTER TABLE diaries MODIFY body TEXT AFTER id; +ALTER TABLE diaries MODIFY body VARCHAR(140) AFTER id; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - `title` text, + `body` varchar(140) DEFAULT NULL, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result index bd936507211e6..f6b3df92c67e4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result @@ -1,28 +1,28 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); SELECT * FROM diaries; id title body 1 groonga (1) starting groonga. -ALTER TABLE diaries MODIFY body TEXT FIRST; +ALTER TABLE diaries MODIFY body VARCHAR(140) FIRST; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( - `body` text, + `body` varchar(140) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result index d8d963d87b443..e156a7fda0329 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result @@ -1,15 +1,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, -body TEXT +title VARCHAR(40), +body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, + `title` varchar(40) DEFAULT NULL, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); @@ -22,7 +22,7 @@ Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, - `body` text, + `body` varchar(140) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result index 64f524de06caf..6ee8f8bafc196 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result @@ -5,15 +5,6 @@ title TEXT, body TEXT, FULLTEXT INDEX (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("survey", "will start mroonga!"); SELECT * FROM diaries; @@ -35,13 +26,4 @@ SELECT * FROM diaries WHERE MATCH (body) AGAINST ("+groonga" IN BOOLEAN MODE); id title body 1 survey will start groonga! -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result index eac322ceb2603..84861ea7162ef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result @@ -6,16 +6,11 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 +SELECT table_name, engine +FROM information_schema.tables +WHERE table_name = 'diaries'; +table_name engine +diaries Mroonga INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; id title body @@ -32,14 +27,9 @@ SELECT * FROM memos WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); id title body -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 +SELECT table_name, engine +FROM information_schema.tables +WHERE table_name = 'memos'; +table_name engine +memos Mroonga DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result index ed36927e7b914..ac1a096de4a6a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS shops; CREATE TABLE shops ( id INT PRIMARY KEY AUTO_INCREMENT, -name TEXT, +name VARCHAR(40), location GEOMETRY NOT NULL ); INSERT INTO shops (name, location) @@ -124,7 +124,7 @@ SHOW CREATE TABLE shops; Table Create Table shops CREATE TABLE `shops` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, + `name` varchar(40) DEFAULT NULL, `location` geometry NOT NULL, PRIMARY KEY (`id`), SPATIAL KEY `location_index` (`location`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result new file mode 100644 index 0000000000000..4926a72a77af4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result @@ -0,0 +1,18 @@ +SET NAMES UTF8; +CREATE DATABASE check_test; +USE check_test; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX (title) +); +INSERT INTO diaries VALUES ('Hello'); +FLUSH TABLES; +CHECK TABLE diaries; +Table Op Msg_type Msg_text +check_test.diaries check error Corrupt +REPAIR TABLE diaries; +Table Op Msg_type Msg_text +check_test.diaries repair status OK +DROP TABLE diaries; +DROP DATABASE check_test; +USE test; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result new file mode 100644 index 0000000000000..def3368ecac18 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result @@ -0,0 +1,13 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +title TEXT +); +INSERT INTO diaries VALUES ('Hello'); +CHECK TABLE diaries; +Table Op Msg_type Msg_text +test.diaries check status OK +SELECT * FROM diaries; +title +Hello +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result index e24a56be3a297..9aec8dd6e7916 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, +title VARCHAR(40), created_at DATE, KEY (created_at) ) DEFAULT CHARSET UTF8; @@ -9,7 +9,7 @@ SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, `created_at` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `created_at` (`created_at`) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result index 018ee8eb5b8de..4d2166eca0a4c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result @@ -1,14 +1,14 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, -title TEXT, +title VARCHAR(40), created_at DATE ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; Table Create Table diaries CREATE TABLE `diaries` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, + `title` varchar(40) DEFAULT NULL, `created_at` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result index 453f641968b9c..70a980e2e8c74 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('2038-01-18 03:14:07', '2038-01-18 03:14:07'); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result index 10824d7c28ddd..a48be4da873c7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result index f3a7b27f3428a..b28a1744947ae 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result index d7acad79bab16..838eaf45f5c06 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result index 56e38902f28c0..f0f03a82c9851 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('2038-01-19 03:14:07', '2038-01-19 03:14:07'); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result index c3ca2628bcaa5..8a775960ef78a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result @@ -4,17 +4,9 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) -VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); +VALUES ('1000-01-02 00:00:00', '1000-01-02 00:00:00'); SELECT * FROM diaries; id title created_at -1 1000-01-01 00:00:00 1000-01-01 00:00:00 +1 1000-01-02 00:00:00 1000-01-02 00:00:00 DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result index 0373d17530e43..44d20d972f201 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result new file mode 100644 index 0000000000000..2d5e5e64147d0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +created_at DATETIME +) DEFAULT CHARSET UTF8; +INSERT INTO diaries (title, created_at) +VALUES ('2012', '2012'); +ERROR 22007: Incorrect datetime value: '2012' for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_55_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result similarity index 65% rename from storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_55_out_of_range.result rename to storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result index 733217fda85f7..21e715e1f638d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_55_out_of_range.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result similarity index 65% rename from storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result rename to storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result index 962212c86f8a9..352638031b773 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result index a31042f768dd7..e7094fd4e55ca 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result @@ -5,15 +5,6 @@ title TEXT, created_at DATETIME(6), KEY (created_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime(6) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `created_at` (`created_at`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01.111111"); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result index 0b1bf0f0eb4a8..028fb2577a2c2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME(6) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime(6) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01.111111"); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result index 10824d7c28ddd..a48be4da873c7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); Warnings: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date_strict.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result similarity index 61% rename from storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date_strict.result rename to storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result index c4d73e2f57de0..ffd6a70760547 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date_strict.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result @@ -3,17 +3,8 @@ CREATE TABLE timestamps ( id INT PRIMARY KEY AUTO_INCREMENT, create_dt DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE timestamps; -Table Create Table -timestamps CREATE TABLE `timestamps` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `create_dt` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 -SET sql_mode='STRICT_TRANS_TABLES'; INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); ERROR 22003: Out of range value for column 'create_dt' at row 1 -SET sql_mode=default; SELECT * FROM timestamps; id create_dt INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result new file mode 100644 index 0000000000000..61d2ed8dfd31e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS timestamps; +CREATE TABLE timestamps ( +id INT PRIMARY KEY AUTO_INCREMENT, +create_dt DATETIME +) DEFAULT CHARSET UTF8; +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +ERROR 22003: Out of range value for column 'create_dt' at row 1 +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); +ERROR 22003: Out of range value for column 'create_dt' at row 1 +SELECT * FROM timestamps; +id create_dt +DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result new file mode 100644 index 0000000000000..0ca19e548f36f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS timestamps; +CREATE TABLE timestamps ( +id INT PRIMARY KEY AUTO_INCREMENT, +create_dt DATETIME +) DEFAULT CHARSET UTF8; +INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); +ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'create_dt' at row 1 +SELECT * FROM timestamps; +id create_dt +INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00"); +SELECT * FROM timestamps; +id create_dt +1 2015-06-17 00:00:00 +DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result new file mode 100644 index 0000000000000..94479c2307d6b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS timestamps; +CREATE TABLE timestamps ( +id INT PRIMARY KEY AUTO_INCREMENT, +create_dt DATETIME +) DEFAULT CHARSET UTF8; +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +ERROR 22007: Incorrect datetime value: '2012-00-01 00:00:00' for column 'create_dt' at row 1 +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); +ERROR 22007: Incorrect datetime value: '2012-01-00 00:00:00' for column 'create_dt' at row 1 +SELECT * FROM timestamps; +id create_dt +DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result index 82f01b9f2373f..510fa2dc061c1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ('NULL', NULL); SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result index b205031dec14d..6f79b31fe2483 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result @@ -5,15 +5,6 @@ title TEXT, created_at DATETIME, KEY (created_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `created_at` (`created_at`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01"); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result index 6592df35fcb14..8a45ece7813f1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01"); INSERT INTO diaries (title, created_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result index c22a63f97443b..659c574202a63 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result @@ -3,25 +3,14 @@ CREATE TABLE timestamps ( id INT PRIMARY KEY AUTO_INCREMENT, create_dt DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE timestamps; -Table Create Table -timestamps CREATE TABLE `timestamps` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `create_dt` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 -INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); -Warnings: -Warning 1265 Data truncated for column 'create_dt' at row 1 -INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); -Warnings: -Warning 1265 Data truncated for column 'create_dt' at row 1 +SET sql_mode='STRICT_TRANS_TABLES'; +INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); +ERROR 22003: Out of range value for column 'create_dt' at row 1 +SET sql_mode=default; SELECT * FROM timestamps; id create_dt -1 2012-01-01 00:00:00 -2 2012-01-01 00:00:00 -SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00"; +INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00"); +SELECT * FROM timestamps; id create_dt -1 2012-01-01 00:00:00 -2 2012-01-01 00:00:00 +2 2015-06-17 00:00:00 DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result new file mode 100644 index 0000000000000..03633a50b7a3e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS timestamps; +CREATE TABLE timestamps ( +id INT PRIMARY KEY AUTO_INCREMENT, +create_dt DATETIME +) DEFAULT CHARSET UTF8; +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +Warnings: +Warning 1265 Data truncated for column 'create_dt' at row 1 +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); +Warnings: +Warning 1265 Data truncated for column 'create_dt' at row 1 +SELECT * FROM timestamps; +id create_dt +1 2012-01-01 00:00:00 +2 2012-01-01 00:00:00 +SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00"; +id create_dt +1 2012-01-01 00:00:00 +2 2012-01-01 00:00:00 +DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result index 4a21d62dd14f0..196e4b80f6057 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result @@ -5,15 +5,6 @@ title TEXT, temperature DECIMAL(6, 3), KEY (temperature) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `temperature` decimal(6,3) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `temperature` (`temperature`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result index cd939fa548300..b67846bb29c8f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, temperature DECIMAL(6, 3) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `temperature` decimal(6,3) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result index 56a6a360dc9cc..620e9b6906c7f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result @@ -5,15 +5,6 @@ title TEXT, temperature DECIMAL, KEY (temperature) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `temperature` decimal(10,0) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `temperature` (`temperature`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, temperature) VALUES ("clear day", 21); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14); INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result index 06162f76dddd5..1ba47b3494a04 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, temperature DECIMAL ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `temperature` decimal(10,0) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, temperature) VALUES ("clear day", 21); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14); INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result new file mode 100644 index 0000000000000..20213f0cbf834 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED; +ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'; +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result new file mode 100644 index 0000000000000..1ee7d8f6570b8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +DELETE FROM logs WHERE id = 1; +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result new file mode 100644 index 0000000000000..5b51851660e7a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DROP COLUMN message; +SELECT * FROM logs; +id record +1 {"level": "info", "message": "start"} +2 {"level": "info", "message": "restart"} +3 {"level": "warn", "message": "abort"} +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result new file mode 100644 index 0000000000000..ff22175ec06cb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result new file mode 100644 index 0000000000000..fac8246771260 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DISABLE KEYS; +ALTER TABLE logs ENABLE KEYS; +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result new file mode 100644 index 0000000000000..71fc442dd6fdd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; +SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE); +id record message +2 {"level": "info", "message": "shutdown"} "shutdown" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result new file mode 100644 index 0000000000000..27c9effc2ba57 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL; +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result new file mode 100644 index 0000000000000..260c774e200f5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +DELETE FROM logs WHERE id = 1; +SELECT * FROM logs; +id record message +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result new file mode 100644 index 0000000000000..bc9339ab0745d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DROP COLUMN message; +SELECT * FROM logs; +id record +1 {"level": "info", "message": "start"} +2 {"level": "info", "message": "restart"} +3 {"level": "warn", "message": "abort"} +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result new file mode 100644 index 0000000000000..92463c9459508 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result new file mode 100644 index 0000000000000..1a502edf29bc8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +ALTER TABLE logs ADD INDEX (message); +ERROR HY000: mroonga: storage: failed to create index: Index for virtual generated column is not supported: message +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result new file mode 100644 index 0000000000000..16acc89bf09aa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL, +FULLTEXT INDEX (message) +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +ERROR HY000: mroonga: storage: failed to create index: Index for virtual generated column is not supported: message diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result new file mode 100644 index 0000000000000..93046e39ba5a6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +ALTER TABLE logs ADD INDEX (message); +ERROR HY000: Table storage engine 'Mroonga' does not support the create option 'Index on virtual generated column' +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result new file mode 100644 index 0000000000000..c4e46d0d4f334 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "shutdown"} "shutdown" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result index 724d20edd623d..f9fc836627062 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result @@ -14,12 +14,17 @@ FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); SELECT mroonga_command("dump --dump_plugins no --dump_records no"); mroonga_command("dump --dump_plugins no --dump_records no") -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit +column_create tags name COLUMN_SCALAR ShortText + column_create bugs tags COLUMN_VECTOR tags column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result index aa7735ef78049..0f57885cdb9bb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result @@ -15,15 +15,20 @@ INSERT INTO bugs (id, priority) VALUES (2, 3); INSERT INTO bugs (id, priority) VALUES (3, -2); SELECT mroonga_command("dump --dump_plugins no --dump_records no"); mroonga_command("dump --dump_plugins no --dump_records no") -table_create priorities TABLE_PAT_KEY Int32 -column_create priorities id COLUMN_SCALAR Int32 - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create priorities TABLE_PAT_KEY Int32 +column_create priorities id COLUMN_SCALAR Int32 + column_create bugs priority COLUMN_SCALAR priorities -column_create priorities bugs_priority_index COLUMN_INDEX|WITH_POSITION bugs priority +column_create priorities bugs_priority_index COLUMN_INDEX bugs priority SELECT * FROM bugs WHERE priority = 3; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result new file mode 100644 index 0000000000000..a9c917f8c8fe2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS entries; +CREATE TABLE entries ( +id INT UNSIGNED PRIMARY KEY, +content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"' +) 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; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result new file mode 100644 index 0000000000000..b2bb3b89c1318 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS entries; +CREATE TABLE entries ( +id INT UNSIGNED PRIMARY KEY, +content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"' +) DEFAULT CHARSET=utf8; +Warnings: +Warning 16506 The column flag 'COMPRESS_ZSTD' 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; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result index 515dad1da2e1d..a6afe72faffc5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result @@ -6,8 +6,15 @@ COLLATE=utf8_bin COMMENT='default_tokenizer "TokenDelimit"'; CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, -tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' +tags VARCHAR(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"' ) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tags` varchar(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"', + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); SELECT * FROM bugs; id tags diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result new file mode 100644 index 0000000000000..e6a3aa5ea89ec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; +INSERT INTO logs VALUES ('{"message": "start"}'); +INSERT INTO logs VALUES ('{"message": "restart"}'); +INSERT INTO logs VALUES ('{"message": "shutdown"}'); +SELECT * FROM logs; +record +{"message": "start"} +{"message": "restart"} +{"message": "shutdown"} +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result new file mode 100644 index 0000000000000..eb1a08f2cd3d3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS users; +SET NAMES cp932; +CREATE TABLE users ( +–¼‘O text, +FULLTEXT INDEX (–¼‘O) +) DEFAULT CHARSET=cp932; +INSERT INTO users VALUES ("‚â‚Ü‚¾"); +INSERT INTO users VALUES ("‚½‚È‚©"); +INSERT INTO users VALUES ("‚·‚¸‚«"); +SELECT * FROM users; +–¼‘O +‚â‚Ü‚¾ +‚½‚È‚© +‚·‚¸‚« +SELECT * FROM users +WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); +–¼‘O +‚½‚È‚© +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_NO_KEY +column_create users @540d@524d COLUMN_SCALAR LongText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result new file mode 100644 index 0000000000000..6f63b5b385614 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +åå‰ text, +FULLTEXT INDEX (åå‰) +) DEFAULT CHARSET=utf8; +INSERT INTO users VALUES ("ã‚„ã¾ã "); +INSERT INTO users VALUES ("ãŸãªã‹"); +INSERT INTO users VALUES ("ã™ãšã"); +SELECT * FROM users; +åå‰ +ã‚„ã¾ã  +ãŸãªã‹ +ã™ãšã +SELECT * FROM users +WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); +åå‰ +ãŸãªã‹ +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_NO_KEY +column_create users @540d@524d COLUMN_SCALAR LongText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result index 9c2a8e876e30f..35434a00160f4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result @@ -6,16 +6,6 @@ average TIME(6), max TIME(6), KEY (average) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; -Table Create Table -running_records CREATE TABLE `running_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `average` time(6) DEFAULT NULL, - `max` time(6) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `average` (`average`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (title, average, max) VALUES ("normal condition", "01:00:00.000001", "01:05:00.000001"); INSERT INTO running_records (title, average, max) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result index da75fd97424b2..a0b0350a8e3a1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result @@ -6,16 +6,6 @@ average TIME, max TIME, KEY (average) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; -Table Create Table -running_records CREATE TABLE `running_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `average` time DEFAULT NULL, - `max` time DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `average` (`average`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (title, average, max) VALUES ("normal condition", "01:00:00", "01:05:00"); INSERT INTO running_records (title, average, max) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result index da245535f2c3c..7ccb1fa234b9b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result @@ -6,16 +6,6 @@ created_at TIMESTAMP(6), updated_at TIMESTAMP(6), KEY (updated_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `updated_at` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', - PRIMARY KEY (`id`), - KEY `updated_at` (`updated_at`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at, updated_at) VALUES ("clear day", "2012-01-29 21:51:01.111111", diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result index b310de481114e..4c221d9ecb636 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result @@ -2,20 +2,10 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, -created_at TIMESTAMP, -updated_at TIMESTAMP, +created_at TIMESTAMP DEFAULT '2016-04-21 00:00:00', +updated_at TIMESTAMP DEFAULT '2016-04-21 00:00:00', KEY (updated_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`id`), - KEY `updated_at` (`updated_at`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, created_at, updated_at) VALUES ("clear day", "2012-01-29 21:51:01", "2012-01-29 21:51:02"); INSERT INTO diaries (title, created_at, updated_at) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result index 3ee91c1a40809..be97d4fc9cb52 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result @@ -5,15 +5,6 @@ title TEXT, party_year YEAR, KEY (party_year) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; -Table Create Table -aniversary_memos CREATE TABLE `aniversary_memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `party_year` year(4) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `party_year` (`party_year`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO aniversary_memos (title, party_year) VALUES ("We need a big cake!", "11"); INSERT INTO aniversary_memos (title, party_year) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result index 254a0c0718af3..a56271bccf152 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, party_year YEAR ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; -Table Create Table -aniversary_memos CREATE TABLE `aniversary_memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `party_year` year(4) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO aniversary_memos (title, party_year) VALUES ("We need a big cake!", "11"); INSERT INTO aniversary_memos (title, party_year) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/count_star.result b/storage/mroonga/mysql-test/mroonga/storage/r/count_star.result new file mode 100644 index 0000000000000..ab6be3a7b77e0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/count_star.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int PRIMARY KEY +); +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +SELECT COUNT(*) FROM ids; +COUNT(*) +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result similarity index 60% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_comment.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result index af3c19e9bb086..e4c4ea059e7f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result @@ -7,4 +7,9 @@ mroonga_command("dump --dump_plugins no") table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 column_create bugs tags COLUMN_VECTOR LongText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result similarity index 59% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result index 9e089e53f498b..9923b91f477f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_flags_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result @@ -2,16 +2,14 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, tags TEXT FLAGS='COLUMN_VECTOR' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE bugs; -Table Create Table -bugs CREATE TABLE `bugs` ( - `id` int(10) unsigned NOT NULL, - `tags` text `FLAGS`='COLUMN_VECTOR', - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 column_create bugs tags COLUMN_VECTOR LongText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result similarity index 70% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_comment.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result index 5e5980ac62bd3..7dede8671367a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result @@ -7,12 +7,17 @@ tag VARCHAR(64) COMMENT 'groonga_type "tags"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY ShortText -column_create tags name COLUMN_SCALAR ShortText - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY ShortText +column_create tags name COLUMN_SCALAR ShortText + column_create bugs tag COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_nonexistent.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result similarity index 74% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_parameter.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result index 24941f043c78a..89e28aea6cf6c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_groonga_type_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result @@ -10,17 +10,21 @@ Table Create Table bugs CREATE TABLE `bugs` ( `id` int(10) unsigned NOT NULL, `tag` varchar(64) DEFAULT NULL `GROONGA_TYPE`='tags', - PRIMARY KEY (`id`), - CONSTRAINT `tag` FOREIGN KEY (`tag`) REFERENCES `test`.`tags` (`name`) ON DELETE RESTRICT ON UPDATE RESTRICT + PRIMARY KEY (`id`) ) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY ShortText -column_create tags name COLUMN_SCALAR ShortText - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY ShortText +column_create tags name COLUMN_SCALAR ShortText + column_create bugs tag COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result similarity index 70% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_type_comment.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result index dc3f39d286e88..357adfdfbd431 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_type_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result @@ -7,12 +7,17 @@ tag VARCHAR(64) COMMENT 'type "tags"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create tags TABLE_PAT_KEY ShortText -column_create tags name COLUMN_SCALAR ShortText - table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create tags TABLE_PAT_KEY ShortText +column_create tags name COLUMN_SCALAR ShortText + column_create bugs tag COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_type_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/create_table_field_type_nonexistent.result rename to storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result index 9302037b7e107..0c33fac1deb94 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result @@ -5,6 +5,11 @@ COLLATE=utf8_bin COMMENT='default_tokenizer "TokenDelimit"'; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit column_create tags name COLUMN_SCALAR ShortText DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result index 828de3ebbadc4..8d39cac4ee87d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result new file mode 100644 index 0000000000000..e9d90b0bd4808 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result @@ -0,0 +1,10 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL, +content_size INT NOT NULL, +KEY (content_size) COMMENT 'flags "INDEX_MEDIUM"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos#content_size index COLUMN_INDEX|INDEX_MEDIUM memos content_size +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result new file mode 100644 index 0000000000000..38a83b899a37f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result @@ -0,0 +1,10 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL, +is_read BOOL NOT NULL, +KEY (is_read) COMMENT 'flags "INDEX_SMALL"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos#is_read index COLUMN_INDEX|INDEX_SMALL memos is_read +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result index b5368b433e641..e90fd833d1705 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'flags "NONE"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX memos content +column_create memos#content index COLUMN_INDEX memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result index 7e0d29a1e1f8a..8fbbd197f6c9b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result @@ -11,5 +11,5 @@ memos CREATE TABLE `memos` ( ) ENGINE=Mroonga DEFAULT CHARSET=utf8 SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result index c9283db72bb60..3d31400fbbebd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX memos content +column_create memos#content index COLUMN_INDEX memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result index 853845d5c1599..8f0c499534333 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result new file mode 100644 index 0000000000000..b6da79c72c929 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result @@ -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 "NormalizerAuto"' +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +INSERT INTO diaries VALUES ("2013-04-23", "ブラックコーヒーを飲んã ã€‚"); +SELECT * FROM diaries +WHERE MATCH (content) AGAINST ("+ãµã‚‰ã¤ã" IN BOOLEAN MODE); +day content +SELECT * FROM diaries +WHERE MATCH (content) AGAINST ("+ブラック" IN BOOLEAN MODE); +day content +2013-04-23 ブラックコーヒーを飲んã ã€‚ +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result new file mode 100644 index 0000000000000..2a05ccdc62ca7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +day DATE PRIMARY KEY, +content VARCHAR(64) NOT NULL, +INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") +table_create diaries TABLE_PAT_KEY Time +column_create diaries content COLUMN_SCALAR ShortText +column_create diaries day COLUMN_SCALAR Time + +table_create diaries#content TABLE_PAT_KEY ShortText --normalizer NormalizerAuto + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create diaries#content index COLUMN_INDEX diaries content +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result index 4088caf49d51c..29f27d156f1bc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result @@ -5,15 +5,11 @@ body text, FULLTEXT INDEX body_index (body) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead INSERT INTO diaries (body) VALUES ("will start Groonga!"); +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead INSERT INTO diaries (body) VALUES ("starting Groonga..."); INSERT INTO diaries (body) VALUES ("started Groonga."); SELECT * FROM diaries; @@ -29,3 +25,5 @@ id body 2 starting Groonga... 3 started Groonga. DROP TABLE diaries; +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result index a18614d19fc9b..7f9ddd50e9231 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result @@ -6,14 +6,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result index 77765f61dc306..320fb9a5635b3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result @@ -4,15 +4,11 @@ id INT PRIMARY KEY AUTO_INCREMENT, name TEXT, FULLTEXT INDEX (name) COMMENT 'parser "off"' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE variables; -Table Create Table -variables CREATE TABLE `variables` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `name` (`name`) COMMENT 'parser "off"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix"); +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead INSERT INTO variables (name) VALUES ("mroonga_default_parser"); INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine"); INSERT INTO variables (name) VALUES ("mroonga_dry_write"); @@ -40,3 +36,5 @@ id name 3 mroonga_default_wrapper_engine 2 mroonga_default_parser DROP TABLE variables; +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result index c730bafc8e315..ad68ca010cca9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result @@ -11,7 +11,12 @@ mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos content +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result index e0809eb0f4b8f..2cbb5a6b2e772 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result @@ -11,7 +11,12 @@ mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos content +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result index df529282a9168..333cf3d5d1f00 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result @@ -17,7 +17,12 @@ mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos content +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result index 5b8d0cd780e1f..a390421684a3d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result @@ -5,14 +5,6 @@ body text, FULLTEXT INDEX body_index (body) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); INSERT INTO diaries (body) VALUES ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result index 9efa08bab53f2..34545ecc30a3e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result @@ -6,14 +6,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result index 780ac2faa3d17..91a5b96d184d6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, name TEXT, FULLTEXT INDEX (name) COMMENT 'tokenizer "off"' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE variables; -Table Create Table -variables CREATE TABLE `variables` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `name` (`name`) COMMENT 'tokenizer "off"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix"); INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer"); INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result index 6717092582671..c827abe2cf49d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result @@ -4,14 +4,6 @@ id int PRIMARY KEY AUTO_INCREMENT, body text, FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) `TOKENIZER`='TokenBigramSplitSymbolAlphaDigit' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); INSERT INTO diaries (body) VALUES ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result index 6308b33d4cf09..8934be78d4761 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result @@ -12,14 +12,19 @@ FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord -column_create terms is_stop_word COLUMN_SCALAR Int8 -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord +column_create terms is_stop_word COLUMN_SCALAR Int8 +column_create terms term COLUMN_SCALAR ShortText + column_create terms content COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result index 2f4a90d40865c..e3df285093b7a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result @@ -12,14 +12,19 @@ FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") -table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord -column_create terms is_stop_word COLUMN_SCALAR Int8 -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 +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord +column_create terms is_stop_word COLUMN_SCALAR Int8 +column_create terms term COLUMN_SCALAR ShortText + column_create terms content COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result new file mode 100644 index 0000000000000..ebc7db1cf37b5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result @@ -0,0 +1,20 @@ +SET NAMES UTF8; +DROP DATABASE IF EXISTS another; +CREATE DATABASE another; +USE another; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX (title) +); +DROP TABLE diaries; +USE test; +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX (title) +); +DROP DATABASE another; +SELECT mroonga_command('object_exist mroonga_operations'); +mroonga_command('object_exist mroonga_operations') +true +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result new file mode 100644 index 0000000000000..e2e712af4b640 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +CREATE TABLE comments ( +comment int unsigned PRIMARY KEY, +content text NOT NULL +); +CREATE TABLE articles ( +content text NOT NULL, +comment int unsigned +); +ALTER TABLE articles ADD FOREIGN KEY (comment) REFERENCES comments (comment); +SHOW CREATE TABLE articles; +Table Create Table +articles CREATE TABLE `articles` ( + `content` text NOT NULL, + `comment` int(10) unsigned DEFAULT NULL, + KEY `comment` (`comment`), + CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +SELECT * FROM information_schema.referential_constraints; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME +def test comment def test PRIMARY NONE RESTRICT RESTRICT articles comments +DROP TABLE articles; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result new file mode 100644 index 0000000000000..fc3cda004993a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +CREATE TABLE comments ( +comment int unsigned PRIMARY KEY, +content text NOT NULL +); +CREATE TABLE articles ( +content text NOT NULL, +comment int unsigned, +FOREIGN KEY (comment) REFERENCES comments (comment) +); +ALTER TABLE articles DROP FOREIGN KEY comment; +SHOW CREATE TABLE articles; +Table Create Table +articles CREATE TABLE `articles` ( + `content` text NOT NULL, + `comment` int(10) unsigned DEFAULT NULL, + KEY `comment` (`comment`) +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +SELECT * FROM information_schema.referential_constraints; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME +DROP TABLE articles; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result index fc550d97f87f0..d76fba588b121 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result @@ -1,39 +1,15 @@ -drop table if exists articles2; -drop table if exists articles; -drop table if exists comments2; -drop table if exists comments; -create table comments( -comment int unsigned, -content text not null, -primary key(comment) +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +CREATE TABLE comments ( +comment int unsigned PRIMARY KEY, +content text NOT NULL ); -create table articles( -content text not null, +CREATE TABLE articles ( +content text NOT NULL, comment int unsigned, FOREIGN KEY (comment) REFERENCES comments (comment) ); -insert into comments (comment, content) values -(1, 'aaa bbb'),(2, 'ccc ddd'),(3, 'eee fff'); -insert into articles (content, comment) values -('111aaa', 1),('222bbb', 2),('222ccc', 2); -select comment, content from comments; -comment content -1 aaa bbb -2 ccc ddd -3 eee fff -select content, comment from articles; -content comment -111aaa 1 -222bbb 2 -222ccc 2 -show create table comments; -Table Create Table -comments CREATE TABLE `comments` ( - `comment` int(10) unsigned NOT NULL DEFAULT '0', - `content` text NOT NULL, - PRIMARY KEY (`comment`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -show create table articles; +SHOW CREATE TABLE articles; Table Create Table articles CREATE TABLE `articles` ( `content` text NOT NULL, @@ -41,107 +17,8 @@ articles CREATE TABLE `articles` ( KEY `comment` (`comment`), CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE=Mroonga DEFAULT CHARSET=latin1 -select * from information_schema.referential_constraints; +SELECT * FROM information_schema.referential_constraints; CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME def test comment def test PRIMARY NONE RESTRICT RESTRICT articles comments -rename table comments to comments2; -rename table articles to articles2; -create table comments( -comment int unsigned, -content text not null, -primary key(comment) -); -create table articles( -content text not null, -comment int unsigned, -FOREIGN KEY (comment) REFERENCES comments (comment) -); -insert into comments (comment, content) values -(1, 'ab'),(2, 'cd'),(3, 'ef'); -insert into articles (content, comment) values -('1a', 1),('2b', 2),('2c', 2); -select comment, content from comments; -comment content -1 ab -2 cd -3 ef -select content, comment from articles; -content comment -1a 1 -2b 2 -2c 2 -select comment, content from comments2; -comment content -1 aaa bbb -2 ccc ddd -3 eee fff -select content, comment from articles2; -content comment -111aaa 1 -222bbb 2 -222ccc 2 -show create table comments; -Table Create Table -comments CREATE TABLE `comments` ( - `comment` int(10) unsigned NOT NULL DEFAULT '0', - `content` text NOT NULL, - PRIMARY KEY (`comment`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -show create table articles; -Table Create Table -articles CREATE TABLE `articles` ( - `content` text NOT NULL, - `comment` int(10) unsigned DEFAULT NULL, - KEY `comment` (`comment`), - CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -show create table comments2; -Table Create Table -comments2 CREATE TABLE `comments2` ( - `comment` int(10) unsigned NOT NULL DEFAULT '0', - `content` text NOT NULL, - PRIMARY KEY (`comment`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -show create table articles2; -Table Create Table -articles2 CREATE TABLE `articles2` ( - `content` text NOT NULL, - `comment` int(10) unsigned DEFAULT NULL, - KEY `comment` (`comment`), - CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments2` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -select * from information_schema.referential_constraints; -CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME -def test comment def test PRIMARY NONE RESTRICT RESTRICT articles comments -def test comment def test PRIMARY NONE RESTRICT RESTRICT articles2 comments2 -alter table articles drop foreign key comment; -show create table articles; -Table Create Table -articles CREATE TABLE `articles` ( - `content` text NOT NULL, - `comment` int(10) unsigned DEFAULT NULL, - KEY `comment` (`comment`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -select content, comment from articles; -content comment -1a 1 -2b 2 -2c 2 -alter table articles add FOREIGN KEY (comment) REFERENCES comments (comment); -show create table articles; -Table Create Table -articles CREATE TABLE `articles` ( - `content` text NOT NULL, - `comment` int(10) unsigned DEFAULT NULL, - KEY `comment` (`comment`), - CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE=Mroonga DEFAULT CHARSET=latin1 -select content, comment from articles; -content comment -1a 1 -2b 2 -2c 2 -drop table articles2; -drop table articles; -drop table comments2; -drop table comments; +DROP TABLE articles; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result new file mode 100644 index 0000000000000..e16157b439f8a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result @@ -0,0 +1,53 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +DELETE FROM comments WHERE id = 100; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (one or more child rows exist in ) +SELECT * FROM entries; +content comment_id +Hello! 100 +SELECT * FROM comments; +id content +100 Good entry! +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +load --table comments +[ +["_key","content","id"], +[100,"Good entry!",100] +] + +load --table entries +[ +["_id","comment_id","content"], +[1,100,"Hello!"] +] + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result new file mode 100644 index 0000000000000..edaba25fad84a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result @@ -0,0 +1,53 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO comments (id, content) VALUES (200, 'Very good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +DELETE FROM comments WHERE id = 200; +SELECT * FROM entries; +content comment_id +Hello! 100 +SELECT * FROM comments; +id content +100 Good entry! +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +load --table comments +[ +["_key","content","id"], +[100,"Good entry!",100] +] + +load --table entries +[ +["_id","comment_id","content"], +[1,100,"Hello!"] +] + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result new file mode 100644 index 0000000000000..ddc54cb3f9e3f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result @@ -0,0 +1,51 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +SELECT * FROM entries; +content comment_id +Hello! 100 +SELECT * FROM comments; +id content +100 Good entry! +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +load --table comments +[ +["_key","content","id"], +[100,"Good entry!",100] +] + +load --table entries +[ +["_id","comment_id","content"], +[1,100,"Hello!"] +] + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result new file mode 100644 index 0000000000000..c220bb8970ba0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result @@ -0,0 +1,37 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (foreign record doesn't exist: :<1>) +SELECT * FROM entries; +content comment_id +SELECT * FROM comments; +id content +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result new file mode 100644 index 0000000000000..5ea0ae3e3acda --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +DROP TABLE IF EXISTS articles2; +DROP TABLE IF EXISTS comments2; +CREATE TABLE comments ( +comment int unsigned PRIMARY KEY, +content text NOT NULL +); +CREATE TABLE articles ( +content text NOT NULL, +comment int unsigned, +FOREIGN KEY (comment) REFERENCES comments (comment) +); +RENAME TABLE comments TO comments2; +RENAME TABLE articles TO articles2; +SHOW CREATE TABLE articles2; +Table Create Table +articles2 CREATE TABLE `articles2` ( + `content` text NOT NULL, + `comment` int(10) unsigned DEFAULT NULL, + KEY `comment` (`comment`), + CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments2` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +SELECT * FROM information_schema.referential_constraints; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME +def test comment def test PRIMARY NONE RESTRICT RESTRICT articles2 comments2 +DROP TABLE articles2; +DROP TABLE comments2; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result new file mode 100644 index 0000000000000..9db892d5d2d5f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result @@ -0,0 +1,55 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO comments (id, content) VALUES (200, 'Very good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +UPDATE entries SET comment_id = 200 WHERE content = 'Hello!'; +SELECT * FROM entries; +content comment_id +Hello! 200 +SELECT * FROM comments; +id content +100 Good entry! +200 Very good entry! +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +load --table comments +[ +["_key","content","id"], +[100,"Good entry!",100], +[200,"Very good entry!",200] +] + +load --table entries +[ +["_id","comment_id","content"], +[1,200,"Hello!"] +] + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result new file mode 100644 index 0000000000000..615c3a0903ad4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result @@ -0,0 +1,53 @@ +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE TABLE comments ( +id int unsigned PRIMARY KEY, +content varchar(140) NOT NULL +); +CREATE TABLE entries ( +content varchar(140) NOT NULL, +comment_id int unsigned, +FOREIGN KEY (comment_id) REFERENCES comments (id) +); +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +UPDATE entries SET comment_id = 200 WHERE content = 'Hello!'; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (foreign record doesn't exist: :<200>) +SELECT * FROM entries; +content comment_id +Hello! 100 +SELECT * FROM comments; +id content +100 Good entry! +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create comments TABLE_PAT_KEY UInt32 +column_create comments content COLUMN_SCALAR ShortText +column_create comments id COLUMN_SCALAR UInt32 + +table_create entries TABLE_NO_KEY +column_create entries content COLUMN_SCALAR ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create entries comment_id COLUMN_SCALAR comments + +load --table comments +[ +["_key","content","id"], +[100,"Good entry!",100] +] + +load --table entries +[ +["_id","comment_id","content"], +[1,100,"Hello!"] +] + +column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id +DROP TABLE entries; +DROP TABLE comments; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result index a48eb25dece33..5beda03ceb695 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result @@ -1,5 +1,5 @@ DROP TABLE IF EXISTS memos; -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET NAMES UTF8; CREATE TABLE memos ( id INT PRIMARY KEY, @@ -15,4 +15,4 @@ id content 1 (groonga) Installed! 3 (groonga) Upgraded! DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result index d0e1a68f76ba1..758f969feb8a8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result @@ -6,15 +6,6 @@ title VARCHAR(255), content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result new file mode 100644 index 0000000000000..deb4bd85385c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); +INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); +SELECT *, MATCH(title, content) +AGAINST("*SS content @ '天気'" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*SS content @ '天気'" in BOOLEAN MODE); +id title content score +2 天気 明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„㦠1 +3 富士山 今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚ 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result new file mode 100644 index 0000000000000..43b21bc1cd85a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS items; +DROP TABLE IF EXISTS readings; +SET NAMES utf8; +CREATE TABLE readings ( +reading VARCHAR(255) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE items ( +name VARCHAR(255) PRIMARY KEY, +readings TEXT COMMENT 'flags "COLUMN_VECTOR", type "readings"', +FULLTEXT INDEX items_index(readings) COMMENT 'table "readings"' +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES("日本", "ニホン ニッãƒãƒ³"); +INSERT INTO items VALUES("ローマ字", "ローマジ"); +INSERT INTO items VALUES("漢字", "カンジ"); +SELECT *, MATCH(readings) +AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE) AS score +FROM items +WHERE MATCH(readings) +AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE); +name readings score +日本 ニホン ニッãƒãƒ³ 1 +DROP TABLE items; +DROP TABLE readings; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result index 5746ce89cb75b..46dd3290565a8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result @@ -1,5 +1,5 @@ DROP TABLE IF EXISTS memos; -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = ERROR; SET NAMES UTF8; CREATE TABLE memos ( @@ -14,4 +14,4 @@ SELECT * FROM memos WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); ERROR 42000: failed to parse fulltext search keyword: <(groonga>: > DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result index 1811994b67efe..d782357eef44b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result @@ -1,5 +1,5 @@ DROP TABLE IF EXISTS memos; -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = ERROR_AND_LOG; SET NAMES UTF8; CREATE TABLE memos ( @@ -14,4 +14,4 @@ SELECT * FROM memos WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); ERROR 42000: failed to parse fulltext search keyword: <(groonga>: > DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result index 6a4759963a3db..fd5b8d1e0ea60 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result @@ -1,5 +1,5 @@ DROP TABLE IF EXISTS memos; -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = "IGNORE"; SET NAMES UTF8; CREATE TABLE memos ( @@ -14,4 +14,4 @@ SELECT * FROM memos WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); id content DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result index 384d677c4276b..a485e1cad6972 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result @@ -1,5 +1,5 @@ DROP TABLE IF EXISTS memos; -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = IGNORE_AND_LOG; SET NAMES UTF8; CREATE TABLE memos ( @@ -14,4 +14,4 @@ SELECT * FROM memos WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); id content DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result index 31d45181c9602..136585c38eb02 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result @@ -6,15 +6,6 @@ title VARCHAR(255) CHARSET utf8mb4 COLLATE utf8mb4_general_ci, content TEXT CHARSET utf8mb4 COLLATE utf8mb4_general_ci, FULLTEXT INDEX (content) ) DEFAULT CHARSET utf8mb4; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 INSERT INTO diaries VALUES(1, "Alphabet", "ABCDE"); INSERT INTO diaries VALUES(2, "Mathmatics", "ð€ðð‚ðƒð„ | U+1D400-U+1D405"); INSERT INTO diaries VALUES(3, "ã²ã‚‰ãŒãª", "ã‚ã„ã†ãˆãŠ"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result index c107991d151ca..25da7011aa458 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result @@ -10,19 +10,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result index 04996d30f36ee..e38913a63c1b0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result @@ -6,15 +6,6 @@ title varchar(255), content text, fulltext index (title) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result index 623c66daaf4cf..5c48cadf5684f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result @@ -1,13 +1,5 @@ drop table if exists t1, t2, t3; create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` text, - PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result index 843c4b958ba0d..6475f9ec7e960 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result index 3856d7ecc108c..4244af26901c9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result index 59b26574c73dd..8d18efaa57103 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result index d17ff6adf8322..0e85b45ae5931 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result index 81b40261a4c7f..37d7597b1f3b8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result @@ -6,16 +6,6 @@ body text, fulltext index title_index (title), fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (title, body) values ("survey", "will start groonga!"); insert into diaries (title, body) values ("groonga (1)", "starting groonga..."); insert into diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result index 5f85632575b67..db4afff0e9115 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result @@ -5,13 +5,6 @@ title VARCHAR(255), content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `title` varchar(255) DEFAULT NULL, - `content` text, - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES("Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES("天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES("富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_100_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_10_0_no_such_key.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_100_no_such_key.result rename to storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_10_0_no_such_key.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_55_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_5_no_such_key.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_55_no_such_key.result rename to storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_5_no_such_key.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_56_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_6_no_such_key.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_56_no_such_key.result rename to storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_6_no_such_key.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result new file mode 100644 index 0000000000000..e07eae11ecdf4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES('It is Groonga'); +INSERT INTO diaries VALUES('It is Mroonga'); +SELECT mroonga_command('select', +'table', 'diaries', +'filter', 'title @ "Groonga"'); +mroonga_command('select', +'table', 'diaries', +'filter', 'title @ "Groonga"') +[[[1],[["_id","UInt32"],["title","LongText"]],[1,"It is Groonga"]]] +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result new file mode 100644 index 0000000000000..e588408e9e2dd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result @@ -0,0 +1,22 @@ +DROP DATABASE IF EXISTS `db-1`; +CREATE DATABASE `db-1`; +USE `db-1`; +SET NAMES UTF8; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +SELECT mroonga_command('dump --dump_plugins no'); +mroonga_command('dump --dump_plugins no') +table_create diaries TABLE_NO_KEY +column_create diaries title COLUMN_SCALAR LongText + +table_create diaries#title TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create diaries#title index COLUMN_INDEX|WITH_POSITION diaries title +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result index c17624581991d..bb68bbff1f519 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result @@ -1,3 +1,3 @@ SET NAMES UTF8; SELECT mroonga_escape(29) AS escaped_query; -ERROR HY000: Can't initialize function 'mroonga_escape'; mroonga_escape(): The 1st argument must be query as string +ERROR HY000: Can't initialize function 'mroonga_escape'; mroonga_escape(): The 1st query argument must be string diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_all.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_all.result rename to storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_all.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_custom.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_custom.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_custom.result rename to storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_custom.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result new file mode 100644 index 0000000000000..ec765b118ef4b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result @@ -0,0 +1,26 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS users; +DROP TABLE IF EXISTS queries; +CREATE TABLE users ( +id INT +); +CREATE TABLE queries ( +user_id INT, +query TEXT +); +INSERT INTO users VALUES (1); +INSERT INTO users VALUES (2); +INSERT INTO users VALUES (3); +INSERT INTO queries VALUES (1, '(a)'); +INSERT INTO queries VALUES (2, '(b)'); +INSERT INTO queries VALUES (3, '(c)'); +SELECT users.id, mroonga_escape(queries.query) AS escaped_query +FROM queries +LEFT JOIN users ON users.id = queries.user_id +ORDER BY users.id; +id escaped_query +1 \(a\) +2 \(b\) +3 \(c\) +DROP TABLE queries; +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result new file mode 100644 index 0000000000000..8b92ec4137e1a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET NAMES utf8mb4; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; +INSERT INTO memos VALUES(1, "(Groonga) Installed!"); +INSERT INTO memos VALUES(2, "(Mroonga) Installed!"); +INSERT INTO memos VALUES(3, "(Groonga) Upgraded!"); +SELECT * FROM memos +WHERE MATCH(content) AGAINST(mroonga_escape("(groonga)") IN BOOLEAN MODE); +id content +1 (Groonga) Installed! +3 (Groonga) Upgraded! +DROP TABLE memos; +SET GLOBAL mroonga_default_parser = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result new file mode 100644 index 0000000000000..c6c39fccb10b2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_escape('+-><~*()\"\\:' AS query) AS escaped_query; +escaped_query +\+\-\>\<\~\*\(\)\"\\\: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_nested.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_nested.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_nested.result rename to storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_nested.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result new file mode 100644 index 0000000000000..246f280005c8b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result @@ -0,0 +1,11 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS data; +CREATE TABLE data ( +value DECIMAL(5, 3) +); +INSERT INTO data VALUES (2.9); +SELECT mroonga_escape(value AS script) +FROM data; +mroonga_escape(value AS script) +2.9 +DROP TABLE data; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result new file mode 100644 index 0000000000000..902bbd31730cb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_escape(-29 AS script) AS escaped_query; +escaped_query +-29 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result new file mode 100644 index 0000000000000..178ff312332bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result @@ -0,0 +1,11 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS data; +CREATE TABLE data ( +value REAL +); +INSERT INTO data VALUES (2.9); +SELECT mroonga_escape(value AS script) +FROM data; +mroonga_escape(value AS script) +2.9 +DROP TABLE data; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result new file mode 100644 index 0000000000000..6f5e9b2a2c428 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_escape('a\"\\\'z' AS script) AS escaped_query; +escaped_query +"a\"\\'z" diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result new file mode 100644 index 0000000000000..96df65061d6fc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result @@ -0,0 +1,11 @@ +CREATE TABLE keywords ( +keyword text +); +INSERT INTO keywords VALUES ('Mroonga'); +INSERT INTO keywords VALUES ('Groonga'); +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', +keyword) AS highlighted +FROM keywords; +highlighted +Mroonga is the Groonga based storage engine. +Mroonga is the Groonga based storage engine. diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result new file mode 100644 index 0000000000000..ca7d796845d7a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result @@ -0,0 +1,13 @@ +SET NAMES utf8; +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'ロック', 'æ›´æ–°') AS highlighted; +highlighted +Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚ diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result new file mode 100644 index 0000000000000..9f4a3dffb5fef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result @@ -0,0 +1,4 @@ +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', +'Mroonga', 'Groonga') AS highlighted; +highlighted +Mroonga is the Groonga based storage engine. diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result new file mode 100644 index 0000000000000..bf280dba0ace9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result @@ -0,0 +1,4 @@ +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', +'mroonga') AS highlighted; +highlighted +Mroonga is the Groonga based storage engine. diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result new file mode 100644 index 0000000000000..b2d0f509f8bc8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result @@ -0,0 +1,13 @@ +SET NAMES utf8; +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'ロック æ›´æ–° -ボトルãƒãƒƒã‚¯' AS query) AS highlighted; +highlighted +Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚ diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result new file mode 100644 index 0000000000000..bd11a908bed7f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result @@ -0,0 +1,13 @@ +SET NAMES utf8; +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'*D- +ロック +æ›´æ–° ボトルãƒãƒƒã‚¯' AS query) AS highlighted; +highlighted +Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚ diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result new file mode 100644 index 0000000000000..fce13d9cd88b3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result @@ -0,0 +1,32 @@ +CREATE TABLE memos ( +content text +); +INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL.'); +INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.'); +INSERT INTO memos VALUES ('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.'); +SELECT mroonga_highlight_html(content, 'Mroonga') AS highlighted +FROM memos; +highlighted +Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL. +Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL's official binary. So we can use it more easily than Tritonn. +Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga's fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga's read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data. diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result new file mode 100644 index 0000000000000..fe5cc8859227d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result @@ -0,0 +1,3 @@ +SELECT mroonga_normalize('aBcAbCã‘'); +mroonga_normalize('aBcAbCã‘') +abcabcリットル diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result new file mode 100644 index 0000000000000..3d675fb0e275f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result @@ -0,0 +1,3 @@ +SELECT mroonga_normalize('aBcAbCã‘', "NormalizerAuto"); +mroonga_normalize('aBcAbCã‘', "NormalizerAuto") +abcabcリットル diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result new file mode 100644 index 0000000000000..7d4192f620b63 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result @@ -0,0 +1,7 @@ +CREATE TABLE memos ( +content text +); +INSERT INTO memos VALUES ('aBcAbCã‘'); +SELECT mroonga_normalize(content) FROM memos; +mroonga_normalize(content) +abcabcリットル diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result new file mode 100644 index 0000000000000..9160633c8fbe5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result @@ -0,0 +1,18 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS synonyms; +CREATE TABLE synonyms ( +term varchar(255), +synonym varchar(255), +INDEX (term) +); +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); +INSERT INTO synonyms VALUES ('Mroonga', 'Mroonga'); +INSERT INTO synonyms VALUES ('Mroonga', 'Groonga MySQL'); +SELECT mroonga_query_expand('synonyms', +'term', +'synonym', +'Mroonga Rroonga PGroonga') AS query; +query +((Mroonga) OR (Groonga MySQL)) ((Rroonga) OR (Groonga Ruby)) PGroonga +DROP TABLE synonyms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result new file mode 100644 index 0000000000000..6a2b5d7a95aff --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result @@ -0,0 +1,15 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS synonyms; +CREATE TABLE synonyms ( +term varchar(255), +synonym varchar(255) +); +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); +SELECT mroonga_query_expand('synonyms', +'term', +'synonym', +'Mroonga Rroonga PGroonga') AS query; +query +Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga +DROP TABLE synonyms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result new file mode 100644 index 0000000000000..5f7b0f73c5791 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result @@ -0,0 +1,16 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS synonyms; +CREATE TABLE synonyms ( +term varchar(255), +synonym varchar(255), +INDEX (term) +); +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); +SELECT mroonga_query_expand('synonyms', +'term', +'synonym', +'Mroonga Rroonga PGroonga') AS query; +query +Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga +DROP TABLE synonyms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result new file mode 100644 index 0000000000000..4690cd013a5f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result @@ -0,0 +1,17 @@ +SET NAMES UTF8; +DROP TABLE IF EXISTS synonyms; +CREATE TABLE synonyms ( +term varchar(255), +synonym varchar(255), +INDEX (term) +); +INSERT INTO synonyms VALUES ('D+', '[D+]'); +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); +SELECT mroonga_query_expand('synonyms', +'term', +'synonym', +'*D+ Mroonga Rroonga PGroonga') AS query; +query +*D+ Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga +DROP TABLE synonyms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result new file mode 100644 index 0000000000000..24665fbfcfd58 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result @@ -0,0 +1,11 @@ +CREATE TABLE keywords ( +keyword text +); +INSERT INTO keywords VALUES ('Mroonga'); +INSERT INTO keywords VALUES ('Groonga'); +SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.', +keyword) as snippet +FROM keywords; +snippet +
Mroonga is the Groonga based storage engine.
+
Mroonga is the Groonga based storage engine.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result new file mode 100644 index 0000000000000..f1efa42ccbde2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'ロック', 'æ›´æ–°') as snippet; +snippet +
ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚
用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒ
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result new file mode 100644 index 0000000000000..013ad5b199699 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result @@ -0,0 +1,4 @@ +SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.', +'Mroonga', 'Groonga') as snippet; +snippet +
Mroonga is the Groonga based storage engine.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result new file mode 100644 index 0000000000000..d3f790b3cff38 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result @@ -0,0 +1,10 @@ +SELECT mroonga_snippet_html('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.', +'lock') as snippet; +snippet +
ng. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one
f the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga's read-lock free characteristic. And you might have the performance bottle neck in the storage engine in upda
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result new file mode 100644 index 0000000000000..d05c2323b680e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'ロック æ›´æ–° -ボトルãƒãƒƒã‚¯' AS query) as snippet; +snippet +
ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚
用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒ
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result new file mode 100644 index 0000000000000..02ce9098543d2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', +'*D- +ロック +æ›´æ–° ボトルãƒãƒƒã‚¯' AS query) as snippet; +snippet +
ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚
用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒ
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result new file mode 100644 index 0000000000000..469defbcb71df --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result @@ -0,0 +1,30 @@ +CREATE TABLE memos ( +content text +); +INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL.'); +INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.'); +INSERT INTO memos VALUES ('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.'); +SELECT mroonga_snippet_html(content, 'Mroonga') as snippet +FROM memos; +snippet +
Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily.
So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL.
+
onn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can
+
Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result index 29fd989b4f48e..5095232dfb282 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result @@ -5,15 +5,6 @@ name TEXT, location GEOMETRY NOT NULL, SPATIAL KEY location_index (location) ); -SHOW CREATE TABLE shops; -Table Create Table -shops CREATE TABLE `shops` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - `location` geometry NOT NULL, - PRIMARY KEY (`id`), - SPATIAL KEY `location_index` (`location`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', ST_GeomFromText('POINT(139.762573 35.720253)')); @@ -167,4 +158,10 @@ id name location_text 14 tetsuji POINT(139.76857 35.680911944444446) 19 daruma POINT(139.7705988888889 35.68146111111111) 26 kazuya POINT(139.760895 35.67350805555556) +EXPLAIN +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +ORDER BY id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE shops range location_index location_index 34 NULL 36 Using where; Using filesort DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result similarity index 58% rename from storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result rename to storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result index 271cf922fd584..73573355c0018 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result @@ -2,13 +2,8 @@ DROP TABLE IF EXISTS shops; CREATE TABLE shops ( location GEOMETRY NOT NULL ); -SET SESSION sql_mode = ''; INSERT INTO shops VALUES (NULL), (NULL); -Warnings: -Warning 1048 Column 'location' cannot be null -SET SESSION sql_mode = default; +ERROR 23000: Column 'location' cannot be null SELECT ST_AsText(location) FROM shops; ST_AsText(location) -POINT(0 0) -POINT(0 0) DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result new file mode 100644 index 0000000000000..2f432fc8e6677 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result @@ -0,0 +1,169 @@ +DROP TABLE IF EXISTS shops; +CREATE TABLE shops ( +id INT PRIMARY KEY AUTO_INCREMENT, +name TEXT, +location GEOMETRY NOT NULL, +SPATIAL KEY location_index (location) +); +INSERT INTO shops (name, location) +VALUES ('nezu-no-taiyaki', +ST_GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) +VALUES ('taiyaki-kataoka', +ST_GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) +VALUES ('soba-taiyaki-ku', +ST_GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) +VALUES ('kuruma', +ST_GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) +VALUES ('hirose-ya', +ST_GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) +VALUES ('sazare', +ST_GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) +VALUES ('omede-taiyaki', +ST_GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) +VALUES ('onaga-ya', +ST_GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) +VALUES ('shiro-ya', +ST_GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) +VALUES ('fuji-ya', +ST_GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) +VALUES ('miyoshi', +ST_GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) +VALUES ('juju-ya', +ST_GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) +VALUES ('tatsumi-ya', +ST_GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) +VALUES ('tetsuji', +ST_GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) +VALUES ('gazuma-ya', +ST_GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) +VALUES ('honma-mon', +ST_GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) +VALUES ('naniwa-ya', +ST_GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) +VALUES ('kuro-dai', +ST_GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) +VALUES ('daruma', +ST_GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) +VALUES ('yanagi-ya', +ST_GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) +VALUES ('sharaku', +ST_GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) +VALUES ('takane', +ST_GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) +VALUES ('chiyoda', +ST_GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) +VALUES ('da-ka-po', +ST_GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) +VALUES ('matsushima-ya', +ST_GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) +VALUES ('kazuya', +ST_GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) +VALUES ('furuya-kogane-an', +ST_GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) +VALUES ('hachi-no-ie', +ST_GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) +VALUES ('azuki-chan', +ST_GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) +VALUES ('kuriko-an', +ST_GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) +VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', +ST_GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) +VALUES ('naze-ya', +ST_GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) +VALUES ('sanoki-ya', +ST_GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) +VALUES ('shigeta', +ST_GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) +VALUES ('nishimi-ya', +ST_GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) +VALUES ('hiiragi', +ST_GeomFromText('POINT(139.711517 35.647701)')); +SELECT id, name, ST_AsText(location) AS location_text FROM shops; +id name location_text +1 nezu-no-taiyaki POINT(139.76257305555555 35.72025305555556) +2 taiyaki-kataoka POINT(139.7155911111111 35.712521111111116) +3 soba-taiyaki-ku POINT(139.65908805555557 35.68371194444445) +4 kuruma POINT(139.70620694444446 35.72151611111111) +5 hirose-ya POINT(139.68560805555555 35.71484388888889) +6 sazare POINT(139.68504305555555 35.71465305555556) +7 omede-taiyaki POINT(139.8171538888889 35.70051611111111) +8 onaga-ya POINT(139.81105 35.69825388888889) +9 shiro-ya POINT(139.63861111111112 35.70551694444445) +10 fuji-ya POINT(139.637115 35.703938055555554) +11 miyoshi POINT(139.53732305555556 35.644538888888896) +12 juju-ya POINT(139.69575500000002 35.62892194444445) +13 tatsumi-ya POINT(139.63865694444445 35.66550111111111) +14 tetsuji POINT(139.76857 35.680911944444446) +15 gazuma-ya POINT(139.64759805555553 35.70081694444444) +16 honma-mon POINT(139.65257305555556 35.72273611111111) +17 naniwa-ya POINT(139.79623388888888 35.73006111111111) +18 kuro-dai POINT(139.70483388888888 35.650345) +19 daruma POINT(139.7705988888889 35.68146111111111) +20 yanagi-ya POINT(139.78398111111113 35.685341111111114) +21 sharaku POINT(139.79484611111113 35.71696888888889) +22 takane POINT(139.56091305555555 35.69860111111112) +23 chiyoda POINT(139.65281694444442 35.64260111111111) +24 da-ka-po POINT(139.72735611111113 35.62734611111111) +25 matsushima-ya POINT(139.73738111111112 35.64055611111111) +26 kazuya POINT(139.760895 35.67350805555556) +27 furuya-kogane-an POINT(139.67607111111113 35.68060305555556) +28 hachi-no-ie POINT(139.66810611111111 35.608021111111114) +29 azuki-chan POINT(139.67320305555555 35.641510000000004) +30 kuriko-an POINT(139.79682888888888 35.71201305555556) +31 yume-no-aru-machi-no-taiyaki-ya-san POINT(139.71252388888888 35.61619888888889) +32 naze-ya POINT(139.66583305555557 35.60903888888889) +33 sanoki-ya POINT(139.7707211111111 35.66592) +34 shigeta POINT(139.78027305555557 35.67262611111111) +35 nishimi-ya POINT(139.77462805555555 35.671825) +36 hiiragi POINT(139.71151694444444 35.64770111111111) +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +ORDER BY id; +id name location_text +14 tetsuji POINT(139.76857 35.680911944444446) +19 daruma POINT(139.7705988888889 35.68146111111111) +26 kazuya POINT(139.760895 35.67350805555556) +EXPLAIN +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +ORDER BY id; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE shops NULL range location_index location_index 34 NULL 36 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`shops`.`id` AS `id`,`test`.`shops`.`name` AS `name`,st_astext(`test`.`shops`.`location`) AS `location_text` from `test`.`shops` where mbrcontains((st_geometryfromtext('LineString(139.7727 35.6684, 139.7038 35.7121)')),`test`.`shops`.`location`) order by `test`.`shops`.`id` +DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result index 508ee135ef23d..b0bbaf09e4c43 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result @@ -1,28 +1,28 @@ -drop table if exists t1, t2, t3; -create table t1 (_id int, a int, primary key (_id) using hash); -insert into t1 values(null, 100); +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH); +INSERT INTO t1 VALUES(null, 100); ERROR 23000: Column '_id' cannot be null -insert into t1 values(1,100); +INSERT INTO t1 VALUES(1,100); Warnings: Warning 1265 Data truncated for column '_id' at row 1 -insert into t1 values(1,100); +INSERT INTO t1 VALUES(1,100); Warnings: Warning 1265 Data truncated for column '_id' at row 1 -insert into t1 values(1,100); +INSERT INTO t1 VALUES(1,100); Warnings: Warning 1265 Data truncated for column '_id' at row 1 -insert into t1 values(1,100); +INSERT INTO t1 VALUES(1,100); Warnings: Warning 1265 Data truncated for column '_id' at row 1 -select * from t1; +SELECT * FROM t1; _id a 1 100 2 100 3 100 4 100 -select * from t1 where _id = 2; +SELECT * FROM t1 WHERE _id = 2; _id a 2 100 -select * from t1 where _id = 20; +SELECT * FROM t1 WHERE _id = 20; _id a -drop table t1; +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result new file mode 100644 index 0000000000000..8fb46156fb708 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH); +INSERT INTO t1 VALUES(null, 100); +ERROR 23000: Column '_id' cannot be null +INSERT INTO t1 VALUES(1,100); +ERROR 01000: Data truncated for column '_id' at row 1 +INSERT INTO t1 VALUES(1,100); +ERROR 01000: Data truncated for column '_id' at row 1 +INSERT INTO t1 VALUES(1,100); +ERROR 01000: Data truncated for column '_id' at row 1 +INSERT INTO t1 VALUES(1,100); +ERROR 01000: Data truncated for column '_id' at row 1 +SELECT * FROM t1; +_id a +SELECT * FROM t1 WHERE _id = 2; +_id a +SELECT * FROM t1 WHERE _id = 20; +_id a +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result new file mode 100644 index 0000000000000..055ca69f884d9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +score3 INT, +INDEX (score1, score2, score3) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `score3` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`score2`,`score3`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100); +INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100); +SELECT * +FROM items +WHERE score1 = 2 +ORDER BY score2 ASC, score3 ASC; +id score1 score2 score3 +3 2 10 100 +7 2 20 -100 +8 2 20 0 +9 2 20 100 +4 2 30 -100 +5 2 30 0 +6 2 30 100 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result new file mode 100644 index 0000000000000..0d7faddcaa803 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +score3 INT, +INDEX (score1, score2, score3) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `score3` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`score2`,`score3`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100); +INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100); +SELECT * +FROM items +WHERE score1 = 2 +ORDER BY score2 DESC, score3 DESC; +id score1 score2 score3 +6 2 30 100 +5 2 30 0 +4 2 30 -100 +9 2 20 100 +8 2 20 0 +7 2 20 -100 +3 2 10 100 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result new file mode 100644 index 0000000000000..b390ca7a8cfe2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS scores; +SET NAMES utf8; +CREATE TABLE scores ( +name char(30) NOT NULL, +score int NOT NULL, +PRIMARY KEY (name, score) +) DEFAULT CHARSET=utf8; +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12); +INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10); +SELECT * FROM scores; +name score +Jiro Yamada 27 +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +UPDATE scores SET name = "Taro Yamada" + WHERE name = "Jiro Yamada" AND score = 27; +ERROR 01000: data truncated for primary key column: +SELECT * FROM scores +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +name score +Taro Yamada -12 +Taro Yamada 10 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result index 86b06bc94dd31..a58a487a178c6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result @@ -1,32 +1,27 @@ -drop table if exists listing; -set names utf8; -create table scores ( -name char(30) not null, -score int not null, -primary key (name, score) -) default charset utf8; -show create table scores; -Table Create Table -scores CREATE TABLE `scores` ( - `name` char(30) NOT NULL, - `score` int(11) NOT NULL, - PRIMARY KEY (`name`,`score`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 -insert into scores (name, score) values("Taro Yamada", 29); -insert into scores (name, score) values("Taro Yamada", -12); -insert into scores (name, score) values("Jiro Yamada", 27); -insert into scores (name, score) values("Taro Yamada", 10); -select * from scores; +DROP TABLE IF EXISTS scores; +SET NAMES utf8; +CREATE TABLE scores ( +name char(30) NOT NULL, +score int NOT NULL, +PRIMARY KEY (name, score) +) DEFAULT CHARSET=utf8; +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12); +INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10); +SELECT * FROM scores; name score Jiro Yamada 27 Taro Yamada -12 Taro Yamada 10 Taro Yamada 29 -update scores set name = "Taro Yamada" where name = "Jiro Yamada" and score = 27; +UPDATE scores SET name = "Taro Yamada" + WHERE name = "Jiro Yamada" AND score = 27; Warnings: Warning 1265 data truncated for primary key column: -select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29); +SELECT * FROM scores +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); name score Taro Yamada -12 Taro Yamada 10 -drop table scores; +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than.result rename to storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.result rename to storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than.result rename to storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result similarity index 100% rename from storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.result rename to storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result new file mode 100644 index 0000000000000..8e5f4329a51f7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`created_at`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE score1 = 2 AND created_at > "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +8 2 0 2015-07-02 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result new file mode 100644 index 0000000000000..1a3021e28151e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`created_at`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE score1 = 2 AND created_at >= "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +8 2 0 2015-07-02 00:00:00 +5 2 0 2015-07-01 12:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result new file mode 100644 index 0000000000000..6adaa9870dc21 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`created_at`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE score1 = 2 AND created_at < "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +2 2 0 2015-07-01 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result new file mode 100644 index 0000000000000..dfc7ef6fe43bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `score1` (`score1`,`created_at`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE score1 = 2 AND created_at <= "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +5 2 0 2015-07-01 12:00:00 +2 2 0 2015-07-01 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result new file mode 100644 index 0000000000000..502c0c1044741 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_at` (`created_at`,`score1`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE created_at > "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +4 2 0 2015-07-02 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result new file mode 100644 index 0000000000000..60ffa88b4b558 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_at` (`created_at`,`score1`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE created_at >= "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +4 2 0 2015-07-02 00:00:00 +3 2 0 2015-07-01 12:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result new file mode 100644 index 0000000000000..2cdb3de3fb8e2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_at` (`created_at`,`score1`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE created_at < "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +2 2 0 2015-07-01 00:00:00 +1 1 0 2015-07-01 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result new file mode 100644 index 0000000000000..3443bbc3ed188 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT, +score2 INT, +created_at DATETIME, +INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `score1` int(11) DEFAULT NULL, + `score2` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `created_at` (`created_at`,`score1`,`score2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +SELECT * +FROM items +WHERE created_at <= "2015-07-01 12:00:00" + ORDER BY created_at DESC; +id score1 score2 created_at +3 2 0 2015-07-01 12:00:00 +2 2 0 2015-07-01 00:00:00 +1 1 0 2015-07-01 00:00:00 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result new file mode 100644 index 0000000000000..b60917848054f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS listing; +CREATE TABLE scores ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT NOT NULL, +score2 INT NOT NULL, +INDEX (score1, score2) +) DEFAULT CHARSET=UTF8; +INSERT INTO scores (score1, score2) VALUES(1, 1); +INSERT INTO scores (score1, score2) VALUES(1, 2); +INSERT INTO scores (score1, score2) VALUES(2, 3); +INSERT INTO scores (score1, score2) VALUES(2, 2); +INSERT INTO scores (score1, score2) VALUES(2, 1); +INSERT INTO scores (score1, score2) VALUES(2, 0); +INSERT INTO scores (score1, score2) VALUES(2, -1); +INSERT INTO scores (score1, score2) VALUES(2, -2); +INSERT INTO scores (score1, score2) VALUES(2, -3); +SELECT MAX(score2) FROM scores WHERE score1 = 2; +MAX(score2) +3 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result new file mode 100644 index 0000000000000..0792751ad0260 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS listing; +CREATE TABLE scores ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +score1 INT NOT NULL, +score2 INT NOT NULL, +INDEX (score1, score2) +) DEFAULT CHARSET=UTF8; +INSERT INTO scores (score1, score2) VALUES(1, 1); +INSERT INTO scores (score1, score2) VALUES(1, 2); +INSERT INTO scores (score1, score2) VALUES(2, 3); +INSERT INTO scores (score1, score2) VALUES(2, 2); +INSERT INTO scores (score1, score2) VALUES(2, 1); +INSERT INTO scores (score1, score2) VALUES(2, 0); +INSERT INTO scores (score1, score2) VALUES(2, -1); +INSERT INTO scores (score1, score2) VALUES(2, -2); +INSERT INTO scores (score1, score2) VALUES(2, -3); +SELECT MIN(score2) FROM scores WHERE score1 = 2; +MIN(score2) +-3 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result index 869ced05d25ab..21168547286d8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result @@ -5,12 +5,12 @@ start DATE, end DATE, UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (2, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (1, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31"); INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02"); SELECT * FROM ranges FORCE INDEX(range_key) -WHERE start = "1000-01-01" AND end = "9999-12-31"; +WHERE start = "1000-01-02" AND end = "9999-12-31"; id start end -2 1000-01-01 9999-12-31 +2 1000-01-02 9999-12-31 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result index 8e480d4844ad2..93e34d88c2ade 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result @@ -5,16 +5,16 @@ start DATE, end DATE, UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (2, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (1, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31"); INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02"); SELECT start, end FROM ranges FORCE INDEX(range_key) ORDER BY start, end; start end -1000-01-01 2012-10-05 -1000-01-01 9999-12-31 +1000-01-02 2012-10-05 +1000-01-02 9999-12-31 2012-10-25 9999-12-31 -9999-12-31 1000-01-01 +9999-12-31 1000-01-02 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result index 92e7f51ff6e2b..c2a94a848a97d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result @@ -6,14 +6,14 @@ end DATE, UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); -INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (2, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02"); +INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start, end; id start end -2 1000-01-01 2012-10-05 -4 1000-01-01 9999-12-31 +2 1000-01-02 2012-10-05 +4 1000-01-02 9999-12-31 1 2012-10-25 9999-12-31 -3 9999-12-31 1000-01-01 +3 9999-12-31 1000-01-02 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result index ddd694c38631d..2d1001560106c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result @@ -6,14 +6,14 @@ end DATE, UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); -INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (2, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02"); +INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start DESC, end DESC; id start end -3 9999-12-31 1000-01-01 +3 9999-12-31 1000-01-02 1 2012-10-25 9999-12-31 -4 1000-01-01 9999-12-31 -2 1000-01-01 2012-10-05 +4 1000-01-02 9999-12-31 +2 1000-01-02 2012-10-05 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result index 1aa710882cb4d..a8546c4bcbf9c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result @@ -5,16 +5,16 @@ start datetime, end datetime, UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (1, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); +INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); SELECT start, end FROM ranges FORCE INDEX(range_key) ORDER BY start, end; start end -1000-01-01 00:00:00 2012-10-05 16:18:29 -1000-01-01 00:00:00 9999-12-31 23:59:59 +1000-01-02 00:00:00 2012-10-05 16:18:29 +1000-01-02 00:00:00 9999-12-31 23:59:59 2012-10-25 16:18:29 9999-12-31 23:59:59 -9999-12-31 23:59:59 1000-01-01 00:00:00 +9999-12-31 23:59:59 1000-01-02 00:00:00 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result index d18f18589326b..5cffb71d6446a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result @@ -6,14 +6,14 @@ end datetime, UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); -INSERT INTO ranges VALUES (4, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); +INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start, end; id start end -2 1000-01-01 00:00:00 2012-10-05 16:18:29 -4 1000-01-01 00:00:00 9999-12-31 23:59:59 +2 1000-01-02 00:00:00 2012-10-05 16:18:29 +4 1000-01-02 00:00:00 9999-12-31 23:59:59 1 2012-10-25 16:18:29 9999-12-31 23:59:59 -3 9999-12-31 23:59:59 1000-01-01 00:00:00 +3 9999-12-31 23:59:59 1000-01-02 00:00:00 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result index c159aeab4ce39..4429f787b76a8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result @@ -6,14 +6,14 @@ end datetime, UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); -INSERT INTO ranges VALUES (4, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); +INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start DESC, end DESC; id start end -3 9999-12-31 23:59:59 1000-01-01 00:00:00 +3 9999-12-31 23:59:59 1000-01-02 00:00:00 1 2012-10-25 16:18:29 9999-12-31 23:59:59 -4 1000-01-01 00:00:00 9999-12-31 23:59:59 -2 1000-01-01 00:00:00 2012-10-05 16:18:29 +4 1000-01-02 00:00:00 9999-12-31 23:59:59 +2 1000-01-02 00:00:00 2012-10-05 16:18:29 DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result index d833fb44024f8..92e95d9276c4a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result @@ -1,8 +1,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, -start timestamp, -end timestamp, +start timestamp DEFAULT '2016-04-21 00:00:00', +end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result index 1e4ee102c9ed5..35bc4123d65a8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result @@ -1,8 +1,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, -start timestamp, -end timestamp, +start timestamp DEFAULT '2016-04-21 00:00:00', +end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result index 23a5522320a3c..fbf88cf3d0a3c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result @@ -1,8 +1,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, -start timestamp, -end timestamp, +start timestamp DEFAULT '2016-04-21 00:00:00', +end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result index 3f3277f5e64cc..b799cc278e1ba 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result @@ -1,8 +1,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, -start timestamp, -end timestamp, +start timestamp DEFAULT '2016-04-21 00:00:00', +end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result index a460c7d99d69f..b1eafd2d04841 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( day DATE PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `day` date NOT NULL, - `title` text, - PRIMARY KEY (`day`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-01-29", "clear day"); INSERT INTO diaries (day, title) VALUES ("2012-01-30", "rainy day"); INSERT INTO diaries (day, title) VALUES ("2012-01-31", "cloudy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result index ffbbfe3f46009..0ae41c513dc71 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( day DATETIME(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `day` datetime(6) NOT NULL, - `title` text, - PRIMARY KEY (`day`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-01-29 21:51:01.111111", "clear day"); INSERT INTO diaries (day, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result index 76c529f7fbb63..f5e743dc9e773 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( day DATETIME PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `day` datetime NOT NULL, - `title` text, - PRIMARY KEY (`day`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-01-29 21:51:01", "clear day"); INSERT INTO diaries (day, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result index 9b1e8e7d7e888..6a529b50692ba 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE releases ( version DECIMAL(6, 3) PRIMARY KEY, message TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE releases; -Table Create Table -releases CREATE TABLE `releases` ( - `version` decimal(6,3) NOT NULL, - `message` text, - PRIMARY KEY (`version`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO releases (version, message) VALUES (10.000, "10th release!"); INSERT INTO releases (version, message) VALUES (10.001, "minor fix."); INSERT INTO releases (version, message) VALUES (999.999, "the last release!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result index 0624ab2f2b21a..d36688bb13c54 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE releases ( version DECIMAL PRIMARY KEY, message TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE releases; -Table Create Table -releases CREATE TABLE `releases` ( - `version` decimal(10,0) NOT NULL, - `message` text, - PRIMARY KEY (`version`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO releases (version, message) VALUES (1, "the first release!!!"); INSERT INTO releases (version, message) VALUES (10, "10th release!"); INSERT INTO releases (version, message) VALUES (999, "the last release!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result index 639114875e9b2..5437c78979144 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE running_records ( time TIME(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; -Table Create Table -running_records CREATE TABLE `running_records` ( - `time` time(6) NOT NULL, - `title` text, - PRIMARY KEY (`time`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (time, title) VALUES ("01:00:00.000001", "normal condition"); INSERT INTO running_records (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result index 6a89cdc33dd7b..e59dee4c68896 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE running_records ( time TIME PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; -Table Create Table -running_records CREATE TABLE `running_records` ( - `time` time NOT NULL, - `title` text, - PRIMARY KEY (`time`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO running_records (time, title) VALUES ("01:00:00", "normal condition"); INSERT INTO running_records (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result index 7040cc22b2e82..0fba3da7533d1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( time TIMESTAMP(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), - `title` text, - PRIMARY KEY (`time`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (time, title) VALUES ("2012-01-29 21:51:01.111111", "clear day"); INSERT INTO diaries (time, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result index 38017f6f8cc8a..8116bda2d601f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( time TIMESTAMP PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `title` text, - PRIMARY KEY (`time`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (time, title) VALUES ("2012-01-29 21:51:01", "clear day"); INSERT INTO diaries (time, title) VALUES ("2012-01-30 01:23:45", "rainy day"); INSERT INTO diaries (time, title) VALUES ("2012-01-31 08:32:10", "cloudy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result index af9b3a2dbfb9a..78c56f258f88f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result @@ -3,13 +3,6 @@ CREATE TABLE aniversary_memos ( party_year YEAR PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; -Table Create Table -aniversary_memos CREATE TABLE `aniversary_memos` ( - `party_year` year(4) NOT NULL, - `title` text, - PRIMARY KEY (`party_year`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO aniversary_memos (party_year, title) VALUES ("11", "We need a big cake!"); INSERT INTO aniversary_memos (party_year, title) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result new file mode 100644 index 0000000000000..f2a0b28b0b637 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int, +UNIQUE KEY (id) +); +INSERT INTO ids VALUES (1); +DELETE FROM ids; +INSERT INTO ids VALUES (1); +SELECT * FROM ids; +id +1 +INSERT INTO ids VALUES (1); +ERROR 23000: Duplicate entry '1' for key 'id' +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result index d58afb1f6d4c1..3600c92082d22 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result @@ -6,15 +6,6 @@ title VARCHAR(255), content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result index 00466f19bb560..f8d41bb784e38 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result @@ -65,18 +65,6 @@ select * from t1; c1 2010-03-26 11:22:33 drop table t1; -create table t1 (c1 int, _id int); -set sql_mode=""; -insert into t1 (c1,_id) values (1,1); -Warnings: -Warning 1265 Data truncated for column '_id' at row 1 -set sql_mode="strict_all_tables"; -insert into t1 (c1,_id) values (4,1); -ERROR 01000: Data truncated for column '_id' at row 1 -select * from t1; -c1 _id -1 1 -drop table t1; create table t1 (c1 int primary key, c2 int); insert into t1 values(1,100); select * from t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result index 12d4b173eaacf..94421a5c200df 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( day DATE PRIMARY KEY, title TEXT ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `day` date NOT NULL, - `title` text, - PRIMARY KEY (`day`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-02-14", "clear day") ON DUPLICATE KEY UPDATE title = "clear day (duplicated)"; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result index fbec44527f776..1ef6f1f2c37ef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result @@ -5,15 +5,6 @@ day DATE, title TEXT, UNIQUE KEY day (day) ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `day` date DEFAULT NULL, - `title` text, - PRIMARY KEY (`id`), - UNIQUE KEY `day` (`day`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (day, title) VALUES ("2012-02-14", "clear day1") ON DUPLICATE KEY UPDATE title = "clear day1 (duplicated)"; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result new file mode 100644 index 0000000000000..624ac00d3fcef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 int, _id int); +SET sql_mode=""; +INSERT INTO t1 (c1,_id) VALUES (1,1); +Warnings: +Warning 1265 Data truncated for column '_id' at row 1 +SET sql_mode="STRICT_ALL_TABLES"; +INSERT INTO t1 (c1,_id) VALUES (4,1); +ERROR 01000: Data truncated for column '_id' at row 1 +SELECT * FROM t1; +c1 _id +1 1 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result deleted file mode 100644 index b66801094bd0c..0000000000000 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result +++ /dev/null @@ -1,106 +0,0 @@ -drop table if exists t1, t2, t3; -flush status; -create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3)); -insert into t1 values(1,10,"aa ii uu ee oo"); -insert into t1 values(2,20,"ka ki ku ke ko"); -insert into t1 values(3,30,"sa si su se so"); -insert into t1 values(4,40,"ta ti tu te to"); -insert into t1 values(5,50,"aa ii uu ee oo"); -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 0 -select * from t1; -c1 c2 c3 -1 10 aa ii uu ee oo -2 20 ka ki ku ke ko -3 30 sa si su se so -4 40 ta ti tu te to -5 50 aa ii uu ee oo -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 0 -select count(*) from t1; -count(*) -5 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 0 -select * from t1 force index(primary) where c1 between 2 and 4; -c1 c2 c3 -2 20 ka ki ku ke ko -3 30 sa si su se so -4 40 ta ti tu te to -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 0 -select count(*) from t1 force index(primary) where c1 between 2 and 4; -count(*) -3 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 1 -select c1 from t1 force index(primary) where c1 < 3; -c1 -1 -2 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 1 -select count(c1) from t1 force index(primary) where c1 < 3; -count(c1) -2 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 1 -select 1 from t1 force index(primary) where c1 > 3; -1 -1 -1 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 1 -select count(1) from t1 force index(primary) where c1 > 3; -count(1) -2 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 2 -select * from t1 where match(c3) against("su"); -c1 c2 c3 -3 30 sa si su se so -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 2 -select count(*) from t1 where match(c3) against("su"); -count(*) -1 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 3 -select * from t1 where match(c3) against("+su" in boolean mode); -c1 c2 c3 -3 30 sa si su se so -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 3 -select count(*) from t1 where match(c3) against("+su" in boolean mode); -count(*) -1 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 4 -select * from t1 force index(idx1) where c2 between 20 and 40; -c1 c2 c3 -2 20 ka ki ku ke ko -3 30 sa si su se so -4 40 ta ti tu te to -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 4 -select count(*) from t1 force index(idx1) where c2 between 20 and 40; -count(*) -3 -show status like 'mroonga_count_skip'; -Variable_name Value -Mroonga_count_skip 5 -drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result index 9971d21e386e3..8d29e0425cf04 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result @@ -7,14 +7,6 @@ title VARCHAR(255), content TEXT, FULLTEXT INDEX(content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result new file mode 100644 index 0000000000000..26ca6de7b28fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT, +age INT, +INDEX (id, age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id, age) VALUES (1, 28); +INSERT INTO users (id, age) VALUES (1, 28); +INSERT INTO users (id, age) VALUES (1, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (3, 29); +SELECT COUNT(*) FROM users WHERE id = 2 AND age = 29; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result new file mode 100644 index 0000000000000..9af4a4fedcca9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); +SELECT COUNT(*) FROM users WHERE age BETWEEN 28 AND 30; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result new file mode 100644 index 0000000000000..2bbcfe7549ca7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +SELECT COUNT(*) FROM users WHERE age = 29; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result new file mode 100644 index 0000000000000..6ec4d774b2835 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +INSERT INTO memos (content) VALUES ('Groonga is good.'); +INSERT INTO memos (content) VALUES ('Groonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga is good.'); +INSERT INTO memos (content) VALUES ('Mroonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.'); +SELECT COUNT(*) FROM memos +WHERE MATCH(content) AGAINST('+Groonga' IN BOOLEAN MODE); +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result new file mode 100644 index 0000000000000..36a1958955aba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +INSERT INTO memos (content) VALUES ('Groonga is good.'); +INSERT INTO memos (content) VALUES ('Groonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga is good.'); +INSERT INTO memos (content) VALUES ('Mroonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.'); +SELECT COUNT(*) FROM memos +WHERE MATCH(content) AGAINST('Groonga'); +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result new file mode 100644 index 0000000000000..d5c033083cc15 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); +SELECT COUNT(*) FROM users WHERE age > 29; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result new file mode 100644 index 0000000000000..59b812d1484cc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); +SELECT COUNT(*) FROM users WHERE age >= 29; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result new file mode 100644 index 0000000000000..b5e4fc1c3de6f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); +SELECT COUNT(*) FROM users WHERE age < 29; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result new file mode 100644 index 0000000000000..f062fe0092ba8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); +SELECT COUNT(*) FROM users WHERE age <= 29; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result new file mode 100644 index 0000000000000..a1a123e7d5f0a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +SELECT COUNT(*) FROM users WHERE age <> 29; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 2 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result new file mode 100644 index 0000000000000..39a0f0bd785fc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT, +age INT, +INDEX (age) +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id, age) VALUES (1, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (3, 29); +SELECT COUNT(*) FROM users WHERE id = 3 AND age = 29; +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result new file mode 100644 index 0000000000000..68a0575ab9747 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id BETWEEN 2 AND 4; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result new file mode 100644 index 0000000000000..713a19dd184bf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id = 3; +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result new file mode 100644 index 0000000000000..3ae04a0246f8a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id > 3; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result new file mode 100644 index 0000000000000..0f0643110f04a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id >= 3; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result new file mode 100644 index 0000000000000..05afd7e8d58c7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id < 3; +COUNT(*) +2 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result new file mode 100644 index 0000000000000..200f89d3eb64e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id <= 3; +COUNT(*) +3 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result new file mode 100644 index 0000000000000..64761c9565dc1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +FLUSH STATUS; +CREATE TABLE users ( +id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); +SELECT COUNT(*) FROM users WHERE id <> 3; +COUNT(*) +4 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result index da15588ccd567..dcf0f3eec669d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result new file mode 100644 index 0000000000000..124a7750f5b7e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX(title), +FULLTEXT INDEX(content) +) DEFAULT CHARSET UTF8; +INSERT INTO memos VALUES(5, "title 1", "content a"); +INSERT INTO memos VALUES(12, "title 1", "content a"); +INSERT INTO memos VALUES(10, "title 1", "content a"); +INSERT INTO memos VALUES(4, "title 2", "content b"); +INSERT INTO memos VALUES(6, "title 2", "content b"); +INSERT INTO memos VALUES(1, "title 2", "content b"); +INSERT INTO memos VALUES(11, "title 1-a", "content a-1"); +INSERT INTO memos VALUES(3, "title 2-b", "content a-2"); +INSERT INTO memos VALUES(2, "title 2-c", "content a-3"); +INSERT INTO memos VALUES(8, "title 1-a", "content b-1"); +INSERT INTO memos VALUES(9, "title 2-b", "content b-2"); +INSERT INTO memos VALUES(7, "title 2-c", "content b-3"); +SELECT * FROM memos +WHERE MATCH(title) AGAINST("+1" IN BOOLEAN MODE) AND +MATCH(content) AGAINST("+a" IN BOOLEAN MODE) +ORDER BY id +LIMIT 1,3; +id title content +10 title 1 content a +11 title 1-a content a-1 +12 title 1 content a +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result index 0794b104a62f3..5a0ea86cc930e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result new file mode 100644 index 0000000000000..d58c3cf223a92 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES CP932; +CREATE TABLE memos ( +Ž¯•ÊŽq INT UNSIGNED, +“à—e TEXT, +FULLTEXT INDEX(“à—e), +KEY(Ž¯•ÊŽq) +) DEFAULT CHARSET CP932; +INSERT INTO memos VALUES(2, "–¾“ú‚ÍŽR“o‚èB"); +INSERT INTO memos VALUES(3, "¡“ú‚̓Tƒ{ƒeƒ“‚ð‚à‚ç‚Á‚½B"); +INSERT INTO memos VALUES(1, "¡“ú‚Í“V‹C‚ª‚æ‚­‚Ä‚æ‚©‚Á‚½B"); +SELECT * FROM memos +WHERE MATCH(“à—e) AGAINST("¡“ú" IN BOOLEAN MODE) +ORDER BY Ž¯•ÊŽq +LIMIT 1; +Ž¯•ÊŽq “à—e +1 ¡“ú‚Í“V‹C‚ª‚æ‚­‚Ä‚æ‚©‚Á‚½B +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result index bd34b040ad796..f1cc14b496363 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result index f495a3b595668..0374f50030e75 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result index b5be750690d43..4bc3f9d5c738d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:34", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:34", "Tomorrow will be fine."); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:34", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result index 6f20f3b8b35c5..56629777889d5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result index 5df3c12ccd86c..b03fe20f397bb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result index c12e69bf686f4..c25f2a56e9053 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result index 6d00bac66eb26..ef93bf8b87937 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `date` datetime DEFAULT NULL, - `content` text, - KEY `date` (`date`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result new file mode 100644 index 0000000000000..f20089f0074c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES utf8; +CREATE TABLE memos ( +id int PRIMARY KEY, +tag ENUM('Groonga', 'Mroonga'), +content TEXT, +FULLTEXT INDEX(content), +KEY(tag), +KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!'); +INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!'); +INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.'); +INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.'); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND +tag = 'Mroonga' + ORDER BY id LIMIT 1; +id tag content +4 Mroonga Mroonga is based on Groonga. +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result new file mode 100644 index 0000000000000..88ec9dd81dbd3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES utf8; +CREATE TABLE memos ( +id int PRIMARY KEY, +tag ENUM('Groonga', 'Mroonga'), +content TEXT, +FULLTEXT INDEX(content), +KEY(tag), +KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!'); +INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!'); +INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.'); +INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.'); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND +tag = 2 +ORDER BY id LIMIT 1; +id tag content +4 Mroonga Mroonga is based on Groonga. +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result index 529f0d521eeff..5c18e22d1afba 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result @@ -11,19 +11,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result index 2320b0ffbc4cf..634fe89cdd4bf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result index c367aef808ab0..22305c7045a8b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result index b00a4e2a2c32d..439f453d1849c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result index 5bf6bca4985d9..51ec2fde5e648 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result index 5d6a19a936e39..3c4f3973f84ff 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result index 6ee2991e51aea..03364eb10174b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result @@ -11,18 +11,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result index e91e8af539103..a284f4dd28084 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result index da01145e45a6e..270d263966d3d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result index bb541c014bd81..eb19384eb6377 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result @@ -13,20 +13,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `_id` int(11) DEFAULT NULL, - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(NULL, 1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(NULL, 2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(NULL, 3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result index fb9393687dcaf..80bd895a6e449 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result index 75ad884a2688c..b3ed4bf6b4d58 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result index bb4ac9c3b33da..793423f5bc5fb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result index 1b4d38e01076e..f50417d1f29c9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result index 4fff9f9185f1b..26da350050f32 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:34", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:34", "Tomorrow will be fine."); INSERT INTO memos VALUES(3, "1:23:34", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result index 61119b2b74e45..342947cc77ec7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!" ); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result index 9bf8b91ea079b..adc4ec6316e29 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!" ); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result index e4d41f5867e3b..2881cc7724aeb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result index 31a497ef8bb7b..d1a9fc2787a71 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result @@ -8,15 +8,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(10) unsigned NOT NULL, - `writing_time` time DEFAULT NULL, - `content` text, - KEY `writing_time` (`writing_time`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result index 46c80ddcce71a..bff0d993ef870 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result @@ -13,20 +13,6 @@ KEY(title), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `title` (`title`), - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result index 38263c1083f6c..cc3173ecff234 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result @@ -12,19 +12,6 @@ FULLTEXT INDEX(content), KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - KEY `month` (`month`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result index 0812fc1089b82..24d427ed2ab72 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result @@ -6,15 +6,6 @@ title TEXT, body TEXT, FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, body) VALUES ("survey", "will start Groonga!"); INSERT INTO diaries (title, body) VALUES ("Groonga (1)", "starting Groonga..."); INSERT INTO diaries (title, body) VALUES ("Groonga (2)", "started Groonga."); @@ -23,7 +14,7 @@ id title body 2 Groonga (1) starting Groonga... FLUSH TABLES; SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); -ERROR HY000: syscall error 'repair_test.mrn.000010A.c' (No such file or directory) +ERROR HY000: system call error: No such file or directory: failed to open path: REPAIR TABLE diaries; Table Op Msg_type Msg_text repair_test.diaries repair status OK diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result index f2cf9667ac7f1..c70ce337447d6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result @@ -5,14 +5,6 @@ id int primary key, content text, fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result index 090ea9b84d67c..fd2cb655eaa9e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result @@ -5,14 +5,6 @@ id int primary key, content varchar(256), fulltext index (content) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `content` varchar(256) DEFAULT NULL, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result index 400156cec7b12..a111880a90475 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result @@ -8,8 +8,8 @@ KEY (age) INSERT INTO users VALUES ("Alice", 20); INSERT INTO users VALUES ("Bob", 20); INSERT INTO users VALUES ("Charry", 29); -SELECT *, COUNT(*) FROM users GROUP BY age; -name age COUNT(*) -Alice 20 2 -Charry 29 1 +SELECT age, COUNT(*) FROM users GROUP BY age; +age COUNT(*) +20 2 +29 1 DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result index 04f63d0e779f5..93d29c2d439a9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result @@ -7,11 +7,8 @@ age int INSERT INTO users VALUES ("Alice", 20); INSERT INTO users VALUES ("Bob", 20); INSERT INTO users VALUES ("Charry", 29); -EXPLAIN SELECT *, COUNT(*) FROM users GROUP BY age; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE users ALL NULL NULL NULL NULL 3 Using temporary; Using filesort -SELECT *, COUNT(*) FROM users GROUP BY age; -name age COUNT(*) -Alice 20 2 -Charry 29 1 +SELECT age, COUNT(*) FROM users GROUP BY age; +age COUNT(*) +20 2 +29 1 DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result index 4f24d0d74b0c7..87c9f4ef2b9e9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result @@ -9,15 +9,6 @@ user_id INT UNSIGNED NOT NULL, title TEXT, FULLTEXT INDEX (title) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `title` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO users (name) VALUES ("alice"); INSERT INTO users (name) VALUES ("bob"); INSERT INTO users (name) VALUES ("carlos"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result index f6c036bbf9f55..0a18d817312b5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result @@ -3,13 +3,6 @@ CREATE TEMPORARY TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TEMPORARY TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title) VALUES ("clear day"); INSERT INTO diaries (title) VALUES ("rainy day"); INSERT INTO diaries (title) VALUES ("cloudy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result index 104d1d5150499..3525e2354d2b0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result @@ -10,19 +10,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result new file mode 100644 index 0000000000000..72a913b402e19 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS memos; +SET SESSION binlog_format = 'ROW'; +CREATE TABLE memos ( +title varchar(20) PRIMARY KEY, +content varchar(140) NOT NULL +) COLLATE=utf8mb4_general_ci +DEFAULT CHARSET=utf8mb4; +INSERT INTO memos (title, content) VALUES ('Mroonga', 'Mroonga is great!'); +SELECT * FROM memos; +title content +Mroonga Mroonga is great! +UPDATE memos SET content = 'Mroonga is very great!' WHERE title = 'Mroonga'; +SELECT * FROM memos; +title content +Mroonga Mroonga is very great! +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result index 11e6ee21949b1..e823e128c4389 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result @@ -1,28 +1,29 @@ -drop table if exists t1, t2, t3; -create table t1 (c1 int, _id int); -insert into t1 values(1,null); -insert into t1 values(2,null); -insert into t1 values(3,null); -select * from t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 int, _id int); +INSERT INTO t1 VALUES(1,null); +INSERT INTO t1 VALUES(2,null); +INSERT INTO t1 VALUES(3,null); +SELECT * FROM t1; c1 _id 1 1 2 2 3 3 -set sql_mode=""; -update t1 set _id = 10 where c1 = 1; +SET sql_mode=""; +UPDATE t1 SET _id = 10 WHERE c1 = 1; Warnings: Warning 1265 Data truncated for column '_id' at row 1 -select * from t1; +SELECT * FROM t1; c1 _id 1 1 2 2 3 3 -set sql_mode="strict_all_tables"; -update t1 set _id = 11 where c1 = 1; +SET sql_mode="STRICT_ALL_TABLES"; +UPDATE t1 SET _id = 11 WHERE c1 = 1; ERROR 01000: Data truncated for column '_id' at row 1 -select * from t1; +SELECT * FROM t1; c1 _id 1 1 2 2 3 3 -drop table t1; +DROP TABLE t1; +SET sql_mode=DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result new file mode 100644 index 0000000000000..1f457eb5e96cd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result @@ -0,0 +1,6 @@ +SET @mroonga_default_tokenizer_backup = @@mroonga_default_tokenizer; +SET GLOBAL mroonga_default_tokenizer = "TokenBigramSplitAlpha"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; +Variable_name Value +mroonga_default_tokenizer TokenBigramSplitAlpha +SET GLOBAL mroonga_default_tokenizer = @mroonga_default_tokenizer_backup; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result new file mode 100644 index 0000000000000..9ad80e9a85a1a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_default_tokenizer = "TokenBigram"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; +Variable_name Value +mroonga_default_tokenizer TokenBigram diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result index 6e690f45e613b..4238cb6320ed5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (body) values ("will start groonga!"); select * from diaries; id body diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result index 8de55efaccc26..429398f6b84eb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (body) values ("will start groonga!"); select * from diaries; id body diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result index dd3ee5b333cb0..9cd6f5c9b1db8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 insert into diaries (body) values ("will start groonga!"); set mroonga_dry_write=true; update diaries set body = "starting groonga..." where id = 1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result new file mode 100644 index 0000000000000..702f3814933d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result @@ -0,0 +1,12 @@ +SET GLOBAL mroonga_enable_operations_recording = true; +FLUSH TABLES; +CREATE TABLE diaries ( +title TEXT +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Research for Mroonga"); +SELECT * FROM diaries; +title +Research for Mroonga +DROP TABLE diaries; +SET GLOBAL mroonga_enable_operations_recording = false; +FLUSH TABLES; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result index 04b22c22ea63b..19abff382bfdf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result @@ -4,30 +4,21 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, -FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' +FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 -INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); -INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); +INSERT INTO diaries (title, tags) VALUES ("Hello Groonga!", "groonga install"); +INSERT INTO diaries (title, tags) VALUES ("Hello Mroonga!", "mroonga install"); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+install" IN BOOLEAN MODE); id title tags -1 Hello groonga! groonga install -2 Hello mroonga! mroonga install -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +1 Hello Groonga! groonga install +2 Hello Mroonga! mroonga install +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); id title tags SET GLOBAL mroonga_match_escalation_threshold = 0; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); id title tags SET mroonga_match_escalation_threshold = 0; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); id title tags -1 Hello groonga! groonga install +1 Hello Groonga! groonga install DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result index 25a1aba61e277..30e9262b5fc7a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result @@ -3,17 +3,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, -FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' +FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result similarity index 65% rename from storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result rename to storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result index 0181fe02d8483..ff574f7bcce84 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result @@ -14,7 +14,9 @@ INSERT INTO ids VALUES (9); INSERT INTO ids VALUES (10); SET GLOBAL mroonga_max_n_records_for_estimate = 1; EXPLAIN SELECT * FROM ids WHERE id > 5; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE ids NULL range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 5) SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result new file mode 100644 index 0000000000000..5ecf89694e4f2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT, +INDEX (id) +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +DELETE FROM ids WHERE id < 2; +SET mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE ids NULL range id id 5 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 0) +SET mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result new file mode 100644 index 0000000000000..b28eac5a2743e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); +SET mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE ids NULL range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 5) +SET mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result new file mode 100644 index 0000000000000..e2d8a8de493f7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT, +INDEX (id) +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +DELETE FROM ids WHERE id < 2; +SET mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ids range id id 5 NULL 1 Using where; Using index +SET mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result new file mode 100644 index 0000000000000..3d7f36d1846b4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result @@ -0,0 +1,9 @@ +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = ""; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file +log file is changed: -> +query log file is still disabled +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result new file mode 100644 index 0000000000000..aed9d91a9d5f1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result @@ -0,0 +1,9 @@ +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = NULL; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file +log file is changed: -> +query log file is still disabled +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result new file mode 100644 index 0000000000000..22ac271e552a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result @@ -0,0 +1,10 @@ +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = ""; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file +log file is changed: -> +query log file is disabled: +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result new file mode 100644 index 0000000000000..3921fb1625933 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result @@ -0,0 +1,10 @@ +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = NULL; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file +log file is changed: -> +query log file is disabled: +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result new file mode 100644 index 0000000000000..7b1be1365b7a1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result @@ -0,0 +1,9 @@ +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file groonga-query.log +log file is changed: -> +query log is enabled: +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result new file mode 100644 index 0000000000000..adf3d1bfbe887 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result @@ -0,0 +1,10 @@ +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +Variable_name Value +mroonga_query_log_file groonga-query.log +log file is changed: -> +query log file isn't changed because the requested path isn't different: +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/suite.pm b/storage/mroonga/mysql-test/mroonga/storage/suite.pm index 7e4f8c1776b96..528ccc5d69360 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/suite.pm +++ b/storage/mroonga/mysql-test/mroonga/storage/suite.pm @@ -5,7 +5,7 @@ package My::Suite::Mroonga; return "No Mroonga engine" unless $ENV{HA_MROONGA_SO} or $::mysqld_variables{'mroonga'} eq "ON"; -sub is_default { not $::opt_embedded_server } +sub is_default { 1 } my $groonga_normalizer_mysql_dir=$::basedir . '/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql'; my $groonga_normalizer_mysql_install_dir=$::basedir . '/lib/groonga/plugins'; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test index 38d4f034daa12..4e486b83cc09c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,11 +23,11 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - body TEXT + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -ALTER TABLE diaries ADD title TEXT AFTER id; +ALTER TABLE diaries ADD title VARCHAR(40) AFTER id; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test index 0e82b3dd4b0a5..5912ed3fcf04a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,11 +23,11 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - body TEXT + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -ALTER TABLE diaries ADD title TEXT FIRST; +ALTER TABLE diaries ADD title VARCHAR(40) FIRST; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test index 1071faf0b812f..18fa2f3ef1eec 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test index 70fb61cc044aa..f84c931c01072 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/not_embedded.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test index 8a64fe00af0df..d49e84cd5fa3e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test index f34cbcdcbf71d..cc208a20872f2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test @@ -13,10 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test new file mode 100644 index 0000000000000..18836127238a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test @@ -0,0 +1,53 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES cp932; + +CREATE TABLE users ( + id int PRIMARY KEY +) DEFAULT CHARSET=cp932; +ALTER TABLE users + ADD COLUMN –¼‘O text, + ADD FULLTEXT INDEX (–¼‘O); + +INSERT INTO users VALUES (1, "‚â‚Ü‚¾"); +INSERT INTO users VALUES (2, "‚½‚È‚©"); +INSERT INTO users VALUES (3, "‚·‚¸‚«"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test new file mode 100644 index 0000000000000..88ef12498a731 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test @@ -0,0 +1,53 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE users ( + id int PRIMARY KEY +) DEFAULT CHARSET=utf8; +ALTER TABLE users + ADD COLUMN åå‰ text, + ADD FULLTEXT INDEX (åå‰); + +INSERT INTO users VALUES (1, "ã‚„ã¾ã "); +INSERT INTO users VALUES (2, "ãŸãªã‹"); +INSERT INTO users VALUES (3, "ã™ãšã"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test index 568deea9e29f6..1f4fa4663b15b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT + title VARCHAR(40) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; @@ -31,7 +31,7 @@ INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; ALTER TABLE diaries - ADD COLUMN body TEXT FIRST, + ADD COLUMN body VARCHAR(140) FIRST, ADD COLUMN published BOOLEAN AFTER id, ADD COLUMN created_at DATETIME; UPDATE diaries SET body = "will start groonga!"; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test index 8c4d76a5868e1..fac1f045db15a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,14 +23,14 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT + title VARCHAR(40) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; -ALTER TABLE diaries ADD COLUMN body TEXT; +ALTER TABLE diaries ADD COLUMN body VARCHAR(140); UPDATE diaries SET body = "will start groonga!"; SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test index 037e81c790696..c198358146b8c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test index 83b8aef1c5aa6..1440c0b78aabb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test index 4476decec780f..53d4b21ff5380 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test index 424ae89b4a60a..7bb65327f791e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test index 94db5d40b6037..7e584131b3d55 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test index 5bc12edadc45d..7ae72d672f6a2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test index 98d26966bd097..119099c435099 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test index 575d65e44a25b..c01f7a95754dc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test index 295bb91e0a912..e680e6e200859 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,12 +23,12 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -ALTER TABLE diaries CHANGE body description TEXT AFTER id; +ALTER TABLE diaries CHANGE body description VARCHAR(140) AFTER id; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test index 01682688a741f..20624ad953700 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,12 +23,12 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -ALTER TABLE diaries CHANGE body description TEXT FIRST; +ALTER TABLE diaries CHANGE body description VARCHAR(140) FIRST; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test index b732f04588cee..7d982ae422e53 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,15 +23,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; ALTER TABLE diaries - CHANGE body description TEXT FIRST, - CHANGE title subject TEXT AFTER internal_id, - CHANGE id internal_id INT; + CHANGE body description VARCHAR(140) FIRST, + CHANGE title subject VARCHAR(40) AFTER internal_id, + CHANGE id internal_id INT AUTO_INCREMENT; SHOW CREATE TABLE diaries; INSERT INTO diaries (subject, description) diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test index 88a69111f65ac..2394be8633374 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,12 +23,12 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -ALTER TABLE diaries CHANGE body description TEXT; +ALTER TABLE diaries CHANGE body description VARCHAR(140); SHOW CREATE TABLE diaries; INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_engine_decimal.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test similarity index 84% rename from storage/mroonga/mysql-test/mroonga/storage/t/alter_table_engine_decimal.test rename to storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test index 71e0fda38252a..e8e0bd416f9b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_engine_decimal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -24,19 +24,18 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, temperature DECIMAL(6, 3) ) ENGINE InnoDB DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; -INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); +INSERT INTO diaries (temperature) VALUES (21.281); SELECT * FROM diaries; ALTER TABLE diaries ENGINE = mroonga; SELECT * FROM diaries; -INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); -INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); +INSERT INTO diaries (temperature) VALUES (14.213); +INSERT INTO diaries (temperature) VALUES (17.821); SELECT * FROM diaries; SHOW CREATE TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test similarity index 90% rename from storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine.test rename to storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test index a477d09194644..f8c4dfa3400ca 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,9 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) ENGINE MyISAM DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; +SELECT table_name, engine + FROM information_schema.tables + WHERE table_name = 'diaries'; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); @@ -37,7 +39,9 @@ SELECT * FROM diaries MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); ALTER TABLE diaries ENGINE = mroonga; -SHOW CREATE TABLE diaries; +SELECT table_name, engine + FROM information_schema.tables + WHERE table_name = 'diaries'; SELECT * FROM diaries WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test index 92380fdb8ec1c..c1bf17ba439dc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test index 1f6980cc04b32..d1f8308268a71 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test index 5cba17d207223..17b86b47389f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test index d7f7f44645947..028fb33f1e36f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test index 626a1bc80a8be..00015dcfacadf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test index ea424df2e572d..5760887e7823d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test index 186e1f5095cb9..69dbe23cc24d7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test index 4348efeb0667a..dce2ea51397a5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test index 49d9f0b8da273..00f6d30a5725a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test index 58e53cb06f2eb..020579106e146 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test index fc3acad9000bb..32da1b3a547a7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test index 6b790e5d6217f..ec5735f067232 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test index 956f397b9654a..eb80d3036d346 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test index 95f683f1df5d4..da06f680d68ce 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test index 62bbe4a4dc2a0..08d84f7b552b0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test index d87078e7e9cf0..3309f60a3d9cb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test index cb6ade7a41854..2f3b61efcf366 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test index 62bbe4a4dc2a0..08d84f7b552b0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test index 13afdcfe0e61b..1d073dc641fae 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test index bf2cc8bd6e2f6..870b1bb60981f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test index 3d9523ab53777..34ee3fcd2757b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test index 193680296dca6..b349411849fef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test index bf7e750174198..6316eac4fe170 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -31,9 +31,8 @@ INSERT INTO memos (content) values ("Started Groonga."); INSERT INTO memos (content) values ("Starting Mroonga..."); ALTER TABLE memos ADD FULLTEXT INDEX content_index (content); -SHOW CREATE TABLE memos; -SELECT * FROM memos WHERE MATCH(content) AGAINST("groonga"); +SELECT * FROM memos WHERE MATCH(content) AGAINST("+groonga" IN BOOLEAN MODE); DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test index c719318d847d4..f4facdcb72f80 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test index 11799a51a652e..165b71a86c9bf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test index 8bdfd10024eb8..ce1e52efa31c3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,15 +23,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); SELECT * FROM diaries; -ALTER TABLE diaries MODIFY body TEXT AFTER id; +ALTER TABLE diaries MODIFY body VARCHAR(140) AFTER id; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test index a4dd52d9faccf..22c6b59e0220f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,15 +23,15 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); SELECT * FROM diaries; -ALTER TABLE diaries MODIFY body TEXT FIRST; +ALTER TABLE diaries MODIFY body VARCHAR(140) FIRST; SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test index 45f4748e98d68..eed22d0669036 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, - body TEXT + title VARCHAR(40), + body VARCHAR(140) ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test index c44937b3f8459..77d0bc741e2b6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( body TEXT, FULLTEXT INDEX (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("survey", "will start mroonga!"); @@ -44,8 +43,6 @@ SELECT * FROM diaries; SELECT * FROM diaries WHERE MATCH (body) AGAINST ("+groonga" IN BOOLEAN MODE); -SHOW CREATE TABLE diaries; - DROP TABLE diaries; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test index 91898b5bb447f..6c15161ed2296 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,9 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; +SELECT table_name, engine + FROM information_schema.tables + WHERE table_name = 'diaries'; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; @@ -42,7 +44,9 @@ SELECT * FROM memos WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); -SHOW CREATE TABLE memos; +SELECT table_name, engine + FROM information_schema.tables + WHERE table_name = 'memos'; DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test index e696d12f128a7..09e0ea8a11891 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -25,7 +25,7 @@ DROP TABLE IF EXISTS shops; CREATE TABLE shops ( id INT PRIMARY KEY AUTO_INCREMENT, - name TEXT, + name VARCHAR(40), location GEOMETRY NOT NULL ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test index db018023af0c3..f452e402d817a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test index 169260cc80812..2d0840ce990db 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test index ee4db71722cba..2d854ec35b4bd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test index c67aff0667408..eff9259a7bad6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_log_bin.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test new file mode 100644 index 0000000000000..77271b4f16987 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test @@ -0,0 +1,45 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET NAMES UTF8; + +CREATE DATABASE check_test; +USE check_test; + +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX (title) +); + +INSERT INTO diaries VALUES ('Hello'); + +--remove_file $MYSQLD_DATADIR/check_test.mrn.000010C + +FLUSH TABLES; + +CHECK TABLE diaries; + +REPAIR TABLE diaries; +DROP TABLE diaries; + +DROP DATABASE check_test; +USE test; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test new file mode 100644 index 0000000000000..1460732b29a14 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test @@ -0,0 +1,38 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + title TEXT +); + +INSERT INTO diaries VALUES ('Hello'); + +CHECK TABLE diaries; + +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test index d0df707162bfd..101c16e9675cc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test index f9e9a817a0819..2c28edb332794 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test index 4beec67b468f0..1d9998eeed3a2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test index 045c9ef2a4ea9..f69e5594ebd6c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test index 199e2904d9453..5d48a1a6201a0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test index 4c63dedfc6087..42c5e1d22845f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test index 0fcc806883d15..6761869d4ff55 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test index cc713a80e5ac3..8645a2d7e5fcf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, + title VARCHAR(40), created_at DATE, KEY (created_at) ) DEFAULT CHARSET UTF8; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test index d5587876c3c18..21dcf156e43cc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, - title TEXT, + title VARCHAR(40), created_at DATE ) DEFAULT CHARSET UTF8; SHOW CREATE TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test index 91a2003978005..552a2dfb63553 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test @@ -1,4 +1,5 @@ # Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2016-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test index 054ea2282362a..bf08b878e1e47 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('2038-01-18 03:14:07', '2038-01-18 03:14:07'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test index 1a1ce992a6f01..71ee07139cab9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test index 3fac76bb69b26..5b25cf38e999e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test index 1e1d950ea7e5d..e93e38cd357d1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test index 3abf611a8390a..af04133ef2c12 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('2038-01-19 03:14:07', '2038-01-19 03:14:07'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test index 586367147cc51..a3e355cc1ea2c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test @@ -13,12 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -30,10 +28,9 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) - VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); + VALUES ('1000-01-02 00:00:00', '1000-01-02 00:00:00'); SELECT * FROM diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test index 6599a554efdf4..3f4bb7b1e2398 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_or_later_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test similarity index 86% rename from storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_or_later_out_of_range.test rename to storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test index 95fa60e7e598c..47266e017d720 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_or_later_out_of_range.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test @@ -13,12 +13,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/have_64bit.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc +--source ../../include/mroonga/have_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -30,8 +29,8 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; +--error ER_TRUNCATED_WRONG_VALUE INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.test similarity index 89% rename from storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test rename to storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.test index bdc21cccf5210..23ddc373ab273 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.test @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc ---source ../../include/mroonga/have_version_55.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc +--source ../../include/mroonga/have_version_5_5.inc --source ../../include/mroonga/have_mysql.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('2012', '2012'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test new file mode 100644 index 0000000000000..55457c167fa3f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2014 Kenji Maruyama +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc +--source ../../include/mroonga/skip_strict_sql_mode.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + created_at DATETIME +) DEFAULT CHARSET UTF8; + +INSERT INTO diaries (title, created_at) + VALUES ('2012', '2012'); + +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test index efa54b1e09419..94eb237f1a282 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_fractional_seconds.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( created_at DATETIME(6), KEY (created_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01.111111"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test index f0f51fba53e05..5dc033f1c531d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_fractional_seconds.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME(6) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01.111111"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test index e75539d4ae24b..d66ed5617b83e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_freebsd.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date_strict.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test similarity index 88% rename from storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date_strict.test rename to storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test index 808313da9304c..3382a1c1e68b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date_strict.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test @@ -1,4 +1,4 @@ -# Copyright(C) 2015 Kouhei Sutou +# Copyright(C) 2015-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/have_mariadb_10_2_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -24,12 +25,9 @@ CREATE TABLE timestamps ( id INT PRIMARY KEY AUTO_INCREMENT, create_dt DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE timestamps; -SET sql_mode='STRICT_TRANS_TABLES'; --error ER_WARN_DATA_OUT_OF_RANGE INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); -SET sql_mode=default; SELECT * FROM timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test new file mode 100644 index 0000000000000..f95b0947fc24e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test @@ -0,0 +1,39 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2016-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mariadb_10_2_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS timestamps; +--enable_warnings + +CREATE TABLE timestamps ( + id INT PRIMARY KEY AUTO_INCREMENT, + create_dt DATETIME +) DEFAULT CHARSET UTF8; + +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); + +SELECT * FROM timestamps; + +DROP TABLE timestamps; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test new file mode 100644 index 0000000000000..2b6a05915d744 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test @@ -0,0 +1,39 @@ +# Copyright(C) 2015-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS timestamps; +--enable_warnings + +CREATE TABLE timestamps ( + id INT PRIMARY KEY AUTO_INCREMENT, + create_dt DATETIME +) DEFAULT CHARSET UTF8; + +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); + +SELECT * FROM timestamps; + +INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00"); +SELECT * FROM timestamps; + +DROP TABLE timestamps; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test new file mode 100644 index 0000000000000..4419231a93ebe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test @@ -0,0 +1,39 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS timestamps; +--enable_warnings + +CREATE TABLE timestamps ( + id INT PRIMARY KEY AUTO_INCREMENT, + create_dt DATETIME +) DEFAULT CHARSET UTF8; + +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); + +SELECT * FROM timestamps; + +DROP TABLE timestamps; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test index 8c30509037f94..fcea5431330fd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ('NULL', NULL); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test index b49897800a09b..bf415b177f859 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( created_at DATETIME, KEY (created_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test index b1168f6333033..c6c9edec5de70 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE diaries ( title TEXT, created_at DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29 21:51:01"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test index 5742de6e39296..c5107e6c88515 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2015-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source include/not_embedded.inc +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -24,14 +26,16 @@ CREATE TABLE timestamps ( id INT PRIMARY KEY AUTO_INCREMENT, create_dt DATETIME ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE timestamps; -INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); -INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); +SET sql_mode='STRICT_TRANS_TABLES'; +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00"); +SET sql_mode=default; SELECT * FROM timestamps; -SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00"; +INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00"); +SELECT * FROM timestamps; DROP TABLE timestamps; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test new file mode 100644 index 0000000000000..12b5862412e54 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test @@ -0,0 +1,39 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2016-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_strict_sql_mode.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS timestamps; +--enable_warnings + +CREATE TABLE timestamps ( + id INT PRIMARY KEY AUTO_INCREMENT, + create_dt DATETIME +) DEFAULT CHARSET UTF8; + +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00"); +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00"); + +SELECT * FROM timestamps; + +SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00"; + +DROP TABLE timestamps; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test index 9213379336fe8..03cb6b64d2f60 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( temperature DECIMAL(6, 3), KEY (temperature) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test index 91e4b789aeade..ca59d052e782a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE diaries ( title TEXT, temperature DECIMAL(6, 3) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, temperature) VALUES ("clear day", 21.281); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14.213); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test index 46d9ea37470d0..14303454af28c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( temperature DECIMAL, KEY (temperature) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, temperature) VALUES ("clear day", 21); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test index acda07ab9541f..ef8609a78adb5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE diaries ( title TEXT, temperature DECIMAL ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, temperature) VALUES ("clear day", 21); INSERT INTO diaries (title, temperature) VALUES ("rainy day", 14); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test index 2b7fd7de81876..6a7a5bcc37ba6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test index f4b3175764c44..92eabc11d61db 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test new file mode 100644 index 0000000000000..8561688db3a37 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); + +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED; +ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'; + +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test new file mode 100644 index 0000000000000..a54ee0e26a923 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +DELETE FROM logs WHERE id = 1; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test new file mode 100644 index 0000000000000..0bd963874699d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DROP COLUMN message; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test new file mode 100644 index 0000000000000..841c2f4445298 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test new file mode 100644 index 0000000000000..725c32384dfa2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DISABLE KEYS; +ALTER TABLE logs ENABLE KEYS; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test new file mode 100644 index 0000000000000..08969fa571678 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test new file mode 100644 index 0000000000000..80437aa0e296c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); + +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL; + +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test new file mode 100644 index 0000000000000..c36913cecca08 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +DELETE FROM logs WHERE id = 1; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test new file mode 100644 index 0000000000000..0946b1f30ece7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DROP COLUMN message; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test new file mode 100644 index 0000000000000..90cb52476932e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test @@ -0,0 +1,39 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test new file mode 100644 index 0000000000000..340c5e70fcd33 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test @@ -0,0 +1,35 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mariadb_10_2_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +--error 16509 +ALTER TABLE logs ADD INDEX (message); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test new file mode 100644 index 0000000000000..480cc1f7b94ae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test @@ -0,0 +1,32 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mariadb_10_2_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +--error 16509 +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL, + FULLTEXT INDEX (message) +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test new file mode 100644 index 0000000000000..7c953d30d14fc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test @@ -0,0 +1,35 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +--error ER_ILLEGAL_HA_CREATE_OPTION +ALTER TABLE logs ADD INDEX (message); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test new file mode 100644 index 0000000000000..68d97f990dc69 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test index ca4f154d4024d..39031cabf1508 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test index c1c16d3affcbb..6b4c637a3598b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test index 9c83c94b417f3..4d4a0f5a67328 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test index 5143f06a21a15..b96fa9b03b3e5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test index 9be02c2a1a213..d3caeba70bf49 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test index b7e8590939999..59471f7e97bec 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test index 432aab8862938..e0ab1ad4c1b3a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/support_libgroonga_lz4.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test index 0f21e37c20184..7d5665b04f5c0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/support_libgroonga_zlib.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test new file mode 100644 index 0000000000000..99ac2cdbb6bb6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test @@ -0,0 +1,37 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/support_libgroonga_zstd.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_ZSTD"' +) 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 diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test index d057e0bcfbdc1..4d0a80ad5d59d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/unsupport_libgroonga_lz4.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test index 1066270e48db3..bbaaa51be406d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/unsupport_libgroonga_zlib.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test new file mode 100644 index 0000000000000..6b5eb5cd86f0d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test @@ -0,0 +1,37 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/unsupport_libgroonga_zstd.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_ZSTD"' +) 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 diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test index b168716ed9428..e18f17b7c9514 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test index 2098e878ecb33..3675db38c486e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test index 995fafefeeb2e..9b6c8d3016f61 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test @@ -1,4 +1,4 @@ -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc @@ -29,8 +29,9 @@ CREATE TABLE tags ( CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, - tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' + tags VARCHAR(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"' ) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE bugs; INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test index d8d181228bb89..038d29c9e66e9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test new file mode 100644 index 0000000000000..9bba55b0b92cc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test @@ -0,0 +1,37 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; + +INSERT INTO logs VALUES ('{"message": "start"}'); +INSERT INTO logs VALUES ('{"message": "restart"}'); +INSERT INTO logs VALUES ('{"message": "shutdown"}'); + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test new file mode 100644 index 0000000000000..f7eae384dcfde --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test @@ -0,0 +1,51 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES cp932; + +CREATE TABLE users ( + –¼‘O text, + FULLTEXT INDEX (–¼‘O) +) DEFAULT CHARSET=cp932; + +INSERT INTO users VALUES ("‚â‚Ü‚¾"); +INSERT INTO users VALUES ("‚½‚È‚©"); +INSERT INTO users VALUES ("‚·‚¸‚«"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test new file mode 100644 index 0000000000000..6d6c44ceba1c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test @@ -0,0 +1,51 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE users ( + åå‰ text, + FULLTEXT INDEX (åå‰) +) DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES ("ã‚„ã¾ã "); +INSERT INTO users VALUES ("ãŸãªã‹"); +INSERT INTO users VALUES ("ã™ãšã"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test index ede3a07f54286..a4e229dd17a53 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test index c43f5c70e1341..5d7b8c4dff8f3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test index ccddec38fa018..3391fb7b740b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test index c041a3f9ea91c..219bb085c84cd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test index d8a6a0ac36c6d..79d56f4e8e6ce 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test index 0a2f9d3074901..a031cab8767a4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test index b64d97fd24e47..287d0407bdf1b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test index f2252055c1031..704cc4d41e3b3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test index ff2eeef6a7b68..2200efc71c49f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test index 50824bb2cba82..33f07c4747008 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test index 54d127c734db5..c8e6dddf4bdc7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_fractional_seconds.inc @@ -28,7 +28,6 @@ CREATE TABLE running_records ( max TIME(6), KEY (average) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; INSERT INTO running_records (title, average, max) VALUES ("normal condition", "01:00:00.000001", "01:05:00.000001"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test index cfa760bcae597..e950411cba62f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE running_records ( max TIME, KEY (average) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; INSERT INTO running_records (title, average, max) VALUES ("normal condition", "01:00:00", "01:05:00"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test index c2407cb1b0b82..19dadc2c285df 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/skip_mariadb_55.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc --source ../../include/mroonga/have_fractional_seconds.inc --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ CREATE TABLE diaries ( updated_at TIMESTAMP(6), KEY (updated_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at, updated_at) VALUES ("clear day", diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test index f398fb9b9e2a6..cc063faa67498 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -23,11 +23,10 @@ DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, - created_at TIMESTAMP, - updated_at TIMESTAMP, + created_at TIMESTAMP DEFAULT '2016-04-21 00:00:00', + updated_at TIMESTAMP DEFAULT '2016-04-21 00:00:00', KEY (updated_at) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, created_at, updated_at) VALUES ("clear day", "2012-01-29 21:51:01", "2012-01-29 21:51:02"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test index 9cf9cb631ec95..de0cbedf0ab5b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test index 2da118e27a560..b7cb86943016a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test index dea569704146e..912f86fb71cd0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test index a2eb99b1dce96..f20348bee6cf8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test index e219fc0757bb7..44fb656a93b3e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test index e9dcd7e1e06b2..c98569d197402 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test index d90c71df98885..9414eee1f025c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test index e7cb3f696104d..82004e1971df1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE aniversary_memos ( party_year YEAR, KEY (party_year) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; INSERT INTO aniversary_memos (title, party_year) VALUES ("We need a big cake!", "11"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test index 8b798a71837f7..e7530cec03475 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE aniversary_memos ( title TEXT, party_year YEAR ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; INSERT INTO aniversary_memos (title, party_year) VALUES ("We need a big cake!", "11"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/count_star.test b/storage/mroonga/mysql-test/mroonga/storage/t/count_star.test new file mode 100644 index 0000000000000..f57d40fd57b3f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/count_star.test @@ -0,0 +1,35 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id int PRIMARY KEY +); + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); + +SELECT COUNT(*) FROM ids; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test index 28262bb4b7d17..1913469353faa 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test index f02e4ddcb25d7..1f7bbf12bde74 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -64,6 +64,8 @@ create table t1 (c1 time); desc t1; drop table t1; create table t1 (c1 timestamp); +# For MariaDB 10.2.3 +-- replace_result current_timestamp() CURRENT_TIMESTAMP desc t1; drop table t1; create table t1 (c1 datetime); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_comment.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test index c01d80a209b11..908a2fcbdbb83 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test similarity index 97% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_parameter.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test index cb86cddcbe765..fc66ae12fa0f8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_flags_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/not_embedded.inc @@ -29,7 +29,6 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, tags TEXT FLAGS='COLUMN_VECTOR' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE bugs; SELECT mroonga_command("dump --dump_plugins no"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_comment.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test index d7514512b5ce5..b39da499d5e3b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_nonexistent.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test index 10d00bfcbb052..0350a299b08f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_nonexistent.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test similarity index 95% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_parameter.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test index 4b820f7b88eb3..d208e62e8395e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_groonga_type_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_comment.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test index 18cfbb33da53b..77965a70c9976 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_nonexistent.test rename to storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test index 1c3b89be67f44..46becfdc2cc96 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_field_type_nonexistent.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test index 18a68fb1f9406..aecfab1f6c3dd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test index 054d311bd44b7..c5fa91c5c9c9a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test index 9a22c1b09ead5..568c9ac78cf2e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test new file mode 100644 index 0000000000000..df509ed0dcd72 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test @@ -0,0 +1,39 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 memos ( + content VARCHAR(64) NOT NULL, + content_size INT NOT NULL, + KEY (content_size) COMMENT 'flags "INDEX_MEDIUM"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test new file mode 100644 index 0000000000000..fc37e28eb7669 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test @@ -0,0 +1,39 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 memos ( + content VARCHAR(64) NOT NULL, + is_read BOOL NOT NULL, + KEY (is_read) COMMENT 'flags "INDEX_SMALL"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test index 470283e94d84b..cc54ab34ad767 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test index 77a7683bc35c3..0c87494e3c70f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test index e3680ad3471d9..7005643546f4e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test index 7add6db7831b9..4700c280d803e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test index 42a91ecfc15ce..5251bf9842a38 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test new file mode 100644 index 0000000000000..2815b28509657 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 "NormalizerAuto"' +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +INSERT INTO diaries VALUES ("2013-04-23", "ブラックコーヒーを飲んã ã€‚"); + +SELECT * FROM diaries + WHERE MATCH (content) AGAINST ("+ãµã‚‰ã¤ã" IN BOOLEAN MODE); +SELECT * FROM diaries + WHERE MATCH (content) AGAINST ("+ブラック" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test new file mode 100644 index 0000000000000..5270372e33260 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test @@ -0,0 +1,37 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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, + INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +SELECT mroonga_command("dump --dump_plugins no"); + +DROP TABLE diaries; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test index c35c7dc15ce2c..2d7ff664335f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test index fe9037843bf99..15045b5466c4e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test index 5739e118ae346..16b76e0ec09b3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test index 7048ab6e76444..c712c2ed018e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,7 +27,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX body_index (body) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test index e163201e85907..e247e3d17f0f8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test index 69a48eb785172..a2484a90a6ebf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -25,7 +26,6 @@ CREATE TABLE variables ( name TEXT, FULLTEXT INDEX (name) COMMENT 'parser "off"' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE variables; INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix"); INSERT INTO variables (name) VALUES ("mroonga_default_parser"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test index a58a408cf5932..b91819e994041 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test index 0d5605821845c..4fe85314d1ccb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test index 956044c76180b..ba5f9a969ef96 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test index 688783b97430f..1066ffebbff8f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX body_index (body) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test index c7acf23cb3114..e7902c7b214fe 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test index e9c1fdf473c05..1fc724f5117cb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE variables ( name TEXT, FULLTEXT INDEX (name) COMMENT 'tokenizer "off"' ) DEFAULT CHARSET=utf8; -SHOW CREATE TABLE variables; INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix"); INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test index 222cc59e4020a..7ffedeaea5bb9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( body text, FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit' ) DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test index c161c50626ddd..1eaf8fa615f57 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test index 22b3061ced205..626172020aade 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test index 0c0fb1394cc49..2120efe0f9601 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test index 74d40a1adc3b7..317730f205f31 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test index 62cc9ed172f27..2639f32517cbd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_groonga_plugin_register.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test index 89e6c347c8cc2..6c2c628224f5a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test index aa38839f9ca7d..36f9848378942 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test index 44f6bba6adc7f..00f9336c16014 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test index 7c562842a953c..be309e71b8f68 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test index 513c56f074d3d..3598a17f72e7a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test b/storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test index 0199dd14a5d76..1bd21b6588184 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test index 3d8430703a233..383ada185e56b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test new file mode 100644 index 0000000000000..764db3d6fe99d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test @@ -0,0 +1,57 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP DATABASE IF EXISTS another; +--enable_warnings + +CREATE DATABASE another; +USE another; + +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX (title) +); + +DROP TABLE diaries; + + +USE test; + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX (title) +); + + +DROP DATABASE another; + +SELECT mroonga_command('object_exist mroonga_operations'); + +DROP TABLE diaries; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test index 39aff4e4b23a9..b27fda75e95c7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test b/storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test index 887b204c7ae70..44d6438bbaf8a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test new file mode 100644 index 0000000000000..0477954e12962 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test @@ -0,0 +1,46 @@ +# Copyright(C) 2013 Kentoku SHIBA +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +--enable_warnings + +CREATE TABLE comments ( + comment int unsigned PRIMARY KEY, + content text NOT NULL +); + +CREATE TABLE articles ( + content text NOT NULL, + comment int unsigned +); + +ALTER TABLE articles ADD FOREIGN KEY (comment) REFERENCES comments (comment); + +SHOW CREATE TABLE articles; + +SELECT * FROM information_schema.referential_constraints; + +DROP TABLE articles; +DROP TABLE comments; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test new file mode 100644 index 0000000000000..9fd0e918a969c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test @@ -0,0 +1,47 @@ +# Copyright(C) 2013 Kentoku SHIBA +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +--enable_warnings + +CREATE TABLE comments ( + comment int unsigned PRIMARY KEY, + content text NOT NULL +); + +CREATE TABLE articles ( + content text NOT NULL, + comment int unsigned, + FOREIGN KEY (comment) REFERENCES comments (comment) +); + +ALTER TABLE articles DROP FOREIGN KEY comment; + +SHOW CREATE TABLE articles; + +SELECT * FROM information_schema.referential_constraints; + +DROP TABLE articles; +DROP TABLE comments; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test index 7f02c81dbcd46..2b0ece4501bb5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test @@ -12,102 +12,34 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/skip_mysql_55.inc ---source ../../include/mroonga/skip_mariadb_55.inc +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings -drop table if exists articles2; -drop table if exists articles; -drop table if exists comments2; -drop table if exists comments; +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; --enable_warnings -create table comments( - comment int unsigned, - content text not null, - primary key(comment) -); - -create table articles( - content text not null, - comment int unsigned, - FOREIGN KEY (comment) REFERENCES comments (comment) -); - -insert into comments (comment, content) values -(1, 'aaa bbb'),(2, 'ccc ddd'),(3, 'eee fff'); - -insert into articles (content, comment) values -('111aaa', 1),('222bbb', 2),('222ccc', 2); - -select comment, content from comments; - -select content, comment from articles; - -show create table comments; - -show create table articles; - -select * from information_schema.referential_constraints; - -rename table comments to comments2; -rename table articles to articles2; - -create table comments( - comment int unsigned, - content text not null, - primary key(comment) +CREATE TABLE comments ( + comment int unsigned PRIMARY KEY, + content text NOT NULL ); -create table articles( - content text not null, +CREATE TABLE articles ( + content text NOT NULL, comment int unsigned, FOREIGN KEY (comment) REFERENCES comments (comment) ); -insert into comments (comment, content) values -(1, 'ab'),(2, 'cd'),(3, 'ef'); - -insert into articles (content, comment) values -('1a', 1),('2b', 2),('2c', 2); - -select comment, content from comments; - -select content, comment from articles; - -select comment, content from comments2; - -select content, comment from articles2; - -show create table comments; - -show create table articles; - -show create table comments2; - -show create table articles2; - -select * from information_schema.referential_constraints; - -alter table articles drop foreign key comment; - -show create table articles; - -select content, comment from articles; - -alter table articles add FOREIGN KEY (comment) REFERENCES comments (comment); - -show create table articles; +SHOW CREATE TABLE articles; -select content, comment from articles; +SELECT * FROM information_schema.referential_constraints; -drop table articles2; -drop table articles; -drop table comments2; -drop table comments; +DROP TABLE articles; +DROP TABLE comments; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test new file mode 100644 index 0000000000000..29453f6916c0b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test @@ -0,0 +1,53 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +--error ER_ROW_IS_REFERENCED_2 +DELETE FROM comments WHERE id = 100; + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test new file mode 100644 index 0000000000000..e2635efc56c83 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test @@ -0,0 +1,53 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO comments (id, content) VALUES (200, 'Very good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +DELETE FROM comments WHERE id = 200; + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test new file mode 100644 index 0000000000000..0b859c8342fa8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test @@ -0,0 +1,51 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test new file mode 100644 index 0000000000000..0ed29655d382a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test @@ -0,0 +1,51 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 1); + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test new file mode 100644 index 0000000000000..308117127d065 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 Kentoku SHIBA +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS articles; +DROP TABLE IF EXISTS comments; +DROP TABLE IF EXISTS articles2; +DROP TABLE IF EXISTS comments2; +--enable_warnings + +CREATE TABLE comments ( + comment int unsigned PRIMARY KEY, + content text NOT NULL +); + +CREATE TABLE articles ( + content text NOT NULL, + comment int unsigned, + FOREIGN KEY (comment) REFERENCES comments (comment) +); + +RENAME TABLE comments TO comments2; +RENAME TABLE articles TO articles2; + +SHOW CREATE TABLE articles2; + +SELECT * FROM information_schema.referential_constraints; + +DROP TABLE articles2; +DROP TABLE comments2; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test new file mode 100644 index 0000000000000..9b5ee9b9e63e6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test @@ -0,0 +1,53 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO comments (id, content) VALUES (200, 'Very good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +UPDATE entries SET comment_id = 200 WHERE content = 'Hello!'; + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test new file mode 100644 index 0000000000000..3e0f074828e03 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test @@ -0,0 +1,53 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_5.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_warnings + +CREATE TABLE comments ( + id int unsigned PRIMARY KEY, + content varchar(140) NOT NULL +); + +CREATE TABLE entries ( + content varchar(140) NOT NULL, + comment_id int unsigned, + FOREIGN KEY (comment_id) REFERENCES comments (id) +); + +INSERT INTO comments (id, content) VALUES (100, 'Good entry!'); +INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100); +--error ER_NO_REFERENCED_ROW_2 +UPDATE entries SET comment_id = 200 WHERE content = 'Hello!'; + +SELECT * FROM entries; +SELECT * FROM comments; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE entries; +DROP TABLE comments; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test index 6a97baa362e96..4bd9ff2db9c3d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test index 6fedec6810c94..89507f0901d26 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS memos; --enable_warnings -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET NAMES UTF8; CREATE TABLE memos ( @@ -38,6 +38,6 @@ SELECT * FROM memos DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test index 3e3c517bee604..a39cfebd285c4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test index f927b45fbc6e6..b8d1c0b9cdb21 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test index 1ead74d035443..c59bc9d7b1f97 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test index ba8f1c1eda170..bcbc4963a56ef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test index 655bf1e8fa084..de10774d83d59 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test index 9c4e92ce55d86..d99628494deeb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test index 5f1efdb796dee..bbebb5b5fe5dd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test index b720dcf6f712e..f4d2112b35a63 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test index 82d0718d1e8e5..e6f2a7ce6b626 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test index c2efa7a85750d..d2258a399d106 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test index 29107188c3595..03a2ff8744a5b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test index c5b5f2f795b1d..97cc2623ebcbd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test new file mode 100644 index 0000000000000..00bd029dee3fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test @@ -0,0 +1,43 @@ +# Copyright(C) 2016 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); +INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); + +SELECT *, MATCH(title, content) + AGAINST("*SS content @ '天気'" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*SS content @ '天気'" in BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test new file mode 100644 index 0000000000000..e6034ac2af564 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test @@ -0,0 +1,50 @@ +# Copyright(C) 2016 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +DROP TABLE IF EXISTS readings; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE readings ( + reading VARCHAR(255) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE items ( + name VARCHAR(255) PRIMARY KEY, + readings TEXT COMMENT 'flags "COLUMN_VECTOR", type "readings"', + FULLTEXT INDEX items_index(readings) COMMENT 'table "readings"' +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES("日本", "ニホン ニッãƒãƒ³"); +INSERT INTO items VALUES("ローマ字", "ローマジ"); +INSERT INTO items VALUES("漢字", "カンジ"); + +SELECT *, MATCH(readings) + AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE) AS score + FROM items + WHERE MATCH(readings) + AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE); + +DROP TABLE items; +DROP TABLE readings; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test index e8ad55ab4c664..bee227664cb81 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test index 5cc8f4154c40a..b84eb91129c9e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test index b85580dba01b2..2edac1599f179 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test index 642b438ebf6f4..583ede590e89f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test index 5ea8c21797fcb..8c4cdb79e201b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test index b9beffa2ef7a3..a972cc6f4745f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS memos; --enable_warnings -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = ERROR; SET NAMES UTF8; @@ -40,6 +40,6 @@ SELECT * FROM memos DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test index c4195f2a541c4..4703fa7df1090 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS memos; --enable_warnings -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = ERROR_AND_LOG; SET NAMES UTF8; @@ -40,6 +40,6 @@ SELECT * FROM memos DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test index 9a45d479d306c..86803c7245106 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS memos; --enable_warnings -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = "IGNORE"; SET NAMES UTF8; @@ -39,6 +39,6 @@ SELECT * FROM memos DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test index cf2cd503b28b9..0080632324f43 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS memos; --enable_warnings -SET GLOBAL mroonga_default_parser = TokenDelimit; +SET GLOBAL mroonga_default_tokenizer = TokenDelimit; SET mroonga_action_on_fulltext_query_error = IGNORE_AND_LOG; SET NAMES UTF8; @@ -39,6 +39,6 @@ SELECT * FROM memos DROP TABLE memos; -SET GLOBAL mroonga_default_parser = TokenBigram; +SET GLOBAL mroonga_default_tokenizer = TokenBigram; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test index 4032ca9e66945..d080d70d4d8e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test index b6ac95da23283..db8fa2b4ccb0c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_cp932.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test index c990b28855204..39c89dbd7a3a2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_eucjpms.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test index 2e457aa768cde..0de940534f18d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test index 8fc9782156390..503b96106c3dc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( content TEXT CHARSET utf8mb4 COLLATE utf8mb4_general_ci, FULLTEXT INDEX (content) ) DEFAULT CHARSET utf8mb4; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "Alphabet", "ABCDE"); INSERT INTO diaries VALUES(2, "Mathmatics", "ð€ðð‚ðƒð„ | U+1D400-U+1D405"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test index 619363f0fed17..d97e75fef512d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test index 41d1ab9166059..38fbc8bb302e8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -31,7 +31,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test index e346fb1d3bc9b..e1fea8b07e71e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/load_mroonga_functions.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test index 0ac152703c918..5aa812fcb0487 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ create table diaries ( content text, fulltext index (title) ) default charset utf8; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test index 4f932d5ac2a1e..2bad02c0991e2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test index ef610b983df74..5c1ec53c5737c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -21,7 +21,6 @@ drop table if exists t1, t2, t3; --enable_warnings create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)); -show create table t1; insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test index ab9522f6fa2b5..718d78732c607 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test index 2881d3cf16070..7a4bd9b8cb7d2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test index 353e19804e56e..174374711b966 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test index 949cc61a4429c..8ccef3d68e335 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test index 97319b711768e..72b617812e95a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ create table diaries ( fulltext index title_index (title), fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (title, body) values ("survey", "will start groonga!"); insert into diaries (title, body) values ("groonga (1)", "starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test index 419224d4fc036..3487f704d909e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES("Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES("天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test index 3f7377d9c6e54..416b61b7cc97c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test index 5c94603c07f49..995f92aa4135f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test index 06afa3ce9cd41..dc5901ef7776b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test index c90fdf6f88ab5..73424524fc4ad 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test index a230111ba16f6..0d2963af7fe29 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test index 601ffcb73bb41..0d13720a54eb3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test index 7c0156ffd3372..aaef394ebdac4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test index c422a6a6750ba..aa1a1a2c160ba 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test index cdb4b9f27aee3..fd9ea74d86aa1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test index 54206e43843b2..c690f92e2ac5e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test index 1e84064b122ce..2919ad86288dd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test index a5040dd80a63e..485e2d84cfbe9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test index 17957ab828479..bad8e8bc9c3d4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_56_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test similarity index 95% rename from storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_56_no_such_key.test rename to storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test index 7dbc8fca2b764..c1d2c6c4cef3f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_56_no_such_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_56.inc +--source ../../include/mroonga/have_version_10_0.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_55_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test similarity index 95% rename from storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_55_no_such_key.test rename to storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test index da9de22217ce6..7c00c29bc4761 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_55_no_such_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_55.inc +--source ../../include/mroonga/have_version_5_5.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_100_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test similarity index 95% rename from storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_100_no_such_key.test rename to storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test index cf4c9b60230b4..a102b4acc7217 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_100_no_such_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_100.inc +--source ../../include/mroonga/have_version_5_6.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test new file mode 100644 index 0000000000000..091abbc911a5c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--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 ( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES('It is Groonga'); +INSERT INTO diaries VALUES('It is Mroonga'); + +SELECT mroonga_command('select', + 'table', 'diaries', + 'filter', 'title @ "Groonga"'); + +DROP TABLE diaries; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test index 892b24c5a7ade..501c2ac86aba0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test new file mode 100644 index 0000000000000..a74acf89ed854 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 `db-1`; +CREATE DATABASE `db-1`; +USE `db-1`; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command('dump --dump_plugins no'); + +DROP TABLE diaries; + +--disable_query_log +USE test; +DROP DATABASE `db-1`; +--enable_query_log + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test index 2712aab22189a..7eb3bba1f3f64 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test index 862e98c5a8cd4..ca18a93e15cad 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test index 39f99a7c2d4e4..13adc1956d183 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test rename to storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test index 1dca7076512c0..993d0b1a4135a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test rename to storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test index e70bb3f367de5..5b99a0ebeb69e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test new file mode 100644 index 0000000000000..63cb2b320d5a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test @@ -0,0 +1,54 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS users; +DROP TABLE IF EXISTS queries; +--enable_warnings + +CREATE TABLE users ( + id INT +); + +CREATE TABLE queries ( + user_id INT, + query TEXT +); + +INSERT INTO users VALUES (1); +INSERT INTO users VALUES (2); +INSERT INTO users VALUES (3); + +INSERT INTO queries VALUES (1, '(a)'); +INSERT INTO queries VALUES (2, '(b)'); +INSERT INTO queries VALUES (3, '(c)'); + +SELECT users.id, mroonga_escape(queries.query) AS escaped_query + FROM queries + LEFT JOIN users ON users.id = queries.user_id + ORDER BY users.id; + +DROP TABLE queries; +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test new file mode 100644 index 0000000000000..3f93ab1828260 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test @@ -0,0 +1,46 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; + +SET NAMES utf8mb4; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; + +INSERT INTO memos VALUES(1, "(Groonga) Installed!"); +INSERT INTO memos VALUES(2, "(Mroonga) Installed!"); +INSERT INTO memos VALUES(3, "(Groonga) Upgraded!"); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST(mroonga_escape("(groonga)") IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = TokenBigram; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test new file mode 100644 index 0000000000000..cdd431cfad0b3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test @@ -0,0 +1,26 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +SELECT mroonga_escape('+-><~*()\"\\:' AS query) AS escaped_query; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_nested.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_nested.test rename to storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test index 503e2000b1031..f98c4303ef650 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_nested.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test new file mode 100644 index 0000000000000..10041ef8360a1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test @@ -0,0 +1,39 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS data; +--enable_warnings + +CREATE TABLE data ( + value DECIMAL(5, 3) +); + +INSERT INTO data VALUES (2.9); + +SELECT mroonga_escape(value AS script) + FROM data; + +DROP TABLE data; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test new file mode 100644 index 0000000000000..141def4f8798b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test @@ -0,0 +1,26 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +SELECT mroonga_escape(-29 AS script) AS escaped_query; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test new file mode 100644 index 0000000000000..663fa69aba9a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test @@ -0,0 +1,39 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS data; +--enable_warnings + +CREATE TABLE data ( + value REAL +); + +INSERT INTO data VALUES (2.9); + +SELECT mroonga_escape(value AS script) + FROM data; + +DROP TABLE data; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test new file mode 100644 index 0000000000000..864cef6070396 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test @@ -0,0 +1,26 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +SELECT mroonga_escape('a\"\\\'z' AS script) AS escaped_query; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test new file mode 100644 index 0000000000000..09bdde1c38233 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test @@ -0,0 +1,45 @@ +# Copyright(C) 2015-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + + +--disable_warnings +--disable_query_log +DROP TABLE IF EXISTS keywords; +--enable_query_log +--enable_warnings + +CREATE TABLE keywords ( + keyword text +); + +INSERT INTO keywords VALUES ('Mroonga'); +INSERT INTO keywords VALUES ('Groonga'); + +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', + keyword) AS highlighted + FROM keywords; + +--disable_query_log +DROP TABLE keywords; +--enable_query_log + + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test new file mode 100644 index 0000000000000..10f44e44618d9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test @@ -0,0 +1,31 @@ +# Copyright(C) 2015-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + 'ロック', 'æ›´æ–°') AS highlighted; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test new file mode 100644 index 0000000000000..185842e77e5d5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test @@ -0,0 +1,25 @@ +# Copyright(C) 2015-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', + 'Mroonga', 'Groonga') AS highlighted; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test new file mode 100644 index 0000000000000..19c1ae826e722 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test @@ -0,0 +1,25 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.', + 'mroonga') AS highlighted; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test new file mode 100644 index 0000000000000..089a1d4eba906 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test @@ -0,0 +1,31 @@ +# Copyright(C) 2016-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + 'ロック æ›´æ–° -ボトルãƒãƒƒã‚¯' AS query) AS highlighted; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test new file mode 100644 index 0000000000000..3ba38c0b8d09b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test @@ -0,0 +1,31 @@ +# Copyright(C) 2017-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_highlight_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + '*D- +ロック +æ›´æ–° ボトルãƒãƒƒã‚¯' AS query) AS highlighted; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test new file mode 100644 index 0000000000000..db5b06ecd85db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test @@ -0,0 +1,55 @@ +# Copyright(C) 2015-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +--disable_query_log +DROP TABLE IF EXISTS memos; +--enable_query_log +--enable_warnings + +CREATE TABLE memos ( + content text +); + +INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL.'); + +INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.'); + +INSERT INTO memos VALUES ('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.'); + +SELECT mroonga_highlight_html(content, 'Mroonga') AS highlighted + FROM memos; + +--disable_query_log +DROP TABLE memos; +--enable_query_log + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test index 5d80d5230ef2c..da116a4a508e2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test @@ -14,7 +14,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test index 98e8d9dab2f7f..1ba332c4d8628 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test index 41f9d3684bff4..1fdd0a605115b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test new file mode 100644 index 0000000000000..d5159b88ce1a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test @@ -0,0 +1,24 @@ +# Copyright(C) 2015 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_normalize('aBcAbCã‘'); + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test new file mode 100644 index 0000000000000..9631313d79be8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test @@ -0,0 +1,24 @@ +# Copyright(C) 2015 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_normalize('aBcAbCã‘', "NormalizerAuto"); + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test new file mode 100644 index 0000000000000..88ee40fc6ca88 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test @@ -0,0 +1,40 @@ +# Copyright(C) 2015 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +--disable_query_log +DROP TABLE IF EXISTS memos; +--enable_query_log +--enable_warnings + +CREATE TABLE memos ( + content text +); + +INSERT INTO memos VALUES ('aBcAbCã‘'); + +SELECT mroonga_normalize(content) FROM memos; + +--disable_query_log +DROP TABLE memos; +--enable_query_log + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test new file mode 100644 index 0000000000000..ee80cd8b91487 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test @@ -0,0 +1,46 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS synonyms; +--enable_warnings + +CREATE TABLE synonyms ( + term varchar(255), + synonym varchar(255), + INDEX (term) +); + +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); +INSERT INTO synonyms VALUES ('Mroonga', 'Mroonga'); +INSERT INTO synonyms VALUES ('Mroonga', 'Groonga MySQL'); + +SELECT mroonga_query_expand('synonyms', + 'term', + 'synonym', + 'Mroonga Rroonga PGroonga') AS query; + +DROP TABLE synonyms; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test new file mode 100644 index 0000000000000..1a2c9d84404f1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS synonyms; +--enable_warnings + +CREATE TABLE synonyms ( + term varchar(255), + synonym varchar(255) +); + +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); + +SELECT mroonga_query_expand('synonyms', + 'term', + 'synonym', + 'Mroonga Rroonga PGroonga') AS query; + +DROP TABLE synonyms; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test new file mode 100644 index 0000000000000..50e4fc558bc42 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test @@ -0,0 +1,44 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS synonyms; +--enable_warnings + +CREATE TABLE synonyms ( + term varchar(255), + synonym varchar(255), + INDEX (term) +); + +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); + +SELECT mroonga_query_expand('synonyms', + 'term', + 'synonym', + 'Mroonga Rroonga PGroonga') AS query; + +DROP TABLE synonyms; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test new file mode 100644 index 0000000000000..2a8aad83d29c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test @@ -0,0 +1,45 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--disable_warnings +DROP TABLE IF EXISTS synonyms; +--enable_warnings + +CREATE TABLE synonyms ( + term varchar(255), + synonym varchar(255), + INDEX (term) +); + +INSERT INTO synonyms VALUES ('D+', '[D+]'); +INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga'); +INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby'); + +SELECT mroonga_query_expand('synonyms', + 'term', + 'synonym', + '*D+ Mroonga Rroonga PGroonga') AS query; + +DROP TABLE synonyms; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test index 0cb551dbc6910..028bdb750ea40 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test index 338417021c8cf..2d85633ab947d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source include/have_cp932.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test index fa8dbb20e9398..525c14a30043e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source include/have_eucjpms.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test new file mode 100644 index 0000000000000..5faed51889167 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test @@ -0,0 +1,45 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + + +--disable_warnings +--disable_query_log +DROP TABLE IF EXISTS keywords; +--enable_query_log +--enable_warnings + +CREATE TABLE keywords ( + keyword text +); + +INSERT INTO keywords VALUES ('Mroonga'); +INSERT INTO keywords VALUES ('Groonga'); + +SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.', + keyword) as snippet + FROM keywords; + +--disable_query_log +DROP TABLE keywords; +--enable_query_log + + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test new file mode 100644 index 0000000000000..c01d298853f22 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test @@ -0,0 +1,31 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + 'ロック', 'æ›´æ–°') as snippet; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test new file mode 100644 index 0000000000000..60d206d2b40d4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test @@ -0,0 +1,25 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.', + 'Mroonga', 'Groonga') as snippet; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test new file mode 100644 index 0000000000000..b4dfd0c5f5f7c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test @@ -0,0 +1,29 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SELECT mroonga_snippet_html('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.', + 'lock') as snippet; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test new file mode 100644 index 0000000000000..998a080c7f814 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test @@ -0,0 +1,31 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + 'ロック æ›´æ–° -ボトルãƒãƒƒã‚¯' AS query) as snippet; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test new file mode 100644 index 0000000000000..b01dcbcd54c0f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test @@ -0,0 +1,31 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES utf8; + +SELECT mroonga_snippet_html('Mroongaã«ã¯2ã¤ã®å‹•ä½œãƒ¢ãƒ¼ãƒ‰ãŒã‚ã‚Šã¾ã™ã€‚ + +1ã¤ãŒã€Œã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ãƒ¢ãƒ¼ãƒ‰ã€ã§ã€ãƒ‡ãƒ¼ã‚¿ã‚¹ãƒˆã‚¢ã‚‚検索機能もã™ã¹ã¦Groongaを使ã†ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚上述ã®å‚照ロックフリーãªGroongaã®æ€§èƒ½ç‰¹æ€§ã‚’フルã«æ´»ã‹ã—ãŸé«˜é€Ÿãªãƒ‡ãƒ¼ã‚¿æ›´æ–°ãƒ»å…¨æ–‡æ¤œç´¢ãƒ»ä½ç½®æƒ…報検索ãŒç‰¹é•·ã§ã™ã€‚一方ã€ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ã®æ©Ÿèƒ½ã¯æä¾›ã•ã‚Œã¾ã›ã‚“。 + +ã‚‚ã†1ã¤ãŒã€Œãƒ©ãƒƒãƒ‘ーモードã€ã§ã€MyISAMã‚„InnoDBã¨ã„ã£ãŸä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ã« 全文検索機能ã ã‘ を追加ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã™ã€‚ã“ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ãªã©ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒã‚µãƒãƒ¼ãƒˆã—ã¦ã„る機能ã«åŠ ãˆã¦Groongaã®é«˜é€Ÿãªå…¨æ–‡æ¤œç´¢æ©Ÿèƒ½ã‚’利用ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚一方ã€Groongaã®å‚照ロックフリーãªç‰¹æ€§ã¯æ´»ã‹ã™ã“ã¨ãŒã§ãã¾ã›ã‚“。ã¾ãŸã€æ›´æ–°å‡¦ç†ã¯ä»–ã®ã‚¹ãƒˆãƒ¬ãƒ¼ã‚¸ã‚¨ãƒ³ã‚¸ãƒ³ãŒãƒœãƒˆãƒ«ãƒãƒƒã‚¯ã«ãªã‚‹ã“ã¨ãŒå¤šã„ã§ã—ょã†ã€‚', + '*D- +ロック +æ›´æ–° ボトルãƒãƒƒã‚¯' AS query) as snippet; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test new file mode 100644 index 0000000000000..59163fe45979a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test @@ -0,0 +1,55 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +--disable_query_log +DROP TABLE IF EXISTS memos; +--enable_query_log +--enable_warnings + +CREATE TABLE memos ( + content text +); + +INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine. + +In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL. + +By using Mroonga, you can use Groonga with SQL.'); + +INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL. + +On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.'); + +INSERT INTO memos VALUES ('Mroonga has two running modes. + +One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions. + +Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.'); + +SELECT mroonga_snippet_html(content, 'Mroonga') as snippet + FROM memos; + +--disable_query_log +DROP TABLE memos; +--enable_query_log + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test index a4e24ce030ee8..2547000aa95fb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test index 4df02c14e7b7b..e8805b492d6b9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test index 3d41de6a93e1e..1678a3ed29d25 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test index 2397bdd9c8f96..887d8fb51accd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc ---source ../../include/mroonga/skip_mysql_57.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test index 4aed7b2472935..94d8024071f87 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test @@ -1,4 +1,4 @@ -# Copyright(C) 2011-2012 Kouhei Sutou +# Copyright(C) 2011-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc +--source ../../include/mroonga/skip_mysql_5_7.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -28,7 +29,6 @@ CREATE TABLE shops ( location GEOMETRY NOT NULL, SPATIAL KEY location_index (location) ); -SHOW CREATE TABLE shops; INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', @@ -144,6 +144,11 @@ SELECT id, name, ST_AsText(location) AS location_text FROM shops WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) ORDER BY id; +EXPLAIN +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) + ORDER BY id; + DROP TABLE shops; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test similarity index 86% rename from storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test rename to storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test index 00efe1e4ac73a..2fd4fad68e795 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test @@ -1,5 +1,5 @@ # Copyright(C) 2014 Kenji Maruyama -# Copyright(C) 2015 Kouhei Sutou +# Copyright(C) 2015-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -13,10 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_geometry.inc ---source ../../include/mroonga/have_version_57.inc +--source ../../include/mroonga/have_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -27,9 +27,8 @@ CREATE TABLE shops ( location GEOMETRY NOT NULL ); -SET SESSION sql_mode = ''; +--error ER_BAD_NULL_ERROR INSERT INTO shops VALUES (NULL), (NULL); -SET SESSION sql_mode = default; SELECT ST_AsText(location) FROM shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test new file mode 100644 index 0000000000000..605e03833da88 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test @@ -0,0 +1,152 @@ +# Copyright(C) 2011-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS shops; +--enable_warnings + +CREATE TABLE shops ( + id INT PRIMARY KEY AUTO_INCREMENT, + name TEXT, + location GEOMETRY NOT NULL, + SPATIAL KEY location_index (location) +); + +INSERT INTO shops (name, location) + VALUES ('nezu-no-taiyaki', + ST_GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) + VALUES ('taiyaki-kataoka', + ST_GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) + VALUES ('soba-taiyaki-ku', + ST_GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) + VALUES ('kuruma', + ST_GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) + VALUES ('hirose-ya', + ST_GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) + VALUES ('sazare', + ST_GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) + VALUES ('omede-taiyaki', + ST_GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) + VALUES ('onaga-ya', + ST_GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) + VALUES ('shiro-ya', + ST_GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) + VALUES ('fuji-ya', + ST_GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) + VALUES ('miyoshi', + ST_GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) + VALUES ('juju-ya', + ST_GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) + VALUES ('tatsumi-ya', + ST_GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) + VALUES ('tetsuji', + ST_GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) + VALUES ('gazuma-ya', + ST_GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) + VALUES ('honma-mon', + ST_GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) + VALUES ('naniwa-ya', + ST_GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) + VALUES ('kuro-dai', + ST_GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) + VALUES ('daruma', + ST_GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) + VALUES ('yanagi-ya', + ST_GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) + VALUES ('sharaku', + ST_GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) + VALUES ('takane', + ST_GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) + VALUES ('chiyoda', + ST_GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) + VALUES ('da-ka-po', + ST_GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) + VALUES ('matsushima-ya', + ST_GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) + VALUES ('kazuya', + ST_GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) + VALUES ('furuya-kogane-an', + ST_GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) + VALUES ('hachi-no-ie', + ST_GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) + VALUES ('azuki-chan', + ST_GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) + VALUES ('kuriko-an', + ST_GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) + VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', + ST_GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) + VALUES ('naze-ya', + ST_GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) + VALUES ('sanoki-ya', + ST_GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) + VALUES ('shigeta', + ST_GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) + VALUES ('nishimi-ya', + ST_GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) + VALUES ('hiiragi', + ST_GeomFromText('POINT(139.711517 35.647701)')); + +SELECT id, name, ST_AsText(location) AS location_text FROM shops; +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) + ORDER BY id; + +EXPLAIN +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) + ORDER BY id; + +DROP TABLE shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test index 0354e9b7e4b0c..ccc51b79e684c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test @@ -14,11 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test index a1429859a337e..478ae97ba9fdc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test index 0f63eed4b52b6..a1c43cc417e39 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test index dcf029593fdfc..f342c049fd59e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test index a28a912e23da0..bfb3f45636033 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test index dd0b6ba440e77..7925f4ffc1679 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test @@ -1,4 +1,5 @@ # Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2016-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,24 +13,28 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings -drop table if exists t1, t2, t3; +DROP TABLE IF EXISTS t1; --enable_warnings -create table t1 (_id int, a int, primary key (_id) using hash); +CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH); + --error ER_BAD_NULL_ERROR -insert into t1 values(null, 100); -insert into t1 values(1,100); -insert into t1 values(1,100); -insert into t1 values(1,100); -insert into t1 values(1,100); -select * from t1; -select * from t1 where _id = 2; -select * from t1 where _id = 20; -drop table t1; +INSERT INTO t1 VALUES(null, 100); +INSERT INTO t1 VALUES(1,100); +INSERT INTO t1 VALUES(1,100); +INSERT INTO t1 VALUES(1,100); +INSERT INTO t1 VALUES(1,100); + +SELECT * FROM t1; +SELECT * FROM t1 WHERE _id = 2; +SELECT * FROM t1 WHERE _id = 20; + +DROP TABLE t1; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test index 8f1e6b889bb47..bf665e83bc567 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test index acb298ef81283..e9f20387651f6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test new file mode 100644 index 0000000000000..b2629c80675b7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test @@ -0,0 +1,44 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2016-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_strict_sql_mode.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH); + +--error ER_BAD_NULL_ERROR +INSERT INTO t1 VALUES(null, 100); +--error 1265 +INSERT INTO t1 VALUES(1,100); +--error 1265 +INSERT INTO t1 VALUES(1,100); +--error 1265 +INSERT INTO t1 VALUES(1,100); +--error 1265 +INSERT INTO t1 VALUES(1,100); + +SELECT * FROM t1; +SELECT * FROM t1 WHERE _id = 2; +SELECT * FROM t1 WHERE _id = 20; + +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test index ebf331d2f1525..5cb0eed102f11 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test index 5afdd36b5b8f6..c5d97a2978580 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test index 314dbd85d952d..be7b7eefd0f7c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test index 82372d63527ce..23e75a58073c1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test index a221c40dcc1d5..eef9de2d0954d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test index b765bab6769a1..8d2d6c92adebd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test new file mode 100644 index 0000000000000..521061cdf610b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test @@ -0,0 +1,49 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + score3 INT, + INDEX (score1, score2, score3) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100); +INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100); + +SELECT * + FROM items + WHERE score1 = 2 + ORDER BY score2 ASC, score3 ASC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test new file mode 100644 index 0000000000000..d48c0e56b17ec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test @@ -0,0 +1,49 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + score3 INT, + INDEX (score1, score2, score3) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100); +INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0); +INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100); + +SELECT * + FROM items + WHERE score1 = 2 + ORDER BY score2 DESC, score3 DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test index 40b39fe853834..92a830880864c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test index 52cee4c7b33c9..8978ee2af49dc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test new file mode 100644 index 0000000000000..6abe39795fd8a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test @@ -0,0 +1,47 @@ +# Copyright(C) 2011-2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_strict_sql_mode.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE scores ( + name char(30) NOT NULL, + score int NOT NULL, + PRIMARY KEY (name, score) +) DEFAULT CHARSET=utf8; + +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12); +INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10); + +SELECT * FROM scores; + +--error 1265 +UPDATE scores SET name = "Taro Yamada" + WHERE name = "Jiro Yamada" AND score = 27; + +SELECT * FROM scores + WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); + +DROP TABLE scores; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test index 0568da4508ccc..64292cf18d182 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test @@ -1,4 +1,4 @@ -# Copyright(C) 2011 Kouhei Sutou +# Copyright(C) 2011-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,28 +12,35 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings -drop table if exists listing; +DROP TABLE IF EXISTS scores; --enable_warnings -set names utf8; -create table scores ( - name char(30) not null, - score int not null, - primary key (name, score) -) default charset utf8; -show create table scores; -insert into scores (name, score) values("Taro Yamada", 29); -insert into scores (name, score) values("Taro Yamada", -12); -insert into scores (name, score) values("Jiro Yamada", 27); -insert into scores (name, score) values("Taro Yamada", 10); -select * from scores; -update scores set name = "Taro Yamada" where name = "Jiro Yamada" and score = 27; -select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29); -drop table scores; +SET NAMES utf8; +CREATE TABLE scores ( + name char(30) NOT NULL, + score int NOT NULL, + PRIMARY KEY (name, score) +) DEFAULT CHARSET=utf8; + +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12); +INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27); +INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10); + +SELECT * FROM scores; + +UPDATE scores SET name = "Taro Yamada" + WHERE name = "Jiro Yamada" AND score = 27; + +SELECT * FROM scores + WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); + +DROP TABLE scores; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than.test rename to storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test index 431f123497bbc..0cfbea6708090 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test rename to storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test index bc739fdfb5279..e5543a66b453d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than.test rename to storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test index a3c3b7663409b..e326aca2678db 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test similarity index 98% rename from storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test rename to storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test index 3cbac1c1ff9c9..d2e09033f0366 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test new file mode 100644 index 0000000000000..49d0d7798d6c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE score1 = 2 AND created_at > "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test new file mode 100644 index 0000000000000..d8e90a15df9ca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE score1 = 2 AND created_at >= "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test new file mode 100644 index 0000000000000..317517f4ca9b6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE score1 = 2 AND created_at < "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test new file mode 100644 index 0000000000000..310cc4764191e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (score1, created_at, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE score1 = 2 AND created_at <= "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test new file mode 100644 index 0000000000000..7449e21ef3cc8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE created_at > "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test new file mode 100644 index 0000000000000..3ea5db1493a7c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE created_at >= "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test new file mode 100644 index 0000000000000..50e9ca0d76f0d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE created_at < "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test new file mode 100644 index 0000000000000..125143d71bae8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test @@ -0,0 +1,45 @@ +# Copyright(C) 2015 Masafumi Yokoyama +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT, + score2 INT, + created_at DATETIME, + INDEX (created_at, score1, score2) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE items; + +INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00"); +INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00"); + +SELECT * + FROM items + WHERE created_at <= "2015-07-01 12:00:00" + ORDER BY created_at DESC; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test index 430b3bb94a237..c674388e18197 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test index 18db29cc85fbc..4bffa8c396a55 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test index 07ab3d38028d0..01139dc631d72 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test index 567d32e0ffd56..902750ba265b9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test index 0658bbcedf327..4172666fafd60 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test new file mode 100644 index 0000000000000..2077b91442827 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS listing; +--enable_warnings + +CREATE TABLE scores ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT NOT NULL, + score2 INT NOT NULL, + INDEX (score1, score2) +) DEFAULT CHARSET=UTF8; + +INSERT INTO scores (score1, score2) VALUES(1, 1); +INSERT INTO scores (score1, score2) VALUES(1, 2); +INSERT INTO scores (score1, score2) VALUES(2, 3); +INSERT INTO scores (score1, score2) VALUES(2, 2); +INSERT INTO scores (score1, score2) VALUES(2, 1); +INSERT INTO scores (score1, score2) VALUES(2, 0); +INSERT INTO scores (score1, score2) VALUES(2, -1); +INSERT INTO scores (score1, score2) VALUES(2, -2); +INSERT INTO scores (score1, score2) VALUES(2, -3); + +SELECT MAX(score2) FROM scores WHERE score1 = 2; + +DROP TABLE scores; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test new file mode 100644 index 0000000000000..8541aaddae0b0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS listing; +--enable_warnings + +CREATE TABLE scores ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + score1 INT NOT NULL, + score2 INT NOT NULL, + INDEX (score1, score2) +) DEFAULT CHARSET=UTF8; + +INSERT INTO scores (score1, score2) VALUES(1, 1); +INSERT INTO scores (score1, score2) VALUES(1, 2); +INSERT INTO scores (score1, score2) VALUES(2, 3); +INSERT INTO scores (score1, score2) VALUES(2, 2); +INSERT INTO scores (score1, score2) VALUES(2, 1); +INSERT INTO scores (score1, score2) VALUES(2, 0); +INSERT INTO scores (score1, score2) VALUES(2, -1); +INSERT INTO scores (score1, score2) VALUES(2, -2); +INSERT INTO scores (score1, score2) VALUES(2, -3); + +SELECT MIN(score2) FROM scores WHERE score1 = 2; + +DROP TABLE scores; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test index a79567bde7ff6..936a57bc2d81f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test index 7c9af9aa998d3..4778da9afa030 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test index adc1c88236c75..1f6151508e4ce 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test index c842ff428c3bf..1323b4ce4a860 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -33,13 +31,13 @@ CREATE TABLE ranges ( UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (2, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (1, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31"); INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02"); SELECT * FROM ranges FORCE INDEX(range_key) - WHERE start = "1000-01-01" AND end = "9999-12-31"; + WHERE start = "1000-01-02" AND end = "9999-12-31"; DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test index 708ba0b44dccc..666b9566efa2e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test @@ -14,11 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -32,10 +31,10 @@ CREATE TABLE ranges ( UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (2, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (1, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31"); INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02"); SELECT start, end FROM ranges FORCE INDEX(range_key) diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test index 94a73a3633fca..0f4306b3e086f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test index 6dc1ef8450182..939d885a617fd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test index 92bd9915a2216..89108b7270d34 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -34,9 +32,9 @@ CREATE TABLE ranges ( ); INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); -INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (2, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02"); +INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start, end; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test index a25cd4d87c362..3cb5bcae3bf1f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -34,9 +32,9 @@ CREATE TABLE ranges ( ); INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); -INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); -INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); -INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +INSERT INTO ranges VALUES (2, "1000-01-02", "2012-10-05"); +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02"); +INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start DESC, end DESC; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test index 6a04c4a9df54a..182f185a0d67a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test index 0807e78c0aaf7..d33d2c1f84eb7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -33,10 +31,10 @@ CREATE TABLE ranges ( UNIQUE KEY range_key(start, end) ); -INSERT INTO ranges VALUES (1, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (1, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); +INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); SELECT start, end FROM ranges FORCE INDEX(range_key) diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test index f20c2fd132cf3..fb647f5c6e705 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test @@ -1,4 +1,4 @@ -# Copyright(C) 2015 Kouhei Sutou +# Copyright(C) 2015-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_strict_sql_mode.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test index 3fcc92f7acfb1..b4b5f500c56d6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -34,9 +32,9 @@ CREATE TABLE ranges ( ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); -INSERT INTO ranges VALUES (4, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); +INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start, end; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test index 4d25f29cfdcbe..a2c4564253ae8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test @@ -14,12 +14,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_freebsd.inc ---source ../../include/mroonga/skip_osx.inc ---source ../../include/mroonga/skip_solaris10.inc ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -34,9 +32,9 @@ CREATE TABLE ranges ( ); INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "9999-12-31 23:59:59"); -INSERT INTO ranges VALUES (2, "1000-01-01 00:00:00", "2012-10-05 16:18:29"); -INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-01 00:00:00"); -INSERT INTO ranges VALUES (4, "1000-01-01 00:00:00", "9999-12-31 23:59:59"); +INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00"); +INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59"); SELECT * FROM ranges FORCE INDEX(range_key) ORDER BY start DESC, end DESC; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test index eb6df3af8ad07..bd360544ee1c1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test index faf590d84b60f..38265a6ed99ea 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test index 52e4113dc09da..fa4780d541bff 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test index a8e36f2ff265f..af3394b1f6140 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test index c13ed51cf7f5f..bc8a7e723a04b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test index 497010df03242..63f708afbb2db 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test index 2ee8ae466ac7e..7e7357108a579 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test @@ -1,5 +1,5 @@ # Copyright(C) 2012 Kentoku SHIBA -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, - start timestamp, - end timestamp, + start timestamp DEFAULT '2016-04-21 00:00:00', + end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test index efb7ab70ae2c1..3f337d05523da 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -24,8 +24,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, - start timestamp, - end timestamp, + start timestamp DEFAULT '2016-04-21 00:00:00', + end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test index 1b1e62951e448..6dbc49388742c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test @@ -1,5 +1,5 @@ # Copyright(C) 2012 Kentoku SHIBA -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -24,8 +24,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, - start timestamp, - end timestamp, + start timestamp DEFAULT '2016-04-21 00:00:00', + end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test index 74bd0eb133a41..7a1bd6bc74fe8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test @@ -1,5 +1,5 @@ # Copyright(C) 2012 Kentoku SHIBA -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS ranges; CREATE TABLE ranges ( id int PRIMARY KEY, - start timestamp, - end timestamp, + start timestamp DEFAULT '2016-04-21 00:00:00', + end timestamp DEFAULT '2016-04-22 00:00:00', UNIQUE KEY range_key(start, end) ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test index e116e7a251e46..67ae21224d13a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test index 45be9e2b9eff8..a0277c18cc0d8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test index 2505b47b1bcc4..21a3b936afe34 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test @@ -13,11 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc ---source ../../include/mroonga/skip_osx.inc --disable_warnings DROP TABLE IF EXISTS ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test index b475b857fd427..fa91ca3177d3f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test @@ -13,11 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc ---source ../../include/mroonga/skip_osx.inc --disable_warnings DROP TABLE IF EXISTS ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test index 47e4d7c24cdb4..1539d9a77416f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test index 88a09a18a5c63..92492d599e79f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test @@ -13,9 +13,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/skip_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test index 5a4525fe7a562..226a51b43332b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test @@ -13,11 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc ---source ../../include/mroonga/skip_osx.inc --disable_warnings DROP TABLE IF EXISTS ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test index 8865c3610ff37..0f1830ff6d622 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test @@ -13,11 +13,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_signed_64bit_time_t.inc --source ../../include/mroonga/have_mroonga.inc ---source ../../include/mroonga/skip_osx.inc --disable_warnings DROP TABLE IF EXISTS ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test index e7ac3a8a941fe..b80986c393866 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test index d1c23dfbc7312..0d303496afbdb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test index 19fc2c36dfb23..e250885d058fe 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test index 37cd919eb77dd..a954ffd4ee39e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test index 9cdee6b1efbf6..19cedaffcd448 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test index 1e1029d0d86cd..9228b1ffb9192 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test index 9b94d315836fc..dc9db9652f617 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE diaries ( day DATE PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (day, title) VALUES ("2012-01-29", "clear day"); INSERT INTO diaries (day, title) VALUES ("2012-01-30", "rainy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test index 44a9fcaca692a..7ddd48617084d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_fractional_seconds.inc --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ CREATE TABLE diaries ( day DATETIME(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (day, title) VALUES ("2012-01-29 21:51:01.111111", "clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test index 82b6632672c23..aba0d8755f0e9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE diaries ( day DATETIME PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (day, title) VALUES ("2012-01-29 21:51:01", "clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test index c9134275c4513..4e2bd44d2d1e6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE releases ( version DECIMAL(6, 3) PRIMARY KEY, message TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE releases; INSERT INTO releases (version, message) VALUES (10.000, "10th release!"); INSERT INTO releases (version, message) VALUES (10.001, "minor fix."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test index f9cdd093ff40e..a5073a6334a87 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE releases ( version DECIMAL PRIMARY KEY, message TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE releases; INSERT INTO releases (version, message) VALUES (1, "the first release!!!"); INSERT INTO releases (version, message) VALUES (10, "10th release!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test index 7b8f48e185a9c..bf61a4fbd0f3f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_fractional_seconds.inc @@ -25,7 +25,6 @@ CREATE TABLE running_records ( time TIME(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; INSERT INTO running_records (time, title) VALUES ("01:00:00.000001", "normal condition"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test index d71dd6485d2ad..6e5c369ffa0f0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE running_records ( time TIME PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE running_records; INSERT INTO running_records (time, title) VALUES ("01:00:00", "normal condition"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test index f59ee6273010b..1eb103b76c7ef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test @@ -12,9 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/skip_mariadb_55.inc +--source ../../include/mroonga/skip_mariadb_5_5.inc --source ../../include/mroonga/have_fractional_seconds.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( time TIMESTAMP(6) PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (time, title) VALUES ("2012-01-29 21:51:01.111111", "clear day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test index 7d8c1778331bf..341dfd21c097c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE diaries ( time TIMESTAMP PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (time, title) VALUES ("2012-01-29 21:51:01", "clear day"); INSERT INTO diaries (time, title) VALUES ("2012-01-30 01:23:45", "rainy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test index 9c8e4e46c280e..a610944d835cf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test index 6236b2d961d67..a390eba41f7a5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE aniversary_memos ( party_year YEAR PRIMARY KEY, title TEXT ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE aniversary_memos; INSERT INTO aniversary_memos (party_year, title) VALUES ("11", "We need a big cake!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test index 9358c7c0e47aa..97e8efc73cbed 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test index 9fe7698974509..a3e040b554bc1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test index 24967c9d14bc1..454326ea21282 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test index 7f4bc666fe198..1a9a06f8b40d8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test index 58604aa347d8d..d19cfcb226271 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test index df89318fbe444..aa0761aa871cf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test index 97dc161f191a8..068f53fea69d1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test index 2e4451b9fb765..b903332396221 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test index 76729da279ec2..5b1e16538ad4f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test index 692953f9332be..10446b115b57f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test index d5c73ac3d81eb..66d29dfb8f112 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test index b8d2dac9cacc5..7dcbb6e902344 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test index 8f262237cde6c..8537caed403cb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test index 994eff8b69a04..d7d48ea72becb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test index 9e58d3cd8e483..216c5f4ef9926 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test index 14c97749c37f8..90f241ad285e0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test index 318ccbfb82016..58e58f4dbdd14 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test index ef89fbdd128bb..2b81524aef25d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test index e35baa1303791..7ad385098ead2 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test index aca93729e3b6b..0baa5d4b311ba 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test index f9563018beaca..15e539b552441 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test index b95dca5fe0793..a3e1d35647bae 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test index a817dfc285ce6..c63a8a867a8f9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test index f9f42e48ac59c..81d6df92ffabf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test index 977629729129c..c64bd185b21bd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test index bba35ebbdeb49..82ea8949d869e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test index 04344db0034d1..685570228569a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test index 27ef9af3a8030..c513983d886af 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test index 518eabe1cb023..51ed0a3bb8bdf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test index 08b9c5b56481c..9d9d02c4b023a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test index 84f2adce7c8cf..04584d2f71f55 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test index 995dd9d77a628..7b8a6fecbab0f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test index 106a5bdd9f2bb..c2307642392b8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test index 4a0b2ff34929d..c4004e4207ad0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test new file mode 100644 index 0000000000000..f4d468b71b394 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test @@ -0,0 +1,39 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id int, + UNIQUE KEY (id) +); + +INSERT INTO ids VALUES (1); +DELETE FROM ids; +INSERT INTO ids VALUES (1); + +SELECT * FROM ids; + +-- error ER_DUP_ENTRY +INSERT INTO ids VALUES (1); + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test index 27c094acec9ad..3b3743b8b37f5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test index 4acdfc0f1bfd9..70c6ec8576fcb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test index 7642ee733f398..27fb6eea83438 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test index 8bcdb56ccfd64..fe222c377ec74 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test index fbf776d9e39b3..b1a37b5acc9bd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test index 557ce195ae310..3d47500544f2e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test index 43988b71a9a6d..fb462fd76851b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test index f6d2d8fb5dbc7..2dcf6716e2e6c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test index 3135ad9fa34d4..f1aac9c1c33e6 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test index 7b54e8d3ac599..445bcfabe39dc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test index 6e3ce140eba5f..95c21513d5709 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc @@ -77,22 +77,6 @@ insert into t1 values("2010/03/26 11:22:33"); select * from t1; drop table t1; - -# for virtual columns -create table t1 (c1 int, _id int); -set sql_mode=""; -# warning WARN_DATA_TRUNCATED -insert into t1 (c1,_id) values (1,1); -set sql_mode="strict_all_tables"; -# We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported -# MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it. -# We share this test with all MySQL servers. So we use number here. ---error 1265 -insert into t1 (c1,_id) values (4,1); -select * from t1; -drop table t1; - - # duplicated key error create table t1 (c1 int primary key, c2 int); insert into t1 values(1,100); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test index d58d432674257..e52d11c5582e5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,9 +12,12 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +skip "This test is too fragile."; --source include/not_embedded.inc +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test index a53e672cbe4cd..e6c0cae164f56 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test index c25e460635948..1b07775d68194 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,7 +24,6 @@ CREATE TABLE diaries ( day DATE PRIMARY KEY, title TEXT ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (day, title) VALUES ("2012-02-14", "clear day") diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test index 5542b0ece3b24..f5b6db7bab62d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( title TEXT, UNIQUE KEY day (day) ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (day, title) VALUES ("2012-02-14", "clear day1") diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test new file mode 100644 index 0000000000000..3f3fd208aeff9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test @@ -0,0 +1,42 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (c1 int, _id int); +--disable_warnings +SET sql_mode=""; +--enable_warnings +# warning WARN_DATA_TRUNCATED +INSERT INTO t1 (c1,_id) VALUES (1,1); +--disable_warnings +SET sql_mode="STRICT_ALL_TABLES"; +--enable_warnings +# We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported +# MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it. +# We share this test with all MySQL servers. So we use number here. +--error 1265 +INSERT INTO t1 (c1,_id) VALUES (4,1); +SELECT * FROM t1; +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test b/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test index 48d50135b08d6..1f9c5fd3849d3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test b/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test index eeda3dac4a910..6c7627e7967ae 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test deleted file mode 100644 index 2355e5d4af49a..0000000000000 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright(C) 2010 Kentoku SHIBA -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - ---source ../../include/mroonga/have_mroonga.inc - ---disable_warnings -drop table if exists t1, t2, t3; ---enable_warnings - -flush status; -create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3)); -insert into t1 values(1,10,"aa ii uu ee oo"); -insert into t1 values(2,20,"ka ki ku ke ko"); -insert into t1 values(3,30,"sa si su se so"); -insert into t1 values(4,40,"ta ti tu te to"); -insert into t1 values(5,50,"aa ii uu ee oo"); -show status like 'mroonga_count_skip'; -select * from t1; -show status like 'mroonga_count_skip'; -select count(*) from t1; -show status like 'mroonga_count_skip'; -select * from t1 force index(primary) where c1 between 2 and 4; -show status like 'mroonga_count_skip'; -select count(*) from t1 force index(primary) where c1 between 2 and 4; -show status like 'mroonga_count_skip'; -select c1 from t1 force index(primary) where c1 < 3; -show status like 'mroonga_count_skip'; -select count(c1) from t1 force index(primary) where c1 < 3; -show status like 'mroonga_count_skip'; -select 1 from t1 force index(primary) where c1 > 3; -show status like 'mroonga_count_skip'; -select count(1) from t1 force index(primary) where c1 > 3; -show status like 'mroonga_count_skip'; -select * from t1 where match(c3) against("su"); -show status like 'mroonga_count_skip'; -select count(*) from t1 where match(c3) against("su"); -show status like 'mroonga_count_skip'; -select * from t1 where match(c3) against("+su" in boolean mode); -show status like 'mroonga_count_skip'; -select count(*) from t1 where match(c3) against("+su" in boolean mode); -show status like 'mroonga_count_skip'; -select * from t1 force index(idx1) where c2 between 20 and 40; -show status like 'mroonga_count_skip'; -select count(*) from t1 force index(idx1) where c2 between 20 and 40; -show status like 'mroonga_count_skip'; -drop table t1; - ---source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test index 6d07ab7b6067c..69713752f4f2a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,11 +30,17 @@ CREATE TABLE diaries ( INSERT INTO diaries VALUES("Hello mroonga!"); INSERT INTO diaries VALUES("It's funny."); +disable_query_log; CONNECT (thread2, localhost, root, ,); CONNECTION thread2; +enable_query_log; + INSERT INTO diaries VALUES("Happy birthday!"); + +disable_query_log; DISCONNECT thread2; CONNECTION default; +enable_query_log; SHOW STATUS LIKE 'mroonga_count_skip'; SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test index 26930d4750263..07bbc773973da 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test index fedf31810c7e4..2014a8fa476bd 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ CREATE TABLE diaries ( content TEXT, FULLTEXT INDEX(content) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test new file mode 100644 index 0000000000000..3c63ecc9c1279 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test @@ -0,0 +1,44 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT, + age INT, + INDEX (id, age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id, age) VALUES (1, 28); +INSERT INTO users (id, age) VALUES (1, 28); +INSERT INTO users (id, age) VALUES (1, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (3, 29); + +SELECT COUNT(*) FROM users WHERE id = 2 AND age = 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test new file mode 100644 index 0000000000000..cccb0d3f48ff8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); + +SELECT COUNT(*) FROM users WHERE age BETWEEN 28 AND 30; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test new file mode 100644 index 0000000000000..f8ebad5d7bbf5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); + +SELECT COUNT(*) FROM users WHERE age = 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test new file mode 100644 index 0000000000000..9e3c6fd8a32c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test @@ -0,0 +1,43 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +INSERT INTO memos (content) VALUES ('Groonga is good.'); +INSERT INTO memos (content) VALUES ('Groonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga is good.'); +INSERT INTO memos (content) VALUES ('Mroonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.'); + +SELECT COUNT(*) FROM memos + WHERE MATCH(content) AGAINST('+Groonga' IN BOOLEAN MODE); + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test new file mode 100644 index 0000000000000..634428c5c9594 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test @@ -0,0 +1,43 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +INSERT INTO memos (content) VALUES ('Groonga is good.'); +INSERT INTO memos (content) VALUES ('Groonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga is good.'); +INSERT INTO memos (content) VALUES ('Mroonga is very good.'); +INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.'); + +SELECT COUNT(*) FROM memos + WHERE MATCH(content) AGAINST('Groonga'); + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test new file mode 100644 index 0000000000000..0feababfbf233 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); + +SELECT COUNT(*) FROM users WHERE age > 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test new file mode 100644 index 0000000000000..5e69f1684ec5a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); + +SELECT COUNT(*) FROM users WHERE age >= 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test new file mode 100644 index 0000000000000..8aa1ba17621ae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); + +SELECT COUNT(*) FROM users WHERE age < 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test new file mode 100644 index 0000000000000..a6e0f3a51ed9c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (27); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (30); +INSERT INTO users (age) VALUES (31); + +SELECT COUNT(*) FROM users WHERE age <= 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test new file mode 100644 index 0000000000000..f07d1b9beae85 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (28); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); +INSERT INTO users (age) VALUES (29); + +SELECT COUNT(*) FROM users WHERE age <> 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test index 378f4424da117..cc3de7c3ce693 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test new file mode 100644 index 0000000000000..1f49597bb2745 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT, + age INT, + INDEX (age) +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id, age) VALUES (1, 29); +INSERT INTO users (id, age) VALUES (2, 29); +INSERT INTO users (id, age) VALUES (3, 29); + +SELECT COUNT(*) FROM users WHERE id = 3 AND age = 29; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test new file mode 100644 index 0000000000000..1c9e7354c357b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id BETWEEN 2 AND 4; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test new file mode 100644 index 0000000000000..23fb2152f9430 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id = 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test new file mode 100644 index 0000000000000..9020dd11efa19 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id > 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test new file mode 100644 index 0000000000000..f4c1e0687c567 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id >= 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test new file mode 100644 index 0000000000000..bcf5afa52de59 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id < 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test new file mode 100644 index 0000000000000..ddfad77ceff00 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id <= 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test new file mode 100644 index 0000000000000..c49385ed849b1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test @@ -0,0 +1,41 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE users ( + id INT PRIMARY KEY +) DEFAULT CHARSET=UTF8; + +INSERT INTO users (id) VALUES (1); +INSERT INTO users (id) VALUES (2); +INSERT INTO users (id) VALUES (3); +INSERT INTO users (id) VALUES (4); +INSERT INTO users (id) VALUES (5); + +SELECT COUNT(*) FROM users WHERE id <> 3; + +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test index 20b89f7246381..e65e44d1f6091 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test new file mode 100644 index 0000000000000..14f548db12499 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test @@ -0,0 +1,57 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT UNSIGNED NOT NULL, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(title), + FULLTEXT INDEX(content) +) DEFAULT CHARSET UTF8; + +INSERT INTO memos VALUES(5, "title 1", "content a"); +INSERT INTO memos VALUES(12, "title 1", "content a"); +INSERT INTO memos VALUES(10, "title 1", "content a"); +INSERT INTO memos VALUES(4, "title 2", "content b"); +INSERT INTO memos VALUES(6, "title 2", "content b"); +INSERT INTO memos VALUES(1, "title 2", "content b"); +INSERT INTO memos VALUES(11, "title 1-a", "content a-1"); +INSERT INTO memos VALUES(3, "title 2-b", "content a-2"); +INSERT INTO memos VALUES(2, "title 2-c", "content a-3"); +INSERT INTO memos VALUES(8, "title 1-a", "content b-1"); +INSERT INTO memos VALUES(9, "title 2-b", "content b-2"); +INSERT INTO memos VALUES(7, "title 2-c", "content b-3"); + +SELECT * FROM memos + WHERE MATCH(title) AGAINST("+1" IN BOOLEAN MODE) AND + MATCH(content) AGAINST("+a" IN BOOLEAN MODE) + ORDER BY id + LIMIT 1,3; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test index b1246ddfbdc27..eb9e7ef55bcbf 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test new file mode 100644 index 0000000000000..c14ee787f1abf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test @@ -0,0 +1,46 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +SET NAMES CP932; +CREATE TABLE memos ( + Ž¯•ÊŽq INT UNSIGNED, + “à—e TEXT, + FULLTEXT INDEX(“à—e), + KEY(Ž¯•ÊŽq) +) DEFAULT CHARSET CP932; + +INSERT INTO memos VALUES(2, "–¾“ú‚ÍŽR“o‚èB"); +INSERT INTO memos VALUES(3, "¡“ú‚̓Tƒ{ƒeƒ“‚ð‚à‚ç‚Á‚½B"); +INSERT INTO memos VALUES(1, "¡“ú‚Í“V‹C‚ª‚æ‚­‚Ä‚æ‚©‚Á‚½B"); + +SELECT * FROM memos + WHERE MATCH(“à—e) AGAINST("¡“ú" IN BOOLEAN MODE) + ORDER BY Ž¯•ÊŽq + LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test index 41d5facf6443c..04cd30ab337e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test index f6440777ab516..cdc7b43353288 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test index 5b57d2980c63c..c7a5244042c58 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:34", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:34", "Tomorrow will be fine."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test index 4f878af84cc66..0f87b70186c6a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test index e8735fda41ccb..922e72e2bbb9b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test index 4a748bc130bd8..78f8f19a14d1a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test index 80fe51e1e8049..2b12fa6ccc141 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(date) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "2011-11-11 12:23:30", "Today is fine."); INSERT INTO diaries VALUES(2, "2011-11-11 12:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test index b36a13f3727b7..1908ce34d8a66 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test new file mode 100644 index 0000000000000..834a39fe75c8b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test @@ -0,0 +1,49 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +SET NAMES utf8; +CREATE TABLE memos ( + id int PRIMARY KEY, + tag ENUM('Groonga', 'Mroonga'), + content TEXT, + FULLTEXT INDEX(content), + KEY(tag), + KEY(id) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!'); +INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!'); +INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.'); +INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.'); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND + tag = 'Mroonga' + ORDER BY id LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test new file mode 100644 index 0000000000000..703d79dc8e174 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test @@ -0,0 +1,49 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +SET NAMES utf8; +CREATE TABLE memos ( + id int PRIMARY KEY, + tag ENUM('Groonga', 'Mroonga'), + content TEXT, + FULLTEXT INDEX(content), + KEY(tag), + KEY(id) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!'); +INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!'); +INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.'); +INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.'); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND + tag = 2 + ORDER BY id LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test index bcc678360e264..9c44110bfd51d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -33,7 +33,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test index e0a2df2e5873f..32345f6613918 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test index c8f698cdbccca..508f85f3a7389 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test index ee510ab752751..a2024e8dda52c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test index 76f2de8146b35..4924cb374e992 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test index caca6b56b8983..b81247ed2f93b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test index 1c26bef936f15..d32d9f1128c9b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test index 4df32d8a590fb..9289bee30688f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test index 07907f1dfb7a2..23adb84f91c45 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -33,7 +33,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test index 0e0b3f8e1ea14..1031427f9cea3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test index 213605adca1bc..78b42e5d8d7b0 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test index 58505edf7a76e..f09a2a0e3b46a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test index 92178a4515854..9a7585609136d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -35,7 +35,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(NULL, 1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(NULL, 2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test index 4ec5a8b15966b..e49a79a7db25f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test index eaedbbdc7dc0f..b563028c81db3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test index 72d2890a12372..c11603c94f8be 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test index eeb2e36ae29fc..71f93c6ee1b14 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test index 666887d334796..883f676e45e8e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:34", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:34", "Tomorrow will be fine."); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test index feeae64b8d12c..a8af0bbb78185 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!" ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test index 4744add7881dd..a0795f8eba6d1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!" ); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test index cb407d354503f..4087207c2a874 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test index b9327e4251dd3..e423a4b937b85 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ CREATE TABLE memos ( FULLTEXT INDEX(content), KEY(writing_time) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE memos; INSERT INTO memos VALUES(1, "1:23:30", "Today is fine."); INSERT INTO memos VALUES(2, "1:23:31", "Today's lucky item is flower!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test index 7c460d1086a5c..60565dd7bab16 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -35,7 +35,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test index ffebd0a4bad14..dcde9373317b8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -34,7 +34,6 @@ CREATE TABLE diaries ( KEY(month), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test index c4e86ac103900..4e7c117d65404 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test index 57b512ed88d58..d6e7b345c0583 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test index 729d8b03770bc..bac10448269e5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test index 6bd955cc956ec..9ffae4a65281a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test index 3e40e88585991..09015f9c2c380 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test index 44fb928774f1b..35adc29839f7d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test index f7d0865f30321..831ef4c3e6a18 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test index 25270f14def79..4e59a2ca3abfa 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test @@ -12,9 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/skip_mariadb_100_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source include/have_partition.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test index d601b4d4fe93c..eaf3304dac590 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test @@ -12,9 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/skip_mariadb_100_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source include/have_partition.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test index 65989b60e8a09..22fade591b6d3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test @@ -12,9 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc +--source ../../include/mroonga/skip_solaris.inc --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_mroonga_helper.inc @@ -27,7 +28,6 @@ CREATE TABLE diaries ( body TEXT, FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start Groonga!"); INSERT INTO diaries (title, body) VALUES ("Groonga (1)", "starting Groonga..."); @@ -35,11 +35,11 @@ INSERT INTO diaries (title, body) VALUES ("Groonga (2)", "started Groonga."); SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); ---remove_file $MYSQLD_DATADIR/repair_test.mrn.000010A.c +--remove_file $MYSQLD_DATADIR/repair_test.mrn.000010E.c FLUSH TABLES; -# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn.000010A.c' (No such file or directory) +# Error ER_CANT_OPEN_FILE system call error: No such file or directory: failed to open path: --error ER_CANT_OPEN_FILE SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test index 81dcbe318b36e..e9ba60c2c2882 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test @@ -12,10 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test index 0f8e90c0c0334..3ff23185741f5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # Based on #910. diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test index bb134cd04e48f..4aba5eda25621 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ create table diaries ( content text, fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test index 231e8b0976223..da3faa03053bc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ create table diaries ( content varchar(256), fulltext index (content) ) default charset utf8; -show create table diaries; insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test index 2e06bf7e5f871..22cbf13889b43 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test index fb8a6750fb99d..db5b90ab0b166 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_all.test index c3973cb916478..b607c314a8478 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_all.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_all.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test index c624f8e0c36d9..52630fec0f077 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test index 59c358cc1b831..75d00e7a73789 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test index 4424cf283daa2..ad71ac7119b39 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -31,7 +31,7 @@ INSERT INTO users VALUES ("Alice", 20); INSERT INTO users VALUES ("Bob", 20); INSERT INTO users VALUES ("Charry", 29); -SELECT *, COUNT(*) FROM users GROUP BY age; +SELECT age, COUNT(*) FROM users GROUP BY age; DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test index 46c0e5aa70e65..710bea0dd5a0e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -30,9 +30,7 @@ INSERT INTO users VALUES ("Alice", 20); INSERT INTO users VALUES ("Bob", 20); INSERT INTO users VALUES ("Charry", 29); -EXPLAIN SELECT *, COUNT(*) FROM users GROUP BY age; - -SELECT *, COUNT(*) FROM users GROUP BY age; +SELECT age, COUNT(*) FROM users GROUP BY age; DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test index a0afe1198efe5..0bce1387b3f55 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test index 231e7c2703795..32bb5758a10a8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test index 3f00049092cb3..95007d8032fee 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test index c2df2522b9cd3..a7460343c266c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -31,7 +31,6 @@ CREATE TABLE diaries ( title TEXT, FULLTEXT INDEX (title) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO users (name) VALUES ("alice"); INSERT INTO users (name) VALUES ("bob"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test index e71a2322bb23c..ef26b467dbc89 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/skip_osx.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ CREATE TEMPORARY TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title) VALUES ("clear day"); INSERT INTO diaries (title) VALUES ("rainy day"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test b/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test index 7e5bc2d010c50..840ff375489ef 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -31,7 +31,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test new file mode 100644 index 0000000000000..c90a8cbf1cb35 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test @@ -0,0 +1,38 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET SESSION binlog_format = 'ROW'; + +CREATE TABLE memos ( + title varchar(20) PRIMARY KEY, + content varchar(140) NOT NULL +) COLLATE=utf8mb4_general_ci + DEFAULT CHARSET=utf8mb4; + +INSERT INTO memos (title, content) VALUES ('Mroonga', 'Mroonga is great!'); +SELECT * FROM memos; +UPDATE memos SET content = 'Mroonga is very great!' WHERE title = 'Mroonga'; +SELECT * FROM memos; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test index 33ccec429896a..dbcfd66546481 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test index 5b5a47ad447aa..526d6f18c2055 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test index f1c91bfd8d300..0f9ecdbf33797 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_int.test index 7f40ba09b2e54..eb4af2c117ecc 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_int.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_int.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test index 65f0ce3b2535e..872f1673569b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test index a50bfd6929e7a..e0cb953d51dc9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test @@ -12,32 +12,38 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings -drop table if exists t1, t2, t3; +DROP TABLE IF EXISTS t1; --enable_warnings # for virtual columns -create table t1 (c1 int, _id int); -insert into t1 values(1,null); -insert into t1 values(2,null); -insert into t1 values(3,null); -select * from t1; -set sql_mode=""; +CREATE TABLE t1 (c1 int, _id int); +INSERT INTO t1 VALUES(1,null); +INSERT INTO t1 VALUES(2,null); +INSERT INTO t1 VALUES(3,null); +SELECT * FROM t1; +--disable_warnings +SET sql_mode=""; +--enable_warnings # warning WARN_DATA_TRUNCATED -update t1 set _id = 10 where c1 = 1; -select * from t1; -set sql_mode="strict_all_tables"; +UPDATE t1 SET _id = 10 WHERE c1 = 1; +SELECT * FROM t1; +--disable_warnings +SET sql_mode="STRICT_ALL_TABLES"; +--enable_warnings # We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported # MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it. # We share this test with all MySQL servers. So we use number here. --error 1265 -update t1 set _id = 11 where c1 = 1; -select * from t1; -drop table t1; +UPDATE t1 SET _id = 11 WHERE c1 = 1; +SELECT * FROM t1; +DROP TABLE t1; + +SET sql_mode=DEFAULT; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test index 2cba585bc2a21..83dc25e498914 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. --source ../../include/mroonga/have_mysql.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test index bdd4f915bbff8..21879480c7d63 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. --source ../../include/mroonga/have_mysql.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test index c7f54925382b8..77c4c1db2b14d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. --source ../../include/mroonga/have_mysql.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test index b3265d9645b1b..b312b31ad393c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. --source ../../include/mroonga/have_mysql.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test index 61613ef290668..6509eeee2bf24 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. --source ../../include/mroonga/have_mysql.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test index ad934696171a6..b7a4b80b6f198 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test index e71dcfe0dda1d..83138aee0ec30 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test index 4cfbe489b9012..41aac1a146fe8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test new file mode 100644 index 0000000000000..4c518b28e9f9f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test @@ -0,0 +1,25 @@ +# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014 Kentoku SHIBA +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET @mroonga_default_tokenizer_backup = @@mroonga_default_tokenizer; +SET GLOBAL mroonga_default_tokenizer = "TokenBigramSplitAlpha"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; +SET GLOBAL mroonga_default_tokenizer = @mroonga_default_tokenizer_backup; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test new file mode 100644 index 0000000000000..ebd08460b3c17 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test @@ -0,0 +1,22 @@ +# Copyright(C) 2014 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET GLOBAL mroonga_default_tokenizer = "TokenBigram"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test index de97096e5a490..767ce3f928652 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (body) values ("will start groonga!"); select * from diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test index b52385793d282..4ad242dd59df8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (body) values ("will start groonga!"); select * from diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test index 47c2442158616..66f82a5c05290 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -25,7 +25,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8; -show create table diaries; insert into diaries (body) values ("will start groonga!"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test new file mode 100644 index 0000000000000..c6e62c9d1eb51 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test @@ -0,0 +1,36 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_enable_operations_recording = true; +FLUSH TABLES; + +CREATE TABLE diaries ( + title TEXT +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Research for Mroonga"); + +SELECT * FROM diaries; + +DROP TABLE diaries; + +SET GLOBAL mroonga_enable_operations_recording = false; +FLUSH TABLES; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test index 3e2c5bfe7bf11..a3720f2ef5b35 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,17 +12,17 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_100_or_later.inc +--source ../../include/mroonga/have_version_10_0_or_later.inc --source ../../include/mroonga/have_mroonga.inc SET GLOBAL mroonga_lock_timeout = -1; SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; -disable_query_log; -SET GLOBAL mroonga_lock_timeout = 10000000; -enable_query_log; +--disable_query_log +SET GLOBAL mroonga_lock_timeout = DEFAULT; +--enable_query_log --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test index 7358389bb5d2b..54c834d7e4c76 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,17 +12,17 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ---source ../../include/mroonga/have_version_100_or_later.inc +--source ../../include/mroonga/have_version_10_0_or_later.inc --source ../../include/mroonga/have_mroonga.inc SET GLOBAL mroonga_lock_timeout = -2; SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; -disable_query_log; -SET GLOBAL mroonga_lock_timeout = 10000000; -enable_query_log; +--disable_query_log +SET GLOBAL mroonga_lock_timeout = DEFAULT; +--enable_query_log --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test index c25d1747b1de8..60e468bf0a6eb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,8 +20,8 @@ SET GLOBAL mroonga_lock_timeout = 0; SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; -disable_query_log; -SET GLOBAL mroonga_lock_timeout = 10000000; -enable_query_log; +--disable_query_log +SET GLOBAL mroonga_lock_timeout = DEFAULT; +--enable_query_log --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test index 523baa1b3e932..4b490b8a74da8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test @@ -1,4 +1,4 @@ -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,8 +20,8 @@ SET GLOBAL mroonga_lock_timeout = 1000; SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; -disable_query_log; -SET GLOBAL mroonga_lock_timeout = 10000000; -enable_query_log; +--disable_query_log +SET GLOBAL mroonga_lock_timeout = DEFAULT; +--enable_query_log --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test index c96b021be7652..07a4afbe76e8a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test index d05cbd2349a5b..13c544b95a577 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test index ead099e0cc16e..e2cda37b79b39 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test index 1f73f4f447f9d..2cf196f49ca03 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test index 8585c1c2f1177..fda1f8768f61f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS diaries; --enable_warnings -# MySQL <= 5.5 reports wrong a warning. :< +# MySQL <= 5.5 reports a wrong warning. :< # It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. --disable_warnings SET GLOBAL mroonga_match_escalation_threshold = -1; @@ -30,24 +30,31 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, - FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' + FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); -INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); +INSERT INTO diaries (title, tags) VALUES ("Hello Groonga!", "groonga install"); +INSERT INTO diaries (title, tags) VALUES ("Hello Mroonga!", "mroonga install"); +disable_query_log; +CONNECT (new_connection, localhost, root, ,); +CONNECTION new_connection; +enable_query_log; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+install" IN BOOLEAN MODE); -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); SET GLOBAL mroonga_match_escalation_threshold = 0; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); SET mroonga_match_escalation_threshold = 0; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+gr" IN BOOLEAN MODE); +disable_query_log; +CONNECTION default; +DISCONNECT new_connection; +enable_query_log; DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test index 8743c3faadb90..0a7d192f76f18 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -24,9 +24,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, - FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' + FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test index 043d8d3340bed..9ce8cf8bae79f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test @@ -1,4 +1,4 @@ -# Copyright(C) 2015 Kouhei Sutou +# Copyright(C) 2015-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -38,13 +39,17 @@ INSERT INTO ids VALUES (10); SET GLOBAL mroonga_max_n_records_for_estimate = 1; +disable_query_log; CONNECT (new_connection, localhost, root, ,); CONNECTION new_connection; +enable_query_log; EXPLAIN SELECT * FROM ids WHERE id > 5; +disable_query_log; CONNECTION default; DISCONNECT new_connection; +enable_query_log; SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test new file mode 100644 index 0000000000000..757a7f9590dbd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test @@ -0,0 +1,60 @@ +# Copyright(C) 2015-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); + + +SET GLOBAL mroonga_max_n_records_for_estimate = 1; + +disable_query_log; +CONNECT (new_connection, localhost, root, ,); +CONNECTION new_connection; +enable_query_log; + +EXPLAIN SELECT * FROM ids WHERE id > 5; + +disable_query_log; +CONNECTION default; +DISCONNECT new_connection; +enable_query_log; + +SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; + + +DROP TABLE ids; + + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test new file mode 100644 index 0000000000000..df9f498632e9c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test @@ -0,0 +1,43 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT, + INDEX (id) +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); + +DELETE FROM ids WHERE id < 2; + +SET mroonga_max_n_records_for_estimate = 1; + +EXPLAIN SELECT * FROM ids WHERE id > 0; + +SET mroonga_max_n_records_for_estimate = DEFAULT; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test new file mode 100644 index 0000000000000..19b4b2836b165 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); + +SET mroonga_max_n_records_for_estimate = 1; + +EXPLAIN SELECT * FROM ids WHERE id > 5; + +SET mroonga_max_n_records_for_estimate = DEFAULT; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test new file mode 100644 index 0000000000000..0b9357e06c052 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test @@ -0,0 +1,43 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT, + INDEX (id) +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); + +DELETE FROM ids WHERE id < 2; + +SET mroonga_max_n_records_for_estimate = 1; + +EXPLAIN SELECT * FROM ids WHERE id > 0; + +SET mroonga_max_n_records_for_estimate = DEFAULT; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test index 894e14f480235..5e31c8b0d63b8 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test @@ -1,4 +1,4 @@ -# Copyright(C) 2015 Kouhei Sutou +# Copyright(C) 2015-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test new file mode 100644 index 0000000000000..912c2e2bf7d35 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test @@ -0,0 +1,32 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = ""; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test new file mode 100644 index 0000000000000..a63f4f75a74d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test @@ -0,0 +1,32 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = NULL; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test new file mode 100644 index 0000000000000..e37b163b5c510 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test @@ -0,0 +1,34 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = ""; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test new file mode 100644 index 0000000000000..2df00d6a46c03 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test @@ -0,0 +1,34 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = NULL; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test new file mode 100644 index 0000000000000..a3a7dc9b08648 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test @@ -0,0 +1,34 @@ +# Copyright(C) 2012 Kouhei Sutou +# Copyright(C) 2014 Kentoku SHIBA +# Copyright(C) 2017 Kentaro Hayashi +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test new file mode 100644 index 0000000000000..66024f5cf0078 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test @@ -0,0 +1,35 @@ +# Copyright(C) 2014-2017 Kouhei Sutou +# Copyright(C) 2017 Kentaro Hayashi +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; + +SET GLOBAL mroonga_log_file = "groonga-query-log.log"; + +SET GLOBAL mroonga_query_log_file = "groonga-query.log"; +SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file"; +--exec sed -r -e 's/^[^|]+\|[^|]+\|[^|]+\| *//' $MYSQLD_DATADIR/groonga-query-log.log + +SET GLOBAL mroonga_query_log_file = DEFAULT; +SET GLOBAL mroonga_log_file = DEFAULT; + +--remove_file $MYSQLD_DATADIR/groonga-query-log.log + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test index d2ae3fd871807..f1fe11864d91c 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/not_embedded.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test index 6c21f8d50d778..2bd4496a2de22 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result index 22dbbff96ac19..2be9834c61778 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result @@ -3,13 +3,6 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; id title @@ -26,12 +19,4 @@ id title body 1 survey will start groonga! 2 groonga (1) starting groonga... 3 groonga (2) started groonga. -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result new file mode 100644 index 0000000000000..9628df686b307 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS users; +SET NAMES cp932; +CREATE TABLE users ( +id int unsigned PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"'; +ALTER TABLE users +ADD COLUMN –¼‘O text, +ADD FULLTEXT INDEX (–¼‘O); +INSERT INTO users (–¼‘O) VALUES ("‚â‚Ü‚¾"); +INSERT INTO users (–¼‘O) VALUES ("‚½‚È‚©"); +INSERT INTO users (–¼‘O) VALUES ("‚·‚¸‚«"); +SELECT * FROM users; +id –¼‘O +1 ‚â‚Ü‚¾ +2 ‚½‚È‚© +3 ‚·‚¸‚« +SELECT * FROM users +WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); +id –¼‘O +2 ‚½‚È‚© +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_HASH_KEY ShortText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result new file mode 100644 index 0000000000000..abd2271f05124 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +id int unsigned PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"'; +ALTER TABLE users +ADD COLUMN åå‰ text, +ADD FULLTEXT INDEX (åå‰); +INSERT INTO users (åå‰) VALUES ("ã‚„ã¾ã "); +INSERT INTO users (åå‰) VALUES ("ãŸãªã‹"); +INSERT INTO users (åå‰) VALUES ("ã™ãšã"); +SELECT * FROM users; +id åå‰ +1 ã‚„ã¾ã  +2 ãŸãªã‹ +3 ã™ãšã +SELECT * FROM users +WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); +id åå‰ +2 ãŸãªã‹ +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_HASH_KEY ShortText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result index e5ce4692aa3ff..7197d3a9dc051 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result @@ -6,16 +6,11 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) ENGINE MyISAM DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SELECT table_name, engine, table_comment +FROM information_schema.tables +WHERE table_name = 'diaries'; +table_name engine table_comment +diaries MyISAM INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); SELECT * FROM diaries @@ -24,16 +19,11 @@ MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); id title body 1 survey will start groonga! ALTER TABLE diaries ENGINE = mroonga COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' +SELECT table_name, engine, table_comment +FROM information_schema.tables +WHERE table_name = 'diaries'; +table_name engine table_comment +diaries Mroonga ENGINE "InnoDB" SELECT * FROM diaries WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result index 1106fcffca2eb..05bd0e4e1e0a1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result @@ -6,28 +6,15 @@ title VARCHAR(64), content TEXT, FULLTEXT INDEX(content) ) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(64) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"' INSERT INTO memos (title, content) VALUES ("Hello", "I start to write memos!"); INSERT INTO memos (title, content) VALUES ("groonga", "I start to use groonga!"); INSERT INTO memos (title, content) VALUES ("mroonga", "I use mroonga too!"); ALTER TABLE memos COMMENT='engine "MyISAM"'; -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(64) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='engine "MyISAM"' +SELECT table_name, table_comment +FROM information_schema.tables +WHERE table_name = 'memos'; +table_name table_comment +memos engine "MyISAM" SELECT * FROM memos; id title content 1 Hello I start to write memos! diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result index 07c149a8fa8ff..25cb53ded0bfb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result @@ -4,26 +4,11 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, body TEXT ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; id title body 1 survey will start groonga! ALTER TABLE diaries DROP COLUMN body; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' SELECT * FROM diaries; id title 1 survey diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result index cc64daac30a47..37f03b4061632 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result @@ -4,14 +4,6 @@ id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, FULLTEXT INDEX title_index (title) ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; id title @@ -39,14 +31,4 @@ WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); id title body 2 groonga (1) starting groonga... -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result index 08e526baa508a..bfbe96d14d71e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result @@ -6,16 +6,6 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; id title body @@ -32,14 +22,4 @@ SELECT * FROM memos WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); id title body -SHOW CREATE TABLE memos; -Table Create Table -memos CREATE TABLE `memos` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result index 0e2f4c3bcca25..fa42d4a1fd39f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result @@ -119,13 +119,4 @@ id name location_text 14 tetsuji POINT(139.76857 35.680912) 19 daruma POINT(139.770599 35.681461) 26 kazuya POINT(139.760895 35.673508) -SHOW CREATE TABLE shops; -Table Create Table -shops CREATE TABLE `shops` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - `location` geometry NOT NULL, - PRIMARY KEY (`id`), - SPATIAL KEY `location_index` (`location`) -) ENGINE=Mroonga AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 COMMENT='ENGINE "InnoDB"' DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result new file mode 100644 index 0000000000000..61122f7842fe4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id int NOT NULL PRIMARY KEY, +content text, +FULLTEXT INDEX (content) +) COMMENT='engine "InnoDB"'; +INSERT INTO memos VALUES (1, 'Hello MySQL'); +INSERT INTO memos VALUES (2, 'Hello Mroonga'); +CHECK TABLE memos FOR UPGRADE; +Table Op Msg_type Msg_text +test.memos check status OK +FLUSH TABLES; +SELECT * FROM memos +WHERE MATCH(content) AGAINST('+mroonga' IN BOOLEAN MODE); +id content +2 Hello Mroonga +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result new file mode 100644 index 0000000000000..5b379d08e3aee --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED; +ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'; +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result new file mode 100644 index 0000000000000..24c9275b5e70d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +DELETE FROM logs WHERE id = 1; +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result new file mode 100644 index 0000000000000..65a55204a32e6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DROP COLUMN message; +SELECT * FROM logs; +id record +1 {"level": "info", "message": "start"} +2 {"level": "info", "message": "restart"} +3 {"level": "warn", "message": "abort"} +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result new file mode 100644 index 0000000000000..febfd34345be7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result new file mode 100644 index 0000000000000..c0d9452f15e2c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DISABLE KEYS; +ALTER TABLE logs ENABLE KEYS; +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result new file mode 100644 index 0000000000000..ae9c244d8807f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, +FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; +SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE); +id record message +2 {"level": "info", "message": "shutdown"} "shutdown" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result new file mode 100644 index 0000000000000..6daeb5e2f3180 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL; +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result new file mode 100644 index 0000000000000..82a46e3fcfc63 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) +VALUES (1, '{"level": "info", "message": "start server"}'); +ALTER TABLE logs ADD FULLTEXT INDEX (message); +INSERT INTO logs(id, record) +VALUES (2, '{"level": "info", "message": "start server"}'); +INSERT INTO logs(id, record) +VALUES (3, '{"level": "warn", "message": "abort server"}'); +SELECT * FROM logs WHERE MATCH(message) AGAINST('+start' IN BOOLEAN MODE); +id record message +2 {"level": "info", "message": "start server"} "start server" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result new file mode 100644 index 0000000000000..09cd18915f8ef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +level VARCHAR(255) GENERATED ALWAYS AS +(json_unquote(json_extract(`record`, '$.level'))) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) +VALUES (1, '{"level": "info", "message": "start server"}'); +ALTER TABLE logs ADD INDEX (level); +INSERT INTO logs(id, record) +VALUES (2, '{"level": "info", "message": "start server"}'); +INSERT INTO logs(id, record) +VALUES (3, '{"level": "warn", "message": "abort server"}'); +SELECT * FROM logs WHERE level = 'info'; +id record level +1 {"level": "info", "message": "start server"} info +2 {"level": "info", "message": "start server"} info +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result new file mode 100644 index 0000000000000..8c1ceaf13dd12 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +DELETE FROM logs WHERE id = 1; +SELECT * FROM logs; +id record message +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result new file mode 100644 index 0000000000000..7d3226175ea3f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +ALTER TABLE logs DROP COLUMN message; +SELECT * FROM logs; +id record +1 {"level": "info", "message": "start"} +2 {"level": "info", "message": "restart"} +3 {"level": "warn", "message": "abort"} +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result new file mode 100644 index 0000000000000..5a0e63ed7c490 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "restart"} "restart" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result new file mode 100644 index 0000000000000..2411f7a725ce5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS logs; +CREATE TABLE logs ( +id INT PRIMARY KEY, +record JSON, +message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; +SELECT * FROM logs; +id record message +1 {"level": "info", "message": "start"} "start" +2 {"level": "info", "message": "shutdown"} "shutdown" +3 {"level": "warn", "message": "abort"} "abort" +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result new file mode 100644 index 0000000000000..38185f5ec97ee --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS users; +SET NAMES cp932; +CREATE TABLE users ( +id int unsigned PRIMARY KEY AUTO_INCREMENT, +–¼‘O text, +FULLTEXT INDEX (–¼‘O) +) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"'; +INSERT INTO users (–¼‘O) VALUES ("‚â‚Ü‚¾"); +INSERT INTO users (–¼‘O) VALUES ("‚½‚È‚©"); +INSERT INTO users (–¼‘O) VALUES ("‚·‚¸‚«"); +SELECT * FROM users; +id –¼‘O +1 ‚â‚Ü‚¾ +2 ‚½‚È‚© +3 ‚·‚¸‚« +SELECT * FROM users +WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); +id –¼‘O +2 ‚½‚È‚© +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_HASH_KEY ShortText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result new file mode 100644 index 0000000000000..2d31307392f32 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +id int unsigned PRIMARY KEY AUTO_INCREMENT, +åå‰ text, +FULLTEXT INDEX (åå‰) +) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"'; +INSERT INTO users (åå‰) VALUES ("ã‚„ã¾ã "); +INSERT INTO users (åå‰) VALUES ("ãŸãªã‹"); +INSERT INTO users (åå‰) VALUES ("ã™ãšã"); +SELECT * FROM users; +id åå‰ +1 ã‚„ã¾ã  +2 ãŸãªã‹ +3 ã™ãšã +SELECT * FROM users +WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); +id åå‰ +2 ãŸãªã‹ +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +table_create users TABLE_HASH_KEY ShortText + +table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI + +column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result new file mode 100644 index 0000000000000..7822d118733a4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +SELECT COUNT(*) FROM ids; +COUNT(*) +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result new file mode 100644 index 0000000000000..141117f608a42 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result @@ -0,0 +1,30 @@ +CREATE TABLE diaries_innodb ( +id INT PRIMARY KEY AUTO_INCREMENT, +body TEXT, +flag TINYINT(2), +INDEX (flag) +) ENGINE = InnoDB DEFAULT CHARSET UTF8; +CREATE TABLE diaries_mroonga ( +id INT PRIMARY KEY AUTO_INCREMENT, +body TEXT, +flag TINYINT(2), +INDEX (flag) +) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; +INSERT INTO diaries_innodb (body) VALUES ("will start groonga!"); +INSERT INTO diaries_innodb (body) VALUES ("starting groonga..."); +INSERT INTO diaries_innodb (body) VALUES ("started groonga."); +INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!"); +INSERT INTO diaries_mroonga (body) VALUES ("starting groonga..."); +INSERT INTO diaries_mroonga (body) VALUES ("started groonga."); +EXPLAIN SELECT COUNT(*) FROM diaries_innodb; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE diaries_innodb NULL index NULL flag 2 NULL 3 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`diaries_innodb` +EXPLAIN SELECT COUNT(*) FROM diaries_mroonga; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE diaries_mroonga NULL index NULL flag 2 NULL 3 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`diaries_mroonga` +DROP TABLE diaries_innodb; +DROP TABLE diaries_mroonga; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result index a6d2f7862af64..1ebd0ba870ea5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result @@ -18,9 +18,9 @@ INSERT INTO diaries_mroonga (body) VALUES ("starting groonga..."); INSERT INTO diaries_mroonga (body) VALUES ("started groonga."); EXPLAIN SELECT COUNT(*) FROM diaries_innodb; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE diaries_innodb index NULL flag 2 NULL 3 Using index +1 SIMPLE diaries_innodb index NULL flag 2 NULL # Using index EXPLAIN SELECT COUNT(*) FROM diaries_mroonga; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE diaries_mroonga index NULL flag 2 NULL 3 Using index +1 SIMPLE diaries_mroonga index NULL flag 2 NULL # Using index DROP TABLE diaries_innodb; DROP TABLE diaries_mroonga; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result index ce1b5470231f7..3610ab6f55659 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result @@ -3,10 +3,12 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY ) DEFAULT CHARSET=utf8 COMMENT='Free style normal comment, engine "InnoDB"'; -SHOW CREATE TABLE bugs; -Table Create Table -bugs CREATE TABLE `bugs` ( - `id` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='Free style normal comment, engine "InnoDB"' +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") +table_create bugs TABLE_HASH_KEY ShortText + +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result index fb03bfe8d8d26..6ff4c105384e4 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result index 4a7107146cec1..9048b677a2fdb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'flags "NONE"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX memos +column_create memos#content index COLUMN_INDEX memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result index 6e00526c7364d..1c701d0eb8f7a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result @@ -12,5 +12,5 @@ memos CREATE TABLE `memos` ( ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result index 08bdd72ee039c..e378ba3b7ba97 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX memos +column_create memos#content index COLUMN_INDEX memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result index a5ac716d38e97..1367a3adbb903 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result @@ -5,5 +5,5 @@ FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); mroonga_command("dump --dump_plugins no --dump_schema no") -column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos +column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result new file mode 100644 index 0000000000000..5230963af7927 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT NOT NULL PRIMARY KEY, +content TEXT NOT NULL, +FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +SHOW CREATE TABLE memos; +Table Create Table +memos CREATE TABLE `memos` ( + `id` int(11) NOT NULL, + `content` text COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `content` (`content`) COMMENT 'normalizer "NormalizerAuto"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ENGINE "InnoDB"' +INSERT INTO memos VALUES (1, "1æ—¥ã®æ¶ˆè²»ãŒã¯ç´„2000㌔ãŒ"); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE); +id content +1 1æ—¥ã®æ¶ˆè²»ãŒã¯ç´„2000㌔㌠+DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result index 7ee07329f218b..4d9d20dc8abcd 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result @@ -5,15 +5,11 @@ body text, fulltext index body_index (body) comment 'parser "TokenBigramSplitSymbolAlphaDigit"' ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead insert into diaries (body) values ("will start Groonga!"); +Warnings: +Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); select * from diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result index e1e32dccc37de..7f4885fb0dafb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result @@ -11,7 +11,12 @@ SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") table_create memos TABLE_HASH_KEY ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result index 11ee04e299828..2d7c67489e65a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result @@ -11,7 +11,12 @@ SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") table_create memos TABLE_HASH_KEY ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result index f6d6be1b643c0..4626d1443f82c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result @@ -19,7 +19,12 @@ SELECT mroonga_command("dump --dump_plugins no"); mroonga_command("dump --dump_plugins no") table_create memos TABLE_HASH_KEY ShortText -table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord +table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord -column_create memos-content index COLUMN_INDEX|WITH_POSITION memos +table_create mroonga_operations TABLE_NO_KEY +column_create mroonga_operations record COLUMN_SCALAR UInt32 +column_create mroonga_operations table COLUMN_SCALAR ShortText +column_create mroonga_operations type COLUMN_SCALAR ShortText + +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result index f6e15804f4286..34e3f88dbadfb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result @@ -5,14 +5,6 @@ body text, fulltext index body_index (body) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result index ddec8fdadbe9b..219d8e08deb3a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result @@ -4,14 +4,6 @@ id int PRIMARY KEY AUTO_INCREMENT, body text, FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit' ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) `TOKENIZER`='TokenBigramSplitSymbolAlphaDigit' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); INSERT INTO diaries (body) VALUES ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result new file mode 100644 index 0000000000000..f7d5b439b6936 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result @@ -0,0 +1,13 @@ +CREATE TABLE logs ( +id INT PRIMARY KEY AUTO_INCREMENT, +message TEXT, +FULLTEXT INDEX (message) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +USE test; +DROP TABLE logs; +CREATE TABLE logs ( +id INT PRIMARY KEY AUTO_INCREMENT, +message TEXT, +FULLTEXT INDEX (message) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result index 08c37695f5a23..8614eaa73f83b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result @@ -6,15 +6,6 @@ title VARCHAR(255), content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET = UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result index b0bff284532c9..1ecf18cb13160 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result @@ -7,16 +7,6 @@ content TEXT, FULLTEXT INDEX (title), FULLTEXT INDEX (content) ) DEFAULT CHARSET = UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries VALUES(1, "富士山", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気 1月1日", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, "天気 4月4日", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result index fd07ea679646b..d3bdfca0def35 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result @@ -6,15 +6,6 @@ title varchar(255), content text, FULLTEXT INDEX (title) ) DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries VALUES (1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES (2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES (3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result index 7391ee4ba8dd2..c25b47c6bde3a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result @@ -6,7 +6,11 @@ insert into t1 values (2, "ka ki ku ke ko"); insert into t1 values (3, "aa ii ii ii oo"); insert into t1 values (4, "sa si su se so"); insert into t1 values (5, "ta ti ii ii to"); -insert into t2 (c1,c2) select c1,c2 from t1; +insert into t2 values (1, "aa ii uu ee oo"); +insert into t2 values (2, "ka ki ku ke ko"); +insert into t2 values (3, "aa ii ii ii oo"); +insert into t2 values (4, "sa si su se so"); +insert into t2 values (5, "ta ti ii ii to"); select * from t1; c1 c2 1 aa ii uu ee oo diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result index 8e1b0845e8506..f4719cbdd95f8 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result @@ -1,13 +1,5 @@ drop table if exists t1, t2, t3; create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) COMMENT = 'engine "innodb"'; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` text, - PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result index 03cf96b55f845..9d1e838b8933a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result @@ -5,14 +5,6 @@ id int primary key, title varchar(255), fulltext index (title) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' set autocommit=0; insert into diaries values(0, "2011-07-14"); insert into diaries values(1, "2011-07-15"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result index 81ce556e74574..39ab80edf3bfe 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result @@ -10,15 +10,18 @@ FULLTEXT KEY (not_matched) INSERT INTO texts VALUES (1, 'Hello1', 'World1'); INSERT INTO texts VALUES (2, 'Hello2', 'World2'); INSERT INTO texts VALUES (3, 'Hello3', 'World3'); -SELECT id, +SELECT * +FROM (SELECT id, matched, not_matched, MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE), MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE) FROM texts -WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE); +WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE)) +AS searched_texts +ORDER BY id; id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE) 1 Hello1 World1 1 0 -3 Hello3 World3 1 0 2 Hello2 World2 1 0 +3 Hello3 World3 1 0 DROP TABLE texts; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result index 64acf4aaeae8e..fbdf241b81e75 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result index c1661d7fcbfb8..074d199150563 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result index 604aca172a574..756a702171a79 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result index 6f489bf37cc50..db869eaa697b8 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result @@ -8,17 +8,6 @@ fulltext index (title, content), fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title` (`title`,`content`), - FULLTEXT KEY `title_2` (`title`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result index d9448ee82bafe..7121e5109d39a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result @@ -6,16 +6,6 @@ body text, fulltext index title_index (title), fulltext index body_index (body) ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries (title, body) values ("survey", "will start groonga!"); insert into diaries (title, body) values ("groonga (1)", "starting groonga..."); insert into diaries (title, body) values ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result index 860c8e548a8ab..90376bdf156ad 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result @@ -1,13 +1,5 @@ drop table if exists t1, t2, t3; create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) COMMENT = 'engine "myisam"'; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` text, - PRIMARY KEY (`c1`), - FULLTEXT KEY `ft` (`c2`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "myisam"' insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result index 74d7426ebc15c..f79798cec6de0 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result @@ -1,23 +1,13 @@ DROP TABLE IF EXISTS diaries; SET NAMES UTF8; CREATE TABLE ft( -a INT, +a INT DEFAULT 0, b TEXT, c TEXT, PRIMARY KEY(a), FULLTEXT KEY ftx1(b), FULLTEXT KEY ftx2(c) )ENGINE=Mroonga DEFAULT CHARSET=UTF8 COMMENT = 'engine "innodb"'; -SHOW CREATE TABLE ft; -Table Create Table -ft CREATE TABLE `ft` ( - `a` int(11) NOT NULL, - `b` text, - `c` text, - PRIMARY KEY (`a`), - FULLTEXT KEY `ftx1` (`b`), - FULLTEXT KEY `ftx2` (`c`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' INSERT INTO ft VALUES(1,'aaaaa','abcde'); INSERT INTO ft VALUES(2,'bbbbb','bcdef'); INSERT INTO ft VALUES(3,'ccccc','cdefg'); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result index 3da64b2de1f73..3ee15c63bfd70 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result @@ -6,16 +6,6 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' START TRANSACTION; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result index b3f5bee27d77a..550554eac8ca3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result @@ -5,15 +5,6 @@ name text, location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; -Table Create Table -shops CREATE TABLE `shops` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - `location` geometry NOT NULL, - PRIMARY KEY (`id`), - SPATIAL KEY `location_index` (`location`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('nezu-no-taiyaki', ST_GeomFromText('POINT(139.762573 35.720253)')); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result index 28b981f9c7b13..615d185f79f0e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result @@ -5,15 +5,6 @@ name text, location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; -Table Create Table -shops CREATE TABLE `shops` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - `location` geometry NOT NULL, - PRIMARY KEY (`id`), - SPATIAL KEY `location_index` (`location`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('sazare', ST_GeomFromText('POINT(139.685043 35.714653)')); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result index 20de4a32cfaf2..adfb53e10a202 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result @@ -5,15 +5,6 @@ name text, location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; -Table Create Table -shops CREATE TABLE `shops` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` text, - `location` geometry NOT NULL, - PRIMARY KEY (`id`), - SPATIAL KEY `location_index` (`location`) -) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('sazare', ST_GeomFromText('POINT(139.685043 35.714653)')); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result index be61419477f18..552cf58682b20 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result @@ -5,14 +5,6 @@ id int primary key, content text, fulltext index (content) ) default charset utf8 comment = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL, - `content` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' LOCK TABLE diaries WRITE; insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result new file mode 100644 index 0000000000000..bf1e67b9378d3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS integers; +SET optimizer_switch='mrr_cost_based=off'; +CREATE TABLE integers ( +id INT PRIMARY KEY AUTO_INCREMENT, +value INT, +KEY (value) +) COMMENT='engine "InnoDB"'; +INSERT INTO integers (value) VALUES (0), (1), (2), (3); +EXPLAIN SELECT * FROM integers +WHERE value IN (0, 2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE integers NULL range value value 5 NULL 2 100.00 Using where; Using MRR +Warnings: +Note 1003 /* select#1 */ select `test`.`integers`.`id` AS `id`,`test`.`integers`.`value` AS `value` from `test`.`integers` where (`test`.`integers`.`value` in (0,2)) +SELECT * FROM integers +WHERE value IN (0, 2); +id value +1 0 +3 2 +DROP TABLE integers; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result index e330fa18c894a..8258a03bf42c1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result @@ -6,15 +6,6 @@ title TEXT, body TEXT, FULLTEXT INDEX body_index (body) ) COMMENT = 'engine "innodb"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result index a5012384889c9..cca7aee95de8a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result @@ -6,15 +6,6 @@ title TEXT, body TEXT, FULLTEXT INDEX body_index (body) ) COMMENT = 'engine "innodb"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); @@ -23,7 +14,7 @@ id title body 2 groonga (1) starting groonga... FLUSH TABLES; SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); -ERROR HY000: syscall error 'repair_test.mrn.0000106' (No such file or directory) +ERROR HY000: system call error: No such file or directory: failed to open path: REPAIR TABLE diaries; Table Op Msg_type Msg_text repair_test.diaries repair status OK diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result index b01e85aa483f9..d66b463d7ed37 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result @@ -3,13 +3,6 @@ CREATE TEMPORARY TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET=UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TEMPORARY TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - PRIMARY KEY (`id`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title) VALUES ("clear day"); INSERT INTO diaries (title) VALUES ("rainy day"); INSERT INTO diaries (title) VALUES ("cloudy day"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result index 11cc1874257ad..9082032ff6e9e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result @@ -6,16 +6,6 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result index 7dde8518db008..0a424e77806d5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result @@ -6,16 +6,6 @@ body TEXT, FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `title_index` (`title`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result index d41231ddd3329..296f87ade66cb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result @@ -10,19 +10,6 @@ content TEXT, FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8 COMMENT = 'engine "innodb"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `year` int(10) unsigned DEFAULT NULL, - `month` int(10) unsigned DEFAULT NULL, - `day` int(10) unsigned DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `content` text, - PRIMARY KEY (`id`), - KEY `day` (`day`), - FULLTEXT KEY `content` (`content`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気ãŒã‚ˆãã¦ãã‚Œã„ã«è¦‹ãˆã‚‹ã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result index e451b2b99fe42..ccc28a0f4c715 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries (body) values ("will start groonga!"); insert into diaries (body) values ("starting groonga..."); insert into diaries (body) values ("started groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result index f11398f3710d9..a9bdd38fa222a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries (body) values ("will start groonga!"); select * from diaries; id body diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result index 47a844c8e6867..b2fe4607f8f90 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result @@ -4,14 +4,6 @@ id int primary key auto_increment, body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `body_index` (`body`) -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "innodb"' insert into diaries (body) values ("will start groonga!"); set mroonga_dry_write=true; update diaries set body = "starting groonga..." where id = 1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result index c98847cb50a8c..9405879f4f54a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result @@ -3,17 +3,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, -FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' +FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result index 3d94ebc93ad2d..fa2da48cc713e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result @@ -3,17 +3,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, -FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' +FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; -Table Create Table -diaries CREATE TABLE `diaries` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` text, - `tags` text, - PRIMARY KEY (`id`), - FULLTEXT KEY `tags_index` (`tags`) COMMENT 'parser "TokenDelimit"' -) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm b/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm index 7e4f8c1776b96..528ccc5d69360 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm +++ b/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm @@ -5,7 +5,7 @@ package My::Suite::Mroonga; return "No Mroonga engine" unless $ENV{HA_MROONGA_SO} or $::mysqld_variables{'mroonga'} eq "ON"; -sub is_default { not $::opt_embedded_server } +sub is_default { 1 } my $groonga_normalizer_mysql_dir=$::basedir . '/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql'; my $groonga_normalizer_mysql_install_dir=$::basedir . '/lib/groonga/plugins'; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test index bb4d538990901..a6d25d3f43826 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -26,7 +26,6 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; @@ -39,8 +38,6 @@ INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga..."); INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); SELECT * FROM diaries; -SHOW CREATE TABLE diaries; - DROP TABLE diaries; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test new file mode 100644 index 0000000000000..49f65449a4d7f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test @@ -0,0 +1,54 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES cp932; + +CREATE TABLE users ( + id int unsigned PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"'; +ALTER TABLE users + ADD COLUMN –¼‘O text, + ADD FULLTEXT INDEX (–¼‘O); + +INSERT INTO users (–¼‘O) VALUES ("‚â‚Ü‚¾"); +INSERT INTO users (–¼‘O) VALUES ("‚½‚È‚©"); +INSERT INTO users (–¼‘O) VALUES ("‚·‚¸‚«"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test new file mode 100644 index 0000000000000..bd5c7389bedf0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test @@ -0,0 +1,54 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE users ( + id int unsigned PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"'; +ALTER TABLE users + ADD COLUMN åå‰ text, + ADD FULLTEXT INDEX (åå‰); + +INSERT INTO users (åå‰) VALUES ("ã‚„ã¾ã "); +INSERT INTO users (åå‰) VALUES ("ãŸãªã‹"); +INSERT INTO users (åå‰) VALUES ("ã™ãšã"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test index a1d5c28baf1df..dc98dc9c531dc 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test index e1b657b7ee817..d466b4466f1cb 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -29,7 +29,9 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) ENGINE MyISAM DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; +SELECT table_name, engine, table_comment + FROM information_schema.tables + WHERE table_name = 'diaries'; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); @@ -38,7 +40,9 @@ SELECT * FROM diaries MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); ALTER TABLE diaries ENGINE = mroonga COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; +SELECT table_name, engine, table_comment + FROM information_schema.tables + WHERE table_name = 'diaries'; SELECT * FROM diaries WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test index 645d3dad7b3c8..ff2b6b47ef1bf 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,14 +28,15 @@ CREATE TABLE memos ( content TEXT, FULLTEXT INDEX(content) ) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; -SHOW CREATE TABLE memos; INSERT INTO memos (title, content) VALUES ("Hello", "I start to write memos!"); INSERT INTO memos (title, content) VALUES ("groonga", "I start to use groonga!"); INSERT INTO memos (title, content) VALUES ("mroonga", "I use mroonga too!"); ALTER TABLE memos COMMENT='engine "MyISAM"'; -SHOW CREATE TABLE memos; +SELECT table_name, table_comment + FROM information_schema.tables + WHERE table_name = 'memos'; SELECT * FROM memos; SELECT * FROM memos WHERE MATCH(content) AGAINST("start" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test index 68bf5c9bbe9cb..13344843ebeea 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test index 0cd02e1812ab5..7bfd5fe507091 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test index 217df7a1edb8e..f05945e1b761c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test index ea3ef4f14842e..f272698c1a836 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test index 107f4a9a7553d..e1de36d25d1f7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test index 3c63d4a149683..2c994bdcc7699 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test index cc4b79ebf3922..01fce22c3f0cf 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -27,13 +27,11 @@ CREATE TABLE diaries ( title TEXT, body TEXT ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; ALTER TABLE diaries DROP COLUMN body; -SHOW CREATE TABLE diaries; SELECT * FROM diaries; INSERT INTO diaries (title) values ("groonga (1)"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test index e92a2e5c7f72d..bc451c354b199 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test index f5f7e307d5dd3..66ee293bff11f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test index 587102c3db4ff..f364ba3d70693 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test index 2f28eef1574d6..7b72b113c790f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test index aaff5f90b7400..25cdc13ac3599 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test index 62e56899aad83..671b961723194 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( title TEXT, FULLTEXT INDEX title_index (title) ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title) VALUES ("survey"); SELECT * FROM diaries; @@ -50,8 +49,6 @@ SELECT * FROM diaries WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); -SHOW CREATE TABLE diaries; - DROP TABLE diaries; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test index c84e86594ca0a..288e5cdc0de61 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc @@ -29,7 +29,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); SELECT * FROM diaries; @@ -43,8 +42,6 @@ SELECT * FROM memos WHERE MATCH(title) AGAINST("groonga") AND MATCH(body) AGAINST("starting"); -SHOW CREATE TABLE memos; - DROP TABLE memos; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test index 34c8bc02a1d4e..bcc043485a023 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test @@ -12,12 +12,12 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -144,8 +144,6 @@ ALTER TABLE shops ADD SPATIAL KEY location_index (location); SELECT id, name, ST_AsText(location) AS location_text FROM shops WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); -SHOW CREATE TABLE shops; - DROP TABLE shops; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test index b4ebd69a5e9ef..57af6f121cc86 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test index 224bdfa07c6f3..1c120f364577f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_log_bin.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test new file mode 100644 index 0000000000000..c6d4a92469164 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE memos ( + id int NOT NULL PRIMARY KEY, + content text, + FULLTEXT INDEX (content) +) COMMENT='engine "InnoDB"'; + +INSERT INTO memos VALUES (1, 'Hello MySQL'); +INSERT INTO memos VALUES (2, 'Hello Mroonga'); + +CHECK TABLE memos FOR UPGRADE; + +FLUSH TABLES; + +SELECT * FROM memos + WHERE MATCH(content) AGAINST('+mroonga' IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test index 2adbae8afd85e..de195a5b9817b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test new file mode 100644 index 0000000000000..e10ecfe9b56ae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); + +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED; +ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'; + +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test new file mode 100644 index 0000000000000..784f419e24c82 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +DELETE FROM logs WHERE id = 1; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test new file mode 100644 index 0000000000000..de2e40680df42 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DROP COLUMN message; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test new file mode 100644 index 0000000000000..a8fcf191e0818 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test @@ -0,0 +1,41 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test new file mode 100644 index 0000000000000..db4f0ed44603e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DISABLE KEYS; +ALTER TABLE logs ENABLE KEYS; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test new file mode 100644 index 0000000000000..a59e5b6c4f104 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test @@ -0,0 +1,43 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, + FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; + +SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test new file mode 100644 index 0000000000000..502fb1502ff6e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); + +ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL; + +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test new file mode 100644 index 0000000000000..5103a91e909cc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test @@ -0,0 +1,46 @@ +# Copyright(C) 2017 Naoya Murakami +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mariadb_10_2_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) + VALUES (1, '{"level": "info", "message": "start server"}'); + +ALTER TABLE logs ADD FULLTEXT INDEX (message); + +INSERT INTO logs(id, record) + VALUES (2, '{"level": "info", "message": "start server"}'); +INSERT INTO logs(id, record) + VALUES (3, '{"level": "warn", "message": "abort server"}'); + +SELECT * FROM logs WHERE MATCH(message) AGAINST('+start' IN BOOLEAN MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test new file mode 100644 index 0000000000000..3b3b67c9747bf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test @@ -0,0 +1,47 @@ +# Copyright(C) 2017 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + level VARCHAR(255) GENERATED ALWAYS AS + (json_unquote(json_extract(`record`, '$.level'))) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) + VALUES (1, '{"level": "info", "message": "start server"}'); + +ALTER TABLE logs ADD INDEX (level); + +INSERT INTO logs(id, record) + VALUES (2, '{"level": "info", "message": "start server"}'); +INSERT INTO logs(id, record) + VALUES (3, '{"level": "warn", "message": "abort server"}'); + +SELECT * FROM logs WHERE level = 'info'; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test new file mode 100644 index 0000000000000..73848a3f2cb42 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +DELETE FROM logs WHERE id = 1; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test new file mode 100644 index 0000000000000..cd5a9cb404b76 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +ALTER TABLE logs DROP COLUMN message; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test new file mode 100644 index 0000000000000..a5180a973d51a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test new file mode 100644 index 0000000000000..c266ffe6ec5ac --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test @@ -0,0 +1,42 @@ +# Copyright(C) 2017 Naoya Murakami +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_version_5_7_or_later.inc +--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +CREATE TABLE logs ( + id INT PRIMARY KEY, + record JSON, + message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL +) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}'); +INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}'); +INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}'); + +UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2; + +SELECT * FROM logs; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test new file mode 100644 index 0000000000000..cea67376fa6d4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test @@ -0,0 +1,53 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES cp932; + +CREATE TABLE users ( + id int unsigned PRIMARY KEY AUTO_INCREMENT, + –¼‘O text, + FULLTEXT INDEX (–¼‘O) +) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"'; + +INSERT INTO users (–¼‘O) VALUES ("‚â‚Ü‚¾"); +INSERT INTO users (–¼‘O) VALUES ("‚½‚È‚©"); +INSERT INTO users (–¼‘O) VALUES ("‚·‚¸‚«"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (–¼‘O) AGAINST ('+‚½‚È‚©' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test new file mode 100644 index 0000000000000..f1e0f39411fe5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test @@ -0,0 +1,53 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE users ( + id int unsigned PRIMARY KEY AUTO_INCREMENT, + åå‰ text, + FULLTEXT INDEX (åå‰) +) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"'; + +INSERT INTO users (åå‰) VALUES ("ã‚„ã¾ã "); +INSERT INTO users (åå‰) VALUES ("ãŸãªã‹"); +INSERT INTO users (åå‰) VALUES ("ã™ãšã"); + +SELECT * FROM users; + +SELECT * FROM users + WHERE MATCH (åå‰) AGAINST ('+ãŸãªã‹' IN BOOLEAN MODE); + +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); + +DROP TABLE users; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test index 2e9674c860e69..ba5786d05ab2e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test new file mode 100644 index 0000000000000..b557a96518aa7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test @@ -0,0 +1,36 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id int PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); + +SELECT COUNT(*) FROM ids; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test new file mode 100644 index 0000000000000..b329d9a5ff61f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test @@ -0,0 +1,55 @@ +# Copyright(C) 2011-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +CREATE TABLE diaries_innodb ( + id INT PRIMARY KEY AUTO_INCREMENT, + body TEXT, + flag TINYINT(2), + INDEX (flag) +) ENGINE = InnoDB DEFAULT CHARSET UTF8; + +CREATE TABLE diaries_mroonga ( + id INT PRIMARY KEY AUTO_INCREMENT, + body TEXT, + flag TINYINT(2), + INDEX (flag) +) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; + +INSERT INTO diaries_innodb (body) VALUES ("will start groonga!"); +INSERT INTO diaries_innodb (body) VALUES ("starting groonga..."); +INSERT INTO diaries_innodb (body) VALUES ("started groonga."); + +INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!"); +INSERT INTO diaries_mroonga (body) VALUES ("starting groonga..."); +INSERT INTO diaries_mroonga (body) VALUES ("started groonga."); + +EXPLAIN SELECT COUNT(*) FROM diaries_innodb; +EXPLAIN SELECT COUNT(*) FROM diaries_mroonga; + +DROP TABLE diaries_innodb; +DROP TABLE diaries_mroonga; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test index 6fd0ff1971c3a..0a3a5c818650c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test @@ -1,4 +1,4 @@ -# Copyright(C) 2011-2015 Kouhei Sutou +# Copyright(C) 2011-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -12,9 +12,10 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_query_log @@ -45,7 +46,9 @@ INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!"); INSERT INTO diaries_mroonga (body) VALUES ("starting groonga..."); INSERT INTO diaries_mroonga (body) VALUES ("started groonga."); +-- replace_column 9 # EXPLAIN SELECT COUNT(*) FROM diaries_innodb; +-- replace_column 9 # EXPLAIN SELECT COUNT(*) FROM diaries_mroonga; DROP TABLE diaries_innodb; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test index 4eab593cfe77d..1c0d445013c28 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -65,6 +65,8 @@ create table t1 (c1 time primary key) COMMENT = 'engine "innodb"'; desc t1; drop table t1; create table t1 (c1 timestamp primary key) COMMENT = 'engine "innodb"'; +# For MariaDB 10.2.3 +-- replace_result current_timestamp() CURRENT_TIMESTAMP desc t1; drop table t1; create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test index f2d4cf80e3ab5..eaad5ed47cfc7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,7 @@ CREATE TABLE bugs ( ) DEFAULT CHARSET=utf8 COMMENT='Free style normal comment, engine "InnoDB"'; -SHOW CREATE TABLE bugs; +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test index aa6b1f01f1042..6daa5acfd0f65 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test index d116aa6cd34cc..22d28e941fd45 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test index 3c6bb52d143ce..c3b689580f6d8 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/have_innodb.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test index b433e54e8859c..06cb7658c21c8 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test index 47cededee5529..84dc9d8526a76 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test index 0d26c751c2278..8846821cfc18c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test new file mode 100644 index 0000000000000..5454b17631349 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test @@ -0,0 +1,40 @@ +# Copyright(C) 2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE memos ( + id INT NOT NULL PRIMARY KEY, + content TEXT NOT NULL, + FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +SHOW CREATE TABLE memos; + +INSERT INTO memos VALUES (1, "1æ—¥ã®æ¶ˆè²»ãŒã¯ç´„2000㌔ãŒ"); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test index 141d15c3c459a..287d594b7f54c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/have_innodb.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test index 151d15a9870b2..54d63fbe49c9a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test @@ -12,8 +12,9 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--source include/not_embedded.inc --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +28,6 @@ create table diaries ( fulltext index body_index (body) comment 'parser "TokenBigramSplitSymbolAlphaDigit"' ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test index d5487a3b82868..c79744993e9bf 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test index 0d863c9f99f90..80bb5cf8701f2 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test index 0532c19dbde75..99343ec60cffd 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/have_innodb.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test index 0a55dd6ae6976..e3e6d671ac6d7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ create table diaries ( fulltext index body_index (body) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; insert into diaries (body) values ("will start Groonga!"); insert into diaries (body) values ("starting Groonga..."); insert into diaries (body) values ("started Groonga."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test index a2087ca8a9f64..3eadb51a73ad3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mariadb.inc --source include/have_innodb.inc @@ -27,7 +27,6 @@ CREATE TABLE diaries ( body text, FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit' ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET utf8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (body) VALUES ("will start Groonga!"); INSERT INTO diaries (body) VALUES ("starting Groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test index dae9bf033ca8d..b06a60671440c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test index b25fc596813fc..ca33da8c30972 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test new file mode 100644 index 0000000000000..c0f492d1920ad --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test @@ -0,0 +1,46 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source include/not_embedded.inc +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +CREATE TABLE logs ( + id INT PRIMARY KEY AUTO_INCREMENT, + message TEXT, + FULLTEXT INDEX (message) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +disable_query_log; +CONNECT(drop_connection, localhost, root); +enable_query_log; + +USE test; +DROP TABLE logs; + +disable_query_log; +CONNECTION default; +enable_query_log; + +CREATE TABLE logs ( + id INT PRIMARY KEY AUTO_INCREMENT, + message TEXT, + FULLTEXT INDEX (message) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test index d835a20746c61..0234f831fb13b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( content TEXT, FULLTEXT INDEX (content) ) DEFAULT CHARSET = UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test index 9882883e597d8..73de4d5e70e38 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX (title), FULLTEXT INDEX (content) ) DEFAULT CHARSET = UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, "富士山", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, "天気 1月1日", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test index 1e57b56d6b00e..14fba8d22754c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test index 3fdad5365fee2..9cfd841b753bd 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test index 53251eb2af70e..b28caa87e2fd1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test index f46f732203be4..1dfdc49695b11 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test index 8f8130b7b45f2..66f7aaf880e4b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test index 6fa65d395eeb5..54278e9768142 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test index 9d7f887c98dee..459fd91355289 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test index 7feca394fa5bc..3245501d6b731 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test index ade88c9c60dee..0e69941134e4f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test index ecc1e0d0bad5b..3191ff6c44c7f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test index 384b951f5628a..90216c0a438e3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test index f259fc8538803..4a5512791a13f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test index 4cec44d01a24b..27af7f5d8801b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test index 169069fb67d07..912b3c9eec177 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_cp932.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test index cda39ce2ad63f..56309998b426f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_eucjpms.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test index 93e78d6b46d86..589b4d79dcf76 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test index 27af190ed7a20..6b07647625d5f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( content text, FULLTEXT INDEX (title) ) DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES (1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES (2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test index 083384b04d17b..d4364af2da780 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -29,7 +29,11 @@ insert into t1 values (2, "ka ki ku ke ko"); insert into t1 values (3, "aa ii ii ii oo"); insert into t1 values (4, "sa si su se so"); insert into t1 values (5, "ta ti ii ii to"); -insert into t2 (c1,c2) select c1,c2 from t1; +insert into t2 values (1, "aa ii uu ee oo"); +insert into t2 values (2, "ka ki ku ke ko"); +insert into t2 values (3, "aa ii ii ii oo"); +insert into t2 values (4, "sa si su se so"); +insert into t2 values (5, "ta ti ii ii to"); select * from t1; select * from t2; select * from t1 where c1=3; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test index f4b76888b76a2..ea76dd055dbac 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,7 +23,6 @@ drop table if exists t1, t2, t3; --enable_warnings create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) COMMENT = 'engine "innodb"'; -show create table t1; insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test index 0775041634217..38e1770026952 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ create table diaries ( title varchar(255), fulltext index (title) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; set autocommit=0; insert into diaries values(0, "2011-07-14"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test index 52700ad01fe1c..61ef72370f046 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test index b362acd4565fd..1cc2f6c297af3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -35,13 +35,16 @@ INSERT INTO texts VALUES (1, 'Hello1', 'World1'); INSERT INTO texts VALUES (2, 'Hello2', 'World2'); INSERT INTO texts VALUES (3, 'Hello3', 'World3'); -SELECT id, - matched, - not_matched, - MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE), - MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE) - FROM texts - WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE); +SELECT * + FROM (SELECT id, + matched, + not_matched, + MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE), + MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE) + FROM texts + WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE)) + AS searched_texts + ORDER BY id; DROP TABLE texts; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test index fa8fb79634d79..673ed5619d9b3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test index d6defc1fca2f0..2d2ffe7b01484 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test index ebf5c37ad9412..81047e78302c2 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test index 8ae0dd8892ba3..037784e42511e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test index a6c12aa1714fa..72662d7809398 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -30,7 +30,6 @@ create table diaries ( fulltext index (title), fulltext index (content) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries values(1, "Hello", "ã¯ã˜ã‚ã¾ã—ãŸã€‚"); insert into diaries values(2, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); insert into diaries values(3, "富士山", "今日もãã‚Œã„。"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test index 58c0ea3faf70d..8ecb8eeec65cf 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ create table diaries ( fulltext index title_index (title), fulltext index body_index (body) ) comment = 'engine "innodb"' default charset utf8; -show create table diaries; insert into diaries (title, body) values ("survey", "will start groonga!"); insert into diaries (title, body) values ("groonga (1)", "starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test index 305f51d4a0247..818624392a4e9 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -22,7 +22,6 @@ drop table if exists t1, t2, t3; --enable_warnings create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) COMMENT = 'engine "myisam"'; -show create table t1; insert into t1 values (1, "hoge hoge"); insert into t1 values (2, "fuga fuga"); insert into t1 values (3, "moge moge"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test index 7fcffefd23440..d65fdefd647fc 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test index cba565b02539b..55813bd3fdcc5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -23,14 +23,13 @@ DROP TABLE IF EXISTS diaries; SET NAMES UTF8; CREATE TABLE ft( - a INT, + a INT DEFAULT 0, b TEXT, c TEXT, PRIMARY KEY(a), FULLTEXT KEY ftx1(b), FULLTEXT KEY ftx2(c) )ENGINE=Mroonga DEFAULT CHARSET=UTF8 COMMENT = 'engine "innodb"'; -SHOW CREATE TABLE ft; INSERT INTO ft VALUES(1,'aaaaa','abcde'); INSERT INTO ft VALUES(2,'bbbbb','bcdef'); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test index 825cf36154672..bcab5307e18b7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET=UTF8; -SHOW CREATE TABLE diaries; START TRANSACTION; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); @@ -39,22 +38,32 @@ SELECT * FROM diaries WHERE MATCH(body) AGAINST("groonga") ORDER BY id; +disable_query_log; CONNECT(search_connection, localhost, root); +enable_query_log; USE test; SELECT * FROM diaries WHERE MATCH(body) AGAINST("groonga") ORDER BY id; +disable_query_log; CONNECTION default; +enable_query_log; COMMIT; +disable_query_log; CONNECTION search_connection; +enable_query_log; SELECT * FROM diaries WHERE MATCH(body) AGAINST("groonga") ORDER BY id; +disable_query_log; DISCONNECT search_connection; +enable_query_log; +disable_query_log; CONNECTION default; +enable_query_log; SELECT * FROM diaries WHERE MATCH(body) AGAINST("groonga") ORDER BY id; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test index 2cfd00b2172ee..f08337af9d1b6 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test index b5f7dd80c31b7..d1be7ae64da19 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test index 88fa88427cf7e..8c669052d2ecd 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -29,7 +29,6 @@ create table shops ( location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; insert into shops (name, location) values ('nezu-no-taiyaki', ST_GeomFromText('POINT(139.762573 35.720253)')); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test index 655a8416725f2..3a4d399beec21 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -29,7 +29,6 @@ create table shops ( location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; insert into shops (name, location) values ('sazare', diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test index 6a73495815895..db7aa344e0af3 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test @@ -12,11 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/have_geometry.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -29,7 +29,6 @@ create table shops ( location geometry NOT NULL, spatial key location_index (location) ) comment = 'engine "innodb"'; -show create table shops; insert into shops (name, location) values ('sazare', diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test index b7a4dd4c36bbc..1c73f30b60c47 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test index 87947f1ea6c71..021d3f8e95d5e 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test index a5edb8bae4a9b..b21dcc5b89388 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -27,7 +27,6 @@ create table diaries ( content text, fulltext index (content) ) default charset utf8 comment = 'engine "innodb"'; -show create table diaries; LOCK TABLE diaries WRITE; insert into diaries values(1, "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test index d16527644e3cd..3006bac6d21b5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -26,6 +26,8 @@ CREATE TABLE diaries ( content TEXT NOT NULL, PRIMARY KEY (date, title) ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +# For MariaDB 10.2.3 +-- replace_result current_timestamp() CURRENT_TIMESTAMP SHOW CREATE TABLE diaries; INSERT INTO diaries (date, title, content) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test index d97823f77a2b9..ae993b76b09d5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mroonga.inc @@ -27,6 +27,8 @@ CREATE TABLE diaries ( content TEXT NOT NULL, UNIQUE INDEX (date, title) ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +# For MariaDB 10.2.3 +-- replace_result current_timestamp() CURRENT_TIMESTAMP SHOW CREATE TABLE diaries; INSERT INTO diaries (date, title, content) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test index dbe11f03bec29..ce9cf85e7dc13 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test @@ -1,5 +1,5 @@ # Copyright(C) 2013 Kenji Maruyama -# Copyright(C) 2013 Kouhei Sutou +# Copyright(C) 2013-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -13,10 +13,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source ../../include/mroonga/have_mysql.inc ---source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_version_5_6_or_later.inc +--source ../../include/mroonga/skip_mysql_5_7_or_later.inc --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test new file mode 100644 index 0000000000000..fb6529ef782cd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 Kenji Maruyama +# Copyright(C) 2013-2016 Kouhei Sutou +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +--source ../../include/mroonga/have_mysql_5_7_or_later.inc +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS integers; +--enable_warnings + +SET optimizer_switch='mrr_cost_based=off'; + +CREATE TABLE integers ( + id INT PRIMARY KEY AUTO_INCREMENT, + value INT, + KEY (value) +) COMMENT='engine "InnoDB"'; + +INSERT INTO integers (value) VALUES (0), (1), (2), (3); + +EXPLAIN SELECT * FROM integers + WHERE value IN (0, 2); + +SELECT * FROM integers + WHERE value IN (0, 2); + +DROP TABLE integers; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test index 078e0b6e28ef3..9aeeef0e8421b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test index 07a497d78713f..4a2338714e413 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test index a74db4417b2c1..8b8e4754dc29f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test index 25a02398a669e..f1b6ad62c88a6 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test index 7d663bef626f8..5ea33c4e150ce 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test index d11a3efe90060..31b4371226136 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test @@ -12,10 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc +--source ../../include/mroonga/skip_solaris.inc --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_mroonga_helper.inc @@ -28,7 +29,6 @@ CREATE TABLE diaries ( body TEXT, FULLTEXT INDEX body_index (body) ) COMMENT = 'engine "innodb"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); @@ -36,13 +36,7 @@ INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); ---remove_file $MYSQLD_DATADIR/repair_test.mrn ---remove_file $MYSQLD_DATADIR/repair_test.mrn.001 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000000 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000105 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000106 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000107 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000107.c +--remove_files_wildcard $MYSQLD_DATADIR repair_test.mrn* FLUSH TABLES; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test index 6d09479e55440..f2b1f63a8e034 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test @@ -12,10 +12,11 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source include/not_embedded.inc +--source ../../include/mroonga/skip_solaris.inc --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_mroonga_helper.inc @@ -28,7 +29,6 @@ CREATE TABLE diaries ( body TEXT, FULLTEXT INDEX body_index (body) ) COMMENT = 'engine "innodb"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); @@ -36,14 +36,11 @@ INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000106 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.000010A FLUSH TABLES; -# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn.0000104' (No such file or directory) -# The (Error 0)[0]" replaces is for Solaris -# ---replace_result "(Error 0)[0]" "(No such file or directory)" +# Error ER_CANT_OPEN_FILE system call error: No such file or directory: failed to open path: --error ER_CANT_OPEN_FILE SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test index 7d98ca0bfa753..143270dcf202f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/skip_osx.inc @@ -27,7 +27,6 @@ CREATE TEMPORARY TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT ) DEFAULT CHARSET=UTF8 COMMENT = 'ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title) VALUES ("clear day"); INSERT INTO diaries (title) VALUES ("rainy day"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test index 9055715486b0a..7c848641626d5 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -31,22 +31,32 @@ SHOW CREATE TABLE simple_table; INSERT INTO simple_table (id) VALUES (1),(2); +disable_query_log; CONNECT(second_connection, localhost, root); +enable_query_log; USE test; START TRANSACTION; INSERT INTO simple_table (id) VALUES (3); +disable_query_log; CONNECTION default; +enable_query_log; SELECT * FROM simple_table; +disable_query_log; CONNECTION second_connection; +enable_query_log; COMMIT; +disable_query_log; CONNECTION default; +enable_query_log; SELECT * FROM simple_table; DROP TABLE simple_table; +disable_query_log; DISCONNECT second_connection; +enable_query_log; SET GLOBAL query_cache_size = @tmp_query_cache_size; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test index dd08d93cd47e2..f11ca4a98393d 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test index ae9099a7ab9c2..36bc09be73bfd 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -28,7 +28,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX title_index (title), FULLTEXT INDEX body_index (body) ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test index 1920237fdadc6..b021b26b5e375 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -32,7 +32,6 @@ CREATE TABLE diaries ( FULLTEXT INDEX(content), KEY(day) ) DEFAULT CHARSET UTF8 COMMENT = 'engine "innodb"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries VALUES(1, 2011, 11, 9, "Hello", "今日ã‹ã‚‰ã¯ã˜ã‚ã¾ã—ãŸã€‚"); INSERT INTO diaries VALUES(2, 2011, 11, 10, "天気", "明日ã®å¯Œå£«å±±ã®å¤©æ°—ã«ã¤ã„ã¦"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test index 7afeee05ffdee..9052c434c317c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test index db1e2da9a181d..ffa26994efea1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test @@ -13,7 +13,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test index 2757c94b4c5ed..c6f2a2a14da5c 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries (body) values ("will start groonga!"); insert into diaries (body) values ("starting groonga..."); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test index 5e9585282758e..b80f60fcba553 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries (body) values ("will start groonga!"); select * from diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test index 8e9a9e3308ada..ab75babfbac94 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -26,7 +26,6 @@ create table diaries ( body text, fulltext index body_index (body) ) default charset utf8 COMMENT = 'engine "innodb"'; -show create table diaries; insert into diaries (body) values ("will start groonga!"); diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test index ead26bca2c14e..71d44ab57043f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -25,9 +25,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, - FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' + FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); @@ -41,11 +40,17 @@ SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); SET GLOBAL mroonga_match_escalation_threshold = -1; --enable_warnings +disable_query_log; CONNECT(search_connection, localhost, root); +enable_query_log; USE test; + SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); + +disable_query_log; DISCONNECT search_connection; CONNECTION default; +enable_query_log; SET GLOBAL mroonga_match_escalation_threshold = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test index 5f5ae169890a2..91196faf6121a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test @@ -12,7 +12,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --source include/have_innodb.inc --source ../../include/mroonga/have_mroonga.inc @@ -25,9 +25,8 @@ CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, tags TEXT, - FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"' + FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"' ) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"'; -SHOW CREATE TABLE diaries; INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); diff --git a/storage/mroonga/packages/apt/Makefile.am b/storage/mroonga/packages/apt/Makefile.am index ca0e1dcb19d53..0ebc7f67d04d8 100644 --- a/storage/mroonga/packages/apt/Makefile.am +++ b/storage/mroonga/packages/apt/Makefile.am @@ -1,11 +1,12 @@ REPOSITORIES_PATH = repositories DISTRIBUTIONS = debian ARCHITECTURES = i386 amd64 -CODE_NAMES = wheezy jessie +CODE_NAMES = jessie stretch +MYSQL_VARIANTS = 5.5 mariadb-10.0 all: -release: build sign-packages update-repository sign-repository upload +release: download build sign-packages update-repository sign-repository upload remove-existing-packages: for distribution in $(DISTRIBUTIONS); do \ @@ -45,21 +46,44 @@ upload: ensure-rsync-path build: build-package-deb -build-package-deb: prepare-build-package-deb +build-package-deb: source env.sh 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; \ + for variant in $(MYSQL_VARIANTS); do \ + cp env.sh tmp/; \ + echo "MYSQL_VARIANT=$${variant}" >> tmp/env.sh; \ + for architecture in $(ARCHITECTURES); do \ + for code_name in $(CODE_NAMES); do \ + rm -rf tmp/debian; \ + if [ $${variant} = "5.5" -a $${code_name} = "stretch" ]; then \ + continue; \ + fi; \ + if [ $${code_name} = "stretch" ]; then \ + cp -rp $(srcdir)/../debian-mariadb-10.0 tmp/debian; \ + for f in `find tmp/debian -maxdepth 2 -type f`; do \ + RENAMED=`echo $$f | sed 's/10.0/10.1/'`; \ + sed -i'' 's/10.0/10.1/g' $${f}; \ + if [ $${f} = $$RENAMED ]; then \ + continue; \ + fi; \ + mv $${f} $$RENAMED; \ + done; \ + if [ $${architecture} = "amd64" ]; then \ + sed -i'' 's,lib/mysql/,lib/x86_64-linux-gnu/mariadb18/,' \ + tmp/debian/mariadb-server-10.1-mroonga.install; \ + elif [ $${architecture} = "i386" ]; then \ + sed -i'' 's,lib/mysql/,lib/i386-linux-gnu/mariadb18/,' \ + tmp/debian/mariadb-server-10.1-mroonga.install; \ + fi; \ + else \ + cp -rp $(srcdir)/../debian-$${variant} tmp/debian; \ + fi; \ + id=debian-$$code_name-$$architecture; \ + vagrant up $$id || exit 1; \ + vagrant destroy --force $$id; \ + done; \ 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 diff --git a/storage/mroonga/packages/apt/Vagrantfile b/storage/mroonga/packages/apt/Vagrantfile index 2829da879dd14..10a6faba115a9 100644 --- a/storage/mroonga/packages/apt/Vagrantfile +++ b/storage/mroonga/packages/apt/Vagrantfile @@ -7,30 +7,43 @@ 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-jessie-i386", + :box => "bento/debian-8.9-i386", }, { - :id => "debian-wheezy-amd64", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8_chef-provisionerless.box", + :id => "debian-jessie-amd64", + :box => "bento/debian-8.9", }, { - :id => "debian-jessie-i386", - :box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0-i386_chef-provisionerless.box", + :id => "debian-stretch-i386", + :box_url => "http://packages.groonga.org/tmp/debian-9.0-i386.virtualbox.box", }, { - :id => "debian-jessie-amd64", - :box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0_chef-provisionerless.box", + :id => "debian-stretch-amd64", + :box => "bento/debian-9.1", }, ] vms.each do |vm| config.vm.define(vm[:id]) do |node| - node.vm.box = vm[:id] - node.vm.box_url = vm[:box_url] + # Use official box + node.vm.box = vm[:box] if vm[:box] + # Use box and box_url until official box is released + node.vm.box = vm[:id] if vm[:box_url] + node.vm.box_url = vm[:box_url] if vm[:box_url] node.vm.provision(:shell, :path => "build-deb.sh") node.vm.provider("virtualbox") do |virtual_box| - virtual_box.memory = 768 + system_n_cpus = 1 + if File.exist?("/proc/cpuinfo") + system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size + end + if system_n_cpus > 1 + vm_n_cpus = system_n_cpus / 2 + else + vm_n_cpus = 1 + end + virtual_box.cpus = (ENV["VM_CPUS"] || vm_n_cpus).to_i + virtual_box.memory = (ENV["VM_MEMORY"] || 768).to_i end end end diff --git a/storage/mroonga/packages/apt/build-deb.sh b/storage/mroonga/packages/apt/build-deb.sh index 510886cb24fab..e0e03d8ec1541 100755 --- a/storage/mroonga/packages/apt/build-deb.sh +++ b/storage/mroonga/packages/apt/build-deb.sh @@ -2,8 +2,6 @@ LANG=C -mysql_server_package=mysql-server - run() { "$@" @@ -15,14 +13,37 @@ run() . /vagrant/tmp/env.sh +code_name=$(lsb_release --codename --short) +case "${MYSQL_VARIANT}" in + mariadb-*) + case "${code_name}" in + stretch) + mysql_server_package=mariadb-server-10.1 + MYSQL_VARIANT=mariadb-10.1 + ;; + *) + mysql_server_package=mariadb-server-${MYSQL_VARIANT##mariadb-} + ;; + esac + DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmariadb-client-lgpl-dev" + DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmariadbd-dev" + ;; + *) + mysql_server_package=mysql-server-${MYSQL_VARIANT} + DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmysqlclient-dev" + DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmysqld-dev" + ;; +esac + grep '^deb ' /etc/apt/sources.list | \ sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list +run sudo sed -i'' -e 's/httpredir/ftp.jp/g' /etc/apt/sources.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 @@ -59,16 +80,23 @@ 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 tar xfz /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz +run mv ${PACKAGE}-${VERSION} ${PACKAGE}-${MYSQL_VARIANT}-${VERSION} +run tar cfz ${PACKAGE}-${MYSQL_VARIANT}_${VERSION}.orig.tar.gz \ + ${PACKAGE}-${MYSQL_VARIANT}-${VERSION} +run cd ${PACKAGE}-${MYSQL_VARIANT}-${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_INFO=$(apt-cache show ${mysql_server_package} | + grep Version | + sort | + tail -1) MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_INFO##Version: } -sed -i "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/" debian/control +sed -i'' \ + -e "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/g" \ + -e "s/MARIADB_VERSION/$MYSQL_PACKAGE_VERSION/g" \ + debian/control run debuild -us -uc run cd - diff --git a/storage/mroonga/packages/apt/env.sh.in b/storage/mroonga/packages/apt/env.sh.in index a44d6b36871cf..51109aee4f728 100644 --- a/storage/mroonga/packages/apt/env.sh.in +++ b/storage/mroonga/packages/apt/env.sh.in @@ -7,8 +7,9 @@ libgroonga-dev pkg-config libmecab-dev mecab-utils -libmysqlclient-dev -libmysqld-dev +gdb +libxml2-dev +unixodbc-dev libssl-dev groonga-normalizer-mysql wget diff --git a/storage/mroonga/packages/apt/sign-packages.sh b/storage/mroonga/packages/apt/sign-packages.sh index 11a4aea26dbf4..57c985f38f60a 100755 --- a/storage/mroonga/packages/apt/sign-packages.sh +++ b/storage/mroonga/packages/apt/sign-packages.sh @@ -23,7 +23,7 @@ run() for code_name in ${CODES}; do case ${code_name} in - squeeze|wheezy|jessie|unstable) + jessie|stretch|unstable) distribution=debian ;; *) diff --git a/storage/mroonga/packages/apt/sign-repository.sh b/storage/mroonga/packages/apt/sign-repository.sh index fb0de850d6fd2..e0d963ffb5fcb 100755 --- a/storage/mroonga/packages/apt/sign-repository.sh +++ b/storage/mroonga/packages/apt/sign-repository.sh @@ -23,7 +23,7 @@ run() for code_name in ${CODES}; do case ${code_name} in - squeeze|wheezy|jessie|unstable) + jessie|stretch|unstable) distribution=debian ;; *) diff --git a/storage/mroonga/packages/apt/update-repository.sh b/storage/mroonga/packages/apt/update-repository.sh index da1f8cd121caf..a95ad117ccc34 100755 --- a/storage/mroonga/packages/apt/update-repository.sh +++ b/storage/mroonga/packages/apt/update-repository.sh @@ -109,7 +109,7 @@ EOF for code_name in ${CODES}; do case ${code_name} in - squeeze|wheezy|jessie|unstable) + jessie|stretch|unstable) distribution=debian component=main ;; diff --git a/storage/mroonga/packages/check-utility.sh b/storage/mroonga/packages/check-utility.sh deleted file mode 100755 index 211e231a473ab..0000000000000 --- a/storage/mroonga/packages/check-utility.sh +++ /dev/null @@ -1,665 +0,0 @@ -#!/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 < /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 < /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 < tmp/check-rpm-mroonga.sh < tmp/install-aptitude-mroonga.sh < tmp/install-aptget-mroonga.sh < tmp/install-centos5-mroonga.sh < tmp/install-centos6-mroonga.sh < tmp/install-fedora-mroonga.sh < $UNINSTALL_SCRIPT < tmp/$UNINSTALL_SCRIPT < tmp/enable-repository.sh < /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 < /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 - diff --git a/storage/mroonga/packages/debian/apparmor/mysql-server-mroonga b/storage/mroonga/packages/debian/apparmor/mysql-server-mroonga deleted file mode 100644 index 259f8d1dc0c22..0000000000000 --- a/storage/mroonga/packages/debian/apparmor/mysql-server-mroonga +++ /dev/null @@ -1,5 +0,0 @@ -/usr/lib/groonga/plugins/ r, -/usr/lib/groonga/plugins/** rm, -/etc/mecabrc r, -/var/lib/mecab/dic/** r, -#include diff --git a/storage/mroonga/packages/debian/changelog b/storage/mroonga/packages/debian/changelog deleted file mode 100644 index 366edca7b4ef9..0000000000000 --- a/storage/mroonga/packages/debian/changelog +++ /dev/null @@ -1,415 +0,0 @@ -mroonga (5.04-1) unstable; urgency=low - - * New upstream release. - - -- Masafumi Yokoyama Mon, 29 Jun 2015 00:00:00 +0900 - -mroonga (5.03-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Fri, 29 May 2015 00:00:00 +0900 - -mroonga (5.02-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Wed, 29 Apr 2015 00:00:00 +0900 - -mroonga (5.01-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Sun, 29 Mar 2015 00:00:00 +0900 - -mroonga (5.00-1) unstable; urgency=low - - * New upstream release. - - -- Mon, 09 Feb 2015 00:00:00 +0900 - -mroonga (4.10-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Thu, 29 Jan 2015 00:00:00 +0900 - -mroonga (4.09-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Mon, 29 Dec 2014 00:00:00 +0900 - -mroonga (4.08-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Sat, 29 Nov 2014 00:00:00 +0900 - -mroonga (4.07-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Wed, 29 Oct 2014 00:00:00 +0900 - -mroonga (4.06-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Mon, 29 Sep 2014 00:00:00 +0900 - -mroonga (4.05-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Fri, 29 Aug 2014 00:00:00 +0900 - -mroonga (4.04-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Tue, 29 Jul 2014 00:00:00 +0900 - -mroonga (4.03-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Thu, 29 May 2014 00:00:00 +0900 - -mroonga (4.02-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Tue, 29 Apr 2014 00:00:00 +0900 - -mroonga (4.01-2) unstable; urgency=low - - * Built for mysql-server 5.5.37 - - -- HAYASHI Kentaro Mon, 28 Apr 2014 00:00:00 +0900 - -mroonga (4.01-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Thu, 06 Mar 2014 00:00:00 +0900 - -mroonga (4.00-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Wed, 29 Jan 2014 13:12:56 +0900 - -mroonga (3.12-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Wed, 29 Jan 2014 00:00:00 +0900 - -mroonga (3.11-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Sun, 29 Dec 2013 00:00:00 +0900 - -mroonga (3.10-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Fri, 29 Nov 2013 00:00:00 +0900 - -mroonga (3.09-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Tue, 29 Oct 2013 00:00:00 +0900 - -mroonga (3.08-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Sun, 29 Sep 2013 00:00:00 +0900 - -mroonga (3.07-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Thu, 29 Aug 2013 00:00:00 +0900 - -mroonga (3.06-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Mon, 29 Jul 2013 00:00:00 +0900 - -mroonga (3.05-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Thu, 13 Jun 2013 00:00:00 +0900 - -mroonga (3.04-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Thu, 16 May 2013 00:00:00 +0900 - -mroonga (3.03-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Fri, 29 Mar 2013 22:15:39 +0900 - -mroonga (3.02-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Fri, 29 Mar 2013 00:00:00 +0900 - -mroonga (3.01-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Thu, 28 Feb 2013 00:00:00 +0900 - -mroonga (3.00-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Thu, 24 Jan 2013 10:28:16 +0900 - -mroonga (2.10-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Wed, 12 Dec 2012 13:28:00 +0900 - -mroonga (2.09-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Thu, 29 Nov 2012 00:00:00 +0900 - -mroonga (2.08-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Mon, 29 Oct 2012 00:00:00 +0900 - -mroonga (2.07-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro Sat, 29 Sep 2012 00:00:00 +0900 - -mroonga (2.06-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Wed, 29 Aug 2012 00:00:00 +0900 - -mroonga (2.05-1) unstable; urgency=low - - * New upstream release. - - -- HAYASHI Kentaro 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 Fri, 29 Jun 2012 00:00:00 +0900 - -mroonga (2.03-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou 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 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 Thu, 29 Mar 2012 00:00:00 +0900 - -mroonga (2.00-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou 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 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 Thu, 29 Dec 2011 00:00:00 +0900 - -mroonga (1.10-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Sat, 29 Oct 2011 00:00:00 +0900 - -groonga-storage-engine (1.0.0-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Thu, 29 Sep 2011 00:00:00 +0900 - -groonga-storage-engine (0.9-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Mon, 29 Aug 2011 00:00:00 +0900 - -groonga-storage-engine (0.8-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Fri, 29 Jul 2011 00:00:00 +0900 - -groonga-storage-engine (0.7-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Wed, 29 Jun 2011 00:00:00 +0900 - -groonga-storage-engine (0.6-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Sun, 29 May 2011 00:00:00 +0900 - -groonga-storage-engine (0.5-4) unstable; urgency=low - - * fix a typo. - - -- Kouhei Sutou Tue, 30 Mar 2011 01:05:00 +0900 - -groonga-storage-engine (0.5-3) unstable; urgency=low - - * fix AppArmor files. - - -- Kouhei Sutou Tue, 30 Mar 2011 00:59:00 +0900 - -groonga-storage-engine (0.5-2) unstable; urgency=low - - * hook script fix. - - -- Kouhei Sutou Tue, 30 Mar 2011 00:58:00 +0900 - -groonga-storage-engine (0.5-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Tue, 29 Mar 2011 00:00:00 +0900 - -groonga-storage-engine (0.4-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Mon, 29 Nov 2010 00:00:00 +0900 - -groonga-storage-engine (0.3-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Fri, 29 Oct 2010 16:34:04 +0900 - -groonga-storage-engine (0.2-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Sat, 25 Sep 2010 14:52:49 +0900 - -groonga-storage-engine (0.1-4) unstable; urgency=low - - * follow configure option changes. - - -- Kouhei Sutou Fri, 10 Sep 2010 08:45:53 +0900 - -groonga-storage-engine (0.1-3) unstable; urgency=low - - * Use HEAD. - - -- Kouhei Sutou 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 Mon, 30 Aug 2010 13:26:25 +0900 - -groonga-storage-engine (0.1-1) unstable; urgency=low - - * New upstream release. - - -- Kouhei Sutou Mon, 23 Aug 2010 13:52:01 +0900 diff --git a/storage/mroonga/packages/debian/compat b/storage/mroonga/packages/debian/compat deleted file mode 100644 index ec635144f6004..0000000000000 --- a/storage/mroonga/packages/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/storage/mroonga/packages/debian/control.in b/storage/mroonga/packages/debian/control.in deleted file mode 100644 index d6d03fa9a4ec7..0000000000000 --- a/storage/mroonga/packages/debian/control.in +++ /dev/null @@ -1,51 +0,0 @@ -Source: mroonga -Section: database -Priority: optional -Maintainer: Kouhei Sutou -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. diff --git a/storage/mroonga/packages/debian/copyright b/storage/mroonga/packages/debian/copyright deleted file mode 100644 index bb41984e8e414..0000000000000 --- a/storage/mroonga/packages/debian/copyright +++ /dev/null @@ -1,27 +0,0 @@ -This work was packaged for Debian by: - - Kouhei Sutou on Thu, 02 Sep 2010 13:51:56 +0900. - -It was downloaded: - - - -Upstream Author(s): - - Tetsuro IKEDA - Daijiro MORI - Tasuku SUENAGA - Kouhei Sutou - -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 in 2010, -and put into public domain, anyone can use it for any purpose. diff --git a/storage/mroonga/packages/debian/mysql-server-mroonga-doc.install b/storage/mroonga/packages/debian/mysql-server-mroonga-doc.install deleted file mode 100644 index ad2e27ef7dd32..0000000000000 --- a/storage/mroonga/packages/debian/mysql-server-mroonga-doc.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/doc/mysql-server-mroonga-doc/ diff --git a/storage/mroonga/packages/debian/mysql-server-mroonga.install b/storage/mroonga/packages/debian/mysql-server-mroonga.install deleted file mode 100644 index 03f64cfedb40d..0000000000000 --- a/storage/mroonga/packages/debian/mysql-server-mroonga.install +++ /dev/null @@ -1,3 +0,0 @@ -usr/lib/mysql/plugin/ha_mroonga.so* -usr/share/mroonga/* -debian/apparmor/mysql-server-mroonga etc/apparmor.d/abstractions/ diff --git a/storage/mroonga/packages/debian/mysql-server-mroonga.postinst b/storage/mroonga/packages/debian/mysql-server-mroonga.postinst deleted file mode 100755 index 9a3db8784a24e..0000000000000 --- a/storage/mroonga/packages/debian/mysql-server-mroonga.postinst +++ /dev/null @@ -1,72 +0,0 @@ -#! /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 " - 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 <> "${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 < "$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# diff --git a/storage/mroonga/packages/debian/mysql-server-mroonga.postrm b/storage/mroonga/packages/debian/mysql-server-mroonga.postrm deleted file mode 100755 index 84d7f1ef4abf1..0000000000000 --- a/storage/mroonga/packages/debian/mysql-server-mroonga.postrm +++ /dev/null @@ -1,38 +0,0 @@ -#! /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 " - 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 diff --git a/storage/mroonga/packages/debian/mysql-server-mroonga.prerm b/storage/mroonga/packages/debian/mysql-server-mroonga.prerm deleted file mode 100755 index 7fad990d75f9a..0000000000000 --- a/storage/mroonga/packages/debian/mysql-server-mroonga.prerm +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -set -e - -cat /usr/share/mroonga/uninstall.sql | \ - mysql --defaults-file=/etc/mysql/debian.cnf || true - -#DEBHELPER# - -exit 0 diff --git a/storage/mroonga/packages/debian/rules b/storage/mroonga/packages/debian/rules deleted file mode 100755 index 2a397b333e112..0000000000000 --- a/storage/mroonga/packages/debian/rules +++ /dev/null @@ -1,39 +0,0 @@ -#!/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 diff --git a/storage/mroonga/packages/rpm/centos/Makefile.am b/storage/mroonga/packages/rpm/centos/Makefile.am index e7b22cfa02502..72d860a90f2c9 100644 --- a/storage/mroonga/packages/rpm/centos/Makefile.am +++ b/storage/mroonga/packages/rpm/centos/Makefile.am @@ -1,9 +1,19 @@ EXTRA_DIST = \ mysql55-mroonga.spec.in \ mysql56-community-mroonga.spec.in \ - mariadb-mroonga.spec.in + mysql57-community-mroonga.spec.in \ + mariadb-mroonga.spec.in \ + mariadb-10.1-mroonga.spec.in \ + mariadb-10.2-mroonga.spec.in \ + percona-server-56-mroonga.spec.in \ + percona-server-57-mroonga.spec.in noinst_DATA = \ mysql55-mroonga.spec \ mysql56-community-mroonga.spec \ - mariadb-mroonga.spec + mysql57-community-mroonga.spec \ + mariadb-mroonga.spec \ + mariadb-10.1-mroonga.spec \ + mariadb-10.2-mroonga.spec \ + percona-server-56-mroonga.spec \ + percona-server-57-mroonga.spec diff --git a/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in index 04d1c41f2cc62..e52a23b979675 100644 --- a/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in +++ b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in @@ -1,24 +1,24 @@ %define mariadb_epoch_default 1 -%define mariadb_version_default 5.5.41 +%define mariadb_version_default 5.5.56 %define mariadb_release_default 2 -%define mariadb_dist_default .el7_0 -%define mariadb_download_base_url_default http://vault.centos.org/7.1.1503/os/Source/SPackages +%define mariadb_dist_default .el7 +%define mariadb_download_base_url_default http://vault.centos.org/7.4.1708/os/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_epoch %{?mariadb_epoch:%{mariadb_epoch}}%{!?mariadb_epoch:%{mariadb_epoch_default}} +%define _mariadb_version %{?mariadb_version:%{mariadb_version}}%{!?mariadb_version:%{mariadb_version_default}} +%define _mariadb_release %{?mariadb_release:%{mariadb_release}}%{!?mariadb_release:%{mariadb_release_default}} +%define _mariadb_dist %{?mariadb_dist:%{mariadb_dist}}%{!?mariadb_dist:%{mariadb_dist_default}} +%define _mariadb_download_base_url %{?mariadb_download_base_url:%{mariadb_download_base_url}}%{!?mariadb_download_base_url:%{mariadb_download_base_url_default}} +%define _mariadb_spec_file %{?mariadb_spec_file:%{mariadb_spec_file}}%{!?mariadb_spec_file:%{mariadb_spec_file_default}} -%define mariadb_package_version %{mariadb_epoch}:%{mariadb_version}-%{mariadb_release}%{mariadb_dist} +%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} +Release: 2%{?dist} Summary: A fast fulltext searchable storage engine for MariaDB Group: Applications/Databases @@ -30,9 +30,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) BuildRequires: groonga-devel >= %{groonga_required_version} BuildRequires: groonga-normalizer-mysql-devel BuildRequires: wget -BuildRequires: mariadb-devel = %{mariadb_package_version} -Requires: mariadb-server = %{mariadb_package_version} -Requires: mariadb = %{mariadb_package_version} +BuildRequires: mariadb-devel = %{_mariadb_package_version} +Requires: mariadb-server = %{_mariadb_package_version} +Requires: mariadb = %{_mariadb_package_version} Requires: groonga-libs >= %{groonga_required_version} Requires: groonga-normalizer-mysql @@ -53,21 +53,21 @@ Documentation for Mroonga %prep %setup -q -n mroonga-%{version} -mariadb_full_version=%{mariadb_version}-%{mariadb_release}%{mariadb_dist} +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 + wget --continue -O ../../SRPMS/$srpm %{_mariadb_download_base_url}/$srpm rpm -Uvh ../../SRPMS/$srpm rm ../../SRPMS/$srpm fi %build -mariadb_source=../mariadb-%{mariadb_version} +mariadb_source=../mariadb-%{_mariadb_version} if [ ! -d ${mariadb_source} ]; then rpmbuild -bc \ --define 'runselftest 0' \ --define 'optflags -O0' \ - ../../SPECS/%{mariadb_spec_file} + ../../SPECS/%{_mariadb_spec_file} fi %configure \ --disable-static \ @@ -86,7 +86,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ rm -rf $RPM_BUILD_ROOT %post -if /usr/bin/mysql -u root -e "quit"; then +if /usr/bin/mysql -u root -e "quit" > /dev/null 2>&1; then password_option="" else password_option="-p" @@ -128,7 +128,7 @@ eval $command || \ %preun uninstall_sql=%{_datadir}/mroonga/uninstall.sql -if mysql -u root -e "quit"; then +if mysql -u root -e "quit" > /dev/null 2>&1; then password_option="" else password_option="-p" @@ -154,6 +154,81 @@ fi %doc mysql-mroonga-doc/* %changelog +* Fri Sep 15 2017 Kouhei Sutou - 7.06-2 +- rebuild against the latest MariaDB. + +* Tue Aug 29 2017 Kentaro Hayashi - 7.06-1 +- new upstream release. + +* Sat Jul 29 2017 Kentaro Hayashi - 7.05-1 +- new upstream release. + +* Thu Jun 29 2017 Kentaro Hayashi - 7.04-1 +- new upstream release. + +* Mon May 29 2017 Kentaro Hayashi - 7.03-1 +- new upstream release. + +* Sat Apr 29 2017 Kentaro Hayashi - 7.02-1 +- new upstream release. + +* Wed Mar 29 2017 Kentaro Hayashi - 7.01-1 +- new upstream release. + +* Thu Feb 09 2017 Kentaro Hayashi - 7.00-1 +- new upstream release. + +* Sat Oct 29 2016 Kentaro Hayashi - 6.10-1 +- new upstream release. + +* Thu Sep 29 2016 Kentaro Hayashi - 6.09-1 +- new upstream release. + +* Mon Aug 29 2016 Kentaro Hayashi - 6.08-1 +- new upstream release. + +* Fri Jul 29 2016 Kentaro Hayashi - 6.07-1 +- new upstream release. + +* Thu Jun 30 2016 Masafumi Yokoyama - 6.06-1 +- new upstream release. + +* Wed Jun 29 2016 Kentaro Hayashi - 6.05-1 +- new upstream release. + +* Sun May 29 2016 Kentaro Hayashi - 6.03-1 +- new upstream release. + +* Fri Apr 29 2016 HAYASHI Kentaro - 6.02-1 +- new upstream release. + +* Tue Mar 29 2016 Masafumi Yokoyama - 6.01-1 +- new upstream release. + +* Mon Feb 29 2016 Kouhei Sutou - 6.00-1 +- new upstream release. + +* Tue Dec 29 2015 Kouhei Sutou - 5.11-1 +- new upstream release. + +* Wed Dec 16 2015 Kouhei Sutou - 5.10-2 +- rebuild against MariaDB on CentOS 7.2. Reported by Larry Kim. Thanks!!! + +* Sun Nov 29 2015 Kouhei Sutou - 5.10-1 +- new upstream release. + +* Thu Oct 29 2015 Kouhei Sutou - 5.09-1 +- new upstream release. + +* Tue Sep 29 2015 Kouhei Sutou - 5.08-1 +- new upstream release. + +* Mon Aug 31 2015 Kouhei Sutou - 5.06-1 +- new upstream release. + +* Wed Jul 29 2015 Masafumi Yokoyama - 5.05-1 +- new upstream release. + * Mon Jun 29 2015 Masafumi Yokoyama - 5.04-1 - new upstream release. diff --git a/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in index e20e1b321627f..5fa331101f02b 100644 --- a/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in +++ b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in @@ -1,26 +1,26 @@ %{?scl:%scl_package mroonga} %{!?scl:%global pkg_name %{name}} -%{!?centos_ver:%define centos_ver 5} +%define _centos_ver %{?centos_ver:%{centos_ver}}%{!?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 +%if %{_centos_ver} == 6 +%define mysql_version_default 5.5.52 +%define mysql_release_default 1 +%define mysql_dist_default el6 +%define mysql_download_base_url_default http://vault.centos.org/6.8/sclo/Source/rh/mysql55/ %define mysql_spec_file_default mysql.spec %else -%define mysql_version_default 5.5.40 -%define mysql_release_default 2 +%define mysql_version_default 5.5.45 +%define mysql_release_default 1 %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 _mysql_version %{?mysql_version:%{mysql_version}}%{!?mysql_version:%{mysql_version_default}} +%define _mysql_release %{?mysql_release:%{mysql_release}}%{!?mysql_release:%{mysql_release_default}} +%define _mysql_dist %{?mysql_dist:%{mysql_dist}}%{!?mysql_dist:%{mysql_dist_default}} +%define _mysql_download_base_url %{?mysql_download_base_url:%{mysql_download_base_url}}%{!?mysql_download_base_url:%{mysql_download_base_url_default}} +%define _mysql_spec_file %{?mysql_spec_file:%{mysql_spec_file}}%{!?mysql_spec_file:%{mysql_spec_file_default}} %define groonga_required_version @REQUIRED_GROONGA_VERSION@ @@ -39,10 +39,10 @@ BuildRequires: groonga-devel >= %{groonga_required_version} BuildRequires: groonga-normalizer-mysql-devel BuildRequires: wget BuildRequires: which -BuildRequires: mysql55-mysql-devel = %{mysql_version}-%{mysql_release}.%{mysql_dist} +BuildRequires: mysql55-mysql-devel = %{_mysql_version}-%{_mysql_release}.%{_mysql_dist} BuildRequires: mysql55-build -Requires: mysql55-mysql-server = %{mysql_version}-%{mysql_release}.%{mysql_dist} -Requires: mysql55-mysql = %{mysql_version}-%{mysql_release}.%{mysql_dist} +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} @@ -64,21 +64,21 @@ Documentation for Mroonga %prep %setup -q -n %{pkg_name}-%{version} -mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist} +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 + wget --continue -O ../../SRPMS/$srpm %{_mysql_download_base_url}/$srpm rpm -Uvh ../../SRPMS/$srpm fi %build -mysql_source=../mysql-%{mysql_version} +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} + ../../SPECS/%{_mysql_spec_file} fi %configure --disable-static --with-mysql-source=${mysql_source} \ --disable-fast-mutexes \ @@ -97,10 +97,10 @@ 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" +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then + password_option="" +else + password_option="-p" fi current_version=0 version=`echo %{groonga_required_version} | sed -e 's/\.//g'` @@ -137,7 +137,7 @@ eval $command || \ %preun uninstall_sql=%{_datadir}/mroonga/uninstall.sql mysql_command=`scl enable mysql55 'which mysql'` -if $mysql_command -u root -e "quit"; then +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then password_option="" else password_option="-p" @@ -163,6 +163,84 @@ fi %doc mysql-mroonga-doc/* %changelog +* Tue Aug 29 2017 Kentaro Hayashi - 7.06-1 +- new upstream release. + +* Sat Jul 29 2017 Kentaro Hayashi - 7.05-1 +- new upstream release. + +* Thu Jun 29 2017 Kentaro Hayashi - 7.04-1 +- new upstream release. + +* Mon May 29 2017 Kentaro Hayashi - 7.03-1 +- new upstream release. + +* Sat Apr 29 2017 Kentaro Hayashi - 7.02-1 +- new upstream release. + +* Wed Mar 29 2017 Kentaro Hayashi - 7.01-1 +- new upstream release. + +* Thu Feb 09 2017 Kentaro Hayashi - 7.00-1 +- new upstream release. + +* Fri Jan 13 2017 Kouhei Sutou - 6.13-1 +- new upstream release. + +* Thu Dec 29 2016 Kentaro Hayashi - 6.12-1 +- new upstream release. + +* Tue Nov 29 2016 Kentaro Hayashi - 6.11-1 +- new upstream release. + +* Sat Oct 29 2016 Kentaro Hayashi - 6.10-1 +- new upstream release. + +* Thu Sep 29 2016 Kentaro Hayashi - 6.09-1 +- new upstream release. + +* Mon Aug 29 2016 Kentaro Hayashi - 6.08-1 +- new upstream release. + +* Fri Jul 29 2016 Kentaro Hayashi - 6.07-1 +- new upstream release. + +* Thu Jun 30 2016 Masafumi Yokoyama - 6.06-1 +- new upstream release. + +* Wed Jun 29 2016 Kentaro Hayashi - 6.05-1 +- new upstream release. + +* Sun May 29 2016 Kentaro Hayashi - 6.03-1 +- new upstream release. + +* Fri Apr 29 2016 HAYASHI Kentaro - 6.02-1 +- new upstream release. + +* Tue Mar 29 2016 Masafumi Yokoyama - 6.01-1 +- new upstream release. + +* Mon Feb 29 2016 Kouhei Sutou - 6.00-1 +- new upstream release. + +* Fri Jan 29 2016 Kouhei Sutou - 5.12-1 +- new upstream release. + +* Sun Nov 29 2015 Kouhei Sutou - 5.10-1 +- new upstream release. + +* Thu Oct 29 2015 Kouhei Sutou - 5.09-1 +- new upstream release. + +* Tue Sep 29 2015 Kouhei Sutou - 5.08-1 +- new upstream release. + +* Mon Aug 31 2015 Kouhei Sutou - 5.06-1 +- new upstream release. + +* Wed Jul 29 2015 Masafumi Yokoyama - 5.05-1 +- new upstream release. + * Mon Jun 29 2015 Masafumi Yokoyama - 5.04-1 - new upstream release. diff --git a/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in index f3233d17afe5a..bf098a5f4153e 100644 --- a/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in +++ b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in @@ -1,24 +1,24 @@ -%{!?centos_ver:%define centos_ver 6} +%define _centos_ver %{?centos_ver:%{centos_ver}}%{!?centos_ver:5} -%if %{centos_ver} == 7 -%define mysql_version_default 5.6.25 +%if %{_centos_ver} == 7 +%define mysql_version_default 5.6.37 %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.25 +%define mysql_version_default 5.6.37 %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 _mysql_version %{?mysql_version:%{mysql_version}}%{!?mysql_version:%{mysql_version_default}} +%define _mysql_release %{?mysql_release:%{mysql_release}}%{!?mysql_release:%{mysql_release_default}} +%define _mysql_dist %{?mysql_dist:%{mysql_dist}}%{!?mysql_dist:%{mysql_dist_default}} +%define _mysql_download_base_url %{?mysql_download_base_url:%{mysql_download_base_url}}%{!?mysql_download_base_url:%{mysql_download_base_url_default}} +%define _mysql_spec_file %{?mysql_spec_file:%{mysql_spec_file}}%{!?mysql_spec_file:%{mysql_spec_file_default}} %define groonga_required_version @REQUIRED_GROONGA_VERSION@ @@ -38,9 +38,10 @@ BuildRequires: groonga-normalizer-mysql-devel BuildRequires: wget BuildRequires: which BuildRequires: gcc, gcc-c++ -BuildRequires: mysql-community-devel = %{mysql_version}-%{mysql_release}.%{mysql_dist} -Requires: mysql-community-server = %{mysql_version}-%{mysql_release}.%{mysql_dist} -Requires: mysql-community-client = %{mysql_version}-%{mysql_release}.%{mysql_dist} +BuildRequires: numactl-devel +BuildRequires: mysql-community-devel = %{_mysql_version}-%{_mysql_release}.%{_mysql_dist} +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 @@ -61,21 +62,21 @@ Documentation for Mroonga %prep %setup -q -n mroonga-%{version} -mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist} +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 + wget --continue -O ../../SRPMS/$srpm %{_mysql_download_base_url}/$srpm rpm -Uvh ../../SRPMS/$srpm fi %build -mysql_source=../mysql-%{mysql_version}/mysql-%{mysql_version} +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} + ../../SPECS/%{_mysql_spec_file} fi %configure \ --disable-static \ @@ -102,10 +103,10 @@ else fi mysql_command=`which mysql` -password_option="" -$mysql_command -u root -e "quit" -if [ $? -ne 0 ]; then - password_option="-p" +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then + password_option="" +else + password_option="-p" fi current_version=0 version=`echo %{groonga_required_version} | sed -e 's/\.//g'` @@ -153,7 +154,7 @@ fi uninstall_sql=%{_datadir}/mroonga/uninstall.sql mysql_command=`which mysql` -if $mysql_command -u root -e "quit"; then +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then password_option="" else password_option="-p" @@ -183,10 +184,115 @@ fi %doc mysql-mroonga-doc/* %changelog +* Tue Aug 29 2017 Kentaro Hayashi - 7.06-1 +- new upstream release. + +* Wed Aug 23 2017 Kentaro Hayashi - 7.05-2 +- build against MySQL 5.6.37 on CentOS 7. Reported by Hiroshi Kagami. Thanks!!! + +* Sat Jul 29 2017 Kentaro Hayashi - 7.05-1 +- new upstream release. + +* Fri Jul 21 2017 Kentaro Hayashi - 7.04-2 +- build against MySQL 5.6.37 on CentOS 6. Reported by Hiroshi Kagami. Thanks!!! + +* Thu Jun 29 2017 Kentaro Hayashi - 7.04-1 +- new upstream release. + +* Mon May 29 2017 Kentaro Hayashi - 7.03-1 +- new upstream release. + +* Sat Apr 29 2017 Kentaro Hayashi - 7.02-1 +- new upstream release. + +* Wed Apr 12 2017 Kentaro Hayashi - 7.01-2 +- build against MySQL 5.6.36 Reported by @tigersun2000. Thanks!!! + +* Wed Mar 29 2017 Kentaro Hayashi - 7.01-1 +- new upstream release. + +* Thu Feb 09 2017 Kentaro Hayashi - 7.00-1 +- new upstream release. + +* Fri Jan 13 2017 Kouhei Sutou - 6.13-1 +- new upstream release. + +* Thu Dec 29 2016 Kentaro Hayashi - 6.12-1 +- new upstream release. + +* Tue Nov 29 2016 Kentaro Hayashi - 6.11-1 +- new upstream release. + +* Sat Oct 29 2016 Kentaro Hayashi - 6.10-1 +- new upstream release. + +* Mon Oct 24 2016 Kouhei Sutou - 6.09-2 +- build against MySQL 5.6.34. Reported by Hiroshi Kagami. Thanks!!! + +* Thu Sep 29 2016 Kentaro Hayashi - 6.09-1 +- new upstream release. + +* Wed Sep 14 2016 Kentaro Hayashi - 6.08-2 +- build against MySQL 5.6.33. + +* Mon Aug 29 2016 Kentaro Hayashi - 6.08-1 +- new upstream release. + +* Fri Jul 29 2016 Kentaro Hayashi - 6.07-1 +- new upstream release. + +* Thu Jun 30 2016 Masafumi Yokoyama - 6.06-1 +- new upstream release. + +* Wed Jun 29 2016 Kentaro Hayashi - 6.05-1 +- new upstream release. + +* Mon Jun 06 2016 Kouhei Sutou - 6.03-2 +- build against MySQL 5.6.30. + +* Sun May 29 2016 Kentaro Hayashi - 6.03-1 +- new upstream release. + +* Fri Apr 29 2016 HAYASHI Kentaro - 6.02-1 +- new upstream release. + +* Tue Mar 29 2016 Masafumi Yokoyama - 6.01-1 +- new upstream release. + +* Mon Feb 29 2016 Kouhei Sutou - 6.00-1 +- new upstream release. + +* Fri Jan 29 2016 Kouhei Sutou - 5.12-1 +- new upstream release. + +* Tue Dec 29 2015 Kouhei Sutou - 5.11-1 +- new upstream release. + +* Wed Dec 09 2015 Kouhei Sutou - 5.10-2 +- build against MySQL 5.6.28. Reported by @stealthinu. Thanks!!! + +* Sun Nov 29 2015 Kouhei Sutou - 5.10-1 +- new upstream release. + +* Thu Oct 29 2015 Kouhei Sutou - 5.09-1 +- new upstream release. + +* Sat Oct 03 2015 Kouhei Sutou - 5.08-2 +- build against MySQL 5.6.27. Reported by @star_orihime. Thanks!!! + +* Tue Sep 29 2015 Kouhei Sutou - 5.08-1 +- new upstream release. + +* Mon Aug 31 2015 Kouhei Sutou - 5.06-1 +- new upstream release. + +* Wed Jul 29 2015 Masafumi Yokoyama - 5.05-1 +- new upstream release. + * Mon Jun 29 2015 Masafumi Yokoyama - 5.04-1 - new upstream release. -* Thu Jun 02 2015 Masafumi Yokoyama - 5.03-2 +* Tue Jun 02 2015 Masafumi Yokoyama - 5.03-2 - build against MySQL 5.6.25. * Fri May 29 2015 HAYASHI Kentaro - 5.03-1 diff --git a/storage/mroonga/packages/rpm/centos/percona-server-56-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/percona-server-56-mroonga.spec.in index cf1947e267643..831bf8719b694 100644 --- a/storage/mroonga/packages/rpm/centos/percona-server-56-mroonga.spec.in +++ b/storage/mroonga/packages/rpm/centos/percona-server-56-mroonga.spec.in @@ -1,16 +1,16 @@ -%{!?centos_ver:%define centos_ver 6} +%define _centos_ver %{?centos_ver:%{centos_ver}}%{!?centos_ver:5} -%define mysql_version_default 5.6.24 -%define mysql_release_default rel72.2 +%define mysql_version_default 5.6.37 +%define mysql_release_default rel82.2 %define mysql_dist_default %{?dist} -%define mysql_download_base_url_default http://repo.percona.com/centos/%{centos_ver}/SRPMS +%define mysql_download_base_url_default http://repo.percona.com/centos/%{_centos_ver}/SRPMS %define mysql_spec_file_default percona-server.spec -%{!?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 _mysql_version %{?mysql_version:%{mysql_version}}%{!?mysql_version:%{mysql_version_default}} +%define _mysql_release %{?mysql_release:%{mysql_release}}%{!?mysql_release:%{mysql_release_default}} +%define _mysql_dist %{?mysql_dist:%{mysql_dist}}%{!?mysql_dist:%{mysql_dist_default}} +%define _mysql_download_base_url %{?mysql_download_base_url:%{mysql_download_base_url}}%{!?mysql_download_base_url:%{mysql_download_base_url_default}} +%define _mysql_spec_file %{?mysql_spec_file:%{mysql_spec_file}}%{!?mysql_spec_file:%{mysql_spec_file_default}} %define groonga_required_version @REQUIRED_GROONGA_VERSION@ @@ -31,10 +31,10 @@ BuildRequires: wget BuildRequires: which BuildRequires: gcc BuildRequires: gcc-c++ -BuildRequires: Percona-Server-devel-56 = %{mysql_version}-%{mysql_release}%{mysql_dist} +BuildRequires: Percona-Server-devel-56 = %{_mysql_version}-%{_mysql_release}%{_mysql_dist} BuildRequires: selinux-policy-devel -Requires: Percona-Server-server-56 = %{mysql_version}-%{mysql_release}%{mysql_dist} -Requires: Percona-Server-client-56 = %{mysql_version}-%{mysql_release}%{mysql_dist} +Requires: Percona-Server-server-56 = %{_mysql_version}-%{_mysql_release}%{_mysql_dist} +Requires: Percona-Server-client-56 = %{_mysql_version}-%{_mysql_release}%{_mysql_dist} Requires: groonga-libs >= %{groonga_required_version} Requires: groonga-normalizer-mysql @@ -55,23 +55,26 @@ Documentation for Mroonga %prep %setup -q -n mroonga-%{version} -mysql_full_version=%{mysql_version}-%{mysql_release}.generic +mysql_full_version=%{_mysql_version}-%{_mysql_release}.generic srpm=Percona-Server-56-${mysql_full_version}.src.rpm if [ ! -f ../../SRPMS/$srpm ]; then - wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm + wget --continue -O ../../SRPMS/$srpm %{_mysql_download_base_url}/$srpm rpm -Uvh ../../SRPMS/$srpm fi %build -mysql_source=../percona-server-%{mysql_version}-$(echo %{mysql_release} | sed -e 's/rel//') +mysql_source=../percona-server-%{_mysql_version}-$(echo %{_mysql_release} | sed -e 's/rel//') if [ ! -d ${mysql_source} ]; then specs_dir= rpmbuild -bp \ --define 'runselftest 0' \ --define 'optflags -O0' \ - ../../SPECS/%{mysql_spec_file} + ../../SPECS/%{_mysql_spec_file} fi -%configure --disable-static --with-mysql-source=${mysql_source} \ +%configure \ + --disable-static \ + --with-mysql-source=${mysql_source} \ + --enable-fast-mutexes \ %{?mroonga_configure_options} make %{?_smp_mflags} @@ -94,9 +97,11 @@ fi mysql_command=`which mysql` password_option="" -$mysql_command -u root -e "quit" -if [ $? -ne 0 ]; then - password_option="-p" + +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then + password_option="" +else + password_option="-p" fi current_version=0 version=`echo %{groonga_required_version} | sed -e 's/\.//g'` @@ -144,7 +149,7 @@ fi uninstall_sql=%{_datadir}/mroonga/uninstall.sql mysql_command=`which mysql` -if $mysql_command -u root -e "quit"; then +if $mysql_command -u root -e "quit" > /dev/null 2>&1; then password_option="" else password_option="-p" @@ -174,5 +179,92 @@ fi %doc mysql-mroonga-doc/* %changelog +* Tue Aug 29 2017 Kentaro Hayashi - 7.06-1 +- new upstream release. + +* Mon Aug 14 2017 Kentaro Hayashi - 7.05-2 +- build against Percona Server 5.6.36rel82.1 Reported by @tigersun2000_twitter. Thanks!!! + +* Sat Jul 29 2017 Kentaro Hayashi - 7.05-1 +- new upstream release. + +* Thu Jun 29 2017 Kentaro Hayashi - 7.04-1 +- new upstream release. + +* Mon May 29 2017 Kentaro Hayashi - 7.03-1 +- new upstream release. + +* Thu May 17 2017 Kentaro Hayashi - 7.02-2 +- build against Percona Server 5.6.36. Reported by @pinpikokun. Thanks!!! + +* Sat Apr 29 2017 Kentaro Hayashi - 7.02-1 +- new upstream release. + +* Wed Mar 29 2017 Kentaro Hayashi - 7.01-1 +- new upstream release. + +* Thu Feb 09 2017 Kentaro Hayashi - 7.00-1 +- new upstream release. + +* Fri Jan 13 2017 Kouhei Sutou - 6.13-1 +- new upstream release. + +* Thu Dec 29 2016 Kentaro Hayashi - 6.12-1 +- new upstream release. + +* Tue Nov 29 2016 Kentaro Hayashi - 6.11-1 +- new upstream release. + +* Sat Oct 29 2016 Kentaro Hayashi - 6.10-1 +- new upstream release. + +* Mon Oct 24 2016 Kouhei Sutou - 6.09-2 +- build against Percona Server 5.6.33. Reported by Hiroshi Kagami. Thanks!!! + +* Thu Sep 29 2016 Kentaro Hayashi - 6.09-1 +- new upstream release. + +* Mon Aug 29 2016 Kentaro Hayashi - 6.08-1 +- new upstream release. + +* Fri Jul 29 2016 Kentaro Hayashi - 6.07-1 +- new upstream release. + +* Thu Jun 30 2016 Masafumi Yokoyama - 6.06-1 +- new upstream release. + +* Wed Jun 29 2016 Kentaro Hayashi - 6.05-1 +- new upstream release. + +* Sun May 29 2016 Kentaro Hayashi - 6.03-1 +- new upstream release. + +* Fri Apr 29 2016 HAYASHI Kentaro - 6.02-1 +- new upstream release. + +* Tue Mar 29 2016 Masafumi Yokoyama - 6.01-1 +- new upstream release. + +* Mon Feb 29 2016 Kouhei Sutou - 6.00-1 +- new upstream release. + +* Fri Jan 29 2016 Kouhei Sutou - 5.12-1 +- new upstream release. + +* Tue Dec 29 2015 Kouhei Sutou - 5.11-1 +- new upstream release. + +* Sun Nov 29 2015 Kouhei Sutou - 5.10-1 +- new upstream release. + +* Thu Oct 29 2015 Kouhei Sutou - 5.09-1 +- new upstream release. + +* Tue Sep 29 2015 Kouhei Sutou - 5.08-1 +- new upstream release. + +* Mon Aug 31 2015 Kouhei Sutou - 5.06-1 +- new upstream release. + * Tue Mar 17 2015 Kouhei Sutou - 5.00-1 - initial release. diff --git a/storage/mroonga/packages/source/Makefile.am b/storage/mroonga/packages/source/Makefile.am index 143f5d0387e52..4b0dee52ba14c 100644 --- a/storage/mroonga/packages/source/Makefile.am +++ b/storage/mroonga/packages/source/Makefile.am @@ -1,17 +1,17 @@ MROONGA_BASE = $(PACKAGE)-$(VERSION) MROONGA_TAR_GZ = $(MROONGA_BASE).tar.gz -GROONGA_VERSION = 5.0.5 +GROONGA_VERSION = 7.0.6 GROONGA_BASE = groonga-$(GROONGA_VERSION) GROONGA_TAR_GZ = $(GROONGA_BASE).tar.gz -GROONGA_NORMALIZER_MYSQL_VERSION = 1.1.0 +GROONGA_NORMALIZER_MYSQL_VERSION = 1.1.1 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.20 +MARIADB_VERSION = 10.1.26 MARIADB_BASE = mariadb-$(MARIADB_VERSION) MARIADB_TAR_GZ = $(MARIADB_BASE).tar.gz @@ -29,7 +29,7 @@ CURL = curl --fail --silent --show-error all: -release: archive upload +release: download archive upload ensure-rsync-path: @if test -z "$(RSYNC_PATH)"; then \ @@ -88,6 +88,8 @@ tmp/$(MARIADB_WITH_MROONGA_BASE).stamp: $(MARIADB_WITH_MROONGA_ARCHIVES) mkdir -p $$(dirname $(BUNDLED_GROONGA_PATH)) tar xf tmp/$(GROONGA_TAR_GZ) rm -rf $(GROONGA_BASE)/test + cd $(GROONGA_BASE)/vendor && ruby download_mecab.rb + cd $(GROONGA_BASE)/vendor && ruby download_lz4.rb mv $(GROONGA_BASE) $(BUNDLED_GROONGA_PATH) tar xf tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) @@ -103,7 +105,7 @@ files/$(MARIADB_WITH_MROONGA_BASE).tar.gz: tmp/$(MARIADB_WITH_MROONGA_BASE).stam mkdir -p files/ (cd tmp && tar czf ../$@ $(MARIADB_WITH_MROONGA_BASE)) -PATCHES = \ +PATCHES = \ patches/mariadb-10.0.3-windows-build.diff tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp $(PATCHES) diff --git a/storage/mroonga/packages/ubuntu/Makefile.am b/storage/mroonga/packages/ubuntu/Makefile.am index 2297a50bfc932..7241391bcbf1c 100644 --- a/storage/mroonga/packages/ubuntu/Makefile.am +++ b/storage/mroonga/packages/ubuntu/Makefile.am @@ -1,5 +1,13 @@ -CODE_NAMES = precise,trusty,utopic,vivid +CODE_NAMES = trusty,xenial,zesty SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz +SOURCE_55_BASE = $(PACKAGE)-5.5 +SOURCE_55 = $(SOURCE_55_BASE)_$(VERSION).orig.tar.gz +SOURCE_56_BASE = $(PACKAGE)-5.6 +SOURCE_56 = $(SOURCE_56_BASE)_$(VERSION).orig.tar.gz +SOURCE_57_BASE = $(PACKAGE)-5.7 +SOURCE_57 = $(SOURCE_57_BASE)_$(VERSION).orig.tar.gz +SOURCE_MARIADB_10_0_BASE = $(PACKAGE)-mariadb-10.0 +SOURCE_MARIADB_10_0 = $(SOURCE_MARIADB_10_0_BASE)_$(VERSION).orig.tar.gz all: @@ -13,12 +21,37 @@ upload: source ensure-launchpad-configuration ./upload.rb \ --package '$(PACKAGE)' \ --version '$(VERSION)' \ - --source-archive '$(SOURCE)' \ + --source-archive-directory '$(builddir)/' \ --code-names '$(CODE_NAMES)' \ - --debian-directory '$(srcdir)/../debian/' \ + --debian-base-directory '$(srcdir)/../' \ + --ppa '$(LAUNCHPAD_PPA)' \ --pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)' -source: $(SOURCE) +source: $(SOURCE_55) $(SOURCE_56) $(SOURCE_57) $(SOURCE_MARIADB_10_0) $(SOURCE): ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE) + +$(SOURCE_55): $(SOURCE) + tar xf $(SOURCE) + mv $(PACKAGE)-$(VERSION) $(SOURCE_55_BASE)-$(VERSION) + tar cfz $(SOURCE_55) $(SOURCE_55_BASE)-$(VERSION) + rm -r $(SOURCE_55_BASE)-$(VERSION) + +$(SOURCE_56): $(SOURCE) + tar xf $(SOURCE) + mv $(PACKAGE)-$(VERSION) $(SOURCE_56_BASE)-$(VERSION) + tar cfz $(SOURCE_56) $(SOURCE_56_BASE)-$(VERSION) + rm -r $(SOURCE_56_BASE)-$(VERSION) + +$(SOURCE_57): $(SOURCE) + tar xf $(SOURCE) + mv $(PACKAGE)-$(VERSION) $(SOURCE_57_BASE)-$(VERSION) + tar cfz $(SOURCE_57) $(SOURCE_57_BASE)-$(VERSION) + rm -r $(SOURCE_57_BASE)-$(VERSION) + +$(SOURCE_MARIADB_10_0): $(SOURCE) + tar xf $(SOURCE) + mv $(PACKAGE)-$(VERSION) $(SOURCE_MARIADB_10_0_BASE)-$(VERSION) + tar cfz $(SOURCE_MARIADB_10_0) $(SOURCE_MARIADB_10_0_BASE)-$(VERSION) + rm -r $(SOURCE_MARIADB_10_0_BASE)-$(VERSION) diff --git a/storage/mroonga/packages/ubuntu/upload.rb b/storage/mroonga/packages/ubuntu/upload.rb index 8743520b5ac7f..1fedb2ecbe644 100755 --- a/storage/mroonga/packages/ubuntu/upload.rb +++ b/storage/mroonga/packages/ubuntu/upload.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # -# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014-2016 Kouhei Sutou # Copyright(C) 2014 HAYASHI Kentaro # # This library is free software; you can redistribute it and/or @@ -24,6 +24,7 @@ class Uploader def initialize @dput_configuration_name = "groonga-ppa" + @use_pbuilder = false end def run @@ -36,7 +37,22 @@ def run @required_groonga_version = required_groonga_version @code_names.each do |code_name| - upload(code_name) + mysql55_version = @mysql55_versions[code_name] + mysql56_version = @mysql56_versions[code_name] + mysql57_version = @mysql57_versions[code_name] + mariadb10_0_version = @mariadb10_0_versions[code_name] + if mysql55_version + upload(code_name, "5.5", mysql55_version) + end + if mysql56_version + upload(code_name, "5.6", mysql56_version) + end + if mysql57_version + upload(code_name, "5.7", mysql57_version) + end + if mariadb10_0_version + upload(code_name, "mariadb-10.0", mariadb10_0_version) + end end end @@ -66,18 +82,37 @@ def ensure_dput_configuration end def ensure_mysql_version - @mysql_version = {} + @mysql_versions = {} + @mysql55_versions = {} + @mysql56_versions = {} + @mysql57_versions = {} + @mariadb10_0_versions = {} @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 \((.+?)\).+/ + source_names = [code_name, "#{code_name}-updates"] + source_names.each do |source_name| + allpackages_url = + "http://packages.ubuntu.com/#{source_name}/allpackages?format=txt.gz" + open(allpackages_url) do |file| + file.each_line do |line| + case line + when /\Amysql-server \((.+?)[\s)]/ + @mysql_versions[code_name] = $1 + when /\Amysql-server-5\.5 \((.+?)[\s)]/ + @mysql55_versions[code_name] = $1 + when /\Amysql-server-5\.6 \((.+?)[\s)]/ + @mysql56_versions[code_name] = $1 + when /\Amysql-server-5\.7 \((.+?)[\s)]/ + @mysql57_versions[code_name] = $1 + when /\Amariadb-server-10\.0 \((.+?)[\s)]/ + @mariadb10_0_versions[code_name] = $1 + end + end end end end end def parse_command_line! - parser = OptionParser.new parser.on("--package=NAME", "The package name") do |name| @@ -87,59 +122,97 @@ def parse_command_line! "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 + parser.on("--source-archive-directory=DIRECTORY", + "The directory that has source archives") do |directory| + @source_archive_directory = Pathname.new(directory).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 + parser.on("--debian-base-directory=DIRECTORY", + "The directory that has debianXX/ directory") do |directory| + @debian_base_directory = Pathname.new(directory).expand_path + end + parser.on("--ppa=PPA", + "The personal package archive name (groonga-ppa or groonga-nightly") do |ppa| + @dput_configuration_name = ppa 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 + parser.on("--[no-]pbuilder", + "Use pbuilder for build check") do |use_pbuilder| + @use_pbuilder = use_pbuilder end parser.parse! end - def upload(code_name) + def upload(code_name, mysql_short_version, mysql_version) + default_mysql_version = (@mysql_versions[code_name] == mysql_version) + deb_package_name = "#{@package}-#{mysql_short_version}" 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}" + source_archive = + @source_archive_directory + "#{deb_package_name}_#{@version}.orig.tar.gz" + run_command("tar", "xf", source_archive.to_s) + directory_name = "#{deb_package_name}-#{@version}" Dir.chdir(directory_name) do - FileUtils.cp_r(@debian_directory.to_s, "debian") + debian_directory = + @debian_base_directory + "debian-#{mysql_short_version}" + 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}.") - case code_name - when "vivid" - run_command("sed", - "-i", "-e", "s,5\\.5,5.6,g", - "debian/rules") + remove_versionless_mroonga = true + if default_mysql_version or mysql_short_version.start_with?("mariadb-") + remove_versionless_mroonga = false + end + if remove_versionless_mroonga + control_content = File.read("debian/control") + File.open("debian/control", "w") do |control| + in_mysql_server_mroonga = false + control_content.each_line do |line| + case line.chomp + when "" + if in_mysql_server_mroonga + in_mysql_server_mroonga = false + else + control.print(line) + end + when "Package: mysql-server-mroonga" + in_mysql_server_mroonga = true + else + next if in_mysql_server_mroonga + control.print(line) + end + end + end end run_command("sed", - "-i", "-e", "s,MYSQL_VERSION,#{@mysql_version[code_name]},", + "-i", "-e", + "s,MYSQL_VERSION\\|MARIADB_VERSION,#{mysql_version},", "debian/control") - run_command("debuild", "-S", "-sa", "-pgpg2", "-k#{@pgp_sign_key}") + run_command("debuild", + "--no-lintian", + # Workaround for Launchpad. Launchpad doesn't accept + # .buildinfo yet. + # See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853795 + "--buildinfo-option=-O", + "-d", + "-S", + "-sa", + "-pgpg2", + "-k#{@pgp_sign_key}") if @use_pbuilder run_command("pbuilder-dist", code_name, "build", - "../#{@package}_#{deb_version}.dsc") + "../#{deb_package_name}_#{deb_version}.dsc") else run_command("dput", @dput_configuration_name, - "../#{@package}_#{deb_version}_source.changes") + "../#{deb_package_name}_#{deb_version}_source.changes") end end end diff --git a/storage/mroonga/packages/windows/Makefile.am b/storage/mroonga/packages/windows/Makefile.am index 192709fac6d72..240c3873a8928 100644 --- a/storage/mroonga/packages/windows/Makefile.am +++ b/storage/mroonga/packages/windows/Makefile.am @@ -1,12 +1,12 @@ EXTRA_DIST = \ README.md \ - build-vc2013.bat \ - build-vc2013-zip-32.bat \ - build-vc2013-zip-64.bat \ - build-vc2013-msi-32.bat \ - build-vc2013-msi-64.bat \ build-vc2015.bat \ build-vc2015-zip-32.bat \ build-vc2015-zip-64.bat \ build-vc2015-msi-32.bat \ - build-vc2015-msi-64.bat + build-vc2015-msi-64.bat \ + build-vc2017.bat \ + build-vc2017-zip-32.bat \ + build-vc2017-zip-64.bat \ + build-vc2017-msi-32.bat \ + build-vc2017-msi-64.bat diff --git a/storage/mroonga/packages/windows/README.md b/storage/mroonga/packages/windows/README.md index f220634b1e7a8..8737f26232acf 100644 --- a/storage/mroonga/packages/windows/README.md +++ b/storage/mroonga/packages/windows/README.md @@ -6,16 +6,16 @@ TODO... ## Build with Visual C++ Express -You need to use Visual C++ 2013 or later to build Mroonga with Express -edition. `build-vc2013.bat` is a build batch script to build with -Visual C++ Express 2013. +You need to use Visual Studio 2015 for Windows Desktop or later to build Mroonga with express +edition. `build-vc2015.bat` is a build batch script to build with +Visual Studio 2015 for Windows Desktop. 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 +## Build with Visual Studio Community You can build both zip file MSI file with Professional edition. But now, this feature is temporary disabled. -If you want to create MSI package, please uncomment in `build-vc2013.bat`. -And then, you can build MSI package with Visual Studio 2013 Professional. +If you want to create MSI package, please uncomment in `build-vc2015.bat`. +And then, you can build MSI package with Visual Studio 2015 Community. diff --git a/storage/mroonga/packages/windows/build-vc2013-msi-32.bat b/storage/mroonga/packages/windows/build-vc2013-msi-32.bat deleted file mode 100644 index 22b29972885b4..0000000000000 --- a/storage/mroonga/packages/windows/build-vc2013-msi-32.bat +++ /dev/null @@ -1,8 +0,0 @@ -rmdir /S /Q build-vc2013-msi-32 -mkdir build-vc2013-msi-32 -cd build-vc2013-msi-32 -cmake ..\source -G "Visual Studio 12" > config.log -cmake --build . --config RelWithDebInfo > build.log -cmake --build . --config RelWithDebInfo --target msi > msi.log -move *.msi ..\ -cd .. diff --git a/storage/mroonga/packages/windows/build-vc2013-msi-64.bat b/storage/mroonga/packages/windows/build-vc2013-msi-64.bat deleted file mode 100644 index c83a376cdb93e..0000000000000 --- a/storage/mroonga/packages/windows/build-vc2013-msi-64.bat +++ /dev/null @@ -1,8 +0,0 @@ -rmdir /S /Q build-vc2013-msi-64 -mkdir build-vc2013-msi-64 -cd build-vc2013-msi-64 -cmake ..\source -G "Visual Studio 12 Win64" > config.log -cmake --build . --config RelWithDebInfo > build.log -cmake --build . --config RelWithDebInfo --target msi > msi.log -move *.msi ..\ -cd .. diff --git a/storage/mroonga/packages/windows/build-vc2013-zip-32.bat b/storage/mroonga/packages/windows/build-vc2013-zip-32.bat deleted file mode 100644 index d3e0e4f8b8ef6..0000000000000 --- a/storage/mroonga/packages/windows/build-vc2013-zip-32.bat +++ /dev/null @@ -1,8 +0,0 @@ -rmdir /S /Q build-vc2013-zip-32 -mkdir build-vc2013-zip-32 -cd build-vc2013-zip-32 -cmake ..\source -G "Visual Studio 12" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log -cmake --build . --config RelWithDebInfo > build.log -cmake --build . --config RelWithDebInfo --target package > zip.log -move *.zip ..\ -cd .. diff --git a/storage/mroonga/packages/windows/build-vc2013-zip-64.bat b/storage/mroonga/packages/windows/build-vc2013-zip-64.bat deleted file mode 100644 index 6ca288b6a8b42..0000000000000 --- a/storage/mroonga/packages/windows/build-vc2013-zip-64.bat +++ /dev/null @@ -1,8 +0,0 @@ -rmdir /S /Q build-vc2013-zip-64 -mkdir build-vc2013-zip-64 -cd build-vc2013-zip-64 -cmake ..\source -G "Visual Studio 12 Win64" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log -cmake --build . --config RelWithDebInfo > build.log -cmake --build . --config RelWithDebInfo --target package > zip.log -move *.zip ..\ -cd .. diff --git a/storage/mroonga/packages/windows/build-vc2013.bat b/storage/mroonga/packages/windows/build-vc2013.bat deleted file mode 100644 index 99d7e4042c5bb..0000000000000 --- a/storage/mroonga/packages/windows/build-vc2013.bat +++ /dev/null @@ -1,4 +0,0 @@ -build-vc2013-zip-32.bat -build-vc2013-zip-64.bat -REM build-vc2013-msi-32.bat -REM build-vc2013-msi-64.bat diff --git a/storage/mroonga/packages/windows/build-vc2015-msi-32.bat b/storage/mroonga/packages/windows/build-vc2015-msi-32.bat index 4c92b5c02cc58..69d803e84febd 100644 --- a/storage/mroonga/packages/windows/build-vc2015-msi-32.bat +++ b/storage/mroonga/packages/windows/build-vc2015-msi-32.bat @@ -1,7 +1,7 @@ rmdir /S /Q build-vc2015-msi-32 mkdir build-vc2015-msi-32 cd build-vc2015-msi-32 -cmake ..\source -G "Visual Studio 14" > config.log +cmake ..\source -G "Visual Studio 14 2015" > config.log cmake --build . --config RelWithDebInfo > build.log cmake --build . --config RelWithDebInfo --target msi > msi.log move *.msi ..\ diff --git a/storage/mroonga/packages/windows/build-vc2015-msi-64.bat b/storage/mroonga/packages/windows/build-vc2015-msi-64.bat index 82bc2a148ec64..a3d6681bf3b43 100644 --- a/storage/mroonga/packages/windows/build-vc2015-msi-64.bat +++ b/storage/mroonga/packages/windows/build-vc2015-msi-64.bat @@ -1,7 +1,7 @@ rmdir /S /Q build-vc2015-msi-64 mkdir build-vc2015-msi-64 cd build-vc2015-msi-64 -cmake ..\source -G "Visual Studio 14 Win64" > config.log +cmake ..\source -G "Visual Studio 14 2015 Win64" > config.log cmake --build . --config RelWithDebInfo > build.log cmake --build . --config RelWithDebInfo --target msi > msi.log move *.msi ..\ diff --git a/storage/mroonga/packages/windows/build-vc2015-zip-32.bat b/storage/mroonga/packages/windows/build-vc2015-zip-32.bat index 5cef259afe5c9..8247fd542f3ab 100644 --- a/storage/mroonga/packages/windows/build-vc2015-zip-32.bat +++ b/storage/mroonga/packages/windows/build-vc2015-zip-32.bat @@ -1,7 +1,12 @@ rmdir /S /Q build-vc2015-zip-32 mkdir build-vc2015-zip-32 cd build-vc2015-zip-32 -cmake ..\source -G "Visual Studio 14" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log +cmake ..\source -G "Visual Studio 14 2015" ^ + -DMRN_GROONGA_EMBED=OFF ^ + -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF ^ + -DGRN_WITH_BUNDLED_LZ4=ON ^ + -DGRN_WITH_BUNDLED_MECAB=ON ^ + > config.log cmake --build . --config RelWithDebInfo > build.log cmake --build . --config RelWithDebInfo --target package > zip.log move *.zip ..\ diff --git a/storage/mroonga/packages/windows/build-vc2015-zip-64.bat b/storage/mroonga/packages/windows/build-vc2015-zip-64.bat index caabca179e75b..b56d80eb15159 100644 --- a/storage/mroonga/packages/windows/build-vc2015-zip-64.bat +++ b/storage/mroonga/packages/windows/build-vc2015-zip-64.bat @@ -1,7 +1,12 @@ rmdir /S /Q build-vc2015-zip-64 mkdir build-vc2015-zip-64 cd build-vc2015-zip-64 -cmake ..\source -G "Visual Studio 14 Win64" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log +cmake ..\source -G "Visual Studio 14 2015 Win64" ^ + -DMRN_GROONGA_EMBED=OFF ^ + -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF ^ + -DGRN_WITH_BUNDLED_LZ4=ON ^ + -DGRN_WITH_BUNDLED_MECAB=ON ^ + > config.log cmake --build . --config RelWithDebInfo > build.log cmake --build . --config RelWithDebInfo --target package > zip.log move *.zip ..\ diff --git a/storage/mroonga/packages/windows/build-vc2015.bat b/storage/mroonga/packages/windows/build-vc2015.bat index f9ac176579222..729f181dbe38f 100644 --- a/storage/mroonga/packages/windows/build-vc2015.bat +++ b/storage/mroonga/packages/windows/build-vc2015.bat @@ -1,4 +1,4 @@ -build-vc2015-zip-32.bat -build-vc2015-zip-64.bat +call build-vc2015-zip-32.bat +call build-vc2015-zip-64.bat REM build-vc2015-msi-32.bat REM build-vc2015--msi-64.bat diff --git a/storage/mroonga/packages/yum/Makefile.am b/storage/mroonga/packages/yum/Makefile.am index 8321619868fae..9d1bd6061c67e 100644 --- a/storage/mroonga/packages/yum/Makefile.am +++ b/storage/mroonga/packages/yum/Makefile.am @@ -1,7 +1,16 @@ REPOSITORIES_PATH = repositories DISTRIBUTIONS = centos ARCHITECTURES = i386 x86_64 -MYSQL_VARIANTS = mysql55 mysql56-community mariadb percona-server-56 +MYSQL_VARIANTS = \ + mysql55 \ + mysql56-community \ + mysql57-community \ + mariadb \ + mariadb-10.1 \ + mariadb-10.2 \ + percona-server-56 \ + percona-server-57 +CENTOS_VERSIONS = 6 7 SPEC_DIR = $(builddir)/../rpm/centos all: @@ -47,7 +56,8 @@ build-in-vm: source specs env.sh "$(PACKAGE)" \ "$(SPEC_DIR)" \ "$(MYSQL_VARIANTS)" \ - "$(ARCHITECTURES)" + "$(ARCHITECTURES)" \ + "$(CENTOS_VERSIONS)" source: tmp/$(PACKAGE)-$(VERSION).tar.gz @@ -61,4 +71,7 @@ $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz: specs: $(SPEC_DIR)/mysql55-$(PACKAGE).spec specs: $(SPEC_DIR)/mysql56-community-$(PACKAGE).spec specs: $(SPEC_DIR)/mariadb-$(PACKAGE).spec +specs: $(SPEC_DIR)/mariadb-10.1-$(PACKAGE).spec +specs: $(SPEC_DIR)/mariadb-10.2-$(PACKAGE).spec specs: $(SPEC_DIR)/percona-server-56-$(PACKAGE).spec +specs: $(SPEC_DIR)/percona-server-57-$(PACKAGE).spec diff --git a/storage/mroonga/packages/yum/Vagrantfile b/storage/mroonga/packages/yum/Vagrantfile index da41350eed31e..1c30bcca31d72 100644 --- a/storage/mroonga/packages/yum/Vagrantfile +++ b/storage/mroonga/packages/yum/Vagrantfile @@ -6,32 +6,23 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vms = [ - { - :id => "centos-5-i386", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11-i386_chef-provisionerless.box", - }, - { - :id => "centos-5-x86_64", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11_chef-provisionerless.box", - }, { :id => "centos-6-i386", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6-i386_chef-provisionerless.box", + :box => "bento/centos-6.9-i386", }, { :id => "centos-6-x86_64", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6_chef-provisionerless.box", + :box => "bento/centos-6.9", }, { :id => "centos-7-x86_64", - :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.1_chef-provisionerless.box", + :box => "bento/centos-7.3", }, ] 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.box = vm[:box] node.vm.provision(:shell, :path => "build-rpm.sh") node.vm.provider("virtualbox") do |virtual_box| system_n_cpus = 1 @@ -44,6 +35,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vm_n_cpus = 1 end virtual_box.cpus = vm_n_cpus + virtual_box.memory = (ENV["VM_MEMORY"] || 1024).to_i end end end diff --git a/storage/mroonga/packages/yum/build-in-vm.sh b/storage/mroonga/packages/yum/build-in-vm.sh index cf9ef581fd0e4..fc84e45024c71 100755 --- a/storage/mroonga/packages/yum/build-in-vm.sh +++ b/storage/mroonga/packages/yum/build-in-vm.sh @@ -1,8 +1,8 @@ #!/bin/sh -if [ $# != 4 ]; then +if [ $# != 5 ]; then echo "Usage: $0 PACKAGE SPEC_DIR MYSQL_VARIANTS ARCHITECTURES" - echo " e.g.: $0 mroonga ../rpm/centos 'mysql55 mariadb' 'i386 x86_64'" + echo " e.g.: $0 mroonga ../rpm/centos 'mysql55 mariadb' 'i386 x86_64' '6 7'" exit 1 fi @@ -10,6 +10,7 @@ PACKAGE="$1" SPEC_DIR="$2" MYSQL_VARIANTS="$3" ARCHITECTURES="$4" +CENTOS_VERSIONS="$5" run() { @@ -30,21 +31,42 @@ for mysql_variant in ${MYSQL_VARIANTS}; do architectures="${ARCHITECTURES}" case ${mysql_variant} in mysql55) - centos_versions="5 6" + centos_versions="6" ;; mysql56-community) centos_versions="6 7" ;; + mysql57-community) + centos_versions="6 7" + ;; mariadb) centos_versions="7" ;; + mariadb-10.1) + centos_versions="6 7" + ;; + mariadb-10.2) + centos_versions="6 7" + ;; percona-server-56) centos_versions="6 7" ;; + percona-server-57) + centos_versions="6 7" + ;; esac for architecture in ${architectures}; do for centos_version in ${centos_versions}; do + skip=1 + for given_version in ${CENTOS_VERSIONS}; do + if [ ${given_version} = ${centos_version} ]; then + skip=0 + fi + done + if [ $skip -eq 1 ]; then + continue + fi if [ ${mysql_variant} = mysql55 -a ${centos_version} = 6 -a ${architecture} = i386 ]; then continue fi diff --git a/storage/mroonga/packages/yum/build-rpm.sh b/storage/mroonga/packages/yum/build-rpm.sh index 8661e659390bb..6ba943ae74d32 100755 --- a/storage/mroonga/packages/yum/build-rpm.sh +++ b/storage/mroonga/packages/yum/build-rpm.sh @@ -70,36 +70,94 @@ case ${distribution} in run yum install -y mariadb-devel ;; centos) + release_rpm=groonga-release-1.3.0-1.noarch.rpm + if [ ${distribution_version} = 5 ]; then + wget http://packages.groonga.org/${distribution}/${release_rpm} + run yum install -y --nogpgcheck ${release_rpm} + rm -f ${release_rpm} + else + run yum install -y \ + http://packages.groonga.org/${distribution}/${release_rpm} + fi + run yum makecache + case ${package_name} in mysql55-${PACKAGE}) USE_MYSQLSERVICES_COMPAT=yes run yum install -y scl-utils-build if [ ${distribution_version} = 6 ]; then - run yum install -y centos-release-SCL + run yum install -y centos-release-scl fi run yum install -y mysql55-mysql-devel mysql55-build ;; - mysql56-community-${PACKAGE}) - release_rpm=mysql-community-release-el${distribution_version}-5.noarch.rpm + mysql5?-community-${PACKAGE}) + release_rpm=mysql-community-release-el${distribution_version}-7.noarch.rpm run yum -y install http://repo.mysql.com/${release_rpm} - run yum -y install mysql-community-devel + if [ "${package_name}" = "mysql57-community-${PACKAGE}" ]; then + run yum install -y yum-utils + run yum-config-manager --disable mysql56-community + run yum-config-manager --enable mysql57-community + if [ ${distribution_version} = 6 ]; then + run yum install -y cmake28 + fi + fi + run yum install -y mysql-community-devel ;; mariadb-${PACKAGE}) - run yum -y install mariadb-devel - ;; + run yum install -y mariadb-devel + ;; + mariadb-10.1-${PACKAGE}) + if [ "${architecture}" = "x86_64" ]; then + mariadb_architecture="amd64" + else + mariadb_architecture="x86" + fi + cat < /etc/yum.repos.d/MariaDB.repo +[mariadb] +name = MariaDB +baseurl = http://yum.mariadb.org/10.1/${distribution}${distribution_version}-${mariadb_architecture} +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 +REPO + run yum install -y MariaDB-devel + if [ ${distribution_version} = 6 ]; then + run yum install -y cmake28 + fi + ;; + mariadb-10.2-${PACKAGE}) + if [ "${architecture}" = "x86_64" ]; then + mariadb_architecture="amd64" + else + mariadb_architecture="x86" + fi + cat < /etc/yum.repos.d/MariaDB.repo +[mariadb] +name = MariaDB +baseurl = http://yum.mariadb.org/10.2/${distribution}${distribution_version}-${mariadb_architecture} +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 +REPO + run yum install -y MariaDB-devel + if [ ${distribution_version} = 6 ]; then + run yum install -y cmake28 + fi + ;; percona-server-56-${PACKAGE}) - release_rpm_version=0.1-3 + release_rpm_version=0.1-4 + release_rpm=percona-release-${release_rpm_version}.noarch.rpm + run yum install -y http://www.percona.com/downloads/percona-release/redhat/${release_rpm_version}/${release_rpm} + run yum install -y Percona-Server-devel-56 + ;; + percona-server-57-${PACKAGE}) + release_rpm_version=0.1-4 release_rpm=percona-release-${release_rpm_version}.noarch.rpm - run yum -y install http://www.percona.com/downloads/percona-release/redhat/${release_rpm_version}/${release_rpm} - run yum -y install Percona-Server-devel-56 + run yum install -y http://www.percona.com/downloads/percona-release/redhat/${release_rpm_version}/${release_rpm} + run yum install -y Percona-Server-devel-57 + if [ ${distribution_version} = 6 ]; then + run yum install -y cmake28 + fi ;; esac - - release_rpm=groonga-release-1.1.0-1.noarch.rpm - wget http://packages.groonga.org/${distribution}/${release_rpm} - run rpm -U ${release_rpm} - rm -f ${release_rpm} - run yum makecache ;; esac run yum install -y ${DEPENDED_PACKAGES} @@ -109,6 +167,11 @@ if [ "${package_name}" = "percona-server-56-${PACKAGE}" ]; then rpmbuild_options="$rpmbuild_options --define 'dist .el7'" fi fi +if [ "${package_name}" = "percona-server-57-${PACKAGE}" ]; then + if [ "${distribution_version}" = "7" ]; then + rpmbuild_options="$rpmbuild_options --define 'dist .el7'" + fi +fi if [ "${USE_MYSQLSERVICES_COMPAT}" = "yes" ]; then rpmbuild_options="$rpmbuild_options --define 'mroonga_configure_options --with-libmysqlservices-compat'" fi diff --git a/storage/mroonga/packages/yum/env.sh.in b/storage/mroonga/packages/yum/env.sh.in index 8c6d05baf5c16..3d327a17efb81 100644 --- a/storage/mroonga/packages/yum/env.sh.in +++ b/storage/mroonga/packages/yum/env.sh.in @@ -9,6 +9,7 @@ make gperf readline-devel openssl-devel +zlib-devel time wget ncurses-devel @@ -23,6 +24,9 @@ perl-Env perl-Test-Simple pam-devel selinux-policy-devel +numactl-devel groonga-devel groonga-normalizer-mysql-devel +cyrus-sasl-devel +openldap-devel " diff --git a/storage/mroonga/packages/yum/update-repository.sh b/storage/mroonga/packages/yum/update-repository.sh index 630b6c87422d3..59eeafa55aa07 100755 --- a/storage/mroonga/packages/yum/update-repository.sh +++ b/storage/mroonga/packages/yum/update-repository.sh @@ -22,8 +22,6 @@ run() for distribution in ${DISTRIBUTIONS}; do for dir in ${DESTINATION}${distribution}/*/*; do - # "--checksum sha" is for CentOS 5. If we drop CentOS 5 support, - # we can remove the option. - test -d $dir && run createrepo --checksum sha $dir + test -d $dir && run createrepo $dir done; done diff --git a/storage/mroonga/plugin_version b/storage/mroonga/plugin_version index 48c32b26a12f0..f5cce03c304f3 100644 --- a/storage/mroonga/plugin_version +++ b/storage/mroonga/plugin_version @@ -1 +1 @@ -5.4 \ No newline at end of file +7.6 \ No newline at end of file diff --git a/storage/mroonga/required_groonga_version b/storage/mroonga/required_groonga_version index a1ef0cae18334..024b4b9b53aba 100644 --- a/storage/mroonga/required_groonga_version +++ b/storage/mroonga/required_groonga_version @@ -1 +1 @@ -5.0.2 +7.0.6 diff --git a/storage/mroonga/test/run-sql-test.sh b/storage/mroonga/test/run-sql-test.sh index f1679dc70fa2e..570907791cc39 100755 --- a/storage/mroonga/test/run-sql-test.sh +++ b/storage/mroonga/test/run-sql-test.sh @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright(C) 2010 Tetsuro IKEDA -# Copyright(C) 2010-2013 Kouhei Sutou +# Copyright(C) 2010-2015 Kouhei Sutou # Copyright(C) 2011 Kazuhiko # # This library is free software; you can redistribute it and/or @@ -16,7 +16,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA export BASE_DIR="$(cd $(dirname $0); pwd)" top_dir="$BASE_DIR/.." @@ -24,31 +24,44 @@ mroonga_test_dir="${top_dir}/mysql-test/mroonga" n_processors=1 case `uname` in - Linux) - n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)" - ;; - Darwin) - n_processors="$(/usr/sbin/sysctl -n hw.ncpu)" - ;; - *) - : - ;; + Linux) + n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)" + ;; + Darwin) + n_processors="$(/usr/sbin/sysctl -n hw.ncpu)" + ;; + *) + : + ;; esac if [ "$NO_MAKE" != "yes" ]; then - MAKE_ARGS= - if [ -n "$n_processors" ]; then - MAKE_ARGS="-j${n_processors}" - fi - make $MAKE_ARGS -C $top_dir > /dev/null || exit 1 + MAKE_ARGS= + if [ -n "$n_processors" ]; then + MAKE_ARGS="-j${n_processors}" + fi + make $MAKE_ARGS -C $top_dir > /dev/null || exit 1 fi . "${top_dir}/config.sh" bundled_groonga_normalizer_mysql_dir="${top_dir}/vendor/groonga/vendor/plugins/groonga-normalizer-mysql" if [ -d "${bundled_groonga_normalizer_mysql_dir}" ]; then - GRN_PLUGINS_DIR="${bundled_groonga_normalizer_mysql_dir}" - export GRN_PLUGINS_DIR + GRN_PLUGINS_DIR="${bundled_groonga_normalizer_mysql_dir}" + export GRN_PLUGINS_DIR +fi + +maria_storage_dir="${MYSQL_SOURCE_DIR}/storage/maria" +if [ -d "${maria_storage_dir}" ]; then + mariadb="yes" +else + mariadb="no" +fi +percona_udf_dir="${MYSQL_SOURCE_DIR}/plugin/percona-udf" +if [ -d "${percona_udf_dir}" ]; then + percona="yes" +else + percona="no" fi source_mysql_test_dir="${MYSQL_SOURCE_DIR}/mysql-test" @@ -58,51 +71,47 @@ source_test_include_dir="${source_mysql_test_dir}/include" build_test_suites_dir="${build_mysql_test_dir}/suite" build_test_include_dir="${build_mysql_test_dir}/include" case "${MYSQL_VERSION}" in - 5.1.*) - plugins_dir="${MYSQL_BUILD_DIR}/lib/mysql/plugin" - if [ ! -d "${build_test_suites_dir}" ]; then - mkdir -p "${build_test_suites_dir}" - fi - ;; - *) - if [ ! -d "${build_test_suites_dir}" ]; then - ln -s "${source_test_suites_dir}" "${build_test_suites_dir}" - fi - maria_storage_dir="${MYSQL_SOURCE_DIR}/storage/maria" - if [ -d "${maria_storage_dir}" ]; then - mariadb="yes" - else - mariadb="no" - fi - if [ "${mariadb}" = "yes" ]; then - if [ "${MRN_BUNDLED}" != "TRUE" ]; then - mariadb_mroonga_plugin_dir="${MYSQL_BUILD_DIR}/plugin/mroonga" - if [ ! -e "${mariadb_mroonga_plugin_dir}" ]; then - ln -s "${top_dir}" "${mariadb_mroonga_plugin_dir}" - fi - fi - plugins_dir= - else - plugins_dir="${MYSQL_SOURCE_DIR}/lib/plugin" + 5.1.*) + plugins_dir="${MYSQL_BUILD_DIR}/lib/mysql/plugin" + if [ ! -d "${build_test_suites_dir}" ]; then + mkdir -p "${build_test_suites_dir}" + fi + ;; + *) + if [ ! -d "${build_test_suites_dir}" ]; then + ln -s "${source_test_suites_dir}" "${build_test_suites_dir}" + fi + if [ "${mariadb}" = "yes" ]; then + if [ "${MRN_BUNDLED}" != "TRUE" ]; then + mariadb_mroonga_plugin_dir="${MYSQL_BUILD_DIR}/plugin/mroonga" + if [ ! -e "${mariadb_mroonga_plugin_dir}" ]; then + ln -s "${top_dir}" "${mariadb_mroonga_plugin_dir}" fi - ;; + fi + plugins_dir= + elif [ "${percona}" = "yes" ]; then + plugins_dir="${MYSQL_SOURCE_DIR}/lib/mysql/plugin" + else + plugins_dir="${MYSQL_SOURCE_DIR}/lib/plugin" + fi + ;; esac same_link_p() { - src=$1 - dest=$2 - if [ -L "$dest" -a "$(readlink "$dest")" = "$src" ]; then - return 0 - else - return 1 - fi + src=$1 + dest=$2 + if [ -L "$dest" -a "$(readlink "$dest")" = "$src" ]; then + return 0 + else + return 1 + fi } mroonga_mysql_test_suite_dir="${build_test_suites_dir}/mroonga" if ! same_link_p "${mroonga_test_dir}" "${mroonga_mysql_test_suite_dir}"; then - rm -rf "${mroonga_mysql_test_suite_dir}" - ln -s "${mroonga_test_dir}" "${mroonga_mysql_test_suite_dir}" + rm -rf "${mroonga_mysql_test_suite_dir}" + ln -s "${mroonga_test_dir}" "${mroonga_mysql_test_suite_dir}" fi innodb_test_suite_dir="${build_test_suites_dir}/innodb" @@ -110,27 +119,27 @@ mroonga_wrapper_innodb_test_suite_name="mroonga_wrapper_innodb" mroonga_wrapper_innodb_test_suite_dir="${build_test_suites_dir}/${mroonga_wrapper_innodb_test_suite_name}" mroonga_wrapper_innodb_include_dir="${mroonga_wrapper_innodb_test_suite_dir}/include/" if [ "$0" -nt "$(dirname "${mroonga_wrapper_innodb_test_suite_dir}")" ]; then - rm -rf "${mroonga_wrapper_innodb_test_suite_dir}" + rm -rf "${mroonga_wrapper_innodb_test_suite_dir}" fi if [ ! -d "${mroonga_wrapper_innodb_test_suite_dir}" ]; then - cp -rp "${innodb_test_suite_dir}" "${mroonga_wrapper_innodb_test_suite_dir}" - mkdir -p "${mroonga_wrapper_innodb_include_dir}" - cp -rp "${source_test_include_dir}"/innodb[-_]*.inc \ - "${mroonga_wrapper_innodb_include_dir}" - ruby -i'' \ - -pe "\$_.gsub!(/\\bengine\\s*=\\s*innodb\\b([^;\\n]*)/i, + cp -rp "${innodb_test_suite_dir}" "${mroonga_wrapper_innodb_test_suite_dir}" + mkdir -p "${mroonga_wrapper_innodb_include_dir}" + cp -rp "${source_test_include_dir}"/innodb[-_]*.inc \ + "${mroonga_wrapper_innodb_include_dir}" + ruby -i'' \ + -pe "\$_.gsub!(/\\bengine\\s*=\\s*innodb\\b([^;\\n]*)/i, \"ENGINE=mroonga\\\1 COMMENT='ENGINE \\\"InnoDB\\\"'\") \$_.gsub!(/\\b(storage_engine\\s*=\\s*)innodb\\b([^;\\n]*)/i, \"\\\1mroonga\") \$_.gsub!(/^(--\\s*source\\s+)(include\\/innodb)/i, \"\\\1suite/mroonga_wrapper_innodb/\\\2\") " \ - ${mroonga_wrapper_innodb_test_suite_dir}/r/*.result \ - ${mroonga_wrapper_innodb_test_suite_dir}/t/*.test \ - ${mroonga_wrapper_innodb_test_suite_dir}/include/*.inc - sed -i'' \ - -e '1 i --source ../mroonga/include/mroonga/have_mroonga.inc' \ - ${mroonga_wrapper_innodb_test_suite_dir}/t/*.test + ${mroonga_wrapper_innodb_test_suite_dir}/r/*.result \ + ${mroonga_wrapper_innodb_test_suite_dir}/t/*.test \ + ${mroonga_wrapper_innodb_test_suite_dir}/include/*.inc + sed -i'' \ + -e '1 i --source ../mroonga/include/mroonga/have_mroonga.inc' \ + ${mroonga_wrapper_innodb_test_suite_dir}/t/*.test fi all_test_suite_names="" @@ -138,83 +147,87 @@ suite_dir="${mroonga_test_dir}/.." cd "${suite_dir}" suite_dir="$(pwd)" for test_suite_name in \ - $(find mroonga -type d -name 'include' '!' -prune -o \ - -type d '!' -name 'mroonga' \ - '!' -name 'include' \ - '!' -name '[tr]'); do - if [ -n "${all_test_suite_names}" ]; then - all_test_suite_names="${all_test_suite_names}," - fi - all_test_suite_names="${all_test_suite_names}${test_suite_name}" + $(find mroonga -type d -name 'include' '!' -prune -o \ + -type d '!' -name 'mroonga' \ + '!' -name 'include' \ + '!' -name '[tr]'); do + if [ -n "${all_test_suite_names}" ]; then + all_test_suite_names="${all_test_suite_names}," + fi + all_test_suite_names="${all_test_suite_names}${test_suite_name}" done cd - if [ -n "${plugins_dir}" ]; then - if [ -d "${top_dir}/.libs" ]; then - make -C ${top_dir} \ - install-pluginLTLIBRARIES \ - plugindir=${plugins_dir} > /dev/null || \ - exit 1 - else - mkdir -p "${plugins_dir}" - cp "${top_dir}/ha_mroonga.so" "${plugins_dir}" || exit 1 - fi + if [ -d "${top_dir}/.libs" ]; then + make -C ${top_dir} \ + install-pluginLTLIBRARIES \ + plugindir=${plugins_dir} > /dev/null || \ + exit 1 + else + mkdir -p "${plugins_dir}" + cp "${top_dir}/ha_mroonga.so" "${plugins_dir}" || exit 1 + fi fi +mysql_test_run_options="" test_suite_names="" test_names="" while [ $# -gt 0 ]; do - case "$1" in - --manual-gdb|--debug) - n_processors=1 - break - ;; - --*) - break - ;; + arg="$1" + shift + case "$arg" in + --manual-gdb|--gdb|--client-gdb|--boot-gdb|--debug|--valgrind) + n_processors=1 + mysql_test_run_options="${mysql_test_run_options} ${arg}" + ;; + --*) + mysql_test_run_options="${mysql_test_run_options} ${arg}" + ;; + *) + case "$arg" in + */t/*.test) + test_suite_name=$(echo "$arg" | sed -e 's,/t/.*\.test,,g') + test_suite_name=$(cd "$test_suite_name" && pwd) + test_name=$(echo "$arg" | sed -e 's,.*/t/\(.*\)\.test,\1,g') + ;; *) - case "$1" in - */t/*.test) - test_suite_name=$(echo "$1" | sed -e 's,/t/.*\.test,,g') - test_suite_name=$(cd "$test_suite_name" && pwd) - test_name=$(echo "$1" | sed -e 's,.*/t/\(.*\)\.test,\1,g') - ;; - *) - if [ -d "$1" ]; then - test_suite_name=$(cd "$1" && pwd) - else - test_suite_name="$1" - fi - test_name="" - ;; - esac - shift - - if [ -n "${test_name}" ]; then - if [ -n "${test_names}" ]; then - test_names="${test_names}|" - fi - test_names="${test_names}.*${test_name}" - fi - - test_suite_name=$(echo "$test_suite_name" | sed -e "s,^${suite_dir}/,,") - if echo "${test_suite_names}" | grep --quiet "${test_suite_name}"; then - continue - fi - if [ -n "${test_suite_names}" ]; then - test_suite_names="${test_suite_names}," - fi - test_suite_names="${test_suite_names}${test_suite_name}" - ;; - esac + if [ -d "$arg" ]; then + test_suite_name=$(cd "$arg" && pwd) + else + test_suite_name="$arg" + fi + test_name="" + ;; + esac + + if [ -n "${test_name}" ]; then + if [ -n "${test_names}" ]; then + test_names="${test_names}|" + fi + test_names="${test_names}${test_name}" + fi + + test_suite_name=$(echo "$test_suite_name" | sed -e "s,^${suite_dir}/,,") + if echo "${test_suite_names}" | grep --quiet "${test_suite_name}"; then + continue + fi + if [ -n "${test_suite_names}" ]; then + test_suite_names="${test_suite_names}," + fi + test_suite_names="${test_suite_names}${test_suite_name}" + ;; + esac done if [ -z "$test_suite_names" ]; then - test_suite_names="${all_test_suite_names}" + test_suite_names="${all_test_suite_names}" fi mysql_test_run_args="" -mysql_test_run_args="${mysql_test_run_args} --mem" +if [ "${percona}" != "yes" ]; then + mysql_test_run_args="${mysql_test_run_args} --mem" +fi mysql_test_run_args="${mysql_test_run_args} --no-check-testcases" mysql_test_run_args="${mysql_test_run_args} --parallel=${n_processors}" mysql_test_run_args="${mysql_test_run_args} --retry=1" @@ -223,10 +236,10 @@ mysql_test_run_args="${mysql_test_run_args} --force" mysql_test_run_args="${mysql_test_run_args} --mysqld=--loose-plugin-load-add=ha_mroonga.so" mysql_test_run_args="${mysql_test_run_args} --mysqld=--loose-plugin-mroonga=ON" if [ -n "$test_names" ]; then - mysql_test_run_args="${mysql_test_run_args} --do-test=${test_names}" + mysql_test_run_args="${mysql_test_run_args} --do-test=${test_names}" fi (cd "$build_mysql_test_dir" && \ - ./mysql-test-run.pl \ - ${mysql_test_run_args} \ - "$@") + perl -I . ./mysql-test-run.pl \ + ${mysql_test_run_args} \ + ${mysql_test_run_options}) diff --git a/storage/mroonga/test/unit/test_mrn_path_mapper.cpp b/storage/mroonga/test/unit/test_mrn_path_mapper.cpp index a5d0d81c3404c..54a9f35b03f53 100644 --- a/storage/mroonga/test/unit/test_mrn_path_mapper.cpp +++ b/storage/mroonga/test/unit/test_mrn_path_mapper.cpp @@ -14,7 +14,7 @@ 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 02111-1301 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/storage/mroonga/tools/prepare-sphinx-html.rb b/storage/mroonga/tools/prepare-sphinx-html.rb index 76eed24a04242..71e12f0e3cab5 100755 --- a/storage/mroonga/tools/prepare-sphinx-html.rb +++ b/storage/mroonga/tools/prepare-sphinx-html.rb @@ -48,13 +48,6 @@ def fix_html_link(html, language) end end -def add_language_annotation_to_source_label(html) - html.gsub(/>(ソースコードを表示)#{label}(英語)<" - end -end - def fix_js_link(js, language) fix_link_path(js) end @@ -156,7 +149,6 @@ def insert_facebook_html(html, language) content = fix_link(content, extension, language) if extension == "html" content = insert_facebook_html(content, language) - content = add_language_annotation_to_source_label(content) end dest_path.open("wb") do |dest| dest.print(content.strip) diff --git a/storage/mroonga/tools/travis/before_script.sh b/storage/mroonga/tools/travis/before_script.sh index 2b4591a60a44b..e3e22c8768aea 100755 --- a/storage/mroonga/tools/travis/before_script.sh +++ b/storage/mroonga/tools/travis/before_script.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright(C) 2012-2015 Kouhei Sutou +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -14,7 +14,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # set -x set -e @@ -40,6 +40,7 @@ if [ "${MROONGA_BUNDLED}" = "yes" ]; then cmake_args=("${cmake_args[@]}" -DWITHOUT_TOKUDB=TRUE) if [ "${MROONGA_TEST_EMBEDDED}" = "yes" ]; then cmake_args=("${cmake_args[@]}" -DWITH_EMBEDDED_SERVER=TRUE) + cmake_args=("${cmake_args[@]}" -DMRN_BUILD_FOR_EMBEDDED_SERVER=TRUE) fi cmake . "${cmake_args[@]}" else @@ -49,9 +50,48 @@ else PATH=$(echo /opt/mysql/server-*/bin/):$PATH fi configure_args=("--with-mysql-source=$PWD/vendor/mysql") - if [ "${MYSQL_VERSION}" = "mysql-5.6.25" ]; then - configure_args=("${configure_args[@]}" --enable-fast-mutexes) - fi + case "${MYSQL_VERSION}" in + mysql-5.6) + configure_args=("${configure_args[@]}" --enable-fast-mutexes) + ;; + mysql-5.7) + boost_archive=boost_1_59_0.tar.gz + curl -L -O http://downloads.sourceforge.net/project/boost/boost/1.59.0/${boost_archive} + sudo mkdir -p /usr/global/share + sudo mv ${boost_archive} /usr/global/share/ + (cd vendor/mysql && sudo debian/rules override_dh_auto_configure) + ;; + mariadb-5.5) + (cd vendor/mysql && sudo debian/rules configure) + configure_args=("${configure_args[@]}" + "--with-mysql-build=$PWD/vendor/mysql/builddir") + ;; + percona-server-5.6) + (cd vendor/mysql && \ + sudo debian/rules configure SKIP_DEBUG_BINARY=yes && \ + cd builddir/libservices && \ + sudo make > /dev/null && \ + cd ../extra && \ + sudo make > /dev/null) + configure_args=("${configure_args[@]}" + "--enable-fast-mutexes" + "--with-mysql-build=$PWD/vendor/mysql/builddir" + "--with-mysql-config=$PWD/vendor/mysql/builddir/scripts/mysql_config") + ;; + percona-server-5.7) + (cd vendor/mysql && \ + sudo debian/rules override_dh_auto_configure SKIP_DEBUG_BINARY=yes && \ + cd builddir/libservices && \ + sudo make > /dev/null && \ + cd ../extra && \ + sudo make > /dev/null) + configure_args=("${configure_args[@]}" + "--with-mysql-build=$PWD/vendor/mysql/builddir" + "--with-mysql-config=$PWD/vendor/mysql/builddir/scripts/mysql_config") + ;; + *) + : + ;; + esac ./configure "${configure_args[@]}" - cat "$(mysql_config --include | sed -e 's/-I//g')/my_config.h" fi diff --git a/storage/mroonga/tools/travis/install.sh b/storage/mroonga/tools/travis/install.sh index c723eb69f3573..e9f8546302989 100755 --- a/storage/mroonga/tools/travis/install.sh +++ b/storage/mroonga/tools/travis/install.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright(C) 2012-2015 Kouhei Sutou +# Copyright(C) 2012-2017 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -14,21 +14,49 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# set -x +set -x set -e +# export GROONGA_MASTER=yes +# export GROONGA_NORMALIZER_MYSQL_MASTER=yes + mariadb_download_base=http://mirror.jmu.edu/pub/mariadb -export GROONGA_MASTER=yes -export GROONGA_NORMALIZER_MYSQL_MASTER=yes +version=$(echo "$MYSQL_VERSION" | sed -r -e 's/^(mysql|mariadb|percona-server)-//') +series=$(echo "$version" | sed -r -e 's/^([0-9]+\.[0-9]+).*$/\1/g') + +setup_mariadb_apt() +{ + distribution=$(lsb_release --short --id | tr 'A-Z' 'a-z') + code_name=$(lsb_release --short --codename) + component=main + apt_url_base="${mariadb_download_base}/repo/${series}" + cat < +# Copyright(C) 2012-2016 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -14,7 +14,7 @@ # # 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 02111-1301 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # set -x set -e @@ -43,11 +43,7 @@ fi build() { - if [ "${MROONGA_BUNDLED}" = "yes" ]; then - make -j${n_processors} > /dev/null - else - make -j${n_processors} > /dev/null - fi + make -j${n_processors} > /dev/null } run_unit_test() @@ -62,8 +58,12 @@ prepare_mysql_test_dir() mysql_test_dir=/usr/mysql-test if [ -d /usr/lib/mysql-testsuite/ ]; then sudo cp -a /usr/lib/mysql-testsuite/ ${mysql_test_dir}/ + elif [ -d /usr/lib/mysql-test/ ]; then + sudo cp -a /usr/lib/mysql-test/ ${mysql_test_dir}/ elif [ -d /usr/share/mysql/mysql-test/ ]; then sudo cp -a /usr/share/mysql/mysql-test/ ${mysql_test_dir}/ + elif [ -d /usr/share/mysql-test/ ]; then + sudo cp -a /usr/share/mysql-test/ ${mysql_test_dir}/ elif [ -d /opt/mysql/ ]; then mysql_test_dir=$(echo /opt/mysql/server-*/mysql-test) else @@ -100,6 +100,9 @@ run_sql_test() if [ "${MROONGA_TEST_EMBEDDED}" = "yes" ]; then test_args=("${test_args[@]}" "--embedded-server") fi + if [ "${MROONGA_TEST_PS_PROTOCOL}" = "yes" ]; then + test_args=("${test_args[@]}" "--ps-protocol") + fi if [ "${MROONGA_BUNDLED}" = "yes" ]; then # Plugins aren't supported. @@ -112,16 +115,17 @@ run_sql_test() ${mroonga_dir}/test/run-sql-test.sh \ "${test_args[@]}" \ - --parallel="${n_processors}" + --parallel="${n_processors}" \ + --retry=3 else prepare_sql_test cd ${mysql_test_dir}/ - ./mysql-test-run.pl \ + perl ./mysql-test-run.pl \ "${test_args[@]}" \ --no-check-testcases \ --parallel="${n_processors}" \ - --retry=1 \ + --retry=3 \ --suite="${test_suite_names}" \ --force fi diff --git a/storage/mroonga/udf/mrn_udf_command.cpp b/storage/mroonga/udf/mrn_udf_command.cpp index d14f3ffd49dce..b4d0f8b20a3a4 100644 --- a/storage/mroonga/udf/mrn_udf_command.cpp +++ b/storage/mroonga/udf/mrn_udf_command.cpp @@ -2,7 +2,7 @@ /* Copyright(C) 2010 Tetsuro IKEDA Copyright(C) 2010-2013 Kentoku SHIBA - Copyright(C) 2011-2013 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -25,39 +25,93 @@ #include #include #include +#include #include +#include + +#include MRN_BEGIN_DECLS extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; struct CommandInfo { - grn_ctx ctx; + grn_ctx *ctx; grn_obj *db; bool use_shared_db; + grn_obj command; String result; }; -MRN_API my_bool mroonga_command_init(UDF_INIT *initid, UDF_ARGS *args, +MRN_API my_bool mroonga_command_init(UDF_INIT *init, UDF_ARGS *args, char *message) { CommandInfo *info = NULL; - initid->ptr = NULL; - if (args->arg_count != 1) { - sprintf(message, - "mroonga_command(): Incorrect number of arguments: %u for 1", - args->arg_count); + init->ptr = NULL; + if (args->arg_count == 0) { + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): Wrong number of arguments: %u for 1..", + args->arg_count); goto error; } - if (args->arg_type[0] != STRING_RESULT) { - strcpy(message, - "mroonga_command(): The 1st argument must be command as string"); + + if ((args->arg_count % 2) == 0) { + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): The number of arguments must be odd: %u", + args->arg_count); goto error; } - initid->maybe_null = 1; - initid->const_item = 1; + + for (unsigned int i = 0; i < args->arg_count; ++i) { + switch (args->arg_type[i]) { + case STRING_RESULT: + // OK + break; + case REAL_RESULT: + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): Argument must be string: <%g>", + *reinterpret_cast(args->args[i])); + goto error; + break; + case INT_RESULT: + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): Argument must be string: <%lld>", + *reinterpret_cast(args->args[i])); + goto error; + break; + case DECIMAL_RESULT: + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): Argument must be string: <%.*s>", + static_cast(args->lengths[i]), + args->args[i]); + goto error; + break; + default: + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): Argument must be string: <%d>(%u)", + args->arg_type[i], + i); + goto error; + break; + } + } + init->maybe_null = 1; + init->const_item = 0; info = (CommandInfo *)mrn_my_malloc(sizeof(CommandInfo), MYF(MY_WME | MY_ZEROFILL)); @@ -66,53 +120,100 @@ MRN_API my_bool mroonga_command_init(UDF_INIT *initid, UDF_ARGS *args, goto error; } - grn_ctx_init(&(info->ctx), 0); + info->ctx = mrn_context_pool->pull(); { const char *current_db_path = MRN_THD_DB_PATH(current_thd); const char *action; if (current_db_path) { action = "open database"; - int error = mrn_db_manager->open(current_db_path, &(info->db)); + char encoded_db_path[FN_REFLEN + 1]; + uint encoded_db_path_length = + tablename_to_filename(current_db_path, + encoded_db_path, + sizeof(encoded_db_path)); + encoded_db_path[encoded_db_path_length] = '\0'; + mrn::Database *db; + int error = mrn_db_manager->open(encoded_db_path, &db); if (error == 0) { - grn_ctx_use(&(info->ctx), info->db); + info->db = db->get(); + grn_ctx_use(info->ctx, info->db); info->use_shared_db = true; } } else { action = "create anonymous database"; - info->db = grn_db_create(&(info->ctx), NULL, NULL); + info->db = grn_db_create(info->ctx, NULL, NULL); info->use_shared_db = false; } if (!info->db) { - sprintf(message, - "mroonga_command(): failed to %s: %s", - action, - info->ctx.errbuf); + grn_snprintf(message, + MYSQL_ERRMSG_SIZE, + MYSQL_ERRMSG_SIZE, + "mroonga_command(): failed to %s: %s", + action, + info->ctx->errbuf); goto error; } } + GRN_TEXT_INIT(&(info->command), 0); - initid->ptr = (char *)info; + init->ptr = (char *)info; return FALSE; error: if (info) { if (!info->use_shared_db) { - grn_obj_close(&(info->ctx), info->db); + grn_obj_close(info->ctx, info->db); } - grn_ctx_fin(&(info->ctx)); + mrn_context_pool->release(info->ctx); my_free(info); } return TRUE; } -MRN_API char *mroonga_command(UDF_INIT *initid, UDF_ARGS *args, char *result, +static void mroonga_command_escape_value(grn_ctx *ctx, + grn_obj *command, + const char *value, + unsigned long value_length) +{ + GRN_TEXT_PUTC(ctx, command, '"'); + + const char *value_current = value; + const char *value_end = value_current + value_length; + while (value_current < value_end) { + int char_length = grn_charlen(ctx, value_current, value_end); + + if (char_length == 0) { + break; + } else if (char_length == 1) { + switch (*value_current) { + case '\\': + case '"': + GRN_TEXT_PUTC(ctx, command, '\\'); + GRN_TEXT_PUTC(ctx, command, *value_current); + break; + case '\n': + GRN_TEXT_PUTS(ctx, command, "\\n"); + break; + default: + GRN_TEXT_PUTC(ctx, command, *value_current); + break; + } + } else { + GRN_TEXT_PUT(ctx, command, value_current, char_length); + } + + value_current += char_length; + } + + GRN_TEXT_PUTC(ctx, command, '"'); +} + +MRN_API char *mroonga_command(UDF_INIT *init, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error) { - CommandInfo *info = (CommandInfo *)initid->ptr; - grn_ctx *ctx = &(info->ctx); - char *command; - unsigned int command_length; + CommandInfo *info = (CommandInfo *)init->ptr; + grn_ctx *ctx = info->ctx; int flags = 0; if (!args->args[0]) { @@ -120,11 +221,31 @@ MRN_API char *mroonga_command(UDF_INIT *initid, UDF_ARGS *args, char *result, return NULL; } + GRN_BULK_REWIND(&(info->command)); + GRN_TEXT_PUT(ctx, &(info->command), args->args[0], args->lengths[0]); + for (unsigned int i = 1; i < args->arg_count; i += 2) { + if (!args->args[i] || !args->args[i + 1]) { + *is_null = 1; + return NULL; + } + + const char *name = args->args[i]; + unsigned long name_length = args->lengths[i]; + GRN_TEXT_PUTS(ctx, &(info->command), " --"); + GRN_TEXT_PUT(ctx, &(info->command), name, name_length); + + const char *value = args->args[i + 1]; + unsigned long value_length = args->lengths[i + 1]; + GRN_TEXT_PUTS(ctx, &(info->command), " "); + mroonga_command_escape_value(ctx, &(info->command), value, value_length); + } + *is_null = 0; - command = args->args[0]; - command_length = args->lengths[0]; - grn_ctx_send(ctx, command, command_length, 0); + grn_ctx_send(ctx, + GRN_TEXT_VALUE(&(info->command)), + GRN_TEXT_LEN(&(info->command)), + 0); if (ctx->rc) { my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); goto error; @@ -156,14 +277,15 @@ MRN_API char *mroonga_command(UDF_INIT *initid, UDF_ARGS *args, char *result, return NULL; } -MRN_API void mroonga_command_deinit(UDF_INIT *initid) +MRN_API void mroonga_command_deinit(UDF_INIT *init) { - CommandInfo *info = (CommandInfo *)initid->ptr; + CommandInfo *info = (CommandInfo *)init->ptr; if (info) { + GRN_OBJ_FIN(info->ctx, &(info->command)); if (!info->use_shared_db) { - grn_obj_close(&(info->ctx), info->db); + grn_obj_close(info->ctx, info->db); } - grn_ctx_fin(&(info->ctx)); + mrn_context_pool->release(info->ctx); MRN_STRING_FREE(info->result); my_free(info); } diff --git a/storage/mroonga/udf/mrn_udf_escape.cpp b/storage/mroonga/udf/mrn_udf_escape.cpp index 89b08a1c6d520..b97327fb1d0ce 100644 --- a/storage/mroonga/udf/mrn_udf_escape.cpp +++ b/storage/mroonga/udf/mrn_udf_escape.cpp @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* - Copyright(C) 2013-2015 Kouhei Sutou + Copyright(C) 2013-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,33 +23,56 @@ #include #include #include +#include MRN_BEGIN_DECLS +extern mrn::ContextPool *mrn_context_pool; + struct EscapeInfo { - grn_ctx ctx; + grn_ctx *ctx; + bool script_mode; grn_obj target_characters; - grn_obj escaped_query; - bool processed; + grn_obj escaped_value; }; -MRN_API my_bool mroonga_escape_init(UDF_INIT *initid, UDF_ARGS *args, +MRN_API my_bool mroonga_escape_init(UDF_INIT *init, UDF_ARGS *args, char *message) { EscapeInfo *info = NULL; + bool script_mode = false; - initid->ptr = NULL; + init->ptr = NULL; if (!(1 <= args->arg_count && args->arg_count <= 2)) { - sprintf(message, - "mroonga_escape(): Incorrect number of arguments: %u for 1..2", - args->arg_count); + snprintf(message, + MYSQL_ERRMSG_SIZE, + "mroonga_escape(): Incorrect number of arguments: %u for 1..2", + args->arg_count); goto error; } - if (args->arg_type[0] != STRING_RESULT) { - strcpy(message, - "mroonga_escape(): The 1st argument must be query as string"); - goto error; + + if (args->attribute_lengths[0] == strlen("script") && + strncmp(args->attributes[0], "script", strlen("script")) == 0) { + switch (args->arg_type[0]) { + case ROW_RESULT: + snprintf(message, + MYSQL_ERRMSG_SIZE, + "mroonga_escape(): " + "The 1st script argument must be " + "string, integer or floating point: "); + goto error; + break; + default: + break; + } + script_mode = true; + } else { + if (args->arg_type[0] != STRING_RESULT) { + strcpy(message, + "mroonga_escape(): The 1st query argument must be string"); + goto error; + } } if (args->arg_count == 2) { if (args->arg_type[1] != STRING_RESULT) { @@ -60,28 +83,27 @@ MRN_API my_bool mroonga_escape_init(UDF_INIT *initid, UDF_ARGS *args, } } - initid->maybe_null = 1; - initid->const_item = 1; + init->maybe_null = 1; - info = (EscapeInfo *)mrn_my_malloc(sizeof(EscapeInfo), - MYF(MY_WME | MY_ZEROFILL)); + info = static_cast(mrn_my_malloc(sizeof(EscapeInfo), + MYF(MY_WME | MY_ZEROFILL))); if (!info) { strcpy(message, "mroonga_escape(): out of memory"); goto error; } - grn_ctx_init(&(info->ctx), 0); + info->ctx = mrn_context_pool->pull(); + info->script_mode = script_mode; GRN_TEXT_INIT(&(info->target_characters), 0); - GRN_TEXT_INIT(&(info->escaped_query), 0); - info->processed = false; + GRN_TEXT_INIT(&(info->escaped_value), 0); - initid->ptr = (char *)info; + init->ptr = reinterpret_cast(info); return FALSE; error: if (info) { - grn_ctx_fin(&(info->ctx)); + mrn_context_pool->release(info->ctx); my_free(info); } return TRUE; @@ -89,32 +111,103 @@ MRN_API my_bool mroonga_escape_init(UDF_INIT *initid, UDF_ARGS *args, static void escape(EscapeInfo *info, UDF_ARGS *args) { - grn_ctx *ctx = &(info->ctx); - char *query = args->args[0]; - unsigned int query_length = args->lengths[0]; - - if (args->arg_count == 2) { - char *target_characters = args->args[1]; - unsigned int target_characters_length = args->lengths[1]; - GRN_TEXT_PUT(ctx, &(info->target_characters), - target_characters, - target_characters_length); - GRN_TEXT_PUTC(ctx, &(info->target_characters), '\0'); - grn_expr_syntax_escape(ctx, query, query_length, - GRN_TEXT_VALUE(&(info->target_characters)), - GRN_QUERY_ESCAPE, - &(info->escaped_query)); + grn_ctx *ctx = info->ctx; + + GRN_BULK_REWIND(&(info->escaped_value)); + if (info->script_mode) { + switch (args->arg_type[0]) { + case STRING_RESULT: + { + char *value = args->args[0]; + unsigned long value_length = args->lengths[0]; + GRN_TEXT_PUTC(ctx, &(info->escaped_value), '"'); + if (args->arg_count == 2) { + grn_obj special_characters; + GRN_TEXT_INIT(&special_characters, 0); + GRN_TEXT_PUT(ctx, + &special_characters, + args->args[1], + args->lengths[1]); + GRN_TEXT_PUTC(ctx, &special_characters, '\0'); + grn_expr_syntax_escape(ctx, + value, + value_length, + GRN_TEXT_VALUE(&special_characters), + '\\', + &(info->escaped_value)); + GRN_OBJ_FIN(ctx, &special_characters); + } else { + const char *special_characters = "\"\\"; + grn_expr_syntax_escape(ctx, + value, + value_length, + special_characters, + '\\', + &(info->escaped_value)); + } + GRN_TEXT_PUTC(ctx, &(info->escaped_value), '"'); + } + break; + case REAL_RESULT: + { + double value = *reinterpret_cast(args->args[0]); + grn_text_ftoa(ctx, &(info->escaped_value), value); + } + break; + case INT_RESULT: + { + longlong value = *reinterpret_cast(args->args[0]); + grn_text_lltoa(ctx, &(info->escaped_value), value); + } + break; + case DECIMAL_RESULT: + { + grn_obj value_raw; + GRN_TEXT_INIT(&value_raw, GRN_OBJ_DO_SHALLOW_COPY); + GRN_TEXT_SET(ctx, &value_raw, args->args[0], args->lengths[0]); + grn_obj value; + GRN_FLOAT_INIT(&value, 0); + if (grn_obj_cast(ctx, &value_raw, &value, GRN_FALSE) == GRN_SUCCESS) { + grn_text_ftoa(ctx, &(info->escaped_value), GRN_FLOAT_VALUE(&value)); + } else { + GRN_TEXT_PUT(ctx, + &(info->escaped_value), + args->args[0], + args->lengths[0]); + } + GRN_OBJ_FIN(ctx, &value); + GRN_OBJ_FIN(ctx, &value_raw); + } + break; + default: + break; + } } else { - grn_expr_syntax_escape_query(ctx, query, query_length, - &(info->escaped_query)); + char *query = args->args[0]; + unsigned long query_length = args->lengths[0]; + if (args->arg_count == 2) { + char *target_characters = args->args[1]; + unsigned long target_characters_length = args->lengths[1]; + GRN_TEXT_PUT(ctx, &(info->target_characters), + target_characters, + target_characters_length); + GRN_TEXT_PUTC(ctx, &(info->target_characters), '\0'); + grn_expr_syntax_escape(ctx, query, query_length, + GRN_TEXT_VALUE(&(info->target_characters)), + GRN_QUERY_ESCAPE, + &(info->escaped_value)); + } else { + grn_expr_syntax_escape_query(ctx, query, query_length, + &(info->escaped_value)); + } } } -MRN_API char *mroonga_escape(UDF_INIT *initid, UDF_ARGS *args, char *result, +MRN_API char *mroonga_escape(UDF_INIT *init, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error) { - EscapeInfo *info = (EscapeInfo *)initid->ptr; - grn_ctx *ctx = &(info->ctx); + EscapeInfo *info = reinterpret_cast(init->ptr); + grn_ctx *ctx = info->ctx; if (!args->args[0]) { *is_null = 1; @@ -123,31 +216,28 @@ MRN_API char *mroonga_escape(UDF_INIT *initid, UDF_ARGS *args, char *result, *is_null = 0; - if (!info->processed) { - escape(info, args); - info->processed = true; - } + escape(info, args); if (ctx->rc) { my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); goto error; } - *length = GRN_TEXT_LEN(&(info->escaped_query)); - return (char *)(GRN_TEXT_VALUE(&(info->escaped_query))); + *length = GRN_TEXT_LEN(&(info->escaped_value)); + return GRN_TEXT_VALUE(&(info->escaped_value)); error: *error = 1; return NULL; } -MRN_API void mroonga_escape_deinit(UDF_INIT *initid) +MRN_API void mroonga_escape_deinit(UDF_INIT *init) { - EscapeInfo *info = (EscapeInfo *)initid->ptr; + EscapeInfo *info = reinterpret_cast(init->ptr); if (info) { - grn_obj_unlink(&(info->ctx), &(info->target_characters)); - grn_obj_unlink(&(info->ctx), &(info->escaped_query)); - grn_ctx_fin(&(info->ctx)); + grn_obj_unlink(info->ctx, &(info->target_characters)); + grn_obj_unlink(info->ctx, &(info->escaped_value)); + mrn_context_pool->release(info->ctx); my_free(info); } } diff --git a/storage/mroonga/udf/mrn_udf_highlight_html.cpp b/storage/mroonga/udf/mrn_udf_highlight_html.cpp new file mode 100644 index 0000000000000..dc46ef5f2055c --- /dev/null +++ b/storage/mroonga/udf/mrn_udf_highlight_html.cpp @@ -0,0 +1,494 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MRN_BEGIN_DECLS + +extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; + +typedef struct st_mrn_highlight_html_info +{ + grn_ctx *ctx; + grn_obj *db; + bool use_shared_db; + grn_obj *keywords; + String result_str; + struct { + bool used; + grn_obj *table; + grn_obj *default_column; + } query_mode; +} mrn_highlight_html_info; + +static my_bool mrn_highlight_html_prepare(mrn_highlight_html_info *info, + UDF_ARGS *args, + char *message, + grn_obj **keywords) +{ + MRN_DBUG_ENTER_FUNCTION(); + + grn_ctx *ctx = info->ctx; + const char *normalizer_name = "NormalizerAuto"; + grn_obj *expr = NULL; + String *result_str = &(info->result_str); + + *keywords = NULL; + + mrn::encoding::set_raw(ctx, system_charset_info); + if (system_charset_info->state & (MY_CS_BINSORT | MY_CS_CSSORT)) { + normalizer_name = NULL; + } + + *keywords = grn_table_create(ctx, NULL, 0, NULL, + GRN_OBJ_TABLE_PAT_KEY, + grn_ctx_at(ctx, GRN_DB_SHORT_TEXT), + NULL); + if (ctx->rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): " + "failed to create grn_pat for keywords: <%s>", + ctx->errbuf); + } + goto error; + } + if (normalizer_name) { + grn_obj_set_info(ctx, + *keywords, + GRN_INFO_NORMALIZER, + grn_ctx_get(ctx, normalizer_name, -1)); + } + + if (info->query_mode.used) { + if (!info->query_mode.table) { + grn_obj *short_text; + short_text = grn_ctx_at(info->ctx, GRN_DB_SHORT_TEXT); + info->query_mode.table = grn_table_create(info->ctx, + NULL, 0, NULL, + GRN_TABLE_HASH_KEY, + short_text, + NULL); + } + if (!info->query_mode.default_column) { + info->query_mode.default_column = + grn_obj_column(info->ctx, + info->query_mode.table, + GRN_COLUMN_NAME_KEY, + GRN_COLUMN_NAME_KEY_LEN); + } + + grn_obj *record = NULL; + GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->query_mode.table, expr, record); + if (!expr) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): " + "failed to create expression: <%s>", + ctx->errbuf); + } + goto error; + } + + mrn::QueryParser query_parser(info->ctx, + current_thd, + expr, + info->query_mode.default_column, + 0, + NULL); + grn_rc rc = query_parser.parse(args->args[1], args->lengths[1]); + if (rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): " + "failed to parse query: <%s>", + ctx->errbuf); + } + goto error; + } + + { + grn_obj extracted_keywords; + GRN_PTR_INIT(&extracted_keywords, GRN_OBJ_VECTOR, GRN_ID_NIL); + grn_expr_get_keywords(ctx, expr, &extracted_keywords); + + size_t n_keywords = + GRN_BULK_VSIZE(&extracted_keywords) / sizeof(grn_obj *); + for (size_t i = 0; i < n_keywords; ++i) { + grn_obj *extracted_keyword = GRN_PTR_VALUE_AT(&extracted_keywords, i); + grn_table_add(ctx, + *keywords, + GRN_TEXT_VALUE(extracted_keyword), + GRN_TEXT_LEN(extracted_keyword), + NULL); + if (ctx->rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): " + "failed to add a keyword: <%.*s>: <%s>", + static_cast(GRN_TEXT_LEN(extracted_keyword)), + GRN_TEXT_VALUE(extracted_keyword), + ctx->errbuf); + GRN_OBJ_FIN(ctx, &extracted_keywords); + } + goto error; + } + } + GRN_OBJ_FIN(ctx, &extracted_keywords); + } + } else { + for (unsigned int i = 1; i < args->arg_count; ++i) { + if (!args->args[i]) { + continue; + } + grn_table_add(ctx, + *keywords, + args->args[i], + args->lengths[i], + NULL); + if (ctx->rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): " + "failed to add a keyword: <%.*s>: <%s>", + static_cast(args->lengths[i]), + args->args[i], + ctx->errbuf); + } + goto error; + } + } + } + + result_str->set_charset(system_charset_info); + DBUG_RETURN(FALSE); + +error: + if (expr) { + grn_obj_close(ctx, expr); + } + if (*keywords) { + grn_obj_close(ctx, *keywords); + } + DBUG_RETURN(TRUE); +} + +MRN_API my_bool mroonga_highlight_html_init(UDF_INIT *init, + UDF_ARGS *args, + char *message) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_highlight_html_info *info = NULL; + + init->ptr = NULL; + + if (args->arg_count < 1) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): wrong number of arguments: %u for 1+", + args->arg_count); + goto error; + } + + + for (unsigned int i = 0; i < args->arg_count; ++i) { + switch (args->arg_type[i]) { + case STRING_RESULT: + /* OK */ + break; + case REAL_RESULT: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): all arguments must be string: " + "<%u>=<%g>", + i, *((double *)(args->args[i]))); + goto error; + break; + case INT_RESULT: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): all arguments must be string: " + "<%u>=<%lld>", + i, *((longlong *)(args->args[i]))); + goto error; + break; + default: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): all arguments must be string: <%u>", + i); + goto error; + break; + } + } + + init->maybe_null = 0; + + info = + reinterpret_cast( + mrn_my_malloc(sizeof(mrn_highlight_html_info), + MYF(MY_WME | MY_ZEROFILL))); + if (!info) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_highlight_html(): failed to allocate memory"); + goto error; + } + + info->ctx = mrn_context_pool->pull(); + { + const char *current_db_path = MRN_THD_DB_PATH(current_thd); + const char *action; + if (current_db_path) { + action = "open database"; + mrn::Database *db; + int error = mrn_db_manager->open(current_db_path, &db); + if (error == 0) { + info->db = db->get(); + grn_ctx_use(info->ctx, info->db); + info->use_shared_db = true; + } + } else { + action = "create anonymous database"; + info->db = grn_db_create(info->ctx, NULL, NULL); + info->use_shared_db = false; + } + if (!info->db) { + sprintf(message, + "mroonga_highlight_html(): failed to %s: %s", + action, + info->ctx->errbuf); + goto error; + } + } + + info->query_mode.used = FALSE; + + if (args->arg_count == 2 && + args->attribute_lengths[1] == strlen("query") && + strncmp(args->attributes[1], "query", strlen("query")) == 0) { + info->query_mode.used = TRUE; + info->query_mode.table = NULL; + info->query_mode.default_column = NULL; + } + + { + bool all_keywords_are_constant = TRUE; + for (unsigned int i = 1; i < args->arg_count; ++i) { + if (!args->args[i]) { + all_keywords_are_constant = FALSE; + break; + } + } + + if (all_keywords_are_constant) { + if (mrn_highlight_html_prepare(info, args, message, &(info->keywords))) { + goto error; + } + } else { + info->keywords = NULL; + } + } + + init->ptr = (char *)info; + + DBUG_RETURN(FALSE); + +error: + if (info) { + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + } + DBUG_RETURN(TRUE); +} + +static bool highlight_html(grn_ctx *ctx, + grn_pat *keywords, + const char *target, + size_t target_length, + String *output) +{ + MRN_DBUG_ENTER_FUNCTION(); + + grn_obj buffer; + + GRN_TEXT_INIT(&buffer, 0); + + { + const char *open_tag = ""; + size_t open_tag_length = strlen(open_tag); + const char *close_tag = ""; + size_t close_tag_length = strlen(close_tag); + + while (target_length > 0) { +#define MAX_N_HITS 16 + grn_pat_scan_hit hits[MAX_N_HITS]; + const char *rest; + size_t previous = 0; + size_t chunk_length; + + int n_hits = grn_pat_scan(ctx, + keywords, + target, + target_length, + hits, MAX_N_HITS, &rest); + for (int i = 0; i < n_hits; i++) { + if ((hits[i].offset - previous) > 0) { + grn_text_escape_xml(ctx, + &buffer, + target + previous, + hits[i].offset - previous); + } + GRN_TEXT_PUT(ctx, &buffer, open_tag, open_tag_length); + grn_text_escape_xml(ctx, + &buffer, + target + hits[i].offset, + hits[i].length); + GRN_TEXT_PUT(ctx, &buffer, close_tag, close_tag_length); + previous = hits[i].offset + hits[i].length; + } + + chunk_length = rest - target; + if ((chunk_length - previous) > 0) { + grn_text_escape_xml(ctx, + &buffer, + target + previous, + target_length - previous); + } + target_length -= chunk_length; + target = rest; +#undef MAX_N_HITS + } + } + + if (output->reserve(GRN_TEXT_LEN(&buffer))) { + my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM); + GRN_OBJ_FIN(ctx, &buffer); + DBUG_RETURN(false); + } + + output->q_append(GRN_TEXT_VALUE(&buffer), GRN_TEXT_LEN(&buffer)); + GRN_OBJ_FIN(ctx, &buffer); + DBUG_RETURN(true); +} + +MRN_API char *mroonga_highlight_html(UDF_INIT *init, + UDF_ARGS *args, + char *result, + unsigned long *length, + char *is_null, + char *error) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_highlight_html_info *info = + reinterpret_cast(init->ptr); + + grn_ctx *ctx = info->ctx; + grn_obj *keywords = info->keywords; + String *result_str = &(info->result_str); + + if (!args->args[0]) { + *is_null = 1; + DBUG_RETURN(NULL); + } + + if (!keywords) { + if (mrn_highlight_html_prepare(info, args, NULL, &keywords)) { + goto error; + } + } + + *is_null = 0; + result_str->length(0); + + if (!highlight_html(ctx, + reinterpret_cast(keywords), + args->args[0], + args->lengths[0], + result_str)) { + goto error; + } + + if (!info->keywords) { + grn_rc rc = grn_obj_close(ctx, keywords); + if (rc != GRN_SUCCESS) { + my_printf_error(ER_MRN_ERROR_FROM_GROONGA_NUM, + ER_MRN_ERROR_FROM_GROONGA_STR, MYF(0), ctx->errbuf); + goto error; + } + } + + *length = result_str->length(); + DBUG_RETURN((char *)result_str->ptr()); + +error: + if (!info->keywords && keywords) { + grn_obj_close(ctx, keywords); + } + + *is_null = 1; + *error = 1; + + DBUG_RETURN(NULL); +} + +MRN_API void mroonga_highlight_html_deinit(UDF_INIT *init) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_highlight_html_info *info = + reinterpret_cast(init->ptr); + if (!info) { + DBUG_VOID_RETURN; + } + + if (info->keywords) { + grn_obj_close(info->ctx, info->keywords); + } + if (info->query_mode.used) { + if (info->query_mode.default_column) { + grn_obj_close(info->ctx, info->query_mode.default_column); + } + if (info->query_mode.table) { + grn_obj_close(info->ctx, info->query_mode.table); + } + } + MRN_STRING_FREE(info->result_str); + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + + DBUG_VOID_RETURN; +} + +MRN_END_DECLS diff --git a/storage/mroonga/udf/mrn_udf_last_insert_grn_id.cpp b/storage/mroonga/udf/mrn_udf_last_insert_grn_id.cpp index b54f5c5320640..fb4b5440ef10f 100644 --- a/storage/mroonga/udf/mrn_udf_last_insert_grn_id.cpp +++ b/storage/mroonga/udf/mrn_udf_last_insert_grn_id.cpp @@ -2,7 +2,7 @@ /* Copyright(C) 2010 Tetsuro IKEDA Copyright(C) 2010-2013 Kentoku SHIBA - Copyright(C) 2011-2013 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,20 +23,21 @@ #include #include #include +#include MRN_BEGIN_DECLS -MRN_API my_bool last_insert_grn_id_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +MRN_API my_bool last_insert_grn_id_init(UDF_INIT *init, UDF_ARGS *args, char *message) { if (args->arg_count != 0) { strcpy(message, "last_insert_grn_id must not have arguments"); return 1; } - initid->maybe_null = 0; + init->maybe_null = 0; return 0; } -MRN_API longlong last_insert_grn_id(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) +MRN_API longlong last_insert_grn_id(UDF_INIT *init, UDF_ARGS *args, char *is_null, char *error) { THD *thd = current_thd; st_mrn_slot_data *slot_data = mrn_get_slot_data(thd, false); @@ -47,7 +48,7 @@ MRN_API longlong last_insert_grn_id(UDF_INIT *initid, UDF_ARGS *args, char *is_n return last_insert_record_id; } -MRN_API void last_insert_grn_id_deinit(UDF_INIT *initid) +MRN_API void last_insert_grn_id_deinit(UDF_INIT *init) { } diff --git a/storage/mroonga/udf/mrn_udf_normalize.cpp b/storage/mroonga/udf/mrn_udf_normalize.cpp new file mode 100644 index 0000000000000..dd597946ea8ff --- /dev/null +++ b/storage/mroonga/udf/mrn_udf_normalize.cpp @@ -0,0 +1,212 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2015 Naoya Murakami + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MRN_BEGIN_DECLS + +extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; + +#define DEFAULT_NORMALIZER_NAME "NormalizerAuto" + +struct st_mrn_normalize_info +{ + grn_ctx *ctx; + grn_obj *db; + bool use_shared_db; + grn_obj *normalizer; + int flags; + String result_str; +}; + +MRN_API my_bool mroonga_normalize_init(UDF_INIT *init, UDF_ARGS *args, + char *message) +{ + st_mrn_normalize_info *info = NULL; + String *result_str = NULL; + + init->ptr = NULL; + if (!(1 <= args->arg_count && args->arg_count <= 2)) { + sprintf(message, + "mroonga_normalize(): Incorrect number of arguments: %u for 1..2", + args->arg_count); + goto error; + } + if (args->arg_type[0] != STRING_RESULT) { + strcpy(message, + "mroonga_normalize(): The 1st argument must be query as string"); + goto error; + } + if (args->arg_count == 2) { + if (args->arg_type[1] != STRING_RESULT) { + strcpy(message, + "mroonga_normalize(): " + "The 2st argument must be normalizer name as string"); + goto error; + } + } + + init->maybe_null = 1; + + info = (st_mrn_normalize_info *)mrn_my_malloc(sizeof(st_mrn_normalize_info), + MYF(MY_WME | MY_ZEROFILL)); + if (!info) { + strcpy(message, "mroonga_normalize(): out of memory"); + goto error; + } + + info->ctx = mrn_context_pool->pull(); + { + const char *current_db_path = MRN_THD_DB_PATH(current_thd); + const char *action; + if (current_db_path) { + action = "open database"; + mrn::Database *db; + int error = mrn_db_manager->open(current_db_path, &db); + if (error == 0) { + info->db = db->get(); + grn_ctx_use(info->ctx, info->db); + info->use_shared_db = true; + } + } else { + action = "create anonymous database"; + info->db = grn_db_create(info->ctx, NULL, NULL); + info->use_shared_db = false; + } + if (!info->db) { + sprintf(message, + "mroonga_normalize(): failed to %s: %s", + action, + info->ctx->errbuf); + goto error; + } + } + + if (args->arg_count == 1) { + info->normalizer = grn_ctx_get(info->ctx, DEFAULT_NORMALIZER_NAME, -1); + } else { + info->normalizer = grn_ctx_get(info->ctx, args->args[1], args->lengths[1]); + } + if (!info->normalizer) { + sprintf(message, "mroonga_normalize(): nonexistent normalizer %.*s", + (int)args->lengths[1], args->args[1]); + goto error; + } + info->flags = 0; + + result_str = &(info->result_str); + mrn::encoding::set_raw(info->ctx, system_charset_info); + result_str->set_charset(system_charset_info); + + init->ptr = (char *)info; + + return FALSE; + +error: + if (info) { + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + } + return TRUE; +} + +MRN_API char *mroonga_normalize(UDF_INIT *init, UDF_ARGS *args, char *result, + unsigned long *length, char *is_null, char *error) +{ + st_mrn_normalize_info *info = (st_mrn_normalize_info *)init->ptr; + grn_ctx *ctx = info->ctx; + String *result_str = &(info->result_str); + + if (!args->args[0]) { + *is_null = 1; + return NULL; + } + + result_str->length(0); + { + char *target = args->args[0]; + unsigned int target_length = args->lengths[0]; + grn_obj *grn_string; + const char *normalized; + unsigned int normalized_length_in_bytes; + unsigned int normalized_n_characters; + + grn_string = grn_string_open(ctx, + target, target_length, + info->normalizer, info->flags); + grn_string_get_normalized(ctx, grn_string, + &normalized, + &normalized_length_in_bytes, + &normalized_n_characters); + if (result_str->reserve(normalized_length_in_bytes)) { + my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM); + goto error; + } + result_str->q_append(normalized, normalized_length_in_bytes); + result_str->length(normalized_length_in_bytes); + grn_obj_unlink(ctx, grn_string); + } + *is_null = 0; + + if (ctx->rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + goto error; + } + + *length = result_str->length(); + return (char *)result_str->ptr(); + +error: + *is_null = 1; + *error = 1; + return NULL; +} + +MRN_API void mroonga_normalize_deinit(UDF_INIT *init) +{ + st_mrn_normalize_info *info = (st_mrn_normalize_info *)init->ptr; + + if (info) { + MRN_STRING_FREE(info->result_str); + if (info->normalizer) { + grn_obj_unlink(info->ctx, info->normalizer); + } + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + } +} + +MRN_END_DECLS diff --git a/storage/mroonga/udf/mrn_udf_query_expand.cpp b/storage/mroonga/udf/mrn_udf_query_expand.cpp new file mode 100644 index 0000000000000..562499242fc08 --- /dev/null +++ b/storage/mroonga/udf/mrn_udf_query_expand.cpp @@ -0,0 +1,282 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MRN_BEGIN_DECLS + +extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; + +namespace mrn { + struct QueryExpandInfo { + grn_ctx *ctx; + grn_obj expanded_query; + grn_obj *term_column; + grn_obj *expanded_term_column; + }; +} + +static void mrn_query_expand_info_free(mrn::QueryExpandInfo *info) +{ + MRN_DBUG_ENTER_FUNCTION(); + + if (!info) { + DBUG_VOID_RETURN; + } + + if (info->ctx) { + GRN_OBJ_FIN(info->ctx, &(info->expanded_query)); + if (grn_obj_is_accessor(info->ctx, info->expanded_term_column)) { + grn_obj_unlink(info->ctx, info->expanded_term_column); + } + if (grn_obj_is_accessor(info->ctx, info->term_column)) { + grn_obj_unlink(info->ctx, info->term_column); + } + mrn_context_pool->release(info->ctx); + } + my_free(info); + + DBUG_VOID_RETURN; +} + +MRN_API my_bool mroonga_query_expand_init(UDF_INIT *init, + UDF_ARGS *args, + char *message) +{ + mrn::QueryExpandInfo *info = NULL; + + MRN_DBUG_ENTER_FUNCTION(); + + init->ptr = NULL; + if (args->arg_count != 4) { + sprintf(message, + "mroonga_query_expand(): wrong number of arguments: %u for 4", + args->arg_count); + goto error; + } + if (args->arg_type[0] != STRING_RESULT) { + strcpy(message, + "mroonga_query_expand(): " + "the 1st argument must be table name as string"); + goto error; + } + if (args->arg_type[1] != STRING_RESULT) { + strcpy(message, + "mroonga_query_expand(): " + "the 2nd argument must be term column name as string"); + goto error; + } + if (args->arg_type[2] != STRING_RESULT) { + strcpy(message, + "mroonga_query_expand(): " + "the 3nd argument must be expanded term column name as string"); + goto error; + } + if (args->arg_type[3] != STRING_RESULT) { + strcpy(message, + "mroonga_query_expand(): " + "the 4th argument must be query as string"); + goto error; + } + + init->maybe_null = 1; + + info = static_cast( + mrn_my_malloc(sizeof(mrn::QueryExpandInfo), + MYF(MY_WME | MY_ZEROFILL))); + if (!info) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): failed to allocate memory"); + goto error; + } + + { + const char *current_db_path = MRN_THD_DB_PATH(current_thd); + if (!current_db_path) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): no current database"); + goto error; + } + + mrn::Database *db; + int error = mrn_db_manager->open(current_db_path, &db); + if (error != 0) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): failed to open database: %s", + mrn_db_manager->error_message()); + goto error; + } + info->ctx = mrn_context_pool->pull(); + grn_ctx_use(info->ctx, db->get()); + } + + GRN_TEXT_INIT(&(info->expanded_query), 0); + + { + const char *table_name = args->args[0]; + unsigned int table_name_length = args->lengths[0]; + grn_obj *table = grn_ctx_get(info->ctx, + table_name, + table_name_length); + if (!table) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): table doesn't exist: <%.*s>", + static_cast(table_name_length), + table_name); + goto error; + } + + const char *term_column_name = args->args[1]; + unsigned int term_column_name_length = args->lengths[1]; + info->term_column = grn_obj_column(info->ctx, + table, + term_column_name, + term_column_name_length); + if (!info->term_column) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): term column doesn't exist: <%.*s.%.*s>", + static_cast(table_name_length), + table_name, + static_cast(term_column_name_length), + term_column_name); + goto error; + } + + const char *expanded_term_column_name = args->args[2]; + unsigned int expanded_term_column_name_length = args->lengths[2]; + info->expanded_term_column = grn_obj_column(info->ctx, + table, + expanded_term_column_name, + expanded_term_column_name_length); + if (!info->expanded_term_column) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): " + "expanded term column doesn't exist: <%.*s.%.*s>", + static_cast(table_name_length), + table_name, + static_cast(expanded_term_column_name_length), + expanded_term_column_name); + goto error; + } + } + + init->ptr = reinterpret_cast(info); + + DBUG_RETURN(FALSE); + +error: + mrn_query_expand_info_free(info); + DBUG_RETURN(TRUE); +} + +static void query_expand(mrn::QueryExpandInfo *info, UDF_ARGS *args) +{ + grn_ctx *ctx = info->ctx; + const char *query = args->args[3]; + unsigned int query_length = args->lengths[3]; + + mrn::QueryParser query_parser(info->ctx, + current_thd, + NULL, + NULL, + 0, + NULL); + const char *raw_query; + size_t raw_query_length; + grn_operator default_operator; + grn_expr_flags flags; + query_parser.parse_pragma(query, + query_length, + &raw_query, + &raw_query_length, + &default_operator, + &flags); + GRN_TEXT_SET(info->ctx, + &(info->expanded_query), + query, + raw_query - query); + grn_expr_syntax_expand_query_by_table(ctx, + raw_query, + raw_query_length, + flags, + info->term_column, + info->expanded_term_column, + &(info->expanded_query)); +} + +MRN_API char *mroonga_query_expand(UDF_INIT *init, + UDF_ARGS *args, + char *result, + unsigned long *length, + char *is_null, + char *error) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn::QueryExpandInfo *info = + reinterpret_cast(init->ptr); + grn_ctx *ctx = info->ctx; + + if (!args->args[3]) { + *is_null = 1; + DBUG_RETURN(NULL); + } + + *is_null = 0; + + query_expand(info, args); + + if (ctx->rc) { + char message[MYSQL_ERRMSG_SIZE]; + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_query_expand(): " + "failed to expand: %s", + ctx->errbuf); + my_message(ER_ERROR_ON_WRITE, message, MYF(0)); + goto error; + } + + *length = GRN_TEXT_LEN(&(info->expanded_query)); + DBUG_RETURN(GRN_TEXT_VALUE(&(info->expanded_query))); + +error: + *error = 1; + DBUG_RETURN(NULL); +} + +MRN_API void mroonga_query_expand_deinit(UDF_INIT *init) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn::QueryExpandInfo *info = + reinterpret_cast(init->ptr); + mrn_query_expand_info_free(info); + DBUG_VOID_RETURN; +} + +MRN_END_DECLS diff --git a/storage/mroonga/udf/mrn_udf_snippet.cpp b/storage/mroonga/udf/mrn_udf_snippet.cpp index 22ec0884014ac..7a35225545d40 100644 --- a/storage/mroonga/udf/mrn_udf_snippet.cpp +++ b/storage/mroonga/udf/mrn_udf_snippet.cpp @@ -2,7 +2,7 @@ /* Copyright(C) 2010 Tetsuro IKEDA Copyright(C) 2010-2013 Kentoku SHIBA - Copyright(C) 2011-2014 Kouhei Sutou + Copyright(C) 2011-2017 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,13 +26,21 @@ #include #include #include +#include +#include #include +#include MRN_BEGIN_DECLS +extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; + struct st_mrn_snip_info { - grn_ctx ctx; + grn_ctx *ctx; + grn_obj *db; + bool use_shared_db; grn_obj *snippet; String result_str; }; @@ -42,7 +50,7 @@ static my_bool mrn_snippet_prepare(st_mrn_snip_info *snip_info, UDF_ARGS *args, { unsigned int i; CHARSET_INFO *cs; - grn_ctx *ctx = &snip_info->ctx; + grn_ctx *ctx = snip_info->ctx; long long snip_max_len; long long snip_max_num; long long skip_leading_spaces; @@ -121,12 +129,12 @@ static my_bool mrn_snippet_prepare(st_mrn_snip_info *snip_info, UDF_ARGS *args, return TRUE; } -MRN_API my_bool mroonga_snippet_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +MRN_API my_bool mroonga_snippet_init(UDF_INIT *init, UDF_ARGS *args, char *message) { uint i; st_mrn_snip_info *snip_info = NULL; bool can_open_snippet = TRUE; - initid->ptr = NULL; + init->ptr = NULL; if (args->arg_count < 11 || (args->arg_count - 11) % 3) { sprintf(message, "Incorrect number of arguments for mroonga_snippet(): %u", @@ -168,8 +176,7 @@ MRN_API my_bool mroonga_snippet_init(UDF_INIT *initid, UDF_ARGS *args, char *mes goto error; } } - initid->maybe_null = 1; - initid->const_item = 1; + init->maybe_null = 1; if (!(snip_info = (st_mrn_snip_info *) mrn_my_malloc(sizeof(st_mrn_snip_info), MYF(MY_WME | MY_ZEROFILL)))) @@ -177,8 +184,32 @@ MRN_API my_bool mroonga_snippet_init(UDF_INIT *initid, UDF_ARGS *args, char *mes strcpy(message, "mroonga_snippet() out of memory"); goto error; } - grn_ctx_init(&snip_info->ctx, 0); - grn_db_create(&snip_info->ctx, NULL, 0); + snip_info->ctx = mrn_context_pool->pull(); + { + const char *current_db_path = MRN_THD_DB_PATH(current_thd); + const char *action; + if (current_db_path) { + action = "open database"; + mrn::Database *db; + int error = mrn_db_manager->open(current_db_path, &db); + if (error == 0) { + snip_info->db = db->get(); + grn_ctx_use(snip_info->ctx, snip_info->db); + snip_info->use_shared_db = true; + } + } else { + action = "create anonymous database"; + snip_info->db = grn_db_create(snip_info->ctx, NULL, NULL); + snip_info->use_shared_db = false; + } + if (!snip_info->db) { + sprintf(message, + "mroonga_snippet(): failed to %s: %s", + action, + snip_info->ctx->errbuf); + goto error; + } + } for (i = 1; i < args->arg_count; i++) { if (!args->args[i]) { @@ -191,24 +222,26 @@ MRN_API my_bool mroonga_snippet_init(UDF_INIT *initid, UDF_ARGS *args, char *mes goto error; } } - initid->ptr = (char *) snip_info; + init->ptr = (char *) snip_info; return FALSE; error: if (snip_info) { - grn_obj_close(&snip_info->ctx, grn_ctx_db(&snip_info->ctx)); - grn_ctx_fin(&snip_info->ctx); + if (!snip_info->use_shared_db) { + grn_obj_close(snip_info->ctx, snip_info->db); + } + mrn_context_pool->release(snip_info->ctx); my_free(snip_info); } return TRUE; } -MRN_API char *mroonga_snippet(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *length, char *is_null, char *error) +MRN_API char *mroonga_snippet(UDF_INIT *init, UDF_ARGS *args, char *result, + unsigned long *length, char *is_null, char *error) { - st_mrn_snip_info *snip_info = (st_mrn_snip_info *) initid->ptr; - grn_ctx *ctx = &snip_info->ctx; + st_mrn_snip_info *snip_info = (st_mrn_snip_info *) init->ptr; + grn_ctx *ctx = snip_info->ctx; String *result_str = &snip_info->result_str; char *target; unsigned int target_length; @@ -286,16 +319,18 @@ MRN_API char *mroonga_snippet(UDF_INIT *initid, UDF_ARGS *args, char *result, return NULL; } -MRN_API void mroonga_snippet_deinit(UDF_INIT *initid) +MRN_API void mroonga_snippet_deinit(UDF_INIT *init) { - st_mrn_snip_info *snip_info = (st_mrn_snip_info *) initid->ptr; + st_mrn_snip_info *snip_info = (st_mrn_snip_info *) init->ptr; if (snip_info) { if (snip_info->snippet) { - grn_obj_close(&snip_info->ctx, snip_info->snippet); + grn_obj_close(snip_info->ctx, snip_info->snippet); } MRN_STRING_FREE(snip_info->result_str); - grn_obj_close(&snip_info->ctx, grn_ctx_db(&snip_info->ctx)); - grn_ctx_fin(&snip_info->ctx); + if (!snip_info->use_shared_db) { + grn_obj_close(snip_info->ctx, snip_info->db); + } + mrn_context_pool->release(snip_info->ctx); my_free(snip_info); } } diff --git a/storage/mroonga/udf/mrn_udf_snippet_html.cpp b/storage/mroonga/udf/mrn_udf_snippet_html.cpp new file mode 100644 index 0000000000000..99c9edfbba84f --- /dev/null +++ b/storage/mroonga/udf/mrn_udf_snippet_html.cpp @@ -0,0 +1,444 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2015-2017 Kouhei Sutou + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MRN_BEGIN_DECLS + +extern mrn::DatabaseManager *mrn_db_manager; +extern mrn::ContextPool *mrn_context_pool; + +typedef struct st_mrn_snippet_html_info +{ + grn_ctx *ctx; + grn_obj *db; + bool use_shared_db; + grn_obj *snippet; + String result_str; + struct { + bool used; + grn_obj *table; + grn_obj *default_column; + } query_mode; +} mrn_snippet_html_info; + +static my_bool mrn_snippet_html_prepare(mrn_snippet_html_info *info, + UDF_ARGS *args, + char *message, + grn_obj **snippet) +{ + MRN_DBUG_ENTER_FUNCTION(); + + grn_ctx *ctx = info->ctx; + int flags = GRN_SNIP_SKIP_LEADING_SPACES; + unsigned int width = 200; + unsigned int max_n_results = 3; + const char *open_tag = ""; + const char *close_tag = ""; + grn_snip_mapping *mapping = GRN_SNIP_MAPPING_HTML_ESCAPE; + grn_obj *expr = NULL; + String *result_str = &(info->result_str); + + *snippet = NULL; + + mrn::encoding::set_raw(ctx, system_charset_info); + if (!(system_charset_info->state & (MY_CS_BINSORT | MY_CS_CSSORT))) { + flags |= GRN_SNIP_NORMALIZE; + } + + *snippet = grn_snip_open(ctx, flags, + width, max_n_results, + open_tag, strlen(open_tag), + close_tag, strlen(close_tag), + mapping); + if (ctx->rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): failed to open grn_snip: <%s>", + ctx->errbuf); + } + goto error; + } + + if (info->query_mode.used) { + if (!info->query_mode.table) { + grn_obj *short_text; + short_text = grn_ctx_at(info->ctx, GRN_DB_SHORT_TEXT); + info->query_mode.table = grn_table_create(info->ctx, + NULL, 0, NULL, + GRN_TABLE_HASH_KEY, + short_text, + NULL); + } + if (!info->query_mode.default_column) { + info->query_mode.default_column = + grn_obj_column(info->ctx, + info->query_mode.table, + GRN_COLUMN_NAME_KEY, + GRN_COLUMN_NAME_KEY_LEN); + } + + grn_obj *record = NULL; + GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->query_mode.table, expr, record); + if (!expr) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): " + "failed to create expression: <%s>", + ctx->errbuf); + } + goto error; + } + + mrn::QueryParser query_parser(info->ctx, + current_thd, + expr, + info->query_mode.default_column, + 0, + NULL); + grn_rc rc = query_parser.parse(args->args[1], args->lengths[1]); + if (rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): " + "failed to parse query: <%s>", + ctx->errbuf); + } + goto error; + } + + rc = grn_expr_snip_add_conditions(info->ctx, + expr, + *snippet, + 0, + NULL, NULL, + NULL, NULL); + if (rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): " + "failed to add conditions: <%s>", + ctx->errbuf); + } + goto error; + } + } else { + unsigned int i; + for (i = 1; i < args->arg_count; ++i) { + if (!args->args[i]) { + continue; + } + grn_rc rc = grn_snip_add_cond(ctx, *snippet, + args->args[i], args->lengths[i], + NULL, 0, + NULL, 0); + if (rc != GRN_SUCCESS) { + if (message) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): " + "failed to add a condition to grn_snip: <%s>", + ctx->errbuf); + } + goto error; + } + } + } + + result_str->set_charset(system_charset_info); + DBUG_RETURN(FALSE); + +error: + if (expr) { + grn_obj_close(ctx, expr); + } + if (*snippet) { + grn_obj_close(ctx, *snippet); + } + DBUG_RETURN(TRUE); +} + +MRN_API my_bool mroonga_snippet_html_init(UDF_INIT *init, + UDF_ARGS *args, + char *message) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_snippet_html_info *info = NULL; + + init->ptr = NULL; + + if (args->arg_count < 1) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): wrong number of arguments: %u for 1+", + args->arg_count); + goto error; + } + + + for (unsigned int i = 0; i < args->arg_count; ++i) { + switch (args->arg_type[i]) { + case STRING_RESULT: + /* OK */ + break; + case REAL_RESULT: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): all arguments must be string: " + "<%u>=<%g>", + i, *((double *)(args->args[i]))); + goto error; + break; + case INT_RESULT: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): all arguments must be string: " + "<%u>=<%lld>", + i, *((longlong *)(args->args[i]))); + goto error; + break; + default: + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): all arguments must be string: <%u>", + i); + goto error; + break; + } + } + + init->maybe_null = 1; + + info = (mrn_snippet_html_info *)mrn_my_malloc(sizeof(mrn_snippet_html_info), + MYF(MY_WME | MY_ZEROFILL)); + if (!info) { + snprintf(message, MYSQL_ERRMSG_SIZE, + "mroonga_snippet_html(): failed to allocate memory"); + goto error; + } + + info->ctx = mrn_context_pool->pull(); + { + const char *current_db_path = MRN_THD_DB_PATH(current_thd); + const char *action; + if (current_db_path) { + action = "open database"; + mrn::Database *db; + int error = mrn_db_manager->open(current_db_path, &db); + if (error == 0) { + info->db = db->get(); + grn_ctx_use(info->ctx, info->db); + info->use_shared_db = true; + } + } else { + action = "create anonymous database"; + info->db = grn_db_create(info->ctx, NULL, NULL); + info->use_shared_db = false; + } + if (!info->db) { + sprintf(message, + "mroonga_snippet_html(): failed to %s: %s", + action, + info->ctx->errbuf); + goto error; + } + } + + info->query_mode.used = FALSE; + + if (args->arg_count == 2 && + args->attribute_lengths[1] == strlen("query") && + strncmp(args->attributes[1], "query", strlen("query")) == 0) { + info->query_mode.used = TRUE; + info->query_mode.table = NULL; + info->query_mode.default_column = NULL; + } + + { + bool all_keywords_are_constant = TRUE; + for (unsigned int i = 1; i < args->arg_count; ++i) { + if (!args->args[i]) { + all_keywords_are_constant = FALSE; + break; + } + } + + if (all_keywords_are_constant) { + if (mrn_snippet_html_prepare(info, args, message, &(info->snippet))) { + goto error; + } + } else { + info->snippet = NULL; + } + } + + init->ptr = (char *)info; + + DBUG_RETURN(FALSE); + +error: + if (info) { + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + } + DBUG_RETURN(TRUE); +} + +MRN_API char *mroonga_snippet_html(UDF_INIT *init, + UDF_ARGS *args, + char *result, + unsigned long *length, + char *is_null, + char *error) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_snippet_html_info *info = + reinterpret_cast(init->ptr); + + grn_ctx *ctx = info->ctx; + grn_obj *snippet = info->snippet; + String *result_str = &(info->result_str); + + if (!args->args[0]) { + *is_null = 1; + DBUG_RETURN(NULL); + } + + if (!snippet) { + if (mrn_snippet_html_prepare(info, args, NULL, &snippet)) { + goto error; + } + } + + { + char *target = args->args[0]; + unsigned int target_length = args->lengths[0]; + + unsigned int n_results, max_tagged_length; + { + grn_rc rc = grn_snip_exec(ctx, snippet, target, target_length, + &n_results, &max_tagged_length); + if (rc != GRN_SUCCESS) { + my_printf_error(ER_MRN_ERROR_FROM_GROONGA_NUM, + ER_MRN_ERROR_FROM_GROONGA_STR, MYF(0), ctx->errbuf); + goto error; + } + } + + *is_null = 0; + result_str->length(0); + + { + const char *start_tag = "
"; + const char *end_tag = "
"; + size_t start_tag_length = strlen(start_tag); + size_t end_tag_length = strlen(end_tag); + unsigned int max_length_per_snippet = + start_tag_length + end_tag_length + max_tagged_length; + if (result_str->reserve(max_length_per_snippet * n_results)) { + my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM); + goto error; + } + + for (unsigned int i = 0; i < n_results; ++i) { + result_str->q_append(start_tag, start_tag_length); + + unsigned int result_length; + grn_rc rc = + grn_snip_get_result(ctx, snippet, i, + (char *)result_str->ptr() + result_str->length(), + &result_length); + if (rc) { + my_printf_error(ER_MRN_ERROR_FROM_GROONGA_NUM, + ER_MRN_ERROR_FROM_GROONGA_STR, MYF(0), ctx->errbuf); + goto error; + } + result_str->length(result_str->length() + result_length); + + result_str->q_append(end_tag, end_tag_length); + } + } + + if (!info->snippet) { + grn_rc rc = grn_obj_close(ctx, snippet); + if (rc != GRN_SUCCESS) { + my_printf_error(ER_MRN_ERROR_FROM_GROONGA_NUM, + ER_MRN_ERROR_FROM_GROONGA_STR, MYF(0), ctx->errbuf); + goto error; + } + } + } + + *length = result_str->length(); + DBUG_RETURN((char *)result_str->ptr()); + +error: + if (!info->snippet && snippet) { + grn_obj_close(ctx, snippet); + } + + *is_null = 1; + *error = 1; + + DBUG_RETURN(NULL); +} + +MRN_API void mroonga_snippet_html_deinit(UDF_INIT *init) +{ + MRN_DBUG_ENTER_FUNCTION(); + + mrn_snippet_html_info *info = + reinterpret_cast(init->ptr); + if (!info) { + DBUG_VOID_RETURN; + } + + if (info->snippet) { + grn_obj_close(info->ctx, info->snippet); + } + if (info->query_mode.used) { + if (info->query_mode.default_column) { + grn_obj_close(info->ctx, info->query_mode.default_column); + } + if (info->query_mode.table) { + grn_obj_close(info->ctx, info->query_mode.table); + } + } + MRN_STRING_FREE(info->result_str); + if (!info->use_shared_db) { + grn_obj_close(info->ctx, info->db); + } + mrn_context_pool->release(info->ctx); + my_free(info); + + DBUG_VOID_RETURN; +} + +MRN_END_DECLS diff --git a/storage/mroonga/udf/sources.am b/storage/mroonga/udf/sources.am index 380ab4b60cf45..ac2f098e31027 100644 --- a/storage/mroonga/udf/sources.am +++ b/storage/mroonga/udf/sources.am @@ -1,5 +1,9 @@ libmrn_udf_la_SOURCES = \ mrn_udf_last_insert_grn_id.cpp \ mrn_udf_snippet.cpp \ + mrn_udf_snippet_html.cpp \ mrn_udf_command.cpp \ - mrn_udf_escape.cpp + mrn_udf_escape.cpp \ + mrn_udf_normalize.cpp \ + mrn_udf_highlight_html.cpp \ + mrn_udf_query_expand.cpp diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index 2d8a59fa66462..fbec319ffeb4d 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright(C) 2012-2015 Brazil +# Copyright(C) 2012-2016 Brazil # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 2.6.2) # cmake_minimum_required(VERSION 2.6.4) # CentOS 5 set(GRN_PROJECT_NAME "groonga") +set(GRN_PROJECT_LABEL "Groonga") project("${GRN_PROJECT_NAME}") if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") @@ -39,7 +40,7 @@ if(MSVC) endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang") - set(CMAKE_COMPILER_IS_CLANGC ON) + set(CMAKE_COMPILER_IS_CLANGCC ON) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_COMPILER_IS_CLANGCXX ON) @@ -59,6 +60,8 @@ else() endif() endif() string(REGEX REPLACE "(^.*=|\n)" "" GRN_VERSION "${GRN_VERSION}") +string(REGEX REPLACE "\\." "," GRN_VERSION_RC "${GRN_VERSION}") +string(REGEX REPLACE "-.*$" "" GRN_VERSION_RC "${GRN_VERSION_RC}") include(CheckIncludeFile) include(CheckFunctionExists) @@ -97,25 +100,25 @@ set(GRN_DEFAULT_ENCODING CACHE STRING "Groonga's default encoding") set(GRN_DEFAULT_MATCH_ESCALATION_THRESHOLD 0 - CACHE STRING "groonga default match escalation threshold") + CACHE STRING "Groonga's default match escalation threshold") set(GRN_DEFAULT_DOCUMENT_ROOT_BASE "html/admin" - CACHE PATH "groonga default document root base path") + CACHE PATH "Groonga's default document root base path") set(GRN_DEFAULT_RELATIVE_DOCUMENT_ROOT "share/${GRN_PROJECT_NAME}/${GRN_DEFAULT_DOCUMENT_ROOT_BASE}" - CACHE PATH "groonga default relative document root") + CACHE PATH "Groonga's default relative document root") set(GRN_DEFAULT_DOCUMENT_ROOT "${CMAKE_INSTALL_PREFIX}/${GRN_DATA_DIR}/${GRN_DEFAULT_DOCUMENT_ROOT_BASE}" - CACHE PATH "groonga default document root") + CACHE PATH "Groonga's default document root") set(GRN_DEFAULT_DB_KEY "auto" CACHE STRING "Groonga's default DB key management algorithm") set(GRN_STACK_SIZE 1024 CACHE STRING - "DANGER!!! groonga stack size. Normarlly, you should not change this variable.") + "DANGER!!! Groonga's stack size. Normarlly, you should not change this variable.") set(GRN_LOCK_TIMEOUT - 10000000 + 900000 CACHE STRING "timeout to acquire a lock.") set(GRN_LOCK_WAIT_TIME_NANOSECOND @@ -129,42 +132,39 @@ set(GRN_PLUGINS_DIR set(GRN_PLUGIN_SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}") set(GRN_DLL_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}groonga${CMAKE_SHARED_LIBRARY_SUFFIX}") -set(GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE "synonyms.tsv") +set(GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE + "${GRN_CONFIG_DIR}/synonyms.tsv") set(GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE - "${CMAKE_INSTALL_PREFIX}/${GRN_DATA_DIR}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE}") + "${CMAKE_INSTALL_PREFIX}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE}") set(GRN_RELATIVE_RUBY_SCRIPTS_DIR "${LIB_DIR}/${GRN_PROJECT_NAME}/scripts/ruby") set(GRN_RUBY_SCRIPTS_DIR "${CMAKE_INSTALL_PREFIX}/${GRN_RELATIVE_RUBY_SCRIPTS_DIR}") -if(CMAKE_COMPILER_IS_GNUCC) +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} -std=gnu99") endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) MY_CHECK_AND_SET_COMPILER_FLAG("-Wall") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wextra") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-but-set-variable") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-parameter") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-sign-compare") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-pointer-sign") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-missing-field-initializers") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wformat=2") + MY_CHECK_AND_SET_COMPILER_FLAG("-Wformat") MY_CHECK_AND_SET_COMPILER_FLAG("-Wstrict-aliasing=2") MY_CHECK_AND_SET_COMPILER_FLAG("-fno-strict-aliasing") MY_CHECK_AND_SET_COMPILER_FLAG("-Wdisabled-optimization") MY_CHECK_AND_SET_COMPILER_FLAG("-Wfloat-equal") MY_CHECK_AND_SET_COMPILER_FLAG("-Wpointer-arith") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wdeclaration-after-statement") MY_CHECK_AND_SET_COMPILER_FLAG("-Wbad-function-cast") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wcast-align") - #MY_CHECK_AND_SET_COMPILER_FLAG("-Wredundant-decls") + if(NOT CMAKE_COMPILER_IS_CLANGCXX) + MY_CHECK_AND_SET_COMPILER_FLAG("-Wcast-align") + endif() + # MY_CHECK_AND_SET_COMPILER_FLAG("-Wredundant-decls") MY_CHECK_AND_SET_COMPILER_FLAG("-Wwrite-strings") MY_CHECK_AND_SET_COMPILER_FLAG("-fexceptions") MY_CHECK_AND_SET_COMPILER_FLAG("-fimplicit-templates") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-clobbered") endif() if(NOT DEFINED CMAKE_C_COMPILE_OPTIONS_PIC) @@ -303,7 +303,7 @@ else() endif() if(NOT USE_KQUEUE) - ac_check_headers(sys/poll.h) + ac_check_headers(poll.h) if(${HAVE_SYS_POLL_H}) ac_check_funcs(poll) if(${HAVE_POLL}) @@ -338,54 +338,92 @@ if(NOT ${GRN_WITH_ZLIB} STREQUAL "no") endif() endif() +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_lz4_version" + GRN_BUNDLED_LZ4_VERSION) +string(STRIP + "${GRN_BUNDLED_LZ4_VERSION}" + GRN_BUNDLED_LZ4_VERSION) +option(GRN_WITH_BUNDLED_LZ4 "use bundled LZ4" OFF) + set(GRN_WITH_LZ4 "auto" CACHE STRING "Support data compression by LZ4.") if(NOT ${GRN_WITH_LZ4} STREQUAL "no") - if(NOT DEFINED LIBLZ4_FOUND) - pkg_check_modules(LIBLZ4 liblz4) - endif() - if(LIBLZ4_FOUND) - set(GRN_WITH_LZ4 TRUE) + if(GRN_WITH_BUNDLED_LZ4) + set(LIBLZ4_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lz4-${GRN_BUNDLED_LZ4_VERSION}/lib") + set(LIBLZ4_LIBS liblz4) else() - if(${GRN_WITH_LZ4} STREQUAL "yes") - message(FATAL_ERROR "No LZ4 found") + if(NOT DEFINED LIBLZ4_FOUND) + pkg_check_modules(LIBLZ4 liblz4) + endif() + if(LIBLZ4_FOUND) + find_library(LIBLZ4_LIBS + NAMES ${LIBLZ4_LIBRARIES} + PATHS ${LIBLZ4_LIBRARY_DIRS} + NO_DEFAULT_PATH) + set(GRN_WITH_LZ4 TRUE) + else() + if(${GRN_WITH_LZ4} STREQUAL "yes") + message(FATAL_ERROR "No LZ4 found") + endif() + set(GRN_WITH_LZ4 FALSE) endif() - set(GRN_WITH_LZ4 FALSE) endif() endif() + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_mecab_version" + GRN_BUNDLED_MECAB_VERSION) +string(STRIP + "${GRN_BUNDLED_MECAB_VERSION}" + GRN_BUNDLED_MECAB_VERSION) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_mecab_naist_jdic_version" + GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION) +string(STRIP + "${GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION}" + GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION) +option(GRN_WITH_BUNDLED_MECAB "use bundled MeCab" OFF) + set(GRN_WITH_MECAB "auto" CACHE STRING "use MeCab for morphological analysis") if(NOT ${GRN_WITH_MECAB} STREQUAL "no") - set(GRN_MECAB_CONFIG "mecab-config" CACHE FILEPATH "mecab-config path") - if(NOT CMAKE_CROSSCOMPILING) - find_program(GRN_MECAB_CONFIG_ABSOLUTE_PATH "${GRN_MECAB_CONFIG}") - endif() - if(EXISTS "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}") - execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --inc-dir - OUTPUT_VARIABLE MECAB_INCLUDE_DIRS - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --libs-only-L - OUTPUT_VARIABLE MECAB_LIBRARY_DIRS - OUTPUT_STRIP_TRAILING_WHITESPACE) - set(MECAB_LIBRARIES "mecab") - ac_check_lib(${MECAB_LIBRARIES} mecab_new) - if(HAVE_LIBMECAB) - set(GRN_WITH_MECAB TRUE) + if(GRN_WITH_BUNDLED_MECAB) + set(MECAB_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/mecab-${GRN_BUNDLED_MECAB_VERSION}/src") + set(MECAB_LIBRARY_DIRS + "${CMAKE_CURRENT_BUILD_DIR}/vendor/mecab") + set(MECAB_LIBRARIES libmecab) + else() + set(GRN_MECAB_CONFIG "mecab-config" CACHE FILEPATH "mecab-config path") + if(NOT CMAKE_CROSSCOMPILING) + find_program(GRN_MECAB_CONFIG_ABSOLUTE_PATH "${GRN_MECAB_CONFIG}") + endif() + if(EXISTS "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}") + execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --inc-dir + OUTPUT_VARIABLE MECAB_INCLUDE_DIRS + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --libs-only-L + OUTPUT_VARIABLE MECAB_LIBRARY_DIRS + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(MECAB_LIBRARIES "mecab") + ac_check_lib(${MECAB_LIBRARIES} mecab_new) + if(HAVE_LIBMECAB) + set(GRN_WITH_MECAB TRUE) + else() + if(${GRN_WITH_MECAB} STREQUAL "yes") + message(FATAL_ERROR + "No MeCab library found: " + "include directories: <${MECAB_INCLUDE_DIRS}>, " + "library directories: <${MECAB_LIBRARY_DIRS}>") + endif() + set(GRN_WITH_MECAB FALSE) + endif() else() if(${GRN_WITH_MECAB} STREQUAL "yes") - message(FATAL_ERROR - "No MeCab library found: " - "include directories: <${MECAB_INCLUDE_DIRS}>, " - "library directories: <${MECAB_LIBRARY_DIRS}>") + message(FATAL_ERROR "No mecab-config found: <${GRN_MECAB_CONFIG}>") endif() set(GRN_WITH_MECAB FALSE) endif() - else() - if(${GRN_WITH_MECAB} STREQUAL "yes") - message(FATAL_ERROR "No mecab-config found: <${GRN_MECAB_CONFIG}>") - endif() - set(GRN_WITH_MECAB FALSE) endif() else() set(GRN_WITH_MECAB FALSE) @@ -486,41 +524,65 @@ else() set(GRN_WITH_LIBEVENT FALSE) endif() +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_message_pack_version" + GRN_BUNDLED_MESSAGE_PACK_VERSION) +string(STRIP + "${GRN_BUNDLED_MESSAGE_PACK_VERSION}" + GRN_BUNDLED_MESSAGE_PACK_VERSION) +option(GRN_WITH_BUNDLED_MESSAGE_PACK "use bundled MessagePack" OFF) + set(GRN_WITH_MESSAGE_PACK "auto" CACHE STRING "use MessagePack for suggestion") if(NOT ${GRN_WITH_MESSAGE_PACK} STREQUAL "no") - if(NOT DEFINED MESSAGE_PACK_FOUND) - pkg_check_modules(MESSAGE_PACK msgpack) - endif() - if(MESSAGE_PACK_FOUND) - set(GRN_WITH_MESSAGE_PACK TRUE) + if(GRN_WITH_BUNDLED_MESSAGE_PACK) + set(MESSAGE_PACK_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/msgpack-${GRN_BUNDLED_MESSAGE_PACK_VERSION}/include") + set(MESSAGE_PACK_LIBS msgpackc) else() - if("${GRN_WITH_MESSAGE_PACK}" STREQUAL "yes" OR - "${GRN_WITH_MESSAGE_PACK}" STREQUAL "auto") - set(MESSAGE_PACK_INCLUDE_DIRS "") - set(MESSAGE_PACK_LIBRARY_DIRS "") - else() - set(MESSAGE_PACK_INCLUDE_DIRS "${GRN_WITH_MESSAGE_PACK}/include") - set(MESSAGE_PACK_LIBRARY_DIRS "${GRN_WITH_MESSAGE_PACK}/lib") + if(NOT DEFINED MESSAGE_PACK_FOUND) + pkg_check_modules(MESSAGE_PACK msgpack) endif() - set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - ac_check_lib(msgpack msgpack_version "${MESSAGE_PACK_LIBRARY_DIRS}") - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - if(HAVE_LIBMSGPACK) - set(MESSAGE_PACK_LIBRARIES "msgpack") + if(MESSAGE_PACK_FOUND) + find_library(MESSAGE_PACK_LIBS + NAMES ${MESSAGE_PACK_LIBRARIES} + PATHS ${MESSAGE_PACK_LIBRARY_DIRS} + NO_DEFAULT_PATH) set(GRN_WITH_MESSAGE_PACK TRUE) else() - if(${GRN_WITH_MESSAGE_PACK} STREQUAL "yes") - message(FATAL_ERROR "No MessagePack found") + if("${GRN_WITH_MESSAGE_PACK}" STREQUAL "yes" OR + "${GRN_WITH_MESSAGE_PACK}" STREQUAL "auto") + set(MESSAGE_PACK_INCLUDE_DIRS "") + set(MESSAGE_PACK_LIBRARY_DIRS "") + else() + set(MESSAGE_PACK_INCLUDE_DIRS "${GRN_WITH_MESSAGE_PACK}/include") + set(MESSAGE_PACK_LIBRARY_DIRS "${GRN_WITH_MESSAGE_PACK}/lib") + endif() + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + ac_check_lib(msgpack msgpack_version "${MESSAGE_PACK_LIBRARY_DIRS}") + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + if(HAVE_LIBMSGPACK) + find_library(MESSAGE_PACK_LIBS + NAMES "msgpack" + PATHS ${MESSAGE_PACK_LIBRARY_DIRS} + NO_DEFAULT_PATH) + set(GRN_WITH_MESSAGE_PACK TRUE) + else() + if(${GRN_WITH_MESSAGE_PACK} STREQUAL "yes") + message(FATAL_ERROR "No MessagePack found") + endif() + set(GRN_WITH_MESSAGE_PACK FALSE) endif() - set(GRN_WITH_MESSAGE_PACK FALSE) endif() endif() else() set(GRN_WITH_MESSAGE_PACK FALSE) endif() -find_program(RUBY NAMES "ruby2.1" "ruby21" "ruby") +find_program(RUBY NAMES + "ruby2.3" "ruby23" + "ruby2.2" "ruby22" + "ruby2.1" "ruby21" + "ruby") option(GRN_WITH_MRUBY "use mruby" OFF) if(GRN_WITH_MRUBY) @@ -531,6 +593,7 @@ else() set(MRUBY_INCLUDE_DIRS "") set(MRUBY_LIBS "") endif() +set(MRUBY_DEFINITIONS "MRB_INT64" "HAVE_ONIGMO_H") # TODO: Support using system Onigmo instead of bundled Onigmo. # set(GRN_WITH_ONIGMO ON) @@ -580,4 +643,9 @@ if(NOT GRN_EMBED) DESTINATION "${LIB_DIR}/pkgconfig/") endif() +install(FILES + "COPYING" + "README.md" + DESTINATION "${GRN_DATA_DIR}") + add_subdirectory(vendor/plugins) diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt.orig b/storage/mroonga/vendor/groonga/CMakeLists.txt.orig new file mode 100644 index 0000000000000..7f3d2ad260578 --- /dev/null +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt.orig @@ -0,0 +1,676 @@ +# Copyright(C) 2012-2016 Brazil +# +# 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 + +# https://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/5263/steps/compile/logs/stdio +# says CMake 2.6.2... We want to drop old software support... +cmake_minimum_required(VERSION 2.6.2) +# cmake_minimum_required(VERSION 2.6.4) # CentOS 5 +set(GRN_PROJECT_NAME "groonga") +set(GRN_PROJECT_LABEL "Groonga") +project("${GRN_PROJECT_NAME}") + +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(GRN_BUNDLED FALSE) +else() + set(GRN_BUNDLED TRUE) +endif() + +if(MSVC) + if(MSVC_VERSION LESS 1800) + set(GRN_OLD_MSVC_MESSAGE "Groonga supports only MSVC 2013 or later") + if(GRN_BUNDLED) + message(STATUS ${GRN_OLD_MSVC_MESSAGE}) + return() + else() + message(FATAL_ERROR ${GRN_OLD_MSVC_MESSAGE}) + endif() + endif() +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_COMPILER_IS_CLANGCC ON) +endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_COMPILER_IS_CLANGCXX ON) +endif() + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/base_version" VERSION) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/version.sh") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/version.sh" GRN_VERSION) +else() + if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/version.sh") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND EXISTS "/bin/sh") + execute_process(COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/version-gen.sh") + file(READ "${CMAKE_CURRENT_BINARY_DIR}/version.sh" GRN_VERSION) + else() + set(GRN_VERSION "${VERSION}") + endif() + endif() +endif() +string(REGEX REPLACE "(^.*=|\n)" "" GRN_VERSION "${GRN_VERSION}") +string(REGEX REPLACE "\\." "," GRN_VERSION_RC "${GRN_VERSION}") +string(REGEX REPLACE "-.*$" "" GRN_VERSION_RC "${GRN_VERSION_RC}") + +include(CheckIncludeFile) +include(CheckFunctionExists) +include(CheckLibraryExists) +include(CheckSymbolExists) +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) +include(FindPkgConfig) +include(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake_modules/ReadFileList.cmake) + +if(DEFINED GRN_EMBED) + set(GRN_EMBED_DEFAULT ${GRN_EMBED}) +else() + set(GRN_EMBED_DEFAULT OFF) +endif() +option(GRN_EMBED + "Build as a static library to embed into an application" + ${GRN_EMBED_DEFAULT}) + +set(BIN_DIR "bin") +set(SBIN_DIR "sbin") +set(LIB_DIR "lib") +set(INCLUDE_DIR "include") +set(GRN_INCLUDE_DIR "include/groonga") +set(DATA_DIR "share") +set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}") +set(CONFIG_DIR "etc") +set(GRN_CONFIG_DIR "${CONFIG_DIR}/${GRN_PROJECT_NAME}") +set(GRN_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GRN_CONFIG_DIR}/groonga.conf") + +set(GRN_LOG_PATH + "${CMAKE_INSTALL_PREFIX}/var/log/${GRN_PROJECT_NAME}/${GRN_PROJECT_NAME}.log" + CACHE FILEPATH "log file path") +set(GRN_DEFAULT_ENCODING + "utf8" + CACHE STRING "Groonga's default encoding") +set(GRN_DEFAULT_MATCH_ESCALATION_THRESHOLD + 0 + CACHE STRING "Groonga's default match escalation threshold") +set(GRN_DEFAULT_DOCUMENT_ROOT_BASE + "html/admin" + CACHE PATH "Groonga's default document root base path") +set(GRN_DEFAULT_RELATIVE_DOCUMENT_ROOT + "share/${GRN_PROJECT_NAME}/${GRN_DEFAULT_DOCUMENT_ROOT_BASE}" + CACHE PATH "Groonga's default relative document root") +set(GRN_DEFAULT_DOCUMENT_ROOT + "${CMAKE_INSTALL_PREFIX}/${GRN_DATA_DIR}/${GRN_DEFAULT_DOCUMENT_ROOT_BASE}" + CACHE PATH "Groonga's default document root") +set(GRN_DEFAULT_DB_KEY + "auto" + CACHE STRING "Groonga's default DB key management algorithm") +set(GRN_STACK_SIZE + 1024 + CACHE STRING + "DANGER!!! Groonga's stack size. Normarlly, you should not change this variable.") +set(GRN_LOCK_TIMEOUT + 900000 + CACHE STRING + "timeout to acquire a lock.") +set(GRN_LOCK_WAIT_TIME_NANOSECOND + 1000000 + CACHE STRING + "wait time in nanosecond to acquire a lock.") +set(GRN_RELATIVE_PLUGINS_DIR + "${LIB_DIR}/${GRN_PROJECT_NAME}/plugins") +set(GRN_PLUGINS_DIR + "${CMAKE_INSTALL_PREFIX}/${GRN_RELATIVE_PLUGINS_DIR}") +set(GRN_PLUGIN_SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}") +set(GRN_DLL_FILENAME + "${CMAKE_SHARED_LIBRARY_PREFIX}groonga${CMAKE_SHARED_LIBRARY_SUFFIX}") +set(GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE + "${GRN_CONFIG_DIR}/synonyms.tsv") +set(GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE + "${CMAKE_INSTALL_PREFIX}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE}") +set(GRN_RELATIVE_RUBY_SCRIPTS_DIR + "${LIB_DIR}/${GRN_PROJECT_NAME}/scripts/ruby") +set(GRN_RUBY_SCRIPTS_DIR + "${CMAKE_INSTALL_PREFIX}/${GRN_RELATIVE_RUBY_SCRIPTS_DIR}") + + +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} -std=gnu99") +endif() + + +macro(check_cflag flag) + string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${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(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} ${flag}") + endif() +endmacro() + +macro(check_cxxflag flag) + string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${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(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} ${flag}") + endif() +endmacro() + +macro(check_build_flag flag) + check_cflag(${flag}) + check_cxxflag(${flag}) +endmacro() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) + check_build_flag("-Wall") + check_build_flag("-Wno-unused-but-set-variable") + check_cflag("-Wno-pointer-sign") + check_build_flag("-Wformat") + check_build_flag("-Wstrict-aliasing=2") + check_build_flag("-fno-strict-aliasing") + check_build_flag("-Wdisabled-optimization") + check_build_flag("-Wfloat-equal") + check_build_flag("-Wpointer-arith") + check_cflag("-Wbad-function-cast") + if(NOT CMAKE_COMPILER_IS_CLANGCXX) + check_build_flag("-Wcast-align") + endif() + # check_build_flag("-Wredundant-decls") + check_build_flag("-Wwrite-strings") + check_cxxflag("-fexceptions") + check_cxxflag("-fimplicit-templates") +endif() + +if(NOT DEFINED CMAKE_C_COMPILE_OPTIONS_PIC) + # For old CMake + if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) + check_build_flag("-fPIC") + endif() +endif() + +option(GRN_WITH_DEBUG "enable debug build." OFF) +if(GRN_WITH_DEBUG) + if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) + set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} -g3 -O0") + set(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} -g3 -O0") + endif() +endif() + +add_definitions( + -DHAVE_CONFIG_H + ) +if(GRN_EMBED) + add_definitions(-DGRN_EMBEDDED) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) + set(_GNU_SOURCE TRUE) +endif() + +include_directories( + BEFORE + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/lib + ) + +macro(ac_check_headers header) + string(REGEX REPLACE "[/.]" "_" output_variable_name ${header}) + string(TOUPPER "${output_variable_name}" output_variable_name) + set(output_variable_name "HAVE_${output_variable_name}") + check_include_file(${header} ${output_variable_name}) +endmacro() + +macro(ac_check_funcs function) + string(TOUPPER "${function}" output_variable_name) + set(output_variable_name "HAVE_${output_variable_name}") + check_function_exists(${function} ${output_variable_name}) +endmacro() + +macro(ac_check_symbols symbol files) + string(TOUPPER "${symbol}" output_variable_name) + set(output_variable_name "HAVE_${output_variable_name}") + check_symbol_exists(${symbol} ${files} ${output_variable_name}) +endmacro() + +macro(ac_check_lib library function) + string(REGEX REPLACE "[/.]" "_" output_variable_base_name ${library}) + string(TOUPPER "${output_variable_base_name}" output_variable_base_name) + set(output_variable_name "HAVE_LIB${output_variable_base_name}") + set(location "${ARG2}") + check_library_exists(${library} ${function} "${location}" + ${output_variable_name}) + if(${output_variable_name}) + set(${output_variable_base_name}_LIBS "${library}") + endif() +endmacro() + +include(build/ac_macros/check_headers.m4) +include(build/ac_macros/check_functions.m4) + +ac_check_symbols(fpclassify math.h) +ac_check_lib(m fpclassify) + +ac_check_lib(dl dlopen) +ac_check_lib(execinfo backtrace) +if(HAVE_LIBEXECINFO) + set(HAVE_BACKTRACE TRUE) +else() + ac_check_funcs(backtrace) +endif() +ac_check_lib(rt clock_gettime) +if(HAVE_LIBRT) + set(HAVE_CLOCK_GETTIME TRUE) +endif() +if(GRN_EMBED) + check_library_exists(stdc++ __cxa_begin_catch "${ARG2}" + STDCPP) + if(STDCPP) + set(STDCPP_LIBS "stdc++") + endif() +endif() + +if(UNIX) + ac_check_headers(pthread.h) + ac_check_lib(pthread pthread_mutex_init) + if(NOT ${HAVE_LIBPTHREAD}) + message(FATAL_ERROR "No libpthread found") + endif() + ac_check_funcs(pthread_mutexattr_setpshared) + ac_check_funcs(pthread_condattr_setpshared) +endif() + +option(GRN_WITH_NFKC "use NFKC based UTF8 normalization." ON) + +if(WIN32) + ac_check_headers(winsock2.h) + if(NOT ${HAVE_WINSOCK2_H}) + message(FATAL_ERROR "No winsock2.h found") + endif() + + # FIXME: CMake couldn't detect ws2_32.lib on Windows 8 64bit. + # It may be caused by missing library search path for ws2_32.lib. + # It seems that Visual Studio (devenv.exe) can find it but link.exe + # can't. "cmake --build" can find it because it uses Visual Studio + # internally. So we assume that we always have ws2_32.lib on Windows. + # ac_check_lib(ws2_32 select) + set(HAVE_LIBWS2_32 TRUE) + set(WS2_32_LIBS "ws2_32.lib") + + set(USE_SELECT TRUE) +else() + ac_check_headers(sys/epoll.h) + if(${HAVE_SYS_EPOLL_H}) + ac_check_funcs(epoll_create) + if(${HAVE_EPOLL_CREATE}) + set(USE_EPOLL TRUE) + endif() + endif() + + if(NOT USE_EPOLL) + ac_check_headers(sys/event.h) + if(${HAVE_SYS_EVENT_H}) + ac_check_funcs(kevent) + if(${HAVE_KEVENT}) + set(USE_KQUEUE TRUE) + endif() + endif() + + if(NOT USE_KQUEUE) + ac_check_headers(poll.h) + if(${HAVE_SYS_POLL_H}) + ac_check_funcs(poll) + if(${HAVE_POLL}) + set(USE_POLL TRUE) + endif() + endif() + + if(NOT USE_POLL) + ac_check_funcs(select) + if(${HAVE_SELECT}) + set(USE_SELECT TRUE) + ac_check_headers(sys/select.h) + endif() + + if(NOT USE_SELECT) + message(FATAL_ERROR "All epoll/kqueue/poll/select are missing") + endif() + endif() + endif() + endif() +endif() + +set(GRN_WITH_ZLIB "auto" + CACHE STRING "Support data compression by zlib.") +if(NOT ${GRN_WITH_ZLIB} STREQUAL "no") + ac_check_lib(z compress) + if(NOT HAVE_LIBZ) + if(${GRN_WITH_ZLIB} STREQUAL "yes") + message(FATAL_ERROR "No libz found") + endif() + set(GRN_WITH_ZLIB "no") + endif() +endif() + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_lz4_version" + GRN_BUNDLED_LZ4_VERSION) +string(STRIP + "${GRN_BUNDLED_LZ4_VERSION}" + GRN_BUNDLED_LZ4_VERSION) +option(GRN_WITH_BUNDLED_LZ4 "use bundled LZ4" OFF) + +set(GRN_WITH_LZ4 "auto" + CACHE STRING "Support data compression by LZ4.") +if(NOT ${GRN_WITH_LZ4} STREQUAL "no") + if(GRN_WITH_BUNDLED_LZ4) + set(LIBLZ4_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lz4-${GRN_BUNDLED_LZ4_VERSION}/lib") + set(LIBLZ4_LIBS liblz4) + else() + if(NOT DEFINED LIBLZ4_FOUND) + pkg_check_modules(LIBLZ4 liblz4) + endif() + if(LIBLZ4_FOUND) + find_library(LIBLZ4_LIBS + NAMES ${LIBLZ4_LIBRARIES} + PATHS ${LIBLZ4_LIBRARY_DIRS} + NO_DEFAULT_PATH) + set(GRN_WITH_LZ4 TRUE) + else() + if(${GRN_WITH_LZ4} STREQUAL "yes") + message(FATAL_ERROR "No LZ4 found") + endif() + set(GRN_WITH_LZ4 FALSE) + endif() + endif() +endif() + + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_mecab_version" + GRN_BUNDLED_MECAB_VERSION) +string(STRIP + "${GRN_BUNDLED_MECAB_VERSION}" + GRN_BUNDLED_MECAB_VERSION) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_mecab_naist_jdic_version" + GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION) +string(STRIP + "${GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION}" + GRN_BUNDLED_MECAB_NAIST_JDIC_VERSION) +option(GRN_WITH_BUNDLED_MECAB "use bundled MeCab" OFF) + +set(GRN_WITH_MECAB "auto" + CACHE STRING "use MeCab for morphological analysis") +if(NOT ${GRN_WITH_MECAB} STREQUAL "no") + if(GRN_WITH_BUNDLED_MECAB) + set(MECAB_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/mecab-${GRN_BUNDLED_MECAB_VERSION}/src") + set(MECAB_LIBRARY_DIRS + "${CMAKE_CURRENT_BUILD_DIR}/vendor/mecab") + set(MECAB_LIBRARIES libmecab) + else() + set(GRN_MECAB_CONFIG "mecab-config" CACHE FILEPATH "mecab-config path") + if(NOT CMAKE_CROSSCOMPILING) + find_program(GRN_MECAB_CONFIG_ABSOLUTE_PATH "${GRN_MECAB_CONFIG}") + endif() + if(EXISTS "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}") + execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --inc-dir + OUTPUT_VARIABLE MECAB_INCLUDE_DIRS + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --libs-only-L + OUTPUT_VARIABLE MECAB_LIBRARY_DIRS + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(MECAB_LIBRARIES "mecab") + ac_check_lib(${MECAB_LIBRARIES} mecab_new) + if(HAVE_LIBMECAB) + set(GRN_WITH_MECAB TRUE) + else() + if(${GRN_WITH_MECAB} STREQUAL "yes") + message(FATAL_ERROR + "No MeCab library found: " + "include directories: <${MECAB_INCLUDE_DIRS}>, " + "library directories: <${MECAB_LIBRARY_DIRS}>") + endif() + set(GRN_WITH_MECAB FALSE) + endif() + else() + if(${GRN_WITH_MECAB} STREQUAL "yes") + message(FATAL_ERROR "No mecab-config found: <${GRN_MECAB_CONFIG}>") + endif() + set(GRN_WITH_MECAB FALSE) + endif() + endif() +else() + set(GRN_WITH_MECAB FALSE) +endif() + +set(GRN_WITH_KYTEA "auto" + CACHE STRING "use KyTea for morphological analysis") +if(NOT ${GRN_WITH_KYTEA} STREQUAL "no") + if(NOT DEFINED KYTEA_FOUND) + pkg_check_modules(KYTEA kytea) + endif() + if(KYTEA_FOUND) + set(GRN_WITH_KYTEA TRUE) + else() + if(${GRN_WITH_KYTEA} STREQUAL "yes") + message(FATAL_ERROR "No KyTea found") + endif() + set(GRN_WITH_KYTEA FALSE) + endif() +else() + set(GRN_WITH_KYTEA FALSE) +endif() + +set(GRN_WITH_LIBSTEMMER "auto" + CACHE STRING "use libstemmer for stemming token filter") +if(NOT ${GRN_WITH_LIBSTEMMER} STREQUAL "no") + if(NOT ("${GRN_WITH_LIBSTEMMER}" STREQUAL "yes" OR + "${GRN_WITH_LIBSTEMMER}" STREQUAL "auto")) + if("${LIBSTEMMER_INCLUDE_DIRS}" STREQUAL "") + set(LIBSTEMMER_INCLUDE_DIRS "${GRN_WITH_LIBSTEMMER}/include") + endif() + if("${LIBSTEMMER_LIBRARY_DIRS}" STREQUAL "") + set(LIBSTEMMER_LIBRARY_DIRS "${GRN_WITH_LIBSTEMMER}/lib") + endif() + endif() + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES + ${CMAKE_REQUIRED_INCLUDES} + ${LIBSTEMMER_INCLUDE_DIRS}) + ac_check_headers(libstemmer.h) + ac_check_lib(stemmer sb_stemmer_list "${LIBSTEMMER_LIBRARY_DIRS}") + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + if(HAVE_LIBSTEMMER_H AND HAVE_LIBSTEMMER) + set(LIBSTEMMER_LIBRARIES "stemmer") + set(GRN_WITH_LIBSTEMMER TRUE) + else() + if(${GRN_WITH_LIBSTEMMER} STREQUAL "yes") + message(FATAL_ERROR "No libstemmer found") + endif() + set(GRN_WITH_LIBSTEMMER FALSE) + endif() +else() + set(GRN_WITH_LIBSTEMMER FALSE) +endif() + +set(GRN_WITH_ZEROMQ "auto" + CACHE STRING "use ZeroMQ for suggestion") +if(NOT ${GRN_WITH_ZEROMQ} STREQUAL "no") + if(NOT DEFINED ZEROMQ_FOUND) + pkg_check_modules(ZEROMQ libzmq) + endif() + if(ZEROMQ_FOUND) + set(GRN_WITH_ZEROMQ TRUE) + else() + if(${GRN_WITH_ZEROMQ} STREQUAL "yes") + message(FATAL_ERROR "No ZeroMQ found") + endif() + set(GRN_WITH_ZEROMQ FALSE) + endif() +else() + set(GRN_WITH_ZEROMQ FALSE) +endif() + +set(GRN_WITH_LIBEVENT "auto" + CACHE STRING "use libevent for suggestion") +if(NOT ${GRN_WITH_LIBEVENT} STREQUAL "no") + if("${GRN_WITH_LIBEVENT}" STREQUAL "yes" OR + "${GRN_WITH_LIBEVENT}" STREQUAL "auto") + set(LIBEVENT_INCLUDE_DIRS "") + set(LIBEVENT_LIBRARY_DIRS "") + else() + set(LIBEVENT_INCLUDE_DIRS "${GRN_WITH_LIBEVENT}/include") + set(LIBEVENT_LIBRARY_DIRS "${GRN_WITH_LIBEVENT}/lib") + endif() + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + ac_check_lib(event event_init "${LIBEVENT_LIBRARY_DIRS}") + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + if(HAVE_LIBEVENT) + set(LIBEVENT_LIBRARIES "event") + set(GRN_WITH_LIBEVENT TRUE) + else() + if(${GRN_WITH_LIBEVENT} STREQUAL "yes") + message(FATAL_ERROR "No libevent found") + endif() + set(GRN_WITH_LIBEVENT FALSE) + endif() +else() + set(GRN_WITH_LIBEVENT FALSE) +endif() + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/bundled_message_pack_version" + GRN_BUNDLED_MESSAGE_PACK_VERSION) +string(STRIP + "${GRN_BUNDLED_MESSAGE_PACK_VERSION}" + GRN_BUNDLED_MESSAGE_PACK_VERSION) +option(GRN_WITH_BUNDLED_MESSAGE_PACK "use bundled MessagePack" OFF) + +set(GRN_WITH_MESSAGE_PACK "auto" + CACHE STRING "use MessagePack for suggestion") +if(NOT ${GRN_WITH_MESSAGE_PACK} STREQUAL "no") + if(GRN_WITH_BUNDLED_MESSAGE_PACK) + set(MESSAGE_PACK_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/msgpack-${GRN_BUNDLED_MESSAGE_PACK_VERSION}/include") + set(MESSAGE_PACK_LIBS msgpackc) + else() + if(NOT DEFINED MESSAGE_PACK_FOUND) + pkg_check_modules(MESSAGE_PACK msgpack) + endif() + if(MESSAGE_PACK_FOUND) + find_library(MESSAGE_PACK_LIBS + NAMES ${MESSAGE_PACK_LIBRARIES} + PATHS ${MESSAGE_PACK_LIBRARY_DIRS} + NO_DEFAULT_PATH) + set(GRN_WITH_MESSAGE_PACK TRUE) + else() + if("${GRN_WITH_MESSAGE_PACK}" STREQUAL "yes" OR + "${GRN_WITH_MESSAGE_PACK}" STREQUAL "auto") + set(MESSAGE_PACK_INCLUDE_DIRS "") + set(MESSAGE_PACK_LIBRARY_DIRS "") + else() + set(MESSAGE_PACK_INCLUDE_DIRS "${GRN_WITH_MESSAGE_PACK}/include") + set(MESSAGE_PACK_LIBRARY_DIRS "${GRN_WITH_MESSAGE_PACK}/lib") + endif() + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + ac_check_lib(msgpack msgpack_version "${MESSAGE_PACK_LIBRARY_DIRS}") + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + if(HAVE_LIBMSGPACK) + find_library(MESSAGE_PACK_LIBS + NAMES "msgpack" + PATHS ${MESSAGE_PACK_LIBRARY_DIRS} + NO_DEFAULT_PATH) + set(GRN_WITH_MESSAGE_PACK TRUE) + else() + if(${GRN_WITH_MESSAGE_PACK} STREQUAL "yes") + message(FATAL_ERROR "No MessagePack found") + endif() + set(GRN_WITH_MESSAGE_PACK FALSE) + endif() + endif() + endif() +else() + set(GRN_WITH_MESSAGE_PACK FALSE) +endif() + +find_program(RUBY NAMES + "ruby2.3" "ruby23" + "ruby2.2" "ruby22" + "ruby2.1" "ruby21" + "ruby") + +option(GRN_WITH_MRUBY "use mruby" OFF) +if(GRN_WITH_MRUBY) + set(MRUBY_INCLUDE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/vendor/mruby-source/include") + set(MRUBY_LIBS mruby) +else() + set(MRUBY_INCLUDE_DIRS "") + set(MRUBY_LIBS "") +endif() +set(MRUBY_DEFINITIONS "MRB_INT64" "HAVE_ONIGMO_H") + +# TODO: Support using system Onigmo instead of bundled Onigmo. +set(GRN_WITH_ONIGMO ON) +set(ONIGMO_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/vendor/onigmo-source") +set(ONIGMO_LIBS onigmo) + +# TODO: It's for Onigmo static link case. If we support system Onigmo, +# we need to remove it and add -DEXPORT to Onigmo build. +add_definitions(-DONIG_EXTERN=extern) + +add_subdirectory(vendor) +if(GRN_EMBED) + add_subdirectory(plugins) +endif() +add_subdirectory(lib) +if(NOT GRN_EMBED) + add_subdirectory(src) + add_subdirectory(plugins) + add_subdirectory(include) + add_subdirectory(data) +endif() + +configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +set(GROONGA "${CMAKE_CURRENT_BINARY_DIR}/src/groonga") +set(GROONGA_SUGGEST_CREATE_DATASET + "${CMAKE_CURRENT_BINARY_DIR}/src/suggest/groonga-suggest-create-dataset") +set(GROONGA_BENCHMARK "${CMAKE_CURRENT_BINARY_DIR}/src/groonga-benchmark") +configure_file(config.sh.in "${CMAKE_CURRENT_BINARY_DIR}/config.sh" @ONLY) + +set(prefix "${CMAKE_INSTALL_PREFIX}") +set(exec_prefix "${prefix}") +set(bindir "${CMAKE_INSTALL_PREFIX}/${BIN_DIR}") +set(sbindir "${CMAKE_INSTALL_PREFIX}/${SBIN_DIR}") +set(libdir "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}") +set(includedir "${CMAKE_INSTALL_PREFIX}/${INCLUDE_DIR}") +set(datarootdir "${CMAKE_INSTALL_PREFIX}/${DATA_DIR}") +set(datadir "${datarootdir}") +set(expanded_pluginsdir "${GRN_PLUGINS_DIR}") +set(GRN_EXPANDED_DEFAULT_DOCUMENT_ROOT "${GRN_DEFAULT_DOCUMENT_ROOT}") +set(EXEEXT "${CMAKE_EXECUTABLE_SUFFIX}") +configure_file(groonga.pc.in "${CMAKE_CURRENT_BINARY_DIR}/groonga.pc" @ONLY) + +if(NOT GRN_EMBED) + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/groonga.pc" + DESTINATION "${LIB_DIR}/pkgconfig/") +endif() + +install(FILES + "COPYING" + "README.md" + DESTINATION "${GRN_DATA_DIR}") + +add_subdirectory(vendor/plugins) diff --git a/storage/mroonga/vendor/groonga/Makefile.am b/storage/mroonga/vendor/groonga/Makefile.am index 6f760a52b3010..1fc7028ff7e90 100644 --- a/storage/mroonga/vendor/groonga/Makefile.am +++ b/storage/mroonga/vendor/groonga/Makefile.am @@ -2,7 +2,7 @@ LOCALES = ja -ACLOCAL_AMFLAGS = ${ACLOCAL_ARGS} -I . +ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = 1.9.6 SUBDIRS = \ build \ @@ -20,16 +20,23 @@ SUBDIRS = \ doc #dist_data_DATA = EXTRA_DIST = \ + CMakeLists.txt \ README.md \ - bindings \ - version-gen.sh \ base_version \ + bindings \ + bundled_lz4_version \ + bundled_mecab_naist_jdic_version \ + bundled_mecab_version \ + config.h.cmake \ gpg_uid \ - CMakeLists.txt \ - config.h.cmake + nginx_version \ + version-gen.sh pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = groonga.pc +if GRN_WITH_ARROW +pkgconfig_DATA += groonga-arrow.pc +endif .PHONY: FORCE @@ -42,6 +49,7 @@ include $(srcdir)/version.sh dist-hook: echo "$(GRN_VERSION)" > $(distdir)/version + cd $(distdir) && autoreconf --install --force && find . -name autom4te.cache | xargs rm -fr benchmark: cd test/benchmark && $(MAKE) benchmark @@ -74,8 +82,7 @@ update-latest-release: misc doc/source/install.rst \ doc/source/install/*.rst \ doc/locale/*/LC_MESSAGES/install.po \ - $(GROONGA_ORG_PATH)/index.html \ - $(GROONGA_ORG_PATH)/ja/index.html + $(GROONGA_ORG_PATH)/_config.yml update-po: @for lang in $(LOCALES); do \ diff --git a/storage/mroonga/vendor/groonga/README.md b/storage/mroonga/vendor/groonga/README.md index 09e5764a02402..af0b5a7dbb503 100644 --- a/storage/mroonga/vendor/groonga/README.md +++ b/storage/mroonga/vendor/groonga/README.md @@ -6,6 +6,19 @@ Groonga is an open-source fulltext search engine and column store. See doc/source/ directory or http://groonga.org/docs/. +Here are shortcut links: + + * How to install: http://groonga.org/docs/install.html + * Tutorial: http://groonga.org/docs/tutorial.html + * How to build as a developer: http://groonga.org/docs/contribution/development/build.html + +## Community + + * [@groonga on Twitter](https://twitter.com/groonga/) + * [Groonga page on Facebook](https://www.facebook.com/groonga) + * [Mailing list on SourceForge.net](http://lists.sourceforge.net/mailman/listinfo/groonga-talk) + * [Chat room on Gitter](https://gitter.im/groonga/public) + ## Bundled software ### mruby diff --git a/storage/mroonga/vendor/groonga/appveyor.yml b/storage/mroonga/vendor/groonga/appveyor.yml index d755e6b49fdf9..fca8c229a55f4 100644 --- a/storage/mroonga/vendor/groonga/appveyor.yml +++ b/storage/mroonga/vendor/groonga/appveyor.yml @@ -1,19 +1,72 @@ version: "{build}" clone_depth: 10 -build_script: - - git submodule update --init - - cmake . -G "Visual Studio 12 2013 Win64" - - cmake --build . --config Debug + +environment: + matrix: + - VS_VERSION: 12 + ARCH: x86 + - VS_VERSION: 12 + ARCH: amd64 + - VS_VERSION: 14 + ARCH: x86 + - VS_VERSION: 14 + ARCH: amd64 notifications: - provider: Email to: - - kou@clear-code.com - - groonga-commit@lists.sourceforge.jp + - groonga-commit@lists.osdn.me on_build_status_changed: true -test: off -# before_test: -# - gem install grntest -# test_script: -# - grntest --groonga src\groonga.exe --base-directory test\command test\command\suite +init: + - set PATH=C:\Ruby22\bin;%PATH% + - set PATH=C:\msys64\usr\bin;%PATH% + - call + "C:\Program Files (x86)\Microsoft Visual Studio %VS_VERSION%.0\VC\vcvarsall.bat" + %ARCH% +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +install: + - tzutil /s "Tokyo Standard Time" + # - choco install -y imdisk-toolkit + # - mkdir tmp + # - imdisk -a -t file -m tmp -o awe -s 1G -p "/fs:ntfs /q /y" + +build_script: + - git submodule update --init + - cd vendor + - ruby download_mecab.rb + - ruby download_message_pack.rb + - ruby download_lz4.rb + - cd .. + - set CMAKE_GENERATOR_NAME=Visual Studio %VS_VERSION% + - if "%VS_VERSION%" == "12" + set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_NAME% 2013 + - if "%VS_VERSION%" == "14" + set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_NAME% 2015 + - if "%ARCH%" == "amd64" + set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_NAME% Win64 + - cmake . -G "%CMAKE_GENERATOR_NAME%" + -DCMAKE_INSTALL_PREFIX=c:\groonga + -DGRN_WITH_MRUBY=yes + -DGRN_WITH_BUNDLED_MECAB=yes + -DGRN_WITH_BUNDLED_MESSAGE_PACK=yes + -DGRN_WITH_BUNDLED_LZ4=yes + - cmake --build . --config Debug + - cmake --build . --config Debug --target Install + +before_test: + - git clone --depth 1 + https://github.com/groonga/grntest.git + test\command\grntest + - cd test\command\grntest + - bundle install --binstubs=..\bin + - cd ..\..\.. +test_script: + - ruby test\command\bin\grntest + --groonga c:\groonga\bin\groonga.exe + --base-directory test\command + --reporter mark + --n-workers 1 + --timeout 60 + test\command\suite diff --git a/storage/mroonga/vendor/groonga/autogen.sh b/storage/mroonga/vendor/groonga/autogen.sh index 66184bf13be10..98dcc83a79ef6 100755 --- a/storage/mroonga/vendor/groonga/autogen.sh +++ b/storage/mroonga/vendor/groonga/autogen.sh @@ -6,15 +6,20 @@ case `uname -s` in Darwin) homebrew_aclocal=/usr/local/share/aclocal if [ -d $homebrew_aclocal ]; then - ACLOCAL_ARGS="$ACLOCAL_ARGS -I $homebrew_aclocal" + ACLOCAL_PATH="$ACLOCAL_PATH $homebrew_aclocal" fi - gettext_aclocal="$(echo /usr/local/Cellar/gettext/*/share/aclocal)" - if [ -d $gettext_aclocal ]; then - ACLOCAL_ARGS="$ACLOCAL_ARGS -I $gettext_aclocal" + gettext_prefix=/usr/local/Cellar/gettext + if [ -d $gettext_prefix ]; then + gettext_aclocal=$(ls $gettext_prefix/*/share/aclocal | \ + gsort --version-sort | \ + tail -n 1) + if [ -d $gettext_aclocal ]; then + ACLOCAL_PATH="$ACLOCAL_PATH $gettext_aclocal" + fi fi ;; FreeBSD) - ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/" + ACLOCAL_PATH="$ACLOCAL_PATH /usr/local/share/aclocal/" ;; esac @@ -23,4 +28,6 @@ if [ ! -e vendor/mruby-source/.git ]; then fi git submodule update --init -${AUTORECONF:-autoreconf} --force --install +mkdir -p m4 + +${AUTORECONF:-autoreconf} --force --install "$@" diff --git a/storage/mroonga/vendor/groonga/base_version b/storage/mroonga/vendor/groonga/base_version index 25b08bbc78f00..bf993904af82d 100644 --- a/storage/mroonga/vendor/groonga/base_version +++ b/storage/mroonga/vendor/groonga/base_version @@ -1 +1 @@ -5.0.5 \ No newline at end of file +7.0.7 \ No newline at end of file diff --git a/storage/mroonga/vendor/groonga/benchmark/Makefile.am b/storage/mroonga/vendor/groonga/benchmark/Makefile.am index 310fb4585a379..a2a8b29ab79dc 100644 --- a/storage/mroonga/vendor/groonga/benchmark/Makefile.am +++ b/storage/mroonga/vendor/groonga/benchmark/Makefile.am @@ -5,17 +5,23 @@ SUBDIRS = \ NONEXISTENT_CXX_SOURCE = nonexistent.cpp if WITH_BENCHMARK -noinst_PROGRAMS = \ - bench-table-factory \ - bench-geo-distance \ - bench-geo-select \ - bench-ctx-create \ - bench-query-optimizer \ - bench-range-select +noinst_PROGRAMS = \ + bench-table-factory \ + bench-geo-distance \ + bench-geo-select \ + bench-ctx-create \ + bench-query-optimizer \ + bench-range-select \ + bench-result-set \ + bench-between-sequential \ + bench-nfkc \ + bench-cache endif EXTRA_DIST = \ - bench-query-optimizer-ddl.grn + bench-geo-select.sh \ + bench-query-optimizer-ddl.grn \ + geo-select-generate-grn.rb AM_CPPFLAGS = \ -I$(srcdir) \ @@ -50,33 +56,56 @@ nodist_EXTRA_bench_query_optimizer_SOURCES = $(NONEXISTENT_CXX_SOURCE) bench_range_select_SOURCES = bench-range-select.c nodist_EXTRA_bench_range_select_SOURCES = $(NONEXISTENT_CXX_SOURCE) +bench_result_set_SOURCES = bench-result-set.c +nodist_EXTRA_bench_result_set_SOURCES = $(NONEXISTENT_CXX_SOURCE) + +bench_between_sequential_SOURCES = bench-between-sequential.c +nodist_EXTRA_bench_between_sequential_SOURCES = $(NONEXISTENT_CXX_SOURCE) + +bench_nfkc_SOURCES = bench-nfkc.c +nodist_EXTRA_bench_nfkc_SOURCES = $(NONEXISTENT_CXX_SOURCE) + +bench_cache_SOURCES = bench-cache.c +nodist_EXTRA_bench_cache_SOURCES = $(NONEXISTENT_CXX_SOURCE) + benchmarks = \ run-bench-table-factory \ run-bench-geo-distance \ run-bench-geo-select \ run-bench-ctx-create \ run-bench-query-optimizer \ - run-bench-range-select + run-bench-range-select \ + run-bench-result-set \ + run-bench-between-sequential \ + run-bench-nfkc \ + run-bench-cache run-bench-table-factory: bench-table-factory @echo $@: - ./bench-table-factory + env \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + ./bench-table-factory run-bench-geo-distance: bench-geo-distance @echo $@: - ./bench-geo-distance + env \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + ./bench-geo-distance run-bench-geo-select: bench-geo-select @echo $@: - env \ - RUBY="$(RUBY)" \ - GROONGA="$(GROONGA)" \ - srcdir="$(srcdir)" \ + env \ + RUBY="$(RUBY)" \ + GROONGA="$(GROONGA)" \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + srcdir="$(srcdir)" \ $(srcdir)/bench-geo-select.sh run-bench-ctx-create: bench-ctx-create @echo $@: - ./bench-ctx-create + env \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + ./bench-ctx-create run-bench-query-optimizer: bench-query-optimizer @echo $@: @@ -99,4 +128,26 @@ run-bench-range-select: bench-range-select GRN_RUBY_SCRIPTS_DIR=$(top_srcdir)/lib/mrb/scripts \ ./bench-range-select +run-bench-result-set: bench-result-set + @echo $@: + env \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + ./bench-result-set + +run-bench-between-sequential: bench-between-sequential + @echo $@: + @[ ! -e tmp ] && ln -s /dev/shm tmp || : + @mkdir -p tmp/between-sequential + env \ + GRN_RUBY_SCRIPTS_DIR="$(top_srcdir)/lib/mrb/scripts" \ + ./bench-between-sequential + +run-bench-nfkc: bench-nfkc + @echo $@: + ./bench-nfkc + +run-bench-cache: bench-cache + @echo $@: + ./bench-cache + benchmark: $(benchmarks) diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-between-sequential.c b/storage/mroonga/vendor/groonga/benchmark/bench-between-sequential.c new file mode 100644 index 0000000000000..53bc3af538855 --- /dev/null +++ b/storage/mroonga/vendor/groonga/benchmark/bench-between-sequential.c @@ -0,0 +1,276 @@ +/* -*- c-basic-offset: 2; coding: utf-8 -*- */ +/* + Copyright (C) 2016 Kouhei Sutou + + 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 +*/ + +/* + Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz + + CFLAGS: -O2 -g + + Groonga: e2971d9a555a90724b76964cc8c8805373500b4a + % make --quiet -C benchmark run-bench-between-sequential + run-bench-between-sequential: + Process 10 times in each pattern + (total) (average) (median) + ( 500, 600] ( 1000): between: (0.0528s) (0.0053s) (0.0043s) + ( 500, 600] ( 1000): range: (0.0120s) (0.0012s) (0.2500ms) + ( 5000, 5100] ( 10000): between: (0.4052s) (0.0405s) (0.0395s) + ( 5000, 5100] ( 10000): range: (0.0197s) (0.0020s) (0.0010s) + ( 50000, 50100] ( 100000): between: (3.9343s) (0.3934s) (0.3900s) + ( 50000, 50100] ( 100000): range: (0.0969s) (0.0097s) (0.0088s) + (500000, 500100] (1000000): between: (38.2969s) (3.8297s) (3.7983s) + (500000, 500100] (1000000): range: (0.9158s) (0.0916s) (0.0900s) + + Groonga: 35e4e431bb7660b3170e98c329f7219bd6723f05 + % make --quiet -C benchmark run-bench-between-sequential + run-bench-between-sequential: + Process 10 times in each pattern + (total) (average) (median) + ( 500, 600] ( 1000): between: (0.0130s) (0.0013s) (0.2590ms) + ( 500, 600] ( 1000): range: (0.0124s) (0.0012s) (0.2530ms) + ( 5000, 5100] ( 10000): between: (0.0163s) (0.0016s) (0.6440ms) + ( 5000, 5100] ( 10000): range: (0.0205s) (0.0021s) (0.0011s) + ( 50000, 50100] ( 100000): between: (0.0611s) (0.0061s) (0.0051s) + ( 50000, 50100] ( 100000): range: (0.1004s) (0.0100s) (0.0091s) + (500000, 500100] (1000000): between: (0.4518s) (0.0452s) (0.0442s) + (500000, 500100] (1000000): range: (0.8866s) (0.0887s) (0.0878s) +*/ + +#include +#include + +#include +#include + +#include "lib/benchmark.h" + +#define GET(context, name) (grn_ctx_get(context, name, strlen(name))) + +typedef struct _BenchmarkData +{ + grn_ctx context; + grn_obj *database; + guint n_records; + const gchar *command; +} BenchmarkData; + +static void +run_command(grn_ctx *context, const gchar *command) +{ + gchar *response; + unsigned int response_length; + int flags; + + grn_ctx_send(context, command, strlen(command), 0); + grn_ctx_recv(context, &response, &response_length, &flags); +} + +static void +bench(gpointer user_data) +{ + BenchmarkData *data = user_data; + grn_ctx *context = &(data->context); + + run_command(context, data->command); +} + +static gchar * +get_tmp_dir(void) +{ + gchar *current_dir; + gchar *tmp_dir; + + current_dir = g_get_current_dir(); + tmp_dir = g_build_filename(current_dir, "tmp", NULL); + g_free(current_dir); + + return tmp_dir; +} + +static void +setup_database(BenchmarkData *data) +{ + grn_ctx *context = &(data->context); + gchar *tmp_dir; + gchar *database_last_component_name; + gchar *database_path; + guint i; + + tmp_dir = get_tmp_dir(); + database_last_component_name = g_strdup_printf("db-%d", data->n_records); + database_path = g_build_filename(tmp_dir, + "between-sequential", + database_last_component_name, + NULL); + g_free(database_last_component_name); + + if (g_file_test(database_path, G_FILE_TEST_EXISTS)) { + data->database = grn_db_open(context, database_path); + run_command(context, "dump"); + } else { + data->database = grn_db_create(context, database_path, NULL); + + run_command(context, "table_create Entries TABLE_NO_KEY"); + run_command(context, "column_create Entries rank COLUMN_SCALAR Int32"); + + run_command(context, "load --table Entries"); + run_command(context, "["); + for (i = 0; i < data->n_records; i++) { +#define BUFFER_SIZE 4096 + gchar buffer[BUFFER_SIZE]; + const gchar *separator; + if (i == (data->n_records - 1)) { + separator = ""; + } else { + separator = ","; + } + snprintf(buffer, BUFFER_SIZE, "{\"rank\": %u}%s", i, separator); + run_command(context, buffer); +#undef BUFFER_SIZE + } + run_command(context, "]"); + } + + g_free(database_path); +} + +static void +bench_startup(BenchmarkData *data) +{ + grn_ctx_init(&(data->context), 0); + setup_database(data); +} + +static void +bench_shutdown(BenchmarkData *data) +{ + grn_ctx *context = &(data->context); + + grn_obj_close(context, data->database); + grn_ctx_fin(context); +} + +int +main(int argc, gchar **argv) +{ + grn_rc rc; + BenchReporter *reporter; + gint n = 10; + + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } + + g_print("Process %d times in each pattern\n", n); + + bench_init(&argc, &argv); + reporter = bench_reporter_new(); + + { + BenchmarkData data_small_between; + BenchmarkData data_small_range; + BenchmarkData data_medium_between; + BenchmarkData data_medium_range; + BenchmarkData data_large_between; + BenchmarkData data_large_range; + BenchmarkData data_very_large_between; + BenchmarkData data_very_large_range; + +#define REGISTER(data, n_records_, min, max, is_between) \ + do { \ + gchar *label; \ + label = \ + g_strdup_printf("(%6d, %6d] (%7d): %7s", \ + min, max, n_records_, \ + is_between ? "between" : "range"); \ + data.n_records = n_records_; \ + if (is_between) { \ + data.command = \ + "select Entries --cache no " \ + "--filter " \ + "'between(rank, " #min ", \"exclude\"," \ + " " #max ", \"include\")'"; \ + } else { \ + data.command = \ + "select Entries --cache no " \ + "--filter 'rank > " #min " && rank <= " #max "'"; \ + } \ + bench_startup(&data); \ + bench_reporter_register(reporter, label, \ + n, \ + NULL, \ + bench, \ + NULL, \ + &data); \ + g_free(label); \ + } while(FALSE) + + REGISTER(data_small_between, + 1000, + 500, 600, + TRUE); + REGISTER(data_small_range, + 1000, + 500, 600, + FALSE); + REGISTER(data_medium_between, + 10000, + 5000, 5100, + TRUE); + REGISTER(data_medium_range, + 10000, + 5000, 5100, + FALSE); + REGISTER(data_large_between, + 100000, + 50000, 50100, + TRUE); + REGISTER(data_large_range, + 100000, + 50000, 50100, + FALSE); + REGISTER(data_very_large_between, + 1000000, + 500000, 500100, + TRUE); + REGISTER(data_very_large_range, + 1000000, + 500000, 500100, + FALSE); + +#undef REGISTER + + bench_reporter_run(reporter); + + bench_shutdown(&data_small_between); + bench_shutdown(&data_small_range); + bench_shutdown(&data_medium_between); + bench_shutdown(&data_medium_range); + bench_shutdown(&data_large_between); + bench_shutdown(&data_large_range); + bench_shutdown(&data_very_large_between); + bench_shutdown(&data_very_large_range); + } + g_object_unref(reporter); + + grn_fin(); + + return EXIT_SUCCESS; +} diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-cache.c b/storage/mroonga/vendor/groonga/benchmark/bench-cache.c new file mode 100644 index 0000000000000..ee54209c7ab11 --- /dev/null +++ b/storage/mroonga/vendor/groonga/benchmark/bench-cache.c @@ -0,0 +1,155 @@ +/* -*- c-basic-offset: 2; coding: utf-8 -*- */ +/* + Copyright (C) 2017 Kouhei Sutou + + 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 +*/ + +/* + Groonga: eb65125330b3a8f920693ef3ad53011c7412f2c9 + CFLAGS: -O2 -g3 + CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz + + % make --silent -C benchmark run-bench-cache + run-bench-cache: + (total) (average) (median) + 1000: (0.0458s) (0.4576ms) (0.4170ms) + 10000: (0.3464s) (0.0035s) (0.0034s) + % GRN_CACHE_TYPE=persistent make --silent -C benchmark run-bench-cache + run-bench-cache: + (total) (average) (median) + 1000: (0.0480s) (0.4801ms) (0.4700ms) + 10000: (0.4033s) (0.0040s) (0.0040s) + */ + +#include +#include +#include + +#include + +#include "lib/benchmark.h" + +typedef struct _BenchmarkData +{ + grn_ctx *context; + grn_cache *cache; + grn_obj value; +} BenchmarkData; + +static void +bench_n(BenchmarkData *data, gint64 n) +{ + gint64 i; + grn_ctx *ctx; + grn_cache *cache; + grn_obj *value; + grn_obj fetch_buffer; + + ctx = data->context; + cache = data->cache; + value = &(data->value); + GRN_TEXT_INIT(&fetch_buffer, 0); + for (i = 0; i < n; i++) { + char key[GRN_TABLE_MAX_KEY_SIZE]; + grn_snprintf(key, + GRN_TABLE_MAX_KEY_SIZE, + GRN_TABLE_MAX_KEY_SIZE, + "key:%" GRN_FMT_INT64D, + i); + GRN_BULK_REWIND(&fetch_buffer); + grn_cache_fetch(ctx, cache, key, strlen(key), &fetch_buffer); + grn_cache_update(ctx, cache, key, strlen(key), value); + } + GRN_OBJ_FIN(ctx, &fetch_buffer); +} + +static void +bench_1000(gpointer user_data) +{ + BenchmarkData *data = user_data; + bench_n(data, 1000); +} + +static void +bench_10000(gpointer user_data) +{ + BenchmarkData *data = user_data; + bench_n(data, 10000); +} + +static void +bench_setup(gpointer user_data) +{ + BenchmarkData *data = user_data; + + data->cache = grn_cache_open(data->context); + GRN_TEXT_INIT(&(data->value), 0); + while (GRN_TEXT_LEN(&(data->value)) < 1024) { + GRN_TEXT_PUTS(data->context, &(data->value), "XXXXXXXXXXX"); + } +} + +static void +bench_teardown(gpointer user_data) +{ + BenchmarkData *data = user_data; + + grn_obj_close(data->context, &(data->value)); + grn_cache_close(data->context, data->cache); +} + +int +main(int argc, gchar **argv) +{ + grn_rc rc; + BenchmarkData data; + BenchReporter *reporter; + gchar *base_dir; + grn_ctx ctx; + gint n = 100; + + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } + bench_init(&argc, &argv); + + grn_ctx_init(&ctx, 0); + + data.context = &ctx; + + base_dir = g_build_filename(g_get_tmp_dir(), "groonga-bench", NULL); + bench_utils_remove_path_recursive_force(base_dir); + g_mkdir_with_parents(base_dir, 0755); + + reporter = bench_reporter_new(); + bench_reporter_register(reporter, "1000", n, + bench_setup, bench_1000, bench_teardown, &data); + bench_reporter_register(reporter, "10000", n, + bench_setup, bench_10000, bench_teardown, &data); + bench_reporter_run(reporter); + g_object_unref(reporter); + + grn_ctx_fin(&ctx); + + bench_utils_remove_path_recursive_force(base_dir); + + bench_quit(); + grn_fin(); + + return EXIT_SUCCESS; +} diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-ctx-create.c b/storage/mroonga/vendor/groonga/benchmark/bench-ctx-create.c index 3e43519071d7f..cd6a99a401f56 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-ctx-create.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-ctx-create.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2013-2014 Kouhei Sutou + Copyright (C) 2013-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -153,12 +153,18 @@ teardown_database(grn_ctx *context, grn_obj *database) int main(int argc, gchar **argv) { + grn_rc rc; grn_ctx context; BenchmarkData data; BenchReporter *reporter; gint n = 1; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } bench_init(&argc, &argv); grn_ctx_init(&context, 0); @@ -188,5 +194,5 @@ main(int argc, gchar **argv) grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-geo-distance.c b/storage/mroonga/vendor/groonga/benchmark/bench-geo-distance.c index 72d1d79b73f6d..f77cfb1d3e757 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-geo-distance.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-geo-distance.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2009 Kouhei Sutou + Copyright (C) 2009-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -48,6 +48,7 @@ */ #include +#include #include #include @@ -421,11 +422,17 @@ bench_teardown(gpointer user_data) int main(int argc, gchar **argv) { + grn_rc rc; BenchmarkData data; BenchReporter *reporter; gint n = 1000; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } bench_init(&argc, &argv); data.report_result = g_getenv("GROONGA_BENCH_REPORT_RESULT") != NULL; @@ -495,5 +502,5 @@ main(int argc, gchar **argv) bench_quit(); grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-geo-select.c b/storage/mroonga/vendor/groonga/benchmark/bench-geo-select.c index 7b57eaaffdcc5..31be2c7ad17a9 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-geo-select.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-geo-select.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2011 Kouhei Sutou + Copyright (C) 2011-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -56,6 +56,7 @@ 2nd: select_in_rectangle (all): (4.61558) */ +#include #include #include @@ -212,11 +213,17 @@ teardown_database(BenchmarkData *data) int main(int argc, gchar **argv) { + grn_rc rc; BenchmarkData data; BenchReporter *reporter; gint n = 100; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } bench_init(&argc, &argv); data.report_result = g_getenv("GROONGA_BENCH_REPORT_RESULT") != NULL; @@ -265,5 +272,5 @@ main(int argc, gchar **argv) bench_quit(); grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-nfkc.c b/storage/mroonga/vendor/groonga/benchmark/bench-nfkc.c new file mode 100644 index 0000000000000..96b1c9bc6e27e --- /dev/null +++ b/storage/mroonga/vendor/groonga/benchmark/bench-nfkc.c @@ -0,0 +1,275 @@ +/* -*- c-basic-offset: 2; coding: utf-8 -*- */ +/* + Copyright (C) 2015-2016 Kouhei Sutou + + 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 +*/ + +/* + Groonga: ed300a833d44eaefa978b5ecf46a96ef91ae0891 + + CFLAGS: -O2 -g + % make --quiet -C benchmark run-bench-nfkc + run-bench-nfkc: + (total) (average) (median) + map1 - switch : (0.0060ms) (0.00060000ms) (0.00000000ms) + map1 - table : (0.00000000ms) (0.00000000ms) (0.00000000ms) + map2 - switch - no change: (0.0010ms) (0.00010000ms) (0.00000000ms) + map2 - table - no change: (0.00000000ms) (0.00000000ms) (0.00000000ms) + map2 - switch - change: (0.0010ms) (0.00010000ms) (0.00000000ms) + map2 - table - change: (0.0010ms) (0.00010000ms) (0.00000000ms) +*/ + +#include +#include + +#include + +#include + +#include "lib/benchmark.h" + +#include "../lib/nfkc50.c" + +#define MAX_UNICODE 0x110000 +#define BUFFER_SIZE 0x100 + +static inline int +ucs2utf8(unsigned int i, unsigned char *buf) +{ + unsigned char *p = buf; + if (i < 0x80) { + *p++ = i; + } else { + if (i < 0x800) { + *p++ = (i >> 6) | 0xc0; + } else { + if (i < 0x00010000) { + *p++ = (i >> 12) | 0xe0; + } else { + if (i < 0x00200000) { + *p++ = (i >> 18) | 0xf0; + } else { + if (i < 0x04000000) { + *p++ = (i >> 24) | 0xf8; + } else if (i < 0x80000000) { + *p++ = (i >> 30) | 0xfc; + *p++ = ((i >> 24) & 0x3f) | 0x80; + } + *p++ = ((i >> 18) & 0x3f) | 0x80; + } + *p++ = ((i >> 12) & 0x3f) | 0x80; + } + *p++ = ((i >> 6) & 0x3f) | 0x80; + } + *p++ = (0x3f & i) | 0x80; + } + *p = '\0'; + return (p - buf); +} + +static void +bench_char_type(gpointer user_data) +{ + uint64_t code_point; + char utf8[7]; + + for (code_point = 1; code_point < MAX_UNICODE; code_point++) { + ucs2utf8(code_point, (unsigned char *)utf8); + grn_nfkc50_char_type(utf8); + } +} + +static void +bench_decompose(gpointer user_data) +{ + uint64_t code_point; + char utf8[7]; + + for (code_point = 1; code_point < MAX_UNICODE; code_point++) { + ucs2utf8(code_point, (unsigned char *)utf8); + grn_nfkc50_decompose(utf8); + } +} + +static void +bench_compose_no_change(gpointer user_data) +{ + uint64_t prefix_code_point; + uint64_t suffix_code_point = 0x61; /* a */ + char prefix_utf8[7]; + char suffix_utf8[7]; + + ucs2utf8(suffix_code_point, (unsigned char *)suffix_utf8); + for (prefix_code_point = 1; + prefix_code_point < MAX_UNICODE; + prefix_code_point++) { + ucs2utf8(prefix_code_point, (unsigned char *)prefix_utf8); + grn_nfkc50_compose(prefix_utf8, suffix_utf8); + } +} + +static void +bench_compose_change(gpointer user_data) +{ + uint64_t prefix_code_point; + uint64_t suffix_code_point = 0x11ba; + char prefix_utf8[7]; + char suffix_utf8[7]; + + ucs2utf8(suffix_code_point, (unsigned char *)suffix_utf8); + for (prefix_code_point = 1; + prefix_code_point < MAX_UNICODE; + prefix_code_point++) { + ucs2utf8(prefix_code_point, (unsigned char *)prefix_utf8); + grn_nfkc50_compose(prefix_utf8, suffix_utf8); + } +} + +/* +static void +check_char_type(gpointer user_data) +{ + uint64_t code_point; + char utf8[7]; + + for (code_point = 1; code_point < MAX_UNICODE; code_point++) { + grn_char_type a; + grn_char_type b; + + ucs2utf8(code_point, (unsigned char *)utf8); + a = grn_nfkc_char_type(utf8); + b = grn_nfkc50_char_type(utf8); + if (a == b) { + continue; + } + printf("%lx: %s: %d != %d\n", code_point, utf8, a, b); + } +} + +static void +check_decompose(gpointer user_data) +{ + uint64_t code_point; + char utf8[7]; + + for (code_point = 1; code_point < MAX_UNICODE; code_point++) { + const char *a; + const char *b; + + ucs2utf8(code_point, (unsigned char *)utf8); + a = grn_nfkc_decompose(utf8); + b = grn_nfkc50_decompose(utf8); + if (a == b) { + continue; + } + if (!a || !b) { + printf("%lx: %s: %s != %s\n", code_point, utf8, a, b); + continue; + } + if (strcmp(a, b) != 0) { + printf("%lx: %s: %s != %s\n", code_point, utf8, a, b); + } + } +} + +static void +check_compose(gpointer user_data) +{ + uint64_t prefix_code_point; + uint64_t suffix_code_point; + char prefix_utf8[7]; + char suffix_utf8[7]; + + for (prefix_code_point = 1; + prefix_code_point < MAX_UNICODE; + prefix_code_point++) { + ucs2utf8(prefix_code_point, (unsigned char *)prefix_utf8); + for (suffix_code_point = 1; + suffix_code_point < MAX_UNICODE; + suffix_code_point++) { + const char *a; + const char *b; + + ucs2utf8(suffix_code_point, (unsigned char *)suffix_utf8); + a = grn_nfkc_compose(prefix_utf8, suffix_utf8); + b = grn_nfkc50_compose(prefix_utf8, suffix_utf8); + if (a == b) { + continue; + } + if (!a || !b) { + printf("%lx-%lx: %s-%s: %s != %s\n", + prefix_code_point, suffix_code_point, + prefix_utf8, suffix_utf8, + a, b); + continue; + } + if (strcmp(a, b) != 0) { + printf("%lx-%lx: %s-%s: %s != %s\n", + prefix_code_point, suffix_code_point, + prefix_utf8, suffix_utf8, + a, b); + } + } + if ((prefix_code_point % 10000) == 0) { + printf("%" G_GUINT64_FORMAT "\n", prefix_code_point); + } + } +} +*/ + +int +main(int argc, gchar **argv) +{ + grn_rc rc; + BenchReporter *reporter; + gint n = 10; + + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } + bench_init(&argc, &argv); + + reporter = bench_reporter_new(); + + if (g_getenv("N")) { + n = atoi(g_getenv("N")); + } + +#define REGISTER(label, bench_function) \ + bench_reporter_register(reporter, label, n, \ + NULL, \ + bench_function, \ + NULL, \ + NULL) + REGISTER("char_type ", bench_char_type); + REGISTER("decompose ", bench_decompose); + REGISTER("compose - no change", bench_compose_no_change); + REGISTER("compose - change", bench_compose_change); + + /* + REGISTER("check - char_type", check_char_type); + REGISTER("check - decompose", check_decompose); + REGISTER("check - compose ", check_compose); + */ +#undef REGISTER + + bench_reporter_run(reporter); + g_object_unref(reporter); + + return EXIT_SUCCESS; +} diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer.c b/storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer.c index d7ed91d0c565f..4ce55c55b6ab2 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2014 Kouhei Sutou + Copyright (C) 2014-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -135,12 +135,18 @@ teardown_database(grn_ctx *context, grn_obj *database) int main(int argc, gchar **argv) { + grn_rc rc; grn_ctx context; grn_obj *database; BenchReporter *reporter; gint n = 100; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } bench_init(&argc, &argv); grn_ctx_init(&context, 0); @@ -204,5 +210,5 @@ main(int argc, gchar **argv) grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c b/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c index d45d453cba642..a0664d582706e 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2014 Kouhei Sutou + Copyright (C) 2014-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -179,10 +179,16 @@ bench_shutdown(BenchmarkData *data) int main(int argc, gchar **argv) { + grn_rc rc; BenchReporter *reporter; gint n = 10; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } g_print("Process %d times in each pattern\n", n); @@ -270,5 +276,5 @@ main(int argc, gchar **argv) grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-result-set.c b/storage/mroonga/vendor/groonga/benchmark/bench-result-set.c new file mode 100644 index 0000000000000..cd4866e5033c9 --- /dev/null +++ b/storage/mroonga/vendor/groonga/benchmark/bench-result-set.c @@ -0,0 +1,151 @@ +/* -*- c-basic-offset: 2; coding: utf-8 -*- */ +/* + Copyright (C) 2015-2016 Kouhei Sutou + + 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 +*/ + +#include +#include + +#include + +#include "lib/benchmark.h" + +typedef struct _BenchmarkData +{ + gchar *base_dir; + grn_ctx *context; + grn_obj *source_table; + grn_obj *result_set; +} BenchmarkData; + +static void +bench_n(BenchmarkData *data, gint64 n) +{ + gint64 i; + grn_ctx *ctx; + grn_hash *result_set; + + ctx = data->context; + result_set = (grn_hash *)data->result_set; + for (i = 0; i < n; i++) { + grn_id id = i; + grn_hash_add(ctx, result_set, &id, sizeof(grn_id), NULL, NULL); + } +} + +static void +bench_1000(gpointer user_data) +{ + BenchmarkData *data = user_data; + bench_n(data, 1000); +} + +static void +bench_10000(gpointer user_data) +{ + BenchmarkData *data = user_data; + bench_n(data, 10000); +} + +static void +bench_100000(gpointer user_data) +{ + BenchmarkData *data = user_data; + bench_n(data, 100000); +} + +static void +bench_setup(gpointer user_data) +{ + BenchmarkData *data = user_data; + + data->result_set = grn_table_create(data->context, + NULL, 0, NULL, + GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, + data->source_table, + NULL); + +} + +static void +bench_teardown(gpointer user_data) +{ + BenchmarkData *data = user_data; + + grn_obj_close(data->context, data->result_set); +} + +int +main(int argc, gchar **argv) +{ + grn_rc rc; + BenchmarkData data; + BenchReporter *reporter; + gchar *base_dir; + grn_ctx ctx; + gint n = 100; + + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } + bench_init(&argc, &argv); + + data.context = &ctx; + + base_dir = g_build_filename(g_get_tmp_dir(), "groonga-bench", NULL); + bench_utils_remove_path_recursive_force(base_dir); + g_mkdir_with_parents(base_dir, 0755); + + { + gchar *database_path; + const gchar *source_table_name = "Sources"; + + grn_ctx_init(&ctx, 0); + database_path = g_build_filename(base_dir, "db", NULL); + grn_db_create(&ctx, database_path, NULL); + g_free(database_path); + + data.source_table = grn_table_create(&ctx, + source_table_name, + strlen(source_table_name), + NULL, + GRN_TABLE_PAT_KEY | GRN_OBJ_PERSISTENT, + grn_ctx_at(&ctx, GRN_DB_SHORT_TEXT), + NULL); + } + + reporter = bench_reporter_new(); + bench_reporter_register(reporter, "1000", n, + bench_setup, bench_1000, bench_teardown, &data); + bench_reporter_register(reporter, "10000", n, + bench_setup, bench_10000, bench_teardown, &data); + bench_reporter_register(reporter, "100000", n, + bench_setup, bench_100000, bench_teardown, &data); + bench_reporter_run(reporter); + g_object_unref(reporter); + + grn_ctx_fin(&ctx); + + bench_utils_remove_path_recursive_force(data.base_dir); + + bench_quit(); + grn_fin(); + + return EXIT_SUCCESS; +} diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-table-factory.c b/storage/mroonga/vendor/groonga/benchmark/bench-table-factory.c index 7e06874dffd12..9e378f5530b88 100644 --- a/storage/mroonga/vendor/groonga/benchmark/bench-table-factory.c +++ b/storage/mroonga/vendor/groonga/benchmark/bench-table-factory.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2; coding: utf-8 -*- */ /* - Copyright (C) 2008 Kouhei Sutou + Copyright (C) 2008-2016 Kouhei Sutou This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,6 +17,7 @@ */ #include +#include #include @@ -226,11 +227,17 @@ bench_teardown(gpointer user_data) int main(int argc, gchar **argv) { + grn_rc rc; BenchmarkData data; BenchReporter *reporter; gint n = 100; - grn_init(); + rc = grn_init(); + if (rc != GRN_SUCCESS) { + g_print("failed to initialize Groonga: <%d>: %s\n", + rc, grn_get_global_error_message()); + return EXIT_FAILURE; + } bench_init(&argc, &argv); data.context = g_new(grn_ctx, 1); @@ -266,5 +273,5 @@ main(int argc, gchar **argv) bench_quit(); grn_fin(); - return 0; + return EXIT_SUCCESS; } diff --git a/storage/mroonga/vendor/groonga/benchmark/lib/Makefile.am b/storage/mroonga/vendor/groonga/benchmark/lib/Makefile.am index 55d113f92e947..2031b9aad8c70 100644 --- a/storage/mroonga/vendor/groonga/benchmark/lib/Makefile.am +++ b/storage/mroonga/vendor/groonga/benchmark/lib/Makefile.am @@ -9,6 +9,9 @@ AM_CPPFLAGS = \ AM_CFLAGS = \ $(GLIB_CFLAGS) +CFLAGS += \ + $(NO_BAD_FUNCTION_CAST_CFLAGS) + LIBS = \ $(GLIB_LIBS) diff --git a/storage/mroonga/vendor/groonga/build/ac_macros/check_functions.m4 b/storage/mroonga/vendor/groonga/build/ac_macros/check_functions.m4 index 02eb52f30a6dd..a0b424b3111c0 100644 --- a/storage/mroonga/vendor/groonga/build/ac_macros/check_functions.m4 +++ b/storage/mroonga/vendor/groonga/build/ac_macros/check_functions.m4 @@ -2,8 +2,6 @@ AC_CHECK_FUNCS(_gmtime64_s) AC_CHECK_FUNCS(_localtime64_s) -AC_CHECK_FUNCS(_stricmp) -AC_CHECK_FUNCS(_strnicmp) AC_CHECK_FUNCS(_strtoui64) AC_CHECK_FUNCS(gmtime_r) AC_CHECK_FUNCS(localtime_r) diff --git a/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 b/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 index 9a30ca8fc9c17..fca8465123cce 100644 --- a/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 +++ b/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 @@ -7,10 +7,6 @@ AC_CHECK_HEADERS(execinfo.h) AC_CHECK_HEADERS(inttypes.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(signal.h) -AC_CHECK_HEADERS(stdarg.h) -AC_CHECK_HEADERS(stdint.h) -AC_CHECK_HEADERS(string.h) -AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/resource.h) diff --git a/storage/mroonga/vendor/groonga/build/makefiles/gettext.am b/storage/mroonga/vendor/groonga/build/makefiles/gettext.am index 9cea8ce63c12a..c6e57c7b47ba5 100644 --- a/storage/mroonga/vendor/groonga/build/makefiles/gettext.am +++ b/storage/mroonga/vendor/groonga/build/makefiles/gettext.am @@ -59,8 +59,6 @@ build: endif html: build -man: build -pdf: build gettext: rm *.pot || true diff --git a/storage/mroonga/vendor/groonga/build/makefiles/sphinx-build.am b/storage/mroonga/vendor/groonga/build/makefiles/sphinx-build.am index e237377ba8033..047823b6ed7e8 100644 --- a/storage/mroonga/vendor/groonga/build/makefiles/sphinx-build.am +++ b/storage/mroonga/vendor/groonga/build/makefiles/sphinx-build.am @@ -2,18 +2,13 @@ DOCTREES_BASE = doctrees SPHINXOPTS = -PAPER = # Internal variables. SOURCE_DIR = $(abs_top_srcdir)/doc/source -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR) +ALLSPHINXOPTS = -E $(SPHINXOPTS) $(SOURCE_DIR) -SPHINX_DIR = $(abs_top_builddir)/doc/sphinx -SPHINX_BUILD_COMMAND = \ - DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \ +SPHINX_BUILD_COMMAND = \ + DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \ DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \ - LOCALE="$(LOCALE)" \ - PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \ + LOCALE="$(LOCALE)" \ $(SPHINX_BUILD) diff --git a/storage/mroonga/vendor/groonga/build/makefiles/sphinx.am b/storage/mroonga/vendor/groonga/build/makefiles/sphinx.am index c68f62e26ec43..161abe06757e2 100644 --- a/storage/mroonga/vendor/groonga/build/makefiles/sphinx.am +++ b/storage/mroonga/vendor/groonga/build/makefiles/sphinx.am @@ -3,7 +3,6 @@ include $(top_srcdir)/build/makefiles/sphinx-build.am $(html_files): html-build-stamp $(html_files_relative_from_locale_dir): html-build-stamp -$(man_files): man-build-stamp am__nobase_dist_doc_locale_DATA_DIST = if DOCUMENT_AVAILABLE @@ -22,41 +21,16 @@ document_source_files = \ required_build_stamps = \ html-build-stamp \ - man-build-stamp \ mo-build-stamp if DOCUMENT_BUILDABLE EXTRA_DIST += $(required_build_stamps) endif -man_files = \ - man/$(PACKAGE_NAME).1 - generated_files = \ $(DOCTREES_BASE) \ - man \ - man-build-stamp \ html \ - html-build-stamp \ - pdf \ - pdf-build-stamp \ - dirhtml \ - dirhtml-build-stamp \ - pickle \ - pikcle-build-stamp \ - json \ - json-build-stamp \ - htmlhelp \ - htmlhelp-build-stamp \ - qthelp \ - qthelp-build-stamp \ - latex \ - latex-build-stamp \ - changes \ - changes-build-stamp \ - linkcheck \ - linkcheck-build-stamp \ - doctest + html-build-stamp $(mo_files_relative_from_locale_dir): mo-build-stamp @@ -75,83 +49,24 @@ maintainer-clean-local: endif .PHONY: help -.PHONY: man clean-man .PHONY: html clean-html -.PHONY: pdf -.PHONY: dirhtml -.PHONY: pickle -.PHONY: json -.PHONY: htmlhelp -.PHONY: qthelp -.PHONY: latex -.PHONY: changes -.PHONY: linkcheck -.PHONY: doctest if DOCUMENT_BUILDABLE help: @echo "Please use \`make ' where is one of" - @echo " man to make man files" @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " rdoc to make RDoc files" - @echo " textile to make Textile files" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -man: man-build-stamp + html: html-recursive html-build-stamp -dirhtml: dirhtml-build-stamp -pickle: pickle-build-stamp -json: json-build-stamp -htmlhelp: htmlhelp-build-stamp -qthelp: qthelp-build-stamp -latex: latex-build-stamp -rdoc: rdoc-build-stamp -textile: textile-build-stamp -changes: changes-build-stamp -linkcheck: linkcheck-build-stamp -doctest: doctest-build-stamp clean_targets = \ - clean-man \ - clean-html \ - clean-dirhtml \ - clean-pickle \ - clean-json \ - clean-htmlhelp \ - clean-qthelp \ - clean-latex \ - clean-rdoc \ - clean-textile \ - clean-changes \ - clean-linkcheck \ - clean-doctest + clean-html $(clean_targets): target=`echo $@ | sed -e 's/^clean-//'`; \ rm -rf $${target}-build-stamp $${target} build_stamps = \ - man-build-stamp \ - html-build-stamp \ - dirhtml-build-stamp \ - pickle-build-stamp \ - json-build-stamp \ - htmlhelp-build-stamp \ - qthelp-build-stamp \ - latex-build-stamp \ - rdoc-build-stamp \ - textile-build-stamp \ - changes-build-stamp \ - linkcheck-build-stamp \ - doctest-build-stamp + html-build-stamp $(build_stamps): $(document_source_files) target=`echo $@ | sed -e 's/-build-stamp$$//'`; \ @@ -162,18 +77,4 @@ $(build_stamps): $(document_source_files) $(ALLSPHINXOPTS) \ $${target} @touch $@ - -qthelp: qthelp-message -qthelp-message: qthelp-build-stamp - @echo "Build finished; now you can run 'qcollectiongenerator' with the" \ - ".qhcp project file in qthelp/*, like this:" - @echo "# qcollectiongenerator qthelp/groonga.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile qthelp/groonga.qhc" - -latex: latex-message -latex-message: latex-build-stamp - @echo "Build finished; the LaTeX files are in latex/*." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." endif diff --git a/storage/mroonga/vendor/groonga/bundled_lz4_version b/storage/mroonga/vendor/groonga/bundled_lz4_version new file mode 100644 index 0000000000000..6a126f402d53d --- /dev/null +++ b/storage/mroonga/vendor/groonga/bundled_lz4_version @@ -0,0 +1 @@ +1.7.5 diff --git a/storage/mroonga/vendor/groonga/bundled_mecab_naist_jdic_version b/storage/mroonga/vendor/groonga/bundled_mecab_naist_jdic_version new file mode 100644 index 0000000000000..495c21efd6d17 --- /dev/null +++ b/storage/mroonga/vendor/groonga/bundled_mecab_naist_jdic_version @@ -0,0 +1 @@ +0.6.3b-20111013 diff --git a/storage/mroonga/vendor/groonga/bundled_mecab_version b/storage/mroonga/vendor/groonga/bundled_mecab_version new file mode 100644 index 0000000000000..00445f812df9a --- /dev/null +++ b/storage/mroonga/vendor/groonga/bundled_mecab_version @@ -0,0 +1 @@ +0.996 diff --git a/storage/mroonga/vendor/groonga/bundled_message_pack_version b/storage/mroonga/vendor/groonga/bundled_message_pack_version new file mode 100644 index 0000000000000..3e3c2f1e5edb0 --- /dev/null +++ b/storage/mroonga/vendor/groonga/bundled_message_pack_version @@ -0,0 +1 @@ +2.1.1 diff --git a/storage/mroonga/vendor/groonga/config.h.cmake b/storage/mroonga/vendor/groonga/config.h.cmake index 8e3bdaf216baa..bfd0cbdc01207 100644 --- a/storage/mroonga/vendor/groonga/config.h.cmake +++ b/storage/mroonga/vendor/groonga/config.h.cmake @@ -3,12 +3,13 @@ /* general constants */ #define CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}" -#define HOST_CPU "${CMAKE_HOST_SYSTEM_PROCESSOR}" -#define HOST_OS "${CMAKE_HOST_SYSTEM_NAME}" +#define HOST_CPU "${CMAKE_SYSTEM_PROCESSOR}" +#define HOST_OS "${CMAKE_SYSTEM_NAME}" #define VERSION "${VERSION}" #define PACKAGE "${PROJECT_NAME}" #define PACKAGE_NAME "${PROJECT_NAME}" +#define PACKAGE_LABEL "${GRN_PROJECT_LABEL}" #define PACKAGE_STRING "${PROJECT_NAME} ${VERSION}" #define PACKAGE_TARNAME "${PROJECT_NAME}" #define PACKAGE_URL "${PACKAGE_URL}" @@ -84,6 +85,7 @@ #cmakedefine GRN_WITH_CUTTER #cmakedefine GRN_WITH_KYTEA #cmakedefine GRN_WITH_LZ4 +#cmakedefine GRN_WITH_ZSTD #cmakedefine GRN_WITH_MECAB #cmakedefine GRN_WITH_MESSAGE_PACK #cmakedefine GRN_WITH_MRUBY @@ -103,10 +105,6 @@ #cmakedefine HAVE_NETDB_H #cmakedefine HAVE_PTHREAD_H #cmakedefine HAVE_SIGNAL_H -#cmakedefine HAVE_STDARG_H -#cmakedefine HAVE_STDINT_H -#cmakedefine HAVE_STRINGS_H -#cmakedefine HAVE_STRING_H #cmakedefine HAVE_SYS_MMAN_H #cmakedefine HAVE_SYS_PARAM_H #cmakedefine HAVE_SYS_RESOURCE_H @@ -133,8 +131,6 @@ /* functions */ #cmakedefine HAVE__GMTIME64_S #cmakedefine HAVE__LOCALTIME64_S -#cmakedefine HAVE__STRICMP -#cmakedefine HAVE__STRNICMP #cmakedefine HAVE__STRTOUI64 #cmakedefine HAVE_BACKTRACE #cmakedefine HAVE_CLOCK diff --git a/storage/mroonga/vendor/groonga/configure.ac b/storage/mroonga/vendor/groonga/configure.ac index dad29c78f4c1c..414876c6a266b 100644 --- a/storage/mroonga/vendor/groonga/configure.ac +++ b/storage/mroonga/vendor/groonga/configure.ac @@ -1,13 +1,18 @@ AC_PREREQ(2.59) m4_define([groonga_version], m4_include(base_version)) AC_INIT([groonga], groonga_version, [groonga@razil.jp]) +AC_CONFIG_MACRO_DIR([m4]) AM_CONFIG_HEADER(config.h) +GRN_VERSION_RC=`echo groonga_version | sed -e 's/\./,/g'` +AC_SUBST(GRN_VERSION_RC) + AM_INIT_AUTOMAKE([foreign tar-pax subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -PACKAGE_TITLE=Groonga -AC_SUBST(PACKAGE_TITLE) +PACKAGE_LABEL=Groonga +AC_SUBST(PACKAGE_LABEL) +AC_DEFINE_UNQUOTED(PACKAGE_LABEL, ["$PACKAGE_LABEL"], [Label of package]) # for Autoconf 2.60 or earlier. if test -z "${datarootdir}"; then @@ -74,6 +79,8 @@ AC_MSG_RESULT([$solaris]) AC_C_BIGENDIAN AC_PROG_CXX +m4_ifdef([AX_CXX_COMPILE_STDCXX_11], + [AX_CXX_COMPILE_STDCXX_11([ext], [optional])]) AC_PROG_CC m4_ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99]) @@ -142,19 +149,17 @@ TEST_CFLAGS="" TEST_CXXFLAGS="" NO_STRICT_ALIASING_CFLAGS="" NO_FLOAT_EQUAL_CFLAGS="" +NO_BAD_FUNCTION_CAST_CFLAGS="" if test "$GCC" = "yes"; then CHECK_BUILD_FLAG([-Wall]) - CHECK_BUILD_FLAG([-Wextra]) if test "x$check_cflag" = "xno"; then CHECK_BUILD_FLAG([-W]) fi CHECK_BUILD_FLAG([-Wno-unused-but-set-variable]) # FIXME: enable it. - CHECK_BUILD_FLAG([-Wno-unused-parameter]) - CHECK_BUILD_FLAG([-Wno-sign-compare]) CHECK_CFLAG([-Wno-pointer-sign]) - CHECK_BUILD_FLAG([-Wno-missing-field-initializers]) + CHECK_CFLAG([-Wno-declaration-after-statement]) - CHECK_BUILD_FLAG([-Wformat=2]) + CHECK_BUILD_FLAG([-Wformat]) CHECK_BUILD_FLAG([-Wstrict-aliasing=2]) if test "x$check_cflag" = "xyes"; then NO_STRICT_ALIASING_CFLAGS="-fno-strict-aliasing" @@ -166,6 +171,9 @@ if test "$GCC" = "yes"; then fi CHECK_BUILD_FLAG([-Wpointer-arith]) CHECK_CFLAG([-Wbad-function-cast]) + if test "x$check_cflag" = "xyes"; then + NO_BAD_FUNCTION_CAST_CFLAGS="-Wno-bad-function-cast" + fi if test "$CLANG" = "no"; then CHECK_BUILD_FLAG([-Wcast-align]) fi @@ -180,27 +188,16 @@ if test "$GCC" = "yes"; then CHECK_CXXFLAG([-fexceptions]) CHECK_CXXFLAG([-fimplicit-templates]) - - CFLAGS_for_source="$CFLAGS" - CXXFLAGS_for_source="$CXXFLAGS" - CHECK_BUILD_FLAG([-Wno-clobbered]) - if test "x$check_cflag" = "xyes"; then - TEST_CFLAGS="-Wno-clobbered" - fi - if test "x$check_cxxflag" = "xyes"; then - TEST_CXXFLAGS="-Wno-clobbered" - fi - CFLAGS="$CFLAGS_for_source" - CXXFLAGS="$CXXFLAGS_for_source" fi AC_SUBST(TEST_CFLAGS) AC_SUBST(TEST_CXXFLAGS) AC_SUBST(NO_STRICT_ALIASING_CFLAGS) AC_SUBST(NO_FLOAT_EQUAL_CFLAGS) +AC_SUBST(NO_BAD_FUNCTION_CAST_CFLAGS) -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL -m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) +LT_INIT([dlopen win32-dll]) +LT_LANG([Windows Resource]) +LT_OUTPUT LT_CURRENT=0 LT_REVISION=0 @@ -233,19 +230,23 @@ AC_CONFIG_FILES([ lib/mrb/scripts/Makefile lib/mrb/scripts/command_line/Makefile lib/mrb/scripts/context/Makefile + lib/mrb/scripts/expression_tree/Makefile lib/mrb/scripts/initialize/Makefile lib/mrb/scripts/logger/Makefile + lib/mrb/scripts/query_logger/Makefile + lib/proc/Makefile + lib/ts/Makefile include/Makefile include/groonga/Makefile plugins/Makefile plugins/tokenizers/Makefile plugins/suggest/Makefile - plugins/table/Makefile plugins/query_expanders/Makefile plugins/ruby/Makefile plugins/token_filters/Makefile plugins/sharding/Makefile plugins/functions/Makefile + plugins/expression_rewriters/Makefile examples/Makefile examples/dictionary/Makefile examples/dictionary/edict/Makefile @@ -264,19 +265,18 @@ AC_CONFIG_FILES([ packages/windows/language-files/Makefile packages/windows/setup-x64.nsi data/Makefile - data/images/Makefile - data/images/logo/Makefile data/html/Makefile data/munin/Makefile data/init.d/Makefile - data/init.d/redhat/Makefile - data/init.d/redhat/sysconfig/Makefile + data/init.d/centos/Makefile + data/init.d/centos/sysconfig/Makefile data/logrotate.d/Makefile - data/logrotate.d/redhat/Makefile + data/logrotate.d/centos/Makefile data/systemd/Makefile - data/systemd/fedora/Makefile - data/systemd/fedora/sysconfig/Makefile + data/systemd/centos/Makefile + data/systemd/centos/sysconfig/Makefile data/scripts/Makefile + data/tmpfiles.d/Makefile tools/Makefile doc/Makefile doc/locale/Makefile @@ -304,7 +304,10 @@ AC_CONFIG_FILES([ benchmark/fixtures/geo-select/Makefile benchmark/lib/Makefile vendor/Makefile + vendor/lz4/Makefile vendor/onigmo/Makefile + vendor/mecab/Makefile + vendor/message_pack/Makefile vendor/mruby/Makefile ]) @@ -355,14 +358,14 @@ AC_LINK_IFELSE( [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [#define _ISOC99_SOURCE + [#define _ISOC99_SOURCE #include ], - [if (fpclassify(0.0)) {return 0;}] + [if (fpclassify(0.0)) {return 0;}] )], [ AC_DEFINE(_ISOC99_SOURCE, [1], [Define to 1 for fpclassify]) - AC_DEFINE(HAVE_FPCLASSIFY, [1], [use fpclassify with _ISOC99_SOURCE]) - AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FPCLASSIFY, [1], [use fpclassify with _ISOC99_SOURCE]) + AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) @@ -454,7 +457,7 @@ AC_ARG_WITH(stack_size, AC_DEFINE_UNQUOTED(GRN_STACK_SIZE, [$GRN_STACK_SIZE], [stack size]) # lock timeout -GRN_LOCK_TIMEOUT=10000000 +GRN_LOCK_TIMEOUT=900000 AC_ARG_WITH(lock_timeout, [AS_HELP_STRING([--with-lock-timeout=N], [This option specifies how many times Groonga tries to acquire a lock. @@ -609,7 +612,7 @@ if test "x$have_epoll" != "xyes"; then ]) ]) if test "x$have_kqueue" != "xyes"; then - AC_CHECK_HEADER(sys/poll.h, [ + AC_CHECK_HEADER(poll.h, [ AC_CHECK_FUNC(poll, [ have_poll="yes" AC_DEFINE(USE_POLL, [1], [use poll]) @@ -617,7 +620,7 @@ if test "x$have_epoll" != "xyes"; then ]) if test "x$have_poll" != "xyes"; then if test "$os_win32" = "yes"; then - AC_CHECK_HEADER(winsock2.h, [have_select="yes"]) + AC_CHECK_HEADER(winsock2.h, [have_select="yes"]) else AC_CHECK_FUNC(select, [ have_select="yes" @@ -750,18 +753,23 @@ if test "x$RUBY" = "xno"; then else if test "x$RUBY" = "xyes"; then AC_PATH_PROGS(RUBY, - [ruby2.1 ruby21 ruby2.0 ruby20 ruby1.9 ruby19 ruby1.9.1 ruby], + [ dnl + ruby2.3 ruby23 dnl + ruby2.2 ruby22 dnl + ruby2.1 ruby21 dnl + ruby dnl + ], ruby-not-found) if test "$RUBY" != "ruby-not-found"; then ruby_version="`$RUBY --version`" - if echo "$ruby_version" | grep -q -- 'ruby \(1\.9\|2\.\)'; then + if echo "$ruby_version" | grep -q -- 'ruby \(2\.\)'; then ac_cv_ruby_available="yes" else - AC_MSG_WARN([$RUBY isn't Ruby 1.9 or later ($ruby_version)]) + AC_MSG_WARN([$RUBY isn't Ruby 2.0 or later ($ruby_version)]) fi fi else - ruby_not_found_warning_message="$RUBY is not found. Disable HTTP test." + ruby_not_found_warning_message="$RUBY is not found." case "$RUBY" in /*) AC_CHECK_FILE([$RUBY], @@ -791,39 +799,13 @@ AM_CONDITIONAL([WITH_UNIT_TEST], AM_CONDITIONAL([WITH_COMMAND_TEST], [test "$ac_cv_ruby_available" = "yes"]) -# check Inkscape for generating PNG images -inkscape_available="no" -AC_ARG_WITH([inkscape], - AS_HELP_STRING([--with-inkscape=PATH], - [Inkscape path (default: auto)]), - [INKSCAPE="$withval"], - [INKSCAPE="yes"]) - -if test "x$INKSCAPE" = "xno"; then - INKSCAPE= -else - if test "x$INKSCAPE" = "xyes"; then - AC_PATH_PROGS(INKSCAPE, [inkscape], none) - if test "$INKSCAPE" != "none"; then - inkscape_available="yes" - fi - else - AC_CHECK_FILE([$INKSCAPE], - [inkscape_available="yes"], - [AC_MSG_WARN([$INKSCAPE is not found. - Disable PNG image generation.])]) - fi -fi -AC_SUBST(INKSCAPE) -AM_CONDITIONAL([WITH_INKSCAPE], [test "$inkscape_available" = "yes"]) - # check Lemon for generating .c and .h files from .y file lemon_available="no" AC_ARG_WITH([lemon], AS_HELP_STRING([--with-lemon=PATH], [Lemon path (default: auto)]), [LEMON="$withval"], - [: ${LEMON:=auto}]) + [: ${LEMON:=auto}]) if test "$LEMON" = "no"; then LEMON= @@ -842,8 +824,8 @@ else fi else AC_CHECK_FILE([$LEMON], - [lemon_available="yes"], - [AC_MSG_WARN([$LEMON is not found. Disable .y compilation.])]) + [lemon_available="yes"], + [AC_MSG_WARN([$LEMON is not found. Disable .y compilation.])]) fi fi AC_SUBST(LEMON) @@ -925,6 +907,30 @@ if test "x$with_lz4" != "xno"; then fi fi +# Zstandard +AC_ARG_WITH(zstd, + [AS_HELP_STRING([--with-zstd], + [Support data compression by Zstandard. [default=auto]])], + [with_zstd="$withval"], + [with_zstd="auto"]) +if test "x$with_zstd" != "xno"; then + m4_ifdef([PKG_CHECK_MODULES], [ + PKG_CHECK_MODULES([LIBZSTD], + [libzstd], + [GRN_WITH_ZSTD=yes], + [GRN_WITH_ZSTD=no]) + ], + [GRN_WITH_ZSTD=no]) + if test "$GRN_WITH_ZSTD" = "yes"; then + AC_DEFINE(GRN_WITH_ZSTD, [1], + [Support data compression by Zstandard.]) + else + if test "x$with_zstd" != "xauto"; then + AC_MSG_ERROR("No libzstd found") + fi + fi +fi + # jemalloc AC_ARG_WITH(jemalloc, [AS_HELP_STRING([--with-jemalloc], @@ -941,8 +947,38 @@ if test "x$with_jemalloc" != "xno"; then [AC_MSG_ERROR("No libjemalloc found")]) fi +# Apache Arrow +AC_ARG_ENABLE(arrow, + [AS_HELP_STRING([--disable-arrow], + [enable Apache Arrow support. [default=auto-detect]])], + [enable_arrow="$enableval"], + [enable_arrow="auto"]) +if test "x$enable_arrow" != "xno"; then + m4_ifdef([PKG_CHECK_MODULES], [ + PKG_CHECK_MODULES([ARROW], + [arrow >= 0.5.0], + [arrow_available=yes], + [arrow_available=no]) + ], + [arrow_available=no]) + if test "x$arrow_available" = "xyes"; then + AC_DEFINE(GRN_WITH_ARROW, [1], [Enable Apache Arrow support.]) + else + if test "x$enable_arrow" = "xyes"; then + AC_MSG_ERROR("No Apache Arrow found") + fi + fi +fi +AM_CONDITIONAL([GRN_WITH_ARROW], [test "$arrow_available" = "yes"]) + # MeCab # NOTE: MUST be checked last + +BUNDLED_MECAB_VERSION=m4_include([bundled_mecab_version]) +AC_SUBST(BUNDLED_MECAB_VERSION) +BUNDLED_MECAB_NAIST_JDIC_VERSION=m4_include([bundled_mecab_naist_jdic_version]) +AC_SUBST(BUNDLED_MECAB_NAIST_JDIC_VERSION) + AC_ARG_WITH(mecab, [AS_HELP_STRING([--with-mecab], [use MeCab for morphological analysis. [default=yes]])], @@ -1170,6 +1206,9 @@ AC_SUBST(LIBEVENT_CFLAGS) AC_SUBST(LIBEVENT_LIBS) # MessagePack +BUNDLED_MESSAGE_PACK_VERSION=m4_include([bundled_message_pack_version]) +AC_SUBST(BUNDLED_MESSAGE_PACK_VERSION) + AC_ARG_ENABLE(message-pack, [AS_HELP_STRING([--disable-message-pack], [Disable MessagePack support. [default=auto-detect]])], @@ -1203,7 +1242,7 @@ if test "x$enable_message_pack" != "xno"; then if test "x$message_pack_available" = "xyes"; then MESSAGE_PACK_CFLAGS="-I$with_message_pack/include" - MESSAGE_PACK_LIBS="-L$with_message_pack/lib -lmsgpack" + MESSAGE_PACK_LIBS="-L$with_message_pack/lib -lmsgpackc" fi fi @@ -1224,6 +1263,17 @@ AM_CONDITIONAL([ENABLE_SUGGEST_LEARNER], "$libevent_available" = "yes" -a \ "$message_pack_available" = "yes"]) +# Check built-in atomic +case "$host" in + i*86*|x86_64*) + ;; + *) + AC_MSG_CHECKING([for platform which requires libatomic]) + AC_CHECK_LIB(atomic, __atomic_store_8, [ATOMIC_LIBS="-latomic"]) + AC_SUBST(ATOMIC_LIBS) + ;; +esac + # Document AC_MSG_CHECKING([whether enable document]) AC_ARG_ENABLE(document, @@ -1246,10 +1296,10 @@ if test x"$enable_document" != x"no"; then AC_PATH_PROG(SPHINX_BUILD, sphinx-build, []) if test -n "$SPHINX_BUILD"; then sphinx_build_version=`"$SPHINX_BUILD" --version` - if ! echo "$sphinx_build_version" | grep -q ' 1\.[[23]]'; then - AC_MSG_ERROR([ + if ! echo "$sphinx_build_version" | grep -q ' 1\.[[3-6]]'; then + AC_MSG_ERROR([ sphinx-build is old: $sphinx_build_version -Sphinx 1.2 or later is required.]) +Sphinx 1.3 or later is required.]) fi document_available=yes document_buildable=yes @@ -1281,8 +1331,8 @@ fi AC_ARG_WITH([cutter-source-path], AS_HELP_STRING([--with-cutter-source-path=PATH], [Specify Cutter source path for - groonga's release manager.]), - [CUTTER_SOURCE_PATH="$withval"]) + groonga's release manager.]), + [CUTTER_SOURCE_PATH="$withval"]) case "$CUTTER_SOURCE_PATH" in ""|/*) : # do nothing @@ -1330,15 +1380,29 @@ AC_MSG_CHECKING([whether package platform]) AC_ARG_WITH(package-platform, [AS_HELP_STRING([--with-package-platform=PLATFORM], [install package platform related files. [default=no] - (supported package platforms: redhat, fedora)])], + (supported package platforms: centos, centos5, centos6, centos7, fedora)])], [package_platform="$withval"], [package_platform="no"]) +if test "$package_platform" = "centos"; then + distribution=$(cut -d " " -f 1 /etc/redhat-release | tr "A-Z" "a-z") + if grep -q Linux /etc/redhat-release; then + distribution_version=$(cut -d " " -f 4 /etc/redhat-release) + else + distribution_version=$(cut -d " " -f 3 /etc/redhat-release) + fi + distribution_version=$(echo ${distribution_version} | sed -e 's/\..*$//g') + package_platform="${package_platform}${distribution_version}" +fi AC_MSG_RESULT($package_platform) -AM_CONDITIONAL([REDHAT_PLATFORM], - [test "${package_platform}" = "redhat"]) -AM_CONDITIONAL([FEDORA_PLATFORM], - [test "${package_platform}" = "fedora"]) +AM_CONDITIONAL([CENTOS_PLATFORM], + [test "${package_platform}" != "no"]) +AM_CONDITIONAL([CENTOS_INIT_PLATFORM], + [test "${package_platform}" = "centos5" || + test "${package_platform}" = "centos6"]) +AM_CONDITIONAL([CENTOS_SYSTEMD_PLATFORM], + [test "${package_platform}" = "centos7" || + test "${package_platform}" = "fedora"]) # plugins check relative_pluginsdir_base="\$(PACKAGE)/plugins" @@ -1354,18 +1418,15 @@ AC_SUBST(pluginsdir) expanded_pluginsdir="\${libdir}/${expanded_relative_pluginsdir_base}" AC_SUBST(expanded_pluginsdir) -tokenizers_pluginsdir="\${pluginsdir}/tokenizers" -AC_SUBST(tokenizers_pluginsdir) +tokenizer_pluginsdir="\${pluginsdir}/tokenizers" +AC_SUBST(tokenizer_pluginsdir) -query_expanders_pluginsdir="\${pluginsdir}/query_expanders" -AC_SUBST(query_expanders_pluginsdir) +query_expander_pluginsdir="\${pluginsdir}/query_expanders" +AC_SUBST(query_expander_pluginsdir) suggest_pluginsdir="\${pluginsdir}/suggest" AC_SUBST(suggest_pluginsdir) -table_pluginsdir="\${pluginsdir}/table" -AC_SUBST(table_pluginsdir) - ruby_pluginsdir="\${pluginsdir}/ruby" AC_SUBST(ruby_pluginsdir) @@ -1378,6 +1439,9 @@ AC_SUBST(sharding_pluginsdir) function_pluginsdir="\${pluginsdir}/functions" AC_SUBST(function_pluginsdir) +expression_rewriter_pluginsdir="\${pluginsdir}/expression_rewriters" +AC_SUBST(expression_rewriter_pluginsdir) + AC_MSG_CHECKING(for the suffix of plugin shared libraries) shrext_cmds=$(./libtool --config | grep '^shrext_cmds=') eval $shrext_cmds @@ -1389,12 +1453,13 @@ fi AC_DEFINE_UNQUOTED(GRN_PLUGIN_SUFFIX, ["$suffix"], "plugin suffix") # for query expanders -GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE="synonyms.tsv" +GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE_BASE="synonyms.tsv" +GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE="etc/${PACKAGE}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE_BASE}" AC_DEFINE_UNQUOTED(GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE, ["$GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE"], "The relative synonyms file for TSV query expander") GRN_QUERY_EXPANDER_TSV_SYNONYMS_PATH="` - eval echo ${sysconfdir}/${PACKAGE}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE} + eval echo ${sysconfdir}/${PACKAGE}/${GRN_QUERY_EXPANDER_TSV_RELATIVE_SYNONYMS_FILE_BASE} `" AC_DEFINE_UNQUOTED(GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE, ["$GRN_QUERY_EXPANDER_TSV_SYNONYMS_PATH"], @@ -1451,8 +1516,7 @@ AC_ARG_WITH(groonga-org-path, AC_SUBST(GROONGA_ORG_PATH) # groonga-httpd -m4_define([nginx_version], m4_include(nginx_version)) -NGINX_VERSION=nginx_version +NGINX_VERSION=m4_include([nginx_version]) AC_SUBST(NGINX_VERSION) # groonga-httpd binary path @@ -1472,6 +1536,12 @@ else fi AM_CONDITIONAL(WITH_GROONGA_HTTPD, test "$enable_groonga_httpd" = "yes") +GROONGA_HTTPD_PID_PATH="` + test \"$prefix\" = NONE && prefix=/usr/local + eval echo ${localstatedir}/run/groonga/groonga-httpd.pid +`" +AC_SUBST(GROONGA_HTTPD_PID_PATH) + # mruby AC_ARG_ENABLE(mruby, [AS_HELP_STRING([--enable-mruby], @@ -1492,12 +1562,17 @@ if test "$enable_mruby" = "yes"; then fi AC_DEFINE(GRN_WITH_MRUBY, [1], [Define to 1 if mruby is enabled.]) MRUBY_CFLAGS="-I\$(top_srcdir)/vendor/mruby-source/include" + GRN_WITH_MRUBY="yes" else MRUBY_CFLAGS="" fi +AC_SUBST(GRN_WITH_MRUBY) AC_SUBST(MRUBY_CFLAGS) AM_CONDITIONAL(WITH_MRUBY, test "$enable_mruby" = "yes") +MRUBY_CPPFLAGS="-DMRB_INT64" +AC_SUBST(MRUBY_CPPFLAGS) + # This option is used in vendor/onigmo/configure AC_ARG_ENABLE(shared-onigmo, [AS_HELP_STRING([--enable-shared-onigmo], @@ -1506,16 +1581,37 @@ AC_ARG_ENABLE(shared-onigmo, [enable_shared_onigmo="no"]) AM_CONDITIONAL(WITH_SHARED_ONIGMO, test "$enable_shared_onigmo" = "yes") -# TODO: Support using system Onigmo instead of bundled Onigmo. -AC_DEFINE(GRN_WITH_ONIGMO, [1], [Use Onigmo.]) -GRN_WITH_ONIGMO="yes" +AC_ARG_WITH(onigmo, + [AS_HELP_STRING([--without-onigmo], + [Don't Use Onigmo. [default=bundled]])], + [with_onigmo="$withval"], + [with_onigmo="bundled"]) +if test "x$with_onigmo" != "xno"; then + GRN_WITH_ONIGMO="yes" + if test "x$with_onigmo" != "xbundled"; then + m4_ifdef([PKG_CHECK_MODULES], [ + PKG_CHECK_MODULES([ONIGMO], [onigmo], + [have_onigmo=yes], + [have_onigmo=no]) + ], + [have_onigmo=no]) + fi + if test "x$with_onigmo" = "xsystem" -a "$have_onigmo" = "no"; then + AC_MSG_ERROR("No Onigmo found") + fi + if test "x$with_onigmo" = "xbundled" -o "$have_onigmo" = "no"; then + AC_CONFIG_SUBDIRS([vendor/onigmo]) + ONIGMO_CFLAGS="-I\$(top_srcdir)/vendor/onigmo-source" + ONIGMO_LIBS="\$(top_builddir)/vendor/onigmo-source/libonigmo.la" + fi + AC_DEFINE(GRN_WITH_ONIGMO, [1], [Use Onigmo.]) +else + GRN_WITH_ONIGMO="no" +fi AC_SUBST(GRN_WITH_ONIGMO) -AC_CONFIG_SUBDIRS([vendor/onigmo]) - -ONIGMO_CFLAGS="-I\$(top_srcdir)/vendor/onigmo-source" -ONIGMO_LIBS="\$(top_builddir)/vendor/onigmo-source/libonig.la" AC_SUBST(ONIGMO_CFLAGS) AC_SUBST(ONIGMO_LIBS) +AM_CONDITIONAL(WITH_BUNDLED_ONIGMO, test "$with_onigmo" != "no" -a "x$have_onigmo" != "xyes") # PCRE GRN_WITH_PCRE=no @@ -1541,6 +1637,30 @@ AC_SUBST(GRN_WITH_PCRE) AC_SUBST(PCRE_CFLAGS) AC_SUBST(PCRE_LIBS_ONLY_L) +# SSL +GRN_WITH_SSL=no +AC_ARG_WITH(ssl, + [AS_HELP_STRING([--without-ssl], + [Don't use SSL module for groonga-httpd. [default=auto-detect]])], + [with_ssl="$withval"], + [with_ssl="auto"]) +if test "x$with_ssl" != "xno"; then + m4_ifdef([PKG_CHECK_MODULES], [ + PKG_CHECK_MODULES([SSL], [libssl], + [_PKG_CONFIG(SSL_LIBS_ONLY_L, [libs-only-L], [libssl]) + SSL_LIBS_ONLY_L="$pkg_cv_SSL_LIBS_ONLY_L" + GRN_WITH_SSL=yes], + [GRN_WITH_SSL=no]) + ], + [GRN_WITH_SSL=no]) + if test "x$with_ssl" = "xyes" -a "$GRN_WITH_SSL" != "yes"; then + AC_MSG_ERROR("No SSL found") + fi +fi +AC_SUBST(GRN_WITH_SSL) +AC_SUBST(SSL_CFLAGS) +AC_SUBST(SSL_LIBS_ONLY_L) + # For package AC_ARG_WITH(rsync-path, [AS_HELP_STRING([--with-rsync-path=PATH], @@ -1549,6 +1669,13 @@ AC_ARG_WITH(rsync-path, [RSYNC_PATH="packages@packages.groonga.org:public"]) AC_SUBST(RSYNC_PATH) +AC_ARG_WITH(launchpad-ppa, + [AS_HELP_STRING([--with-launchpad-ppa=PPA], + [specify Launchpad Personal Package Archive. [default=groonga-ppa]])], + [LAUNCHPAD_PPA="$withval"], + [LAUNCHPAD_PPA="groonga-ppa"]) +AC_SUBST(LAUNCHPAD_PPA) + AC_ARG_WITH(launchpad-uploader-pgp-key, [AS_HELP_STRING([--with-launchpad-uploader-pgp-key=KEY], [specify PGP key UID to upload Groonga packages to Launchpad.])], @@ -1582,15 +1709,19 @@ GROONGA_HTTPD_DEFAULT_DATABASE_PATH="` AC_SUBST(GROONGA_HTTPD_DEFAULT_DATABASE_PATH) AC_OUTPUT([ + lib/metadata.rc packages/rpm/centos/groonga.spec packages/apt/debian/groonga-keyring.postrm packages/apt/env.sh packages/yum/env.sh groonga.pc + groonga-arrow.pc config.sh groonga-httpd-conf.sh data/groonga-httpd.conf + data/logrotate.d/centos/groonga-httpd data/scripts/groonga-httpd-restart + data/systemd/centos/groonga-httpd.service ]) echo "$PACKAGE_NAME $PACKAGE_VERSION configuration:" @@ -1657,11 +1788,16 @@ echo "groonga-httpd:" echo " enable: $enable_groonga_httpd" if test "$enable_groonga_httpd" = "yes"; then echo " default database path: $GROONGA_HTTPD_DEFAULT_DATABASE_PATH" - echo " PCRE: $WITH_PCRE" - if test "$WITH_PCRE" = "yes"; then + echo " PCRE: $GRN_WITH_PCRE" + if test "$GRN_WITH_PCRE" = "yes"; then echo " CFLAGS: $PCRE_CFLAGS" echo " LIBS only -L: $PCRE_LIBS_ONLY_L" fi + echo " SSL: $GRN_WITH_SSL" + if test "$GRN_WITH_SSL" = "yes"; then + echo " CFLAGS: $SSL_CFLAGS" + echo " LIBS only -L: $SSL_LIBS_ONLY_L" + fi fi echo diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh b/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh index b98397be05aec..e48700af07be0 100755 --- a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh +++ b/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh @@ -16,6 +16,12 @@ else edict_gz=$2 fi -if zcat $edict_gz | ${base_dir}/edict2grn.rb | groonga $1 > /dev/null; then +if type gzcat > /dev/null 2>&1; then + zcat="gzcat" +else + zcat="zcat" +fi + +if $zcat $edict_gz | ${base_dir}/edict2grn.rb | groonga $1 > /dev/null; then echo "edict data loaded." fi diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html b/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html index aaad128a290b5..47e81754094c9 100644 --- a/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html +++ b/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html @@ -16,7 +16,7 @@ - +