From 0cc855cdc8cd0baa6ba50662632b299a3843ff13 Mon Sep 17 00:00:00 2001 From: Kentoku SHIBA Date: Sun, 21 Sep 2014 00:33:45 +0900 Subject: [PATCH] Update Mroonga to the latest version on 2014-09-21T00:33:44+0900 --- .bzrignore | 12 + mysql-test/valgrind.supp | 13 + storage/mroonga/AUTHORS | 7 + storage/mroonga/CMakeLists.txt | 380 + storage/mroonga/ChangeLog | 3 + storage/mroonga/Makefile.am | 157 + storage/mroonga/NEWS | 1 + storage/mroonga/README | 1 + storage/mroonga/autogen.sh | 116 + storage/mroonga/build/Makefile.am | 2 + .../mroonga/build/cmake_modules/Makefile.am | 2 + .../build/cmake_modules/ReadFileList.cmake | 27 + .../mroonga/build/makefiles/LC_MESSAGES.am | 5 + storage/mroonga/build/makefiles/gettext.am | 73 + storage/mroonga/build/makefiles/locale.am | 12 + .../mroonga/build/makefiles/sphinx-build.am | 19 + storage/mroonga/build/makefiles/sphinx.am | 179 + storage/mroonga/config.sh.in | 20 + storage/mroonga/configure.ac | 492 + storage/mroonga/data/Makefile.am | 4 + storage/mroonga/data/install.sql.in | 19 + storage/mroonga/data/uninstall.sql | 8 + storage/mroonga/gpg_uid | 1 + storage/mroonga/ha_mroonga.cpp | 15536 +++ storage/mroonga/ha_mroonga.def | 15 + storage/mroonga/ha_mroonga.hpp | 1190 + storage/mroonga/lib/Makefile.am | 23 + .../mroonga/lib/libmrn_need_mysql_sources.am | 25 + .../mroonga/lib/libmrn_no_mysql_sources.am | 8 + .../lib/libmysqlservices_compat_sources.am | 2 + .../lib/mrn_auto_increment_value_lock.cpp | 42 + .../lib/mrn_auto_increment_value_lock.hpp | 36 + .../mroonga/lib/mrn_condition_converter.cpp | 608 + .../mroonga/lib/mrn_condition_converter.hpp | 82 + .../mroonga/lib/mrn_debug_column_access.cpp | 36 + .../mroonga/lib/mrn_debug_column_access.hpp | 38 + storage/mroonga/lib/mrn_encoding.cpp | 222 + storage/mroonga/lib/mrn_encoding.hpp | 35 + storage/mroonga/lib/mrn_external_lock.cpp | 43 + storage/mroonga/lib/mrn_external_lock.hpp | 38 + storage/mroonga/lib/mrn_field_normalizer.cpp | 142 + storage/mroonga/lib/mrn_field_normalizer.hpp | 47 + storage/mroonga/lib/mrn_index_column_name.cpp | 96 + storage/mroonga/lib/mrn_index_column_name.hpp | 43 + storage/mroonga/lib/mrn_index_table_name.cpp | 89 + storage/mroonga/lib/mrn_index_table_name.hpp | 43 + storage/mroonga/lib/mrn_lock.cpp | 31 + storage/mroonga/lib/mrn_lock.hpp | 36 + .../mrn_match_escalation_threshold_scope.cpp | 33 + .../mrn_match_escalation_threshold_scope.hpp | 35 + .../lib/mrn_multiple_column_key_codec.cpp | 548 + .../lib/mrn_multiple_column_key_codec.hpp | 70 + storage/mroonga/lib/mrn_mysqlservices.cpp | 32 + storage/mroonga/lib/mrn_parameters_parser.cpp | 176 + storage/mroonga/lib/mrn_parameters_parser.hpp | 59 + storage/mroonga/lib/mrn_path_mapper.cpp | 196 + storage/mroonga/lib/mrn_path_mapper.hpp | 51 + storage/mroonga/lib/mrn_smart_grn_obj.cpp | 53 + storage/mroonga/lib/mrn_smart_grn_obj.hpp | 39 + storage/mroonga/lib/mrn_time_converter.cpp | 260 + storage/mroonga/lib/mrn_time_converter.hpp | 47 + storage/mroonga/lib/mrn_windows.hpp | 31 + storage/mroonga/mrn_constants.hpp | 47 + storage/mroonga/mrn_err.h | 32 + storage/mroonga/mrn_macro.hpp | 30 + storage/mroonga/mrn_mysql.h | 83 + storage/mroonga/mrn_mysql_compat.h | 143 + storage/mroonga/mrn_sys.cpp | 88 + storage/mroonga/mrn_sys.hpp | 36 + storage/mroonga/mrn_table.cpp | 1129 + storage/mroonga/mrn_table.hpp | 172 + storage/mroonga/mrn_version.h.in | 40 + storage/mroonga/mysql-test/Makefile.am | 8 + .../mroonga/include/mroonga/check_freebsd.inc | 19 + .../include/mroonga/check_ha_mroonga_so.inc | 26 + .../mroonga/include/mroonga/check_mariadb.inc | 19 + .../mroonga/include/mroonga/check_osx.inc | 19 + .../mroonga/include/mroonga/check_version.inc | 28 + .../mroonga/include/mroonga/check_windows.inc | 20 + .../mroonga/include/mroonga/have_32bit.inc | 28 + .../mroonga/include/mroonga/have_64bit.inc | 25 + .../mroonga/have_fractional_seconds.inc | 32 + .../mroonga/include/mroonga/have_freebsd.inc | 21 + .../mroonga/have_fulltext_index_comment.inc | 25 + .../mroonga/include/mroonga/have_mroonga.inc | 44 + .../include/mroonga/have_mroonga_deinit.inc | 36 + .../include/mroonga/have_mroonga_helper.inc | 17 + .../mroonga/include/mroonga/have_mysql.inc | 21 + .../include/mroonga/have_version_100.inc | 21 + .../mroonga/have_version_100_or_later.inc | 21 + .../include/mroonga/have_version_55.inc | 21 + .../include/mroonga/have_version_56.inc | 21 + .../mroonga/have_version_56_or_later.inc | 21 + .../mroonga/load_mroonga_functions.inc | 24 + .../mroonga/include/mroonga/skip_freebsd.inc | 21 + .../include/mroonga/skip_mariadb_55.inc | 24 + .../mroonga/include/mroonga/skip_osx.inc | 21 + .../mroonga/unload_mroonga_functions.inc | 22 + .../r/alter_table_add_column_after.result | 26 + .../r/alter_table_add_column_first.result | 26 + .../r/alter_table_add_column_multiple.result | 44 + .../r/alter_table_add_column_plain.result | 37 + .../alter_table_add_column_with_flags.result | 10 + .../r/alter_table_add_column_with_type.result | 16 + ...e_add_key_multiple_column_with_data.result | 31 + ...ange_column_comment_not_for_mroonga.result | 17 + ...lter_table_change_column_have_index.result | 16 + ...er_table_change_column_rename_after.result | 28 + ...er_table_change_column_rename_first.result | 28 + ...table_change_column_rename_multiple.result | 32 + ...table_change_column_rename_no_order.result | 28 + .../r/alter_table_change_engine.result | 49 + ..._table_disable_keys_create_fulltext.result | 27 + ...er_table_disable_keys_fulltext_ujis.result | 23 + ...er_table_disable_keys_fulltext_utf8.result | 23 + ..._table_disable_keys_multiple_column.result | 27 + .../r/alter_table_disable_keys_normal.result | 25 + .../r/alter_table_disable_keys_primary.result | 23 + .../alter_table_disable_keys_truncate.result | 20 + .../alter_table_disable_keys_updating.result | 18 + .../r/alter_table_drop_column_multiple.result | 36 + .../r/alter_table_drop_column_one.result | 37 + ..._drop_key_multiple_column_with_data.result | 33 + .../r/alter_table_enable_keys_fulltext.result | 24 + ...ter_table_enable_keys_fulltext_ujis.result | 24 + ...ter_table_enable_keys_fulltext_utf8.result | 24 + ...r_table_enable_keys_multiple_column.result | 28 + .../r/alter_table_enable_keys_normal.result | 26 + .../r/alter_table_enable_keys_primary.result | 24 + .../r/alter_table_engine_decimal.result | 38 + ...r_table_fulltext_add_no_primary_key.result | 19 + .../r/alter_table_fulltext_add_normal.result | 22 + .../r/alter_table_fulltext_add_table.result | 21 + .../r/alter_table_fulltext_drop_table.result | 21 + .../r/alter_table_modify_column_after.result | 33 + .../r/alter_table_modify_column_first.result | 33 + .../alter_table_modify_column_no_order.result | 33 + ...le_recreate_anonymous_index_at_once.result | 47 + .../storage/r/alter_table_rename_table.result | 45 + .../storage/r/alter_table_spatial.result | 132 + .../r/auto_increment_TODO_SPLIT_ME.result | 53 + .../r/auto_increment_table_param.result | 70 + .../storage/r/auto_increment_text.result | 15 + .../storage/r/binlog_TODO_SPLIT_ME.result | 34 + .../r/collation_utf8_general_ci_french.result | 11 + .../r/collation_utf8_unicode_ci_french.result | 11 + .../collation_utf8_unicode_ci_japanese.result | 11 + ...olumn_comment_index_not_for_mroonga.result | 12 + ...lumn_comment_normal_not_for_mroonga.result | 13 + .../storage/r/column_date_with_index.result | 29 + .../r/column_date_without_index.result | 27 + .../storage/r/column_date_zero_date.result | 27 + .../r/column_datetime_32bit_2038.result | 25 + ...mn_datetime_32bit_before_unix_epoch.result | 22 + .../r/column_datetime_32bit_max.result | 22 + .../column_datetime_32bit_out_of_range.result | 23 + .../r/column_datetime_64bit_2038.result | 23 + ...mn_datetime_64bit_before_unix_epoch.result | 20 + .../r/column_datetime_64bit_max.result | 20 + ...etime_64bit_version_55_out_of_range.result | 23 + ...it_version_56_or_later_out_of_range.result | 23 + ...etime_fractional_seconds_with_index.result | 34 + ...me_fractional_seconds_without_index.result | 32 + ..._datetime_freebsd_before_unix_epoch.result | 22 + .../storage/r/column_datetime_null.result | 20 + .../r/column_datetime_with_index.result | 33 + .../r/column_datetime_without_index.result | 31 + .../r/column_datetime_zero_date.result | 27 + ...cimal_fractional_seconds_with_index.result | 29 + ...al_fractional_seconds_without_index.result | 27 + .../r/column_decimal_with_index.result | 29 + .../r/column_decimal_without_index.result | 27 + .../r/column_enum_less_with_index.result | 28 + .../r/column_enum_many_with_index.result | 287 + .../storage/r/column_groonga__id__id.result | 13 + .../r/column_groonga__id_invalid_id.result | 8 + ..._groonga_index_fulltext_other_table.result | 42 + ...olumn_groonga_index_int_other_table.result | 45 + .../r/column_groonga_scalar_reference.result | 24 + ...scalar_with_not_for_mroonga_comment.result | 27 + ...oonga_vector_order_by_with_function.result | 23 + .../r/column_groonga_vector_reference.result | 21 + .../r/column_int_with_index_zero_value.result | 21 + .../storage/r/column_set_16_with_index.result | 40 + .../storage/r/column_set_24_with_index.result | 48 + .../storage/r/column_set_32_with_index.result | 56 + .../storage/r/column_set_64_with_index.result | 88 + .../storage/r/column_set_8_with_index.result | 32 + .../r/column_signed_bigint_with_index.result | 28 + .../r/column_signed_int_with_index.result | 28 + .../column_signed_mediumint_with_index.result | 26 + .../column_signed_smallint_with_index.result | 24 + .../r/column_signed_tinyint_with_index.result | 18 + ..._time_fractional_seconds_with_index.result | 40 + .../storage/r/column_time_with_index.result | 40 + ...stamp_fractional_seconds_with_index.result | 42 + .../r/column_timestamp_with_index.result | 35 + .../r/column_tinyint_without_index.result | 18 + .../column_unsigned_bigint_with_index.result | 28 + ...olumn_unsigned_bigint_without_index.result | 17 + .../r/column_unsigned_int_with_index.result | 28 + ...olumn_unsigned_mediumint_with_index.result | 28 + ...column_unsigned_smallint_with_index.result | 25 + .../column_unsigned_tinyint_with_index.result | 18 + .../storage/r/column_year_with_index.result | 37 + .../r/column_year_without_index.result | 35 + .../r/create_database_name_slash.result | 33 + .../r/create_table_TODO_SPLIT_ME.result | 172 + .../r/create_table_comment_normal.result | 11 + .../r/create_table_default_tokenizer.result | 11 + ...ate_table_normalizer_fulltext_index.result | 16 + ...o_utf8_charset_with_utf8_normalizer.result | 12 + .../r/create_table_reference_type.result | 16 + .../storage/r/create_table_vector.result | 11 + .../storage/r/delete_fulltext_column.result | 21 + .../r/delete_index_btree_many_records.result | 27 + .../r/delete_index_hash_id_no_unique.result | 19 + .../r/delete_index_hash_id_unique.result | 19 + .../storage/r/delete_normal_column.result | 34 + .../storage/r/delete_unsigned_bigint.result | 12 + .../r/drop_database_TODO_SPLIT_ME.result | 14 + .../storage/r/drop_table_TODO_SPLIT_ME.result | 5 + .../mroonga/storage/r/flush_logs.result | 1 + .../storage/r/foreign_key_create.result | 147 + .../fulltext_boolean_mode_empty_query.result | 19 + .../r/fulltext_boolean_mode_escape.result | 18 + .../fulltext_boolean_mode_leading_not.result | 24 + ..._default_operator_minus_no_operator.result | 17 + ...agma_default_operator_minus_with_or.result | 18 + ...ma_default_operator_minus_with_plus.result | 18 + ...gma_default_operator_or_no_operator.result | 18 + ...agma_default_operator_or_with_minus.result | 18 + ...ragma_default_operator_or_with_plus.result | 18 + ...a_default_operator_plus_no_operator.result | 14 + ...ma_default_operator_plus_with_minus.result | 14 + ...ragma_default_operator_plus_with_or.result | 15 + ...oolean_mode_pragma_weight_full_spec.result | 20 + ...oolean_mode_pragma_weight_no_weight.result | 20 + ...ean_mode_pragma_weight_omit_section.result | 20 + ..._pragma_weight_ten_or_more_sections.result | 39 + ...ragma_weight_three_or_more_sections.result | 21 + ...ext_boolean_mode_syntax_error_error.result | 17 + ...ean_mode_syntax_error_error_and_log.result | 17 + ...xt_boolean_mode_syntax_error_ignore.result | 17 + ...an_mode_syntax_error_ignore_and_log.result | 17 + .../storage/r/fulltext_charset_ascii.result | 29 + .../storage/r/fulltext_charset_cp932.result | 18 + .../storage/r/fulltext_charset_eucjpms.result | 18 + .../r/fulltext_charset_japanese.result | 18 + .../storage/r/fulltext_charset_utf8mb4.result | 26 + .../storage/r/fulltext_empty_query.result | 19 + .../storage/r/fulltext_found_rows.result | 42 + .../r/fulltext_groonga_varchar_vector.result | 21 + .../storage/r/fulltext_index_recreate.result | 41 + .../storage/r/fulltext_insert_select.result | 66 + .../storage/r/fulltext_insert_values.result | 25 + ...lltext_multiple_column_index_delete.result | 34 + ...lltext_multiple_column_index_insert.result | 40 + ...text_multiple_column_index_recreate.result | 42 + ...lltext_multiple_column_index_update.result | 37 + .../storage/r/fulltext_multiple_index.result | 33 + .../storage/r/fulltext_no_primary_key.result | 21 + .../r/fulltext_not_match_against.result | 68 + .../mroonga/storage/r/fulltext_or.result | 22 + .../r/fulltext_order_different_against.result | 23 + .../r/fulltext_order_different_match.result | 24 + .../storage/r/fulltext_order_no_where.result | 22 + .../fulltext_order_same_match_against.result | 22 + .../storage/r/fulltext_parser_comment.result | 29 + .../storage/r/fulltext_parser_default.result | 33 + .../storage/r/fulltext_parser_off.result | 42 + .../storage/r/fulltext_two_inner_join.result | 41 + .../r/fulltext_version_100_no_such_key.result | 25 + .../r/fulltext_version_55_no_such_key.result | 25 + .../r/fulltext_version_56_no_such_key.result | 25 + .../storage/r/function_command_select.result | 13 + ...ction_escape_error_query_is_missing.result | 3 + ...on_escape_error_query_is_not_string.result | 3 + ...ror_target_characters_is_not_string.result | 3 + .../r/function_escape_success_all.result | 4 + .../r/function_escape_success_custom.result | 4 + .../r/function_escape_success_nested.result | 13 + .../r/function_last_insert_grn_id.result | 28 + .../function_last_insert_id_reference.result | 15 + .../r/function_last_insert_id_set.result | 21 + .../storage/r/function_snippet_ascii.result | 120 + .../storage/r/function_snippet_cp932.result | 91 + .../storage/r/function_snippet_eucjpms.result | 91 + ...snippet_invalid_nonexistent_charset.result | 4 + ...snippet_invalid_unsupported_charset.result | 4 + .../r/function_snippet_japanese.result | 95 + .../r/geometry_bulk_insert_null.result | 13 + .../storage/r/geometry_contains.result | 170 + .../r/index_btree_equal_datetime.result | 16 + .../storage/r/index_btree_equal_time.result | 16 + .../r/index_btree_equal_timestamp.result | 16 + .../r/index_btree_normal_column_insert.result | 25 + .../storage/r/index_hash_id_normal.result | 18 + .../storage/r/index_hash_id_primary.result | 28 + .../storage/r/index_hash_id_unique.result | 18 + .../r/index_hash_normal_column_insert.result | 25 + .../r/index_multiple_column_delete.result | 32 + ...x_multiple_column_nullable_smallint.result | 65 + ...ple_column_nullable_unsigned_bigint.result | 65 + ...ltiple_column_nullable_unsigned_int.result | 65 + ...e_column_nullable_unsigned_smallint.result | 65 + ...ex_multiple_column_nullable_varchar.result | 65 + ...ndex_multiple_column_primary_delete.result | 29 + ..._multiple_column_primary_select_int.result | 37 + ...ndex_multiple_column_primary_update.result | 32 + .../r/index_multiple_column_recreate.result | 39 + .../r/index_multiple_column_replace.result | 39 + ...index_multiple_column_select_double.result | 28 + .../index_multiple_column_select_float.result | 28 + .../r/index_multiple_column_select_int.result | 37 + ...index_multiple_column_select_string.result | 40 + ...ndex_multiple_column_select_varchar.result | 39 + ...iple_column_unique_date_32bit_equal.result | 25 + ...iple_column_unique_date_64bit_equal.result | 16 + ...tiple_column_unique_date_index_read.result | 20 + ..._column_unique_date_order_32bit_asc.result | 29 + ...column_unique_date_order_32bit_desc.result | 29 + ..._column_unique_date_order_64bit_asc.result | 19 + ...column_unique_date_order_64bit_desc.result | 19 + ...ultiple_column_unique_date_reinsert.result | 17 + ...e_column_unique_datetime_index_read.result | 20 + ...le_column_unique_datetime_order_asc.result | 19 + ...e_column_unique_datetime_order_desc.result | 19 + ...ple_column_unique_datetime_reinsert.result | 17 + ...ndex_multiple_column_unique_decimal.result | 36 + ...tiple_column_unique_time_index_read.result | 22 + ...ltiple_column_unique_time_order_asc.result | 21 + ...tiple_column_unique_time_order_desc.result | 21 + ...ultiple_column_unique_time_reinsert.result | 17 + ..._column_unique_timestamp_index_read.result | 20 + ...e_column_unique_timestamp_order_asc.result | 19 + ..._column_unique_timestamp_order_desc.result | 19 + ...le_column_unique_timestamp_reinsert.result | 17 + ...ndex_multiple_column_unique_varchar.result | Bin 0 -> 1027 bytes ...iple_column_unique_year_32bit_equal.result | 25 + ...iple_column_unique_year_64bit_equal.result | 16 + ...tiple_column_unique_year_index_read.result | 20 + ..._column_unique_year_order_32bit_asc.result | 29 + ...column_unique_year_order_32bit_desc.result | 29 + ..._column_unique_year_order_64bit_asc.result | 19 + ...column_unique_year_order_64bit_desc.result | 19 + ...ultiple_column_unique_year_reinsert.result | 17 + .../r/index_multiple_column_update_int.result | 30 + ...index_multiple_column_update_string.result | 34 + .../r/index_primary_char_exact_length.result | 16 + .../index_primary_char_null_character.result | Bin 0 -> 387 bytes .../storage/r/index_primary_char_short.result | 16 + .../storage/r/index_primary_date.result | 28 + ...ry_datetime_with_fractional_seconds.result | 30 + ...datetime_without_fractional_seconds.result | 29 + ...ary_decimal_with_fractional_seconds.result | 25 + ..._decimal_without_fractional_seconds.result | 25 + ...rimary_time_with_fractional_seconds.result | 29 + ...ary_time_without_fractional_seconds.result | 29 + ...y_timestamp_with_fractional_seconds.result | 30 + ...imestamp_without_fractional_seconds.result | 26 + ...ndex_primary_varchar_null_character.result | Bin 0 -> 390 bytes .../storage/r/index_primary_year.result | 29 + .../r/index_range_greater_than_asc.result | 16 + .../r/index_range_greater_than_desc.result | 15 + ...dex_range_greater_than_or_equal_asc.result | 16 + ...ex_range_greater_than_or_equal_desc.result | 16 + .../r/index_range_less_than_asc.result | 16 + .../r/index_range_less_than_desc.result | 16 + .../index_range_less_than_or_equal_asc.result | 16 + ...index_range_less_than_or_equal_desc.result | 16 + .../r/index_read_multiple_bigint.result | 38 + ...index_read_multiple_bigint_unsigned.result | 31 + .../r/index_read_multiple_double.result | 38 + .../r/index_read_multiple_float.result | 38 + .../storage/r/index_read_multiple_int.result | 38 + .../r/index_read_multiple_int_unsigned.result | 31 + .../r/index_read_multiple_mediumint.result | 38 + ...ex_read_multiple_mediumint_unsigned.result | 31 + .../r/index_read_multiple_smallint.result | 38 + ...dex_read_multiple_smallint_unsigned.result | 31 + .../r/index_read_multiple_tinyint.result | 38 + ...ndex_read_multiple_tinyint_unsigned.result | 31 + .../r/index_read_multiple_varchar.result | 29 + ...dex_read_multiple_varchar_collation.result | 31 + .../storage/r/index_read_normal_int.result | 55 + .../r/index_read_normal_varchar.result | 55 + .../storage/r/index_read_primary_int.result | 55 + .../r/index_read_primary_varchar.result | 55 + .../index_unique_delete_by_primary_key.result | 13 + .../r/index_unique_insert_after_error.result | 15 + .../storage/r/index_unique_varchar.result | 15 + .../r/index_update_multiple_column.result | 18 + .../r/index_update_single_column.result | 17 + .../r/information_schema_plugins.result | 4 + .../r/information_schema_plugins.result.in | 4 + ...n_schema_tables_auto_increment_none.result | 10 + ...on_schema_tables_auto_increment_use.result | 10 + ...formation_schema_tables_data_length.result | 26 + .../storage/r/insert_TODO_SPLIT_ME.result | 90 + ...no_primary_key_and_unique_key_twice.result | 18 + ...on_duplicate_key_update_primary_key.result | 26 + ..._on_duplicate_key_update_unique_key.result | 30 + .../mroonga/storage/r/like_unicode_ci.result | 13 + .../mroonga/storage/r/lock_tables_read.result | 7 + ..._order_limit_not_optimized_disabled.result | 47 + ..._order_limit_not_optimized_no_limit.result | 47 + ...er_limit_optimized_datetime_between.result | 35 + ...mit_optimized_datetime_between_over.result | 35 + ...rder_limit_optimized_datetime_equal.result | 35 + ...mit_optimized_datetime_greater_than.result | 35 + ...ized_datetime_greater_than_or_equal.result | 35 + ..._limit_optimized_datetime_less_than.result | 35 + ...timized_datetime_less_than_or_equal.result | 35 + ...er_limit_optimized_have_primary_key.result | 43 + ...n_order_limit_optimized_int_between.result | 25 + ...er_limit_optimized_int_between_over.result | 25 + ...ion_order_limit_optimized_int_equal.result | 45 + ...er_limit_optimized_int_greater_than.result | 45 + ...optimized_int_greater_than_or_equal.result | 45 + ...order_limit_optimized_int_less_than.result | 45 + ...it_optimized_int_less_than_or_equal.result | 45 + ...rder_limit_optimized_no_primary_key.result | 42 + ...der_limit_optimized_no_where_clause.result | 19 + ..._order_limit_optimized_order_by_asc.result | 43 + ...order_limit_optimized_order_by_desc.result | 43 + ...n_order_limit_optimized_order_by_id.result | 46 + ...it_optimized_order_by_match_against.result | 44 + ...imit_optimized_select_match_against.result | 45 + ..._order_limit_optimized_time_between.result | 35 + ...r_limit_optimized_time_between_over.result | 35 + ...on_order_limit_optimized_time_equal.result | 35 + ...r_limit_optimized_time_greater_than.result | 35 + ...ptimized_time_greater_than_or_equal.result | 35 + ...rder_limit_optimized_time_less_than.result | 35 + ...t_optimized_time_less_than_or_equal.result | 35 + ..._optimized_varchar_equal_with_index.result | 46 + ...timized_varchar_equal_without_index.result | 44 + ..._order_limit_optimized_year_between.result | 30 + ...r_limit_optimized_year_between_over.result | 30 + ...on_order_limit_optimized_year_equal.result | 32 + ...r_limit_optimized_year_greater_than.result | 30 + ...ptimized_year_greater_than_or_equal.result | 30 + ...rder_limit_optimized_year_less_than.result | 30 + ...t_optimized_year_less_than_or_equal.result | 30 + ...timization_skip_count_TODO_SPLIT_ME.result | 106 + ...skip_count_after_insert_multithread.result | 19 + ...ip_count_after_insert_single_thread.result | 19 + .../r/optimization_skip_count_disabled.result | 32 + .../optimization_skip_count_index_view.result | 28 + .../mroonga/storage/r/replace_geometry.result | 23 + .../storage/r/replace_select_varchar.result | 39 + .../mroonga/storage/r/replace_text.result | 33 + .../mroonga/storage/r/replace_varchar.result | 33 + .../mroonga/storage/r/replace_vector.result | 29 + .../mroonga/storage/r/select_all.result | 198 + .../r/select_empty_key_where_equal.result | 12 + .../r/select_empty_key_where_not_equal.result | 13 + .../r/select_group_by_with_index.result | 15 + .../r/select_group_by_without_index.result | 17 + .../mroonga/storage/r/select_pkey.result | 27 + .../storage/r/select_secondary_key.result | 55 + .../r/show_create_table_TODO_SPLIT_ME.result | 25 + .../storage/r/sub_query_fulltext.result | 44 + .../mroonga/storage/r/temporary_table.result | 21 + .../mroonga/storage/r/truncate.result | 55 + .../mroonga/storage/r/update_fulltext.result | 22 + .../storage/r/update_id_hash_index.result | 20 + .../r/update_id_unique_hash_index.result | 20 + .../mroonga/storage/r/update_int.result | 42 + .../r/update_last_insert_grn_id.result | 29 + .../storage/r/update_virtual_column.result | 28 + .../r/variable_database_path_prefix.result | 17 + .../variable_default_parser_new_value.result | 6 + .../variable_default_parser_same_value.result | 4 + .../r/variable_dry_write_delete.result | 28 + .../r/variable_dry_write_insert.result | 30 + .../r/variable_dry_write_update.result | 26 + .../r/variable_lock_timeout_disable.result | 4 + .../r/variable_lock_timeout_invalid.result | 6 + .../r/variable_lock_timeout_no_retry.result | 4 + .../r/variable_lock_timeout_valid.result | 4 + .../r/variable_log_file_new_value.result | 6 + .../variable_log_file_nonexistent_path.result | 4 + .../r/variable_log_file_same_value.result | 4 + .../r/variable_log_level_TODO_SPLIT_ME.result | 49 + ...e_match_escalation_threshold_global.result | 33 + ..._match_escalation_threshold_session.result | 33 + .../r/variable_vector_column_delimiter.result | 29 + .../mroonga/storage/r/variable_version.result | 3 + .../storage/r/variable_version.result.in | 3 + .../mysql-test/mroonga/storage/suite.opt | 1 + .../mysql-test/mroonga/storage/suite.pm | 23 + .../t/alter_table_add_column_after.test | 38 + .../t/alter_table_add_column_first.test | 38 + .../t/alter_table_add_column_multiple.test | 50 + .../t/alter_table_add_column_plain.test | 45 + .../t/alter_table_add_column_with_flags.test | 38 + .../t/alter_table_add_column_with_type.test | 43 + ...ble_add_key_multiple_column_with_data.test | 45 + ...change_column_comment_not_for_mroonga.test | 39 + .../alter_table_change_column_have_index.test | 35 + ...lter_table_change_column_rename_after.test | 39 + ...lter_table_change_column_rename_first.test | 39 + ...r_table_change_column_rename_multiple.test | 43 + ...r_table_change_column_rename_no_order.test | 39 + .../storage/t/alter_table_change_engine.test | 54 + ...er_table_disable_keys_create_fulltext.test | 55 + ...lter_table_disable_keys_fulltext_ujis.test | 49 + ...lter_table_disable_keys_fulltext_utf8.test | 49 + ...er_table_disable_keys_multiple_column.test | 51 + .../t/alter_table_disable_keys_normal.test | 49 + .../t/alter_table_disable_keys_primary.test | 47 + .../t/alter_table_disable_keys_truncate.test | 45 + .../t/alter_table_disable_keys_updating.test | 41 + .../t/alter_table_drop_column_multiple.test | 45 + .../t/alter_table_drop_column_one.test | 44 + ...le_drop_key_multiple_column_with_data.test | 46 + .../t/alter_table_enable_keys_fulltext.test | 51 + ...alter_table_enable_keys_fulltext_ujis.test | 51 + ...alter_table_enable_keys_fulltext_utf8.test | 51 + ...ter_table_enable_keys_multiple_column.test | 53 + .../t/alter_table_enable_keys_normal.test | 51 + .../t/alter_table_enable_keys_primary.test | 49 + .../storage/t/alter_table_engine_decimal.test | 46 + ...ter_table_fulltext_add_no_primary_key.test | 39 + .../t/alter_table_fulltext_add_normal.test | 40 + .../t/alter_table_fulltext_add_table.test | 47 + .../t/alter_table_fulltext_drop_table.test | 48 + .../t/alter_table_modify_column_after.test | 42 + .../t/alter_table_modify_column_first.test | 42 + .../t/alter_table_modify_column_no_order.test | 42 + ...able_recreate_anonymous_index_at_once.test | 51 + .../storage/t/alter_table_rename_table.test | 49 + .../storage/t/alter_table_spatial.test | 150 + .../t/auto_increment_TODO_SPLIT_ME.test | 53 + .../storage/t/auto_increment_table_param.test | 49 + .../storage/t/auto_increment_text.test | 33 + .../storage/t/binlog_TODO_SPLIT_ME.test | 53 + .../t/collation_utf8_general_ci_french.test | 35 + .../t/collation_utf8_unicode_ci_french.test | 35 + .../t/collation_utf8_unicode_ci_japanese.test | 35 + .../column_comment_index_not_for_mroonga.test | 34 + ...column_comment_normal_not_for_mroonga.test | 34 + .../storage/t/column_date_with_index.test | 41 + .../storage/t/column_date_without_index.test | 40 + .../storage/t/column_date_zero_date.test | 38 + .../storage/t/column_datetime_32bit_2038.test | 40 + ...lumn_datetime_32bit_before_unix_epoch.test | 38 + .../storage/t/column_datetime_32bit_max.test | 38 + .../t/column_datetime_32bit_out_of_range.test | 38 + .../storage/t/column_datetime_64bit_2038.test | 40 + ...lumn_datetime_64bit_before_unix_epoch.test | 40 + .../storage/t/column_datetime_64bit_max.test | 38 + ...atetime_64bit_version_55_out_of_range.test | 40 + ...4bit_version_56_or_later_out_of_range.test | 41 + ...atetime_fractional_seconds_with_index.test | 47 + ...time_fractional_seconds_without_index.test | 46 + ...mn_datetime_freebsd_before_unix_epoch.test | 38 + .../storage/t/column_datetime_null.test | 37 + .../storage/t/column_datetime_with_index.test | 45 + .../t/column_datetime_without_index.test | 44 + .../storage/t/column_datetime_zero_date.test | 38 + ...decimal_fractional_seconds_with_index.test | 41 + ...imal_fractional_seconds_without_index.test | 40 + .../storage/t/column_decimal_with_index.test | 41 + .../t/column_decimal_without_index.test | 40 + .../t/column_enum_less_with_index.test | 41 + .../t/column_enum_many_with_index.test | 298 + .../storage/t/column_groonga__id__id.test | 34 + .../t/column_groonga__id_invalid_id.test | 34 + ...mn_groonga_index_fulltext_other_table.test | 54 + .../column_groonga_index_int_other_table.test | 55 + .../t/column_groonga_scalar_reference.test | 45 + ...a_scalar_with_not_for_mroonga_comment.test | 48 + ...groonga_vector_order_by_with_function.test | 45 + .../t/column_groonga_vector_reference.test | 44 + .../t/column_int_with_index_zero_value.test | 40 + .../storage/t/column_set_16_with_index.test | 56 + .../storage/t/column_set_24_with_index.test | 65 + .../storage/t/column_set_32_with_index.test | 74 + .../storage/t/column_set_64_with_index.test | 110 + .../storage/t/column_set_8_with_index.test | 47 + .../t/column_signed_bigint_with_index.test | 42 + .../t/column_signed_int_with_index.test | 42 + .../t/column_signed_mediumint_with_index.test | 42 + .../t/column_signed_smallint_with_index.test | 41 + .../t/column_signed_tinyint_with_index.test | 38 + ...mn_time_fractional_seconds_with_index.test | 50 + .../storage/t/column_time_with_index.test | 49 + ...mestamp_fractional_seconds_with_index.test | 55 + .../t/column_timestamp_with_index.test | 46 + .../t/column_tinyint_without_index.test | 35 + .../t/column_unsigned_bigint_with_index.test | 42 + .../column_unsigned_bigint_without_index.test | 38 + .../t/column_unsigned_int_with_index.test | 42 + .../column_unsigned_mediumint_with_index.test | 42 + .../column_unsigned_smallint_with_index.test | 41 + .../t/column_unsigned_tinyint_with_index.test | 38 + .../storage/t/column_year_with_index.test | 47 + .../storage/t/column_year_without_index.test | 46 + .../storage/t/create_database_name_slash.test | 60 + .../storage/t/create_table_TODO_SPLIT_ME.test | 147 + .../t/create_table_comment_normal.test | 34 + .../t/create_table_default_tokenizer.test | 36 + ...reate_table_normalizer_fulltext_index.test | 42 + ..._no_utf8_charset_with_utf8_normalizer.test | 40 + .../t/create_table_reference_type.test | 42 + .../storage/t/create_table_vector.test | 35 + .../storage/t/delete_fulltext_column.test | 36 + .../t/delete_index_btree_many_records.test | 46 + .../t/delete_index_hash_id_no_unique.test | 33 + .../t/delete_index_hash_id_unique.test | 33 + .../storage/t/delete_normal_column.test | 44 + .../storage/t/delete_unsigned_bigint.test | 37 + .../t/drop_database_TODO_SPLIT_ME.test | 40 + .../storage/t/drop_table_TODO_SPLIT_ME.test | 29 + .../mroonga/storage/t/flush_logs.test | 21 + .../mroonga/storage/t/foreign_key_create.test | 118 + .../t/fulltext_boolean_mode_empty_query.test | 41 + .../t/fulltext_boolean_mode_escape.test | 43 + .../t/fulltext_boolean_mode_leading_not.test | 40 + ...ma_default_operator_minus_no_operator.test | 42 + ...pragma_default_operator_minus_with_or.test | 42 + ...agma_default_operator_minus_with_plus.test | 42 + ...ragma_default_operator_or_no_operator.test | 41 + ...pragma_default_operator_or_with_minus.test | 41 + ..._pragma_default_operator_or_with_plus.test | 41 + ...gma_default_operator_plus_no_operator.test | 39 + ...agma_default_operator_plus_with_minus.test | 39 + ..._pragma_default_operator_plus_with_or.test | 39 + ..._boolean_mode_pragma_weight_full_spec.test | 43 + ..._boolean_mode_pragma_weight_no_weight.test | 43 + ...olean_mode_pragma_weight_omit_section.test | 43 + ...de_pragma_weight_ten_or_more_sections.test | 63 + ..._pragma_weight_three_or_more_sections.test | 44 + ...ltext_boolean_mode_syntax_error_error.test | 45 + ...olean_mode_syntax_error_error_and_log.test | 45 + ...text_boolean_mode_syntax_error_ignore.test | 44 + ...lean_mode_syntax_error_ignore_and_log.test | 44 + .../storage/t/fulltext_charset_ascii.test | 36 + .../storage/t/fulltext_charset_cp932.test | 34 + .../storage/t/fulltext_charset_eucjpms.test | 34 + .../storage/t/fulltext_charset_japanese.test | 33 + .../storage/t/fulltext_charset_utf8mb4.test | 42 + .../storage/t/fulltext_empty_query.test | 41 + .../storage/t/fulltext_found_rows.test | 49 + .../t/fulltext_groonga_varchar_vector.test | 47 + .../storage/t/fulltext_index_recreate.test | 44 + .../storage/t/fulltext_insert_select.test | 45 + .../storage/t/fulltext_insert_values.test | 33 + ...fulltext_multiple_column_index_delete.test | 42 + ...fulltext_multiple_column_index_insert.test | 42 + ...lltext_multiple_column_index_recreate.test | 50 + ...fulltext_multiple_column_index_update.test | 43 + .../storage/t/fulltext_multiple_index.test | 47 + .../storage/t/fulltext_no_primary_key.test | 39 + .../storage/t/fulltext_not_match_against.test | 46 + .../mroonga/storage/t/fulltext_or.test | 42 + .../t/fulltext_order_different_against.test | 42 + .../t/fulltext_order_different_match.test | 44 + .../storage/t/fulltext_order_no_where.test | 41 + .../t/fulltext_order_same_match_against.test | 42 + .../storage/t/fulltext_parser_comment.test | 38 + .../storage/t/fulltext_parser_default.test | 41 + .../storage/t/fulltext_parser_off.test | 48 + .../storage/t/fulltext_two_inner_join.test | 69 + .../t/fulltext_version_100_no_such_key.test | 43 + .../t/fulltext_version_55_no_such_key.test | 42 + .../t/fulltext_version_56_no_such_key.test | 43 + .../storage/t/function_command_select.test | 41 + ...unction_escape_error_query_is_missing.test | 27 + ...tion_escape_error_query_is_not_string.test | 27 + ...error_target_characters_is_not_string.test | 27 + .../t/function_escape_success_all.test | 26 + .../t/function_escape_success_custom.test | 26 + .../t/function_escape_success_nested.test | 40 + .../t/function_last_insert_grn_id.test | 48 + .../t/function_last_insert_id_reference.test | 35 + .../t/function_last_insert_id_set.test | 37 + .../storage/t/function_snippet_ascii.test | 43 + .../storage/t/function_snippet_cp932.test | 43 + .../storage/t/function_snippet_eucjpms.test | 43 + ...n_snippet_invalid_nonexistent_charset.test | 28 + ...n_snippet_invalid_unsupported_charset.test | 28 + .../storage/t/function_snippet_japanese.test | 41 + .../storage/t/geometry_bulk_insert_null.test | 34 + .../mroonga/storage/t/geometry_contains.test | 148 + .../storage/t/index_btree_equal_datetime.test | 44 + .../storage/t/index_btree_equal_time.test | 40 + .../t/index_btree_equal_timestamp.test | 40 + .../t/index_btree_normal_column_insert.test | 33 + .../storage/t/index_hash_id_normal.test | 33 + .../storage/t/index_hash_id_primary.test | 35 + .../storage/t/index_hash_id_unique.test | 33 + .../t/index_hash_normal_column_insert.test | 33 + .../t/index_multiple_column_delete.test | 40 + ...dex_multiple_column_nullable_smallint.test | 53 + ...tiple_column_nullable_unsigned_bigint.test | 53 + ...multiple_column_nullable_unsigned_int.test | 53 + ...ple_column_nullable_unsigned_smallint.test | 53 + ...ndex_multiple_column_nullable_varchar.test | 53 + .../index_multiple_column_primary_delete.test | 39 + ...ex_multiple_column_primary_select_int.test | 40 + .../index_multiple_column_primary_update.test | 39 + .../t/index_multiple_column_recreate.test | 50 + .../t/index_multiple_column_replace.test | 43 + .../index_multiple_column_select_double.test | 43 + .../t/index_multiple_column_select_float.test | 43 + .../t/index_multiple_column_select_int.test | 46 + .../index_multiple_column_select_string.test | 41 + .../index_multiple_column_select_varchar.test | 44 + ...ltiple_column_unique_date_32bit_equal.test | 42 + ...ltiple_column_unique_date_64bit_equal.test | 44 + ...ultiple_column_unique_date_index_read.test | 45 + ...le_column_unique_date_order_32bit_asc.test | 42 + ...e_column_unique_date_order_32bit_desc.test | 42 + ...le_column_unique_date_order_64bit_asc.test | 44 + ...e_column_unique_date_order_64bit_desc.test | 44 + ..._multiple_column_unique_date_reinsert.test | 40 + ...ple_column_unique_datetime_index_read.test | 45 + ...iple_column_unique_datetime_order_asc.test | 44 + ...ple_column_unique_datetime_order_desc.test | 44 + ...tiple_column_unique_datetime_reinsert.test | 40 + .../index_multiple_column_unique_decimal.test | 39 + ...ultiple_column_unique_time_index_read.test | 43 + ...multiple_column_unique_time_order_asc.test | 43 + ...ultiple_column_unique_time_order_desc.test | 43 + ..._multiple_column_unique_time_reinsert.test | 40 + ...le_column_unique_timestamp_index_read.test | 42 + ...ple_column_unique_timestamp_order_asc.test | 42 + ...le_column_unique_timestamp_order_desc.test | 42 + ...iple_column_unique_timestamp_reinsert.test | 40 + .../index_multiple_column_unique_varchar.test | 39 + ...ltiple_column_unique_year_32bit_equal.test | 42 + ...ltiple_column_unique_year_64bit_equal.test | 42 + ...ultiple_column_unique_year_index_read.test | 43 + ...le_column_unique_year_order_32bit_asc.test | 42 + ...e_column_unique_year_order_32bit_desc.test | 42 + ...le_column_unique_year_order_64bit_asc.test | 42 + ...e_column_unique_year_order_64bit_desc.test | 42 + ..._multiple_column_unique_year_reinsert.test | 40 + .../t/index_multiple_column_update_int.test | 43 + .../index_multiple_column_update_string.test | 40 + .../t/index_primary_char_exact_length.test | 38 + .../t/index_primary_char_null_character.test | 37 + .../storage/t/index_primary_char_short.test | 37 + .../mroonga/storage/t/index_primary_date.test | 42 + ...mary_datetime_with_fractional_seconds.test | 45 + ...y_datetime_without_fractional_seconds.test | 43 + ...imary_decimal_with_fractional_seconds.test | 39 + ...ry_decimal_without_fractional_seconds.test | 39 + ..._primary_time_with_fractional_seconds.test | 44 + ...imary_time_without_fractional_seconds.test | 43 + ...ary_timestamp_with_fractional_seconds.test | 46 + ..._timestamp_without_fractional_seconds.test | 40 + .../index_primary_varchar_null_character.test | 37 + .../mroonga/storage/t/index_primary_year.test | 43 + .../t/index_range_greater_than_asc.test | 39 + .../t/index_range_greater_than_desc.test | 39 + ...index_range_greater_than_or_equal_asc.test | 39 + ...ndex_range_greater_than_or_equal_desc.test | 39 + .../storage/t/index_range_less_than_asc.test | 39 + .../storage/t/index_range_less_than_desc.test | 39 + .../t/index_range_less_than_or_equal_asc.test | 39 + .../index_range_less_than_or_equal_desc.test | 39 + .../storage/t/index_read_multiple_bigint.test | 45 + .../index_read_multiple_bigint_unsigned.test | 43 + .../storage/t/index_read_multiple_double.test | 45 + .../storage/t/index_read_multiple_float.test | 45 + .../storage/t/index_read_multiple_int.test | 46 + .../t/index_read_multiple_int_unsigned.test | 43 + .../t/index_read_multiple_mediumint.test | 45 + ...ndex_read_multiple_mediumint_unsigned.test | 43 + .../t/index_read_multiple_smallint.test | 45 + ...index_read_multiple_smallint_unsigned.test | 43 + .../t/index_read_multiple_tinyint.test | 45 + .../index_read_multiple_tinyint_unsigned.test | 43 + .../t/index_read_multiple_varchar.test | 44 + ...index_read_multiple_varchar_collation.test | 43 + .../storage/t/index_read_normal_int.test | 41 + .../storage/t/index_read_normal_varchar.test | 41 + .../storage/t/index_read_primary_int.test | 41 + .../storage/t/index_read_primary_varchar.test | 41 + .../t/index_unique_delete_by_primary_key.test | 37 + .../t/index_unique_insert_after_error.test | 38 + .../storage/t/index_unique_varchar.test | 36 + .../t/index_update_multiple_column.test | 40 + .../storage/t/index_update_single_column.test | 39 + .../storage/t/information_schema_plugins.test | 22 + ...ion_schema_tables_auto_increment_none.test | 34 + ...tion_schema_tables_auto_increment_use.test | 34 + ...information_schema_tables_data_length.test | 42 + .../storage/t/insert_TODO_SPLIT_ME.test | 105 + ...e_no_primary_key_and_unique_key_twice.test | 41 + ...t_on_duplicate_key_update_primary_key.test | 43 + ...rt_on_duplicate_key_update_unique_key.test | 45 + .../mroonga/storage/t/like_unicode_ci.test | 37 + .../mroonga/storage/t/lock_tables_read.test | 32 + ...on_order_limit_not_optimized_disabled.test | 60 + ...on_order_limit_not_optimized_no_limit.test | 55 + ...rder_limit_optimized_datetime_between.test | 50 + ...limit_optimized_datetime_between_over.test | 50 + ..._order_limit_optimized_datetime_equal.test | 50 + ...limit_optimized_datetime_greater_than.test | 50 + ...imized_datetime_greater_than_or_equal.test | 50 + ...er_limit_optimized_datetime_less_than.test | 50 + ...optimized_datetime_less_than_or_equal.test | 50 + ...rder_limit_optimized_have_primary_key.test | 51 + ...ion_order_limit_optimized_int_between.test | 48 + ...rder_limit_optimized_int_between_over.test | 48 + ...ation_order_limit_optimized_int_equal.test | 56 + ...rder_limit_optimized_int_greater_than.test | 56 + ...t_optimized_int_greater_than_or_equal.test | 56 + ...n_order_limit_optimized_int_less_than.test | 56 + ...imit_optimized_int_less_than_or_equal.test | 56 + ..._order_limit_optimized_no_primary_key.test | 51 + ...order_limit_optimized_no_where_clause.test | 39 + ...on_order_limit_optimized_order_by_asc.test | 55 + ...n_order_limit_optimized_order_by_desc.test | 55 + ...ion_order_limit_optimized_order_by_id.test | 57 + ...imit_optimized_order_by_match_against.test | 56 + ..._limit_optimized_select_match_against.test | 57 + ...on_order_limit_optimized_time_between.test | 50 + ...der_limit_optimized_time_between_over.test | 50 + ...tion_order_limit_optimized_time_equal.test | 50 + ...der_limit_optimized_time_greater_than.test | 50 + ..._optimized_time_greater_than_or_equal.test | 50 + ..._order_limit_optimized_time_less_than.test | 50 + ...mit_optimized_time_less_than_or_equal.test | 50 + ...it_optimized_varchar_equal_with_index.test | 57 + ...optimized_varchar_equal_without_index.test | 56 + ...on_order_limit_optimized_year_between.test | 53 + ...der_limit_optimized_year_between_over.test | 53 + ...tion_order_limit_optimized_year_equal.test | 55 + ...der_limit_optimized_year_greater_than.test | 53 + ..._optimized_year_greater_than_or_equal.test | 53 + ..._order_limit_optimized_year_less_than.test | 53 + ...mit_optimized_year_less_than_or_equal.test | 53 + ...optimization_skip_count_TODO_SPLIT_ME.test | 61 + ...n_skip_count_after_insert_multithread.test | 45 + ...skip_count_after_insert_single_thread.test | 40 + .../t/optimization_skip_count_disabled.test | 51 + .../t/optimization_skip_count_index_view.test | 56 + .../mroonga/storage/t/replace_geometry.test | 39 + .../storage/t/replace_select_varchar.test | 64 + .../mroonga/storage/t/replace_text.test | 44 + .../mroonga/storage/t/replace_varchar.test | 44 + .../mroonga/storage/t/replace_vector.test | 46 + .../mroonga/storage/t/select_all.test | 100 + .../t/select_empty_key_where_equal.test | 36 + .../t/select_empty_key_where_not_equal.test | 36 + .../storage/t/select_group_by_with_index.test | 38 + .../t/select_group_by_without_index.test | 39 + .../mroonga/storage/t/select_pkey.test | 40 + .../storage/t/select_secondary_key.test | 51 + .../t/show_create_table_TODO_SPLIT_ME.test | 35 + .../mroonga/storage/t/sub_query_fulltext.test | 55 + .../mroonga/storage/t/temporary_table.test | 39 + .../mroonga/storage/t/truncate.test | 56 + .../mroonga/storage/t/update_fulltext.test | 36 + .../storage/t/update_id_hash_index.test | 33 + .../t/update_id_unique_hash_index.test | 33 + .../mroonga/storage/t/update_int.test | 44 + .../storage/t/update_last_insert_grn_id.test | 48 + .../storage/t/update_virtual_column.test | 43 + .../t/variable_database_path_prefix.test | 42 + .../t/variable_default_parser_new_value.test | 25 + .../t/variable_default_parser_same_value.test | 22 + .../storage/t/variable_dry_write_delete.test | 43 + .../storage/t/variable_dry_write_insert.test | 43 + .../storage/t/variable_dry_write_update.test | 42 + .../t/variable_lock_timeout_disable.test | 28 + .../t/variable_lock_timeout_invalid.test | 28 + .../t/variable_lock_timeout_no_retry.test | 27 + .../t/variable_lock_timeout_valid.test | 27 + .../t/variable_log_file_new_value.test | 25 + .../t/variable_log_file_nonexistent_path.test | 22 + .../t/variable_log_file_same_value.test | 22 + .../t/variable_log_level_TODO_SPLIT_ME.test | 61 + ...ble_match_escalation_threshold_global.test | 55 + ...le_match_escalation_threshold_session.test | 53 + .../t/variable_vector_column_delimiter.test | 54 + .../mroonga/storage/t/variable_version.test | 22 + .../wrapper/r/alter_table_add_column.result | 37 + .../alter_table_change_column_comment.result | 17 + .../r/alter_table_change_engine.result | 49 + .../alter_table_comment_change_engine.result | 40 + ..._table_disable_keys_create_fulltext.result | 27 + .../alter_table_disable_keys_fulltext.result | 23 + ..._table_disable_keys_multiple_column.result | 27 + .../r/alter_table_disable_keys_normal.result | 25 + .../r/alter_table_disable_keys_primary.result | 23 + .../alter_table_disable_keys_updating.result | 19 + .../wrapper/r/alter_table_drop_column.result | 37 + .../r/alter_table_enable_keys_fulltext.result | 24 + ...alter_table_enable_keys_lock_tables.result | 20 + ...r_table_enable_keys_multiple_column.result | 28 + .../r/alter_table_enable_keys_normal.result | 26 + .../r/alter_table_enable_keys_primary.result | 24 + .../wrapper/r/alter_table_fulltext.result | 52 + .../wrapper/r/alter_table_rename_table.result | 45 + .../wrapper/r/alter_table_spatial.result | 131 + .../wrapper/r/auto_increment_text.result | 15 + .../wrapper/r/binlog_TODO_SPLIT_ME.result | 34 + ...olumn_comment_index_not_for_mroonga.result | 16 + .../wrapper/r/column_normal_comment.result | 13 + .../wrapper/r/count_star_with_index.result | 28 + .../r/create_table_TODO_SPLIT_ME.result | 109 + .../r/create_table_comment_combined.result | 12 + ...ate_table_normalizer_fulltext_index.result | 16 + .../wrapper/r/delete_TODO_SPLIT_ME.result | 55 + .../mroonga/wrapper/r/delete_all.result | 19 + .../fulltext_boolean_mode_leading_not.result | 24 + ...boolean_mode_multiple_match_against.result | 32 + ..._default_operator_minus_no_operator.result | 18 + ...agma_default_operator_minus_with_or.result | 19 + ...ma_default_operator_minus_with_plus.result | 19 + ...gma_default_operator_or_no_operator.result | 19 + ...agma_default_operator_or_with_minus.result | 19 + ...ragma_default_operator_or_with_plus.result | 19 + ...a_default_operator_plus_no_operator.result | 15 + ...ma_default_operator_plus_with_minus.result | 15 + ...ragma_default_operator_plus_with_or.result | 16 + ...oolean_mode_pragma_weight_full_spec.result | 20 + ...oolean_mode_pragma_weight_no_weight.result | 20 + ...ean_mode_pragma_weight_omit_section.result | 20 + .../wrapper/r/fulltext_charset_ascii.result | 29 + .../wrapper/r/fulltext_charset_cp932.result | 18 + .../wrapper/r/fulltext_charset_eucjpms.result | 18 + .../r/fulltext_charset_japanese.result | 18 + .../wrapper/r/fulltext_index_recreate.result | 41 + .../wrapper/r/fulltext_insert_select.result | 66 + .../wrapper/r/fulltext_insert_values.result | 25 + .../wrapper/r/fulltext_many_records.result | 4389 + ...lltext_multiple_column_index_delete.result | 34 + ...lltext_multiple_column_index_insert.result | 40 + ...text_multiple_column_index_recreate.result | 42 + ...lltext_multiple_column_index_update.result | 37 + .../wrapper/r/fulltext_multiple_index.result | 33 + .../mroonga/wrapper/r/fulltext_myisam.result | 202 + .../r/fulltext_not_match_against.result | 68 + .../r/fulltext_order_TODO_SPLIT_ME.result | 50 + .../r/fulltext_order_transaction.result | 50 + .../wrapper/r/fulltext_parser_comment.result | 29 + .../r/function_last_insert_grn_id.result | 17 + .../function_last_insert_id_reference.result | 15 + .../r/function_last_insert_id_set.result | 21 + .../wrapper/r/geometry_contains.result | 169 + .../mroonga/wrapper/r/geometry_delete.result | 31 + .../mroonga/wrapper/r/geometry_update.result | 36 + .../r/index_force_index_not_used.result | 8 + .../wrapper/r/insert_TODO_SPLIT_ME.result | 78 + .../mroonga/wrapper/r/insert_bulk.result | 30 + ..._multiple_column_primary_key_myisam.result | 36 + ...multiple_column_unique_index_myisam.result | 39 + .../r/multi_range_read_disk_sweep.result | 18 + ...imization_order_limit_TODO_SPLIT_ME.result | 67 + ...ization_order_limit_no_where_clause.result | 24 + .../wrapper/r/repair_table_no_files.result | 42 + .../r/repair_table_no_index_file.result | 42 + .../mroonga/wrapper/r/temporary_table.result | 21 + .../wrapper/r/transaction_query_cache.result | 28 + .../transaction_rollback_delete_delete.result | 50 + .../transaction_rollback_delete_update.result | 47 + .../mroonga/wrapper/r/truncate.result | 55 + .../mroonga/wrapper/r/update_fulltext.result | 33 + .../mroonga/wrapper/r/update_int.result | 36 + .../r/variable_dry_write_delete.result | 53 + .../r/variable_dry_write_insert.result | 42 + .../r/variable_dry_write_update.result | 39 + ...e_match_escalation_threshold_global.result | 33 + ..._match_escalation_threshold_session.result | 33 + .../r/version_55_performance_schema.result | 38 + ...sion_56_or_later_performance_schema.result | 73 + .../mysql-test/mroonga/wrapper/suite.opt | 1 + .../mysql-test/mroonga/wrapper/suite.pm | 23 + .../wrapper/t/alter_table_add_column.test | 46 + .../t/alter_table_change_column_comment.test | 40 + .../wrapper/t/alter_table_change_engine.test | 55 + .../t/alter_table_comment_change_engine.test | 45 + ...er_table_disable_keys_create_fulltext.test | 56 + .../t/alter_table_disable_keys_fulltext.test | 50 + ...er_table_disable_keys_multiple_column.test | 52 + .../t/alter_table_disable_keys_normal.test | 50 + .../t/alter_table_disable_keys_primary.test | 48 + .../t/alter_table_disable_keys_updating.test | 42 + .../wrapper/t/alter_table_drop_column.test | 45 + .../t/alter_table_enable_keys_fulltext.test | 52 + .../alter_table_enable_keys_lock_tables.test | 45 + ...ter_table_enable_keys_multiple_column.test | 54 + .../t/alter_table_enable_keys_normal.test | 52 + .../t/alter_table_enable_keys_primary.test | 50 + .../wrapper/t/alter_table_fulltext.test | 57 + .../wrapper/t/alter_table_rename_table.test | 50 + .../wrapper/t/alter_table_spatial.test | 150 + .../wrapper/t/auto_increment_text.test | 34 + .../wrapper/t/binlog_TODO_SPLIT_ME.test | 55 + .../column_comment_index_not_for_mroonga.test | 37 + .../wrapper/t/column_normal_comment.test | 35 + .../wrapper/t/count_star_with_index.test | 54 + .../wrapper/t/create_table_TODO_SPLIT_ME.test | 99 + .../t/create_table_comment_combined.test | 35 + ...reate_table_normalizer_fulltext_index.test | 43 + .../wrapper/t/delete_TODO_SPLIT_ME.test | 59 + .../mroonga/wrapper/t/delete_all.test | 44 + .../t/fulltext_boolean_mode_leading_not.test | 41 + ...t_boolean_mode_multiple_match_against.test | 44 + ...ma_default_operator_minus_no_operator.test | 43 + ...pragma_default_operator_minus_with_or.test | 43 + ...agma_default_operator_minus_with_plus.test | 43 + ...ragma_default_operator_or_no_operator.test | 42 + ...pragma_default_operator_or_with_minus.test | 42 + ..._pragma_default_operator_or_with_plus.test | 42 + ...gma_default_operator_plus_no_operator.test | 40 + ...agma_default_operator_plus_with_minus.test | 40 + ..._pragma_default_operator_plus_with_or.test | 40 + ..._boolean_mode_pragma_weight_full_spec.test | 44 + ..._boolean_mode_pragma_weight_no_weight.test | 44 + ...olean_mode_pragma_weight_omit_section.test | 44 + .../wrapper/t/fulltext_charset_ascii.test | 38 + .../wrapper/t/fulltext_charset_cp932.test | 35 + .../wrapper/t/fulltext_charset_eucjpms.test | 35 + .../wrapper/t/fulltext_charset_japanese.test | 35 + .../wrapper/t/fulltext_index_recreate.test | 51 + .../wrapper/t/fulltext_insert_select.test | 47 + .../wrapper/t/fulltext_insert_values.test | 35 + .../wrapper/t/fulltext_many_records.test | 4136 + ...fulltext_multiple_column_index_delete.test | 43 + ...fulltext_multiple_column_index_insert.test | 43 + ...lltext_multiple_column_index_recreate.test | 51 + ...fulltext_multiple_column_index_update.test | 44 + .../wrapper/t/fulltext_multiple_index.test | 48 + .../mroonga/wrapper/t/fulltext_myisam.test | 102 + .../wrapper/t/fulltext_not_match_against.test | 47 + .../t/fulltext_order_TODO_SPLIT_ME.test | 51 + .../wrapper/t/fulltext_order_transaction.test | 64 + .../wrapper/t/fulltext_parser_comment.test | 39 + .../t/function_last_insert_grn_id.test | 52 + .../t/function_last_insert_id_reference.test | 36 + .../t/function_last_insert_id_set.test | 38 + .../mroonga/wrapper/t/geometry_contains.test | 145 + .../mroonga/wrapper/t/geometry_delete.test | 48 + .../mroonga/wrapper/t/geometry_update.test | 50 + .../wrapper/t/index_force_index_not_used.test | 32 + .../wrapper/t/insert_TODO_SPLIT_ME.test | 91 + .../mroonga/wrapper/t/insert_bulk.test | 44 + ...te_multiple_column_primary_key_myisam.test | 49 + ...e_multiple_column_unique_index_myisam.test | 49 + .../t/multi_range_read_disk_sweep.test | 45 + ...ptimization_order_limit_TODO_SPLIT_ME.test | 68 + ...imization_order_limit_no_where_clause.test | 46 + .../wrapper/t/repair_table_no_files.test | 69 + .../wrapper/t/repair_table_no_index_file.test | 63 + .../mroonga/wrapper/t/temporary_table.test | 40 + .../wrapper/t/transaction_query_cache.test | 53 + .../t/transaction_rollback_delete_delete.test | 59 + .../t/transaction_rollback_delete_update.test | 56 + .../mroonga/wrapper/t/truncate.test | 57 + .../mroonga/wrapper/t/update_fulltext.test | 43 + .../mroonga/wrapper/t/update_int.test | 41 + .../wrapper/t/variable_dry_write_delete.test | 55 + .../wrapper/t/variable_dry_write_insert.test | 47 + .../wrapper/t/variable_dry_write_update.test | 48 + ...ble_match_escalation_threshold_global.test | 56 + ...le_match_escalation_threshold_session.test | 54 + .../t/version_55_performance_schema.test | 42 + ...ersion_56_or_later_performance_schema.test | 42 + storage/mroonga/packages/Makefile.am | 7 + storage/mroonga/packages/apt/Makefile.am | 55 + storage/mroonga/packages/apt/build-deb.sh | 121 + .../mroonga/packages/apt/build-in-chroot.sh | 134 + .../packages/apt/mroonga-depended-packages | 11 + storage/mroonga/packages/apt/sign-packages.sh | 42 + .../mroonga/packages/apt/sign-repository.sh | 46 + .../mroonga/packages/apt/update-repository.sh | 130 + storage/mroonga/packages/check-utility.sh | 665 + .../debian/apparmor/mysql-server-mroonga | 5 + storage/mroonga/packages/debian/changelog | 355 + 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 | 35 + storage/mroonga/packages/rpm/Makefile.am | 3 + .../mroonga/packages/rpm/centos/Makefile.am | 9 + .../rpm/centos/mariadb-mroonga.spec.in | 375 + .../rpm/centos/mysql55-mroonga.spec.in | 200 + .../centos/mysql56-community-mroonga.spec.in | 198 + .../mroonga/packages/rpm/fedora/Makefile.am | 2 + .../rpm/fedora/mariadb-mroonga.spec.in | 189 + .../packages/rpm/fedora/mysql-mroonga.spec.in | 324 + storage/mroonga/packages/source/Makefile.am | 122 + .../patches/mariadb-10.0.3-windows-build.diff | 9 + storage/mroonga/packages/ubuntu/Makefile.am | 24 + storage/mroonga/packages/ubuntu/upload.rb | 168 + storage/mroonga/packages/windows/Makefile.am | 12 + storage/mroonga/packages/windows/README.md | 20 + .../packages/windows/build-vc2010-msi-32.bat | 8 + .../packages/windows/build-vc2010-msi-64.bat | 8 + .../packages/windows/build-vc2010-zip-32.bat | 8 + .../packages/windows/build-vc2010-zip-64.bat | 8 + .../mroonga/packages/windows/build-vc2010.bat | 4 + .../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 + storage/mroonga/packages/yum/Makefile.am | 63 + storage/mroonga/packages/yum/Vagrantfile | 50 + storage/mroonga/packages/yum/build-in-vm.sh | 60 + storage/mroonga/packages/yum/build-rpm.sh | 108 + storage/mroonga/packages/yum/env.sh.in | 27 + storage/mroonga/packages/yum/sign-rpm.sh | 44 + .../mroonga/packages/yum/update-repository.sh | 29 + storage/mroonga/plug.in | 6 + storage/mroonga/plugin_version | 1 + .../required_groonga_normalizer_mysql_version | 1 + storage/mroonga/required_groonga_version | 1 + storage/mroonga/sources.am | 13 + storage/mroonga/test/Makefile.am | 14 + storage/mroonga/test/run-sql-test.sh | 232 + storage/mroonga/test/run-unit-test.sh | 49 + storage/mroonga/test/unit/Makefile.am | 34 + .../test/unit/test_mrn_path_mapper.cpp | 116 + storage/mroonga/test/unit/test_mrn_sys.cpp | 95 + storage/mroonga/tools/Makefile.am | 6 + storage/mroonga/tools/prepare-sphinx-html.rb | 183 + storage/mroonga/tools/travis/before_script.sh | 32 + storage/mroonga/tools/travis/install.sh | 103 + storage/mroonga/tools/travis/script.sh | 114 + storage/mroonga/tools/upload-to-github.rb | 42 + storage/mroonga/udf/Makefile.am | 10 + storage/mroonga/udf/mrn_udf_command.cpp | 165 + storage/mroonga/udf/mrn_udf_escape.cpp | 154 + .../udf/mrn_udf_last_insert_grn_id.cpp | 54 + storage/mroonga/udf/mrn_udf_snippet.cpp | 302 + storage/mroonga/udf/sources.am | 5 + storage/mroonga/vendor/groonga/CMakeLists.txt | 505 + storage/mroonga/vendor/groonga/Makefile.am | 135 + storage/mroonga/vendor/groonga/README.md | 49 + storage/mroonga/vendor/groonga/autogen.sh | 21 + storage/mroonga/vendor/groonga/base_version | 1 + .../vendor/groonga/benchmark/Makefile.am | 89 + .../groonga/benchmark/bench-ctx-create.c | 192 + .../groonga/benchmark/bench-geo-distance.c | 499 + .../groonga/benchmark/bench-geo-select.c | 269 + .../groonga/benchmark/bench-geo-select.sh | 38 + .../benchmark/bench-query-optimizer-ddl.grn | 16 + .../groonga/benchmark/bench-query-optimizer.c | 208 + .../groonga/benchmark/bench-table-factory.c | 270 + .../groonga/benchmark/fixtures/Makefile.am | 2 + .../fixtures/geo-select/13_2010.CSV.xz | Bin 0 -> 2355640 bytes .../benchmark/fixtures/geo-select/Makefile.am | 4 + .../benchmark/fixtures/geo-select/README.txt | 6 + .../fixtures/geo-select/format_2010.html | 111 + .../groonga/benchmark/geo-distance-summary.rb | 140 + .../benchmark/geo-select-generate-grn.rb | 53 + .../vendor/groonga/benchmark/lib/Makefile.am | 21 + .../groonga/benchmark/lib/bench-reporter.c | 315 + .../groonga/benchmark/lib/bench-reporter.h | 64 + .../groonga/benchmark/lib/bench-utils.c | 83 + .../groonga/benchmark/lib/bench-utils.h | 34 + .../vendor/groonga/benchmark/lib/benchmark.c | 35 + .../vendor/groonga/benchmark/lib/benchmark.h | 32 + .../vendor/groonga/bindings/php/config.m4 | 66 + .../vendor/groonga/bindings/php/config.w32 | 6 + .../vendor/groonga/bindings/php/groonga.c | 218 + .../vendor/groonga/bindings/php/php_groonga.h | 125 + .../groonga/bindings/php/tests/001.phpt | 29 + .../groonga/bindings/python/ql/groongaql.c | 364 + .../groonga/bindings/python/ql/setup.py | 22 + .../mroonga/vendor/groonga/build/Makefile.am | 2 + .../build/ac_macros/check_functions.m4 | 13 + .../groonga/build/ac_macros/check_headers.m4 | 24 + .../groonga/build/cmake_modules/Makefile.am | 2 + .../build/cmake_modules/ReadFileList.cmake | 27 + .../groonga/build/makefiles/LC_MESSAGES.am | 5 + .../vendor/groonga/build/makefiles/gettext.am | 73 + .../vendor/groonga/build/makefiles/locale.am | 12 + .../groonga/build/makefiles/sphinx-build.am | 19 + .../vendor/groonga/build/makefiles/sphinx.am | 179 + storage/mroonga/vendor/groonga/config.h.cmake | 153 + storage/mroonga/vendor/groonga/config.sh.in | 6 + storage/mroonga/vendor/groonga/configure.ac | 1514 + .../vendor/groonga/data/CMakeLists.txt | 20 + .../mroonga/vendor/groonga/data/Makefile.am | 20 + .../groonga/data/account/twitter.gpg.hayashi | Bin 0 -> 657 bytes .../groonga/data/account/twitter.gpg.kou | Bin 0 -> 657 bytes .../groonga/data/account/twitter.gpg.yuki | Bin 0 -> 662 bytes .../vendor/groonga/data/groonga-httpd.conf.in | 57 + .../mroonga/vendor/groonga/data/groonga.conf | 11 + .../vendor/groonga/data/html/CMakeLists.txt | 18 + .../vendor/groonga/data/html/Makefile.am | 9 + .../data/html/admin/css/groonga-admin.css | 120 + .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_55_fbec88_40x100.png | Bin 0 -> 182 bytes .../images/ui-bg_glass_75_d0e5f5_1x400.png | Bin 0 -> 124 bytes .../images/ui-bg_glass_85_dfeffc_1x400.png | Bin 0 -> 123 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_gloss-wave_55_5c9ccc_500x100.png | Bin 0 -> 4033 bytes .../ui-bg_inset-hard_100_f5f8f9_1x100.png | Bin 0 -> 104 bytes .../ui-bg_inset-hard_100_fcfdfd_1x100.png | Bin 0 -> 88 bytes .../images/ui-icons_217bc0_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_469bdd_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_6da8d5_256x240.png | Bin 0 -> 5355 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_d8e7f3_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_f9bd01_256x240.png | Bin 0 -> 5355 bytes .../css/redmond/jquery-ui-1.8.18.custom.css | 565 + .../groonga/data/html/admin/favicon.ico | Bin 0 -> 1406 bytes .../groonga/data/html/admin/favicon.png | Bin 0 -> 682 bytes .../groonga/data/html/admin/favicon.svg | 121 + .../data/html/admin/images/groonga.png | Bin 0 -> 6064 bytes .../data/html/admin/images/groonga.svg | 121 + .../data/html/admin/images/loading.gif | Bin 0 -> 673 bytes .../vendor/groonga/data/html/admin/index.html | 297 + .../groonga/data/html/admin/index.ja.html | 301 + .../data/html/admin/js/groonga-admin.ja.js | 1372 + .../data/html/admin/js/groonga-admin.js | 1372 + .../data/html/admin/js/jquery-1.7.2.min.js | 4 + .../admin/js/jquery-ui-1.8.18.custom.min.js | 356 + .../data/html/admin/js/jquery.flot-0.7.min.js | 6 + .../html/admin/js/jquery.flot.license.txt | 22 + .../mroonga/vendor/groonga/data/html/files.am | 34 + .../vendor/groonga/data/html/update-files.sh | 17 + .../vendor/groonga/data/images/Makefile.am | 2 + .../groonga/data/images/logo/Makefile.am | 22 + .../vendor/groonga/data/images/logo/files.am | 53 + .../logo/groonga-icon-foreground-white.png | Bin 0 -> 2266 bytes .../logo/groonga-icon-foreground-white.svg | 118 + .../images/logo/groonga-icon-full-size.png | Bin 0 -> 6841 bytes .../images/logo/groonga-icon-full-size.svg | 97 + .../groonga/data/images/logo/groonga-icon.png | Bin 0 -> 2281 bytes .../groonga/data/images/logo/groonga-icon.svg | 93 + .../logo/groonga-logo-foreground-white.png | Bin 0 -> 7393 bytes .../logo/groonga-logo-foreground-white.svg | 108 + .../groonga/data/images/logo/groonga-logo.png | Bin 0 -> 7311 bytes .../groonga/data/images/logo/groonga-logo.svg | 118 + ...powered-by-banner-bar-foreground-white.png | Bin 0 -> 4752 bytes ...powered-by-banner-bar-foreground-white.svg | 170 + .../logo/groonga-powered-by-banner-bar.png | Bin 0 -> 4680 bytes .../logo/groonga-powered-by-banner-bar.svg | 186 + ...nga-powered-by-banner-foreground-white.png | Bin 0 -> 3245 bytes ...nga-powered-by-banner-foreground-white.svg | 183 + .../logo/groonga-powered-by-banner-large.png | Bin 0 -> 5900 bytes .../logo/groonga-powered-by-banner-large.svg | 179 + .../images/logo/groonga-powered-by-banner.png | Bin 0 -> 3038 bytes .../images/logo/groonga-powered-by-banner.svg | 201 + .../logo/mroonga-icon-foreground-white.png | Bin 0 -> 2119 bytes .../logo/mroonga-icon-foreground-white.svg | 106 + .../images/logo/mroonga-icon-full-size.png | Bin 0 -> 6682 bytes .../images/logo/mroonga-icon-full-size.svg | 97 + .../groonga/data/images/logo/mroonga-icon.png | Bin 0 -> 2090 bytes .../groonga/data/images/logo/mroonga-icon.svg | 93 + .../logo/mroonga-logo-foreground-white.png | Bin 0 -> 2692 bytes .../logo/mroonga-logo-foreground-white.svg | 122 + .../groonga/data/images/logo/mroonga-logo.ai | 243 + .../groonga/data/images/logo/mroonga-logo.png | Bin 0 -> 6494 bytes .../groonga/data/images/logo/mroonga-logo.svg | 106 + .../logo/nroonga-icon-foreground-white.png | Bin 0 -> 2357 bytes .../logo/nroonga-icon-foreground-white.svg | 106 + .../images/logo/nroonga-icon-full-size.png | Bin 0 -> 6741 bytes .../images/logo/nroonga-icon-full-size.svg | 107 + .../groonga/data/images/logo/nroonga-icon.png | Bin 0 -> 2350 bytes .../groonga/data/images/logo/nroonga-icon.svg | 93 + .../logo/nroonga-logo-foreground-white.png | Bin 0 -> 2974 bytes .../logo/nroonga-logo-foreground-white.svg | 122 + .../groonga/data/images/logo/nroonga-logo.png | Bin 0 -> 6732 bytes .../groonga/data/images/logo/nroonga-logo.svg | 117 + .../logo/rroonga-icon-foreground-white.png | Bin 0 -> 2306 bytes .../logo/rroonga-icon-foreground-white.svg | 106 + .../images/logo/rroonga-icon-full-size.png | Bin 0 -> 6162 bytes .../images/logo/rroonga-icon-full-size.svg | 107 + .../groonga/data/images/logo/rroonga-icon.png | Bin 0 -> 2306 bytes .../groonga/data/images/logo/rroonga-icon.svg | 93 + .../logo/rroonga-logo-foreground-white.png | Bin 0 -> 3008 bytes .../logo/rroonga-logo-foreground-white.svg | 122 + .../groonga/data/images/logo/rroonga-logo.png | Bin 0 -> 6291 bytes .../groonga/data/images/logo/rroonga-logo.svg | 117 + .../groonga/data/images/logo/update-files.sh | 17 + .../vendor/groonga/data/munin/Makefile.am | 12 + .../groonga/data/munin/groonga_cpu_load_ | 100 + .../groonga/data/munin/groonga_cpu_time_ | 122 + .../vendor/groonga/data/munin/groonga_disk_ | 246 + .../vendor/groonga/data/munin/groonga_memory_ | 104 + .../groonga/data/munin/groonga_n_records_ | 256 + .../data/munin/groonga_query_performance_ | 198 + .../vendor/groonga/data/munin/groonga_status_ | 176 + .../groonga/data/munin/groonga_throughput_ | 176 + .../vendor/groonga/data/scripts/Makefile.am | 1 + .../data/scripts/groonga-httpd-restart.in | 106 + .../mroonga/vendor/groonga/data/synonyms.tsv | 5 + .../vendor/groonga/data/systemd/Makefile.am | 1 + .../groonga/data/systemd/fedora/Makefile.am | 13 + .../data/systemd/fedora/groonga-httpd.service | 14 + .../fedora/groonga-server-gqtp.service | 13 + .../fedora/groonga-server-http.service | 13 + .../data/systemd/fedora/sysconfig/Makefile.am | 8 + .../fedora/sysconfig/groonga-server-gqtp | 9 + .../fedora/sysconfig/groonga-server-http | 9 + .../vendor/groonga/data/travis/setup.sh | 55 + .../vendor/groonga/examples/Makefile.am | 1 + .../groonga/examples/dictionary/Makefile.am | 34 + .../examples/dictionary/edict/Makefile.am | 4 + .../examples/dictionary/edict/edict-import.sh | 21 + .../examples/dictionary/edict/edict2grn.rb | 56 + .../examples/dictionary/eijiro/Makefile.am | 4 + .../dictionary/eijiro/eijiro-import.sh | 12 + .../examples/dictionary/eijiro/eijiro2grn.rb | 61 + .../examples/dictionary/gene95/Makefile.am | 4 + .../examples/dictionary/gene95/gene-import.sh | 26 + .../examples/dictionary/gene95/gene2grn.rb | 46 + .../dictionary/html/css/dictionary.css | 3 + .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes .../smoothness/jquery-ui-1.8.12.custom.css | 578 + .../examples/dictionary/html/index.html | 28 + .../examples/dictionary/html/js/dictionary.js | 82 + .../dictionary/html/js/jquery-1.7.2.min.js | 4 + .../html/js/jquery-ui-1.8.18.custom.min.js | 356 + .../groonga/examples/dictionary/init-db.sh | 10 + .../examples/dictionary/jmdict/Makefile.am | 3 + .../examples/dictionary/jmdict/jmdict.rb | 42 + .../groonga/examples/dictionary/readme.txt | 71 + storage/mroonga/vendor/groonga/gpg_uid | 1 + .../vendor/groonga/groonga-httpd-conf.sh.in | 26 + storage/mroonga/vendor/groonga/groonga.pc.in | 20 + .../vendor/groonga/include/CMakeLists.txt | 20 + .../vendor/groonga/include/Makefile.am | 6 + .../mroonga/vendor/groonga/include/groonga.h | 2101 + .../groonga/include/groonga/Makefile.am | 6 + .../vendor/groonga/include/groonga/nfkc.h | 32 + .../groonga/include/groonga/normalizer.h | 55 + .../vendor/groonga/include/groonga/plugin.h | 152 + .../groonga/include/groonga/tokenizer.h | 225 + .../mroonga/vendor/groonga/lib/CMakeLists.txt | 90 + .../mroonga/vendor/groonga/lib/Makefile.am | 46 + storage/mroonga/vendor/groonga/lib/com.c | 1161 + storage/mroonga/vendor/groonga/lib/com.h | 260 + storage/mroonga/vendor/groonga/lib/ctx.c | 2992 + storage/mroonga/vendor/groonga/lib/ctx.h | 506 + storage/mroonga/vendor/groonga/lib/ctx_impl.h | 188 + .../mroonga/vendor/groonga/lib/ctx_impl_mrb.c | 104 + .../mroonga/vendor/groonga/lib/ctx_impl_mrb.h | 36 + storage/mroonga/vendor/groonga/lib/dat.cpp | 1099 + storage/mroonga/vendor/groonga/lib/dat.h | 99 + .../vendor/groonga/lib/dat/Makefile.am | 12 + .../mroonga/vendor/groonga/lib/dat/array.hpp | 100 + .../mroonga/vendor/groonga/lib/dat/base.hpp | 69 + .../mroonga/vendor/groonga/lib/dat/block.hpp | 96 + .../mroonga/vendor/groonga/lib/dat/check.hpp | 151 + .../vendor/groonga/lib/dat/cursor-factory.cpp | 94 + .../vendor/groonga/lib/dat/cursor-factory.hpp | 46 + .../mroonga/vendor/groonga/lib/dat/cursor.hpp | 48 + .../mroonga/vendor/groonga/lib/dat/dat.hpp | 255 + .../mroonga/vendor/groonga/lib/dat/entry.hpp | 61 + .../vendor/groonga/lib/dat/file-impl.cpp | 244 + .../vendor/groonga/lib/dat/file-impl.hpp | 73 + .../mroonga/vendor/groonga/lib/dat/file.cpp | 67 + .../mroonga/vendor/groonga/lib/dat/file.hpp | 60 + .../mroonga/vendor/groonga/lib/dat/header.hpp | 181 + .../vendor/groonga/lib/dat/id-cursor.cpp | 184 + .../vendor/groonga/lib/dat/id-cursor.hpp | 85 + .../vendor/groonga/lib/dat/key-cursor.cpp | 349 + .../vendor/groonga/lib/dat/key-cursor.hpp | 90 + .../mroonga/vendor/groonga/lib/dat/key.hpp | 112 + .../mroonga/vendor/groonga/lib/dat/node.hpp | 129 + .../groonga/lib/dat/predictive-cursor.cpp | 206 + .../groonga/lib/dat/predictive-cursor.hpp | 86 + .../vendor/groonga/lib/dat/prefix-cursor.cpp | 175 + .../vendor/groonga/lib/dat/prefix-cursor.hpp | 80 + .../mroonga/vendor/groonga/lib/dat/sources.am | 29 + .../mroonga/vendor/groonga/lib/dat/string.hpp | 175 + .../mroonga/vendor/groonga/lib/dat/trie.cpp | 1213 + .../mroonga/vendor/groonga/lib/dat/trie.hpp | 285 + .../mroonga/vendor/groonga/lib/dat/vector.hpp | 193 + storage/mroonga/vendor/groonga/lib/db.c | 10615 ++ storage/mroonga/vendor/groonga/lib/db.h | 469 + .../mroonga/vendor/groonga/lib/ecmascript.c | 2242 + .../mroonga/vendor/groonga/lib/ecmascript.h | 72 + .../vendor/groonga/lib/ecmascript.lemon | 473 + storage/mroonga/vendor/groonga/lib/error.c | 53 + storage/mroonga/vendor/groonga/lib/error.h | 35 + storage/mroonga/vendor/groonga/lib/expr.c | 7085 ++ storage/mroonga/vendor/groonga/lib/expr.h | 70 + storage/mroonga/vendor/groonga/lib/geo.c | 2682 + storage/mroonga/vendor/groonga/lib/geo.h | 207 + .../mroonga/vendor/groonga/lib/groonga_in.h | 746 + storage/mroonga/vendor/groonga/lib/hash.c | 3342 + storage/mroonga/vendor/groonga/lib/hash.h | 346 + storage/mroonga/vendor/groonga/lib/icudump.c | 294 + storage/mroonga/vendor/groonga/lib/ii.c | 7396 ++ storage/mroonga/vendor/groonga/lib/ii.h | 196 + storage/mroonga/vendor/groonga/lib/io.c | 1801 + storage/mroonga/vendor/groonga/lib/io.h | 494 + .../mroonga/vendor/groonga/lib/libgroonga.c | 8 + storage/mroonga/vendor/groonga/lib/mrb.c | 226 + storage/mroonga/vendor/groonga/lib/mrb.h | 43 + .../vendor/groonga/lib/mrb/Makefile.am | 20 + .../vendor/groonga/lib/mrb/mrb_accessor.c | 71 + .../vendor/groonga/lib/mrb/mrb_accessor.h | 35 + .../mroonga/vendor/groonga/lib/mrb/mrb_bulk.c | 149 + .../mroonga/vendor/groonga/lib/mrb/mrb_bulk.h | 35 + .../vendor/groonga/lib/mrb/mrb_column.c | 39 + .../vendor/groonga/lib/mrb/mrb_column.h | 34 + .../vendor/groonga/lib/mrb/mrb_converter.c | 93 + .../vendor/groonga/lib/mrb/mrb_converter.h | 37 + .../mroonga/vendor/groonga/lib/mrb/mrb_ctx.c | 224 + .../mroonga/vendor/groonga/lib/mrb/mrb_ctx.h | 34 + .../mroonga/vendor/groonga/lib/mrb/mrb_expr.c | 460 + .../mroonga/vendor/groonga/lib/mrb/mrb_expr.h | 36 + .../groonga/lib/mrb/mrb_fixed_size_column.c | 59 + .../groonga/lib/mrb/mrb_fixed_size_column.h | 34 + .../mroonga/vendor/groonga/lib/mrb/mrb_id.c | 74 + .../mroonga/vendor/groonga/lib/mrb/mrb_id.h | 34 + .../vendor/groonga/lib/mrb/mrb_index_column.c | 59 + .../vendor/groonga/lib/mrb/mrb_index_column.h | 34 + .../vendor/groonga/lib/mrb/mrb_logger.c | 76 + .../vendor/groonga/lib/mrb/mrb_logger.h | 34 + .../mroonga/vendor/groonga/lib/mrb/mrb_obj.c | 114 + .../mroonga/vendor/groonga/lib/mrb/mrb_obj.h | 34 + .../vendor/groonga/lib/mrb/mrb_operator.c | 190 + .../vendor/groonga/lib/mrb/mrb_operator.h | 34 + .../vendor/groonga/lib/mrb/mrb_procedure.c | 58 + .../vendor/groonga/lib/mrb/mrb_procedure.h | 34 + .../lib/mrb/mrb_variable_size_column.c | 60 + .../lib/mrb/mrb_variable_size_column.h | 34 + .../mroonga/vendor/groonga/lib/mrb/mrb_void.c | 59 + .../mroonga/vendor/groonga/lib/mrb/mrb_void.h | 34 + .../groonga/lib/mrb/scripts/Makefile.am | 9 + .../lib/mrb/scripts/backtrace_entry.rb | 20 + .../vendor/groonga/lib/mrb/scripts/context.rb | 31 + .../lib/mrb/scripts/context/error_level.rb | 30 + .../groonga/lib/mrb/scripts/context/rc.rb | 99 + .../groonga/lib/mrb/scripts/eval_context.rb | 13 + .../groonga/lib/mrb/scripts/expression.rb | 13 + .../groonga/lib/mrb/scripts/index_info.rb | 10 + .../vendor/groonga/lib/mrb/scripts/logger.rb | 27 + .../groonga/lib/mrb/scripts/logger/level.rb | 32 + .../vendor/groonga/lib/mrb/scripts/object.rb | 7 + .../groonga/lib/mrb/scripts/scan_info.rb | 27 + .../lib/mrb/scripts/scan_info_builder.rb | 243 + .../groonga/lib/mrb/scripts/scan_info_data.rb | 171 + .../vendor/groonga/lib/mrb/scripts/sources.am | 13 + .../groonga/lib/mrb/scripts/test/empty.rb | 1 + .../mroonga/vendor/groonga/lib/mrb/sources.am | 31 + .../vendor/groonga/lib/nfkc-custom-rules.txt | 1 + storage/mroonga/vendor/groonga/lib/nfkc.c | 80249 ++++++++++++++++ storage/mroonga/vendor/groonga/lib/nfkc.rb | 418 + .../mroonga/vendor/groonga/lib/normalizer.c | 1195 + .../vendor/groonga/lib/normalizer_in.h | 52 + storage/mroonga/vendor/groonga/lib/output.c | 1926 + storage/mroonga/vendor/groonga/lib/output.h | 89 + storage/mroonga/vendor/groonga/lib/pat.c | 2913 + storage/mroonga/vendor/groonga/lib/pat.h | 113 + storage/mroonga/vendor/groonga/lib/plugin.c | 753 + .../mroonga/vendor/groonga/lib/plugin_in.h | 68 + storage/mroonga/vendor/groonga/lib/proc.c | 5247 + storage/mroonga/vendor/groonga/lib/proc.h | 35 + storage/mroonga/vendor/groonga/lib/snip.c | 838 + storage/mroonga/vendor/groonga/lib/snip.h | 132 + storage/mroonga/vendor/groonga/lib/sources.am | 51 + storage/mroonga/vendor/groonga/lib/store.c | 1779 + storage/mroonga/vendor/groonga/lib/store.h | 160 + storage/mroonga/vendor/groonga/lib/str.c | 3181 + storage/mroonga/vendor/groonga/lib/str.h | 129 + storage/mroonga/vendor/groonga/lib/string.c | 406 + .../mroonga/vendor/groonga/lib/string_in.h | 65 + storage/mroonga/vendor/groonga/lib/token.c | 778 + storage/mroonga/vendor/groonga/lib/token.h | 91 + .../mroonga/vendor/groonga/lib/tokenizer.c | 320 + storage/mroonga/vendor/groonga/lib/util.c | 1148 + storage/mroonga/vendor/groonga/lib/util.h | 48 + storage/mroonga/vendor/groonga/nginx_version | 1 + .../vendor/groonga/packages/Makefile.am | 7 + .../vendor/groonga/packages/apt/Makefile.am | 79 + .../vendor/groonga/packages/apt/build-deb.sh | 115 + .../groonga/packages/apt/build-in-chroot.sh | 134 + .../groonga/packages/apt/debian/changelog | 11 + .../vendor/groonga/packages/apt/debian/compat | 1 + .../groonga/packages/apt/debian/control | 18 + .../groonga/packages/apt/debian/copyright | 34 + .../apt/debian/groonga-keyring.install | 1 + .../apt/debian/groonga-keyring.postinst | 22 + .../apt/debian/groonga-keyring.postrm.in | 26 + .../vendor/groonga/packages/apt/debian/rules | 17 + .../groonga/packages/apt/debian/source/format | 1 + .../packages/apt/groonga-depended-packages | 7 + .../apt/groonga-keyring-depended-packages | 1 + .../groonga/packages/apt/sign-packages.sh | 42 + .../groonga/packages/apt/sign-repository.sh | 46 + .../groonga/packages/apt/update-repository.sh | 130 + .../vendor/groonga/packages/check-utility.sh | 538 + .../vendor/groonga/packages/debian/changelog | 414 + .../vendor/groonga/packages/debian/compat | 1 + .../vendor/groonga/packages/debian/control | 210 + .../vendor/groonga/packages/debian/copyright | 109 + .../packages/debian/groonga-bin.install | 6 + .../packages/debian/groonga-doc.install | 1 + .../groonga/packages/debian/groonga-doc.links | 4 + .../packages/debian/groonga-examples.install | 1 + .../packages/debian/groonga-httpd.default | 15 + .../packages/debian/groonga-httpd.dirs | 3 + .../packages/debian/groonga-httpd.init | 193 + .../packages/debian/groonga-httpd.install | 3 + .../packages/debian/groonga-httpd.logrotate | 17 + .../packages/debian/groonga-httpd.postinst | 26 + .../packages/debian/groonga-httpd.postrm | 12 + .../debian/groonga-munin-plugins.conf | 24 + .../debian/groonga-munin-plugins.install | 2 + .../debian/groonga-munin-plugins.links | 8 + .../debian/groonga-munin-plugins.postinst | 27 + .../debian/groonga-munin-plugins.postrm | 9 + .../debian/groonga-plugin-suggest.install | 2 + .../debian/groonga-server-common.postinst | 42 + .../debian/groonga-server-common.postrm | 13 + .../debian/groonga-server-gqtp.default | 15 + .../packages/debian/groonga-server-gqtp.dirs | 2 + .../packages/debian/groonga-server-gqtp.init | 235 + .../debian/groonga-server-gqtp.logrotate | 17 + .../debian/groonga-server-http.default | 16 + .../packages/debian/groonga-server-http.dirs | 2 + .../packages/debian/groonga-server-http.init | 250 + .../debian/groonga-server-http.logrotate | 17 + .../debian/groonga-tokenizer-mecab.install | 1 + .../packages/debian/libgroonga-dev.install | 3 + .../packages/debian/libgroonga0.install | 4 + .../debian/missing-sources/jquery-1.7.2.js | 9404 ++ .../jquery-ui-1.8.18.custom.js | 11802 +++ .../debian/missing-sources/jquery.flot-0.7.js | 2599 + .../packages/debian/missing-sources/jquery.js | 9472 ++ .../debian/missing-sources/underscore.js | 999 + .../groonga/packages/debian/patches/series | 0 .../vendor/groonga/packages/debian/rules | 31 + .../groonga/packages/debian/source/format | 1 + .../vendor/groonga/packages/debian/watch | 3 + .../release-key-secret.asc.gpg.hayashi | Bin 0 -> 1458 bytes .../packages/release-key-secret.asc.gpg.kou | Bin 0 -> 1457 bytes .../release-key-secret.asc.gpg.yoshihara | Bin 0 -> 1457 bytes .../vendor/groonga/packages/rpm/Makefile.am | 1 + .../groonga/packages/rpm/centos/Makefile.am | 2 + .../packages/rpm/centos/groonga.spec.in | 573 + .../groonga/packages/rpm/fedora/Makefile.am | 3 + .../packages/rpm/fedora/groonga.spec.in | 641 + .../groonga/packages/source/Makefile.am | 25 + .../groonga/packages/ubuntu/Makefile.am | 24 + .../vendor/groonga/packages/ubuntu/upload.rb | 135 + .../groonga/packages/windows/Makefile.am | 130 + .../vendor/groonga/packages/windows/Rakefile | 248 + .../groonga/packages/windows/create-setup.bat | 2 + .../windows/language-files/Makefile.am | 3 + .../windows/language-files/english.nsi | 2 + .../windows/language-files/japanese.nsi | 2 + .../packages/windows/patches/Makefile.am | 3 + .../mecab-0.98-add-missing-dll-export.diff | 11 + .../windows/patches/mecab-0.98-mingw-w64.diff | 13 + .../mecab-0.98-not-use-locale-on-mingw.diff | 15 + .../patches/mecab-0.994-mingw-cflags.diff | 12 + .../patches/mecab-0.994-mingw-externc.diff | 12 + .../mecab-0.994-mingw-ltmain-wmain.diff | 11 + ...ecab-0.994-mingw-yieldprocessor-macro.diff | 11 + .../mecab-mingw-unsigned-long-long-int.diff | 24 + .../groonga/packages/windows/setup-x64.nsi.in | 112 + .../vendor/groonga/packages/yum/Makefile.am | 82 + .../vendor/groonga/packages/yum/Vagrantfile | 41 + .../groonga/packages/yum/build-release-rpm.sh | 99 + .../vendor/groonga/packages/yum/build-rpm.sh | 124 + .../vendor/groonga/packages/yum/env.sh.in | 19 + .../mecab-ipadic-provides-mecab-dic.diff | 10 + .../mecab-jumandic-provides-mecab-dic.diff | 10 + .../vendor/groonga/packages/yum/sign-rpm.sh | 44 + .../groonga/packages/yum/update-repository.sh | 33 + .../vendor/groonga/plugins/CMakeLists.txt | 20 + .../vendor/groonga/plugins/Makefile.am | 9 + .../plugins/query_expanders/CMakeLists.txt | 32 + .../plugins/query_expanders/Makefile.am | 20 + .../groonga/plugins/query_expanders/tsv.c | 299 + .../plugins/query_expanders/tsv_sources.am | 2 + .../groonga/plugins/ruby/CMakeLists.txt | 44 + .../vendor/groonga/plugins/ruby/Makefile.am | 29 + .../vendor/groonga/plugins/ruby/eval.c | 64 + .../groonga/plugins/ruby/eval_sources.am | 3 + .../vendor/groonga/plugins/ruby/load.c | 63 + .../groonga/plugins/ruby/load_sources.am | 3 + .../vendor/groonga/plugins/ruby/ruby_plugin.h | 76 + .../groonga/plugins/suggest/CMakeLists.txt | 29 + .../groonga/plugins/suggest/Makefile.am | 24 + .../vendor/groonga/plugins/suggest/sources.am | 2 + .../vendor/groonga/plugins/suggest/suggest.c | 1022 + .../groonga/plugins/table/CMakeLists.txt | 29 + .../vendor/groonga/plugins/table/Makefile.am | 24 + .../vendor/groonga/plugins/table/sources.am | 2 + .../vendor/groonga/plugins/table/table.c | 747 + .../groonga/plugins/tokenizers/CMakeLists.txt | 53 + .../groonga/plugins/tokenizers/Makefile.am | 33 + .../groonga/plugins/tokenizers/kytea.cpp | 354 + .../plugins/tokenizers/kytea_sources.am | 2 + .../vendor/groonga/plugins/tokenizers/mecab.c | 338 + .../plugins/tokenizers/mecab_sources.am | 2 + storage/mroonga/vendor/groonga/src/.gitignore | 2 + .../mroonga/vendor/groonga/src/CMakeLists.txt | 54 + .../mroonga/vendor/groonga/src/Makefile.am | 48 + storage/mroonga/vendor/groonga/src/grnslap.c | 373 + .../vendor/groonga/src/grnslap_sources.am | 2 + storage/mroonga/vendor/groonga/src/groonga.c | 2819 + .../vendor/groonga/src/groonga_benchmark.c | 3172 + .../groonga/src/groonga_benchmark_sources.am | 2 + .../vendor/groonga/src/groonga_sources.am | 2 + .../vendor/groonga/src/httpd/Makefile.am | 32 + .../groonga/src/httpd/nginx-module/config | 52 + .../nginx-module/ngx_http_groonga_module.c | 1440 + .../vendor/groonga/src/suggest/CMakeLists.txt | 90 + .../vendor/groonga/src/suggest/Makefile.am | 77 + .../src/suggest/create_dataset_sources.am | 2 + .../suggest/groonga_suggest_create_dataset.c | 220 + .../src/suggest/groonga_suggest_ddl.txt | 62 + .../src/suggest/groonga_suggest_httpd.c | 842 + .../src/suggest/groonga_suggest_learner.c | 839 + .../groonga/src/suggest/httpd_sources.am | 3 + .../groonga/src/suggest/learner_sources.am | 3 + .../mroonga/vendor/groonga/src/suggest/util.c | 215 + .../mroonga/vendor/groonga/src/suggest/util.h | 40 + .../groonga/src/suggest/util_sources.am | 3 + .../groonga/src/suggest/zmq_compatible.h | 33 + .../mroonga/vendor/groonga/tools/Makefile.am | 6 + .../tools/groonga-memory-leak-checker.rb | 93 + .../tools/groonga-suggest-httpd-client.rb | 181 + .../groonga/tools/prepare-sphinx-html.rb | 183 + .../groonga/tools/travis-before-script.sh | 33 + .../vendor/groonga/tools/travis-script.sh | 15 + .../vendor/groonga/vendor/CMakeLists.txt | 16 + .../mroonga/vendor/groonga/vendor/Makefile.am | 17 + .../groonga/vendor/mruby/CMakeLists.txt | 35 + .../vendor/groonga/vendor/mruby/Makefile.am | 60 + .../groonga/vendor/mruby/build_config.rb | 33 + .../vendor/groonga/vendor/mruby/sources.am | 56 + .../vendor/groonga/vendor/mruby/update.rb | 88 + .../vendor/groonga/vendor/nginx-1.7.4/CHANGES | 6766 ++ .../groonga/vendor/nginx-1.7.4/CHANGES.ru | 6875 ++ .../vendor/groonga/vendor/nginx-1.7.4/LICENSE | 26 + .../vendor/groonga/vendor/nginx-1.7.4/README | 3 + .../groonga/vendor/nginx-1.7.4/auto/cc/acc | 15 + .../groonga/vendor/nginx-1.7.4/auto/cc/bcc | 72 + .../groonga/vendor/nginx-1.7.4/auto/cc/ccc | 46 + .../groonga/vendor/nginx-1.7.4/auto/cc/clang | 104 + .../groonga/vendor/nginx-1.7.4/auto/cc/conf | 218 + .../groonga/vendor/nginx-1.7.4/auto/cc/gcc | 186 + .../groonga/vendor/nginx-1.7.4/auto/cc/icc | 121 + .../groonga/vendor/nginx-1.7.4/auto/cc/msvc | 136 + .../groonga/vendor/nginx-1.7.4/auto/cc/name | 89 + .../groonga/vendor/nginx-1.7.4/auto/cc/owc | 104 + .../groonga/vendor/nginx-1.7.4/auto/cc/sunc | 158 + .../groonga/vendor/nginx-1.7.4/auto/define | 12 + .../vendor/nginx-1.7.4/auto/endianness | 45 + .../groonga/vendor/nginx-1.7.4/auto/feature | 123 + .../groonga/vendor/nginx-1.7.4/auto/have | 12 + .../vendor/nginx-1.7.4/auto/have_headers | 12 + .../groonga/vendor/nginx-1.7.4/auto/headers | 13 + .../groonga/vendor/nginx-1.7.4/auto/include | 61 + .../groonga/vendor/nginx-1.7.4/auto/init | 51 + .../groonga/vendor/nginx-1.7.4/auto/lib/conf | 83 + .../vendor/nginx-1.7.4/auto/lib/geoip/conf | 94 + .../auto/lib/google-perftools/conf | 61 + .../nginx-1.7.4/auto/lib/libatomic/conf | 43 + .../nginx-1.7.4/auto/lib/libatomic/make | 16 + .../vendor/nginx-1.7.4/auto/lib/libgd/conf | 83 + .../vendor/nginx-1.7.4/auto/lib/libxslt/conf | 156 + .../groonga/vendor/nginx-1.7.4/auto/lib/make | 32 + .../vendor/nginx-1.7.4/auto/lib/md5/conf | 103 + .../vendor/nginx-1.7.4/auto/lib/md5/make | 96 + .../nginx-1.7.4/auto/lib/md5/makefile.bcc | 22 + .../nginx-1.7.4/auto/lib/md5/makefile.msvc | 22 + .../nginx-1.7.4/auto/lib/md5/makefile.owc | 11 + .../vendor/nginx-1.7.4/auto/lib/openssl/conf | 78 + .../vendor/nginx-1.7.4/auto/lib/openssl/make | 67 + .../nginx-1.7.4/auto/lib/openssl/makefile.bcc | 18 + .../auto/lib/openssl/makefile.msvc | 14 + .../vendor/nginx-1.7.4/auto/lib/pcre/conf | 203 + .../vendor/nginx-1.7.4/auto/lib/pcre/make | 64 + .../nginx-1.7.4/auto/lib/pcre/makefile.bcc | 27 + .../nginx-1.7.4/auto/lib/pcre/makefile.msvc | 23 + .../nginx-1.7.4/auto/lib/pcre/makefile.owc | 25 + .../vendor/nginx-1.7.4/auto/lib/perl/conf | 78 + .../vendor/nginx-1.7.4/auto/lib/perl/make | 41 + .../vendor/nginx-1.7.4/auto/lib/sha1/conf | 79 + .../vendor/nginx-1.7.4/auto/lib/sha1/make | 96 + .../nginx-1.7.4/auto/lib/sha1/makefile.bcc | 22 + .../nginx-1.7.4/auto/lib/sha1/makefile.msvc | 22 + .../nginx-1.7.4/auto/lib/sha1/makefile.owc | 11 + .../groonga/vendor/nginx-1.7.4/auto/lib/test | 40 + .../vendor/nginx-1.7.4/auto/lib/zlib/conf | 79 + .../vendor/nginx-1.7.4/auto/lib/zlib/make | 135 + .../nginx-1.7.4/auto/lib/zlib/makefile.bcc | 17 + .../nginx-1.7.4/auto/lib/zlib/makefile.msvc | 17 + .../nginx-1.7.4/auto/lib/zlib/makefile.owc | 14 + .../groonga/vendor/nginx-1.7.4/auto/make | 417 + .../groonga/vendor/nginx-1.7.4/auto/modules | 534 + .../groonga/vendor/nginx-1.7.4/auto/nohave | 12 + .../groonga/vendor/nginx-1.7.4/auto/options | 527 + .../groonga/vendor/nginx-1.7.4/auto/os/conf | 107 + .../groonga/vendor/nginx-1.7.4/auto/os/darwin | 116 + .../vendor/nginx-1.7.4/auto/os/freebsd | 144 + .../groonga/vendor/nginx-1.7.4/auto/os/linux | 185 + .../vendor/nginx-1.7.4/auto/os/solaris | 61 + .../groonga/vendor/nginx-1.7.4/auto/os/win32 | 40 + .../groonga/vendor/nginx-1.7.4/auto/sources | 557 + .../groonga/vendor/nginx-1.7.4/auto/stubs | 8 + .../groonga/vendor/nginx-1.7.4/auto/summary | 116 + .../vendor/nginx-1.7.4/auto/types/sizeof | 84 + .../vendor/nginx-1.7.4/auto/types/typedef | 77 + .../vendor/nginx-1.7.4/auto/types/uintptr_t | 45 + .../vendor/nginx-1.7.4/auto/types/value | 12 + .../groonga/vendor/nginx-1.7.4/auto/unix | 827 + .../vendor/nginx-1.7.4/conf/fastcgi.conf | 25 + .../vendor/nginx-1.7.4/conf/fastcgi_params | 24 + .../groonga/vendor/nginx-1.7.4/conf/koi-utf | 109 + .../groonga/vendor/nginx-1.7.4/conf/koi-win | 103 + .../vendor/nginx-1.7.4/conf/mime.types | 89 + .../vendor/nginx-1.7.4/conf/nginx.conf | 117 + .../vendor/nginx-1.7.4/conf/scgi_params | 16 + .../vendor/nginx-1.7.4/conf/uwsgi_params | 16 + .../groonga/vendor/nginx-1.7.4/conf/win-utf | 126 + .../groonga/vendor/nginx-1.7.4/contrib/README | 21 + .../vendor/nginx-1.7.4/contrib/geo2nginx.pl | 58 + .../nginx-1.7.4/contrib/unicode2nginx/koi-utf | 131 + .../contrib/unicode2nginx/unicode-to-nginx.pl | 45 + .../nginx-1.7.4/contrib/unicode2nginx/win-utf | 130 + .../contrib/vim/ftdetect/nginx.vim | 4 + .../nginx-1.7.4/contrib/vim/indent/nginx.vim | 11 + .../nginx-1.7.4/contrib/vim/syntax/nginx.vim | 703 + .../groonga/vendor/nginx-1.7.4/html/50x.html | 21 + .../vendor/nginx-1.7.4/html/index.html | 25 + .../groonga/vendor/nginx-1.7.4/man/nginx.8 | 202 + .../src/event/modules/ngx_aio_module.c | 171 + .../src/event/modules/ngx_devpoll_module.c | 575 + .../src/event/modules/ngx_epoll_module.c | 845 + .../src/event/modules/ngx_eventport_module.c | 633 + .../src/event/modules/ngx_kqueue_module.c | 785 + .../src/event/modules/ngx_poll_module.c | 443 + .../src/event/modules/ngx_rtsig_module.c | 747 + .../src/event/modules/ngx_select_module.c | 435 + .../event/modules/ngx_win32_select_module.c | 400 + .../vendor/nginx-1.7.4/src/event/ngx_event.c | 1339 + .../vendor/nginx-1.7.4/src/event/ngx_event.h | 569 + .../nginx-1.7.4/src/event/ngx_event_accept.c | 515 + .../src/event/ngx_event_busy_lock.c | 286 + .../src/event/ngx_event_busy_lock.h | 65 + .../nginx-1.7.4/src/event/ngx_event_connect.c | 258 + .../nginx-1.7.4/src/event/ngx_event_connect.h | 76 + .../nginx-1.7.4/src/event/ngx_event_mutex.c | 70 + .../nginx-1.7.4/src/event/ngx_event_openssl.c | 3344 + .../nginx-1.7.4/src/event/ngx_event_openssl.h | 215 + .../src/event/ngx_event_openssl_stapling.c | 1762 + .../nginx-1.7.4/src/event/ngx_event_pipe.c | 1006 + .../nginx-1.7.4/src/event/ngx_event_pipe.h | 94 + .../nginx-1.7.4/src/event/ngx_event_posted.c | 173 + .../nginx-1.7.4/src/event/ngx_event_posted.h | 75 + .../nginx-1.7.4/src/event/ngx_event_timer.c | 158 + .../nginx-1.7.4/src/event/ngx_event_timer.h | 102 + .../src/http/modules/ngx_http_access_module.c | 469 + .../modules/ngx_http_addition_filter_module.c | 251 + .../http/modules/ngx_http_auth_basic_module.c | 467 + .../modules/ngx_http_auth_request_module.c | 444 + .../http/modules/ngx_http_autoindex_module.c | 705 + .../http/modules/ngx_http_browser_module.c | 715 + .../modules/ngx_http_charset_filter_module.c | 1685 + .../modules/ngx_http_chunked_filter_module.c | 243 + .../src/http/modules/ngx_http_dav_module.c | 1156 + .../modules/ngx_http_degradation_module.c | 243 + .../http/modules/ngx_http_empty_gif_module.c | 140 + .../http/modules/ngx_http_fastcgi_module.c | 3279 + .../src/http/modules/ngx_http_flv_module.c | 266 + .../src/http/modules/ngx_http_geo_module.c | 1644 + .../src/http/modules/ngx_http_geoip_module.c | 925 + .../modules/ngx_http_gunzip_filter_module.c | 681 + .../modules/ngx_http_gzip_filter_module.c | 1229 + .../modules/ngx_http_gzip_static_module.c | 331 + .../modules/ngx_http_headers_filter_module.c | 635 + .../modules/ngx_http_image_filter_module.c | 1520 + .../src/http/modules/ngx_http_index_module.c | 540 + .../http/modules/ngx_http_limit_conn_module.c | 767 + .../http/modules/ngx_http_limit_req_module.c | 989 + .../src/http/modules/ngx_http_log_module.c | 1792 + .../src/http/modules/ngx_http_map_module.c | 567 + .../http/modules/ngx_http_memcached_module.c | 700 + .../src/http/modules/ngx_http_mp4_module.c | 3500 + .../ngx_http_not_modified_filter_module.c | 266 + .../src/http/modules/ngx_http_proxy_module.c | 3920 + .../modules/ngx_http_random_index_module.c | 317 + .../modules/ngx_http_range_filter_module.c | 890 + .../src/http/modules/ngx_http_realip_module.c | 442 + .../http/modules/ngx_http_referer_module.c | 671 + .../http/modules/ngx_http_rewrite_module.c | 1025 + .../src/http/modules/ngx_http_scgi_module.c | 1810 + .../modules/ngx_http_secure_link_module.c | 368 + .../modules/ngx_http_split_clients_module.c | 246 + .../http/modules/ngx_http_ssi_filter_module.c | 2930 + .../http/modules/ngx_http_ssi_filter_module.h | 114 + .../src/http/modules/ngx_http_ssl_module.c | 962 + .../src/http/modules/ngx_http_ssl_module.h | 65 + .../src/http/modules/ngx_http_static_module.c | 290 + .../modules/ngx_http_stub_status_module.c | 236 + .../http/modules/ngx_http_sub_filter_module.c | 756 + .../modules/ngx_http_upstream_hash_module.c | 631 + .../ngx_http_upstream_ip_hash_module.c | 279 + .../ngx_http_upstream_keepalive_module.c | 536 + .../ngx_http_upstream_least_conn_module.c | 408 + .../modules/ngx_http_userid_filter_module.c | 842 + .../src/http/modules/ngx_http_uwsgi_module.c | 2121 + .../modules/ngx_http_xslt_filter_module.c | 1147 + .../src/http/modules/perl/Makefile.PL | 33 + .../src/http/modules/perl/nginx.pm | 138 + .../src/http/modules/perl/nginx.xs | 1038 + .../http/modules/perl/ngx_http_perl_module.c | 1076 + .../http/modules/perl/ngx_http_perl_module.h | 67 + .../nginx-1.7.4/src/http/modules/perl/typemap | 3 + .../vendor/nginx-1.7.4/src/http/ngx_http.c | 2118 + .../vendor/nginx-1.7.4/src/http/ngx_http.h | 186 + .../nginx-1.7.4/src/http/ngx_http_busy_lock.c | 307 + .../nginx-1.7.4/src/http/ngx_http_busy_lock.h | 54 + .../nginx-1.7.4/src/http/ngx_http_cache.h | 169 + .../nginx-1.7.4/src/http/ngx_http_config.h | 75 + .../src/http/ngx_http_copy_filter_module.c | 303 + .../src/http/ngx_http_core_module.c | 5283 + .../src/http/ngx_http_core_module.h | 589 + .../src/http/ngx_http_file_cache.c | 2015 + .../src/http/ngx_http_header_filter_module.c | 633 + .../nginx-1.7.4/src/http/ngx_http_parse.c | 2359 + .../src/http/ngx_http_parse_time.c | 277 + .../http/ngx_http_postpone_filter_module.c | 176 + .../nginx-1.7.4/src/http/ngx_http_request.c | 3650 + .../nginx-1.7.4/src/http/ngx_http_request.h | 598 + .../src/http/ngx_http_request_body.c | 1099 + .../nginx-1.7.4/src/http/ngx_http_script.c | 1754 + .../nginx-1.7.4/src/http/ngx_http_script.h | 257 + .../nginx-1.7.4/src/http/ngx_http_spdy.c | 3647 + .../nginx-1.7.4/src/http/ngx_http_spdy.h | 261 + .../src/http/ngx_http_spdy_filter_module.c | 1213 + .../src/http/ngx_http_spdy_module.c | 408 + .../src/http/ngx_http_spdy_module.h | 41 + .../src/http/ngx_http_special_response.c | 792 + .../nginx-1.7.4/src/http/ngx_http_upstream.c | 5553 ++ .../nginx-1.7.4/src/http/ngx_http_upstream.h | 396 + .../src/http/ngx_http_upstream_round_robin.c | 697 + .../src/http/ngx_http_upstream_round_robin.h | 90 + .../nginx-1.7.4/src/http/ngx_http_variables.c | 2613 + .../nginx-1.7.4/src/http/ngx_http_variables.h | 112 + .../src/http/ngx_http_write_filter_module.c | 318 + .../vendor/nginx-1.7.4/src/mail/ngx_mail.c | 568 + .../vendor/nginx-1.7.4/src/mail/ngx_mail.h | 421 + .../src/mail/ngx_mail_auth_http_module.c | 1461 + .../src/mail/ngx_mail_core_module.c | 653 + .../nginx-1.7.4/src/mail/ngx_mail_handler.c | 788 + .../src/mail/ngx_mail_imap_handler.c | 457 + .../src/mail/ngx_mail_imap_module.c | 253 + .../src/mail/ngx_mail_imap_module.h | 39 + .../nginx-1.7.4/src/mail/ngx_mail_parse.c | 918 + .../src/mail/ngx_mail_pop3_handler.c | 500 + .../src/mail/ngx_mail_pop3_module.c | 264 + .../src/mail/ngx_mail_pop3_module.h | 38 + .../src/mail/ngx_mail_proxy_module.c | 1136 + .../src/mail/ngx_mail_smtp_handler.c | 857 + .../src/mail/ngx_mail_smtp_module.c | 307 + .../src/mail/ngx_mail_smtp_module.h | 45 + .../src/mail/ngx_mail_ssl_module.c | 568 + .../src/mail/ngx_mail_ssl_module.h | 57 + .../src/misc/ngx_cpp_test_module.cpp | 29 + .../src/misc/ngx_google_perftools_module.c | 126 + .../nginx-1.7.4/src/os/unix/ngx_aio_read.c | 109 + .../src/os/unix/ngx_aio_read_chain.c | 78 + .../nginx-1.7.4/src/os/unix/ngx_aio_write.c | 109 + .../src/os/unix/ngx_aio_write_chain.c | 100 + .../nginx-1.7.4/src/os/unix/ngx_alloc.c | 90 + .../nginx-1.7.4/src/os/unix/ngx_alloc.h | 45 + .../nginx-1.7.4/src/os/unix/ngx_atomic.h | 313 + .../nginx-1.7.4/src/os/unix/ngx_channel.c | 260 + .../nginx-1.7.4/src/os/unix/ngx_channel.h | 34 + .../nginx-1.7.4/src/os/unix/ngx_daemon.c | 70 + .../nginx-1.7.4/src/os/unix/ngx_darwin.h | 23 + .../src/os/unix/ngx_darwin_config.h | 95 + .../nginx-1.7.4/src/os/unix/ngx_darwin_init.c | 196 + .../src/os/unix/ngx_darwin_sendfile_chain.c | 370 + .../nginx-1.7.4/src/os/unix/ngx_errno.c | 87 + .../nginx-1.7.4/src/os/unix/ngx_errno.h | 78 + .../src/os/unix/ngx_file_aio_read.c | 208 + .../nginx-1.7.4/src/os/unix/ngx_files.c | 564 + .../nginx-1.7.4/src/os/unix/ngx_files.h | 386 + .../nginx-1.7.4/src/os/unix/ngx_freebsd.h | 25 + .../src/os/unix/ngx_freebsd_config.h | 127 + .../src/os/unix/ngx_freebsd_init.c | 260 + .../src/os/unix/ngx_freebsd_rfork_thread.c | 756 + .../src/os/unix/ngx_freebsd_rfork_thread.h | 122 + .../src/os/unix/ngx_freebsd_sendfile_chain.c | 440 + .../src/os/unix/ngx_gcc_atomic_amd64.h | 82 + .../src/os/unix/ngx_gcc_atomic_ppc.h | 155 + .../src/os/unix/ngx_gcc_atomic_sparc64.h | 82 + .../src/os/unix/ngx_gcc_atomic_x86.h | 127 + .../nginx-1.7.4/src/os/unix/ngx_linux.h | 18 + .../src/os/unix/ngx_linux_aio_read.c | 137 + .../src/os/unix/ngx_linux_config.h | 127 + .../nginx-1.7.4/src/os/unix/ngx_linux_init.c | 91 + .../src/os/unix/ngx_linux_sendfile_chain.c | 378 + .../vendor/nginx-1.7.4/src/os/unix/ngx_os.h | 83 + .../src/os/unix/ngx_posix_config.h | 158 + .../nginx-1.7.4/src/os/unix/ngx_posix_init.c | 128 + .../nginx-1.7.4/src/os/unix/ngx_process.c | 630 + .../nginx-1.7.4/src/os/unix/ngx_process.h | 88 + .../src/os/unix/ngx_process_cycle.c | 1413 + .../src/os/unix/ngx_process_cycle.h | 61 + .../src/os/unix/ngx_pthread_thread.c | 278 + .../nginx-1.7.4/src/os/unix/ngx_readv_chain.c | 271 + .../vendor/nginx-1.7.4/src/os/unix/ngx_recv.c | 183 + .../vendor/nginx-1.7.4/src/os/unix/ngx_send.c | 73 + .../nginx-1.7.4/src/os/unix/ngx_setaffinity.c | 69 + .../nginx-1.7.4/src/os/unix/ngx_setaffinity.h | 23 + .../src/os/unix/ngx_setproctitle.c | 135 + .../src/os/unix/ngx_setproctitle.h | 52 + .../nginx-1.7.4/src/os/unix/ngx_shmem.c | 126 + .../nginx-1.7.4/src/os/unix/ngx_shmem.h | 29 + .../nginx-1.7.4/src/os/unix/ngx_socket.c | 116 + .../nginx-1.7.4/src/os/unix/ngx_socket.h | 64 + .../nginx-1.7.4/src/os/unix/ngx_solaris.h | 16 + .../src/os/unix/ngx_solaris_config.h | 110 + .../src/os/unix/ngx_solaris_init.c | 75 + .../src/os/unix/ngx_solaris_sendfilev_chain.c | 260 + .../src/os/unix/ngx_sunpro_amd64.il | 43 + .../src/os/unix/ngx_sunpro_atomic_sparc64.h | 61 + .../src/os/unix/ngx_sunpro_sparc64.il | 36 + .../nginx-1.7.4/src/os/unix/ngx_sunpro_x86.il | 44 + .../nginx-1.7.4/src/os/unix/ngx_thread.h | 128 + .../vendor/nginx-1.7.4/src/os/unix/ngx_time.c | 104 + .../vendor/nginx-1.7.4/src/os/unix/ngx_time.h | 66 + .../nginx-1.7.4/src/os/unix/ngx_udp_recv.c | 115 + .../vendor/nginx-1.7.4/src/os/unix/ngx_user.c | 108 + .../vendor/nginx-1.7.4/src/os/unix/ngx_user.h | 24 + .../src/os/unix/ngx_writev_chain.c | 185 + .../nginx-1.7.4/src/os/unix/rfork_thread.S | 73 + .../vendor/groonga/vendor/onigmo/Makefile.am | 22 + .../groonga/vendor/plugins/CMakeLists.txt | 27 + .../plugins/groonga-normalizer-mysql/AUTHORS | 1 + .../groonga-normalizer-mysql/CMakeLists.txt | 65 + .../groonga-normalizer-mysql/ChangeLog | 0 .../plugins/groonga-normalizer-mysql/INSTALL | 1 + .../groonga-normalizer-mysql/Makefile.am | 84 + .../plugins/groonga-normalizer-mysql/NEWS | 1 + .../plugins/groonga-normalizer-mysql/README | 1 + .../groonga-normalizer-mysql/README.md | 201 + .../groonga-normalizer-mysql/autogen.sh | 20 + .../build/Makefile.am | 18 + .../build/cmake_modules/Makefile.am | 18 + .../build/cmake_modules/ReadFileList.cmake | 27 + .../groonga-normalizer-mysql/configure.ac | 179 + .../data/travis/setup.sh | 34 + .../groonga-normalizer-mysql/doc/Makefile.am | 18 + .../doc/text/Makefile.am | 19 + .../doc/text/lgpl-2.0.txt | 481 + .../plugins/groonga-normalizer-mysql/gpg_uid | 1 + .../groonga-normalizer-mysql.pc.in | 5 + .../normalizers/CMakeLists.txt | 27 + .../normalizers/Makefile.am | 69 + .../normalizers/mysql.c | 666 + .../normalizers/mysql_general_ci_table.h | 565 + .../normalizers/mysql_sources.am | 5 + ...ana_ci_kana_with_voiced_sound_mark_table.h | 1685 + .../normalizers/mysql_unicode_ci_table.h | 1685 + .../packages/Makefile.am | 6 + .../packages/apt/Makefile.am | 60 + .../packages/apt/build-deb.sh | 86 + .../packages/apt/build-in-chroot.sh | 134 + ...groonga-normalizer-mysql-depended-packages | 4 + .../packages/apt/sign-packages.sh | 42 + .../packages/apt/sign-repository.sh | 46 + .../packages/apt/update-repository.sh | 130 + .../packages/debian/changelog | 41 + .../packages/debian/compat | 1 + .../packages/debian/control | 25 + .../packages/debian/copyright | 29 + .../debian/groonga-normalizer-mysql.install | 1 + .../packages/debian/patches/series | 0 .../packages/debian/rules | 15 + .../packages/debian/source/format | 1 + .../packages/rpm/Makefile.am | 1 + .../packages/rpm/centos/Makefile.am | 1 + .../centos/groonga-normalizer-mysql.spec.in | 78 + .../packages/rpm/fedora/Makefile.am | 2 + .../fedora/groonga-normalizer-mysql.spec.in | 77 + .../packages/source/Makefile.am | 25 + .../packages/ubuntu/Makefile.am | 28 + .../packages/yum/Makefile.am | 72 + .../packages/yum/Vagrantfile | 38 + .../packages/yum/build-rpm.sh | 67 + .../packages/yum/env.sh.in | 11 + .../packages/yum/sign-rpm.sh | 37 + .../packages/yum/update-repository.sh | 33 + .../required_groonga_version | 1 + .../tool/dump_difference_uca.rb | 50 + .../tool/dump_difference_utf8.rb | 50 + .../tool/generate_uca_table.rb | 286 + .../tool/generate_utf8_table.rb | 146 + .../groonga-normalizer-mysql/tool/parser.rb | 161 + .../tool/travis/before_script.sh | 23 + .../tool/travis/install.sh | 27 + .../plugins/groonga-normalizer-mysql/version | 1 + .../vendor/groonga/vendor/update_nginx.sh | 33 + storage/mroonga/vendor/groonga/version-gen.sh | 35 + storage/mroonga/version | 1 + storage/mroonga/version_in_hex | 1 + storage/mroonga/version_major | 1 + storage/mroonga/version_micro | 1 + storage/mroonga/version_minor | 1 + 2027 files changed, 460307 insertions(+) create mode 100644 storage/mroonga/AUTHORS create mode 100644 storage/mroonga/CMakeLists.txt create mode 100644 storage/mroonga/ChangeLog create mode 100644 storage/mroonga/Makefile.am create mode 100644 storage/mroonga/NEWS create mode 100644 storage/mroonga/README create mode 100755 storage/mroonga/autogen.sh create mode 100644 storage/mroonga/build/Makefile.am create mode 100644 storage/mroonga/build/cmake_modules/Makefile.am create mode 100644 storage/mroonga/build/cmake_modules/ReadFileList.cmake create mode 100644 storage/mroonga/build/makefiles/LC_MESSAGES.am create mode 100644 storage/mroonga/build/makefiles/gettext.am create mode 100644 storage/mroonga/build/makefiles/locale.am create mode 100644 storage/mroonga/build/makefiles/sphinx-build.am create mode 100644 storage/mroonga/build/makefiles/sphinx.am create mode 100644 storage/mroonga/config.sh.in create mode 100644 storage/mroonga/configure.ac create mode 100644 storage/mroonga/data/Makefile.am create mode 100644 storage/mroonga/data/install.sql.in create mode 100644 storage/mroonga/data/uninstall.sql create mode 100644 storage/mroonga/gpg_uid create mode 100644 storage/mroonga/ha_mroonga.cpp create mode 100644 storage/mroonga/ha_mroonga.def create mode 100644 storage/mroonga/ha_mroonga.hpp create mode 100644 storage/mroonga/lib/Makefile.am create mode 100644 storage/mroonga/lib/libmrn_need_mysql_sources.am create mode 100644 storage/mroonga/lib/libmrn_no_mysql_sources.am create mode 100644 storage/mroonga/lib/libmysqlservices_compat_sources.am create mode 100644 storage/mroonga/lib/mrn_auto_increment_value_lock.cpp create mode 100644 storage/mroonga/lib/mrn_auto_increment_value_lock.hpp create mode 100644 storage/mroonga/lib/mrn_condition_converter.cpp create mode 100644 storage/mroonga/lib/mrn_condition_converter.hpp create mode 100644 storage/mroonga/lib/mrn_debug_column_access.cpp create mode 100644 storage/mroonga/lib/mrn_debug_column_access.hpp create mode 100644 storage/mroonga/lib/mrn_encoding.cpp create mode 100644 storage/mroonga/lib/mrn_encoding.hpp create mode 100644 storage/mroonga/lib/mrn_external_lock.cpp create mode 100644 storage/mroonga/lib/mrn_external_lock.hpp create mode 100644 storage/mroonga/lib/mrn_field_normalizer.cpp create mode 100644 storage/mroonga/lib/mrn_field_normalizer.hpp create mode 100644 storage/mroonga/lib/mrn_index_column_name.cpp create mode 100644 storage/mroonga/lib/mrn_index_column_name.hpp create mode 100644 storage/mroonga/lib/mrn_index_table_name.cpp create mode 100644 storage/mroonga/lib/mrn_index_table_name.hpp create mode 100644 storage/mroonga/lib/mrn_lock.cpp create mode 100644 storage/mroonga/lib/mrn_lock.hpp create mode 100644 storage/mroonga/lib/mrn_match_escalation_threshold_scope.cpp create mode 100644 storage/mroonga/lib/mrn_match_escalation_threshold_scope.hpp create mode 100644 storage/mroonga/lib/mrn_multiple_column_key_codec.cpp create mode 100644 storage/mroonga/lib/mrn_multiple_column_key_codec.hpp create mode 100644 storage/mroonga/lib/mrn_mysqlservices.cpp create mode 100644 storage/mroonga/lib/mrn_parameters_parser.cpp create mode 100644 storage/mroonga/lib/mrn_parameters_parser.hpp create mode 100644 storage/mroonga/lib/mrn_path_mapper.cpp create mode 100644 storage/mroonga/lib/mrn_path_mapper.hpp create mode 100644 storage/mroonga/lib/mrn_smart_grn_obj.cpp create mode 100644 storage/mroonga/lib/mrn_smart_grn_obj.hpp create mode 100644 storage/mroonga/lib/mrn_time_converter.cpp create mode 100644 storage/mroonga/lib/mrn_time_converter.hpp create mode 100644 storage/mroonga/lib/mrn_windows.hpp create mode 100644 storage/mroonga/mrn_constants.hpp create mode 100644 storage/mroonga/mrn_err.h create mode 100644 storage/mroonga/mrn_macro.hpp create mode 100644 storage/mroonga/mrn_mysql.h create mode 100644 storage/mroonga/mrn_mysql_compat.h create mode 100644 storage/mroonga/mrn_sys.cpp create mode 100644 storage/mroonga/mrn_sys.hpp create mode 100644 storage/mroonga/mrn_table.cpp create mode 100644 storage/mroonga/mrn_table.hpp create mode 100644 storage/mroonga/mrn_version.h.in create mode 100644 storage/mroonga/mysql-test/Makefile.am create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_fulltext_index_comment.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100_or_later.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56_or_later.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc create mode 100644 storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_key_multiple_column_with_data.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_comment_not_for_mroonga.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_have_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_create_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_ujis.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_utf8.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_multiple_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_truncate.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_updating.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_key_multiple_column_with_data.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_ujis.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_utf8.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_multiple_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_no_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_drop_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_table_param.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_text.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/binlog_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_general_ci_french.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_french.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_comment_index_not_for_mroonga.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_comment_normal_not_for_mroonga.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_55_out_of_range.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_enum_less_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_enum_many_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id_invalid_id.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_reference.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_with_not_for_mroonga_comment.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_order_by_with_function.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_int_with_index_zero_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_set_24_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_set_32_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_set_64_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_set_8_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_signed_bigint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_signed_int_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_signed_mediumint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_signed_smallint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_signed_tinyint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_tinyint_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_int_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_mediumint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_smallint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_tinyint_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_comment_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_fulltext_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_fulltext_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_index_btree_many_records.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_no_unique.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_unique.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_normal_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/delete_unsigned_bigint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/drop_database_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/drop_table_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/flush_logs.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_empty_query.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_full_spec.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_no_weight.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_omit_section.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_three_or_more_sections.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_ascii.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_eucjpms.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_empty_query.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_groonga_varchar_vector.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_not_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_or.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_match.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_no_where.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_same_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_comment.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_default.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_off.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_two_inner_join.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_100_no_such_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_55_no_such_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_56_no_such_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_target_characters_is_not_string.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_all.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_custom.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_nested.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_reference.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_set.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_eucjpms.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_nonexistent_charset.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_unsupported_charset.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_datetime.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_time.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_timestamp.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_btree_normal_column_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_unique.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_hash_normal_column_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_smallint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_bigint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_smallint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_select_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_replace.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_double.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_float.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_32bit_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_decimal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_index_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_reinsert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_32bit_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_64bit_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_index_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_reinsert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_string.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_exact_length.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_null_character.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_short.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_varchar_null_character.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint_unsigned.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_double.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_float.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int_unsigned.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint_unsigned.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint_unsigned.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint_unsigned.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar_collation.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_by_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_unique_insert_after_error.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_unique_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_update_multiple_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/index_update_single_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_none.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_use.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/lock_tables_read.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between_over.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_where_clause.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between_over.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than_or_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_multithread.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_single_thread.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_disabled.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_index_view.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/replace_vector.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_all.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_not_equal.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/select_secondary_key.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/show_create_table_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/truncate.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_id_hash_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_id_unique_hash_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_last_insert_grn_id.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_new_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_same_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_disable.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_invalid.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_no_retry.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_valid.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_new_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_nonexistent_path.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_same_value.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_log_level_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_vector_column_delimiter.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result create mode 100644 storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in create mode 100644 storage/mroonga/mysql-test/mroonga/storage/suite.opt create mode 100644 storage/mroonga/mysql-test/mroonga/storage/suite.pm create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_engine_decimal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_or_later_out_of_range.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_fulltext_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_match.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_no_where.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_same_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_comment.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_default.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_off.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_100_no_such_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_55_no_such_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_56_no_such_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_nested.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_multithread.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_single_thread.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_disabled.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_index_view.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_all.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/truncate.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test create mode 100644 storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_create_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_multiple_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_updating.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_lock_tables.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_multiple_column.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_normal.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_primary.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/auto_increment_text.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/binlog_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_comment_index_not_for_mroonga.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/delete_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/delete_all.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_full_spec.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_no_weight.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_omit_section.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_ascii.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_cp932.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_eucjpms.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_japanese.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_not_match_against.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_parser_comment.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_grn_id.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_reference.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_set.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/index_force_index_not_used.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/insert_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_disk_sweep.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_where_clause.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/update_fulltext.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/update_int.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/version_55_performance_schema.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/r/version_56_or_later_performance_schema.result create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/suite.opt create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/suite.pm create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_parser_comment.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_grn_id.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test create mode 100644 storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test create mode 100644 storage/mroonga/packages/Makefile.am create mode 100644 storage/mroonga/packages/apt/Makefile.am create mode 100755 storage/mroonga/packages/apt/build-deb.sh create mode 100755 storage/mroonga/packages/apt/build-in-chroot.sh create mode 100644 storage/mroonga/packages/apt/mroonga-depended-packages create mode 100755 storage/mroonga/packages/apt/sign-packages.sh create mode 100755 storage/mroonga/packages/apt/sign-repository.sh create mode 100755 storage/mroonga/packages/apt/update-repository.sh create mode 100755 storage/mroonga/packages/check-utility.sh create mode 100644 storage/mroonga/packages/debian/apparmor/mysql-server-mroonga create mode 100644 storage/mroonga/packages/debian/changelog create mode 100644 storage/mroonga/packages/debian/compat create mode 100644 storage/mroonga/packages/debian/control.in create mode 100644 storage/mroonga/packages/debian/copyright create mode 100644 storage/mroonga/packages/debian/mysql-server-mroonga-doc.install create mode 100644 storage/mroonga/packages/debian/mysql-server-mroonga.install create mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.postinst create mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.postrm create mode 100755 storage/mroonga/packages/debian/mysql-server-mroonga.prerm create mode 100755 storage/mroonga/packages/debian/rules create mode 100644 storage/mroonga/packages/rpm/Makefile.am create mode 100644 storage/mroonga/packages/rpm/centos/Makefile.am create mode 100644 storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in create mode 100644 storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in create mode 100644 storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in create mode 100644 storage/mroonga/packages/rpm/fedora/Makefile.am create mode 100644 storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in create mode 100644 storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in create mode 100644 storage/mroonga/packages/source/Makefile.am create mode 100644 storage/mroonga/packages/source/patches/mariadb-10.0.3-windows-build.diff create mode 100644 storage/mroonga/packages/ubuntu/Makefile.am create mode 100755 storage/mroonga/packages/ubuntu/upload.rb create mode 100644 storage/mroonga/packages/windows/Makefile.am create mode 100644 storage/mroonga/packages/windows/README.md create mode 100644 storage/mroonga/packages/windows/build-vc2010-msi-32.bat create mode 100644 storage/mroonga/packages/windows/build-vc2010-msi-64.bat create mode 100644 storage/mroonga/packages/windows/build-vc2010-zip-32.bat create mode 100644 storage/mroonga/packages/windows/build-vc2010-zip-64.bat create mode 100644 storage/mroonga/packages/windows/build-vc2010.bat create mode 100644 storage/mroonga/packages/windows/build-vc2013-msi-32.bat create mode 100644 storage/mroonga/packages/windows/build-vc2013-msi-64.bat create mode 100644 storage/mroonga/packages/windows/build-vc2013-zip-32.bat create mode 100644 storage/mroonga/packages/windows/build-vc2013-zip-64.bat create mode 100644 storage/mroonga/packages/windows/build-vc2013.bat create mode 100644 storage/mroonga/packages/yum/Makefile.am create mode 100644 storage/mroonga/packages/yum/Vagrantfile create mode 100755 storage/mroonga/packages/yum/build-in-vm.sh create mode 100755 storage/mroonga/packages/yum/build-rpm.sh create mode 100644 storage/mroonga/packages/yum/env.sh.in create mode 100755 storage/mroonga/packages/yum/sign-rpm.sh create mode 100755 storage/mroonga/packages/yum/update-repository.sh create mode 100644 storage/mroonga/plug.in create mode 100644 storage/mroonga/plugin_version create mode 100644 storage/mroonga/required_groonga_normalizer_mysql_version create mode 100644 storage/mroonga/required_groonga_version create mode 100644 storage/mroonga/sources.am create mode 100644 storage/mroonga/test/Makefile.am create mode 100755 storage/mroonga/test/run-sql-test.sh create mode 100755 storage/mroonga/test/run-unit-test.sh create mode 100644 storage/mroonga/test/unit/Makefile.am create mode 100644 storage/mroonga/test/unit/test_mrn_path_mapper.cpp create mode 100644 storage/mroonga/test/unit/test_mrn_sys.cpp create mode 100644 storage/mroonga/tools/Makefile.am create mode 100755 storage/mroonga/tools/prepare-sphinx-html.rb create mode 100755 storage/mroonga/tools/travis/before_script.sh create mode 100755 storage/mroonga/tools/travis/install.sh create mode 100755 storage/mroonga/tools/travis/script.sh create mode 100755 storage/mroonga/tools/upload-to-github.rb create mode 100644 storage/mroonga/udf/Makefile.am create mode 100644 storage/mroonga/udf/mrn_udf_command.cpp create mode 100644 storage/mroonga/udf/mrn_udf_escape.cpp create mode 100644 storage/mroonga/udf/mrn_udf_last_insert_grn_id.cpp create mode 100644 storage/mroonga/udf/mrn_udf_snippet.cpp create mode 100644 storage/mroonga/udf/sources.am create mode 100644 storage/mroonga/vendor/groonga/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/README.md create mode 100755 storage/mroonga/vendor/groonga/autogen.sh create mode 100644 storage/mroonga/vendor/groonga/base_version create mode 100644 storage/mroonga/vendor/groonga/benchmark/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-ctx-create.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-geo-distance.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-geo-select.c create mode 100755 storage/mroonga/vendor/groonga/benchmark/bench-geo-select.sh create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer-ddl.grn create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-query-optimizer.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/bench-table-factory.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/fixtures/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/benchmark/fixtures/geo-select/13_2010.CSV.xz create mode 100644 storage/mroonga/vendor/groonga/benchmark/fixtures/geo-select/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/benchmark/fixtures/geo-select/README.txt create mode 100644 storage/mroonga/vendor/groonga/benchmark/fixtures/geo-select/format_2010.html create mode 100755 storage/mroonga/vendor/groonga/benchmark/geo-distance-summary.rb create mode 100755 storage/mroonga/vendor/groonga/benchmark/geo-select-generate-grn.rb create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/bench-reporter.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/bench-reporter.h create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/bench-utils.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/bench-utils.h create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/benchmark.c create mode 100644 storage/mroonga/vendor/groonga/benchmark/lib/benchmark.h create mode 100644 storage/mroonga/vendor/groonga/bindings/php/config.m4 create mode 100644 storage/mroonga/vendor/groonga/bindings/php/config.w32 create mode 100644 storage/mroonga/vendor/groonga/bindings/php/groonga.c create mode 100644 storage/mroonga/vendor/groonga/bindings/php/php_groonga.h create mode 100644 storage/mroonga/vendor/groonga/bindings/php/tests/001.phpt create mode 100644 storage/mroonga/vendor/groonga/bindings/python/ql/groongaql.c create mode 100755 storage/mroonga/vendor/groonga/bindings/python/ql/setup.py create mode 100644 storage/mroonga/vendor/groonga/build/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/build/ac_macros/check_functions.m4 create mode 100644 storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 create mode 100644 storage/mroonga/vendor/groonga/build/cmake_modules/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/build/cmake_modules/ReadFileList.cmake create mode 100644 storage/mroonga/vendor/groonga/build/makefiles/LC_MESSAGES.am create mode 100644 storage/mroonga/vendor/groonga/build/makefiles/gettext.am create mode 100644 storage/mroonga/vendor/groonga/build/makefiles/locale.am create mode 100644 storage/mroonga/vendor/groonga/build/makefiles/sphinx-build.am create mode 100644 storage/mroonga/vendor/groonga/build/makefiles/sphinx.am create mode 100644 storage/mroonga/vendor/groonga/config.h.cmake create mode 100644 storage/mroonga/vendor/groonga/config.sh.in create mode 100644 storage/mroonga/vendor/groonga/configure.ac create mode 100644 storage/mroonga/vendor/groonga/data/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/data/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/account/twitter.gpg.hayashi create mode 100644 storage/mroonga/vendor/groonga/data/account/twitter.gpg.kou create mode 100644 storage/mroonga/vendor/groonga/data/account/twitter.gpg.yuki create mode 100644 storage/mroonga/vendor/groonga/data/groonga-httpd.conf.in create mode 100644 storage/mroonga/vendor/groonga/data/groonga.conf create mode 100644 storage/mroonga/vendor/groonga/data/html/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/data/html/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/groonga-admin.css create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_217bc0_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_2e83ff_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_469bdd_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_d8e7f3_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/favicon.ico create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/favicon.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/favicon.svg create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/images/groonga.png create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/images/groonga.svg create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/images/loading.gif create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/index.html create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/index.ja.html create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.ja.js create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.js create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/jquery-1.7.2.min.js create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/jquery-ui-1.8.18.custom.min.js create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot-0.7.min.js create mode 100644 storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot.license.txt create mode 100644 storage/mroonga/vendor/groonga/data/html/files.am create mode 100755 storage/mroonga/vendor/groonga/data/html/update-files.sh create mode 100644 storage/mroonga/vendor/groonga/data/images/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/files.am create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.ai create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.svg create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.png create mode 100644 storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.svg create mode 100755 storage/mroonga/vendor/groonga/data/images/logo/update-files.sh create mode 100644 storage/mroonga/vendor/groonga/data/munin/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_cpu_load_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_cpu_time_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_disk_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_memory_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_n_records_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_query_performance_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_status_ create mode 100755 storage/mroonga/vendor/groonga/data/munin/groonga_throughput_ create mode 100644 storage/mroonga/vendor/groonga/data/scripts/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/data/scripts/groonga-httpd-restart.in create mode 100644 storage/mroonga/vendor/groonga/data/synonyms.tsv create mode 100644 storage/mroonga/vendor/groonga/data/systemd/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-gqtp.service create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-http.service create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp create mode 100644 storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http create mode 100755 storage/mroonga/vendor/groonga/data/travis/setup.sh create mode 100644 storage/mroonga/vendor/groonga/examples/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/edict/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/edict/edict2grn.rb create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/eijiro/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro-import.sh create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro2grn.rb create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/gene95/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene-import.sh create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene2grn.rb create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/dictionary.css create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_222222_256x240.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_2e83ff_256x240.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_454545_256x240.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_888888_256x240.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_cd0a0a_256x240.png create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/index.html create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/js/dictionary.js create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/init-db.sh create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/jmdict/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/examples/dictionary/jmdict/jmdict.rb create mode 100644 storage/mroonga/vendor/groonga/examples/dictionary/readme.txt create mode 100644 storage/mroonga/vendor/groonga/gpg_uid create mode 100644 storage/mroonga/vendor/groonga/groonga-httpd-conf.sh.in create mode 100644 storage/mroonga/vendor/groonga/groonga.pc.in create mode 100644 storage/mroonga/vendor/groonga/include/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/include/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/include/groonga.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/include/groonga/nfkc.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/normalizer.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/plugin.h create mode 100644 storage/mroonga/vendor/groonga/include/groonga/tokenizer.h create mode 100644 storage/mroonga/vendor/groonga/lib/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/lib/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/com.c create mode 100644 storage/mroonga/vendor/groonga/lib/com.h create mode 100644 storage/mroonga/vendor/groonga/lib/ctx.c create mode 100644 storage/mroonga/vendor/groonga/lib/ctx.h create mode 100644 storage/mroonga/vendor/groonga/lib/ctx_impl.h create mode 100644 storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c create mode 100644 storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.h create mode 100644 storage/mroonga/vendor/groonga/lib/dat.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat.h create mode 100644 storage/mroonga/vendor/groonga/lib/dat/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/dat/array.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/base.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/block.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/check.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/cursor-factory.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/cursor-factory.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/cursor.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/dat.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/entry.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/file-impl.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/file-impl.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/file.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/file.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/header.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/id-cursor.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/id-cursor.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/key-cursor.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/key-cursor.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/key.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/node.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/predictive-cursor.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/prefix-cursor.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/dat/string.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/trie.cpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/trie.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/dat/vector.hpp create mode 100644 storage/mroonga/vendor/groonga/lib/db.c create mode 100644 storage/mroonga/vendor/groonga/lib/db.h create mode 100644 storage/mroonga/vendor/groonga/lib/ecmascript.c create mode 100644 storage/mroonga/vendor/groonga/lib/ecmascript.h create mode 100644 storage/mroonga/vendor/groonga/lib/ecmascript.lemon create mode 100644 storage/mroonga/vendor/groonga/lib/error.c create mode 100644 storage/mroonga/vendor/groonga/lib/error.h create mode 100644 storage/mroonga/vendor/groonga/lib/expr.c create mode 100644 storage/mroonga/vendor/groonga/lib/expr.h create mode 100644 storage/mroonga/vendor/groonga/lib/geo.c create mode 100644 storage/mroonga/vendor/groonga/lib/geo.h create mode 100644 storage/mroonga/vendor/groonga/lib/groonga_in.h create mode 100644 storage/mroonga/vendor/groonga/lib/hash.c create mode 100644 storage/mroonga/vendor/groonga/lib/hash.h create mode 100644 storage/mroonga/vendor/groonga/lib/icudump.c create mode 100644 storage/mroonga/vendor/groonga/lib/ii.c create mode 100644 storage/mroonga/vendor/groonga/lib/ii.h create mode 100644 storage/mroonga/vendor/groonga/lib/io.c create mode 100644 storage/mroonga/vendor/groonga/lib/io.h create mode 100644 storage/mroonga/vendor/groonga/lib/libgroonga.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_accessor.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_accessor.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_bulk.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_bulk.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_column.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_column.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_converter.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_converter.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_fixed_size_column.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_fixed_size_column.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_id.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_id.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_index_column.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_index_column.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_logger.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_logger.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_operator.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_operator.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_procedure.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_procedure.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_variable_size_column.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_variable_size_column.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_void.c create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/mrb_void.h create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/backtrace_entry.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/context.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/context/rc.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/eval_context.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/expression.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/index_info.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/logger.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/logger/level.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/object.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/scripts/test/empty.rb create mode 100644 storage/mroonga/vendor/groonga/lib/mrb/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/nfkc-custom-rules.txt create mode 100644 storage/mroonga/vendor/groonga/lib/nfkc.c create mode 100755 storage/mroonga/vendor/groonga/lib/nfkc.rb create mode 100644 storage/mroonga/vendor/groonga/lib/normalizer.c create mode 100644 storage/mroonga/vendor/groonga/lib/normalizer_in.h create mode 100644 storage/mroonga/vendor/groonga/lib/output.c create mode 100644 storage/mroonga/vendor/groonga/lib/output.h create mode 100644 storage/mroonga/vendor/groonga/lib/pat.c create mode 100644 storage/mroonga/vendor/groonga/lib/pat.h create mode 100644 storage/mroonga/vendor/groonga/lib/plugin.c create mode 100644 storage/mroonga/vendor/groonga/lib/plugin_in.h create mode 100644 storage/mroonga/vendor/groonga/lib/proc.c create mode 100644 storage/mroonga/vendor/groonga/lib/proc.h create mode 100644 storage/mroonga/vendor/groonga/lib/snip.c create mode 100644 storage/mroonga/vendor/groonga/lib/snip.h create mode 100644 storage/mroonga/vendor/groonga/lib/sources.am create mode 100644 storage/mroonga/vendor/groonga/lib/store.c create mode 100644 storage/mroonga/vendor/groonga/lib/store.h create mode 100644 storage/mroonga/vendor/groonga/lib/str.c create mode 100644 storage/mroonga/vendor/groonga/lib/str.h create mode 100644 storage/mroonga/vendor/groonga/lib/string.c create mode 100644 storage/mroonga/vendor/groonga/lib/string_in.h create mode 100644 storage/mroonga/vendor/groonga/lib/token.c create mode 100644 storage/mroonga/vendor/groonga/lib/token.h create mode 100644 storage/mroonga/vendor/groonga/lib/tokenizer.c create mode 100644 storage/mroonga/vendor/groonga/lib/util.c create mode 100644 storage/mroonga/vendor/groonga/lib/util.h create mode 100644 storage/mroonga/vendor/groonga/nginx_version create mode 100644 storage/mroonga/vendor/groonga/packages/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/apt/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/packages/apt/build-deb.sh create mode 100755 storage/mroonga/vendor/groonga/packages/apt/build-in-chroot.sh create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/changelog create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/compat create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/control create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/copyright create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.install create mode 100755 storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postinst create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postrm.in create mode 100755 storage/mroonga/vendor/groonga/packages/apt/debian/rules create mode 100644 storage/mroonga/vendor/groonga/packages/apt/debian/source/format create mode 100644 storage/mroonga/vendor/groonga/packages/apt/groonga-depended-packages create mode 100644 storage/mroonga/vendor/groonga/packages/apt/groonga-keyring-depended-packages create mode 100755 storage/mroonga/vendor/groonga/packages/apt/sign-packages.sh create mode 100755 storage/mroonga/vendor/groonga/packages/apt/sign-repository.sh create mode 100755 storage/mroonga/vendor/groonga/packages/apt/update-repository.sh create mode 100755 storage/mroonga/vendor/groonga/packages/check-utility.sh create mode 100644 storage/mroonga/vendor/groonga/packages/debian/changelog create mode 100644 storage/mroonga/vendor/groonga/packages/debian/compat create mode 100644 storage/mroonga/vendor/groonga/packages/debian/control create mode 100644 storage/mroonga/vendor/groonga/packages/debian/copyright create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-bin.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-doc.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-doc.links create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-examples.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.dirs create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.logrotate create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postinst create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postrm create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.conf create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.links create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postinst create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postrm create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-plugin-suggest.install create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postinst create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postrm create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.default create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.dirs create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.init create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.logrotate create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.default create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.dirs create mode 100755 storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.init create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.logrotate create mode 100644 storage/mroonga/vendor/groonga/packages/debian/groonga-tokenizer-mecab.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/libgroonga-dev.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install create mode 100644 storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-1.7.2.js create mode 100644 storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-ui-1.8.18.custom.js create mode 100644 storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.flot-0.7.js create mode 100644 storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.js create mode 100644 storage/mroonga/vendor/groonga/packages/debian/missing-sources/underscore.js create mode 100644 storage/mroonga/vendor/groonga/packages/debian/patches/series create mode 100755 storage/mroonga/vendor/groonga/packages/debian/rules create mode 100644 storage/mroonga/vendor/groonga/packages/debian/source/format create mode 100644 storage/mroonga/vendor/groonga/packages/debian/watch create mode 100644 storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.hayashi create mode 100644 storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.kou create mode 100644 storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.yoshihara create mode 100644 storage/mroonga/vendor/groonga/packages/rpm/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/rpm/centos/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in create mode 100644 storage/mroonga/vendor/groonga/packages/rpm/fedora/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in create mode 100644 storage/mroonga/vendor/groonga/packages/source/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/ubuntu/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/packages/ubuntu/upload.rb create mode 100644 storage/mroonga/vendor/groonga/packages/windows/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/windows/Rakefile create mode 100644 storage/mroonga/vendor/groonga/packages/windows/create-setup.bat create mode 100644 storage/mroonga/vendor/groonga/packages/windows/language-files/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/windows/language-files/english.nsi create mode 100644 storage/mroonga/vendor/groonga/packages/windows/language-files/japanese.nsi create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-add-missing-dll-export.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-mingw-w64.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-not-use-locale-on-mingw.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-cflags.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-externc.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-ltmain-wmain.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-yieldprocessor-macro.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/patches/mecab-mingw-unsigned-long-long-int.diff create mode 100644 storage/mroonga/vendor/groonga/packages/windows/setup-x64.nsi.in create mode 100644 storage/mroonga/vendor/groonga/packages/yum/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/packages/yum/Vagrantfile create mode 100755 storage/mroonga/vendor/groonga/packages/yum/build-release-rpm.sh create mode 100755 storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh create mode 100644 storage/mroonga/vendor/groonga/packages/yum/env.sh.in create mode 100644 storage/mroonga/vendor/groonga/packages/yum/patches/mecab-ipadic-provides-mecab-dic.diff create mode 100644 storage/mroonga/vendor/groonga/packages/yum/patches/mecab-jumandic-provides-mecab-dic.diff create mode 100755 storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh create mode 100755 storage/mroonga/vendor/groonga/packages/yum/update-repository.sh create mode 100644 storage/mroonga/vendor/groonga/plugins/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/query_expanders/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/query_expanders/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/query_expanders/tsv.c create mode 100644 storage/mroonga/vendor/groonga/plugins/query_expanders/tsv_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/eval.c create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/eval_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/load.c create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/load_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/ruby/ruby_plugin.h create mode 100644 storage/mroonga/vendor/groonga/plugins/suggest/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/suggest/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/suggest/sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/suggest/suggest.c create mode 100644 storage/mroonga/vendor/groonga/plugins/table/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/table/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/table/sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/table/table.c create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/kytea.cpp create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/kytea_sources.am create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c create mode 100644 storage/mroonga/vendor/groonga/plugins/tokenizers/mecab_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/.gitignore create mode 100644 storage/mroonga/vendor/groonga/src/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/src/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/src/grnslap.c create mode 100644 storage/mroonga/vendor/groonga/src/grnslap_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/groonga.c create mode 100644 storage/mroonga/vendor/groonga/src/groonga_benchmark.c create mode 100644 storage/mroonga/vendor/groonga/src/groonga_benchmark_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/groonga_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/httpd/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/src/httpd/nginx-module/config create mode 100644 storage/mroonga/vendor/groonga/src/httpd/nginx-module/ngx_http_groonga_module.c create mode 100644 storage/mroonga/vendor/groonga/src/suggest/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/src/suggest/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/src/suggest/create_dataset_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/suggest/groonga_suggest_create_dataset.c create mode 100644 storage/mroonga/vendor/groonga/src/suggest/groonga_suggest_ddl.txt create mode 100644 storage/mroonga/vendor/groonga/src/suggest/groonga_suggest_httpd.c create mode 100644 storage/mroonga/vendor/groonga/src/suggest/groonga_suggest_learner.c create mode 100644 storage/mroonga/vendor/groonga/src/suggest/httpd_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/suggest/learner_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/suggest/util.c create mode 100644 storage/mroonga/vendor/groonga/src/suggest/util.h create mode 100644 storage/mroonga/vendor/groonga/src/suggest/util_sources.am create mode 100644 storage/mroonga/vendor/groonga/src/suggest/zmq_compatible.h create mode 100644 storage/mroonga/vendor/groonga/tools/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/tools/groonga-memory-leak-checker.rb create mode 100755 storage/mroonga/vendor/groonga/tools/groonga-suggest-httpd-client.rb create mode 100755 storage/mroonga/vendor/groonga/tools/prepare-sphinx-html.rb create mode 100755 storage/mroonga/vendor/groonga/tools/travis-before-script.sh create mode 100755 storage/mroonga/vendor/groonga/tools/travis-script.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/mruby/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/mruby/build_config.rb create mode 100644 storage/mroonga/vendor/groonga/vendor/mruby/sources.am create mode 100755 storage/mroonga/vendor/groonga/vendor/mruby/update.rb create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES.ru create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/LICENSE create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/README create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/acc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/ccc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/clang create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/gcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/icc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/name create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/owc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/sunc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/define create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/endianness create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/feature create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have_headers create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/headers create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/include create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/init create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/geoip/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/google-perftools/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libgd/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libxslt/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.owc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.owc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.owc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/test create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.bcc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.msvc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.owc create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/make create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/modules create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/nohave create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/options create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/darwin create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/freebsd create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/linux create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/solaris create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/win32 create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/sources create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/stubs create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/summary create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/sizeof create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/typedef create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/uintptr_t create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/value create mode 100755 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/unix create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi.conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi_params create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-utf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-win create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/mime.types create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/nginx.conf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/scgi_params create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/uwsgi_params create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/win-utf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/README create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/geo2nginx.pl create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/koi-utf create mode 100755 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/unicode-to-nginx.pl create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/win-utf create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/ftdetect/nginx.vim create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/indent/nginx.vim create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/syntax/nginx.vim create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/50x.html create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/index.html create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/man/nginx.8 create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_aio_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_devpoll_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_epoll_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_eventport_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_kqueue_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_poll_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_rtsig_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_select_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_win32_select_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_accept.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_mutex.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl_stapling.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_access_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_addition_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_basic_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_request_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_autoindex_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_browser_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_charset_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_chunked_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_dav_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_degradation_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_empty_gif_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_fastcgi_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_flv_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geo_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geoip_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gunzip_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_static_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_headers_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_image_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_index_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_conn_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_req_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_log_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_map_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_memcached_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_mp4_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_not_modified_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_proxy_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_random_index_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_range_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_realip_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_referer_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_rewrite_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_scgi_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_secure_link_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_split_clients_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_static_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_stub_status_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_sub_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_hash_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_ip_hash_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_keepalive_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_least_conn_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_userid_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_uwsgi_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_xslt_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/Makefile.PL create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.pm create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.xs create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/typemap create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_cache.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_copy_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_file_cache.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_header_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse_time.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_postpone_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request_body.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_special_response.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_write_filter_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_auth_http_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_core_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_handler.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_handler.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_parse.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_handler.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_proxy_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_handler.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_cpp_test_module.cpp create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_google_perftools_module.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_atomic.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_daemon.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_init.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_sendfile_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_file_aio_read.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_init.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_sendfile_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_amd64.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_ppc.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_sparc64.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_x86.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_aio_read.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_init.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_sendfile_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_os.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_init.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_pthread_thread.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_readv_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_recv.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_send.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_config.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_init.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_sendfilev_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_amd64.il create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_atomic_sparc64.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_sparc64.il create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_x86.il create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_thread.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_udp_recv.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.h create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_writev_chain.c create mode 100644 storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/rfork_thread.S create mode 100644 storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/AUTHORS create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/ChangeLog create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/INSTALL create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/NEWS create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/README create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/README.md create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/autogen.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/build/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/build/cmake_modules/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/build/cmake_modules/ReadFileList.cmake create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/data/travis/setup.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/doc/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/doc/text/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/doc/text/lgpl-2.0.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/gpg_uid create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/groonga-normalizer-mysql.pc.in create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/CMakeLists.txt create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql.c create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_general_ci_table.h create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_sources.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_unicode_ci_except_kana_ci_kana_with_voiced_sound_mark_table.h create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_unicode_ci_table.h create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-in-chroot.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/groonga-normalizer-mysql-depended-packages create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/sign-packages.sh create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/sign-repository.sh create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/update-repository.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/changelog create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/compat create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/control create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/copyright create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/groonga-normalizer-mysql.install create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/patches/series create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/rules create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/debian/source/format create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/rpm/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/rpm/centos/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/rpm/centos/groonga-normalizer-mysql.spec.in create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/rpm/fedora/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/rpm/fedora/groonga-normalizer-mysql.spec.in create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/source/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/ubuntu/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/Makefile.am create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/Vagrantfile create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/build-rpm.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/env.sh.in create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/sign-rpm.sh create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/yum/update-repository.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/required_groonga_version create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/dump_difference_uca.rb create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/dump_difference_utf8.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/generate_uca_table.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/generate_utf8_table.rb create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/parser.rb create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/travis/before_script.sh create mode 100755 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/tool/travis/install.sh create mode 100644 storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version create mode 100755 storage/mroonga/vendor/groonga/vendor/update_nginx.sh create mode 100755 storage/mroonga/vendor/groonga/version-gen.sh create mode 100644 storage/mroonga/version create mode 100644 storage/mroonga/version_in_hex create mode 100644 storage/mroonga/version_major create mode 100644 storage/mroonga/version_micro create mode 100644 storage/mroonga/version_minor diff --git a/.bzrignore b/.bzrignore index 682d8e983d5..a98f46a84b2 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1455,6 +1455,18 @@ storage/tokudb/ft-index/utils/tokudb_gen storage/tokudb/ft-index/utils/tokudb_load storage/connect/connect.cnf storage/cassandra/cassandra.cnf +storage/mroonga/config.sh +storage/mroonga/mrn_version.h +storage/mroonga/data/install.sql +storage/mroonga/vendor/groonga/config.sh +storage/mroonga/vendor/groonga/groonga.pc +storage/mroonga/vendor/groonga/version.sh +storage/mroonga/vendor/groonga/src/grnslap +storage/mroonga/vendor/groonga/src/groonga +storage/mroonga/vendor/groonga/src/groonga-benchmark +storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset +storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/groonga-normalizer-mysql.pc +libmysql/libmysql.version libmysql/libmysql_versions.ld scripts/mysql_config.pl pcre/pcre_chartables.c diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index ca190104d79..5c54c4ff30c 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1269,3 +1269,16 @@ fun:__tls_get_addr } +{ + Mroonga: dlopen leaves some "still reachable" + Memcheck:Leak + fun:malloc + ... + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 +} diff --git a/storage/mroonga/AUTHORS b/storage/mroonga/AUTHORS new file mode 100644 index 00000000000..c29bd9cc5fa --- /dev/null +++ b/storage/mroonga/AUTHORS @@ -0,0 +1,7 @@ +Active developers: +* Kentoku SHIBA +* Kouhei Sutou + +Inactive developers: +* Tetsuro IKEDA: The original author: Active +* Yoshinori Matsunobu: The original author of information schema diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt new file mode 100644 index 00000000000..5c420d9672b --- /dev/null +++ b/storage/mroonga/CMakeLists.txt @@ -0,0 +1,380 @@ +# -*- indent-tabs-mode: nil -*- +# +# Copyright(C) 2012-2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +cmake_minimum_required(VERSION 2.6) +project(mroonga) + +if(MSVC) + if(MSVC_VERSION LESS 1600) + message(STATUS "Mroonga supports only MSVC 2010 or later") + return() + endif() +endif() + +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(MRN_BUNDLED FALSE) +else() + set(MRN_BUNDLED TRUE) +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) + if(MSVC) + message(STATUS "Bundled Mroonga does not support MSVC yet") + return() + endif() +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) + add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}") +else() + 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) + set(checking_message "checking for C flag '${flag}'") + check_c_compiler_flag(${flag} is_available) + if(${is_available}) + message(STATUS "${checking_message} - available") + set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}") + else() + message(STATUS "${checking_message} - not available") + endif() +endmacro() + +macro(mrn_check_cxxflag flag) + set(checking_message "checking for CXX flag '${flag}'") + check_cxx_compiler_flag(${flag} is_available) + if(${is_available}) + message(STATUS "${checking_message} - available") + set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}") + else() + message(STATUS "${checking_message} - not available") + 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 MROONGA_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}/pcre") + set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/pcre") +else() + set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/regex") +endif() + +set(MYSQL_INCLUDE_DIRS + "${MYSQL_BUILD_DIR}/include" + "${MYSQL_SOURCE_DIR}/sql" + "${MYSQL_SOURCE_DIR}/include" + "${MYSQL_REGEX_INCLUDE_DIR}" + "${MYSQL_SOURCE_DIR}" + CACHE INTERNAL "MySQL include directories") + +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_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") + if(EXISTS "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql") + set(GROONGA_NORMALIZER_MYSQL_FOUND TRUE) + else() + set(GROONGA_NORMALIZER_MYSQL_FOUND FALSE) + 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}") +endif() + +if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED) + read_file_list(${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_sources.am MRN_GRN_NORMALIZER_MYSQL_SOURCES) + string(REGEX REPLACE "([^;]+)" "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/\\1" + MRN_GRN_NORMALIZER_MYSQL_SOURCES "${MRN_GRN_NORMALIZER_MYSQL_SOURCES}") +endif() + +include_directories( + "${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( + ${GROONGA_LIBRARY_DIRS} + ${MYSQL_LIBRARY_DIRS}) + +if(MRN_BUNDLED) + if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED) + mysql_add_plugin(ha_mroonga + "${MROONGA_SOURCES};${MRN_UDF_SOURCES};${MRN_GRN_NORMALIZER_MYSQL_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}" + STORAGE_ENGINE MODULE_ONLY + LINK_LIBRARIES ${GROONGA_LIBRARIES} + MODULE_OUTPUT_NAME "ha_mroonga") + else() + mysql_add_plugin(ha_mroonga + "${MROONGA_SOURCES};${MRN_UDF_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}" + STORAGE_ENGINE MODULE_ONLY + LINK_LIBRARIES ${GROONGA_LIBRARIES} + MODULE_OUTPUT_NAME "ha_mroonga") + endif() + set(EXPANDED_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}") + list(FIND + CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${EXPANDED_INSTALL_LIBDIR}" + EXPANDED_INSTALL_LIBDIR_INDEX_IN_IMPLICIT_LINK_DIRECTORIES) + if(EXPANDED_INSTALL_LIBDIR_INDEX_IN_IMPLICIT_LINK_DIRECTORIES EQUAL -1) + set_property(TARGET ha_mroonga APPEND PROPERTY + INSTALL_RPATH "${EXPANDED_INSTALL_LIBDIR}") + endif() +else() + add_library(ha_mroonga MODULE + ${MROONGA_SOURCES} + ${MRN_UDF_SOURCES} + ${LIBMRN_NO_MYSQL_SOURCES} + ${LIBMRN_NEED_MYSQL_SOURCES}) + + set(MYSQL_LIBRARIES "mysqlservices") + target_link_libraries(ha_mroonga ${GROONGA_LIBRARIES} ${MYSQL_LIBRARIES}) + + option(WITH_DEBUG "Enable debug options" OFF) + if(WITH_DEBUG) + set_property(TARGET ha_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 ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "DBUG_OFF") + endif() + + option(WITH_DEBUG_FULL "Enable full debug options" OFF) + if(WITH_DEBUG_FULL) + set_property(TARGET ha_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 ha_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 ha_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") + mrn_check_cxxflag("-fno-exceptions") + mrn_check_cxxflag("-fno-rtti") + mrn_check_cxxflag("-felide-constructors") + endif() + set_source_files_properties(${MROONGA_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_C_COMPILE_FLAGS}") + set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES + COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}") + set_property(TARGET ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") + set_target_properties(ha_mroonga PROPERTIES + PREFIX "" + OUTPUT_NAME "ha_mroonga") + + install(TARGETS ha_mroonga DESTINATION "${MYSQL_PLUGIN_DIR}") +endif() + +if(GROONGA_NORMALIZER_MYSQL_FOUND) + set(WITH_GROONGA_NORMALIZER_MYSQL 1) + set_property(TARGET ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1") + if(MRN_GROONGA_BUNDLED) + set_property(TARGET ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC=1") + else() + set(GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME \"normalizers/mysql\") + set_property(TARGET ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"") + endif() +endif() + +set(DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser") +set_property(TARGET ha_mroonga APPEND PROPERTY + COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${DEFAULT_PARSER}\"") + +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_BINARY_DIR}/data/install.sql" + "${PROJECT_SOURCE_DIR}/data/uninstall.sql" + DESTINATION "${MRN_DATA_DIR}/") diff --git a/storage/mroonga/ChangeLog b/storage/mroonga/ChangeLog new file mode 100644 index 00000000000..1a63e191506 --- /dev/null +++ b/storage/mroonga/ChangeLog @@ -0,0 +1,3 @@ +2009-01-27 Tetsuro IKEDA + + * initial import for development diff --git a/storage/mroonga/Makefile.am b/storage/mroonga/Makefile.am new file mode 100644 index 00000000000..250aefdd87c --- /dev/null +++ b/storage/mroonga/Makefile.am @@ -0,0 +1,157 @@ +AUTOMAKE_OPTIONS = 1.9.7 + +LOCALES = ja + +AM_CPPFLAGS = $(MYSQL_INCLUDES) $(GROONGA_CFLAGS) -I$(top_srcdir)/lib +ACLOCAL_AMFLAGS = $$ACLOCAL_ARGS + +include sources.am + +libraries = \ + $(top_builddir)/udf/libmrn_udf.la \ + $(top_builddir)/lib/libmrn_no_mysql.la \ + $(top_builddir)/lib/libmrn_need_mysql.la +if WITH_LIBMYSQLSERVICES_COMPAT +libraries += $(top_builddir)/lib/libmysqlservices.la +endif + +dynamic_plugin_ldflags = -module $(GROONGA_LIBS) $(MYSQL_LIBS) +dynamic_plugin_cxxflags = $(AM_CXXFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +dynamic_plugin_cflags = $(AM_CFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN + +plugin_LTLIBRARIES = ha_mroonga.la +ha_mroonga_la_LDFLAGS = $(dynamic_plugin_ldflags) +ha_mroonga_la_CXXFLAGS = $(dynamic_plugin_cxxflags) +ha_mroonga_la_CFLAGS = $(dynamic_plugin_cflags) +ha_mroonga_la_SOURCES = $(sources) +ha_mroonga_la_LIBADD = $(libraries) + +SUBDIRS = \ + build \ + lib \ + udf \ + test \ + mysql-test \ + doc \ + tools \ + packages \ + data + +EXTRA_DIST = \ + AUTHORS \ + gpg_uid \ + plug.in \ + CMakeLists.txt + +installcheck-local: install + test/run-sql-test.sh + +tag: + cd $(top_srcdir) && \ + git tag v$(VERSION) -a -m 'Mroonga $(VERSION)!!!' + +update-latest-release: misc + @if test -z "$(OLD_RELEASE)"; then \ + echo "\$$(OLD_RELEASE) is missing"; \ + exit 1; \ + fi + @if test -z "$(OLD_RELEASE_DATE)"; then \ + echo "\$$(OLD_RELEASE_DATE) is missing"; \ + exit 1; \ + fi + @if test -z "$(NEW_RELEASE_DATE)"; then \ + echo "\$$(NEW_RELEASE_DATE) is missing"; \ + exit 1; \ + fi + cd $(top_srcdir) && \ + misc/update-latest-release.rb \ + $(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \ + $(VERSION) $(NEW_RELEASE_DATE) \ + packages/rpm/fedora/mysql-mroonga.spec.in \ + packages/rpm/fedora/mariadb-mroonga.spec.in \ + packages/rpm/centos/mariadb-mroonga.spec.in \ + packages/rpm/centos/mysql55-mroonga.spec.in \ + packages/rpm/centos/mysql56-community-mroonga.spec.in \ + packages/debian/changelog \ + doc/source/install/*.rst \ + doc/locale/*/LC_MESSAGES/install.po \ + $(MROONGA_GITHUB_COM_PATH)/index.html \ + $(MROONGA_GITHUB_COM_PATH)/ja/index.html + +update-po: + @for lang in $(LOCALES); do \ + (cd $(top_srcdir)/doc/locale/$$lang/LC_MESSAGES && make update) \ + done + +update-document: + @if test -z "$(MROONGA_GITHUB_COM_PATH)"; then \ + echo "\$$(MROONGA_GITHUB_COM_PATH) is missing"; \ + echo "add --with-mroonga-github-com-path in configure"; \ + exit 1; \ + fi + rm -rf tmp-doc + mkdir tmp-doc + (cd doc && $(MAKE) clean-html) + (cd doc && $(MAKE) install docdir=$(abs_srcdir)/tmp-doc/install) + ruby $(srcdir)/tools/prepare-sphinx-html.rb tmp-doc/install tmp-doc/dist + rm -rf $(MROONGA_GITHUB_COM_PATH)/docs + mv tmp-doc/dist/en $(MROONGA_GITHUB_COM_PATH)/docs + for locale in `cd tmp-doc/dist; echo *`; do \ + dest_base_dir=$(MROONGA_GITHUB_COM_PATH)/$${locale}; \ + mkdir -p $${dest_base_dir}; \ + dest_dir=$${dest_base_dir}/docs; \ + rm -rf $${dest_dir}; \ + mv tmp-doc/dist/$${locale} $${dest_dir}; \ + done + +update-files: + cd $(srcdir)/doc && $(MAKE) update-files + +update-version: + @if test -z "$(NEW_VERSION_MAJOR)"; then \ + echo "\$$(NEW_VERSION_MAJOR) is missing"; \ + exit 1; \ + fi + @if test -z "$(NEW_VERSION_MINOR)"; then \ + echo "\$$(NEW_VERSION_MINOR) is missing"; \ + exit 1; \ + fi + @if test -z "$(NEW_VERSION_MICRO)"; then \ + echo "\$$(NEW_VERSION_MICRO) is missing"; \ + exit 1; \ + fi + @echo -n $(NEW_VERSION_MAJOR) > $(srcdir)/version_major + @echo -n $(NEW_VERSION_MINOR) > $(srcdir)/version_minor + @echo -n $(NEW_VERSION_MICRO) > $(srcdir)/version_micro + @echo -n $(NEW_VERSION_MAJOR).$(NEW_VERSION_MINOR)$(NEW_VERSION_MICRO) \ + > $(srcdir)/version + @if test $(NEW_VERSION_MINOR) -eq 0 ; then \ + printf "0x%02x%02x" \ + $(NEW_VERSION_MAJOR) $(NEW_VERSION_MICRO) \ + > $(srcdir)/version_in_hex; \ + printf "%d.%d" \ + $(NEW_VERSION_MAJOR) $(NEW_VERSION_MICRO) \ + > $(srcdir)/plugin_version; \ + else \ + printf "0x%02x%02x" \ + $(NEW_VERSION_MAJOR) $(NEW_VERSION_MINOR)$(NEW_VERSION_MICRO) \ + > $(srcdir)/version_in_hex; \ + printf "%d.%d" \ + $(NEW_VERSION_MAJOR) $(NEW_VERSION_MINOR)$(NEW_VERSION_MICRO) \ + > $(srcdir)/plugin_version; \ + fi + +upload-to-github: + ruby $(srcdir)/tools/upload-to-github.rb \ + $$USER $(PACKAGE)-$(VERSION).tar.gz + +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/NEWS b/storage/mroonga/NEWS new file mode 100644 index 00000000000..9dfa8b8dcc5 --- /dev/null +++ b/storage/mroonga/NEWS @@ -0,0 +1 @@ +See doc/source/news.txt or http://mroonga.github.com/docs/news.html. diff --git a/storage/mroonga/README b/storage/mroonga/README new file mode 100644 index 00000000000..7c431018d86 --- /dev/null +++ b/storage/mroonga/README @@ -0,0 +1 @@ +See doc/locale/en/html/index.html or doc/locale/ja/html/index.html diff --git a/storage/mroonga/autogen.sh b/storage/mroonga/autogen.sh new file mode 100755 index 00000000000..7a1d38635d4 --- /dev/null +++ b/storage/mroonga/autogen.sh @@ -0,0 +1,116 @@ +#!/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 + ;; +FreeBSD) + ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/" + ;; +esac + + +# 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 diff --git a/storage/mroonga/build/Makefile.am b/storage/mroonga/build/Makefile.am new file mode 100644 index 00000000000..506a11dc3b0 --- /dev/null +++ b/storage/mroonga/build/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = \ + cmake_modules diff --git a/storage/mroonga/build/cmake_modules/Makefile.am b/storage/mroonga/build/cmake_modules/Makefile.am new file mode 100644 index 00000000000..83fb0f0c1b4 --- /dev/null +++ b/storage/mroonga/build/cmake_modules/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + ReadFileList.cmake diff --git a/storage/mroonga/build/cmake_modules/ReadFileList.cmake b/storage/mroonga/build/cmake_modules/ReadFileList.cmake new file mode 100644 index 00000000000..018587991d8 --- /dev/null +++ b/storage/mroonga/build/cmake_modules/ReadFileList.cmake @@ -0,0 +1,27 @@ +# Copyright(C) 2012 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 + +macro(read_file_list file_name output_variable) + file(READ ${file_name} ${output_variable}) + # Remove variable declaration at the first line: + # "libgroonga_la_SOURCES = \" -> "" + string(REGEX REPLACE "^.*=[ \t]*\\\\" "" + ${output_variable} "${${output_variable}}") + # Remove white spaces: " com.c \\\n com.h \\\n" -> "com.c\\com.h" + string(REGEX REPLACE "[ \t\n]" "" ${output_variable} "${${output_variable}}") + # Convert string to list: "com.c\\com.h" -> "com.c;com.h" + # NOTE: List in CMake is ";" separated string. + string(REGEX REPLACE "\\\\" ";" ${output_variable} "${${output_variable}}") +endmacro() diff --git a/storage/mroonga/build/makefiles/LC_MESSAGES.am b/storage/mroonga/build/makefiles/LC_MESSAGES.am new file mode 100644 index 00000000000..acfc3da238e --- /dev/null +++ b/storage/mroonga/build/makefiles/LC_MESSAGES.am @@ -0,0 +1,5 @@ +BUILT_SOURCES = +EXTRA_DIST = +SUFFIXES = + +include $(top_srcdir)/build/makefiles/gettext.am diff --git a/storage/mroonga/build/makefiles/gettext.am b/storage/mroonga/build/makefiles/gettext.am new file mode 100644 index 00000000000..9706b485dd1 --- /dev/null +++ b/storage/mroonga/build/makefiles/gettext.am @@ -0,0 +1,73 @@ +include $(top_srcdir)/doc/files.am +include $(top_srcdir)/build/makefiles/sphinx-build.am + +EXTRA_DIST += \ + $(po_files) + +if DOCUMENT_AVAILABLE +EXTRA_DIST += \ + $(mo_files) +endif + +if DOCUMENT_BUILDABLE +BUILT_SOURCES += \ + pot-build-stamp \ + edit-po-build-stamp \ + $(mo_files) +endif + +SUFFIXES += .pot .po .mo .edit + +.PHONY: gettext update build + +.pot.edit: + if test -f $*.po; then \ + msgmerge \ + --quiet \ + --sort-by-file \ + --output-file=$@.tmp \ + $*.po \ + $<; \ + else \ + msginit \ + --input=$< \ + --output-file=$@.tmp \ + --locale=$(LOCALE) \ + --no-translator; \ + fi + (echo "# -*- po -*-"; \ + GREP_OPTIONS= grep -v '^# -\*- po -\*-' $@.tmp | \ + GREP_OPTIONS= grep -v '^"POT-Creation-Date:') > $@ + rm $@.tmp + +.edit.po: + msgcat --no-location --output $@ $< + +.po.mo: + msgfmt -o $@ $< + +if DOCUMENT_BUILDABLE +update: pot-build-stamp edit-po-build-stamp +build: update $(mo_files) +else +update: +build: +endif + +html: build +man: build +pdf: build + +gettext: + rm *.pot || true + $(SPHINX_BUILD_COMMAND) -d doctrees -b gettext $(ALLSPHINXOPTS) . + xgettext --language Python --output conf.pot \ + $(top_srcdir)/doc/source/conf.py + +pot-build-stamp: $(absolute_source_files) + $(MAKE) gettext + @touch $@ + +edit-po-build-stamp: $(absolute_source_files) + $(MAKE) $(edit_po_files) + @touch $@ diff --git a/storage/mroonga/build/makefiles/locale.am b/storage/mroonga/build/makefiles/locale.am new file mode 100644 index 00000000000..414c19a7e34 --- /dev/null +++ b/storage/mroonga/build/makefiles/locale.am @@ -0,0 +1,12 @@ +SUBDIRS = LC_MESSAGES + +BUILT_SOURCES = +EXTRA_DIST = + +include $(top_srcdir)/build/makefiles/sphinx.am + +init: + cd LC_MESSAGES && $(MAKE) $@ + +update-po: + cd LC_MESSAGES && $(MAKE) update diff --git a/storage/mroonga/build/makefiles/sphinx-build.am b/storage/mroonga/build/makefiles/sphinx-build.am new file mode 100644 index 00000000000..e237377ba80 --- /dev/null +++ b/storage/mroonga/build/makefiles/sphinx-build.am @@ -0,0 +1,19 @@ +# You can set these variables from the command line. +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) + +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/build/makefiles/sphinx.am b/storage/mroonga/build/makefiles/sphinx.am new file mode 100644 index 00000000000..f84fb23b739 --- /dev/null +++ b/storage/mroonga/build/makefiles/sphinx.am @@ -0,0 +1,179 @@ +include $(top_srcdir)/doc/files.am +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 +doc_localedir = $(docdir)/$(LOCALE) +nobase_dist_doc_locale_DATA = \ + $(html_files_relative_from_locale_dir) +am__nobase_dist_doc_locale_DATA_DIST += \ + $(nobase_dist_doc_locale_DATA) +endif + +document_source_files = \ + $(absolute_source_files) \ + $(absolute_theme_files) \ + $(po_files_relative_from_locale_dir) \ + $(mo_files_relative_from_locale_dir) + +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 + +$(mo_files_relative_from_locale_dir): mo-build-stamp + +mo-build-stamp: $(po_files_relative_from_locale_dir) + cd LC_MESSAGES && $(MAKE) build + @touch $@ + +if DOCUMENT_BUILDABLE +clean-local: $(clean_targets) clean-doctrees + +clean-doctrees: + rm -rf $(DOCTREES_BASE) + +maintainer-clean-local: + rm -rf -- $(generated_files) +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-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_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 + +$(build_stamps): $(document_source_files) + target=`echo $@ | sed -e 's/-build-stamp$$//'`; \ + $(SPHINX_BUILD_COMMAND) \ + -Dlanguage=$(LOCALE) \ + -d $(DOCTREES_BASE)/$${target} \ + -b $${target} \ + $(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/config.sh.in b/storage/mroonga/config.sh.in new file mode 100644 index 00000000000..2b584c6916d --- /dev/null +++ b/storage/mroonga/config.sh.in @@ -0,0 +1,20 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +MYSQL_SOURCE_DIR="@MYSQL_SOURCE_DIR@" +MYSQL_BUILD_DIR="@MYSQL_BUILD_DIR@" +MYSQL_VERSION="@MYSQL_VERSION@" +MRN_BUNDLED="@MRN_BUNDLED@" diff --git a/storage/mroonga/configure.ac b/storage/mroonga/configure.ac new file mode 100644 index 00000000000..dc39935d8ee --- /dev/null +++ b/storage/mroonga/configure.ac @@ -0,0 +1,492 @@ +AC_PREREQ(2.59) + +m4_define([mrn_version_major], m4_include(version_major)) +m4_define([mrn_version_minor], m4_include(version_minor)) +m4_define([mrn_version_micro], m4_include(version_micro)) +m4_define([mrn_version], m4_include(version)) +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_HEADERS([config.h]) + +AM_INIT_AUTOMAKE([tar-pax foreign subdir-objects]) + +MRN_VERSION=mrn_version +MRN_VERSION_MAJOR=mrn_version_major +MRN_VERSION_MINOR=mrn_version_minor +MRN_VERSION_MICRO=mrn_version_micro +MRN_VERSION_IN_HEX=mrn_version_in_hex +MRN_PLUGIN_VERSION=mrn_plugin_version +AC_SUBST([MRN_VERSION]) +AC_SUBST([MRN_VERSION_MAJOR]) +AC_SUBST([MRN_VERSION_MINOR]) +AC_SUBST([MRN_VERSION_MICRO]) +AC_SUBST([MRN_VERSION_IN_HEX]) +AC_SUBST([MRN_PLUGIN_VERSION]) + +MRN_PACKAGE_STRING="$PACKAGE_STRING" +AC_SUBST([MRN_PACKAGE_STRING]) + +MRN_BUNDLED=FALSE +AC_SUBST([MRN_BUNDLED]) + +AC_C_BIGENDIAN +AC_PROG_CC +AC_PROG_CXX +AC_PROG_CPP +AC_PROG_LIBTOOL +m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) + +AC_DEFUN([CHECK_CFLAG], [ + AC_MSG_CHECKING([if gcc supports $1]) + old_CFLAGS=$CFLAGS + flag=`echo '$1' | sed -e 's,^-Wno-,-W,'` + CFLAGS="$CFLAGS $flag -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [check_cflag=yes], + [check_cflag=no]) + CFLAGS="$old_CFLAGS" + if test "x$check_cflag" = "xyes"; then + CFLAGS="$CFLAGS $1" + fi + AC_MSG_RESULT([$check_cflag]) +]) + +AC_DEFUN([CHECK_CXXFLAG], [ + AC_MSG_CHECKING([if g++ supports $1]) + old_CXXFLAGS=$CXXFLAGS + flag=`echo '$1' | sed -e 's,^-Wno-,-W,'` + CXXFLAGS="$CXXFLAGS $flag -Werror" + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [check_cxxflag=yes], + [check_cxxflag=no]) + AC_LANG_POP([C++]) + CXXFLAGS="$old_CXXFLAGS" + if test "x$check_cxxflag" = "xyes"; then + CXXFLAGS="$CXXFLAGS $1" + fi + AC_MSG_RESULT([$check_cxxflag]) +]) + +AC_DEFUN([CHECK_BUILD_FLAG], [ + CHECK_CFLAG([$1]) + CHECK_CXXFLAG([$1]) +]) + +if test "$GCC" = "yes"; then + CHECK_BUILD_FLAG([-Wall]) + CHECK_BUILD_FLAG([-Wextra]) + CHECK_BUILD_FLAG([-Wno-unused-parameter]) + CHECK_BUILD_FLAG([-Wno-strict-aliasing]) + # REMOVEME: workaround for MySQL/MariaDB 5.5.22 :< + # They use deprecated MYSQL::generate_name style in class definition. + CHECK_BUILD_FLAG([-Wno-deprecated]) +fi + +AC_MSG_CHECKING(for the suffix of plugin shared libraries) +shrext_cmds=$(./libtool --config | grep '^shrext_cmds=') +eval $shrext_cmds +module=yes eval MRN_PLUGIN_SUFFIX="$shrext_cmds" +AC_MSG_RESULT($MRN_PLUGIN_SUFFIX) +if test -z "$MRN_PLUGIN_SUFFIX"; then + AC_MSG_ERROR([can't detect plugin suffix]) +fi +AC_SUBST(MRN_PLUGIN_SUFFIX) + +AC_ARG_WITH(libmysqlservices-compat, + [AS_HELP_STRING([--with-libmysqlservices-compat], + [Use libmysqlservices compatible library for missing libmysqlservices.a]) + ], + [with_libmysqlservices_compat=$withval], + [with_libmysqlservices_compat=no]) +AM_CONDITIONAL([WITH_LIBMYSQLSERVICES_COMPAT], [test "${with_libmysqlservices_compat}" != "no"]) + +AC_DEFUN([CONFIG_OPTION_MYSQL],[ + AC_MSG_CHECKING([mysql source]) + + ac_mysql_source_dir= + AC_ARG_WITH([mysql-source], + [AS_HELP_STRING([--with-mysql-source=PATH], [MySQL source directory PATH])], + [ + ac_mysql_source_dir="$withval" + if test -f "$ac_mysql_source_dir/sql/handler.h"; then + case "$ac_mysql_source_dir" in + /*) + : + ;; + *) + ac_mysql_source_dir="$ac_pwd/$ac_mysql_source_dir" + ;; + esac + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([invalid MySQL source directory]) + fi + ], + [AC_MSG_ERROR([--with-mysql-source=PATH is required])] + ) + MYSQL_SOURCE_DIR="$ac_mysql_source_dir" + AC_SUBST(MYSQL_SOURCE_DIR) + + ac_mysql_build_dir= + AC_ARG_WITH([mysql-build], + [AS_HELP_STRING([--with-mysql-build=PATH], [MySQL build directory PATH])], + [ac_mysql_build_dir="$withval"], + [ac_mysql_build_dir="$ac_mysql_source_dir"] + ) + case "$ac_mysql_build_dir" in + /*) + : + ;; + *) + ac_mysql_build_dir="$ac_pwd/$ac_mysql_build_dir" + ;; + esac + MYSQL_BUILD_DIR="$ac_mysql_build_dir" + AC_SUBST(MYSQL_BUILD_DIR) + + AC_MSG_CHECKING([mysql_config]) + AC_ARG_WITH([mysql-config], + [AS_HELP_STRING([--with-mysql-config=PATH], + [mysql_config PATH])], + [ac_mysql_config="$withval"], + [ac_mysql_config=]) + if test -z "$ac_mysql_config"; then + AC_PATH_PROG(ac_mysql_config, mysql_config, mysql-config-not-found) + fi + if test "$ac_mysql_config" = "mysql-config-not-found"; then + AC_MSG_ERROR([can't detect mysql_config. Please specify mysql_config path by --with-mysql-config=PATH.]) + fi + AC_MSG_RESULT([$ac_mysql_config]) + + plugindir="$($ac_mysql_config --plugindir)" + if test $? -ne 0; then + AC_MSG_ERROR([failed to run "$ac_mysql_config": $plugindir]) + fi + AC_SUBST(plugindir) + + MYSQL_CFLAGS="$MYSQL_CFLAGS $($ac_mysql_config --cflags)" + AC_SUBST(MYSQL_CFLAGS) + + MYSQL_INCLUDES="" + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/include" + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql" + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/include" + 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" + MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir" + MYSQL_INCLUDES="$MYSQL_INCLUDES $($ac_mysql_config --include)" + AC_SUBST(MYSQL_INCLUDES) + + MYSQL_VERSION="$($ac_mysql_config --version)" + AC_SUBST(MYSQL_VERSION) + + if test "${with_libmysqlservices_compat}" = "no"; then + MYSQL_MAJOR_MINOR_VERSION=["$(echo $MYSQL_VERSION | sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*[a-z]*\)$/\1.\2/')"] + case "$MYSQL_MAJOR_MINOR_VERSION" in + 5.1) + MYSQL_LIBS="" + ;; + *) + AC_MSG_CHECKING([for libmysqlservices.a directory]) + pkglibdir="$($ac_mysql_config --variable=pkglibdir)" + mysql_build_libservices_dir="${MYSQL_BUILD_DIR}/libservices" + if test -f "${mysql_build_libservices_dir}/libmysqlservices.a"; then + mysql_services_lib_dir="${mysql_build_libservices_dir}" + else + if test -f "${pkglibdir}/libmysqlservices.a"; then + mysql_services_lib_dir="${pkglibdir}" + elif test -f "${pkglibdir}/mysql/libmysqlservices.a"; then + mysql_services_lib_dir="${pkglibdir}/mysql" + else + AC_MSG_ERROR([libmysqlservices.a is not found in <${pkglibdir}/> and <${pkglibdir}/mysql/>]) + fi + fi + AC_MSG_RESULT([$mysql_services_lib_dir]) + MYSQL_LIBS="$MYSQL_LIBS -L\"$mysql_services_lib_dir\" -lmysqlservices" + ;; + esac + AC_SUBST(MYSQL_LIBS) + fi +]) + +m4_define([mrn_required_groonga_version], m4_include(required_groonga_version)) +REQUIRED_GROONGA_VERSION=mrn_required_groonga_version +AC_SUBST(REQUIRED_GROONGA_VERSION) +AC_DEFUN([CONFIG_OPTION_GROONGA],[ + PKG_CHECK_MODULES(GROONGA, groonga >= ${REQUIRED_GROONGA_VERSION}) + _PKG_CONFIG(GROONGA_VERSION, variable=groonga_version, groonga) + GROONGA_VERSION=$pkg_cv_GROONGA_VERSION + AC_SUBST(GROONGA_VERSION) +]) + +m4_define([mrn_required_groonga_normalizer_mysql_version], + m4_include(required_groonga_normalizer_mysql_version)) +REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION=mrn_required_groonga_normalizer_mysql_version +AC_DEFUN([CONFIG_OPTION_GROONGA_NORMALIZER_MYSQL], [ + AC_MSG_CHECKING([for groonga-normalizer-mysql]) + PKG_CHECK_EXISTS([groonga-normalizer-mysql >= ${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}], + [WITH_GROONGA_NORMALIZER_MYSQL=yes], + [WITH_GROONGA_NORMALIZER_MYSQL=no]) + AC_MSG_RESULT($WITH_GROONGA_NORMALIZER_MYSQL) + if test "$WITH_GROONGA_NORMALIZER_MYSQL" = "yes"; then + AC_DEFINE([WITH_GROONGA_NORMALIZER_MYSQL], + [1], + [Use MySQL normalizer plugin for groonga]) + _PKG_CONFIG(plugin_name, variable=plugin_name, groonga-normalizer-mysql) + GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=$pkg_cv_plugin_name + AC_DEFINE_UNQUOTED([GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME], + "${GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME}", + [Name of MySQL normalizer plugin for groonga]) + fi +]) + +AC_ARG_WITH(debug, + [dnl +AS_HELP_STRING([--with-debug], + [Add debug code]) +AS_HELP_STRING([--with-debug=full], + [Add debug code (adds memory checker, very slow)])dnl + ], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + # Medium debug. + AC_DEFINE([DBUG_ON], [1], [Use libdbug]) + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS -O0 -g3" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS -O0 -g3" +elif test "$with_debug" = "full" +then + # Full debug. Very slow in some cases + AC_DEFINE([DBUG_ON], [1], [Use libdbug]) + CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS -O0 -g3" + CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS -O0 -g3" +else + # Optimized version. No debug + AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug]) + CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" +fi + +AC_ARG_WITH(valgrind, + [AS_HELP_STRING([--with-valgrind], [Use valgrind. [default=no]])], + [with_valgrind="$withval"], + [with_valgrind="no"]) +if test "$with_valgrind" != "no"; then + CFLAGS="-DHAVE_valgrind $CFLAGS" + CXXFLAGS="-DHAVE_valgrind $CXXFLAGS" +fi + +CONFIG_OPTION_MYSQL +CONFIG_OPTION_GROONGA +CONFIG_OPTION_GROONGA_NORMALIZER_MYSQL + +AC_ARG_WITH(default_parser, + [AS_HELP_STRING([--with-default-parser=PARSER], + [specify the default fulltext parser like + --with-default-parser=TokenMecab. + (default: TokenBigram)])], + [default_parser=$withval], + [default_parser=no]) +if test x"$default_parser" != x"no"; then + AC_DEFINE_UNQUOTED(MRN_PARSER_DEFAULT, + "$default_parser", + "specified default fulltext parser") + MRN_DEFAULT_PARSER=$default_parser +else + MRN_DEFAULT_PARSER=TokenBigram +fi +AC_SUBST(MRN_DEFAULT_PARSER) + +AC_ARG_ENABLE(fast_mutexes, + [AS_HELP_STRING([--disable-fast-mutexes], + [Force disable fast mutex. + [default: use mysql_config output]])], + [enable_fast_mutexes=$enableval], + [enable_fast_mutexes=auto]) +if test "$enable_fast_mutexes" = "no"; then + AC_DEFINE(FORCE_FAST_MUTEX_DISABLED, [1], + [Define to 1 if force fast mutexes disabled]) +elif test "$enable_fast_mutexes" = "yes"; then + AC_DEFINE(MY_PTHREAD_FASTMUTEX, [1], + [Define to 1 if fast mutexes enabled]) +fi + +AC_ARG_ENABLE(dtrace, + [AS_HELP_STRING([--enable-dtrace], + [Enable DTrace. [default: no]])], + [enable_dtrace=$enableval], + [enable_dtrace=no]) +if test "$enable_dtrace" = "no"; then + AC_DEFINE(DISABLE_DTRACE, [1], [Define to 1 if DTrace is disabled]) +fi + +# check Cutter with C++ support if available +REQUIRED_MINIMUM_CUTTER_VERSION=1.1.3 +m4_ifdef([AC_CHECK_CPPCUTTER], [ +AC_CHECK_CPPCUTTER(>= $REQUIRED_MINIMUM_CUTTER_VERSION) +], +[ac_cv_use_cutter="no"]) +AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"]) + +# For mroonga.github.com +AC_ARG_WITH(mroonga-github-com-path, + [AS_HELP_STRING([--with-mroonga-github-com-path=PATH], + [specify mroonga.github.com path to update mroonga.github.com.])], + [MROONGA_GITHUB_COM_PATH="$withval"], + [MROONGA_GITHUB_COM_PATH=""]) +AC_SUBST(MROONGA_GITHUB_COM_PATH) + +# For package +AC_ARG_WITH(rsync-path, + [AS_HELP_STRING([--with-rsync-path=PATH], + [specify rsync path to upload mroonga packages.])], + [RSYNC_PATH="$withval"], + [RSYNC_PATH="packages@packages.groonga.org:public"]) +AC_SUBST(RSYNC_PATH) + +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.])], + [LAUNCHPAD_UPLOADER_PGP_KEY="$withval"], + [LAUNCHPAD_UPLOADER_PGP_KEY=""]) +AC_SUBST(LAUNCHPAD_UPLOADER_PGP_KEY) + +GPG_UID=m4_include(gpg_uid) +AC_SUBST(GPG_UID) + +# For update-version +AC_ARG_WITH(cutter-source-path, + [AS_HELP_STRING([--with-cutter-source-path=PATH], + [specify Cutter source path for mroonga's release manager.])], + [CUTTER_SOURCE_PATH="$withval"]) +case "$CUTTER_SOURCE_PATH" in + ""|/*) + : # do nothing + ;; + *) + CUTTER_SOURCE_PATH="\$(top_builddir)/${CUTTER_SOURCE_PATH}" + ;; +esac +AC_SUBST(CUTTER_SOURCE_PATH) + + +# Document +AC_MSG_CHECKING([whether enable document]) +AC_ARG_ENABLE(document, + [AS_HELP_STRING([--enable-document], + [enable document generation by Sphinx. [default=auto]])], + [enable_document="$enableval"], + [enable_document="auto"]) +AC_MSG_RESULT($enable_document) + +document_available=no +document_buildable=no +have_built_document=no +if test x"$enable_document" != x"no"; then + if test -f "$srcdir/doc/build-stamp"; then + document_available=yes + have_built_document=yes + fi + + if test x"$enable_document" = x"yes"; 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([ +sphinx-build is old: $sphinx_build_version +Sphinx 1.2 or later is required.]) + fi + document_available=yes + document_buildable=yes + else + AC_MSG_ERROR([ +No sphinx-build found. +Install it and try again. + +How to install sphinx-build: + +For Debian GNU/Linux based system like Ubuntu: + % sudo apt-get install -y python-pip + % sudo pip install sphinx + +For Red Hat based system like CentOS: + % sudo yum install -y python-pip + % sudo pip install sphinx]) + fi + AC_SUBST(SPHINX_BUILD) + fi +fi + +AM_CONDITIONAL([DOCUMENT_AVAILABLE], + [test "${document_available}" = "yes"]) +AC_MSG_CHECKING([whether document available]) +AC_MSG_RESULT($document_available) + +AM_CONDITIONAL([DOCUMENT_BUILDABLE], + [test "${document_buildable}" = "yes"]) +AC_MSG_CHECKING([whether document buildable]) +AC_MSG_RESULT($document_buildable) + +AM_CONDITIONAL([HAVE_BUILT_DOCUMENT], + [test "${have_built_document}" = "yes"]) +AC_MSG_CHECKING([whether having built document]) +AC_MSG_RESULT($have_built_document) + +DOCUMENT_VERSION=mrn_version +DOCUMENT_VERSION_FULL="$DOCUMENT_VERSION" +AC_SUBST(DOCUMENT_VERSION) +AC_SUBST(DOCUMENT_VERSION_FULL) + +CFLAGS="$CFLAGS" +CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti -felide-constructors" + +AC_CONFIG_FILES([ + Makefile + build/Makefile + build/cmake_modules/Makefile + lib/Makefile + udf/Makefile + test/Makefile + test/unit/Makefile + mysql-test/Makefile + packages/Makefile + packages/rpm/Makefile + packages/rpm/centos/Makefile + packages/rpm/fedora/Makefile + packages/yum/Makefile + packages/apt/Makefile + packages/source/Makefile + packages/ubuntu/Makefile + packages/windows/Makefile + tools/Makefile + doc/Makefile + doc/locale/Makefile + doc/locale/en/Makefile + doc/locale/en/LC_MESSAGES/Makefile + doc/locale/ja/Makefile + doc/locale/ja/LC_MESSAGES/Makefile + data/Makefile +]) +AC_OUTPUT([ + config.sh + mrn_version.h + mysql-test/mroonga/storage/information_schema/r/plugins.result + mysql-test/mroonga/storage/variable/r/version.result + packages/debian/control + packages/rpm/centos/mysql55-mroonga.spec + packages/rpm/centos/mysql56-community-mroonga.spec + packages/rpm/centos/mariadb-mroonga.spec + packages/rpm/fedora/mysql-mroonga.spec + packages/rpm/fedora/mariadb-mroonga.spec + packages/yum/env.sh + data/install.sql +]) diff --git a/storage/mroonga/data/Makefile.am b/storage/mroonga/data/Makefile.am new file mode 100644 index 00000000000..c088c78c30f --- /dev/null +++ b/storage/mroonga/data/Makefile.am @@ -0,0 +1,4 @@ +sqldir = $(pkgdatadir) +dist_sql_DATA = \ + install.sql \ + uninstall.sql diff --git a/storage/mroonga/data/install.sql.in b/storage/mroonga/data/install.sql.in new file mode 100644 index 00000000000..b0c930c8144 --- /dev/null +++ b/storage/mroonga/data/install.sql.in @@ -0,0 +1,19 @@ +DELETE IGNORE FROM mysql.plugin WHERE dl = 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +INSTALL PLUGIN Mroonga SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS last_insert_grn_id; +CREATE FUNCTION last_insert_grn_id RETURNS INTEGER + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_snippet; +CREATE FUNCTION mroonga_snippet RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_command; +CREATE FUNCTION mroonga_command RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; + +DROP FUNCTION IF EXISTS mroonga_escape; +CREATE FUNCTION mroonga_escape RETURNS STRING + SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@'; diff --git a/storage/mroonga/data/uninstall.sql b/storage/mroonga/data/uninstall.sql new file mode 100644 index 00000000000..b79e6c03d18 --- /dev/null +++ b/storage/mroonga/data/uninstall.sql @@ -0,0 +1,8 @@ +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; + +UNINSTALL PLUGIN Mroonga; + +FLUSH TABLES; diff --git a/storage/mroonga/gpg_uid b/storage/mroonga/gpg_uid new file mode 100644 index 00000000000..7c1a800ba92 --- /dev/null +++ b/storage/mroonga/gpg_uid @@ -0,0 +1 @@ +45499429 diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp new file mode 100644 index 00000000000..a4a2f9417c4 --- /dev/null +++ b/storage/mroonga/ha_mroonga.cpp @@ -0,0 +1,15536 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2014 Kouhei Sutou + Copyright(C) 2013 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 +*/ + +#include "mrn_mysql.h" + +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation +#endif + +#if MYSQL_VERSION_ID >= 50500 +# include +# include +# include +# include +# include +#endif + +#include + +#ifdef MRN_HAVE_SQL_OPTIMIZER_H +# include +#endif + +#include +#include +#include +#include +#include + +#ifdef WIN32 +# include +# include +# define MRN_MKDIR(pathname, mode) _mkdir((pathname)) +# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \ + type *variable_name = (type *)_malloca(sizeof(type) * (variable_size)) +# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) _freea(variable_name) +# define MRN_TABLE_SHARE_LOCK_SHARE_PROC "?key_TABLE_SHARE_LOCK_share@@3IA" +# define MRN_TABLE_SHARE_LOCK_HA_DATA_PROC "?key_TABLE_SHARE_LOCK_ha_data@@3IA" +# ifdef _WIN64 +# define MRN_BINLOG_FILTER_PROC "?binlog_filter@@3PEAVRpl_filter@@EA" +# define MRN_MY_TZ_UTC_PROC "?my_tz_UTC@@3PEAVTime_zone@@EA" +# else +# define MRN_BINLOG_FILTER_PROC "?binlog_filter@@3PAVRpl_filter@@A" +# define MRN_MY_TZ_UTC_PROC "?my_tz_UTC@@3PAVTime_zone@@A" +# endif +#else +# include +# include +# define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode)) +# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \ + type variable_name[variable_size] +# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) +#endif + +#include "mrn_err.h" +#include "mrn_table.hpp" +#include "ha_mroonga.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +# include +#endif + +// for debug +#define MRN_CLASS_NAME "ha_mroonga" + +#define MRN_SHORT_TEXT_SIZE (1 << 12) // 4Kbytes +#define MRN_TEXT_SIZE (1 << 16) // 64Kbytes +#define MRN_LONG_TEXT_SIZE (1 << 31) // 2Gbytes + +#ifdef MRN_HAVE_TDC_LOCK_TABLE_SHARE +# define mrn_open_mutex(share) &((share)->tdc.LOCK_table_share) +# define mrn_open_mutex_lock(share) do { \ + TABLE_SHARE *share_ = share; \ + if (share_) { \ + mysql_mutex_lock(mrn_open_mutex(share_)); \ + } \ +} while (0) +# define mrn_open_mutex_unlock(share) do { \ + TABLE_SHARE *share_ = share; \ + if (share_) { \ + mysql_mutex_unlock(mrn_open_mutex(share_)); \ + } \ +} while (0) +#else +# if MYSQL_VERSION_ID >= 50500 +# ifdef DBUG_OFF +# ifndef _WIN32 +extern mysql_mutex_t LOCK_open; +# endif +# endif +static mysql_mutex_t *mrn_LOCK_open; +# define mrn_open_mutex_lock(share) mysql_mutex_lock(mrn_LOCK_open) +# define mrn_open_mutex_unlock(share) mysql_mutex_unlock(mrn_LOCK_open) +# else +# ifndef _WIN32 +extern pthread_mutex_t LOCK_open; +# endif +static pthread_mutex_t *mrn_LOCK_open; +# define mrn_open_mutex_lock(share) +# define mrn_open_mutex_unlock(share) +# endif +#endif + +#if MYSQL_VERSION_ID >= 50600 +# 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) +#else +# define MRN_ORDER_IS_ASC(order) ((order)->asc) +#endif + +#define MRN_STRINGIFY(macro_or_string) MRN_STRINGIFY_ARG(macro_or_string) +#define MRN_STRINGIFY_ARG(contents) #contents + +#define MRN_PLUGIN_NAME mroonga +#define MRN_PLUGIN_NAME_STRING "Mroonga" +#define MRN_STATUS_VARIABLE_NAME_PREFIX_STRING "Mroonga" + +#ifdef MRN_MARIADB_P +# define st_mysql_plugin st_maria_plugin +# define mrn_declare_plugin(NAME) maria_declare_plugin(NAME) +# define mrn_declare_plugin_end maria_declare_plugin_end +# define MRN_PLUGIN_LAST_VALUES MRN_VERSION, MariaDB_PLUGIN_MATURITY_STABLE +# define MRN_ABORT_ON_WARNING(thd) thd_kill_level(thd) +#else +# define mrn_declare_plugin(NAME) mysql_declare_plugin(NAME) +# define mrn_declare_plugin_end mysql_declare_plugin_end +# ifdef MRN_PLUGIN_HAVE_FLAGS +# define MRN_PLUGIN_LAST_VALUES NULL, 0 +# else +# define MRN_PLUGIN_LAST_VALUES NULL +# endif +# define MRN_ABORT_ON_WARNING(thd) thd->abort_on_warning +#endif + +#ifdef WIN32 +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE + PSI_mutex_key *mrn_table_share_lock_share; +# endif +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA + PSI_mutex_key *mrn_table_share_lock_ha_data; +# endif +#endif + +#if MYSQL_VERSION_ID >= 100007 && defined(MRN_MARIADB_P) +# define MRN_THD_GET_AUTOINC(thd, off, inc) thd_get_autoinc(thd, off, inc) +# define MRN_GET_ERR_MSG(code) my_get_err_msg(code) +#else +# define MRN_THD_GET_AUTOINC(thd, off, inc) \ + { \ + *(off) = thd->variables.auto_increment_offset; \ + *(inc) = thd->variables.auto_increment_increment; \ + } +# define MRN_GET_ERR_MSG(code) ER(code) +#endif + +Rpl_filter *mrn_binlog_filter; +Time_zone *mrn_my_tz_UTC; +#ifdef MRN_HAVE_TABLE_DEF_CACHE +HASH *mrn_table_def_cache; +#endif + +static const char *INDEX_COLUMN_NAME = "index"; +static const char *MRN_PLUGIN_AUTHOR = "The Mroonga project"; + +#ifdef __cplusplus +extern "C" { +#endif + +/* groonga's internal functions */ +const char *grn_obj_get_value_(grn_ctx *ctx, grn_obj *obj, grn_id id, uint32 *size); +int grn_atoi(const char *nptr, const char *end, const char **rest); +uint grn_atoui(const char *nptr, const char *end, const char **rest); + +/* global variables */ +static pthread_mutex_t mrn_db_mutex; +static pthread_mutex_t mrn_log_mutex; +handlerton *mrn_hton_ptr; +HASH mrn_open_tables; +pthread_mutex_t mrn_open_tables_mutex; +HASH mrn_long_term_share; +pthread_mutex_t mrn_long_term_share_mutex; + +/* internal variables */ +static grn_ctx mrn_ctx; +static grn_obj *mrn_db; +static grn_hash *mrn_hash; + +#ifdef WIN32 +static inline double round(double x) +{ + return (floor(x + 0.5)); +} +#endif + +static void mrn_init_encoding_map() +{ + mrn::encoding::init(); +} + +static int mrn_change_encoding(grn_ctx *ctx, const CHARSET_INFO *charset) +{ + int error = 0; + if (!mrn::encoding::set(ctx, charset)) { + const char *name = ""; + const char *csname = ""; + if (charset) { + name = charset->name; + csname = charset->csname; + } + error = ER_MRN_CHARSET_NOT_SUPPORT_NUM; + my_printf_error(error, + ER_MRN_CHARSET_NOT_SUPPORT_STR, + MYF(0), name, csname); + } + return error; +} + +#if !defined(DBUG_OFF) && !defined(_lint) +static const char *mrn_inspect_thr_lock_type(enum thr_lock_type lock_type) +{ + const char *inspected = ""; + switch (lock_type) { + case TL_IGNORE: + inspected = "TL_IGNORE"; + break; + case TL_UNLOCK: + inspected = "TL_UNLOCK"; + break; + case TL_READ_DEFAULT: + inspected = "TL_READ_DEFAULT"; + break; + case TL_READ: + inspected = "TL_READ"; + break; + case TL_READ_WITH_SHARED_LOCKS: + inspected = "TL_READ_WITH_SHARED_LOCKS"; + break; + case TL_READ_HIGH_PRIORITY: + inspected = "TL_READ_HIGH_PRIORITY"; + break; + case TL_READ_NO_INSERT: + inspected = "TL_READ_NO_INSERT"; + break; + case TL_WRITE_ALLOW_WRITE: + inspected = "TL_WRITE_ALLOW_WRITE"; + break; +#ifdef MRN_HAVE_TL_WRITE_ALLOW_READ + case TL_WRITE_ALLOW_READ: + inspected = "TL_WRITE_ALLOW_READ"; + break; +#endif + case TL_WRITE_CONCURRENT_INSERT: + inspected = "TL_WRITE_CONCURRENT_INSERT"; + break; + case TL_WRITE_DELAYED: + inspected = "TL_WRITE_DELAYED"; + break; + case TL_WRITE_DEFAULT: + inspected = "TL_WRITE_DEFAULT"; + break; + case TL_WRITE_LOW_PRIORITY: + inspected = "TL_WRITE_LOW_PRIORITY"; + break; + case TL_WRITE: + inspected = "TL_WRITE"; + break; + case TL_WRITE_ONLY: + inspected = "TL_WRITE_ONLY"; + break; + } + return inspected; +} + +static const char *mrn_inspect_extra_function(enum ha_extra_function operation) +{ + const char *inspected = ""; + switch (operation) { + case HA_EXTRA_NORMAL: + inspected = "HA_EXTRA_NORMAL"; + break; + case HA_EXTRA_QUICK: + inspected = "HA_EXTRA_QUICK"; + break; + case HA_EXTRA_NOT_USED: + inspected = "HA_EXTRA_NOT_USED"; + break; + case HA_EXTRA_CACHE: + inspected = "HA_EXTRA_CACHE"; + break; + case HA_EXTRA_NO_CACHE: + inspected = "HA_EXTRA_NO_CACHE"; + break; + case HA_EXTRA_NO_READCHECK: + inspected = "HA_EXTRA_NO_READCHECK"; + break; + case HA_EXTRA_READCHECK: + inspected = "HA_EXTRA_READCHECK"; + break; + case HA_EXTRA_KEYREAD: + inspected = "HA_EXTRA_KEYREAD"; + break; + case HA_EXTRA_NO_KEYREAD: + inspected = "HA_EXTRA_NO_KEYREAD"; + break; + case HA_EXTRA_NO_USER_CHANGE: + inspected = "HA_EXTRA_NO_USER_CHANGE"; + break; + case HA_EXTRA_KEY_CACHE: + inspected = "HA_EXTRA_KEY_CACHE"; + break; + case HA_EXTRA_NO_KEY_CACHE: + inspected = "HA_EXTRA_NO_KEY_CACHE"; + break; + case HA_EXTRA_WAIT_LOCK: + inspected = "HA_EXTRA_WAIT_LOCK"; + break; + case HA_EXTRA_NO_WAIT_LOCK: + inspected = "HA_EXTRA_NO_WAIT_LOCK"; + break; + case HA_EXTRA_WRITE_CACHE: + inspected = "HA_EXTRA_WRITE_CACHE"; + break; + case HA_EXTRA_FLUSH_CACHE: + inspected = "HA_EXTRA_FLUSH_CACHE"; + break; + case HA_EXTRA_NO_KEYS: + inspected = "HA_EXTRA_NO_KEYS"; + break; + case HA_EXTRA_KEYREAD_CHANGE_POS: + inspected = "HA_EXTRA_KEYREAD_CHANGE_POS"; + break; + case HA_EXTRA_REMEMBER_POS: + inspected = "HA_EXTRA_REMEMBER_POS"; + break; + case HA_EXTRA_RESTORE_POS: + inspected = "HA_EXTRA_RESTORE_POS"; + break; + case HA_EXTRA_REINIT_CACHE: + inspected = "HA_EXTRA_REINIT_CACHE"; + break; + case HA_EXTRA_FORCE_REOPEN: + inspected = "HA_EXTRA_FORCE_REOPEN"; + break; + case HA_EXTRA_FLUSH: + inspected = "HA_EXTRA_FLUSH"; + break; + case HA_EXTRA_NO_ROWS: + inspected = "HA_EXTRA_NO_ROWS"; + break; + case HA_EXTRA_RESET_STATE: + inspected = "HA_EXTRA_RESET_STATE"; + break; + case HA_EXTRA_IGNORE_DUP_KEY: + inspected = "HA_EXTRA_IGNORE_DUP_KEY"; + break; + case HA_EXTRA_NO_IGNORE_DUP_KEY: + inspected = "HA_EXTRA_NO_IGNORE_DUP_KEY"; + break; + case HA_EXTRA_PREPARE_FOR_DROP: + inspected = "HA_EXTRA_PREPARE_FOR_DROP"; + break; + case HA_EXTRA_PREPARE_FOR_UPDATE: + inspected = "HA_EXTRA_PREPARE_FOR_UPDATE"; + break; + case HA_EXTRA_PRELOAD_BUFFER_SIZE: + inspected = "HA_EXTRA_PRELOAD_BUFFER_SIZE"; + break; + case HA_EXTRA_CHANGE_KEY_TO_UNIQUE: + inspected = "HA_EXTRA_CHANGE_KEY_TO_UNIQUE"; + break; + case HA_EXTRA_CHANGE_KEY_TO_DUP: + inspected = "HA_EXTRA_CHANGE_KEY_TO_DUP"; + break; + case HA_EXTRA_KEYREAD_PRESERVE_FIELDS: + inspected = "HA_EXTRA_KEYREAD_PRESERVE_FIELDS"; + break; + case HA_EXTRA_MMAP: + inspected = "HA_EXTRA_MMAP"; + break; + case HA_EXTRA_IGNORE_NO_KEY: + inspected = "HA_EXTRA_IGNORE_NO_KEY"; + break; + case HA_EXTRA_NO_IGNORE_NO_KEY: + inspected = "HA_EXTRA_NO_IGNORE_NO_KEY"; + break; + case HA_EXTRA_MARK_AS_LOG_TABLE: + inspected = "HA_EXTRA_MARK_AS_LOG_TABLE"; + break; + case HA_EXTRA_WRITE_CAN_REPLACE: + inspected = "HA_EXTRA_WRITE_CAN_REPLACE"; + break; + case HA_EXTRA_WRITE_CANNOT_REPLACE: + inspected = "HA_EXTRA_WRITE_CANNOT_REPLACE"; + break; + case HA_EXTRA_DELETE_CANNOT_BATCH: + inspected = "HA_EXTRA_DELETE_CANNOT_BATCH"; + break; + case HA_EXTRA_UPDATE_CANNOT_BATCH: + inspected = "HA_EXTRA_UPDATE_CANNOT_BATCH"; + break; + case HA_EXTRA_INSERT_WITH_UPDATE: + inspected = "HA_EXTRA_INSERT_WITH_UPDATE"; + break; + case HA_EXTRA_PREPARE_FOR_RENAME: + inspected = "HA_EXTRA_PREPARE_FOR_RENAME"; + break; +#ifdef MRN_HAVE_HA_EXTRA_ADD_CHILDREN_LIST + case HA_EXTRA_ADD_CHILDREN_LIST: + inspected = "HA_EXTRA_ADD_CHILDREN_LIST"; + break; +#endif + case HA_EXTRA_ATTACH_CHILDREN: + inspected = "HA_EXTRA_ATTACH_CHILDREN"; + break; +#ifdef MRN_HAVE_HA_EXTRA_IS_ATTACHED_CHILDREN + case HA_EXTRA_IS_ATTACHED_CHILDREN: + inspected = "HA_EXTRA_IS_ATTACHED_CHILDREN"; + break; +#endif + case HA_EXTRA_DETACH_CHILDREN: + inspected = "HA_EXTRA_DETACH_CHILDREN"; + break; +#ifdef MRN_HAVE_HA_EXTRA_EXPORT + case HA_EXTRA_EXPORT: + inspected = "HA_EXTRA_EXPORT"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_SECONDARY_SORT_ROWID + case HA_EXTRA_SECONDARY_SORT_ROWID: + inspected = "HA_EXTRA_SECONDARY_SORT_ROWID"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_DETACH_CHILD + case HA_EXTRA_DETACH_CHILD: + inspected = "HA_EXTRA_DETACH_CHILD"; + break; +#endif +#ifdef MRN_HAVE_HA_EXTRA_PREPARE_FOR_FORCED_CLOSE + case HA_EXTRA_PREPARE_FOR_FORCED_CLOSE: + inspected = "HA_EXTRA_PREPARE_FOR_FORCED_CLOSE"; + break; +#endif + } + return inspected; +} +#endif + +static uchar *mrn_open_tables_get_key(const uchar *record, + size_t *length, + my_bool not_used __attribute__ ((unused))) +{ + MRN_DBUG_ENTER_FUNCTION(); + MRN_SHARE *share = reinterpret_cast(const_cast(record)); + *length = share->table_name_length; + DBUG_RETURN(reinterpret_cast(share->table_name)); +} + +static uchar *mrn_long_term_share_get_key(const uchar *record, + size_t *length, + my_bool not_used __attribute__ ((unused))) +{ + MRN_DBUG_ENTER_FUNCTION(); + MRN_LONG_TERM_SHARE *long_term_share = + reinterpret_cast(const_cast(record)); + *length = long_term_share->table_name_length; + DBUG_RETURN(reinterpret_cast(long_term_share->table_name)); +} + +/* status */ +static long mrn_count_skip = 0; +static long mrn_fast_order_limit = 0; + +/* logging */ +static char *mrn_log_file_path = NULL; +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; + +char *mrn_default_parser = NULL; +char *mrn_default_wrapper_engine = NULL; +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; + +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 void mrn_logger_log(grn_ctx *ctx, grn_log_level level, + const char *timestamp, const char *title, + const char *message, const char *location, + void *user_data) +{ + const char level_marks[] = " EACewnid-"; + if (mrn_log_file_opened) { + mrn::Lock lock(&mrn_log_mutex); + fprintf(mrn_log_file, + "%s|%c|%08x|%s\n", + timestamp, + level_marks[level], + static_cast((ulong)(pthread_self())), + message); + fflush(mrn_log_file); + } +} + +static grn_logger mrn_logger = { + mrn_log_level_default, + GRN_LOG_TIME|GRN_LOG_MESSAGE, + NULL, + mrn_logger_log, + NULL, + NULL +}; + +/* global hashes and mutexes */ +HASH mrn_allocated_thds; +pthread_mutex_t mrn_allocated_thds_mutex; +static uchar *mrn_allocated_thds_get_key(const uchar *record, + size_t *length, + my_bool not_used __attribute__ ((unused))) +{ + MRN_DBUG_ENTER_FUNCTION(); + *length = sizeof(THD *); + DBUG_RETURN(const_cast(record)); +} + +/* system functions */ + +static struct st_mysql_storage_engine storage_engine_structure = +{ MYSQL_HANDLERTON_INTERFACE_VERSION }; + +static struct st_mysql_show_var mrn_status_variables[] = +{ + {MRN_STATUS_VARIABLE_NAME_PREFIX_STRING "_count_skip", + (char *)&mrn_count_skip, SHOW_LONG}, + {MRN_STATUS_VARIABLE_NAME_PREFIX_STRING "_fast_order_limit", + (char *)&mrn_fast_order_limit, SHOW_LONG}, + {NullS, NullS, SHOW_LONG} +}; + +static const char *mrn_log_level_type_names[] = { "NONE", "EMERG", "ALERT", + "CRIT", "ERROR", "WARNING", + "NOTICE", "INFO", "DEBUG", + "DUMP", NullS }; +static TYPELIB mrn_log_level_typelib = +{ + array_elements(mrn_log_level_type_names)-1, + "mrn_log_level_typelib", + mrn_log_level_type_names, + NULL +}; + +static void mrn_log_level_update(THD *thd, struct st_mysql_sys_var *var, + void *var_ptr, const void *save) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulong new_value = *static_cast(save); + ulong old_value = mrn_log_level; + mrn_log_level = new_value; + mrn_logger.max_level = static_cast(mrn_log_level); + grn_logger_set(&mrn_ctx, &mrn_logger); + grn_ctx *ctx = grn_ctx_open(0); + mrn_change_encoding(ctx, system_charset_info); + GRN_LOG(ctx, GRN_LOG_NOTICE, "log level changed from '%s' to '%s'", + mrn_log_level_type_names[old_value], + mrn_log_level_type_names[new_value]); + grn_ctx_fin(ctx); + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_ENUM(log_level, mrn_log_level, + PLUGIN_VAR_RQCMDARG, + "logging level", + NULL, + mrn_log_level_update, + static_cast(mrn_log_level), + &mrn_log_level_typelib); + +static void mrn_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; + + grn_ctx ctx; + grn_ctx_init(&ctx, 0); + 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, + "log file isn't changed " + "because the requested path isn't different: <%s>", + new_value); + } else { + GRN_LOG(&ctx, GRN_LOG_NOTICE, + "log file is changed: <%s> -> <%s>", + *old_value_ptr, new_value); + + int log_file_open_errno = 0; + { + mrn::Lock lock(&mrn_log_mutex); + FILE *new_log_file; + new_log_file = fopen(new_value, "a"); + if (new_log_file) { + if (mrn_log_file_opened) { + fclose(mrn_log_file); + } + mrn_log_file = new_log_file; + mrn_log_file_opened = true; + } else { + log_file_open_errno = errno; + } + } + + if (log_file_open_errno == 0) { + 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, + "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, + "log file can't be opened: <%s>: <%s>", + new_value, strerror(log_file_open_errno)); + } + } + } + +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + char *old_log_file_name = *old_value_ptr; + *old_value_ptr = my_strdup(new_log_file_name, MYF(MY_WME)); + my_free(old_log_file_name, MYF(0)); +#else + *old_value_ptr = my_strdup(new_log_file_name, MYF(MY_WME)); +#endif + + grn_ctx_fin(&ctx); + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_STR(log_file, mrn_log_file_path, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "log file for " MRN_PLUGIN_NAME_STRING, + NULL, + mrn_log_file_update, + MRN_LOG_FILE_PATH); + +static void mrn_default_parser_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_init(&ctx, 0); + mrn_change_encoding(&ctx, system_charset_info); + if (strcmp(*old_value_ptr, new_value) == 0) { + GRN_LOG(&ctx, GRN_LOG_NOTICE, + "default parser isn't changed " + "because the requested default parser isn't different: <%s>", + new_value); + } else { + GRN_LOG(&ctx, GRN_LOG_NOTICE, + "default fulltext parser is changed: <%s> -> <%s>", + *old_value_ptr, new_value); + } + +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + my_free(*old_value_ptr, MYF(0)); + *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); +#else + *old_value_ptr = (char *)new_value; +#endif + + grn_ctx_fin(&ctx); + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_STR(default_parser, mrn_default_parser, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "default fulltext parser", + NULL, + mrn_default_parser_update, + MRN_PARSER_DEFAULT); + +static MYSQL_THDVAR_BOOL( + dry_write, /* name */ + PLUGIN_VAR_OPCMDARG, /* options */ + "If dry_write is true, any write operations are ignored.", /* comment */ + NULL, /* check */ + NULL, /* update */ + false /* default */ +); + +static MYSQL_THDVAR_BOOL( + enable_optimization, /* name */ + PLUGIN_VAR_OPCMDARG, /* options */ + "If enable_optimization is true, some optimizations will be applied.", /* comment */ + NULL, /* check */ + NULL, /* update */ + true /* default */ +); + +static MYSQL_THDVAR_LONGLONG(match_escalation_threshold, + PLUGIN_VAR_RQCMDARG, + "The threshold to determin whether search method is escalated", + NULL, + NULL, + grn_get_default_match_escalation_threshold(), + -1, + LONGLONG_MAX, + 0); + +static void mrn_vector_column_delimiter_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; + +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + my_free(*old_value_ptr, MYF(0)); + *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); +#else + *old_value_ptr = (char *)new_value; +#endif + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_STR(vector_column_delimiter, mrn_vector_column_delimiter, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "The vector column delimiter", + NULL, + &mrn_vector_column_delimiter_update, + " "); + +static void mrn_database_path_prefix_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; +#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + if (*old_value_ptr) + my_free(*old_value_ptr, MYF(0)); + if (new_value) + *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); + else + *old_value_ptr = NULL; +#else + *old_value_ptr = (char *)new_value; +#endif + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_STR(database_path_prefix, + mrn::PathMapper::default_path_prefix, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "The database path prefix", + NULL, + &mrn_database_path_prefix_update, + NULL); + +static MYSQL_SYSVAR_STR(default_wrapper_engine, mrn_default_wrapper_engine, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "The default engine for wrapper mode", + NULL, + NULL, + NULL); + +static TYPELIB mrn_action_on_error_typelib = +{ + array_elements(mrn_action_on_error_names) - 1, + "mrn_action_on_error_typelib", + mrn_action_on_error_names, + NULL +}; + +static MYSQL_THDVAR_ENUM(action_on_fulltext_query_error, + PLUGIN_VAR_RQCMDARG, + "action on fulltext query error", + NULL, + NULL, + mrn_action_on_fulltext_query_error_default, + &mrn_action_on_error_typelib); + +static void mrn_lock_timeout_update(THD *thd, struct st_mysql_sys_var *var, + void *var_ptr, const void *save) +{ + MRN_DBUG_ENTER_FUNCTION(); + const int new_value = *static_cast(save); + int *old_value_ptr = static_cast(var_ptr); + + *old_value_ptr = new_value; + grn_set_lock_timeout(new_value); + + DBUG_VOID_RETURN; +} + +static MYSQL_SYSVAR_INT(lock_timeout, + mrn_lock_timeout, + PLUGIN_VAR_RQCMDARG, + "lock timeout used in Groonga", + NULL, + mrn_lock_timeout_update, + grn_get_lock_timeout(), + -1, + INT_MAX, + 1); + +static MYSQL_SYSVAR_STR(libgroonga_version, mrn_libgroonga_version, + PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY, + "The version of libgroonga", + NULL, + NULL, + grn_get_version()); + +static MYSQL_SYSVAR_STR(version, mrn_version, + PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY, + "The version of mroonga", + NULL, + NULL, + MRN_VERSION); + +static struct st_mysql_sys_var *mrn_system_variables[] = +{ + MYSQL_SYSVAR(log_level), + MYSQL_SYSVAR(log_file), + MYSQL_SYSVAR(default_parser), + MYSQL_SYSVAR(dry_write), + MYSQL_SYSVAR(enable_optimization), + MYSQL_SYSVAR(match_escalation_threshold), + MYSQL_SYSVAR(database_path_prefix), + MYSQL_SYSVAR(default_wrapper_engine), + MYSQL_SYSVAR(action_on_fulltext_query_error), + MYSQL_SYSVAR(lock_timeout), + MYSQL_SYSVAR(libgroonga_version), + MYSQL_SYSVAR(version), + MYSQL_SYSVAR(vector_column_delimiter), + NULL +}; + +/* mroonga information schema */ +static struct st_mysql_information_schema i_s_info = +{ + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION +}; + +static ST_FIELD_INFO i_s_mrn_stats_fields_info[] = +{ + { + "VERSION", + 40, + MYSQL_TYPE_STRING, + 0, + 0, + "", + SKIP_OPEN_TABLE + }, + { + "rows_written", + MY_INT32_NUM_DECIMAL_DIGITS, + MYSQL_TYPE_LONG, + 0, + 0, + "Rows written to groonga", + SKIP_OPEN_TABLE + }, + { + "rows_read", + MY_INT32_NUM_DECIMAL_DIGITS, + MYSQL_TYPE_LONG, + 0, + 0, + "Rows read from groonga", + SKIP_OPEN_TABLE + } +}; + +static int i_s_mrn_stats_deinit(void* p) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(0); +} + +static int i_s_mrn_stats_fill( + THD* thd, TABLE_LIST* tables, Item* cond) +{ + TABLE* table = (TABLE *) tables->table; + int status = 0; + MRN_DBUG_ENTER_FUNCTION(); + table->field[0]->store(grn_get_version(), strlen(grn_get_version()), + system_charset_info); + table->field[0]->set_notnull(); + table->field[1]->store(1); /* TODO */ + table->field[2]->store(2); /* TODO */ + if (schema_table_store_record(thd, table)) { + status = 1; + } + DBUG_RETURN(status); +} + +static int i_s_mrn_stats_init(void* p) +{ + MRN_DBUG_ENTER_FUNCTION(); + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p; + schema->fields_info = i_s_mrn_stats_fields_info; + schema->fill_table = i_s_mrn_stats_fill; + DBUG_RETURN(0); +} + +struct st_mysql_plugin i_s_mrn_stats = +{ + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &i_s_info, + MRN_STATUS_VARIABLE_NAME_PREFIX_STRING "_stats", + MRN_PLUGIN_AUTHOR, + "Statistics for " MRN_PLUGIN_NAME_STRING, + PLUGIN_LICENSE_GPL, + i_s_mrn_stats_init, + i_s_mrn_stats_deinit, + MRN_VERSION_IN_HEX, + NULL, + NULL, + MRN_PLUGIN_LAST_VALUES +}; +/* End of mroonga information schema implementations */ + +static handler *mrn_handler_create(handlerton *hton, TABLE_SHARE *share, MEM_ROOT *root) +{ + MRN_DBUG_ENTER_FUNCTION(); + handler *new_handler = new (root) ha_mroonga(hton, share); + DBUG_RETURN(new_handler); +} + +static void mrn_drop_db(const char *path) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn::PathMapper mapper(path); + mrn::Lock lock(&mrn_db_mutex); + grn_obj *db = NULL; + if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) { + struct stat dummy; + if (stat(mapper.db_path(), &dummy) == 0) { + db = grn_db_open(&mrn_ctx, mapper.db_path()); + } + } + if (db) { + if (grn_obj_remove(&mrn_ctx, db)) { + GRN_LOG(&mrn_ctx, GRN_LOG_ERROR, + "cannot drop database (%s)", mapper.db_path()); + } + } + mrn_hash_remove(&mrn_ctx, mrn_hash, mapper.db_name()); + DBUG_VOID_RETURN; +} + +static void mrn_drop_database(handlerton *hton, char *path) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn_drop_db(path); + DBUG_VOID_RETURN; +} + +static int mrn_close_connection(handlerton *hton, THD *thd) +{ + MRN_DBUG_ENTER_FUNCTION(); + void *p = *thd_ha_data(thd, mrn_hton_ptr); + if (p) { + mrn_clear_alter_share(thd); + free(p); + *thd_ha_data(thd, mrn_hton_ptr) = (void *) NULL; + { + mrn::Lock lock(&mrn_allocated_thds_mutex); + my_hash_delete(&mrn_allocated_thds, (uchar*) thd); + } + } + DBUG_RETURN(0); +} + +static bool mrn_flush_logs(handlerton *hton) +{ + MRN_DBUG_ENTER_FUNCTION(); + bool result = 0; + if (mrn_log_file_opened) { + mrn::Lock lock(&mrn_log_mutex); + fclose(mrn_log_file); + mrn_log_file = fopen(mrn_log_file_path, "a"); + } + DBUG_RETURN(result); +} + +static grn_builtin_type mrn_grn_type_from_field(grn_ctx *ctx, Field *field, + bool for_index_key) +{ + grn_builtin_type type = GRN_DB_VOID; + enum_field_types mysql_field_type = field->real_type(); + switch (mysql_field_type) { + case MYSQL_TYPE_DECIMAL: // DECIMAL; <= 65bytes + type = GRN_DB_SHORT_TEXT; // 4Kbytes + break; + case MYSQL_TYPE_TINY: // TINYINT; 1byte + if (static_cast(field)->unsigned_flag) { + type = GRN_DB_UINT8; // 1byte + } else { + type = GRN_DB_INT8; // 1byte + } + break; + case MYSQL_TYPE_SHORT: // SMALLINT; 2bytes + if (static_cast(field)->unsigned_flag) { + type = GRN_DB_UINT16; // 2bytes + } else { + type = GRN_DB_INT16; // 2bytes + } + break; + case MYSQL_TYPE_LONG: // INT; 4bytes + if (static_cast(field)->unsigned_flag) { + type = GRN_DB_UINT32; // 4bytes + } else { + type = GRN_DB_INT32; // 4bytes + } + break; + case MYSQL_TYPE_FLOAT: // FLOAT; 4 or 8bytes + case MYSQL_TYPE_DOUBLE: // DOUBLE; 8bytes + type = GRN_DB_FLOAT; // 8bytes + break; + case MYSQL_TYPE_NULL: // NULL; 1byte + type = GRN_DB_INT8; // 1byte + break; + case MYSQL_TYPE_TIMESTAMP: // TIMESTAMP; 4bytes + type = GRN_DB_TIME; // 8bytes + break; + case MYSQL_TYPE_LONGLONG: // BIGINT; 8bytes + if (static_cast(field)->unsigned_flag) { + type = GRN_DB_UINT64; // 8bytes + } else { + type = GRN_DB_INT64; // 8bytes + } + break; + case MYSQL_TYPE_INT24: // MEDIUMINT; 3bytes + if (static_cast(field)->unsigned_flag) { + type = GRN_DB_UINT32; // 4bytes + } else { + type = GRN_DB_INT32; // 4bytes + } + break; + case MYSQL_TYPE_DATE: // DATE; 4bytes + case MYSQL_TYPE_TIME: // TIME; 3bytes + case MYSQL_TYPE_DATETIME: // DATETIME; 8bytes + case MYSQL_TYPE_YEAR: // YEAR; 1byte + case MYSQL_TYPE_NEWDATE: // DATE; 3bytes + type = GRN_DB_TIME; // 8bytes + break; + case MYSQL_TYPE_VARCHAR: // VARCHAR; <= 64KB * 4 + 2bytes + if (for_index_key) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else { + if (field->field_length <= MRN_SHORT_TEXT_SIZE) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else if (field->field_length <= MRN_TEXT_SIZE) { + type = GRN_DB_TEXT; // 64Kbytes + } else { + type = GRN_DB_LONG_TEXT; // 2Gbytes + } + } + break; + case MYSQL_TYPE_BIT: // BIT; <= 8bytes + type = GRN_DB_INT64; // 8bytes + break; +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: // TIMESTAMP; 4bytes + type = GRN_DB_TIME; // 8bytes + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: // DATETIME; 8bytes + type = GRN_DB_TIME; // 8bytes + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: // TIME(FSP); 3 + (FSP + 1) / 2 bytes + // 0 <= FSP <= 6; 3-6bytes + type = GRN_DB_TIME; // 8bytes + break; +#endif + case MYSQL_TYPE_NEWDECIMAL: // DECIMAL; <= 9bytes + type = GRN_DB_SHORT_TEXT; // 4Kbytes + break; + case MYSQL_TYPE_ENUM: // ENUM; <= 2bytes + if (field->pack_length() == 1) { + type = GRN_DB_UINT8; // 1bytes + } else { + type = GRN_DB_UINT16; // 2bytes + } + break; + case MYSQL_TYPE_SET: // SET; <= 8bytes + switch (field->pack_length()) { + case 1: + type = GRN_DB_UINT8; // 1byte + break; + case 2: + type = GRN_DB_UINT16; // 2bytes + break; + case 3: + case 4: + type = GRN_DB_UINT32; // 3bytes + break; + case 8: + default: + type = GRN_DB_UINT64; // 8bytes + break; + } + break; + case MYSQL_TYPE_TINY_BLOB: // TINYBLOB; <= 256bytes + 1byte + type = GRN_DB_SHORT_TEXT; // 4Kbytes + break; + case MYSQL_TYPE_MEDIUM_BLOB: // MEDIUMBLOB; <= 16Mbytes + 3bytes + if (for_index_key) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else { + type = GRN_DB_LONG_TEXT; // 2Gbytes + } + break; + case MYSQL_TYPE_LONG_BLOB: // LONGBLOB; <= 4Gbytes + 4bytes + if (for_index_key) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else { + type = GRN_DB_LONG_TEXT; // 2Gbytes + } + break; + case MYSQL_TYPE_BLOB: // BLOB; <= 64Kbytes + 2bytes + if (for_index_key) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else { + type = GRN_DB_LONG_TEXT; // 2Gbytes + } + break; + case MYSQL_TYPE_VAR_STRING: // VARCHAR; <= 255byte * 4 + 1bytes + if (for_index_key) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else { + if (field->field_length <= MRN_SHORT_TEXT_SIZE) { + type = GRN_DB_SHORT_TEXT; // 4Kbytes + } else if (field->field_length <= MRN_TEXT_SIZE) { + type = GRN_DB_TEXT; // 64Kbytes + } else { + type = GRN_DB_LONG_TEXT; // 2Gbytes + } + } + break; + case MYSQL_TYPE_STRING: // CHAR; < 1Kbytes =~ (255 * 4)bytes + // 4 is the maximum size of a character + type = GRN_DB_SHORT_TEXT; // 4Kbytes + break; + case MYSQL_TYPE_GEOMETRY: // case-by-case + type = GRN_DB_WGS84_GEO_POINT; // 8bytes + break; + } + return type; +} + +#ifdef HAVE_SPATIAL +static int mrn_set_geometry(grn_ctx *ctx, grn_obj *buf, + const char *wkb, uint wkb_size) +{ + int error = 0; + Geometry_buffer buffer; + Geometry *geometry; + + geometry = Geometry::construct(&buffer, wkb, wkb_size); + if (!geometry) { + return ER_CANT_CREATE_GEOMETRY_OBJECT; + } + switch (geometry->get_class_info()->m_type_id) { + case Geometry::wkb_point: + { + Gis_point *point = (Gis_point *)geometry; + double latitude = 0.0, longitude = 0.0; +#ifdef MRN_HAVE_POINT_XY + point_xy xy(0.0, 0.0); + point->get_xy(&xy); + longitude = xy.x; + latitude = xy.y; +#else + point->get_xy(&longitude, &latitude); +#endif + grn_obj_reinit(ctx, buf, GRN_DB_WGS84_GEO_POINT, 0); + GRN_GEO_POINT_SET(ctx, buf, + GRN_GEO_DEGREE2MSEC(latitude), + GRN_GEO_DEGREE2MSEC(longitude)); + break; + } + default: + my_printf_error(ER_MRN_GEOMETRY_NOT_SUPPORT_NUM, + ER_MRN_GEOMETRY_NOT_SUPPORT_STR, MYF(0)); + error = ER_MRN_GEOMETRY_NOT_SUPPORT_NUM; + break; + } + delete geometry; + + return error; +} +#endif + +static uint mrn_alter_table_flags(uint flags) { + uint alter_flags = 0; +#ifdef HA_INPLACE_ADD_INDEX_NO_READ_WRITE + bool is_inplace_index_change; +# ifdef MRN_HAVE_ALTER_INFO + is_inplace_index_change = (((flags & Alter_info::ALTER_ADD_INDEX) && + (flags & Alter_info::ALTER_DROP_INDEX)) || + (flags & Alter_info::ALTER_CHANGE_COLUMN)); +# else + is_inplace_index_change = (((flags & ALTER_ADD_INDEX) && + (flags & ALTER_DROP_INDEX)) || + (flags & ALTER_CHANGE_COLUMN)); +# endif + if (!is_inplace_index_change) { + alter_flags |= + HA_INPLACE_ADD_INDEX_NO_READ_WRITE | + HA_INPLACE_DROP_INDEX_NO_READ_WRITE | + HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE | + HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE | + HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE | + HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE | + HA_INPLACE_ADD_INDEX_NO_WRITE | + HA_INPLACE_DROP_INDEX_NO_WRITE | + HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE | + HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE | + HA_INPLACE_ADD_PK_INDEX_NO_WRITE | + HA_INPLACE_DROP_PK_INDEX_NO_WRITE; + } +#endif + return alter_flags; +} + +static int mrn_init(void *p) +{ + // init handlerton + grn_ctx *ctx = NULL; + handlerton *hton; + hton = (handlerton *)p; + hton->state = SHOW_OPTION_YES; + hton->create = mrn_handler_create; + hton->flags = HTON_NO_PARTITION; + hton->drop_database = mrn_drop_database; + hton->close_connection = mrn_close_connection; + hton->flush_logs = mrn_flush_logs; + hton->alter_table_flags = mrn_alter_table_flags; + mrn_hton_ptr = hton; + +#ifdef _WIN32 + HMODULE current_module = GetModuleHandle(NULL); + mrn_binlog_filter = + *((Rpl_filter **)GetProcAddress(current_module, MRN_BINLOG_FILTER_PROC)); + mrn_my_tz_UTC = + *((Time_zone **)GetProcAddress(current_module, MRN_MY_TZ_UTC_PROC)); +# ifdef MRN_HAVE_TABLE_DEF_CACHE + mrn_table_def_cache = (HASH *)GetProcAddress(current_module, + "?table_def_cache@@3Ust_hash@@A"); +# endif +# ifndef MRN_HAVE_TDC_LOCK_TABLE_SHARE + mrn_LOCK_open = +# if MYSQL_VERSION_ID >= 50500 + (mysql_mutex_t *)GetProcAddress(current_module, + "?LOCK_open@@3Ust_mysql_mutex@@A"); +# else + (pthread_mutex_t *)GetProcAddress(current_module, + "?LOCK_open@@3U_RTL_CRITICAL_SECTION@@A"); +# endif +# endif +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE + mrn_table_share_lock_share = + (PSI_mutex_key *)GetProcAddress(current_module, MRN_TABLE_SHARE_LOCK_SHARE_PROC); +# endif +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA + mrn_table_share_lock_ha_data = + (PSI_mutex_key *)GetProcAddress(current_module, MRN_TABLE_SHARE_LOCK_HA_DATA_PROC); +# endif +#else + mrn_binlog_filter = binlog_filter; + mrn_my_tz_UTC = my_tz_UTC; +# ifdef MRN_HAVE_TABLE_DEF_CACHE + mrn_table_def_cache = &table_def_cache; +# endif +# ifndef MRN_HAVE_TDC_LOCK_TABLE_SHARE + mrn_LOCK_open = &LOCK_open; +# endif +#endif + + // init groonga + if (grn_init() != GRN_SUCCESS) { + goto err_grn_init; + } + + grn_set_lock_timeout(mrn_lock_timeout); + + mrn_init_encoding_map(); + + grn_ctx_init(&mrn_ctx, 0); + ctx = &mrn_ctx; + if (mrn_change_encoding(ctx, system_charset_info)) + goto err_mrn_change_encoding; + + if (pthread_mutex_init(&mrn_log_mutex, NULL) != 0) { + goto err_log_mutex_init; + } + + mrn_logger.max_level = static_cast(mrn_log_level); + grn_logger_set(ctx, &mrn_logger); + if (!(mrn_log_file = fopen(mrn_log_file_path, "a"))) { + goto err_log_file_open; + } + mrn_log_file_opened = true; + GRN_LOG(ctx, GRN_LOG_NOTICE, "%s started.", MRN_PACKAGE_STRING); + GRN_LOG(ctx, GRN_LOG_NOTICE, "log level is '%s'", + mrn_log_level_type_names[mrn_log_level]); + + // init meta-info database + if (!(mrn_db = grn_db_create(ctx, NULL, NULL))) { + GRN_LOG(ctx, GRN_LOG_ERROR, "cannot create system database, exiting"); + goto err_db_create; + } + grn_ctx_use(ctx, mrn_db); + + // init hash + if (!(mrn_hash = grn_hash_create(ctx, NULL, + MRN_MAX_KEY_SIZE, sizeof(grn_obj *), + GRN_OBJ_KEY_VAR_SIZE))) { + GRN_LOG(ctx, GRN_LOG_ERROR, "cannot init hash, exiting"); + goto err_hash_create; + } + + // init lock + if ((pthread_mutex_init(&mrn_db_mutex, NULL) != 0)) { + goto err_db_mutex_init; + } + if ((pthread_mutex_init(&mrn_allocated_thds_mutex, NULL) != 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)) { + goto error_allocated_thds_hash_init; + } + if ((pthread_mutex_init(&mrn_open_tables_mutex, NULL) != 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)) { + goto error_allocated_open_tables_hash_init; + } + if ((pthread_mutex_init(&mrn_long_term_share_mutex, NULL) != 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)) { + goto error_allocated_long_term_share_hash_init; + } + +#ifdef MRN_USE_MYSQL_DATA_HOME + mrn::PathMapper::default_mysql_data_home_path = mysql_data_home; +#endif + + return 0; + +error_allocated_long_term_share_hash_init: + pthread_mutex_destroy(&mrn_long_term_share_mutex); +error_allocated_long_term_share_mutex_init: + my_hash_free(&mrn_open_tables); +error_allocated_open_tables_hash_init: + pthread_mutex_destroy(&mrn_open_tables_mutex); +err_allocated_open_tables_mutex_init: + my_hash_free(&mrn_allocated_thds); +error_allocated_thds_hash_init: + pthread_mutex_destroy(&mrn_allocated_thds_mutex); +err_allocated_thds_mutex_init: + pthread_mutex_destroy(&mrn_db_mutex); +err_db_mutex_init: + grn_hash_close(ctx, mrn_hash); +err_hash_create: + grn_obj_unlink(ctx, mrn_db); +err_db_create: + if (mrn_log_file_opened) { + fclose(mrn_log_file); + mrn_log_file_opened = false; + } +err_log_file_open: + pthread_mutex_destroy(&mrn_log_mutex); +err_log_mutex_init: +err_mrn_change_encoding: + grn_ctx_fin(ctx); + grn_fin(); +err_grn_init: + return -1; +} + +static int mrn_deinit(void *p) +{ + THD *thd = current_thd, *tmp_thd; + grn_ctx *ctx = &mrn_ctx; + void *value; + MRN_LONG_TERM_SHARE *long_term_share; + + GRN_LOG(ctx, GRN_LOG_NOTICE, "%s deinit", MRN_PACKAGE_STRING); + + if (thd && thd_sql_command(thd) == SQLCOM_UNINSTALL_PLUGIN) { + mrn::Lock lock(&mrn_allocated_thds_mutex); + while ((tmp_thd = (THD *) my_hash_element(&mrn_allocated_thds, 0))) + { + mrn_clear_alter_share(tmp_thd); + void *slot_ptr = mrn_get_slot_data(tmp_thd, false); + if (slot_ptr) free(slot_ptr); + *thd_ha_data(tmp_thd, mrn_hton_ptr) = (void *) NULL; + my_hash_delete(&mrn_allocated_thds, (uchar *) tmp_thd); + } + } + + { + mrn::Lock lock(&mrn_open_tables_mutex); + while ((long_term_share = (MRN_LONG_TERM_SHARE *) + my_hash_element(&mrn_long_term_share, 0))) + { + mrn_free_long_term_share(long_term_share); + } + } + + my_hash_free(&mrn_long_term_share); + pthread_mutex_destroy(&mrn_long_term_share_mutex); + my_hash_free(&mrn_open_tables); + pthread_mutex_destroy(&mrn_open_tables_mutex); + my_hash_free(&mrn_allocated_thds); + pthread_mutex_destroy(&mrn_allocated_thds_mutex); + pthread_mutex_destroy(&mrn_db_mutex); + GRN_HASH_EACH(ctx, mrn_hash, id, NULL, 0, &value, { + grn_obj *db; + memcpy(&db, value, sizeof(grn_obj *)); + grn_obj_unlink(ctx, db); + }); + grn_hash_close(ctx, mrn_hash); + grn_obj_unlink(ctx, mrn_db); + + grn_ctx_fin(ctx); + grn_fin(); + + if (mrn_log_file_opened) { + fclose(mrn_log_file); + mrn_log_file_opened = false; + } + pthread_mutex_destroy(&mrn_log_mutex); + + return 0; +} + +mrn_declare_plugin(MRN_PLUGIN_NAME) +{ + MYSQL_STORAGE_ENGINE_PLUGIN, + &storage_engine_structure, + MRN_PLUGIN_NAME_STRING, + MRN_PLUGIN_AUTHOR, + "CJK-ready fulltext search, column store", + PLUGIN_LICENSE_GPL, + mrn_init, + mrn_deinit, + MRN_VERSION_IN_HEX, + mrn_status_variables, + mrn_system_variables, + MRN_PLUGIN_LAST_VALUES +}, +i_s_mrn_stats +mrn_declare_plugin_end; + +static void mrn_generic_ft_clear(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + if (!info->ctx) { + DBUG_VOID_RETURN; + } + + if (info->cursor) { + grn_obj_unlink(info->ctx, info->cursor); + } + if (info->id_accessor) { + grn_obj_unlink(info->ctx, info->id_accessor); + } + if (info->key_accessor) { + grn_obj_unlink(info->ctx, info->key_accessor); + } + grn_obj_unlink(info->ctx, info->result); + grn_obj_unlink(info->ctx, info->score_column); + grn_obj_unlink(info->ctx, &(info->key)); + grn_obj_unlink(info->ctx, &(info->score)); + + info->ctx = NULL; + + DBUG_VOID_RETURN; +} + +static void mrn_generic_ft_close_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + mrn_generic_ft_clear(handler); + delete info; + DBUG_VOID_RETURN; +} + +static int mrn_wrapper_ft_read_next(FT_INFO *handler, char *record) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(HA_ERR_END_OF_FILE); +} + +static float mrn_wrapper_ft_find_relevance(FT_INFO *handler, uchar *record, + uint length) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + float score = 0.0; + grn_id record_id; + + mrn_change_encoding(info->ctx, NULL); + key_copy((uchar *)(GRN_TEXT_VALUE(&(info->key))), record, + info->primary_key_info, info->primary_key_info->key_length); + record_id = grn_table_get(info->ctx, + info->table, + GRN_TEXT_VALUE(&(info->key)), + GRN_TEXT_LEN(&(info->key))); + + if (record_id != GRN_ID_NIL) { + grn_id result_record_id; + result_record_id = grn_table_get(info->ctx, info->result, + &record_id, sizeof(grn_id)); + if (result_record_id != GRN_ID_NIL) { + GRN_BULK_REWIND(&(info->score)); + grn_obj_get_value(info->ctx, info->score_column, + result_record_id, &(info->score)); + score = (float)GRN_INT32_VALUE(&(info->score)); + } + } + + DBUG_PRINT("info", + ("mroonga: record_id=%d score=%g", record_id, score)); + + DBUG_RETURN(score); +} + +static void mrn_wrapper_ft_close_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn_generic_ft_close_search(handler); + DBUG_VOID_RETURN; +} + +static float mrn_wrapper_ft_get_relevance(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + float score = 0.0; + grn_id record_id; + ha_mroonga *mroonga = info->mroonga; + mrn_change_encoding(info->ctx, NULL); + record_id = grn_table_get(info->ctx, + info->table, + GRN_TEXT_VALUE(&(mroonga->key_buffer)), + GRN_TEXT_LEN(&(mroonga->key_buffer))); + + if (record_id != GRN_ID_NIL) { + grn_id result_record_id; + result_record_id = grn_table_get(info->ctx, info->result, + &record_id, sizeof(grn_id)); + if (result_record_id != GRN_ID_NIL) { + GRN_BULK_REWIND(&(info->score)); + grn_obj_get_value(info->ctx, info->score_column, + result_record_id, &(info->score)); + score = (float)GRN_INT32_VALUE(&(info->score)); + } + } + + DBUG_PRINT("info", + ("mroonga: record_id=%d score=%g", record_id, score)); + + DBUG_RETURN(score); +} + +static void mrn_wrapper_ft_reinit_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_VOID_RETURN; +} + +static _ft_vft mrn_wrapper_ft_vft = { + mrn_wrapper_ft_read_next, + mrn_wrapper_ft_find_relevance, + mrn_wrapper_ft_close_search, + mrn_wrapper_ft_get_relevance, + mrn_wrapper_ft_reinit_search +}; + +static int mrn_storage_ft_read_next(FT_INFO *handler, char *record) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(HA_ERR_END_OF_FILE); +} + +static float mrn_storage_ft_find_relevance(FT_INFO *handler, uchar *record, + uint length) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + ha_mroonga *mroonga = info->mroonga; + mrn_change_encoding(info->ctx, NULL); + + float score = 0.0; + if (mroonga->record_id != GRN_ID_NIL) { + grn_id result_record_id; + result_record_id = grn_table_get(info->ctx, info->result, + &(mroonga->record_id), sizeof(grn_id)); + if (result_record_id != GRN_ID_NIL) { + GRN_BULK_REWIND(&(info->score)); + grn_obj_get_value(info->ctx, info->score_column, + result_record_id, &(info->score)); + score = (float)GRN_INT32_VALUE(&(info->score)); + } + } + DBUG_PRINT("info", ("mroonga: record_id=%d score=%g", + mroonga->record_id, score)); + + DBUG_RETURN(score); +} + +static void mrn_storage_ft_close_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn_generic_ft_close_search(handler); + DBUG_VOID_RETURN; +} + +static float mrn_storage_ft_get_relevance(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + ha_mroonga *mroonga = info->mroonga; + mrn_change_encoding(info->ctx, NULL); + + float score = 0.0; + if (mroonga->record_id != GRN_ID_NIL) { + grn_id result_record_id; + result_record_id = grn_table_get(info->ctx, info->result, + &(mroonga->record_id), sizeof(grn_id)); + if (result_record_id != GRN_ID_NIL) { + GRN_BULK_REWIND(&(info->score)); + grn_obj_get_value(info->ctx, info->score_column, + result_record_id, &(info->score)); + score = (float)GRN_INT32_VALUE(&(info->score)); + } + } + DBUG_PRINT("info", + ("mroonga: record_id=%d score=%g", mroonga->record_id, score)); + + DBUG_RETURN(score); +} + +static void mrn_storage_ft_reinit_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_VOID_RETURN; +} + +static _ft_vft mrn_storage_ft_vft = { + mrn_storage_ft_read_next, + mrn_storage_ft_find_relevance, + mrn_storage_ft_close_search, + mrn_storage_ft_get_relevance, + mrn_storage_ft_reinit_search +}; + +static int mrn_no_such_key_ft_read_next(FT_INFO *handler, char *record) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(HA_ERR_END_OF_FILE); +} + +static float mrn_no_such_key_ft_find_relevance(FT_INFO *handler, uchar *record, + uint length) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(0.0); +} + +static void mrn_no_such_key_ft_close_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = (st_mrn_ft_info *)handler; + delete info; + DBUG_VOID_RETURN; +} + +static float mrn_no_such_key_ft_get_relevance(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_RETURN(0.0); +} + +static void mrn_no_such_key_ft_reinit_search(FT_INFO *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + DBUG_VOID_RETURN; +} + +static _ft_vft mrn_no_such_key_ft_vft = { + mrn_no_such_key_ft_read_next, + mrn_no_such_key_ft_find_relevance, + mrn_no_such_key_ft_close_search, + mrn_no_such_key_ft_get_relevance, + mrn_no_such_key_ft_reinit_search +}; + +#ifdef HA_CAN_FULLTEXT_EXT +static uint mrn_generic_ft_get_version() +{ + MRN_DBUG_ENTER_FUNCTION(); + // This value is not used in MySQL 5.6.7-rc. So it is + // meaningless. It may be used in the future... + uint version = 1; + DBUG_RETURN(version); +} + +static ulonglong mrn_generic_ft_ext_get_flags() +{ + MRN_DBUG_ENTER_FUNCTION(); + // TODO: Should we support FTS_ORDERED_RESULT? + // TODO: Shuold we support FTS_DOCID_IN_RESULT? + ulonglong flags = 0; + DBUG_RETURN(flags); +} + +// This function is used if we enable FTS_DOCID_IN_RESULT flag and the +// table has "FTS_DOC_ID" (defined as FTS_DOC_ID_COL_NAME macro) +// special name column. Should we support "FTS_DOC_ID" special name +// column? +// See also sql/sql_optimizer.cc:JOIN::optimize_fts_query(). +static ulonglong mrn_generic_ft_ext_get_docid(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong id = GRN_ID_NIL; + DBUG_RETURN(id); +} + +static ulonglong mrn_generic_ft_ext_count_matches(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_ft_info *info = reinterpret_cast(handler); + ulonglong n_records = grn_table_size(info->ctx, info->result); + DBUG_RETURN(n_records); +} + +static uint mrn_wrapper_ft_ext_get_version() +{ + MRN_DBUG_ENTER_FUNCTION(); + uint version = mrn_generic_ft_get_version(); + DBUG_RETURN(version); +} + +static ulonglong mrn_wrapper_ft_ext_get_flags() +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong flags = mrn_generic_ft_ext_get_flags(); + DBUG_RETURN(flags); +} + +static ulonglong mrn_wrapper_ft_ext_get_docid(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong id = mrn_generic_ft_ext_get_docid(handler); + DBUG_RETURN(id); +} + +static ulonglong mrn_wrapper_ft_ext_count_matches(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong n_records = mrn_generic_ft_ext_count_matches(handler); + DBUG_RETURN(n_records); +} + +static _ft_vft_ext mrn_wrapper_ft_vft_ext = { + mrn_wrapper_ft_ext_get_version, + mrn_wrapper_ft_ext_get_flags, + mrn_wrapper_ft_ext_get_docid, + mrn_wrapper_ft_ext_count_matches +}; + +static uint mrn_storage_ft_ext_get_version() +{ + MRN_DBUG_ENTER_FUNCTION(); + uint version = mrn_generic_ft_get_version(); + DBUG_RETURN(version); +} + +static ulonglong mrn_storage_ft_ext_get_flags() +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong flags = mrn_generic_ft_ext_get_flags(); + DBUG_RETURN(flags); +} + +static ulonglong mrn_storage_ft_ext_get_docid(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong id = mrn_generic_ft_ext_get_docid(handler); + DBUG_RETURN(id); +} + +static ulonglong mrn_storage_ft_ext_count_matches(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong n_records = mrn_generic_ft_ext_count_matches(handler); + DBUG_RETURN(n_records); +} + +static _ft_vft_ext mrn_storage_ft_vft_ext = { + mrn_storage_ft_ext_get_version, + mrn_storage_ft_ext_get_flags, + mrn_storage_ft_ext_get_docid, + mrn_storage_ft_ext_count_matches +}; + +static uint mrn_no_such_key_ft_ext_get_version() +{ + MRN_DBUG_ENTER_FUNCTION(); + uint version = mrn_generic_ft_get_version(); + DBUG_RETURN(version); +} + +static ulonglong mrn_no_such_key_ft_ext_get_flags() +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong flags = mrn_generic_ft_ext_get_flags(); + DBUG_RETURN(flags); +} + +static ulonglong mrn_no_such_key_ft_ext_get_docid(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong id = GRN_ID_NIL; + DBUG_RETURN(id); +} + +static ulonglong mrn_no_such_key_ft_ext_count_matches(FT_INFO_EXT *handler) +{ + MRN_DBUG_ENTER_FUNCTION(); + ulonglong n_records = 0; + DBUG_RETURN(n_records); +} + +static _ft_vft_ext mrn_no_such_key_ft_vft_ext = { + mrn_no_such_key_ft_ext_get_version, + mrn_no_such_key_ft_ext_get_flags, + mrn_no_such_key_ft_ext_get_docid, + mrn_no_such_key_ft_ext_count_matches +}; +#endif + +/* handler implementation */ +ha_mroonga::ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg) + :handler(hton, share_arg), + wrap_handler(NULL), + is_clone(false), + parent_for_clone(NULL), + mem_root_for_clone(NULL), + record_id(GRN_ID_NIL), + key_id(NULL), + del_key_id(NULL), + + wrap_ft_init_count(0), + share(NULL), + wrap_key_info(NULL), + base_key_info(NULL), + + analyzed_for_create(false), + wrap_handler_for_create(NULL), +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + hnd_add_index(NULL), +#endif +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + alter_key_info_buffer(NULL), +#else + wrap_alter_key_info(NULL), +#endif + mrn_lock_type(F_UNLCK), + + ctx_entity_(), + ctx(&ctx_entity_), + grn_table(NULL), + grn_columns(NULL), + grn_column_ranges(NULL), + grn_index_tables(NULL), + grn_index_columns(NULL), + grn_table_is_referenced(false), + + grn_source_column_geo(NULL), + cursor_geo(NULL), + cursor(NULL), + index_table_cursor(NULL), + empty_value_records(NULL), + empty_value_records_cursor(NULL), + + sorted_result(NULL), + matched_record_keys(NULL), + blob_buffers(NULL), + + dup_key(0), + + count_skip(false), + fast_order_limit(false), + fast_order_limit_with_index(false), + + ignoring_duplicated_key(false), + inserting_with_update(false), + fulltext_searching(false), + ignoring_no_key_columns(false), + replacing_(false), + written_by_row_based_binlog(0), + current_ft_item(NULL) +{ + MRN_DBUG_ENTER_METHOD(); + grn_ctx_init(ctx, 0); + mrn_change_encoding(ctx, system_charset_info); + grn_ctx_use(ctx, mrn_db); + GRN_WGS84_GEO_POINT_INIT(&top_left_point, 0); + GRN_WGS84_GEO_POINT_INIT(&bottom_right_point, 0); + GRN_WGS84_GEO_POINT_INIT(&source_point, 0); + GRN_TEXT_INIT(&key_buffer, 0); + GRN_TEXT_INIT(&encoded_key_buffer, 0); + GRN_VOID_INIT(&old_value_buffer); + GRN_VOID_INIT(&new_value_buffer); + DBUG_VOID_RETURN; +} + +ha_mroonga::~ha_mroonga() +{ + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create) { + if (wrap_handler_for_create) { + delete wrap_handler_for_create; + } + if (share_for_create.wrapper_mode) { + plugin_unlock(NULL, share_for_create.plugin); + } + mrn_free_share_alloc(&share_for_create); + free_root(&mem_root_for_create, MYF(0)); + } + if (blob_buffers) + { + delete [] blob_buffers; + } + grn_obj_unlink(ctx, &top_left_point); + grn_obj_unlink(ctx, &bottom_right_point); + grn_obj_unlink(ctx, &source_point); + grn_obj_unlink(ctx, &key_buffer); + grn_obj_unlink(ctx, &encoded_key_buffer); + grn_obj_unlink(ctx, &old_value_buffer); + grn_obj_unlink(ctx, &new_value_buffer); + grn_ctx_fin(ctx); + DBUG_VOID_RETURN; +} + +const char *ha_mroonga::table_type() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(MRN_PLUGIN_NAME_STRING); +} + +const char *ha_mroonga::index_type(uint key_nr) +{ + MRN_DBUG_ENTER_METHOD(); + KEY key_info = table->s->key_info[key_nr]; + if (key_info.algorithm == HA_KEY_ALG_FULLTEXT) { + DBUG_RETURN("FULLTEXT"); + } else if (key_info.algorithm == HA_KEY_ALG_HASH) { + DBUG_RETURN("HASH"); + } else { + DBUG_RETURN("BTREE"); + } +} + +static const char *ha_mroonga_exts[] = { + NullS +}; +const char **ha_mroonga::bas_ext() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(ha_mroonga_exts); +} + +uint ha_mroonga::wrapper_max_supported_record_length() const +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrap_handler_for_create->max_supported_record_length(); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->max_supported_record_length(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_max_supported_record_length() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_MAX_REC_LENGTH); +} + +uint ha_mroonga::max_supported_record_length() const +{ + MRN_DBUG_ENTER_METHOD(); + + uint res; + if (!share && !analyzed_for_create && + ( + thd_sql_command(ha_thd()) == SQLCOM_CREATE_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX || + thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE + ) + ) { + create_share_for_create(); + } + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrapper_max_supported_record_length(); + } else if (wrap_handler && share && share->wrapper_mode) { + res = wrapper_max_supported_record_length(); + } else { + res = storage_max_supported_record_length(); + } + + DBUG_RETURN(res); +} + +uint ha_mroonga::wrapper_max_supported_keys() const +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrap_handler_for_create->max_supported_keys(); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->max_supported_keys(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_max_supported_keys() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_MAX_REC_LENGTH); +} + +uint ha_mroonga::max_supported_keys() const +{ + MRN_DBUG_ENTER_METHOD(); + + uint res; + if (!share && !analyzed_for_create && + ( + thd_sql_command(ha_thd()) == SQLCOM_CREATE_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX || + thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE + ) + ) { + create_share_for_create(); + } + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrapper_max_supported_keys(); + } else if (wrap_handler && share && share->wrapper_mode) { + res = wrapper_max_supported_keys(); + } else { + res = storage_max_supported_keys(); + } + + DBUG_RETURN(res); +} + +uint ha_mroonga::wrapper_max_supported_key_length() const +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrap_handler_for_create->max_supported_key_length(); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->max_supported_key_length(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_max_supported_key_length() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_MAX_REC_LENGTH); +} + +uint ha_mroonga::max_supported_key_length() const +{ + MRN_DBUG_ENTER_METHOD(); + + uint res; + if (!share && !analyzed_for_create && + ( + thd_sql_command(ha_thd()) == SQLCOM_CREATE_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX || + thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE + ) + ) { + create_share_for_create(); + } + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrapper_max_supported_key_length(); + } else if (wrap_handler && share && share->wrapper_mode) { + res = wrapper_max_supported_key_length(); + } else { + res = storage_max_supported_key_length(); + } + + DBUG_RETURN(res); +} + +uint ha_mroonga::wrapper_max_supported_key_part_length() const +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrap_handler_for_create->max_supported_key_part_length(); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->max_supported_key_part_length(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_max_supported_key_part_length() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_MAX_REC_LENGTH); +} + +uint ha_mroonga::max_supported_key_part_length() const +{ + MRN_DBUG_ENTER_METHOD(); + + uint res; + if (!share && !analyzed_for_create && + ( + thd_sql_command(ha_thd()) == SQLCOM_CREATE_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX || + thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE + ) + ) { + create_share_for_create(); + } + if (analyzed_for_create && share_for_create.wrapper_mode) { + res = wrapper_max_supported_key_part_length(); + } else if (wrap_handler && share && share->wrapper_mode) { + res = wrapper_max_supported_key_part_length(); + } else { + res = storage_max_supported_key_part_length(); + } + + DBUG_RETURN(res); +} + +ulonglong ha_mroonga::wrapper_table_flags() const +{ + ulonglong table_flags; + MRN_DBUG_ENTER_METHOD(); + if (analyzed_for_create && share_for_create.wrapper_mode) { + table_flags = wrap_handler_for_create->ha_table_flags(); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + table_flags = wrap_handler->ha_table_flags(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + table_flags |= HA_CAN_FULLTEXT | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | + HA_CAN_RTREEKEYS | HA_REC_NOT_IN_SEQ; +#ifdef HA_CAN_REPAIR + table_flags |= HA_CAN_REPAIR; +#endif +#ifdef HA_CAN_FULLTEXT_EXT + table_flags |= HA_CAN_FULLTEXT_EXT; +#endif + DBUG_RETURN(table_flags); +} + +ulonglong ha_mroonga::storage_table_flags() const +{ + MRN_DBUG_ENTER_METHOD(); + ulonglong flags = + HA_NO_TRANSACTIONS | + HA_PARTIAL_COLUMN_READ | + HA_REC_NOT_IN_SEQ | + HA_NULL_IN_KEY | + HA_CAN_INDEX_BLOBS | + HA_STATS_RECORDS_IS_EXACT | + HA_CAN_FULLTEXT | + HA_CAN_INSERT_DELAYED | + HA_BINLOG_FLAGS | + HA_CAN_BIT_FIELD | + HA_DUPLICATE_POS | + HA_CAN_GEOMETRY | + HA_CAN_RTREEKEYS; + //HA_HAS_RECORDS; +#ifdef HA_MUST_USE_TABLE_CONDITION_PUSHDOWN + flags |= HA_MUST_USE_TABLE_CONDITION_PUSHDOWN; +#endif +#ifdef HA_CAN_REPAIR + flags |= HA_CAN_REPAIR; +#endif +#ifdef HA_CAN_FULLTEXT_EXT + flags |= HA_CAN_FULLTEXT_EXT; +#endif + DBUG_RETURN(flags); +} + +ulonglong ha_mroonga::table_flags() const +{ + MRN_DBUG_ENTER_METHOD(); + + ulonglong flags; + if (!share && !analyzed_for_create && + ( + thd_sql_command(ha_thd()) == SQLCOM_CREATE_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX || + thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE + ) + ) { + create_share_for_create(); + } + if (analyzed_for_create && share_for_create.wrapper_mode) { + flags = wrapper_table_flags(); + } else if (wrap_handler && share && share->wrapper_mode) { + flags = wrapper_table_flags(); + } else { + flags = storage_table_flags(); + } + + DBUG_RETURN(flags); +} + +ulong ha_mroonga::wrapper_index_flags(uint idx, uint part, bool all_parts) const +{ + ulong index_flags; + KEY key = table_share->key_info[idx]; + MRN_DBUG_ENTER_METHOD(); + if (key.algorithm == HA_KEY_ALG_BTREE || key.algorithm == HA_KEY_ALG_UNDEF) { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + index_flags = wrap_handler->index_flags(idx, part, all_parts); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } else { + index_flags = HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR; + } + DBUG_RETURN(index_flags); +} + +ulong ha_mroonga::storage_index_flags(uint idx, uint part, bool all_parts) const +{ + MRN_DBUG_ENTER_METHOD(); + ulong flags; + KEY key = table_share->key_info[idx]; + if (key.algorithm == HA_KEY_ALG_BTREE || key.algorithm == HA_KEY_ALG_UNDEF) { + flags = HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE; + bool need_normalize_p = false; + Field *field = &key.key_part[part].field[0]; + if (field && should_normalize(field)) { + need_normalize_p = true; + } + if (!need_normalize_p) { + flags |= HA_KEYREAD_ONLY; + } + if (KEY_N_KEY_PARTS(&key) > 1 || !need_normalize_p) { + flags |= HA_READ_ORDER; + } + } else { + flags = HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR; + } + DBUG_RETURN(flags); +} + +ulong ha_mroonga::index_flags(uint idx, uint part, bool all_parts) const +{ + MRN_DBUG_ENTER_METHOD(); + + KEY key = table_share->key_info[idx]; + if (key.algorithm == HA_KEY_ALG_FULLTEXT) { + 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); + } + + int error = 0; + if (wrap_handler && share && share->wrapper_mode) + { + error = wrapper_index_flags(idx, part, all_parts); + } else { + error = storage_index_flags(idx, part, all_parts); + } + DBUG_RETURN(error); +} + +int ha_mroonga::create_share_for_create() const +{ + int error; + THD *thd = ha_thd(); + LEX *lex = thd->lex; + HA_CREATE_INFO *create_info = &lex->create_info; + TABLE_LIST *table_list = lex->select_lex.table_list.first; + MRN_DBUG_ENTER_METHOD(); + wrap_handler_for_create = NULL; + memset(&table_for_create, 0, sizeof(TABLE)); + memset(&share_for_create, 0, sizeof(MRN_SHARE)); + memset(&table_share_for_create, 0, sizeof(TABLE_SHARE)); + if (table_share) { + table_share_for_create.comment = table_share->comment; + table_share_for_create.connect_string = table_share->connect_string; + } else { +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + if (thd_sql_command(ha_thd()) != SQLCOM_CREATE_INDEX) { +#endif + table_share_for_create.comment = create_info->comment; + table_share_for_create.connect_string = create_info->connect_string; +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + } +#endif + if (thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE || + thd_sql_command(ha_thd()) == SQLCOM_CREATE_INDEX) { + st_mrn_slot_data *slot_data = mrn_get_slot_data(thd, false); + if (slot_data && slot_data->alter_create_info) { + create_info = slot_data->alter_create_info; + if (slot_data->alter_connect_string) { + table_share_for_create.connect_string.str = + slot_data->alter_connect_string; + table_share_for_create.connect_string.length = + strlen(slot_data->alter_connect_string); + } else { + table_share_for_create.connect_string.str = NULL; + table_share_for_create.connect_string.length = 0; + } + if (slot_data->alter_comment) { + table_share_for_create.comment.str = + slot_data->alter_comment; + table_share_for_create.comment.length = + strlen(slot_data->alter_comment); + } else { + table_share_for_create.comment.str = NULL; + table_share_for_create.comment.length = 0; + } + } + } + } + init_alloc_root(&mem_root_for_create, 1024, 0, MYF(0)); + analyzed_for_create = true; + if (table_list) { + share_for_create.table_name = table_list->table_name; + share_for_create.table_name_length = table_list->table_name_length; + } + share_for_create.table_share = &table_share_for_create; + table_for_create.s = &table_share_for_create; +#ifdef WITH_PARTITION_STORAGE_ENGINE + table_for_create.part_info = NULL; +#endif + if ((error = mrn_parse_table_param(&share_for_create, &table_for_create))) + goto error; + + if (share_for_create.wrapper_mode) + { + wrap_handler_for_create = + share_for_create.hton->create(share_for_create.hton, NULL, + &mem_root_for_create); + if (!wrap_handler_for_create) { + error = HA_ERR_OUT_OF_MEM; + goto error; + } + wrap_handler_for_create->init(); + } + DBUG_RETURN(0); + +error: + if (share_for_create.wrapper_mode) { + plugin_unlock(NULL, share_for_create.plugin); + } + mrn_free_share_alloc(&share_for_create); + free_root(&mem_root_for_create, MYF(0)); + analyzed_for_create = false; + thd->clear_error(); + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_create(const char *name, TABLE *table, + HA_CREATE_INFO *info, MRN_SHARE *tmp_share) +{ + int error = 0; + handler *hnd; + MRN_DBUG_ENTER_METHOD(); + + if (table_share->primary_key == MAX_KEY) + { + my_message(ER_REQUIRES_PRIMARY_KEY, + MRN_GET_ERR_MSG(ER_REQUIRES_PRIMARY_KEY), MYF(0)); + DBUG_RETURN(ER_REQUIRES_PRIMARY_KEY); + } + + mrn::PathMapper mapper(name); + error = wrapper_create_index(name, table, info, tmp_share, + mapper.table_name()); + if (error) + DBUG_RETURN(error); + + wrap_key_info = mrn_create_key_info_for_table(tmp_share, table, &error); + if (error) + DBUG_RETURN(error); + base_key_info = table->key_info; + + share = tmp_share; + MRN_SET_WRAP_SHARE_KEY(tmp_share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (!(hnd = + tmp_share->hton->create(tmp_share->hton, table->s, + current_thd->mem_root))) + { + MRN_SET_BASE_SHARE_KEY(tmp_share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + share = NULL; + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + hnd->init(); + error = hnd->ha_create(name, table, info); + MRN_SET_BASE_SHARE_KEY(tmp_share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + share = NULL; + delete hnd; + + if (error) { + wrapper_delete_index(name, tmp_share, mapper.table_name()); + } + + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_create_index_fulltext_validate(KEY *key_info) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + uint i; + for (i = 0; i < KEY_N_KEY_PARTS(key_info); i++) { + Field *field = key_info->key_part[i].field; + + grn_builtin_type gtype = mrn_grn_type_from_field(ctx, field, true); + if (gtype != GRN_DB_SHORT_TEXT) + { + error = ER_CANT_CREATE_TABLE; + GRN_LOG(ctx, GRN_LOG_ERROR, + "key type must be text: <%d> " + "(TODO: We should show type name not type ID.)", + field->type()); + my_message(ER_CANT_CREATE_TABLE, + "key type must be text. (TODO: We should show type name.)", + MYF(0)); + DBUG_RETURN(error); + } + } + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name, + int i, + KEY *key_info, + grn_obj **index_tables, + grn_obj **index_columns, + MRN_SHARE *tmp_share) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + error = wrapper_create_index_fulltext_validate(key_info); + if (error) { + DBUG_RETURN(error); + } + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + grn_obj_flags index_table_flags = + GRN_OBJ_TABLE_PAT_KEY | + GRN_OBJ_PERSISTENT; + grn_obj *index_table; + + grn_obj_flags index_column_flags = + GRN_OBJ_COLUMN_INDEX | GRN_OBJ_WITH_POSITION | GRN_OBJ_PERSISTENT; + if (KEY_N_KEY_PARTS(key_info) > 1) { + index_column_flags |= GRN_OBJ_WITH_SECTION; + } + + mrn::SmartGrnObj lexicon_key_type(ctx, GRN_DB_SHORT_TEXT); + error = mrn_change_encoding(ctx, key_info->key_part->field->charset()); + if (error) { + DBUG_RETURN(error); + } + mrn::IndexTableName index_table_name(grn_table_name, key_info->name); + index_table = grn_table_create(ctx, + index_table_name.c_str(), + index_table_name.length(), + NULL, + index_table_flags, + lexicon_key_type.get(), + 0); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(ER_CANT_CREATE_TABLE, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + mrn_change_encoding(ctx, system_charset_info); + index_tables[i] = index_table; + + grn_obj *tokenizer = find_tokenizer(tmp_share->key_parser[i], + tmp_share->key_parser_length[i]); + if (tokenizer) { + grn_info_type info_type = GRN_INFO_DEFAULT_TOKENIZER; + grn_obj_set_info(ctx, index_table, info_type, tokenizer); + grn_obj_unlink(ctx, tokenizer); + } + + if (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) { + grn_obj_set_info(ctx, index_table, info_type, normalizer); + grn_obj_unlink(ctx, normalizer); + } + } + + grn_obj *index_column = grn_column_create(ctx, index_table, + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME), + NULL, + index_column_flags, + grn_table); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + if (index_columns) { + index_columns[i] = index_column; + } else { + grn_obj_unlink(ctx, index_column); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_create_index_geo(const char *grn_table_name, + int i, + KEY *key_info, + grn_obj **index_tables, + grn_obj **index_columns, + MRN_SHARE *tmp_share) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + mrn::IndexTableName index_table_name(grn_table_name, key_info->name); + + grn_obj_flags index_table_flags = + GRN_OBJ_TABLE_PAT_KEY | + GRN_OBJ_PERSISTENT; + grn_obj *index_table; + + grn_obj_flags index_column_flags = + GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; + + grn_obj *lexicon_key_type = grn_ctx_at(ctx, GRN_DB_WGS84_GEO_POINT); + index_table = grn_table_create(ctx, + index_table_name.c_str(), + index_table_name.length(), + NULL, + index_table_flags, lexicon_key_type, 0); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(ER_CANT_CREATE_TABLE, ctx->errbuf, MYF(0)); + grn_obj_unlink(ctx, lexicon_key_type); + DBUG_RETURN(error); + } + grn_obj_unlink(ctx, lexicon_key_type); + index_tables[i] = index_table; + + grn_obj *index_column = grn_column_create(ctx, index_table, + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME), + NULL, + index_column_flags, + grn_table); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + if (index_columns) { + index_columns[i] = index_column; + } else { + grn_obj_unlink(ctx, index_column); + } + + DBUG_RETURN(error); +} + +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_DBUG_ENTER_METHOD(); + + int error = 0; + error = ensure_database_create(name); + if (error) + DBUG_RETURN(error); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + grn_obj *grn_index_table; + 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 + grn_obj_flags grn_table_flags = GRN_OBJ_PERSISTENT | GRN_OBJ_TABLE_HASH_KEY; + + grn_index_table = grn_table_create(ctx, grn_table_name, strlen(grn_table_name), + grn_table_path, grn_table_flags, + pkey_type, pkey_value_type); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + if (grn_table) { + grn_obj_unlink(ctx, grn_table); + } + grn_table = grn_index_table; + + uint i; + uint n_keys = table->s->keys; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, n_keys); + if (!tmp_share->disable_keys) { + for (i = 0; i < n_keys; i++) { + index_tables[i] = NULL; + + KEY key_info = table->s->key_info[i]; + if (key_info.algorithm == HA_KEY_ALG_FULLTEXT) { + error = wrapper_create_index_fulltext(grn_table_name, + i, &key_info, + index_tables, NULL, tmp_share); + } else if (mrn_is_geo_key(&key_info)) { + error = wrapper_create_index_geo(grn_table_name, + i, &key_info, + index_tables, NULL, tmp_share); + } + } + } + + if (error) { + for (uint j = 0; j < i; j++) { + if (index_tables[j]) { + grn_obj_remove(ctx, index_tables[j]); + } + } + grn_obj_remove(ctx, grn_table); + grn_table = NULL; + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_create(const char *name, TABLE *table, + HA_CREATE_INFO *info, MRN_SHARE *tmp_share) +{ + int error; + MRN_LONG_TERM_SHARE *long_term_share = tmp_share->long_term_share; + MRN_DBUG_ENTER_METHOD(); + + if (info->auto_increment_value) { + mrn::Lock lock(&long_term_share->auto_inc_mutex); + long_term_share->auto_inc_value = info->auto_increment_value; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + long_term_share->auto_inc_inited = true; + } + + error = storage_create_validate_pseudo_column(table); + if (error) + DBUG_RETURN(error); + + error = storage_create_validate_index(table); + if (error) + DBUG_RETURN(error); + + error = ensure_database_create(name); + if (error) + DBUG_RETURN(error); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + grn_obj_flags table_flags = GRN_OBJ_PERSISTENT; + + /* primary key must be handled before creating table */ + grn_obj *pkey_type; + uint pkey_nr = table->s->primary_key; + if (pkey_nr != MAX_INDEXES) { + KEY key_info = table->s->key_info[pkey_nr]; + bool is_id; + + int key_parts = KEY_N_KEY_PARTS(&key_info); + if (key_parts == 1) { + Field *pkey_field = key_info.key_part[0].field; + const char *column_name = pkey_field->field_name; + is_id = (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0); + + grn_builtin_type gtype = mrn_grn_type_from_field(ctx, pkey_field, false); + pkey_type = grn_ctx_at(ctx, gtype); + } else { + is_id = false; + pkey_type = grn_ctx_at(ctx, GRN_DB_SHORT_TEXT); + } + + // default algorithm is BTREE ==> PAT + if (!is_id && key_info.algorithm == HA_KEY_ALG_HASH) { + table_flags |= GRN_OBJ_TABLE_HASH_KEY; + } else if (!is_id) { + table_flags |= GRN_OBJ_TABLE_PAT_KEY; + } else { + // for _id + table_flags |= GRN_OBJ_TABLE_NO_KEY; + pkey_type = NULL; + } + + } else { + // primary key doesn't exists + table_flags |= GRN_OBJ_TABLE_NO_KEY; + pkey_type = NULL; + } + + /* create table */ + grn_obj *table_obj; + mrn::PathMapper mapper(name); + + char *table_path = NULL; // we don't specify path + grn_obj *pkey_value_type = NULL; // we don't use this + + table_obj = grn_table_create(ctx, + mapper.table_name(), strlen(mapper.table_name()), + table_path, + table_flags, pkey_type, pkey_value_type); + if (ctx->rc) { + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + + if (table_flags == (GRN_OBJ_PERSISTENT | GRN_OBJ_TABLE_PAT_KEY)) { + KEY key_info = table->s->key_info[pkey_nr]; + int key_parts = KEY_N_KEY_PARTS(&key_info); + if (key_parts == 1) { + Field *field = &(key_info.key_part->field[0]); + if (should_normalize(field)) { + grn_obj *normalizer = find_normalizer(&key_info); + if (normalizer) { + grn_info_type info_type = GRN_INFO_NORMALIZER; + grn_obj_set_info(ctx, table_obj, info_type, normalizer); + grn_obj_unlink(ctx, normalizer); + } + } + if (tmp_share->default_tokenizer) { + grn_obj *default_tokenizer = + grn_ctx_get(ctx, + tmp_share->default_tokenizer, + tmp_share->default_tokenizer_length); + if (default_tokenizer) { + grn_info_type info_type = GRN_INFO_DEFAULT_TOKENIZER; + grn_obj_set_info(ctx, table_obj, info_type, default_tokenizer); + grn_obj_unlink(ctx, default_tokenizer); + } + } + } + } + + /* create columns */ + uint n_columns = table->s->fields; + for (uint i = 0; i < n_columns; i++) { + grn_obj *col_type; + Field *field = table->s->field[i]; + const char *column_name = field->field_name; + int column_name_size = strlen(column_name); + + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + continue; + } + +#ifdef MRN_SUPPORT_FOREIGN_KEYS + if (storage_create_foreign_key(table, mapper.table_name(), field, table_obj, + error)) { + continue; + } + if (error) { + grn_obj_remove(ctx, table_obj); + DBUG_RETURN(error); + } +#endif + + grn_obj_flags col_flags = GRN_OBJ_PERSISTENT; + if (tmp_share->col_flags[i]) { + // TODO: parse flags + if (strcmp(tmp_share->col_flags[i], "COLUMN_VECTOR") == 0) { + col_flags |= GRN_OBJ_COLUMN_VECTOR; + } else { + col_flags |= GRN_OBJ_COLUMN_SCALAR; + } + } else { + col_flags |= GRN_OBJ_COLUMN_SCALAR; + } + grn_builtin_type gtype = mrn_grn_type_from_field(ctx, field, false); + if (tmp_share->col_type[i]) { + col_type = grn_ctx_get(ctx, tmp_share->col_type[i], -1); + } else { + col_type = grn_ctx_at(ctx, gtype); + } + char *col_path = NULL; // we don't specify path + + grn_column_create(ctx, table_obj, column_name, column_name_size, + 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)); + DBUG_RETURN(error); + } + } + + error = storage_create_indexes(table, mapper.table_name(), table_obj, + tmp_share); + if (error) { + grn_obj_remove(ctx, table_obj); + table_obj = NULL; + } + + if (table_obj) { + grn_obj_unlink(ctx, table_obj); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_create_validate_pseudo_column(TABLE *table) +{ + int error = 0; + uint i, n_columns; + + MRN_DBUG_ENTER_METHOD(); + n_columns = table->s->fields; + for (i = 0; i < n_columns; i++) { + Field *field = table->s->field[i]; + const char *column_name = field->field_name; + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + switch (field->type()) { + case MYSQL_TYPE_TINY : + case MYSQL_TYPE_SHORT : + case MYSQL_TYPE_INT24 : + case MYSQL_TYPE_LONG : + case MYSQL_TYPE_LONGLONG : + break; + default: + GRN_LOG(ctx, GRN_LOG_ERROR, "_id must be numeric data type"); + error = ER_CANT_CREATE_TABLE; + my_message(error, "_id must be numeric data type", MYF(0)); + DBUG_RETURN(error); + } + } + } + + DBUG_RETURN(error); +} + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +bool ha_mroonga::storage_create_foreign_key(TABLE *table, + const char *grn_table_name, + Field *field, + grn_obj *table_obj, int &error) +{ + MRN_DBUG_ENTER_METHOD(); + LEX *lex = ha_thd()->lex; + Alter_info *alter_info = &lex->alter_info; + List_iterator key_iterator(alter_info->key_list); + Key *key; + char ref_db_buff[NAME_LEN + 1], ref_table_buff[NAME_LEN + 1]; + while ((key = key_iterator++)) + { + if (key->type != Key::FOREIGN_KEY) + { + continue; + } + if (key->columns.elements > 1) + { + error = ER_CANT_CREATE_TABLE; + my_message(error, "mroonga can't use FOREIGN_KEY with multiple columns", + MYF(0)); + DBUG_RETURN(false); + } + List_iterator key_part_col_iterator(key->columns); + Key_part_spec *key_part_col = key_part_col_iterator++; + LEX_STRING field_name = key_part_col->field_name; + DBUG_PRINT("info", ("mroonga: field_name=%s", field_name.str)); + DBUG_PRINT("info", ("mroonga: field->field_name=%s", field->field_name)); + if (strcmp(field->field_name, field_name.str)) + { + continue; + } + Foreign_key *fk = (Foreign_key *) key; + List_iterator key_part_ref_col_iterator(fk->ref_columns); + Key_part_spec *key_part_ref_col = key_part_ref_col_iterator++; + LEX_STRING ref_field_name = key_part_ref_col->field_name; + DBUG_PRINT("info", ("mroonga: ref_field_name=%s", ref_field_name.str)); + LEX_STRING ref_db_name = fk->ref_db; + DBUG_PRINT("info", ("mroonga: ref_db_name=%s", ref_db_name.str)); + if (ref_db_name.str && lower_case_table_names) { + strmake(ref_db_buff, ref_db_name.str, sizeof(ref_db_buff) - 1); + my_casedn_str(system_charset_info, ref_db_buff); + ref_db_name.str = ref_db_buff; + DBUG_PRINT("info", ("mroonga: casedn ref_db_name=%s", ref_db_name.str)); + } + LEX_STRING ref_table_name = fk->ref_table; + DBUG_PRINT("info", ("mroonga: ref_table_name=%s", ref_table_name.str)); + if (ref_table_name.str && lower_case_table_names) { + strmake(ref_table_buff, ref_table_name.str, sizeof(ref_table_buff) - 1); + my_casedn_str(system_charset_info, ref_table_buff); + ref_table_name.str = ref_table_buff; + DBUG_PRINT("info", ("mroonga: casedn ref_table_name=%s", ref_table_name.str)); + } + if (ref_db_name.str && strcmp(table->s->db.str, ref_db_name.str)) + { + error = ER_CANT_CREATE_TABLE; + my_message(error, + "mroonga can't use FOREIGN_KEY during different database tables", + MYF(0)); + DBUG_RETURN(false); + } + + grn_obj *column, *column_ref = NULL, *grn_table_ref = NULL; + char ref_path[FN_REFLEN + 1]; + TABLE_LIST table_list; + TABLE_SHARE *tmp_ref_table_share; + build_table_filename(ref_path, sizeof(ref_path) - 1, + table->s->db.str, ref_table_name.str, "", 0); + + DBUG_PRINT("info", ("mroonga: ref_path=%s", ref_path)); + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(false); + mrn::PathMapper mapper(ref_path); + grn_table_ref = grn_ctx_get(ctx, mapper.table_name(), + strlen(mapper.table_name())); + 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", + table->s->db.str, ref_table_name.str); + my_message(error, err_msg, MYF(0)); + DBUG_RETURN(false); + } + +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + 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); +#else + table_list.init_one_table(mapper.db_name(), + mapper.mysql_table_name(), + TL_WRITE); +#endif + mrn_open_mutex_lock(table->s); + tmp_ref_table_share = + mrn_create_tmp_table_share(&table_list, ref_path, &error); + mrn_open_mutex_unlock(table->s); + if (!tmp_ref_table_share) { + 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", + table->s->db.str, ref_table_name.str); + my_message(error, err_msg, MYF(0)); + DBUG_RETURN(false); + } + uint ref_pkey_nr = tmp_ref_table_share->primary_key; + if (ref_pkey_nr == MAX_KEY) { + mrn_open_mutex_lock(table->s); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table->s); + 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", + table->s->db.str, ref_table_name.str); + my_message(error, err_msg, MYF(0)); + DBUG_RETURN(false); + } + KEY *ref_key_info = &tmp_ref_table_share->key_info[ref_pkey_nr]; + uint ref_key_parts = KEY_N_KEY_PARTS(ref_key_info); + if (ref_key_parts > 1) { + mrn_open_mutex_lock(table->s); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table->s); + 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] primary key is multiple column", + table->s->db.str, ref_table_name.str); + my_message(error, err_msg, MYF(0)); + DBUG_RETURN(false); + } + Field *ref_field = &ref_key_info->key_part->field[0]; + if (strcmp(ref_field->field_name, ref_field_name.str)) { + mrn_open_mutex_lock(table->s); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table->s); + grn_obj_unlink(ctx, grn_table_ref); + 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", + table->s->db.str, ref_table_name.str, ref_field_name.str); + my_message(error, err_msg, MYF(0)); + DBUG_RETURN(false); + } + mrn_open_mutex_lock(table->s); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table->s); + grn_obj_flags col_flags = GRN_OBJ_PERSISTENT; + column = grn_column_create(ctx, table_obj, field->field_name, + strlen(field->field_name), + NULL, col_flags, grn_table_ref); + if (ctx->rc) { + grn_obj_unlink(ctx, grn_table_ref); + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(false); + } + + mrn::IndexColumnName index_column_name(grn_table_name, field->field_name); + grn_obj_flags ref_col_flags = GRN_OBJ_COLUMN_INDEX | GRN_OBJ_PERSISTENT; + column_ref = grn_column_create(ctx, grn_table_ref, + index_column_name.c_str(), + index_column_name.length(), + NULL, ref_col_flags, table_obj); + if (ctx->rc) { + grn_obj_unlink(ctx, column); + grn_obj_unlink(ctx, grn_table_ref); + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(false); + } + + grn_obj source_ids; + grn_id source_id = grn_obj_id(ctx, column); + GRN_UINT32_INIT(&source_ids, GRN_OBJ_VECTOR); + GRN_UINT32_PUT(ctx, &source_ids, source_id); + if (error) { + grn_obj_unlink(ctx, &source_ids); + grn_obj_unlink(ctx, column_ref); + grn_obj_unlink(ctx, column); + grn_obj_unlink(ctx, grn_table_ref); + DBUG_RETURN(false); + } + grn_obj_set_info(ctx, column_ref, GRN_INFO_SOURCE, &source_ids); + grn_obj_unlink(ctx, &source_ids); + grn_obj_unlink(ctx, column_ref); + grn_obj_unlink(ctx, column); + grn_obj_unlink(ctx, grn_table_ref); + error = 0; + DBUG_RETURN(true); + } + error = 0; + DBUG_RETURN(false); +} +#endif + +int ha_mroonga::storage_create_validate_index(TABLE *table) +{ + int error = 0; + uint i; + + MRN_DBUG_ENTER_METHOD(); + /* checking if index is used for virtual columns */ + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->s->key_info[i]; + // must be single column key + int key_parts = KEY_N_KEY_PARTS(&key_info); + if (key_parts != 1) { + continue; + } + Field *field = key_info.key_part[0].field; + const char *column_name = field->field_name; + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + if (key_info.algorithm == HA_KEY_ALG_HASH) { + continue; // hash index is ok + } + GRN_LOG(ctx, GRN_LOG_ERROR, "only hash index can be defined for _id"); + error = ER_CANT_CREATE_TABLE; + my_message(error, "only hash index can be defined for _id", MYF(0)); + DBUG_RETURN(error); + } + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_create_index_table(TABLE *table, + const char *grn_table_name, + grn_obj *grn_table, + MRN_SHARE *tmp_share, + KEY *key_info, + grn_obj **index_tables, + uint i) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + grn_obj *index_type; + grn_obj *index_table; + grn_obj_flags index_table_flags = GRN_OBJ_PERSISTENT; + bool is_multiple_column_index = KEY_N_KEY_PARTS(key_info) > 1; + + if (tmp_share->index_table && tmp_share->index_table[i]) { + index_table = grn_ctx_get(ctx, + tmp_share->index_table[i], + tmp_share->index_table_length[i]); + // TODO: add error check + index_tables[i] = index_table; + DBUG_RETURN(error); + } + + if (is_multiple_column_index) { + index_type = grn_ctx_at(ctx, GRN_DB_SHORT_TEXT); + } else { + Field *field = key_info->key_part[0].field; + grn_builtin_type groonga_type = mrn_grn_type_from_field(ctx, field, true); + index_type = grn_ctx_at(ctx, groonga_type); + } + // TODO: Add NULL check for index_type + + int key_alg = key_info->algorithm; + if (key_info->flags & HA_FULLTEXT) { + index_table_flags |= GRN_OBJ_TABLE_PAT_KEY; + error = mrn_change_encoding(ctx, key_info->key_part->field->charset()); + if (error) { + grn_obj_remove(ctx, grn_table); + DBUG_RETURN(error); + } + } else if (key_alg == HA_KEY_ALG_HASH) { + index_table_flags |= GRN_OBJ_TABLE_HASH_KEY; + } else { + index_table_flags |= GRN_OBJ_TABLE_PAT_KEY; + } + + { + mrn::IndexTableName index_table_name(grn_table_name, key_info->name); + index_table = grn_table_create(ctx, + index_table_name.c_str(), + index_table_name.length(), + NULL, + index_table_flags, + index_type, + NULL); + } + if (ctx->rc) { + grn_obj_unlink(ctx, index_type); + grn_obj_remove(ctx, grn_table); + error = ER_CANT_CREATE_TABLE; + my_message(ER_CANT_CREATE_TABLE, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + + if (key_info->flags & HA_FULLTEXT) { + grn_obj *tokenizer = find_tokenizer(tmp_share->key_parser[i], + tmp_share->key_parser_length[i]); + if (tokenizer) { + grn_info_type info_type = GRN_INFO_DEFAULT_TOKENIZER; + grn_obj_set_info(ctx, index_table, info_type, tokenizer); + grn_obj_unlink(ctx, tokenizer); + } + } + + { + grn_obj *normalizer = NULL; + Field *field = &(key_info->key_part->field[0]); + if (key_info->flags & HA_FULLTEXT) { + if (should_normalize(field)) { + normalizer = find_normalizer(key_info); + } + } else if (key_alg != HA_KEY_ALG_HASH) { + if (!is_multiple_column_index && should_normalize(field)) { + normalizer = find_normalizer(key_info); + } + } + if (normalizer) { + grn_info_type info_type = GRN_INFO_NORMALIZER; + grn_obj_set_info(ctx, index_table, info_type, normalizer); + grn_obj_unlink(ctx, normalizer); + } + } + + index_tables[i] = index_table; + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_create_index(TABLE *table, const char *grn_table_name, + grn_obj *grn_table, MRN_SHARE *tmp_share, + KEY *key_info, grn_obj **index_tables, + grn_obj **index_columns, uint i) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + grn_obj *index_table, *index_column; + const char *column_name = NULL; + int column_name_size = 0; + + 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) { + // skipping _id virtual column + DBUG_RETURN(0); + } + } + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + error = storage_create_index_table(table, grn_table_name, + grn_table, tmp_share, + key_info, index_tables, i); + if (error) + DBUG_RETURN(error); + + grn_obj_flags index_column_flags = + GRN_OBJ_COLUMN_INDEX | GRN_OBJ_WITH_POSITION | GRN_OBJ_PERSISTENT; + if (is_multiple_column_index) { + 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; + } else { + index_column_name = INDEX_COLUMN_NAME; + } + index_column = grn_column_create(ctx, + index_table, + index_column_name, + strlen(index_column_name), + NULL, + index_column_flags, + grn_table); + + if (ctx->rc) { + grn_obj_remove(ctx, index_table); + error = ER_CANT_CREATE_TABLE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + + mrn_change_encoding(ctx, system_charset_info); + if (is_multiple_column_index) { + if (key_info->flags & HA_FULLTEXT) { + grn_obj source_ids; + GRN_UINT32_INIT(&source_ids, GRN_OBJ_VECTOR); + + 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); + grn_id source_id = grn_obj_id(ctx, source_column); + GRN_UINT32_PUT(ctx, &source_ids, source_id); + grn_obj_unlink(ctx, source_column); + } + mrn_change_encoding(ctx, key_info->key_part->field->charset()); + grn_obj_set_info(ctx, index_column, GRN_INFO_SOURCE, &source_ids); + grn_obj_unlink(ctx, &source_ids); + } + } else { + grn_obj *column; + column = grn_obj_column(ctx, grn_table, column_name, column_name_size); + if (column) { + grn_obj source_ids; + grn_id source_id = grn_obj_id(ctx, column); + GRN_UINT32_INIT(&source_ids, GRN_OBJ_VECTOR); + GRN_UINT32_PUT(ctx, &source_ids, source_id); + mrn_change_encoding(ctx, key_info->key_part->field->charset()); + grn_obj_set_info(ctx, index_column, GRN_INFO_SOURCE, &source_ids); + grn_obj_unlink(ctx, &source_ids); + grn_obj_unlink(ctx, column); + } + } + mrn_change_encoding(ctx, system_charset_info); + + if (index_columns) { + index_columns[i] = index_column; + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_create_indexes(TABLE *table, const char *grn_table_name, + grn_obj *grn_table, MRN_SHARE *tmp_share) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + uint n_keys = table->s->keys; + uint i; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, n_keys); + for (i = 0; i < n_keys; i++) { + index_tables[i] = NULL; + if (i == table->s->primary_key) { + continue; // pkey is already handled + } + KEY *key_info = &table->s->key_info[i]; + if (tmp_share->disable_keys && !(key_info->flags & HA_NOSAME)) { + continue; // key is disabled + } + if ((error = storage_create_index(table, grn_table_name, grn_table, + tmp_share, key_info, + index_tables, NULL, i))) { + break; + } + } + if (error) { + while (true) { + if (index_tables[i]) { + grn_obj_remove(ctx, index_tables[i]); + } + if (!i) + break; + i--; + } + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + DBUG_RETURN(error); +} + +int ha_mroonga::close_databases() +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + mrn::Lock lock(&mrn_db_mutex); + + grn_hash_cursor *hash_cursor; + hash_cursor = grn_hash_cursor_open(&mrn_ctx, mrn_hash, + NULL, 0, NULL, 0, + 0, -1, 0); + if (mrn_ctx.rc) { + my_message(ER_ERROR_ON_READ, mrn_ctx.errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_READ); + } + + while (grn_hash_cursor_next(&mrn_ctx, hash_cursor) != GRN_ID_NIL) { + if (mrn_ctx.rc) { + error = ER_ERROR_ON_READ; + my_message(error, mrn_ctx.errbuf, MYF(0)); + break; + } + void *value; + grn_obj *db; + grn_hash_cursor_get_value(&mrn_ctx, hash_cursor, &value); + memcpy(&db, value, sizeof(grn_obj *)); + grn_rc rc = grn_hash_cursor_delete(&mrn_ctx, hash_cursor, NULL); + if (rc) + { + error = ER_ERROR_ON_READ; + my_message(error, mrn_ctx.errbuf, MYF(0)); + break; + } + grn_obj_close(&mrn_ctx, db); + } + grn_hash_cursor_close(&mrn_ctx, hash_cursor); + + DBUG_RETURN(error); +} + +void ha_mroonga::ensure_database_directory() +{ + MRN_DBUG_ENTER_METHOD(); + + const char *path_prefix = mrn::PathMapper::default_path_prefix; + if (!path_prefix) + DBUG_VOID_RETURN; + + const char *last_path_separator; + last_path_separator = strrchr(path_prefix, FN_LIBCHAR); + if (!last_path_separator) + last_path_separator = strrchr(path_prefix, FN_LIBCHAR2); + if (!last_path_separator) + DBUG_VOID_RETURN; + if (path_prefix == last_path_separator) + DBUG_VOID_RETURN; + + char database_directory[MRN_MAX_PATH_SIZE]; + size_t database_directory_length = last_path_separator - path_prefix; + strncpy(database_directory, path_prefix, database_directory_length); + database_directory[database_directory_length] = '\0'; + mkdir_p(database_directory); + + DBUG_VOID_RETURN; +} + +int ha_mroonga::ensure_normalizers_register() +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; +#ifdef WITH_GROONGA_NORMALIZER_MYSQL + { + grn_obj *mysql_normalizer; + mysql_normalizer = grn_ctx_get(ctx, "NormalizerMySQLGeneralCI", -1); + if (mysql_normalizer) { + grn_obj_unlink(ctx, mysql_normalizer); + } else { +#ifdef GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC + char ref_path[FN_REFLEN + 1], *tmp; + tmp = strmov(ref_path, opt_plugin_dir); + tmp = strmov(tmp, "/ha_mroonga"); + strcpy(tmp, SO_EXT); + grn_plugin_register_by_path(ctx, ref_path); +#else + grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME); +#endif + } + } +#endif + + DBUG_RETURN(error); +} + +int ha_mroonga::ensure_database_create(const char *name) +{ + int error; + + MRN_DBUG_ENTER_METHOD(); + /* before creating table, we must check if database is alreadly opened, created */ + grn_obj *db; + struct stat db_stat; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + mrn::PathMapper mapper(name); + { + mrn::Lock lock(&mrn_db_mutex); + if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) { + if (stat(mapper.db_path(), &db_stat)) { + // creating new database + GRN_LOG(ctx, GRN_LOG_INFO, + "database not found. creating...(%s)", mapper.db_path()); + if (name[0] == FN_CURLIB && + (name[1] == FN_LIBCHAR || name[1] == FN_LIBCHAR2)) { + ensure_database_directory(); + } + db = grn_db_create(&mrn_ctx, mapper.db_path(), NULL); + if (mrn_ctx.rc) { + error = ER_CANT_CREATE_TABLE; + my_message(error, mrn_ctx.errbuf, MYF(0)); + DBUG_RETURN(error); + } + } else { + // opening existing database + db = grn_db_open(&mrn_ctx, mapper.db_path()); + if (mrn_ctx.rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, mrn_ctx.errbuf, MYF(0)); + DBUG_RETURN(error); + } + } + mrn_hash_put(&mrn_ctx, mrn_hash, mapper.db_name(), db); + } + } + grn_ctx_use(ctx, db); + error = ensure_normalizers_register(); + + DBUG_RETURN(error); +} + +int ha_mroonga::ensure_database_open(const char *name) +{ + int error; + + MRN_DBUG_ENTER_METHOD(); + grn_obj *db; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + mrn::PathMapper mapper(name); + { + mrn::Lock lock(&mrn_db_mutex); + if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) { + db = grn_db_open(&mrn_ctx, mapper.db_path()); + if (mrn_ctx.rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, mrn_ctx.errbuf, MYF(0)); + DBUG_RETURN(error); + } + mrn_hash_put(&mrn_ctx, mrn_hash, mapper.db_name(), db); + } + } + grn_ctx_use(ctx, db); + error = ensure_normalizers_register(); + + DBUG_RETURN(error); +} + +int ha_mroonga::ensure_database_remove(const char *name) +{ + int error; + + MRN_DBUG_ENTER_METHOD(); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + mrn::PathMapper mapper(name); + { + mrn::Lock lock(&mrn_db_mutex); + grn_obj *db; + if (mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) { + mrn_hash_remove(&mrn_ctx, mrn_hash, mapper.db_name()); + grn_obj_close(&mrn_ctx, db); + } + } + remove_related_files(mapper.db_path()); + + DBUG_RETURN(error); +} + + +int ha_mroonga::create(const char *name, TABLE *table, HA_CREATE_INFO *info) +{ + int error = 0; + MRN_SHARE *tmp_share; + MRN_DBUG_ENTER_METHOD(); + /* checking data type of virtual columns */ + + if (!(tmp_share = mrn_get_share(name, table, &error))) + DBUG_RETURN(error); + + st_mrn_slot_data *slot_data = mrn_get_slot_data(ha_thd(), false); + if (slot_data && slot_data->disable_keys_create_info == info) { + tmp_share->disable_keys = true; + } + + if (tmp_share->wrapper_mode) + { + error = wrapper_create(name, table, info, tmp_share); + } else { + error = storage_create(name, table, info, tmp_share); + } + + if (error) { + mrn_free_long_term_share(tmp_share->long_term_share); + tmp_share->long_term_share = NULL; + } + mrn_free_share(tmp_share); + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked) +{ + 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_create(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); + + error = open_table(name); + if (error) + DBUG_RETURN(error); + + error = wrapper_open_indexes(name); + if (error) { + grn_obj_unlink(ctx, grn_table); + grn_table = NULL; + DBUG_RETURN(error); + } + } + + init_alloc_root(&mem_root, 1024, 0, MYF(0)); + wrap_key_info = mrn_create_key_info_for_table(share, table, &error); + if (error) + DBUG_RETURN(error); + base_key_info = table->key_info; + + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (!is_clone) + { + if (!(wrap_handler = + share->hton->create(share->hton, table->s, &mem_root))) + { + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + wrap_handler->init(); +#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); + } else { +#ifdef MRN_HANDLER_CLONE_NEED_NAME + if (!(wrap_handler = parent_for_clone->wrap_handler->clone(name, + mem_root_for_clone))) +#else + if (!(wrap_handler = parent_for_clone->wrap_handler->clone( + mem_root_for_clone))) +#endif + { + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + } + ref_length = wrap_handler->ref_length; + key_used_on_scan = wrap_handler->key_used_on_scan; + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + init(); + wrapper_overwrite_index_bits(); + wrapper_set_keys_in_use(); + + pk_keypart_map = make_prev_keypart_map( + KEY_N_KEY_PARTS(&(table->key_info[table_share->primary_key]))); + + if (error) + { + grn_obj_unlink(ctx, grn_table); + grn_table = NULL; + // TODO: free indexes. + + delete wrap_handler; + wrap_handler = NULL; + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_open_indexes(const char *name) +{ + int error; + + MRN_DBUG_ENTER_METHOD(); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + uint n_keys = table->s->keys; + uint n_primary_keys = table->s->primary_key; + if (n_keys > 0) { + // TODO: reduce allocate memories. We only need just + // for HA_KEY_ALG_FULLTEXT keys. + grn_index_tables = (grn_obj **)malloc(sizeof(grn_obj *) * n_keys); + grn_index_columns = (grn_obj **)malloc(sizeof(grn_obj *) * n_keys); + } else { + grn_index_tables = grn_index_columns = NULL; + } + + mrn::PathMapper mapper(name); + uint i = 0; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->s->key_info[i]; + + grn_index_tables[i] = NULL; + grn_index_columns[i] = NULL; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + if (i == n_primary_keys) { + continue; + } + + mrn::IndexTableName index_table_name(mapper.table_name(), key_info.name); + grn_index_tables[i] = grn_ctx_get(ctx, + index_table_name.c_str(), + index_table_name.length()); + if (ctx->rc) { + DBUG_PRINT("info", + ("mroonga: sql_command=%u", thd_sql_command(ha_thd()))); + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error; + } + + grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i], + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME)); + if (!grn_index_columns[i]) { + /* just for backward compatibility before 1.0. */ + Field *field = key_info.key_part[0].field; + grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i], + field->field_name, + strlen(field->field_name)); + } + + if (ctx->rc) { + DBUG_PRINT("info", + ("mroonga: sql_command=%u", thd_sql_command(ha_thd()))); + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + grn_obj_unlink(ctx, grn_index_tables[i]); + goto error; + } + } + + grn_bulk_space(ctx, &key_buffer, table->key_info->key_length); + +error: + if (error) { + while (i-- > 0) { + grn_obj *index_column = grn_index_columns[i]; + if (index_column) { + grn_obj_unlink(ctx, index_column); + } + grn_obj *index_table = grn_index_tables[i]; + if (index_table) { + grn_obj_unlink(ctx, index_table); + } + } + free(grn_index_columns); + free(grn_index_tables); + grn_index_columns = NULL; + grn_index_tables = NULL; + } + + DBUG_RETURN(error); +} + +void ha_mroonga::wrapper_overwrite_index_bits() +{ + uint i, j; + longlong table_option = table_flags(); + MRN_DBUG_ENTER_METHOD(); + table_share->keys_for_keyread.clear_all(); + for (i = 0; i < table_share->fields; i++) + { + Field *field = table_share->field[i]; + field->part_of_key.clear_all(); + field->part_of_key_not_clustered.clear_all(); + field->part_of_sortkey.clear_all(); + } + for (i = 0; i < table_share->keys; i++) { + KEY *key_info = &table->s->key_info[i]; + KEY_PART_INFO *key_part = key_info->key_part; + for (j = 0 ; j < KEY_N_KEY_PARTS(key_info); key_part++, j++) + { + Field *field = key_part->field; + if (field->key_length() == key_part->length && + !(field->flags & BLOB_FLAG)) + { + if (index_flags(i, j, 0) & HA_KEYREAD_ONLY) + { + table_share->keys_for_keyread.set_bit(i); + field->part_of_key.set_bit(i); + field->part_of_key_not_clustered.set_bit(i); + } + if (index_flags(i, j, 1) & HA_READ_ORDER) + field->part_of_sortkey.set_bit(i); + } + if (i == table_share->primary_key && + (table_option & HA_PRIMARY_KEY_IN_READ_INDEX)) + { + if (field->key_length() == key_part->length && + !(field->flags & BLOB_FLAG)) + field->part_of_key = table_share->keys_in_use; + if (field->part_of_sortkey.is_set(i)) + field->part_of_sortkey = table_share->keys_in_use; + } + } + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + + error = ensure_database_open(name); + if (error) + DBUG_RETURN(error); + + error = open_table(name); + if (error) + DBUG_RETURN(error); + + error = storage_open_columns(); + if (error) { + grn_obj_unlink(ctx, grn_table); + grn_table = NULL; + DBUG_RETURN(error); + } + + error = storage_open_indexes(name); + if (error) { + // TODO: free grn_columns and set NULL; + grn_obj_unlink(ctx, grn_table); + grn_table = NULL; + DBUG_RETURN(error); + } + + storage_set_keys_in_use(); + + ref_length = sizeof(grn_id); + DBUG_RETURN(0); +} + +void ha_mroonga::update_grn_table_is_referenced() +{ + MRN_DBUG_ENTER_METHOD(); + + grn_table_is_referenced = false; + + grn_table_cursor *cursor; + int flags = GRN_CURSOR_BY_ID | GRN_CURSOR_ASCENDING;; + cursor = grn_table_cursor_open(ctx, grn_ctx_db(ctx), + NULL, 0, + NULL, 0, + 0, -1, flags); + if (cursor) { + grn_id id; + grn_id grn_table_id; + + grn_table_id = grn_obj_id(ctx, grn_table); + while ((id = grn_table_cursor_next(ctx, cursor)) != GRN_ID_NIL) { + grn_obj *object; + grn_id range = GRN_ID_NIL; + + object = grn_ctx_at(ctx, id); + if (!object) { + ctx->rc = GRN_SUCCESS; + continue; + } + + switch (object->header.type) { + case GRN_COLUMN_FIX_SIZE: + case GRN_COLUMN_VAR_SIZE: + range = grn_obj_get_range(ctx, object); + break; + default: + break; + } + grn_obj_unlink(ctx, object); + + if (range == grn_table_id) { + grn_table_is_referenced = true; + break; + } + } + + grn_table_cursor_close(ctx, cursor); + } + + DBUG_VOID_RETURN; +} + +int ha_mroonga::open_table(const char *name) +{ + int error; + MRN_DBUG_ENTER_METHOD(); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + mrn::PathMapper mapper(name); + grn_table = grn_ctx_get(ctx, mapper.table_name(), strlen(mapper.table_name())); + if (ctx->rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + if (!grn_table) { + error = ER_CANT_OPEN_FILE; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "mroonga: failed to open table: <%s>", + mapper.table_name()); + my_message(error, error_message, MYF(0)); + DBUG_RETURN(error); + } + + update_grn_table_is_referenced(); + + DBUG_RETURN(0); +} + +int ha_mroonga::storage_open_columns(void) +{ + int error; + MRN_DBUG_ENTER_METHOD(); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + int n_columns = table->s->fields; + grn_columns = (grn_obj **)malloc(sizeof(grn_obj *) * n_columns); + grn_column_ranges = (grn_obj **)malloc(sizeof(grn_obj *) * n_columns); + if (table_share->blob_fields) + { + if (blob_buffers) + { + delete [] blob_buffers; + } + if (!(blob_buffers = new String[n_columns])) + { + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + } + + int i; + for (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); + if (table_share->blob_fields) + { + blob_buffers[i].set_charset(field->charset()); + } + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + grn_columns[i] = NULL; + grn_column_ranges[i] = NULL; + continue; + } + + grn_columns[i] = grn_obj_column(ctx, grn_table, + column_name, column_name_size); + grn_id range_id = grn_obj_get_range(ctx, grn_columns[i]); + grn_column_ranges[i] = grn_ctx_at(ctx, range_id); + if (ctx->rc) { + // TODO: free grn_columns and set NULL; + int error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + } + + DBUG_RETURN(0); +} + +int ha_mroonga::storage_open_indexes(const char *name) +{ + int error; + + MRN_DBUG_ENTER_METHOD(); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + uint n_keys = table->s->keys; + uint pkey_nr = table->s->primary_key; + if (n_keys > 0) { + grn_index_tables = (grn_obj **)malloc(sizeof(grn_obj *) * n_keys); + grn_index_columns = (grn_obj **)malloc(sizeof(grn_obj *) * n_keys); + key_id = (grn_id *)malloc(sizeof(grn_id) * n_keys); + del_key_id = (grn_id *)malloc(sizeof(grn_id) * n_keys); + } else { + grn_index_tables = grn_index_columns = NULL; + key_id = NULL; + del_key_id = NULL; + } + + mrn::PathMapper mapper(name); + uint i, j; + for (i = 0; i < n_keys; i++) { + if (i == pkey_nr) { + grn_index_tables[i] = grn_index_columns[i] = NULL; + continue; + } + + KEY key_info = table->s->key_info[i]; + if (KEY_N_KEY_PARTS(&key_info) > 1) { + KEY_PART_INFO *key_part = key_info.key_part; + for (j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + bitmap_set_bit(&multiple_column_key_bitmap, + key_part[j].field->field_index); + } + } + + MRN_SHARE *tmp_share; + tmp_share = mrn_get_share(name, table, &error); + if (tmp_share->index_table[i]) { + grn_index_tables[i] = grn_ctx_get(ctx, + tmp_share->index_table[i], + tmp_share->index_table_length[i]); + if (ctx->rc == GRN_SUCCESS) { + grn_index_columns[i] = grn_obj_column(ctx, + grn_index_tables[i], + key_info.name, + strlen(key_info.name)); + } + } else { + mrn::IndexTableName index_table_name(mapper.table_name(), key_info.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_columns[i] = grn_obj_column(ctx, + grn_index_tables[i], + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME)); + if (!grn_index_columns[i]) { + /* just for backward compatibility before 1.0. */ + Field *field = key_info.key_part[0].field; + grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i], + field->field_name, + strlen(field->field_name)); + } + } + } + mrn_free_share(tmp_share); + if (ctx->rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error; + } + + if (ctx->rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error; + } + } + +error: + if (error) { + if (i) { + while (true) { + grn_obj *index_column = grn_index_columns[i]; + if (index_column) { + grn_obj_unlink(ctx, index_column); + } + grn_obj *index_table = grn_index_tables[i]; + if (index_table) { + grn_obj_unlink(ctx, index_table); + } + if (!i) + break; + i--; + } + } + free(key_id); + free(del_key_id); + free(grn_index_columns); + free(grn_index_tables); + key_id = NULL; + del_key_id = NULL; + grn_index_columns = NULL; + grn_index_tables = NULL; + } + + DBUG_RETURN(error); +} + +int ha_mroonga::open(const char *name, int mode, uint test_if_locked) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + + if (!(share = mrn_get_share(name, table, &error))) + DBUG_RETURN(error); + thr_lock_data_init(&share->lock,&thr_lock_data,NULL); + + if (bitmap_init(&multiple_column_key_bitmap, NULL, table->s->fields, false)) + { + mrn_free_share(share); + share = NULL; + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + + if (share->wrapper_mode) + { + error = wrapper_open(name, mode, test_if_locked); + } else { + error = storage_open(name, mode, test_if_locked); + } + + if (error) + { + bitmap_free(&multiple_column_key_bitmap); + mrn_free_share(share); + share = NULL; + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_close() +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_HAVE_HA_CLOSE + error = wrap_handler->ha_close(); +#else + error = wrap_handler->close(); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + delete wrap_handler; + wrap_handler = NULL; + if (wrap_key_info) + { + my_free(wrap_key_info, MYF(0)); + wrap_key_info = NULL; + } + base_key_info = NULL; + free_root(&mem_root, MYF(0)); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_close() +{ + MRN_DBUG_ENTER_METHOD(); + grn_obj_unlink(ctx, grn_table); + // TODO: unlink elements + free(grn_columns); + // TODO: unlink elements + free(grn_column_ranges); + DBUG_RETURN(0); +} + +int ha_mroonga::close() +{ + int error = 0; + THD *thd = ha_thd(); + MRN_DBUG_ENTER_METHOD(); + + clear_indexes(); + + if (share->wrapper_mode) + { + error = wrapper_close(); + } else { + error = storage_close(); + } + + if (is_temporary_table_name(share->table_name)) { + TABLE_LIST table_list; + TABLE_SHARE *tmp_table_share; + int tmp_error; + /* no need to decode */ + mrn::PathMapper mapper(share->table_name); +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + 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); +#else + table_list.init_one_table(mapper.db_name(), mapper.mysql_table_name(), + TL_WRITE); +#endif + mrn_open_mutex_lock(NULL); + tmp_table_share = + mrn_create_tmp_table_share(&table_list, share->table_name, &tmp_error); + mrn_open_mutex_unlock(NULL); + if (!tmp_table_share) { + error = tmp_error; + } else if ((tmp_error = alter_share_add(share->table_name, + tmp_table_share))) { + error = tmp_error; + mrn_open_mutex_lock(NULL); + mrn_free_tmp_table_share(tmp_table_share); + mrn_open_mutex_unlock(NULL); + } + } + bitmap_free(&multiple_column_key_bitmap); + mrn_free_share(share); + share = NULL; + is_clone = false; + if ( + thd && + thd_sql_command(thd) == SQLCOM_FLUSH + ) { + /* flush tables */ + mrn::Lock lock(&mrn_open_tables_mutex); + if (!mrn_open_tables.records) + { + int tmp_error = close_databases(); + if (tmp_error) + error = tmp_error; + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_delete_table(const char *name, MRN_SHARE *tmp_share, + const char *table_name) +{ + int error = 0; + handler *hnd; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(tmp_share, tmp_share->table_share); + if (!(hnd = + tmp_share->hton->create(tmp_share->hton, tmp_share->table_share, + current_thd->mem_root))) + { + MRN_SET_BASE_SHARE_KEY(tmp_share, tmp_share->table_share); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + hnd->init(); + MRN_SET_BASE_SHARE_KEY(tmp_share, tmp_share->table_share); + + if ((error = hnd->ha_delete_table(name))) + { + delete hnd; + DBUG_RETURN(error); + } + + error = wrapper_delete_index(name, tmp_share, table_name); + + delete hnd; + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_delete_index(const char *name, MRN_SHARE *tmp_share, + const char *table_name) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + + error = ensure_database_open(name); + if (error) + DBUG_RETURN(error); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + TABLE_SHARE *tmp_table_share = tmp_share->table_share; + + uint i; + for (i = 0; i < tmp_table_share->keys; i++) { + error = drop_index(tmp_share, i); + if (error) { + DBUG_RETURN(error); + } + } + + grn_obj *table = grn_ctx_get(ctx, table_name, strlen(table_name)); + if (!ctx->rc) { + grn_obj_remove(ctx, table); + } + if (ctx->rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_delete_table(const char *name, MRN_SHARE *tmp_share, + const char *table_name) +{ + int error = 0; + TABLE_SHARE *tmp_table_share = tmp_share->table_share; + MRN_DBUG_ENTER_METHOD(); + + error = ensure_database_open(name); + if (error) + DBUG_RETURN(error); + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + uint i; + for (i = 0; i < tmp_table_share->keys; i++) { + error = drop_index(tmp_share, i); + if (error) { + DBUG_RETURN(error); + } + } + + grn_obj *table_obj = grn_ctx_get(ctx, table_name, strlen(table_name)); + if (!ctx->rc) { + grn_obj_remove(ctx, table_obj); + } + if (ctx->rc) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + DBUG_RETURN(error); +} + +int ha_mroonga::delete_table(const char *name) +{ + int error = 0; + THD *thd = ha_thd(); + TABLE_LIST table_list; + TABLE_SHARE *tmp_table_share = NULL; + TABLE tmp_table; + MRN_SHARE *tmp_share; + st_mrn_alter_share *alter_share, *tmp_alter_share; + MRN_DBUG_ENTER_METHOD(); + mrn::PathMapper mapper(name); + st_mrn_slot_data *slot_data = mrn_get_slot_data(thd, false); + if (slot_data && slot_data->first_alter_share) + { + tmp_alter_share = NULL; + alter_share = slot_data->first_alter_share; + while (alter_share) + { + if (!strcmp(alter_share->path, name)) + { + /* found */ + tmp_table_share = alter_share->alter_share; + if (tmp_alter_share) + tmp_alter_share->next = alter_share->next; + else + slot_data->first_alter_share = alter_share->next; + free(alter_share); + break; + } + tmp_alter_share = alter_share; + alter_share = alter_share->next; + } + } + if (!tmp_table_share) + { + mrn::PathMapper mapper(name); +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + 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); +#else + table_list.init_one_table(mapper.db_name(), mapper.mysql_table_name(), + TL_WRITE); +#endif + mrn_open_mutex_lock(NULL); + tmp_table_share = mrn_create_tmp_table_share(&table_list, name, &error); + mrn_open_mutex_unlock(NULL); + if (!tmp_table_share) { + DBUG_RETURN(error); + } + } + tmp_table.s = tmp_table_share; +#ifdef WITH_PARTITION_STORAGE_ENGINE + tmp_table.part_info = NULL; +#endif + if (!(tmp_share = mrn_get_share(name, &tmp_table, &error))) + { + mrn_open_mutex_lock(NULL); + mrn_free_tmp_table_share(tmp_table_share); + mrn_open_mutex_unlock(NULL); + DBUG_RETURN(error); + } + + if (tmp_share->wrapper_mode) + { + error = wrapper_delete_table(name, tmp_share, mapper.table_name()); + } else { + error = storage_delete_table(name, tmp_share, mapper.table_name()); + } + + if (!error) { + 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 (is_temporary_table_name(name)) { + mrn_drop_db(name); + } + DBUG_RETURN(error); +} + +void ha_mroonga::wrapper_set_keys_in_use() +{ + uint i, j; + MRN_DBUG_ENTER_METHOD(); + mrn::AutoIncrementValueLock lock_(table_share); + table_share->keys_in_use.set_prefix(table_share->keys); + share->disable_keys = false; + for (i = 0; i < table_share->keys; i++) { + j = share->wrap_key_nr[i]; + if (j < MAX_KEY) { + if (!share->wrap_table_share->keys_in_use.is_set(j)) { + /* copy bitmap */ + table_share->keys_in_use.clear_bit(i); + share->disable_keys = true; + } + } else { + if (!grn_index_tables || !grn_index_tables[i]) { + /* disabled */ + table_share->keys_in_use.clear_bit(i); + share->disable_keys = true; + } + } + } + table_share->keys_for_keyread.set_prefix(table_share->keys); + table_share->keys_for_keyread.intersect(table_share->keys_in_use); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_set_keys_in_use() +{ + uint i; + MRN_DBUG_ENTER_METHOD(); + mrn::AutoIncrementValueLock lock_(table_share); + table_share->keys_in_use.set_prefix(table_share->keys); + share->disable_keys = false; + for (i = 0; i < table_share->keys; i++) { + if (i == table_share->primary_key) { + continue; + } + if (!grn_index_tables[i]) { + /* disabled */ + table_share->keys_in_use.clear_bit(i); + DBUG_PRINT("info", ("mroonga: key %u disabled", i)); + share->disable_keys = true; + } + } + table_share->keys_for_keyread.set_prefix(table_share->keys); + table_share->keys_for_keyread.intersect(table_share->keys_in_use); + DBUG_VOID_RETURN; +} + +int ha_mroonga::wrapper_info(uint flag) +{ + 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->info(flag); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (flag & HA_STATUS_ERRKEY) { + errkey = wrap_handler->errkey; + memcpy(dup_ref, wrap_handler->dup_ref, wrap_handler->ref_length); + } + if (flag & HA_STATUS_TIME) { + stats.update_time = wrap_handler->stats.update_time; + } + if (flag & HA_STATUS_CONST) { + stats.max_data_file_length = wrap_handler->stats.max_data_file_length; + stats.create_time = wrap_handler->stats.create_time; + stats.block_size = wrap_handler->stats.block_size; + wrapper_set_keys_in_use(); + } + if (flag & HA_STATUS_VARIABLE) { + stats.data_file_length = wrap_handler->stats.data_file_length; + stats.index_file_length = wrap_handler->stats.index_file_length; + stats.records = wrap_handler->stats.records; + stats.mean_rec_length = wrap_handler->stats.mean_rec_length; + stats.check_time = wrap_handler->stats.check_time; + } + if (flag & HA_STATUS_AUTO) { + stats.auto_increment_value = wrap_handler->stats.auto_increment_value; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_info(uint flag) +{ + MRN_DBUG_ENTER_METHOD(); + mrn_change_encoding(ctx, NULL); + + if (flag & (HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK)) { + errkey = dup_key; + } + + if ((flag & HA_STATUS_AUTO) && table->found_next_number_field) { + THD *thd = ha_thd(); + ulonglong nb_reserved_values; + bool next_number_field_is_null = !table->next_number_field; + mrn::ExternalLock mrn_external_lock(ha_thd(), this, + mrn_lock_type == F_UNLCK ? + F_RDLCK : F_UNLCK); + if (mrn_external_lock.error()) { + DBUG_RETURN(mrn_external_lock.error()); + } + if (next_number_field_is_null) { + table->next_number_field = table->found_next_number_field; + } + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + { + mrn::Lock lock(&long_term_share->auto_inc_mutex); + unsigned long auto_increment_offset, auto_increment_increment; + MRN_THD_GET_AUTOINC(thd, &auto_increment_offset, + &auto_increment_increment); + storage_get_auto_increment(auto_increment_offset, + auto_increment_increment, 1, + &stats.auto_increment_value, + &nb_reserved_values); + } + if (next_number_field_is_null) { + table->next_number_field = NULL; + } + } + + if (flag & HA_STATUS_CONST) { + storage_set_keys_in_use(); + } + + if (flag & HA_STATUS_VARIABLE) { + storage_info_variable(); + } + + DBUG_RETURN(0); +} + +void ha_mroonga::storage_info_variable() +{ + MRN_DBUG_ENTER_METHOD(); + + storage_info_variable_records(); + storage_info_variable_data_file_length(); + + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_info_variable_records() +{ + MRN_DBUG_ENTER_METHOD(); + + stats.records = grn_table_size(ctx, grn_table); + + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_info_variable_data_file_length() +{ + MRN_DBUG_ENTER_METHOD(); + + stats.data_file_length = 0; + stats.data_file_length += file_size(grn_obj_path(ctx, grn_table)); + grn_hash *columns = grn_hash_create(ctx, NULL, sizeof(grn_id), 0, + GRN_OBJ_TABLE_HASH_KEY); + grn_table_columns(ctx, grn_table, NULL, 0, (grn_obj *)columns); + /* grn_id id __attribute__((unused)); */ + grn_id *column_id; + GRN_HASH_EACH(ctx, columns, id, &column_id, NULL, NULL, { + grn_obj *column = grn_ctx_at(ctx, *column_id); + stats.data_file_length += file_size(grn_obj_path(ctx, column)); + grn_obj_unlink(ctx, column); + }); + grn_hash_close(ctx, columns); + + DBUG_VOID_RETURN; +} + +int ha_mroonga::info(uint flag) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_info(flag); + } else { + error = storage_info(flag); + } + DBUG_RETURN(error); +} + +uint ha_mroonga::wrapper_lock_count() const +{ + uint lock_count; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + lock_count = wrap_handler->lock_count(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(lock_count); +} + +uint ha_mroonga::storage_lock_count() const +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(1); +} + +uint ha_mroonga::lock_count() const +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_lock_count(); + } else { + error = storage_lock_count(); + } + DBUG_RETURN(error); +} + +THR_LOCK_DATA **ha_mroonga::wrapper_store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + to = wrap_handler->store_lock(thd, to, lock_type); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(to); +} + +THR_LOCK_DATA **ha_mroonga::storage_store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + MRN_DBUG_ENTER_METHOD(); + if (lock_type != TL_IGNORE && thr_lock_data.type == TL_UNLOCK) { + if (!thd_in_lock_tables(thd)) { + if (lock_type == TL_READ_NO_INSERT) { + lock_type = TL_READ; + } else if (lock_type >= TL_WRITE_CONCURRENT_INSERT && + lock_type <= TL_WRITE && !thd_tablespace_op(thd)) { + lock_type = TL_WRITE_ALLOW_WRITE; + } + } + + thr_lock_data.type = lock_type; + } + *to++ = &thr_lock_data; + DBUG_RETURN(to); +} + +THR_LOCK_DATA **ha_mroonga::store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: lock_type=%s", + mrn_inspect_thr_lock_type(lock_type))); + if (share->wrapper_mode) + to = wrapper_store_lock(thd, to, lock_type); + else + to = storage_store_lock(thd, to, lock_type); + DBUG_RETURN(to); +} + +int ha_mroonga::wrapper_external_lock(THD *thd, int lock_type) +{ + 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_external_lock(thd, lock_type); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_external_lock(THD *thd, int lock_type) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::external_lock(THD *thd, int lock_type) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + mrn_lock_type = lock_type; + if (share->wrapper_mode) + { + error = wrapper_external_lock(thd, lock_type); + } else { + error = storage_external_lock(thd, lock_type); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_rnd_init(bool scan) +{ + 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_rnd_init(scan); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_rnd_init(bool scan) +{ + MRN_DBUG_ENTER_METHOD(); + mrn_change_encoding(ctx, NULL); + cursor = grn_table_cursor_open(ctx, grn_table, NULL, 0, NULL, 0, 0, -1, 0); + if (ctx->rc) { + my_message(ER_ERROR_ON_READ, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_READ); + } + DBUG_RETURN(0); +} + +int ha_mroonga::rnd_init(bool scan) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_rnd_init(scan); + } else { + error = storage_rnd_init(scan); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_rnd_end() +{ + 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_rnd_end(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_rnd_end() +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor(); + DBUG_RETURN(0); +} + +int ha_mroonga::rnd_end() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_rnd_end(); + } else { + error = storage_rnd_end(); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_rnd_next(uchar *buf) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_RND_NEXT + error = wrap_handler->ha_rnd_next(buf); +#else + error = wrap_handler->rnd_next(buf); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_rnd_next(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = storage_get_next_record(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::rnd_next(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_rnd_next(buf); + } else { + error = storage_rnd_next(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_rnd_pos(uchar *buf, uchar *pos) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_HAVE_HA_RND_POS + error = wrap_handler->ha_rnd_pos(buf, pos); +#else + error = wrap_handler->rnd_pos(buf, pos); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_rnd_pos(uchar *buf, uchar *pos) +{ + MRN_DBUG_ENTER_METHOD(); + record_id = *((grn_id*) pos); + storage_store_fields(buf, record_id); + DBUG_RETURN(0); +} + +int ha_mroonga::rnd_pos(uchar *buf, uchar *pos) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_rnd_pos(buf, pos); + } else { + error = storage_rnd_pos(buf, pos); + } + DBUG_RETURN(error); +} + +void ha_mroonga::wrapper_position(const uchar *record) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->ref = ref; + wrap_handler->position(record); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_position(const uchar *record) +{ + MRN_DBUG_ENTER_METHOD(); + memcpy(ref, &record_id, sizeof(grn_id)); + DBUG_VOID_RETURN; +} + +void ha_mroonga::position(const uchar *record) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + wrapper_position(record); + else + storage_position(record); + DBUG_VOID_RETURN; +} + +int ha_mroonga::generic_extra(enum ha_extra_function operation) +{ + MRN_DBUG_ENTER_METHOD(); + switch (operation) { + case HA_EXTRA_IGNORE_DUP_KEY: + ignoring_duplicated_key = true; + break; + case HA_EXTRA_NO_IGNORE_DUP_KEY: + ignoring_duplicated_key = false; + break; + case HA_EXTRA_WRITE_CAN_REPLACE: + replacing_ = true; + break; + case HA_EXTRA_WRITE_CANNOT_REPLACE: + replacing_ = false; + break; + case HA_EXTRA_INSERT_WITH_UPDATE: + inserting_with_update = true; + break; + case HA_EXTRA_KEYREAD: + ignoring_no_key_columns = true; + break; + case HA_EXTRA_NO_KEYREAD: + ignoring_no_key_columns = false; + break; + default: + break; + } + DBUG_RETURN(0); +} + +int ha_mroonga::wrapper_extra(enum ha_extra_function operation) +{ + 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->extra(operation); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_extra(enum ha_extra_function operation) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::extra(enum ha_extra_function operation) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", + ("mroonga: this=%p; extra-operation=%s", + this, mrn_inspect_extra_function(operation))); + if (share->wrapper_mode) { + if ((error = wrapper_extra(operation))) + DBUG_RETURN(error); + } else { + if ((error = storage_extra(operation))) + DBUG_RETURN(error); + } + error = generic_extra(operation); + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_extra_opt(enum ha_extra_function operation, + ulong cache_size) +{ + 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->extra_opt(operation, cache_size); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_extra_opt(enum ha_extra_function operation, + ulong cache_size) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::extra_opt(enum ha_extra_function operation, ulong cache_size) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + if ((error = wrapper_extra_opt(operation, cache_size))) + DBUG_RETURN(error); + } else { + if ((error = storage_extra_opt(operation, cache_size))) + DBUG_RETURN(error); + } + error = generic_extra(operation); + DBUG_RETURN(error); +} + +bool ha_mroonga::wrapper_is_target_index(KEY *key_info) +{ + MRN_DBUG_ENTER_METHOD(); + bool target_index = + (key_info->algorithm == HA_KEY_ALG_FULLTEXT) || mrn_is_geo_key(key_info); + DBUG_PRINT("info", ("mroonga: %s", target_index ? "true" : "false")); + DBUG_RETURN(target_index); +} + +bool ha_mroonga::wrapper_have_target_index() +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_target_index = false; + + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (wrapper_is_target_index(&key_info)) { + have_target_index = true; + break; + } + } + + DBUG_PRINT("info", ("mroonga: %s", have_target_index ? "true" : "false")); + DBUG_RETURN(have_target_index); +} + +int ha_mroonga::wrapper_write_row(uchar *buf) +{ + int error = 0; + THD *thd = ha_thd(); + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + tmp_disable_binlog(thd); + error = wrap_handler->ha_write_row(buf); + insert_id_for_cur_row = wrap_handler->insert_id_for_cur_row; + reenable_binlog(thd); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + if (!error && wrapper_have_target_index()) { + error = wrapper_write_row_index(buf); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_write_row_index(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + mrn_change_encoding(ctx, NULL); + GRN_BULK_REWIND(&key_buffer); + grn_bulk_space(ctx, &key_buffer, table->key_info->key_length); + key_copy((uchar *)(GRN_TEXT_VALUE(&key_buffer)), + buf, + &(table->key_info[table_share->primary_key]), + table->key_info[table_share->primary_key].key_length); + + int added; + grn_id record_id; + record_id = grn_table_add(ctx, grn_table, + GRN_TEXT_VALUE(&key_buffer), + GRN_TEXT_LEN(&key_buffer), + &added); + if (record_id == GRN_ID_NIL) { + DBUG_PRINT("info", ("mroonga: failed to add a new record into groonga")); + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to add a new record into groonga: key=<%.*s>", + (int)GRN_TEXT_LEN(&key_buffer), + GRN_TEXT_VALUE(&key_buffer)); + error = ER_ERROR_ON_WRITE; + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, error, + error_message); + DBUG_RETURN(0); + } + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + continue; + } + + uint j; + for (j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + + if (field->is_null()) + continue; + + error = mrn_change_encoding(ctx, field->charset()); + if (error) + goto err; + error = generic_store_bulk(field, &new_value_buffer); + if (error) { + my_message(error, + "mroonga: wrapper: " + "failed to get new value for updating index.", + MYF(0)); + goto err; + } + + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, j + 1, + NULL, &new_value_buffer); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } + } +err: + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_write_row(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + THD *thd = ha_thd(); + int i; + uint j; + int n_columns = table->s->fields; + + if (table->next_number_field && buf == table->record[0]) + { + if ((error = update_auto_increment())) + DBUG_RETURN(error); + } + + 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; + + if (field->is_null()) continue; + + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, MRN_GET_ERR_MSG(WARN_DATA_TRUNCATED), + MRN_COLUMN_NAME_ID, + MRN_GET_CURRENT_ROW_FOR_WARNING(thd)); + if (MRN_ABORT_ON_WARNING(thd)) { + DBUG_RETURN(ER_DATA_TOO_LONG); + } + } + } + + char *pkey; + int pkey_size; + uint pkey_nr; + pkey_nr = table->s->primary_key; + GRN_BULK_REWIND(&key_buffer); + if (pkey_nr == MAX_INDEXES) { + pkey = NULL; + pkey_size = 0; + } else { + KEY key_info = table->key_info[pkey_nr]; + if (KEY_N_KEY_PARTS(&key_info) == 1) { + Field *pkey_field = key_info.key_part[0].field; + error = mrn_change_encoding(ctx, pkey_field->charset()); + if (error) { + DBUG_RETURN(error); + } + generic_store_bulk(pkey_field, &key_buffer); + pkey = GRN_TEXT_VALUE(&key_buffer); + pkey_size = GRN_TEXT_LEN(&key_buffer); + } else { + mrn_change_encoding(ctx, NULL); + uchar key[MRN_MAX_KEY_SIZE]; + key_copy(key, buf, &key_info, key_info.key_length); + grn_bulk_space(ctx, &key_buffer, key_info.key_length); + pkey = GRN_TEXT_VALUE(&key_buffer); + storage_encode_multiple_column_key(&key_info, + key, key_info.key_length, + (uchar *)pkey, (uint *)&pkey_size); + } + } + + int added; + record_id = grn_table_add(ctx, grn_table, pkey, pkey_size, &added); + if (ctx->rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_WRITE); + } + if (!added) { + // duplicated error + error = HA_ERR_FOUND_DUPP_KEY; + memcpy(dup_ref, &record_id, sizeof(grn_id)); + dup_key = pkey_nr; + if (!ignoring_duplicated_key) { + GRN_LOG(ctx, GRN_LOG_ERROR, + "duplicated id on insert: update primary key: <%.*s>", + pkey_size, pkey); + } + DBUG_RETURN(error); + } + + if ((error = storage_write_row_unique_indexes(buf))) + { + goto err; + } + + 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 HAVE_SPATIAL + bool is_null_geometry_value = + field->real_type() == MYSQL_TYPE_GEOMETRY && + static_cast(field)->get_length() == 0; + if (is_null_geometry_value) { + continue; + } +#endif + + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + continue; + } + + error = mrn_change_encoding(ctx, field->charset()); + if (error) { + grn_obj_unlink(ctx, &colbuf); + goto err; + } + error = generic_store_bulk(field, &colbuf); + if (error) { + grn_obj_unlink(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_set_value(ctx, grn_columns[i], record_id, &colbuf, GRN_OBJ_SET); + if (ctx->rc) { + grn_obj_unlink(ctx, &colbuf); + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + error = ER_ERROR_ON_WRITE; + goto err; + } + } + grn_obj_unlink(ctx, &colbuf); + + error = storage_write_row_multiple_column_indexes(buf, record_id); + if (error) { + goto err; + } + + // for UDF last_insert_grn_id() + st_mrn_slot_data *slot_data; + slot_data = mrn_get_slot_data(thd, true); + if (slot_data == NULL) { + error = HA_ERR_OUT_OF_MEM; + goto err; + } + slot_data->last_insert_record_id = record_id; + + grn_db_touch(ctx, grn_ctx_db(ctx)); + + if (table->found_next_number_field && + !table->s->next_number_keypart) { + Field_num *field = (Field_num *) table->found_next_number_field; + if (field->unsigned_flag || field->val_int() > 0) { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + ulonglong nr = (ulonglong) field->val_int(); + if (!long_term_share->auto_inc_inited) { + storage_info(HA_STATUS_AUTO); + } + { + mrn::Lock lock(&long_term_share->auto_inc_mutex); + if (long_term_share->auto_inc_value <= nr) { + long_term_share->auto_inc_value = nr + 1; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + } + } + } + } + DBUG_RETURN(0); + +err: + for (j = 0; j < table->s->keys; j++) { + if (j == pkey_nr) { + continue; + } + KEY *key_info = &table->key_info[j]; + if (key_info->flags & HA_NOSAME) { + grn_table_delete_by_id(ctx, grn_index_tables[j], key_id[j]); + } + } + grn_table_delete_by_id(ctx, grn_table, record_id); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_write_row_multiple_column_index(uchar *buf, + grn_id record_id, + KEY *key_info, + grn_obj *index_column) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + mrn_change_encoding(ctx, NULL); + GRN_BULK_REWIND(&key_buffer); + grn_bulk_space(ctx, &key_buffer, key_info->key_length); + key_copy((uchar *)(GRN_TEXT_VALUE(&key_buffer)), + buf, + key_info, + key_info->key_length); + GRN_BULK_REWIND(&encoded_key_buffer); + grn_bulk_space(ctx, &encoded_key_buffer, key_info->key_length); + uint encoded_key_length; + storage_encode_multiple_column_key(key_info, + (uchar *)(GRN_TEXT_VALUE(&key_buffer)), + key_info->key_length, + (uchar *)(GRN_TEXT_VALUE(&encoded_key_buffer)), + &encoded_key_length); + DBUG_PRINT("info", ("mroonga: key_length=%u", key_info->key_length)); + DBUG_PRINT("info", ("mroonga: encoded_key_length=%u", encoded_key_length)); + DBUG_ASSERT(key_info->key_length >= encoded_key_length); + + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, 1, NULL, + &encoded_key_buffer); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_write_row_multiple_column_indexes(uchar *buf, + grn_id record_id) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + if (i == table->s->primary_key) { + continue; + } + + KEY key_info = table->key_info[i]; + + if (KEY_N_KEY_PARTS(&key_info) == 1 || (key_info.flags & HA_FULLTEXT)) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + continue; + } + + if ((error = storage_write_row_multiple_column_index(buf, + record_id, + &key_info, + index_column))) + { + goto err; + } + } + +err: + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_write_row_unique_index(uchar *buf, + KEY *key_info, + grn_obj *index_table, + grn_id *key_id) +{ + char *ukey = NULL; + int error, ukey_size = 0; + MRN_DBUG_ENTER_METHOD(); + GRN_BULK_REWIND(&key_buffer); + if (KEY_N_KEY_PARTS(key_info) == 1) { + Field *ukey_field = key_info->key_part[0].field; + error = mrn_change_encoding(ctx, ukey_field->charset()); + if (error) { + DBUG_RETURN(error); + } + generic_store_bulk(ukey_field, &key_buffer); + ukey = GRN_TEXT_VALUE(&key_buffer); + ukey_size = GRN_TEXT_LEN(&key_buffer); + } else { + mrn_change_encoding(ctx, NULL); + uchar key[MRN_MAX_KEY_SIZE]; + key_copy(key, buf, key_info, key_info->key_length); + grn_bulk_space(ctx, &key_buffer, key_info->key_length); + ukey = GRN_TEXT_VALUE(&key_buffer); + storage_encode_multiple_column_key(key_info, + key, key_info->key_length, + (uchar *)(ukey), (uint *)&ukey_size); + } + + int added; + *key_id = grn_table_add(ctx, index_table, ukey, ukey_size, &added); + if (ctx->rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_WRITE); + } + if (!added) { + // duplicated error + error = HA_ERR_FOUND_DUPP_KEY; + memcpy(dup_ref, key_id, sizeof(grn_id)); + if (!ignoring_duplicated_key) { + GRN_LOG(ctx, GRN_LOG_ERROR, + "duplicated id on insert: update unique index: <%.*s>", + ukey_size, ukey); + } + DBUG_RETURN(error); + } + DBUG_RETURN(0); +} + +int ha_mroonga::storage_write_row_unique_indexes(uchar *buf) +{ + int error = 0; + uint i; + uint n_keys = table->s->keys; + MRN_DBUG_ENTER_METHOD(); + + for (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; + } + + if ((error = storage_write_row_unique_index(buf, key_info, + index_table, &key_id[i]))) + { + if (error == HA_ERR_FOUND_DUPP_KEY) + { + dup_key = i; + } + goto err; + } + } + DBUG_RETURN(0); + +err: + if (i) { + mrn_change_encoding(ctx, NULL); + do { + i--; + KEY *key_info = &table->key_info[i]; + if (key_info->flags & HA_NOSAME) { + grn_table_delete_by_id(ctx, grn_index_tables[i], key_id[i]); + } + } while (i); + } + DBUG_RETURN(error); +} + +int ha_mroonga::write_row(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_write_row(buf); + } else { + error = storage_write_row(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_get_record_id(uchar *data, grn_id *record_id, + const char *context) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + grn_obj key; + GRN_TEXT_INIT(&key, 0); + + mrn_change_encoding(ctx, NULL); + grn_bulk_space(ctx, &key, table->key_info->key_length); + key_copy((uchar *)(GRN_TEXT_VALUE(&key)), + data, + &(table->key_info[table_share->primary_key]), + table->key_info[table_share->primary_key].key_length); + + *record_id = grn_table_get(ctx, grn_table, + GRN_TEXT_VALUE(&key), GRN_TEXT_LEN(&key)); + if (*record_id == GRN_ID_NIL) { + DBUG_PRINT("info", ("mroonga: %s", context)); + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "%s: key=<%.*s>", + context, (int)GRN_TEXT_LEN(&key), GRN_TEXT_VALUE(&key)); + error = ER_ERROR_ON_WRITE; + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, error, + error_message); + } + grn_obj_unlink(ctx, &key); + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_update_row(const uchar *old_data, uchar *new_data) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + THD *thd = ha_thd(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + tmp_disable_binlog(thd); + error = wrap_handler->ha_update_row(old_data, new_data); + reenable_binlog(thd); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + if (!error && wrapper_have_target_index()) { + error = wrapper_update_row_index(old_data, new_data); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + mrn_change_encoding(ctx, NULL); + KEY key_info = table->key_info[table_share->primary_key]; + GRN_BULK_REWIND(&key_buffer); + key_copy((uchar *)(GRN_TEXT_VALUE(&key_buffer)), + new_data, + &key_info, key_info.key_length); + int added; + grn_id new_record_id; + new_record_id = grn_table_add(ctx, grn_table, + GRN_TEXT_VALUE(&key_buffer), + table->key_info->key_length, + &added); + if (new_record_id == GRN_ID_NIL) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to get new record ID for updating from groonga: key=<%.*s>", + (int)GRN_TEXT_LEN(&key_buffer), GRN_TEXT_VALUE(&key_buffer)); + error = ER_ERROR_ON_WRITE; + my_message(error, error_message, MYF(0)); + DBUG_RETURN(error); + } + + grn_id old_record_id; + my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(old_data, table->record[0]); + for (uint j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + field->move_field_offset(ptr_diff); + } + error = wrapper_get_record_id((uchar *)old_data, &old_record_id, + "failed to get old record ID " + "for updating from groonga"); + for (uint j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + field->move_field_offset(-ptr_diff); + } + if (error) { + DBUG_RETURN(0); + } + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + /* disable keys */ + continue; + } + + uint j; + for (j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + + generic_store_bulk(field, &new_value_buffer); + + field->move_field_offset(ptr_diff); + generic_store_bulk(field, &old_value_buffer); + field->move_field_offset(-ptr_diff); + + grn_rc rc; + if (old_record_id == new_record_id) { + if (added) { + rc = grn_column_index_update(ctx, index_column, old_record_id, j + 1, + &old_value_buffer, NULL); + if (!rc) { + rc = grn_column_index_update(ctx, index_column, new_record_id, j + 1, + NULL, &new_value_buffer); + } + } else { + rc = grn_column_index_update(ctx, index_column, old_record_id, j + 1, + &old_value_buffer, &new_value_buffer); + } + } else { + rc = grn_column_index_update(ctx, index_column, old_record_id, j + 1, + &old_value_buffer, NULL); + if (!rc) { + rc = grn_column_index_update(ctx, index_column, new_record_id, j + 1, + NULL, &new_value_buffer); + } + if (!rc) { + rc = grn_table_delete_by_id(ctx, grn_table, old_record_id); + } + } + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } + } +err: + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + grn_obj colbuf; + int i; + uint j; + int n_columns = table->s->fields; + THD *thd = ha_thd(); + + 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) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, MRN_GET_ERR_MSG(WARN_DATA_TRUNCATED), + MRN_COLUMN_NAME_ID, + MRN_GET_CURRENT_ROW_FOR_WARNING(thd)); + if (MRN_ABORT_ON_WARNING(thd)) { + DBUG_RETURN(ER_DATA_TOO_LONG); + } + } + } + } + + KEY *pkey_info = NULL; + storage_store_fields_for_prep_update(old_data, new_data, record_id); + { + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + if ((error = storage_prepare_delete_row_unique_indexes(old_data, + record_id))) { + DBUG_RETURN(error); + } + if ((error = storage_update_row_unique_indexes(new_data))) + { + DBUG_RETURN(error); + } + } + + if (table->s->primary_key != MAX_INDEXES) { + pkey_info = &(table->key_info[table->s->primary_key]); + } + GRN_VOID_INIT(&colbuf); + 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)) { + 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) { + continue; + } + + error = mrn_change_encoding(ctx, field->charset()); + if (error) + goto err; + + bool on_duplicate_key_update = + (inserting_with_update && ignoring_duplicated_key); + if (!on_duplicate_key_update && pkey_info) { + bool have_pkey = false; + 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, Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, message); + } + have_pkey = true; + } + } + if (have_pkey) { + continue; + } + } + + generic_store_bulk(field, &colbuf); + grn_obj_set_value(ctx, grn_columns[i], record_id, &colbuf, GRN_OBJ_SET); + if (ctx->rc) { + grn_obj_unlink(ctx, &colbuf); + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + error = ER_ERROR_ON_WRITE; + goto err; + } + } + } + grn_obj_unlink(ctx, &colbuf); + + if ((error = storage_update_row_index(old_data, new_data))) + { + goto err; + } + + if ((error = storage_delete_row_unique_indexes())) + { + DBUG_RETURN(error); + } + + grn_db_touch(ctx, grn_ctx_db(ctx)); + + if (table->found_next_number_field && + !table->s->next_number_keypart && + new_data == table->record[0]) { + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + Field_num *field = (Field_num *) table->found_next_number_field; + if (field->unsigned_flag || field->val_int() > 0) { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + ulonglong nr = (ulonglong) field->val_int(); + if (!long_term_share->auto_inc_inited) { + storage_info(HA_STATUS_AUTO); + } + { + mrn::Lock lock(&long_term_share->auto_inc_mutex); + if (long_term_share->auto_inc_value <= nr) { + long_term_share->auto_inc_value = nr + 1; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + } + } + } + } + DBUG_RETURN(0); + +err: + for (j = 0; j < table->s->keys; j++) { + if (j == table->s->primary_key) { + continue; + } + KEY *key_info = &table->key_info[j]; + if ((key_info->flags & HA_NOSAME) && key_id[j] != GRN_ID_NIL) { + grn_table_delete_by_id(ctx, grn_index_tables[j], key_id[j]); + } + } + + if (!error && thd_sql_command(ha_thd()) == SQLCOM_TRUNCATE) { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + mrn::Lock lock(&long_term_share->auto_inc_mutex); + long_term_share->auto_inc_value = 0; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + long_term_share->auto_inc_inited = false; + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_update_row_index(const uchar *old_data, uchar *new_data) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + grn_obj old_key, old_encoded_key, new_key, new_encoded_key; + GRN_TEXT_INIT(&old_key, 0); + GRN_TEXT_INIT(&old_encoded_key, 0); + GRN_TEXT_INIT(&new_key, 0); + GRN_TEXT_INIT(&new_encoded_key, 0); + + my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(old_data, table->record[0]); + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + mrn_change_encoding(ctx, NULL); + for (i = 0; i < n_keys; i++) { + if (i == table->s->primary_key) { + continue; + } + + KEY key_info = table->key_info[i]; + + if (KEY_N_KEY_PARTS(&key_info) == 1 || (key_info.flags & HA_FULLTEXT)) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + /* disable keys */ + continue; + } + + GRN_BULK_REWIND(&old_key); + grn_bulk_space(ctx, &old_key, key_info.key_length); + for (uint j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + field->move_field_offset(ptr_diff); + } + key_copy((uchar *)(GRN_TEXT_VALUE(&old_key)), + (uchar *)old_data, + &key_info, + key_info.key_length); + for (uint j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + field->move_field_offset(-ptr_diff); + } + GRN_BULK_REWIND(&old_encoded_key); + grn_bulk_space(ctx, &old_encoded_key, key_info.key_length); + uint old_encoded_key_length; + storage_encode_multiple_column_key(&key_info, + (uchar *)(GRN_TEXT_VALUE(&old_key)), + key_info.key_length, + (uchar *)(GRN_TEXT_VALUE(&old_encoded_key)), + &old_encoded_key_length); + + GRN_BULK_REWIND(&new_key); + grn_bulk_space(ctx, &new_key, key_info.key_length); + key_copy((uchar *)(GRN_TEXT_VALUE(&new_key)), + (uchar *)new_data, + &key_info, + key_info.key_length); + GRN_BULK_REWIND(&new_encoded_key); + grn_bulk_space(ctx, &new_encoded_key, key_info.key_length); + uint new_encoded_key_length; + storage_encode_multiple_column_key(&key_info, + (uchar *)(GRN_TEXT_VALUE(&new_key)), + key_info.key_length, + (uchar *)(GRN_TEXT_VALUE(&new_encoded_key)), + &new_encoded_key_length); + + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, 1, + &old_encoded_key, &new_encoded_key); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } +err: + grn_obj_unlink(ctx, &old_key); + grn_obj_unlink(ctx, &old_encoded_key); + grn_obj_unlink(ctx, &new_key); + grn_obj_unlink(ctx, &new_encoded_key); + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_update_row_unique_indexes(uchar *new_data) +{ + int error; + uint i; + uint n_keys = table->s->keys; + MRN_DBUG_ENTER_METHOD(); + + for (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) { + key_id[i] = GRN_ID_NIL; + del_key_id[i] = GRN_ID_NIL; + continue; + } + + if ( + KEY_N_KEY_PARTS(key_info) == 1 && + !bitmap_is_set(table->write_set, + key_info->key_part[0].field->field_index) + ) { + /* no change */ + key_id[i] = GRN_ID_NIL; + del_key_id[i] = GRN_ID_NIL; + continue; + } + + if ((error = storage_write_row_unique_index(new_data, key_info, + index_table, &key_id[i]))) + { + if (error == HA_ERR_FOUND_DUPP_KEY) + { + if (key_id[i] == del_key_id[i]) { + /* no change */ + key_id[i] = GRN_ID_NIL; + del_key_id[i] = GRN_ID_NIL; + continue; + } + dup_key = i; + DBUG_PRINT("info", ("mroonga: different key ID: %d record ID: %d,%d", + i, key_id[i], del_key_id[i])); + } + goto err; + } + } + DBUG_RETURN(0); + +err: + if (i) { + mrn_change_encoding(ctx, NULL); + do { + i--; + KEY *key_info = &table->key_info[i]; + if ((key_info->flags & HA_NOSAME) && key_id[i] != GRN_ID_NIL) { + grn_table_delete_by_id(ctx, grn_index_tables[i], key_id[i]); + } + } while (i); + } + DBUG_RETURN(error); +} + +int ha_mroonga::update_row(const uchar *old_data, uchar *new_data) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_update_row(old_data, new_data); + } else { + error = storage_update_row(old_data, new_data); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_delete_row(const uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + THD *thd= ha_thd(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + tmp_disable_binlog(thd); + error = wrap_handler->ha_delete_row(buf); + reenable_binlog(thd); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + if (!error && wrapper_have_target_index()) { + error = wrapper_delete_row_index(buf); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_delete_row_index(const uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + mrn_change_encoding(ctx, NULL); + grn_id record_id; + error = wrapper_get_record_id((uchar *)buf, &record_id, + "failed to get record ID " + "for deleting from groonga"); + if (error) { + DBUG_RETURN(0); + } + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + /* disable keys */ + continue; + } + + uint j; + for (j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + + if (field->is_null()) + continue; + + generic_store_bulk(field, &old_value_buffer); + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, j + 1, + &old_value_buffer, NULL); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } + } +err: + grn_table_delete_by_id(ctx, grn_table, record_id); + if (ctx->rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_delete_row(const uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(0); + } + + storage_store_fields_for_prep_update(buf, NULL, record_id); + if ((error = storage_prepare_delete_row_unique_indexes(buf, record_id))) { + DBUG_RETURN(error); + } + mrn_change_encoding(ctx, NULL); + grn_table_delete_by_id(ctx, grn_table, record_id); + if (ctx->rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_WRITE); + } + if ( + (error = storage_delete_row_index(buf)) || + (error = storage_delete_row_unique_indexes()) + ) { + DBUG_RETURN(error); + } + + grn_db_touch(ctx, grn_ctx_db(ctx)); + + DBUG_RETURN(0); +} + +int ha_mroonga::storage_delete_row_index(const uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + grn_obj key, encoded_key; + GRN_TEXT_INIT(&key, 0); + GRN_TEXT_INIT(&encoded_key, 0); + + mrn::DebugColumnAccess debug_column_access(table, table->read_set); + uint i; + uint n_keys = table->s->keys; + mrn_change_encoding(ctx, NULL); + for (i = 0; i < n_keys; i++) { + if (i == table->s->primary_key) { + continue; + } + + KEY key_info = table->key_info[i]; + + if (KEY_N_KEY_PARTS(&key_info) == 1 || (key_info.flags & HA_FULLTEXT)) { + continue; + } + + grn_obj *index_column = grn_index_columns[i]; + if (!index_column) { + /* disable keys */ + continue; + } + + GRN_BULK_REWIND(&key); + grn_bulk_space(ctx, &key, key_info.key_length); + key_copy((uchar *)(GRN_TEXT_VALUE(&key)), + (uchar *)buf, + &key_info, + key_info.key_length); + GRN_BULK_REWIND(&encoded_key); + grn_bulk_space(ctx, &encoded_key, key_info.key_length); + uint encoded_key_length; + storage_encode_multiple_column_key(&key_info, + (uchar *)(GRN_TEXT_VALUE(&key)), + key_info.key_length, + (uchar *)(GRN_TEXT_VALUE(&encoded_key)), + &encoded_key_length); + + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, 1, + &encoded_key, NULL); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } +err: + grn_obj_unlink(ctx, &encoded_key); + grn_obj_unlink(ctx, &key); + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_delete_row_unique_index(grn_obj *index_table, + grn_id del_key_id) +{ + MRN_DBUG_ENTER_METHOD(); + grn_rc rc = grn_table_delete_by_id(ctx, index_table, del_key_id); + if (rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_WRITE); + } + DBUG_RETURN(0); +} + +int ha_mroonga::storage_delete_row_unique_indexes() +{ + int error = 0, tmp_error; + uint i; + uint n_keys = table->s->keys; + MRN_DBUG_ENTER_METHOD(); + + for (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)) || del_key_id[i] == GRN_ID_NIL) { + continue; + } + + grn_obj *index_table = grn_index_tables[i]; + if ((tmp_error = storage_delete_row_unique_index(index_table, + del_key_id[i]))) + { + error = tmp_error; + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_prepare_delete_row_unique_index(const uchar *buf, + grn_id record_id, + KEY *key_info, + grn_obj *index_table, + grn_obj *index_column, + grn_id *del_key_id) +{ + const void *ukey = NULL; + uint32 ukey_size = 0; + MRN_DBUG_ENTER_METHOD(); + if (KEY_N_KEY_PARTS(key_info) == 1) { + ukey = grn_obj_get_value_(ctx, index_column, record_id, &ukey_size); + } else { + mrn_change_encoding(ctx, NULL); + uchar key[MRN_MAX_KEY_SIZE]; + key_copy(key, (uchar *) buf, key_info, key_info->key_length); + grn_bulk_space(ctx, &key_buffer, key_info->key_length); + ukey = GRN_TEXT_VALUE(&key_buffer); + storage_encode_multiple_column_key(key_info, + key, key_info->key_length, + (uchar *)ukey, (uint *)&ukey_size); + } + *del_key_id = grn_table_get(ctx, index_table, ukey, ukey_size); + DBUG_RETURN(0); +} + +int ha_mroonga::storage_prepare_delete_row_unique_indexes(const uchar *buf, + grn_id record_id) +{ + int error = 0, tmp_error; + uint i; + uint n_keys = table->s->keys; + MRN_DBUG_ENTER_METHOD(); + + for (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) { + del_key_id[i] = GRN_ID_NIL; + continue; + } + + grn_obj *index_column; + if (KEY_N_KEY_PARTS(key_info) == 1) { + Field *field = key_info->key_part[0].field; + mrn_change_encoding(ctx, field->charset()); + index_column = grn_columns[field->field_index]; + } else { + mrn_change_encoding(ctx, NULL); + index_column = grn_index_columns[i]; + } + if ((tmp_error = storage_prepare_delete_row_unique_index(buf, record_id, + key_info, + index_table, + index_column, + &del_key_id[i]))) + { + error = tmp_error; + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::delete_row(const uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_delete_row(buf); + } else { + error = storage_delete_row(buf); + } + DBUG_RETURN(error); +} + +uint ha_mroonga::wrapper_max_supported_key_parts() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(MAX_REF_PARTS); +} + +uint ha_mroonga::storage_max_supported_key_parts() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(1); +} + +uint ha_mroonga::max_supported_key_parts() +{ + MRN_DBUG_ENTER_METHOD(); + uint parts; + if (share->wrapper_mode) + { + parts = wrapper_max_supported_key_parts(); + } else { + parts = storage_max_supported_key_parts(); + } + DBUG_RETURN(parts); +} + +ha_rows ha_mroonga::wrapper_records_in_range(uint key_nr, key_range *range_min, + key_range *range_max) +{ + ha_rows row_count; + MRN_DBUG_ENTER_METHOD(); + KEY key_info = table->s->key_info[key_nr]; + if (mrn_is_geo_key(&key_info)) { + row_count = generic_records_in_range_geo(key_nr, range_min, range_max); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + row_count = wrap_handler->records_in_range(key_nr, range_min, range_max); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(row_count); +} + +ha_rows ha_mroonga::storage_records_in_range(uint key_nr, key_range *range_min, + key_range *range_max) +{ + MRN_DBUG_ENTER_METHOD(); + int flags = 0; + uint size_min = 0, size_max = 0; + ha_rows row_count = 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[key_nr]; + bool is_multiple_column_index = KEY_N_KEY_PARTS(&key_info) > 1; + + if (is_multiple_column_index) { + mrn_change_encoding(ctx, NULL); + if (range_min && range_max && + range_min->length == range_max->length && + memcmp(range_min->key, range_max->key, range_min->length) == 0) { + flags |= GRN_CURSOR_PREFIX; + key_min = key_min_entity; + storage_encode_multiple_column_key(&key_info, + range_min->key, range_min->length, + key_min, &size_min); + } else { + key_min = key_min_entity; + key_max = key_max_entity; + storage_encode_multiple_column_key_range(&key_info, + range_min, range_max, + key_min, &size_min, + key_max, &size_max); + } + } else if (mrn_is_geo_key(&key_info)) { + mrn_change_encoding(ctx, key_info.key_part->field->charset()); + row_count = generic_records_in_range_geo(key_nr, range_min, range_max); + DBUG_RETURN(row_count); + } else { + KEY_PART_INFO key_part = key_info.key_part[0]; + Field *field = key_part.field; + const char *column_name = field->field_name; + mrn_change_encoding(ctx, field->charset()); + + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + DBUG_RETURN((ha_rows)1); + } + + if (range_min) { + key_min = key_min_entity; + storage_encode_key(field, range_min->key, key_min, &size_min); + if (size_min == 0) { + DBUG_RETURN(HA_POS_ERROR); + } + } + if (range_max) { + key_max = key_max_entity; + storage_encode_key(field, range_max->key, key_max, &size_max); + if (size_max == 0) { + DBUG_RETURN(HA_POS_ERROR); + } + } + } + + if (range_min) { + DBUG_PRINT("info", ("mroonga: range_min->flag=%u", range_min->flag)); + if (range_min->flag == HA_READ_AFTER_KEY) { + flags |= GRN_CURSOR_GT; + } + } + if (range_max) { + DBUG_PRINT("info", ("mroonga: range_min->flag=%u", range_max->flag)); + if (range_max->flag == HA_READ_BEFORE_KEY) { + flags |= GRN_CURSOR_LT; + } + } + + uint pkey_nr = table->s->primary_key; + if (key_nr == pkey_nr) { + DBUG_PRINT("info", ("mroonga: use primary key")); + grn_table_cursor *cursor; + cursor = grn_table_cursor_open(ctx, grn_table, + key_min, size_min, + key_max, size_max, + 0, -1, flags); + while (grn_table_cursor_next(ctx, cursor) != GRN_ID_NIL) { + row_count++; + } + grn_table_cursor_close(ctx, cursor); + } else { + if (is_multiple_column_index) { + DBUG_PRINT("info", ("mroonga: use multiple column key%u", key_nr)); + } else { + DBUG_PRINT("info", ("mroonga: use key%u", key_nr)); + } + + grn_table_cursor *cursor; + grn_table_cursor *index_cursor; + cursor = grn_table_cursor_open(ctx, grn_index_tables[key_nr], + key_min, size_min, + key_max, size_max, + 0, -1, flags); + index_cursor = grn_index_cursor_open(ctx, cursor, + grn_index_columns[key_nr], + 0, GRN_ID_MAX, 0); + while (grn_table_cursor_next(ctx, index_cursor) != GRN_ID_NIL) { + row_count++; + } + grn_obj_unlink(ctx, index_cursor); + grn_table_cursor_close(ctx, cursor); + } + DBUG_RETURN(row_count); +} + +ha_rows ha_mroonga::generic_records_in_range_geo(uint key_nr, + key_range *range_min, + key_range *range_max) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows row_count; + int error; + + if (!range_min) { + DBUG_PRINT("info", + ("mroonga: range min is missing for geometry range search")); + DBUG_RETURN(HA_POS_ERROR); + } + if (range_max) { + DBUG_PRINT("info", + ("mroonga: range max is specified for geometry range search")); + DBUG_RETURN(HA_POS_ERROR); + } + error = mrn_change_encoding(ctx, + table->key_info[key_nr].key_part->field->charset()); + if (error) + DBUG_RETURN(error); + if (!(range_min->flag & HA_READ_MBR_CONTAIN)) { + push_warning_unsupported_spatial_index_search(range_min->flag); + row_count = grn_table_size(ctx, grn_table); + DBUG_RETURN(row_count); + } + + geo_store_rectangle(range_min->key); + row_count = grn_geo_estimate_in_rectangle(ctx, + grn_index_columns[key_nr], + &top_left_point, + &bottom_right_point); + DBUG_RETURN(row_count); +} + +ha_rows ha_mroonga::records_in_range(uint key_nr, key_range *range_min, key_range *range_max) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows row_count = 0; + if (share->wrapper_mode) + { + row_count = wrapper_records_in_range(key_nr, range_min, range_max); + } else { + row_count = storage_records_in_range(key_nr, range_min, range_max); + } + DBUG_PRINT("info", ("mroonga: row_count=%" MRN_HA_ROWS_FORMAT, row_count)); + DBUG_RETURN(row_count); +} + +int ha_mroonga::wrapper_index_init(uint idx, bool sorted) +{ + int error = 0; + KEY key_info = table->s->key_info[idx]; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (!mrn_is_geo_key(&key_info) && key_info.algorithm != HA_KEY_ALG_FULLTEXT) + { + error = wrap_handler->ha_index_init(share->wrap_key_nr[idx], sorted); + } else { + error = wrap_handler->ha_index_init(share->wrap_primary_key, sorted); + } + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_init(uint idx, bool sorted) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::index_init(uint idx, bool sorted) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: idx=%u", idx)); + active_index = idx; + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_init(idx, sorted); + } else { + error = storage_index_init(idx, sorted); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_end() +{ + 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_index_or_rnd_end(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_end() +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor(); + clear_cursor_geo(); + DBUG_RETURN(0); +} + +int ha_mroonga::index_end() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_end(); + } else { + error = storage_index_end(); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + 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(key, find_flag); + if (!error) { + error = wrapper_get_next_geo_record(buf); + } + DBUG_RETURN(error); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP + error = wrap_handler->ha_index_read_map(buf, key, keypart_map, find_flag); +#else + error = wrap_handler->index_read_map(buf, key, keypart_map, find_flag); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + MRN_DBUG_ENTER_METHOD(); + check_count_skip(keypart_map, 0, false); + + int error = 0; + + uint key_nr = active_index; + KEY key_info = table->key_info[key_nr]; + int flags = 0; + 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]; + + clear_cursor(); + clear_cursor_geo(); + clear_empty_value_records(); + + bool is_multiple_column_index = KEY_N_KEY_PARTS(&key_info) > 1; + if (is_multiple_column_index) { + mrn_change_encoding(ctx, NULL); + flags |= GRN_CURSOR_PREFIX; + uint key_length = calculate_key_len(table, active_index, key, keypart_map); + key_min = key_min_entity; + storage_encode_multiple_column_key(&key_info, + key, key_length, + key_min, &size_min); + } else if (mrn_is_geo_key(&key_info)) { + error = mrn_change_encoding(ctx, key_info.key_part->field->charset()); + if (error) + DBUG_RETURN(error); + error = generic_geo_open_cursor(key, find_flag); + if (!error) { + error = storage_get_next_record(buf); + } + DBUG_RETURN(error); + } else { + KEY_PART_INFO key_part = key_info.key_part[0]; + Field *field = key_part.field; + error = mrn_change_encoding(ctx, field->charset()); + if (error) + DBUG_RETURN(error); + + if (find_flag == HA_READ_KEY_EXACT) { + const char *column_name = field->field_name; + + key_min = key_min_entity; + key_max = key_min_entity; + storage_encode_key(field, key, key_min, &size_min); + size_max = size_min; + // 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(buf, found_record_id); + table->status = 0; + record_id = found_record_id; + DBUG_RETURN(0); + } else { + table->status = STATUS_NOT_FOUND; + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + } + } else if ( + find_flag == HA_READ_BEFORE_KEY || + find_flag == HA_READ_PREFIX_LAST_OR_PREV + ) { + key_max = key_max_entity; + storage_encode_key(field, key, key_max_entity, &size_max); + } else { + key_min = key_min_entity; + storage_encode_key(field, key, key_min_entity, &size_min); + } + } + + 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")); + cursor = grn_table_cursor_open(ctx, grn_table, + key_min, size_min, + key_max, size_max, + 0, -1, flags); + } else { + bool is_empty_value_records_search = false; + if (is_multiple_column_index) { + DBUG_PRINT("info", ("mroonga: use multiple column key%u", key_nr)); + } else if (flags == 0 && size_min == 0 && size_max == 0) { + is_empty_value_records_search = true; + DBUG_PRINT("info", + ("mroonga: use table scan for searching empty value records")); + } else { + DBUG_PRINT("info", ("mroonga: use key%u", key_nr)); + } + if (is_empty_value_records_search) { + grn_obj *expression, *expression_variable; + GRN_EXPR_CREATE_FOR_QUERY(ctx, grn_table, + expression, expression_variable); + grn_obj *target_column = + grn_columns[key_info.key_part->field->field_index]; + grn_expr_append_const(ctx, expression, target_column, GRN_OP_GET_VALUE, 1); + grn_obj empty_value; + GRN_TEXT_INIT(&empty_value, 0); + grn_expr_append_obj(ctx, expression, &empty_value, GRN_OP_PUSH, 1); + grn_expr_append_op(ctx, expression, GRN_OP_EQUAL, 2); + + empty_value_records = + grn_table_create(ctx, NULL, 0, NULL, + GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, + grn_table, 0); + grn_table_select(ctx, grn_table, expression, empty_value_records, + GRN_OP_OR); + grn_obj_unlink(ctx, expression); + grn_obj_unlink(ctx, &empty_value); + + empty_value_records_cursor = + grn_table_cursor_open(ctx, empty_value_records, + NULL, 0, NULL, 0, + 0, -1, flags); + } else { + index_table_cursor = grn_table_cursor_open(ctx, grn_index_tables[key_nr], + key_min, size_min, + key_max, size_max, + 0, -1, flags); + cursor = grn_index_cursor_open(ctx, index_table_cursor, + grn_index_columns[key_nr], + 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(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_read_map(buf, key, keypart_map, find_flag); + } else { + error = storage_index_read_map(buf, key, keypart_map, find_flag); + } + DBUG_PRINT("info", ("mroonga: error=%d", error)); + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_HAVE_INDEX_READ_LAST_MAP +int ha_mroonga::wrapper_index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +# ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_LAST_MAP + error = wrap_handler->ha_index_read_last_map(buf, key, keypart_map); +# else + error = wrap_handler->index_read_last_map(buf, key, keypart_map); +# endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map) +{ + MRN_DBUG_ENTER_METHOD(); + uint key_nr = active_index; + KEY key_info = table->key_info[key_nr]; + + int flags = GRN_CURSOR_DESCENDING, error; + uint size_min = 0, size_max = 0; + uchar *key_min = NULL, *key_max = NULL; + uchar key_min_entity[MRN_MAX_KEY_SIZE]; + + clear_cursor(); + + bool is_multiple_column_index = KEY_N_KEY_PARTS(&key_info) > 1; + if (is_multiple_column_index) { + mrn_change_encoding(ctx, NULL); + flags |= GRN_CURSOR_PREFIX; + uint key_length = calculate_key_len(table, active_index, key, keypart_map); + key_min = key_min_entity; + storage_encode_multiple_column_key(&key_info, + key, key_length, + key_min, &size_min); + } else { + KEY_PART_INFO key_part = key_info.key_part[0]; + Field *field = key_part.field; + error = mrn_change_encoding(ctx, field->charset()); + if (error) + DBUG_RETURN(error); + + key_min = key_min_entity; + key_max = key_min_entity; + storage_encode_key(field, key, key_min, &size_min); + size_max = size_min; + } + + uint pkey_nr = table->s->primary_key; + if (key_nr == 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", key_nr)); + } else { + DBUG_PRINT("info", ("mroonga: use key%u", key_nr)); + } + index_table_cursor = grn_table_cursor_open(ctx, grn_index_tables[key_nr], + key_min, size_min, + key_max, size_max, + 0, -1, flags); + cursor = grn_index_cursor_open(ctx, index_table_cursor, + grn_index_columns[key_nr], + 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(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_read_last_map(buf, key, keypart_map); + } else { + error = storage_index_read_last_map(buf, key, keypart_map); + } + DBUG_RETURN(error); +} +#endif + +int ha_mroonga::wrapper_index_next(uchar *buf) +{ + 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(buf); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_NEXT + error = wrap_handler->ha_index_next(buf); +#else + error = wrap_handler->index_next(buf); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_next(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = storage_get_next_record(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_next(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_next(buf); + } else { + error = storage_index_next(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_prev(uchar *buf) +{ + 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(buf); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_NEXT + error = wrap_handler->ha_index_prev(buf); +#else + error = wrap_handler->index_prev(buf); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_prev(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = storage_get_next_record(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_prev(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_prev(buf); + } else { + error = storage_index_prev(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_first(uchar *buf) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_FIRST + error = wrap_handler->ha_index_first(buf); +#else + error = wrap_handler->index_first(buf); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_first(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor(); + int flags = GRN_CURSOR_ASCENDING; + uint pkey_nr = table->s->primary_key; + mrn_change_encoding(ctx, NULL); + if (active_index == pkey_nr) { + DBUG_PRINT("info", ("mroonga: use primary key")); + cursor = grn_table_cursor_open(ctx, grn_table, NULL, 0, NULL, 0, + 0, -1, flags); + } else { + if (KEY_N_KEY_PARTS(&(table->key_info[active_index])) > 1) { + 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], + NULL, 0, + NULL, 0, + 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); + } + int error = storage_get_next_record(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_first(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_first(buf); + } else { + error = storage_index_first(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_last(uchar *buf) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_LAST + error = wrap_handler->ha_index_last(buf); +#else + error = wrap_handler->index_last(buf); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_last(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor(); + int flags = GRN_CURSOR_DESCENDING; + uint pkey_nr = table->s->primary_key; + mrn_change_encoding(ctx, NULL); + if (active_index == pkey_nr) { + DBUG_PRINT("info", ("mroonga: use primary key")); + cursor = grn_table_cursor_open(ctx, grn_table, NULL, 0, NULL, 0, + 0, -1, flags); + } else { + if (KEY_N_KEY_PARTS(&(table->key_info[active_index])) > 1) { + 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], + NULL, 0, + NULL, 0, + 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); + } + int error = storage_get_next_record(buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_last(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_last(buf); + } else { + error = storage_index_last(buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_index_next_same(uchar *buf, const uchar *key, + uint keylen) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + KEY key_info = table->s->key_info[active_index]; + if (mrn_is_geo_key(&key_info)) { + error = wrapper_get_next_geo_record(buf); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); +#ifdef MRN_HANDLER_HAVE_HA_INDEX_NEXT_SAME + error = wrap_handler->ha_index_next_same(buf, key, keylen); +#else + error = wrap_handler->index_next_same(buf, key, keylen); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_index_next_same(uchar *buf, const uchar *key, + uint keylen) +{ + MRN_DBUG_ENTER_METHOD(); + int error = storage_get_next_record(count_skip ? NULL : buf); + DBUG_RETURN(error); +} + +int ha_mroonga::index_next_same(uchar *buf, const uchar *key, uint keylen) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_index_next_same(buf, key, keylen); + } else { + error = storage_index_next_same(buf, key, 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 { + KEY_PART_INFO key_part = key_info.key_part[0]; + Field *field = key_part.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(); + struct st_mrn_ft_info *mrn_ft_info = + reinterpret_cast(ft_handler); + GRN_CTX_SET_ENCODING(ctx, mrn_ft_info->encoding); + + int error = 0; + if (sorted_result) { + mrn_ft_info->cursor = grn_table_cursor_open(ctx, sorted_result, + NULL, 0, NULL, 0, + 0, -1, 0); + } else { + mrn_ft_info->cursor = grn_table_cursor_open(ctx, mrn_ft_info->result, + NULL, 0, NULL, 0, + 0, -1, 0); + } + if (ctx->rc) { + error = ER_ERROR_ON_READ; + my_message(error, ctx->errbuf, MYF(0)); + } else { + 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 = table->pos_in_table_list->select_lex->where; + + 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; + } + 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; + } + + n_weights++; + + generic_ft_init_ext_parse_pragma_w_append_section(info, + index_column, + match_columns, + 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; + generic_ft_init_ext_parse_pragma_w_append_section(info, + index_column, + match_columns, + section, + §ion_value_buffer, + default_weight, + n_weights); + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(specified_sections); + + GRN_OBJ_FIN(info->ctx, §ion_value_buffer); + + DBUG_RETURN(n_weights > 0); +} + +grn_rc ha_mroonga::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) +{ + 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); + } + grn_expr_flags expression_flags = + GRN_EXPR_SYNTAX_QUERY | GRN_EXPR_ALLOW_LEADING_NOT; + rc = grn_expr_parse(info->ctx, expression, + keyword, keyword_length, + match_columns, GRN_OP_MATCH, default_operator, + expression_flags); + 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; + } + } + + DBUG_RETURN(rc); +} + +grn_rc ha_mroonga::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) +{ + MRN_DBUG_ENTER_METHOD(); + + grn_rc rc = GRN_SUCCESS; + + grn_obj query; + GRN_TEXT_INIT(&query, GRN_OBJ_DO_SHALLOW_COPY); + GRN_TEXT_SET(info->ctx, &query, key->ptr(), key->length()); + grn_expr_append_obj(info->ctx, match_columns, index_column, GRN_OP_PUSH, 1); + grn_expr_append_obj(info->ctx, expression, match_columns, GRN_OP_PUSH, 1); + grn_expr_append_const(info->ctx, expression, &query, GRN_OP_PUSH, 1); + grn_expr_append_op(info->ctx, expression, GRN_OP_SIMILAR, 2); + grn_obj_unlink(info->ctx, &query); + + DBUG_RETURN(rc); +} + +struct st_mrn_ft_info *ha_mroonga::generic_ft_init_ext_select(uint flags, + uint key_nr, + String *key) +{ + MRN_DBUG_ENTER_METHOD(); + + struct st_mrn_ft_info *info = new st_mrn_ft_info(); + info->mroonga = this; + info->ctx = ctx; + mrn_change_encoding(info->ctx, + table->key_info[key_nr].key_part->field->charset()); + info->encoding = GRN_CTX_GET_ENCODING(info->ctx); + info->table = grn_table; + info->result = grn_table_create(info->ctx, NULL, 0, NULL, + GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, + grn_table, 0); + info->score_column = grn_obj_column(info->ctx, info->result, + MRN_COLUMN_NAME_SCORE, + strlen(MRN_COLUMN_NAME_SCORE)); + GRN_TEXT_INIT(&(info->key), 0); + grn_bulk_space(info->ctx, &(info->key), table->key_info->key_length); + GRN_INT32_INIT(&(info->score), 0); + info->active_index = key_nr; + info->key_info = &(table->key_info[key_nr]); + info->primary_key_info = &(table->key_info[table_share->primary_key]); + info->cursor = NULL; + info->id_accessor = NULL; + info->key_accessor = NULL; + + if (key->length() == 0) { + DBUG_RETURN(info); + } + + grn_obj *index_column = grn_index_columns[key_nr]; + grn_obj *match_columns, *match_columns_variable; + GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->table, match_columns, + match_columns_variable); + + 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) { + rc = generic_ft_init_ext_prepare_expression_in_boolean_mode(info, + key, + index_column, + match_columns, + expression, + &tmp_objects); + } else { + rc = generic_ft_init_ext_prepare_expression_in_normal_mode(info, + key, + index_column, + match_columns, + expression, + &tmp_objects); + } + + if (rc == GRN_SUCCESS) { + if (fast_order_limit) { + generic_ft_init_ext_add_conditions_fast_order_limit(info, expression); + } + longlong escalation_threshold = THDVAR(ha_thd(), match_escalation_threshold); + mrn::MatchEscalationThresholdScope scope(info->ctx, escalation_threshold); + grn_table_select(info->ctx, info->table, expression, + info->result, GRN_OP_OR); + } + + 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); +} + +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); + + mrn_change_encoding(ctx, system_charset_info); + grn_operator operation = GRN_OP_AND; + if (!matched_record_keys) { + matched_record_keys = grn_table_create(ctx, NULL, 0, NULL, + GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, + grn_table, 0); + operation = GRN_OP_OR; + } + + grn_table_sort_key *sort_keys = NULL; + int n_sort_keys = 0; + 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); + + grn_rc rc; + rc = grn_table_setoperation(ctx, matched_record_keys, info->result, + matched_record_keys, operation); + if (rc) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to merge matched record keys: <%s>", + ctx->errbuf); + my_message(ER_ERROR_ON_READ, error_message, MYF(0)); + GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message); + } + if (fast_order_limit) { + sorted_result = grn_table_create(ctx, NULL, + 0, NULL, + GRN_OBJ_TABLE_NO_KEY, NULL, + matched_record_keys); + grn_table_sort(ctx, matched_record_keys, 0, static_cast(limit), + sorted_result, sort_keys, n_sort_keys); + } + if (sort_keys) { + for (int i = 0; i < n_sort_keys; i++) { + grn_obj_unlink(info->ctx, sort_keys[i].key); + } + free(sort_keys); + } + + DBUG_RETURN((FT_INFO *)info); +} + +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); + 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); + 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 + mrn_ft_info->could_you = &mrn_storage_ft_vft_ext; +#endif + DBUG_RETURN(info); +} + +FT_INFO *ha_mroonga::ft_init_ext(uint flags, uint key_nr, String *key) +{ + MRN_DBUG_ENTER_METHOD(); + fulltext_searching = true; + FT_INFO *info; + if (key_nr == NO_SUCH_KEY) { + struct st_mrn_ft_info *mrn_ft_info = new st_mrn_ft_info(); + mrn_ft_info->please = &mrn_no_such_key_ft_vft; +#ifdef HA_CAN_FULLTEXT_EXT + mrn_ft_info->could_you = &mrn_no_such_key_ft_vft_ext; +#endif + info = (FT_INFO *)mrn_ft_info; + } else { + if (share->wrapper_mode) + { + info = wrapper_ft_init_ext(flags, key_nr, key); + } else { + info = storage_ft_init_ext(flags, key_nr, key); + } + } + DBUG_RETURN(info); +} + +int ha_mroonga::wrapper_ft_read(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + if (wrap_ft_init_count) + set_pk_bitmap(); + + struct st_mrn_ft_info *mrn_ft_info = + reinterpret_cast(ft_handler); + GRN_CTX_SET_ENCODING(ctx, mrn_ft_info->encoding); + + int error = 0; + do { + grn_id found_record_id; + found_record_id = grn_table_cursor_next(ctx, mrn_ft_info->cursor); + if (found_record_id == GRN_ID_NIL) { + error = HA_ERR_END_OF_FILE; + break; + } + + GRN_BULK_REWIND(&key_buffer); + if (mrn_ft_info->key_accessor) { + grn_obj_get_value(ctx, mrn_ft_info->key_accessor, + found_record_id, &key_buffer); + } else { + void *key; + int key_length; + key_length = grn_table_cursor_get_key(ctx, mrn_ft_info->cursor, &key); + GRN_TEXT_SET(ctx, &key_buffer, key, key_length); + } + error = wrapper_get_record(buf, (const uchar *)GRN_TEXT_VALUE(&key_buffer)); + } while (error == HA_ERR_END_OF_FILE || error == HA_ERR_KEY_NOT_FOUND); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_ft_read(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + struct st_mrn_ft_info *mrn_ft_info = + reinterpret_cast(ft_handler); + GRN_CTX_SET_ENCODING(ctx, mrn_ft_info->encoding); + + grn_id found_record_id; + found_record_id = grn_table_cursor_next(ctx, mrn_ft_info->cursor); + if (ctx->rc) { + my_message(ER_ERROR_ON_READ, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_READ); + } + + if (found_record_id == GRN_ID_NIL) { + table->status = STATUS_NOT_FOUND; + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + table->status = 0; + + if (count_skip && record_id != GRN_ID_NIL) { + DBUG_RETURN(0); + } + + GRN_BULK_REWIND(&key_buffer); + if (mrn_ft_info->id_accessor) { + grn_obj id_buffer; + GRN_RECORD_INIT(&id_buffer, 0, grn_obj_id(ctx, grn_table)); + grn_obj_get_value(ctx, mrn_ft_info->id_accessor, + found_record_id, &id_buffer); + record_id = GRN_RECORD_VALUE(&id_buffer); + } else if (mrn_ft_info->key_accessor) { + grn_obj_get_value(ctx, mrn_ft_info->key_accessor, + found_record_id, &key_buffer); + record_id = grn_table_get(ctx, grn_table, + GRN_TEXT_VALUE(&key_buffer), + GRN_TEXT_LEN(&key_buffer)); + } else { + void *key; + grn_table_cursor_get_key(ctx, mrn_ft_info->cursor, &key); + if (ctx->rc) { + record_id = GRN_ID_NIL; + my_message(ER_ERROR_ON_READ, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_READ); + } else { + record_id = *((grn_id *)key); + } + } + storage_store_fields(buf, record_id); + DBUG_RETURN(0); +} + +int ha_mroonga::ft_read(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_ft_read(buf); + } else { + error = storage_ft_read(buf); + } + DBUG_RETURN(error); +} + +const Item *ha_mroonga::wrapper_cond_push(const Item *cond) +{ + const Item *reminder_cond; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + reminder_cond = wrap_handler->cond_push(cond); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(reminder_cond); +} + +const Item *ha_mroonga::storage_cond_push(const Item *cond) +{ + MRN_DBUG_ENTER_METHOD(); + 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)) { + reminder_cond = NULL; + } + } + DBUG_RETURN(reminder_cond); +} + +const Item *ha_mroonga::cond_push(const Item *cond) +{ + MRN_DBUG_ENTER_METHOD(); + const Item *reminder_cond; + if (share->wrapper_mode) + { + reminder_cond = wrapper_cond_push(cond); + } else { + reminder_cond = storage_cond_push(cond); + } + DBUG_RETURN(reminder_cond); +} + +void ha_mroonga::wrapper_cond_pop() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->cond_pop(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_cond_pop() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::cond_pop() +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + wrapper_cond_pop(); + else + storage_cond_pop(); + DBUG_VOID_RETURN; +} + +bool ha_mroonga::wrapper_get_error_message(int error, String *buf) +{ + bool temporary_error; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + temporary_error = wrap_handler->get_error_message(error, buf); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(temporary_error); +} + +bool ha_mroonga::storage_get_error_message(int error, String *buf) +{ + MRN_DBUG_ENTER_METHOD(); + bool temporary_error = false; + // latest error message + buf->copy(ctx->errbuf, (uint) strlen(ctx->errbuf), system_charset_info); + DBUG_RETURN(temporary_error); +} + +bool ha_mroonga::get_error_message(int error, String *buf) +{ + MRN_DBUG_ENTER_METHOD(); + bool temporary_error; + if (share && share->wrapper_mode) + { + temporary_error = wrapper_get_error_message(error, buf); + } else { + temporary_error = storage_get_error_message(error, buf); + } + DBUG_RETURN(temporary_error); +} + +void ha_mroonga::mkdir_p(const char *directory) +{ + MRN_DBUG_ENTER_METHOD(); + + int i = 0; + char sub_directory[MRN_MAX_PATH_SIZE]; + sub_directory[0] = '\0'; + while (true) { + if (directory[i] == FN_LIBCHAR || + directory[i] == FN_LIBCHAR2 || + directory[i] == '\0') { + sub_directory[i] = '\0'; + struct stat directory_status; + if (stat(sub_directory, &directory_status) != 0) { + DBUG_PRINT("info", ("mroonga: creating directory: <%s>", sub_directory)); + GRN_LOG(ctx, GRN_LOG_INFO, "creating directory: <%s>", sub_directory); + if (MRN_MKDIR(sub_directory, S_IRWXU) == 0) { + DBUG_PRINT("info", + ("mroonga: created directory: <%s>", sub_directory)); + GRN_LOG(ctx, GRN_LOG_INFO, "created directory: <%s>", sub_directory); + } else { + DBUG_PRINT("error", + ("mroonga: failed to create directory: <%s>: <%s>", + sub_directory, strerror(errno))); + GRN_LOG(ctx, GRN_LOG_ERROR, + "failed to create directory: <%s>: <%s>", + sub_directory, strerror(errno)); + DBUG_VOID_RETURN; + } + } + } + + if (directory[i] == '\0') { + break; + } + + sub_directory[i] = directory[i]; + ++i; + } + + DBUG_VOID_RETURN; +} + +ulonglong ha_mroonga::file_size(const char *path) +{ + MRN_DBUG_ENTER_METHOD(); + + struct stat file_status; + if (stat(path, &file_status) == 0) { + DBUG_RETURN(file_status.st_size); + } else { + DBUG_RETURN(0); + } +} + +void ha_mroonga::push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag) +{ + char search_name[MRN_BUFFER_SIZE]; + if (flag == HA_READ_MBR_INTERSECT) { + strcpy(search_name, "intersect"); + } else if (flag == HA_READ_MBR_WITHIN) { + strcpy(search_name, "within"); + } else if (flag & HA_READ_MBR_DISJOINT) { + strcpy(search_name, "disjoint"); + } else if (flag & HA_READ_MBR_EQUAL) { + strcpy(search_name, "equal"); + } else { + sprintf(search_name, "unknown: %d", flag); + } + push_warning_printf(ha_thd(), + Sql_condition::WARN_LEVEL_WARN, + ER_UNSUPPORTED_EXTENSION, + "spatial index search " + "except MBRContains aren't supported: <%s>", + search_name); +} + +void ha_mroonga::clear_cursor() +{ + MRN_DBUG_ENTER_METHOD(); + if (cursor) { + grn_obj_unlink(ctx, cursor); + cursor = NULL; + } + if (index_table_cursor) { + grn_table_cursor_close(ctx, index_table_cursor); + index_table_cursor = NULL; + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::clear_cursor_geo() +{ + MRN_DBUG_ENTER_METHOD(); + if (cursor_geo) { + grn_obj_unlink(ctx, cursor_geo); + cursor_geo = NULL; + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::clear_empty_value_records() +{ + MRN_DBUG_ENTER_METHOD(); + if (empty_value_records_cursor) { + grn_table_cursor_close(ctx, empty_value_records_cursor); + empty_value_records_cursor = NULL; + } + if (empty_value_records) { + grn_obj_unlink(ctx, empty_value_records); + empty_value_records = NULL; + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::clear_search_result() +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor(); + if (sorted_result) { + grn_obj_unlink(ctx, sorted_result); + sorted_result = NULL; + } + if (matched_record_keys) { + grn_obj_unlink(ctx, matched_record_keys); + matched_record_keys = NULL; + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::clear_search_result_geo() +{ + MRN_DBUG_ENTER_METHOD(); + clear_cursor_geo(); + if (grn_source_column_geo) { + grn_obj_unlink(ctx, grn_source_column_geo); + grn_source_column_geo = NULL; + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::clear_indexes() +{ + MRN_DBUG_ENTER_METHOD(); + uint n_keys = table->s->keys; + uint pkey_nr = table->s->primary_key; + + for (uint i = 0; i < n_keys; i++) { + if (i != pkey_nr) { + if (grn_index_tables) { + grn_obj_unlink(ctx, grn_index_tables[i]); + } + if (grn_index_columns) { + grn_obj_unlink(ctx, grn_index_columns[i]); + } + } + } + + if (grn_index_tables) { + free(grn_index_tables); + grn_index_tables = NULL; + } + + if (grn_index_columns) { + free(grn_index_columns); + grn_index_columns = NULL; + } + + if (key_id) { + free(key_id); + key_id = NULL; + } + + if (del_key_id) { + free(del_key_id); + del_key_id = NULL; + } + + DBUG_VOID_RETURN; +} + +int ha_mroonga::alter_share_add(const char *path, TABLE_SHARE *table_share) +{ + MRN_DBUG_ENTER_METHOD(); + st_mrn_slot_data *slot_data = mrn_get_slot_data(ha_thd(), true); + if (!slot_data) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + st_mrn_alter_share *alter_share = + (st_mrn_alter_share *)malloc(sizeof(st_mrn_alter_share)); + if (!alter_share) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + alter_share->next = NULL; + strcpy(alter_share->path, path); + alter_share->alter_share = table_share; + if (slot_data->first_alter_share) + { + st_mrn_alter_share *tmp_alter_share = slot_data->first_alter_share; + while (tmp_alter_share->next) + tmp_alter_share = tmp_alter_share->next; + tmp_alter_share->next = alter_share; + } else { + slot_data->first_alter_share = alter_share; + } + DBUG_RETURN(0); +} + +void ha_mroonga::remove_related_files(const char *base_path) +{ + MRN_DBUG_ENTER_METHOD(); + + const char *base_directory_name = "."; + size_t base_path_length = strlen(base_path); +#ifdef WIN32 + WIN32_FIND_DATA data; + HANDLE finder = FindFirstFile(base_directory_name, &data); + if (finder != INVALID_HANDLE_VALUE) { + do { + if (!(data.dwFileAttributes & FILE_ATTRIBUTE_NORMAL)) { + continue; + } + if (strncmp(data.cFileName, base_path, base_path_length) == 0) { + unlink(data.cFileName); + } + } while (FindNextFile(finder, &data) != 0); + FindClose(finder); + } +#else + DIR *dir = opendir(base_directory_name); + if (dir) { + while (struct dirent *entry = readdir(dir)) { + struct stat file_status; + if (stat(entry->d_name, &file_status) != 0) { + continue; + } + if (!((file_status.st_mode & S_IFMT) && S_IFREG)) { + continue; + } + if (strncmp(entry->d_name, base_path, base_path_length) == 0) { + unlink(entry->d_name); + } + } + closedir(dir); + } +#endif + + DBUG_VOID_RETURN; +} + +void ha_mroonga::remove_grn_obj_force(const char *name) +{ + MRN_DBUG_ENTER_METHOD(); + + grn_obj *obj = grn_ctx_get(ctx, name, strlen(name)); + if (obj) { + grn_obj_remove(ctx, obj); + } else { + grn_obj *db = grn_ctx_db(ctx); + grn_id id = grn_table_get(ctx, db, name, strlen(name)); + if (id) { + char path[MRN_MAX_PATH_SIZE]; + grn_obj_delete_by_id(ctx, db, id, GRN_TRUE); + if (grn_obj_path_by_id(ctx, db, id, path) == GRN_SUCCESS) { + remove_related_files(path); + } + } + } + + DBUG_VOID_RETURN; +} + +int ha_mroonga::drop_index(MRN_SHARE *target_share, uint key_index) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + grn_rc rc = GRN_SUCCESS; + char target_name[GRN_TABLE_MAX_KEY_SIZE]; + int target_name_length; + + KEY *key_info = target_share->table_share->key_info; + if (!target_share->wrapper_mode && target_share->index_table[key_index]) { + const char *table_name = target_share->index_table[key_index]; + snprintf(target_name, GRN_TABLE_MAX_KEY_SIZE, + "%s.%s", table_name, key_info[key_index].name); + grn_obj *index_column = grn_ctx_get(ctx, target_name, strlen(target_name)); + if (index_column) { + rc = grn_obj_remove(ctx, index_column); + } + } else { + mrn::PathMapper mapper(target_share->table_name); + mrn::IndexTableName index_table_name(mapper.table_name(), + key_info[key_index].name); + grn_obj *index_table = grn_ctx_get(ctx, + index_table_name.c_str(), + index_table_name.length()); + if (index_table) { + target_name_length = grn_obj_name(ctx, index_table, + target_name, GRN_TABLE_MAX_KEY_SIZE); + rc = grn_obj_remove(ctx, index_table); + } + } + + if (rc != GRN_SUCCESS) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to drop index: <%.*s>: <%s>", + target_name_length, target_name, + ctx->errbuf); + my_message(ER_ERROR_ON_WRITE, error_message, MYF(0)); + GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message); + } + + DBUG_RETURN(error); +} + +grn_obj *ha_mroonga::find_tokenizer(const char *name, int name_length) +{ + MRN_DBUG_ENTER_METHOD(); + + if (strncasecmp("off", name, name_length) == 0) { + DBUG_RETURN(NULL); + } + + grn_obj *tokenizer; + mrn_change_encoding(ctx, system_charset_info); + tokenizer = grn_ctx_get(ctx, name, name_length); + if (!tokenizer) { + char message[MRN_BUFFER_SIZE]; + sprintf(message, + "specified fulltext parser <%.*s> doesn't exist. " + "default fulltext parser <%s> is used instead.", + name_length, name, + MRN_PARSER_DEFAULT); + push_warning(ha_thd(), + Sql_condition::WARN_LEVEL_WARN, ER_UNSUPPORTED_EXTENSION, + message); + tokenizer = grn_ctx_get(ctx, + MRN_PARSER_DEFAULT, + strlen(MRN_PARSER_DEFAULT)); + } + if (!tokenizer) { + push_warning(ha_thd(), + Sql_condition::WARN_LEVEL_WARN, ER_UNSUPPORTED_EXTENSION, + "couldn't find fulltext parser. " + "Bigram fulltext parser is used instead."); + tokenizer = grn_ctx_at(ctx, GRN_DB_BIGRAM); + } + DBUG_RETURN(tokenizer); +} + +grn_obj *ha_mroonga::find_normalizer(KEY *key_info) +{ + MRN_DBUG_ENTER_METHOD(); + grn_obj *normalizer = NULL; +#if MYSQL_VERSION_ID >= 50500 + if (key_info->comment.length > 0) { + mrn::ParametersParser parser(key_info->comment.str, + key_info->comment.length); + parser.parse(); + const char *normalizer_name = parser["normalizer"]; + if (normalizer_name) { + normalizer = grn_ctx_get(ctx, normalizer_name, -1); + } + } +#endif + if (!normalizer) { + Field *field = key_info->key_part[0].field; + mrn::FieldNormalizer field_normalizer(ctx, ha_thd(), field); + normalizer = field_normalizer.find_grn_normalizer(); + } + DBUG_RETURN(normalizer); +} + +int ha_mroonga::wrapper_get_record(uchar *buf, const uchar *key) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (wrap_handler->inited == NONE) { +#ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_IDX_MAP + error = wrap_handler->ha_index_read_idx_map(buf, + share->wrap_primary_key, + key, + pk_keypart_map, + HA_READ_KEY_EXACT); +#else + error = wrap_handler->index_read_idx_map(buf, + share->wrap_primary_key, + key, + pk_keypart_map, + HA_READ_KEY_EXACT); +#endif + } else { +#ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP + error = wrap_handler->ha_index_read_map(buf, + key, + pk_keypart_map, + HA_READ_KEY_EXACT); +#else + error = wrap_handler->index_read_map(buf, + key, + pk_keypart_map, + HA_READ_KEY_EXACT); +#endif + } + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_get_next_geo_record(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + mrn_change_encoding(ctx, NULL); + do { + GRN_BULK_REWIND(&key_buffer); + grn_id found_record_id; + grn_posting *posting; + posting = grn_geo_cursor_next(ctx, cursor_geo); + if (!posting) { + error = HA_ERR_END_OF_FILE; + clear_cursor_geo(); + break; + } + found_record_id = posting->rid; + grn_table_get_key(ctx, grn_table, found_record_id, + GRN_TEXT_VALUE(&key_buffer), + table->key_info->key_length); + error = wrapper_get_record(buf, (const uchar *)GRN_TEXT_VALUE(&key_buffer)); + } while (error == HA_ERR_END_OF_FILE || error == HA_ERR_KEY_NOT_FOUND); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_get_next_record(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + if (cursor_geo) { + grn_posting *posting; + posting = grn_geo_cursor_next(ctx, cursor_geo); + if (posting) { + record_id = posting->rid; + } else { + record_id = GRN_ID_NIL; + } + } else if (cursor) { + record_id = grn_table_cursor_next(ctx, cursor); + } else if (empty_value_records_cursor) { + grn_id empty_value_record_id; + empty_value_record_id = + grn_table_cursor_next(ctx, empty_value_records_cursor); + if (empty_value_record_id == GRN_ID_NIL) { + record_id = GRN_ID_NIL; + } else { + grn_table_get_key(ctx, empty_value_records, empty_value_record_id, + &record_id, sizeof(grn_id)); + } + } else { + record_id = GRN_ID_NIL; + } + if (ctx->rc) { + int error = ER_ERROR_ON_READ; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + if (record_id == GRN_ID_NIL) { + DBUG_PRINT("info", ("mroonga: storage_get_next_record: end-of-file")); + table->status = STATUS_NOT_FOUND; + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + if (buf) { + if (ignoring_no_key_columns) + storage_store_fields_by_index(buf); + else + storage_store_fields(buf, record_id); + if (cursor_geo && grn_source_column_geo) { + int latitude, longitude; + GRN_GEO_POINT_VALUE(&source_point, latitude, longitude); + double latitude_in_degree = GRN_GEO_MSEC2DEGREE(latitude); + double longitude_in_degree = GRN_GEO_MSEC2DEGREE(longitude); + if (!((bottom_right_latitude_in_degree <= latitude_in_degree && + latitude_in_degree <= top_left_latitude_in_degree) && + (top_left_longitude_in_degree <= longitude_in_degree && + longitude_in_degree <= bottom_right_longitude_in_degree))) { + DBUG_PRINT("info", + ("mroonga: remove not contained geo point: " + "<%g,%g>(<%d,%d>); key: <%g,%g>(<%d,%d>), <%g,%g>(<%d,%d>)", + latitude_in_degree, longitude_in_degree, + latitude, longitude, + top_left_latitude_in_degree, top_left_longitude_in_degree, + GRN_GEO_DEGREE2MSEC(top_left_latitude_in_degree), + GRN_GEO_DEGREE2MSEC(top_left_longitude_in_degree), + bottom_right_latitude_in_degree, + bottom_right_longitude_in_degree, + GRN_GEO_DEGREE2MSEC(bottom_right_latitude_in_degree), + GRN_GEO_DEGREE2MSEC(bottom_right_longitude_in_degree))); + int error = storage_get_next_record(buf); + DBUG_RETURN(error); + } + } + } + table->status = 0; + DBUG_RETURN(0); +} + +void ha_mroonga::geo_store_rectangle(const uchar *rectangle) +{ + MRN_DBUG_ENTER_METHOD(); + + double locations[4]; + for (int i = 0; i < 4; i++) { + uchar reversed_value[8]; + for (int j = 0; j < 8; j++) { + reversed_value[j] = (rectangle + (8 * i))[7 - j]; + } + mi_float8get(locations[i], reversed_value); + } + top_left_longitude_in_degree = locations[0]; + bottom_right_longitude_in_degree = locations[1]; + bottom_right_latitude_in_degree = locations[2]; + top_left_latitude_in_degree = locations[3]; + int top_left_latitude = GRN_GEO_DEGREE2MSEC(top_left_latitude_in_degree); + int top_left_longitude = GRN_GEO_DEGREE2MSEC(top_left_longitude_in_degree); + int bottom_right_latitude = GRN_GEO_DEGREE2MSEC(bottom_right_latitude_in_degree); + int bottom_right_longitude = GRN_GEO_DEGREE2MSEC(bottom_right_longitude_in_degree); + GRN_GEO_POINT_SET(ctx, &top_left_point, + top_left_latitude, top_left_longitude); + GRN_GEO_POINT_SET(ctx, &bottom_right_point, + bottom_right_latitude, bottom_right_longitude); + + DBUG_VOID_RETURN; +} + +int ha_mroonga::generic_geo_open_cursor(const uchar *key, + enum ha_rkey_function find_flag) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + int flags = 0; + if (find_flag & HA_READ_MBR_CONTAIN) { + grn_obj *index = grn_index_columns[active_index]; + geo_store_rectangle(key); + cursor_geo = grn_geo_cursor_open_in_rectangle(ctx, + index, + &top_left_point, + &bottom_right_point, + 0, -1); + if (cursor_geo) { + if (grn_source_column_geo) { + grn_obj_unlink(ctx, grn_source_column_geo); + } + grn_obj sources; + GRN_OBJ_INIT(&sources, GRN_BULK, 0, GRN_ID_NIL); + grn_obj_get_info(ctx, index, GRN_INFO_SOURCE, &sources); + grn_source_column_geo = grn_ctx_at(ctx, GRN_RECORD_VALUE(&sources)); + grn_obj_unlink(ctx, &sources); + } + } else { + push_warning_unsupported_spatial_index_search(find_flag); + cursor = grn_table_cursor_open(ctx, grn_table, NULL, 0, NULL, 0, + 0, -1, flags); + } + if (ctx->rc) { + error = ER_ERROR_ON_READ; + my_message(error, ctx->errbuf, MYF(0)); + } + DBUG_RETURN(error); +} + +bool ha_mroonga::is_dry_write() +{ + MRN_DBUG_ENTER_METHOD(); + bool dry_write_p = THDVAR(ha_thd(), dry_write); + DBUG_RETURN(dry_write_p); +} + +bool ha_mroonga::is_enable_optimization() +{ + MRN_DBUG_ENTER_METHOD(); + bool enable_optimization_p = THDVAR(ha_thd(), enable_optimization); + DBUG_RETURN(enable_optimization_p); +} + +bool ha_mroonga::should_normalize(Field *field) const +{ + MRN_DBUG_ENTER_METHOD(); + mrn::FieldNormalizer field_normalizer(ctx, ha_thd(), field); + bool need_normalize_p = field_normalizer.should_normalize(); + 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) +{ + MRN_DBUG_ENTER_METHOD(); + + if (!is_enable_optimization()) { + DBUG_PRINT("info", ("mroonga: count skip: 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->non_agg_fields.elements && + !select_lex->group_list.elements && + !select_lex->having && + 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; + } + + uint i = 0; + Item *where; + if (fulltext) { + DBUG_PRINT("info", ("mroonga: count skip: fulltext")); + where = select_lex->where; + 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; + } + where = where->next; + if (!where || + where->type() != Item::STRING_ITEM) { + DBUG_PRINT("info", ("mroonga: count skip: string item is not match")); + count_skip = false; + DBUG_VOID_RETURN; + } + for (where = where->next; where; where = where->next) { + if (where->type() != Item::FIELD_ITEM) + break; + DBUG_PRINT("info", ("mroonga: count skip: FIELD_ITEM=%p", where)); + } + if (where != info) { + DBUG_PRINT("info", ("mroonga: count skip: where clause is not match")); + 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 = select_lex->where; where; where = where->next) { + if (where->type() == Item::FIELD_ITEM) + { + Field *field = ((Item_field *)where)->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")); + } + } + 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) +{ + MRN_DBUG_ENTER_METHOD(); + + if (column->header.type != GRN_COLUMN_FIX_SIZE) { + DBUG_RETURN(false); + } + + char *bytes = GRN_BULK_HEAD(value); + unsigned int size = GRN_BULK_VSIZE(value); + for (unsigned int i = 0; i < size; ++i) { + if (bytes[i] != '\0') { + DBUG_RETURN(false); + } + } + + DBUG_RETURN(true); +} + +void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys, + int *n_sort_keys, + longlong *limit) +{ + MRN_DBUG_ENTER_METHOD(); + + if (!is_enable_optimization()) { + DBUG_PRINT("info", ("mroonga: fast order limit: optimization is disabled")); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + + TABLE_LIST *table_list = table->pos_in_table_list; + st_select_lex *select_lex = table_list->select_lex; + SELECT_LEX_UNIT *unit = table_list->derived; + st_select_lex *first_select_lex; + if (unit) + { + first_select_lex = unit->first_select(); + } else { + first_select_lex = select_lex; + } + DBUG_PRINT("info", + ("mroonga: first_select_lex->options=%llu", + first_select_lex ? first_select_lex->options : 0)); + + if ( + thd_sql_command(ha_thd()) == SQLCOM_SELECT && + !select_lex->with_sum_func && + !select_lex->group_list.elements && + !select_lex->having && + select_lex->table_list.elements == 1 && + select_lex->order_list.elements && + select_lex->explicit_limit && + select_lex->select_limit && + select_lex->select_limit->val_int() > 0 + ) { + if (select_lex->offset_limit) { + *limit = select_lex->offset_limit->val_int(); + } else { + *limit = 0; + } + *limit += select_lex->select_limit->val_int(); + if (*limit > (longlong)INT_MAX) { + DBUG_PRINT("info", + ("mroonga: fast_order_limit = false: " + "too long limit: %lld <= %d is required", + *limit, INT_MAX)); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + if (first_select_lex && (first_select_lex->options & OPTION_FOUND_ROWS)) { + DBUG_PRINT("info", + ("mroonga: fast_order_limit = false: " + "SQL_CALC_FOUND_ROWS is specified")); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + Item *where = select_lex->where; + const Item_func *match_against = NULL; + if (where) { + bool is_storage_mode = !(share->wrapper_mode); + mrn::ConditionConverter converter(ctx, grn_table, is_storage_mode); + if (!converter.is_convertable(where)) { + DBUG_PRINT("info", + ("mroonga: fast_order_limit = false: " + "not groonga layer condition search")); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + match_against = converter.find_match_against(where); + if (!match_against) { + DBUG_PRINT("info", + ("mroonga: fast_order_limit = false: " + "groonga layer condition but not fulltext search")); + fast_order_limit = false; + DBUG_VOID_RETURN; + } + } + *n_sort_keys = select_lex->order_list.elements; + *sort_keys = (grn_table_sort_key *)malloc(sizeof(grn_table_sort_key) * + *n_sort_keys); + ORDER *order; + int i; + mrn_change_encoding(ctx, system_charset_info); + for (order = (ORDER *) select_lex->order_list.first, i = 0; order; + order = order->next, i++) { + Item *item = *order->item; + if (grn_columns && item->type() == Item::FIELD_ITEM) + { + Field *field = ((Item_field *) (*order->item))->field; + const char *column_name = field->field_name; + int column_name_size = strlen(column_name); + + if (should_normalize(field)) + { + DBUG_PRINT("info", ("mroonga: fast_order_limit = false: " + "sort by collated value isn't supported yet.")); + fast_order_limit = false; + free(*sort_keys); + *sort_keys = NULL; + *n_sort_keys = 0; + DBUG_VOID_RETURN; + } + + (*sort_keys)[i].key = grn_obj_column(ctx, matched_record_keys, + column_name, column_name_size); + } else if (!match_against || match_against->eq(item, true)) { + (*sort_keys)[i].key = grn_obj_column(ctx, matched_record_keys, + MRN_COLUMN_NAME_SCORE, + strlen(MRN_COLUMN_NAME_SCORE)); + } else { + DBUG_PRINT("info", ("mroonga: fast_order_limit = false: " + "sort by computed value isn't supported.")); + fast_order_limit = false; + free(*sort_keys); + *sort_keys = NULL; + *n_sort_keys = 0; + DBUG_VOID_RETURN; + } + (*sort_keys)[i].offset = 0; + if (MRN_ORDER_IS_ASC(order)) + { + (*sort_keys)[i].flags = GRN_TABLE_SORT_ASC; + } else { + (*sort_keys)[i].flags = GRN_TABLE_SORT_DESC; + } + } + DBUG_PRINT("info", ("mroonga: fast_order_limit = true")); + fast_order_limit = true; + mrn_fast_order_limit++; + DBUG_VOID_RETURN; + } + DBUG_PRINT("info", ("mroonga: fast_order_limit = false")); + fast_order_limit = false; + DBUG_VOID_RETURN; +} + +int ha_mroonga::generic_store_bulk_fixed_size_string(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + grn_obj_reinit(ctx, buf, GRN_DB_SHORT_TEXT, 0); + GRN_TEXT_SET(ctx, buf, field->ptr, field->field_length); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_variable_size_string(Field *field, + grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + String value; + field->val_str(NULL, &value); + grn_obj_reinit(ctx, buf, GRN_DB_SHORT_TEXT, 0); + DBUG_PRINT("info", ("mroonga: length=%u", value.length())); + DBUG_PRINT("info", ("mroonga: value=%s", value.c_ptr_safe())); + GRN_TEXT_SET(ctx, buf, value.ptr(), value.length()); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_integer(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + long long value = field->val_int(); + DBUG_PRINT("info", ("mroonga: value=%lld", value)); + uint32 size = field->pack_length(); + DBUG_PRINT("info", ("mroonga: size=%u", size)); + Field_num *field_num = static_cast(field); + bool is_unsigned = field_num->unsigned_flag; + DBUG_PRINT("info", ("mroonga: is_unsigned=%s", is_unsigned ? "true" : "false")); + switch (size) { + case 1: + if (is_unsigned) { + grn_obj_reinit(ctx, buf, GRN_DB_UINT8, 0); + GRN_UINT8_SET(ctx, buf, value); + } else { + grn_obj_reinit(ctx, buf, GRN_DB_INT8, 0); + GRN_INT8_SET(ctx, buf, value); + } + break; + case 2: + if (is_unsigned) { + grn_obj_reinit(ctx, buf, GRN_DB_UINT16, 0); + GRN_UINT16_SET(ctx, buf, value); + } else { + grn_obj_reinit(ctx, buf, GRN_DB_INT16, 0); + GRN_INT16_SET(ctx, buf, value); + } + break; + case 3: + case 4: + if (is_unsigned) { + grn_obj_reinit(ctx, buf, GRN_DB_UINT32, 0); + GRN_UINT32_SET(ctx, buf, value); + } else { + grn_obj_reinit(ctx, buf, GRN_DB_INT32, 0); + GRN_INT32_SET(ctx, buf, value); + } + break; + case 8: + if (is_unsigned) { + grn_obj_reinit(ctx, buf, GRN_DB_UINT64, 0); + GRN_UINT64_SET(ctx, buf, value); + } else { + grn_obj_reinit(ctx, buf, GRN_DB_INT64, 0); + GRN_INT64_SET(ctx, buf, value); + } + break; + default: + // Why!? + error = HA_ERR_UNSUPPORTED; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "unknown integer value size: <%u>: " + "available sizes: [1, 2, 3, 4, 8]", + size); + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, + error, error_message); + break; + } + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_unsigned_integer(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + long long signed_value = field->val_int(); + unsigned long long unsigned_value = *((unsigned long long *)(&signed_value)); + uint32 size = field->pack_length(); + switch (size) { + case 1: + grn_obj_reinit(ctx, buf, GRN_DB_UINT8, 0); + GRN_UINT8_SET(ctx, buf, unsigned_value); + break; + case 2: + grn_obj_reinit(ctx, buf, GRN_DB_UINT16, 0); + GRN_UINT16_SET(ctx, buf, unsigned_value); + break; + case 3: + case 4: + grn_obj_reinit(ctx, buf, GRN_DB_UINT32, 0); + GRN_UINT32_SET(ctx, buf, unsigned_value); + break; + case 8: + grn_obj_reinit(ctx, buf, GRN_DB_UINT64, 0); + GRN_UINT64_SET(ctx, buf, unsigned_value); + break; + default: + // Why!? + error = HA_ERR_UNSUPPORTED; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "unknown unsigned integer value size: <%u>: " + "available sizes: [1, 2, 3, 4, 8]", + size); + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, + error, error_message); + break; + } + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_float(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + double value = field->val_real(); + uint32 size = field->pack_length(); + switch (size) { + case 4: + case 8: + grn_obj_reinit(ctx, buf, GRN_DB_FLOAT, 0); + GRN_FLOAT_SET(ctx, buf, value); + break; + default: + // Why!? + error = HA_ERR_UNSUPPORTED; + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "unknown float value size: <%u>: " + "available sizes: [4, 8]", + size); + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, + error, error_message); + break; + } + DBUG_RETURN(error); +} + +long long int ha_mroonga::get_grn_time_from_timestamp_field(Field_timestamp *field) +{ + MRN_DBUG_ENTER_METHOD(); + long long int grn_time = 0; +#ifdef MRN_TIMESTAMP_USE_TIMEVAL + int warnings = 0; + struct timeval time_value; + if (field->get_timestamp(&time_value, &warnings)) { + // XXX: Should we report warnings or MySQL does? + } else { + DBUG_PRINT("info", ("mroonga: timeval tv_sec=%ld", time_value.tv_sec)); + grn_time = GRN_TIME_PACK(time_value.tv_sec, time_value.tv_usec); + } +#elif defined(MRN_TIMESTAMP_USE_MY_TIME_T) + unsigned long int micro_seconds; + my_time_t seconds = field->get_timestamp(µ_seconds); + DBUG_PRINT("info", ("mroonga: my_time_t seconds=%ld", seconds)); + grn_time = GRN_TIME_PACK(seconds, micro_seconds); +#else + my_bool is_null_value; + long seconds = field->get_timestamp(&is_null_value); + DBUG_PRINT("info", ("mroonga: long seconds=%ld", seconds)); + grn_time = GRN_TIME_PACK(seconds, 0); +#endif + DBUG_RETURN(grn_time); +} + +int ha_mroonga::generic_store_bulk_timestamp(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + Field_timestamp *timestamp_field = (Field_timestamp *)field; + long long int time = get_grn_time_from_timestamp_field(timestamp_field); + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_date(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + long long int date_value = field->val_int(); + struct tm date; + memset(&date, 0, sizeof(struct tm)); + date.tm_year = date_value / 10000 % 10000 - mrn::TimeConverter::TM_YEAR_BASE; + date.tm_mon = date_value / 100 % 100 - 1; + date.tm_mday = date_value % 100; + int usec = 0; + mrn::TimeConverter time_converter; + long long int time = time_converter.tm_to_grn_time(&date, usec, &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_time(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + Field_time *time_field = (Field_time *)field; + MYSQL_TIME mysql_time; + time_field->get_time(&mysql_time); + mrn::TimeConverter time_converter; + long long int time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_datetime(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + Field_datetime *datetime_field = (Field_datetime *)field; + MYSQL_TIME mysql_time; + datetime_field->get_time(&mysql_time); + mrn::TimeConverter time_converter; + long long int time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_year(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + + int year; + if (field->field_length == 2) { + year = static_cast(field->val_int() + 2000); + } else { + year = static_cast(field->val_int()); + } + + DBUG_PRINT("info", ("mroonga: year=%d", year)); + struct tm date; + memset(&date, 0, sizeof(struct tm)); + date.tm_year = year - mrn::TimeConverter::TM_YEAR_BASE; + date.tm_mon = 0; + date.tm_mday = 1; + + int usec = 0; + mrn::TimeConverter time_converter; + long long int time = time_converter.tm_to_grn_time(&date, usec, &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 +int ha_mroonga::generic_store_bulk_datetime2(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + Field_datetimef *datetimef_field = (Field_datetimef *)field; + MYSQL_TIME mysql_time; + datetimef_field->get_time(&mysql_time); + mrn::TimeConverter time_converter; + long long int time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} +#endif + +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 +int ha_mroonga::generic_store_bulk_time2(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + MYSQL_TIME mysql_time; + field->get_time(&mysql_time); + mrn::TimeConverter time_converter; + long long int time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} +#endif + +int ha_mroonga::generic_store_bulk_new_date(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + Field_newdate *newdate_field = (Field_newdate *)field; + MYSQL_TIME mysql_date; + newdate_field->get_time(&mysql_date); + mrn::TimeConverter time_converter; + long long int time = time_converter.mysql_time_to_grn_time(&mysql_date, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + grn_obj_reinit(ctx, buf, GRN_DB_TIME, 0); + GRN_TIME_SET(ctx, buf, time); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_new_decimal(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + String value; + Field_new_decimal *new_decimal_field = (Field_new_decimal *)field; + new_decimal_field->val_str(&value, NULL); + grn_obj_reinit(ctx, buf, GRN_DB_SHORT_TEXT, 0); + GRN_TEXT_SET(ctx, buf, value.ptr(), value.length()); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_blob(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + String buffer; + Field_blob *blob = (Field_blob *)field; + const char *value = blob->val_str(0, &buffer)->ptr(); + grn_obj_reinit(ctx, buf, GRN_DB_TEXT, 0); + GRN_TEXT_SET(ctx, buf, value, blob->get_length()); + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk_geometry(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; +#ifdef HAVE_SPATIAL + String buffer; + Field_geom *geometry = (Field_geom *)field; + const char *wkb = geometry->val_str(0, &buffer)->ptr(); + int len = geometry->get_length(); + error = mrn_set_geometry(ctx, buf, wkb, len); +#endif + DBUG_RETURN(error); +} + +int ha_mroonga::generic_store_bulk(Field *field, grn_obj *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + error = mrn_change_encoding(ctx, field->charset()); + if (error) + return error; + switch (field->real_type()) { + case MYSQL_TYPE_DECIMAL: + error = generic_store_bulk_variable_size_string(field, buf); + break; + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_LONG: + error = generic_store_bulk_integer(field, buf); + break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + error = generic_store_bulk_float(field, buf); + break; + case MYSQL_TYPE_NULL: + error = generic_store_bulk_unsigned_integer(field, buf); + break; + case MYSQL_TYPE_TIMESTAMP: + error = generic_store_bulk_timestamp(field, buf); + break; + case MYSQL_TYPE_LONGLONG: + case MYSQL_TYPE_INT24: + error = generic_store_bulk_integer(field, buf); + break; + case MYSQL_TYPE_DATE: + error = generic_store_bulk_date(field, buf); + break; + case MYSQL_TYPE_TIME: + error = generic_store_bulk_time(field, buf); + break; + case MYSQL_TYPE_DATETIME: + error = generic_store_bulk_datetime(field, buf); + break; + case MYSQL_TYPE_YEAR: + error = generic_store_bulk_year(field, buf); + break; + case MYSQL_TYPE_NEWDATE: + error = generic_store_bulk_new_date(field, buf); + break; + case MYSQL_TYPE_VARCHAR: + error = generic_store_bulk_variable_size_string(field, buf); + break; + case MYSQL_TYPE_BIT: + error = generic_store_bulk_unsigned_integer(field, buf); + break; +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: + error = generic_store_bulk_timestamp(field, buf); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: + error = generic_store_bulk_datetime2(field, buf); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: + error = generic_store_bulk_time2(field, buf); + break; +#endif + case MYSQL_TYPE_NEWDECIMAL: + error = generic_store_bulk_new_decimal(field, buf); + break; + case MYSQL_TYPE_ENUM: + error = generic_store_bulk_unsigned_integer(field, buf); + break; + case MYSQL_TYPE_SET: + error = generic_store_bulk_unsigned_integer(field, buf); + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + error = generic_store_bulk_blob(field, buf); + break; + case MYSQL_TYPE_VAR_STRING: + error = generic_store_bulk_variable_size_string(field, buf); + break; + case MYSQL_TYPE_STRING: + error = generic_store_bulk_fixed_size_string(field, buf); + break; + case MYSQL_TYPE_GEOMETRY: + error = generic_store_bulk_geometry(field, buf); + break; + default: + error = HA_ERR_UNSUPPORTED; + break; + } + DBUG_RETURN(error); +} + +void ha_mroonga::storage_store_field_string(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + field->store(value, value_length, field->charset()); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_integer(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + Field_num *field_num = static_cast(field); + bool is_unsigned = field_num->unsigned_flag; + switch (value_length) { + case 1: + { + if (is_unsigned) { + unsigned char field_value; + field_value = *((unsigned char *)value); + field->store(field_value, is_unsigned); + } else { + char field_value; + field_value = *((char *)value); + field->store(field_value, is_unsigned); + } + break; + } + case 2: + { + if (is_unsigned) { + unsigned short field_value; + field_value = *((unsigned short *)value); + field->store(field_value, is_unsigned); + } else { + short field_value; + field_value = *((short *)value); + field->store(field_value, is_unsigned); + } + break; + } + case 4: + { + if (is_unsigned) { + unsigned int field_value; + field_value = *((unsigned int *)value); + field->store(field_value, is_unsigned); + } else { + int field_value; + field_value = *((int *)value); + field->store(field_value, is_unsigned); + } + break; + } + case 8: + { + if (is_unsigned) { + unsigned long long int field_value; + field_value = *((unsigned long long int *)value); + DBUG_PRINT("info", ("mroonga: field_value=%llu", field_value)); + field->store(field_value, is_unsigned); + } else { + long long int field_value; + field_value = *((long long int *)value); + field->store(field_value, is_unsigned); + } + break; + } + default: + { + // Why!? + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "unknown integer value size: <%d>: " + "available sizes: [1, 2, 4, 8]", + value_length); + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, error_message); + storage_store_field_string(field, value, value_length); + break; + } + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_unsigned_integer(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + switch (value_length) { + case 1: + { + unsigned char field_value; + field_value = *((unsigned char *)value); + field->store(field_value, true); + break; + } + case 2: + { + unsigned short field_value; + field_value = *((unsigned short *)value); + field->store(field_value, true); + break; + } + case 4: + { + unsigned int field_value; + field_value = *((unsigned int *)value); + field->store(field_value, true); + break; + } + case 8: + { + unsigned long long int field_value; + field_value = *((unsigned long long int *)value); + DBUG_PRINT("info", ("mroonga: field_value=%llu", field_value)); + field->store(field_value, true); + break; + } + default: + { + // Why!? + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "unknown integer value size: <%d>: " + "available sizes: [1, 2, 4, 8]", + value_length); + push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, error_message); + storage_store_field_string(field, value, value_length); + break; + } + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_float(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + double field_value; + field_value = *((double *)value); + field->store(field_value); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_timestamp(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + Field_timestamp *timestamp_field = (Field_timestamp *)field; +#ifdef MRN_TIMESTAMP_USE_TIMEVAL + struct timeval time_value; + GRN_TIME_UNPACK(time, time_value.tv_sec, time_value.tv_usec); + timestamp_field->store_timestamp(&time_value); +#elif defined(MRN_TIMESTAMP_USE_MY_TIME_T) + long long int sec, usec; + GRN_TIME_UNPACK(time, sec, usec); + timestamp_field->store_TIME(static_cast(sec), + static_cast(usec)); +#else + int32 sec, usec __attribute__((unused)); + GRN_TIME_UNPACK(time, sec, usec); + timestamp_field->store_timestamp(sec); +#endif + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_date(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + long long int sec, usec __attribute__((unused)); + GRN_TIME_UNPACK(time, sec, usec); + struct tm date; + time_t sec_t = static_cast(sec); + gmtime_r(&sec_t, &date); + long long int date_in_mysql = + (date.tm_year + mrn::TimeConverter::TM_YEAR_BASE) * 10000 + + (date.tm_mon + 1) * 100 + + date.tm_mday; + field->store(date_in_mysql, false); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_time(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + MYSQL_TIME mysql_time; + memset(&mysql_time, 0, sizeof(MYSQL_TIME)); + mysql_time.time_type = MYSQL_TIMESTAMP_TIME; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_time); +#ifdef MRN_FIELD_STORE_TIME_NEED_TYPE + Field_time *time_field = (Field_time *)field; + time_field->store_time(&mysql_time, mysql_time.time_type); +#else + field->store_time(&mysql_time); +#endif + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_datetime(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + MYSQL_TIME mysql_datetime; + memset(&mysql_datetime, 0, sizeof(MYSQL_TIME)); + mysql_datetime.time_type = MYSQL_TIMESTAMP_DATETIME; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_datetime); +#ifdef MRN_FIELD_STORE_TIME_NEED_TYPE + Field_datetime *datetime_field = (Field_datetime *)field; + datetime_field->store_time(&mysql_datetime, mysql_datetime.time_type); +#else + field->store_time(&mysql_datetime); +#endif + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_year(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + MYSQL_TIME mysql_time; + memset(&mysql_time, 0, sizeof(MYSQL_TIME)); + mysql_time.time_type = MYSQL_TIMESTAMP_DATE; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_time); + DBUG_PRINT("info", ("mroonga: stored %d", mysql_time.year)); + field->store(mysql_time.year, false); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_new_date(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + MYSQL_TIME mysql_date; + memset(&mysql_date, 0, sizeof(MYSQL_TIME)); + mysql_date.time_type = MYSQL_TIMESTAMP_DATE; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_date); +#ifdef MRN_FIELD_STORE_TIME_NEED_TYPE + Field_newdate *newdate_field = (Field_newdate *)field; + newdate_field->store_time(&mysql_date, MYSQL_TIMESTAMP_DATE); +#else + field->store_time(&mysql_date); +#endif + DBUG_VOID_RETURN; +} + +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 +void ha_mroonga::storage_store_field_datetime2(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + MYSQL_TIME mysql_datetime; + memset(&mysql_datetime, 0, sizeof(MYSQL_TIME)); + mysql_datetime.time_type = MYSQL_TIMESTAMP_DATETIME; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_datetime); + field->store_time(&mysql_datetime); + DBUG_VOID_RETURN; +} +#endif + +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 +void ha_mroonga::storage_store_field_time2(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + long long int time = *((long long int *)value); + + MYSQL_TIME mysql_time; + memset(&mysql_time, 0, sizeof(MYSQL_TIME)); + mysql_time.time_type = MYSQL_TIMESTAMP_TIME; + mrn::TimeConverter time_converter; + time_converter.grn_time_to_mysql_time(time, &mysql_time); + field->store_time(&mysql_time); + DBUG_VOID_RETURN; +} +#endif + +void ha_mroonga::storage_store_field_blob(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); + Field_blob *blob = (Field_blob *)field; + String *blob_buffer = &blob_buffers[field->field_index]; + blob_buffer->length(0); + blob_buffer->reserve(value_length); + blob_buffer->q_append(value, value_length); + blob->set_ptr((uint32) value_length, (uchar *) blob_buffer->ptr()); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field_geometry(Field *field, + const char *value, + uint value_length) +{ + MRN_DBUG_ENTER_METHOD(); +#ifdef HAVE_SPATIAL + uchar wkb[SRID_SIZE + WKB_HEADER_SIZE + POINT_DATA_SIZE]; + grn_geo_point *field_value = (grn_geo_point *)value; + int latitude, longitude; + latitude = field_value->latitude; + longitude = field_value->longitude; + if (grn_source_column_geo) { + GRN_GEO_POINT_SET(ctx, &source_point, latitude, longitude); + } + memset(wkb, 0, SRID_SIZE); + memset(wkb + SRID_SIZE, Geometry::wkb_ndr, 1); // wkb_ndr is meaningless. + int4store(wkb + SRID_SIZE + 1, Geometry::wkb_point); + double latitude_in_degree, longitude_in_degree; + latitude_in_degree = GRN_GEO_MSEC2DEGREE(latitude); + longitude_in_degree = GRN_GEO_MSEC2DEGREE(longitude); + float8store(wkb + SRID_SIZE + WKB_HEADER_SIZE, + longitude_in_degree); + float8store(wkb + SRID_SIZE + WKB_HEADER_SIZE + SIZEOF_STORED_DOUBLE, + latitude_in_degree); + String *geometry_buffer = &blob_buffers[field->field_index]; + geometry_buffer->length(0); + uint wkb_length = sizeof(wkb) / sizeof(*wkb); + Field_geom *geometry = (Field_geom *)field; + geometry_buffer->reserve(wkb_length); + geometry_buffer->q_append((const char *) wkb, wkb_length); + geometry->set_ptr((uint32) wkb_length, (uchar *) geometry_buffer->ptr()); +#endif + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_field(Field *field, + const char *value, uint value_length) +{ + field->set_notnull(); + switch (field->real_type()) { + case MYSQL_TYPE_DECIMAL: + storage_store_field_string(field, value, value_length); + break; + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_LONG: + storage_store_field_integer(field, value, value_length); + break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + storage_store_field_float(field, value, value_length); + break; + case MYSQL_TYPE_NULL: + storage_store_field_unsigned_integer(field, value, value_length); + break; + case MYSQL_TYPE_TIMESTAMP: + storage_store_field_timestamp(field, value, value_length); + break; + case MYSQL_TYPE_LONGLONG: + case MYSQL_TYPE_INT24: + storage_store_field_integer(field, value, value_length); + break; + case MYSQL_TYPE_DATE: + storage_store_field_date(field, value, value_length); + break; + case MYSQL_TYPE_TIME: + storage_store_field_time(field, value, value_length); + break; + case MYSQL_TYPE_DATETIME: + storage_store_field_datetime(field, value, value_length); + break; + case MYSQL_TYPE_YEAR: + storage_store_field_year(field, value, value_length); + break; + case MYSQL_TYPE_NEWDATE: + storage_store_field_new_date(field, value, value_length); + break; + case MYSQL_TYPE_VARCHAR: + storage_store_field_string(field, value, value_length); + break; + case MYSQL_TYPE_BIT: + storage_store_field_unsigned_integer(field, value, value_length); + break; +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: + storage_store_field_timestamp(field, value, value_length); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: + storage_store_field_datetime2(field, value, value_length); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: + storage_store_field_time2(field, value, value_length); + break; +#endif + case MYSQL_TYPE_NEWDECIMAL: + storage_store_field_string(field, value, value_length); + break; + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + storage_store_field_unsigned_integer(field, value, value_length); + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + storage_store_field_blob(field, value, value_length); + break; + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + storage_store_field_string(field, value, value_length); + break; + case MYSQL_TYPE_GEOMETRY: + storage_store_field_geometry(field, value, value_length); + break; + } +} + +void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: stored record ID: %d", record_id)); + + my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(buf, table->record[0]); + + Field *primary_key_field = NULL; + if (grn_table_is_referenced && table->s->primary_key != MAX_INDEXES) { + KEY *key_info = &(table->s->key_info[table->s->primary_key]); + primary_key_field = key_info->key_part[0].field; + } + + int i; + int n_columns = table->s->fields; + for (i = 0; i < n_columns; i++) { + Field *field = table->field[i]; + + if (bitmap_is_set(table->read_set, field->field_index) || + bitmap_is_set(table->write_set, field->field_index)) { + const char *column_name = field->field_name; + + if (ignoring_no_key_columns) { + KEY key_info = table->s->key_info[active_index]; + if (strcmp(key_info.key_part[0].field->field_name, column_name)) { + continue; + } + } + + mrn::DebugColumnAccess debug_column_access(table, table->write_set); + DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index)); + field->move_field_offset(ptr_diff); + if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { + // for _id column + field->set_notnull(); + field->store((int)record_id); + } else if (primary_key_field && + strcmp(primary_key_field->field_name, column_name) == 0) { + // for primary key column + char key[GRN_TABLE_MAX_KEY_SIZE]; + int key_length; + key_length = grn_table_get_key(ctx, grn_table, record_id, + &key, GRN_TABLE_MAX_KEY_SIZE); + storage_store_field(field, key, key_length); + } else { + // actual column + const char *value; + uint32 value_length; + value = grn_obj_get_value_(ctx, grn_columns[i], record_id, + &value_length); + DBUG_PRINT("info", ("mroonga: value_length=%u",value_length)); + grn_obj *range = grn_column_ranges[i]; + // TODO: create mrn::is_grn_table() and use it. + if (GRN_TABLE_HASH_KEY <= range->header.type && + range->header.type <= GRN_DB) { + // TODO: extract as a method + if (((grn_columns[i]->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) == + GRN_OBJ_COLUMN_VECTOR)) { + // TODO: Check whether reference type or not + grn_obj unvectored_value; + GRN_TEXT_INIT(&unvectored_value, 0); + grn_id *ids = (grn_id *)value; + for (int i = 0; i * sizeof(grn_id) < value_length; i++) { + grn_id id = ids[i]; + if (i > 0) { + GRN_TEXT_PUTS(ctx, &unvectored_value, mrn_vector_column_delimiter); + } + char key[GRN_TABLE_MAX_KEY_SIZE]; + int key_length; + key_length = grn_table_get_key(ctx, range, id, + &key, GRN_TABLE_MAX_KEY_SIZE); + GRN_TEXT_PUT(ctx, &unvectored_value, key, key_length); + } + storage_store_field(field, + GRN_TEXT_VALUE(&unvectored_value), + GRN_TEXT_LEN(&unvectored_value)); + GRN_OBJ_FIN(ctx, &unvectored_value); + } else { + grn_id id = *((grn_id *)value); + char key[GRN_TABLE_MAX_KEY_SIZE]; + int key_length; + key_length = grn_table_get_key(ctx, range, id, + &key, GRN_TABLE_MAX_KEY_SIZE); + storage_store_field(field, key, key_length); + } + } else { + storage_store_field(field, value, value_length); + } + } + field->move_field_offset(-ptr_diff); + } + } + + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data, + uchar *new_data, + grn_id record_id) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: stored record ID: %d", record_id)); + my_ptrdiff_t ptr_diff_old = PTR_BYTE_DIFF(old_data, table->record[0]); + my_ptrdiff_t ptr_diff_new = 0; +#ifdef MRN_RBR_UPDATE_NEED_ALL_COLUMNS + if (!written_by_row_based_binlog) { + if (check_written_by_row_based_binlog()) { + written_by_row_based_binlog = 2; + } else { + written_by_row_based_binlog = 1; + } + } + bool need_all_columns = + (new_data && written_by_row_based_binlog == 2); +#endif + if (new_data) { + ptr_diff_new = PTR_BYTE_DIFF(new_data, table->record[0]); + } + int i; + int n_columns = table->s->fields; + for (i = 0; i < n_columns; i++) { + Field *field = table->field[i]; + + if ( + !bitmap_is_set(table->read_set, field->field_index) && + !bitmap_is_set(table->write_set, field->field_index) && +#ifdef MRN_RBR_UPDATE_NEED_ALL_COLUMNS + ( + need_all_columns || +#endif + bitmap_is_set(&multiple_column_key_bitmap, field->field_index) +#ifdef MRN_RBR_UPDATE_NEED_ALL_COLUMNS + ) +#endif + ) { + mrn::DebugColumnAccess debug_column_access(table, table->write_set); + DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index)); + const char *value; + uint32 value_length; + value = grn_obj_get_value_(ctx, grn_columns[i], record_id, + &value_length); + // old column + field->move_field_offset(ptr_diff_old); + storage_store_field(field, value, value_length); + field->move_field_offset(-ptr_diff_old); + if (new_data) { + // new column + field->move_field_offset(ptr_diff_new); + storage_store_field(field, value, value_length); + field->move_field_offset(-ptr_diff_new); + } + } + } + + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_store_fields_by_index(uchar *buf) +{ + MRN_DBUG_ENTER_METHOD(); + uint key_length; + void *key; + KEY *key_info = &table->key_info[active_index]; + if (table->s->primary_key == active_index) + key_length = grn_table_cursor_get_key(ctx, cursor, &key); + else + key_length = grn_table_cursor_get_key(ctx, index_table_cursor, &key); + + if (KEY_N_KEY_PARTS(key_info) == 1) { + my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(buf, table->record[0]); + Field *field = key_info->key_part->field; + mrn::DebugColumnAccess debug_column_access(table, table->write_set); + field->move_field_offset(ptr_diff); + storage_store_field(field, (const char *)key, key_length); + field->move_field_offset(-ptr_diff); + } else { + uchar enc_buf[MAX_KEY_LENGTH]; + uint enc_len; + mrn::MultipleColumnKeyCodec codec(ctx, ha_thd(), key_info); + codec.decode(static_cast(key), key_length, enc_buf, &enc_len); + key_restore(buf, enc_buf, key_info, enc_len); + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::storage_encode_key_normalize_min_sort_chars(Field *field, + uchar *buf, + uint size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + if (size == 0) { + DBUG_RETURN(0); + } + if (!field->has_charset()) { + DBUG_RETURN(0); + } + + uint16 raw_min_sort_char = + static_cast(field->sort_charset()->min_sort_char); + if (raw_min_sort_char <= UINT_MAX8) { + uchar min_sort_char = static_cast(raw_min_sort_char); + for (uint i = size - 1; i > 0; --i) { + if (buf[i] != min_sort_char) { + break; + } + buf[i] = '\0'; + } + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_fixed_size_string(Field *field, + const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + memcpy(buf, key, field->field_length); + *size = field->field_length; + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_variable_size_string(Field *field, + const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + *size = uint2korr(key); + memcpy(buf, key + HA_KEY_BLOB_LENGTH, *size); + storage_encode_key_normalize_min_sort_chars(field, buf, *size); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_timestamp(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + long long int time; + MYSQL_TIME mysql_time; +#ifdef MRN_MARIADB_P + if (field->decimals() == 0) { + my_time_t my_time = sint4korr(key); + mrn_my_tz_UTC->gmt_sec_to_TIME(&mysql_time, my_time); + mysql_time.second_part = 0; + } else { + Field_timestamp_hires *timestamp_hires_field = + (Field_timestamp_hires *)field; + uint fuzzy_date = 0; + uchar *ptr_backup = field->ptr; + uchar *null_ptr_backup = field->null_ptr; + TABLE *table_backup = field->table; + field->ptr = (uchar *)key; + field->null_ptr = (uchar *)(key - 1); + field->table = table; + timestamp_hires_field->get_date(&mysql_time, fuzzy_date); + field->ptr = ptr_backup; + field->null_ptr = null_ptr_backup; + field->table = table_backup; + } +#else + my_time_t my_time = uint4korr(key); + mrn_my_tz_UTC->gmt_sec_to_TIME(&mysql_time, my_time); +#endif + mrn::TimeConverter time_converter; + time = time_converter.mysql_time_to_grn_time(&mysql_time, &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &time, 8); + *size = 8; + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_time(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + long long int time; +#ifdef MRN_MARIADB_P + MYSQL_TIME mysql_time; + bool truncated = false; + if (field->decimals() == 0) { + long long int packed_time = sint3korr(key); + mysql_time.neg = false; + if (packed_time < 0) { + mysql_time.neg = true; + packed_time = -packed_time; + } + mysql_time.year = 0; + mysql_time.month = 0; + mysql_time.day = 0; + mysql_time.hour = (int)(packed_time / 10000); + long long int minute_part = packed_time - mysql_time.hour * 10000; + mysql_time.minute = (int)(minute_part / 100); + mysql_time.second = (int)(minute_part % 100); + mysql_time.second_part = 0; + mysql_time.time_type = MYSQL_TIMESTAMP_TIME; + } else { + Field_time_hires *time_hires_field = (Field_time_hires *)field; + uint fuzzy_date = 0; + uchar *ptr_backup = field->ptr; + uchar *null_ptr_backup = field->null_ptr; + field->ptr = (uchar *)key; + field->null_ptr = (uchar *)(key - 1); + time_hires_field->get_date(&mysql_time, fuzzy_date); + field->ptr = ptr_backup; + field->null_ptr = null_ptr_backup; + } + mrn::TimeConverter time_converter; + time = time_converter.mysql_time_to_grn_time(&mysql_time, &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } +#else + int mysql_time = (int)sint3korr(key); + int sec = + mysql_time / 10000 * 60 * 60 + + mysql_time / 100 % 100 * 60 + + mysql_time % 60; + int usec = 0; + time = GRN_TIME_PACK(sec, usec); +#endif + memcpy(buf, &time, 8); + *size = 8; + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_year(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + int year = (int)key[0]; + + struct tm datetime; + memset(&datetime, 0, sizeof(struct tm)); + datetime.tm_year = year; + datetime.tm_mon = 0; + datetime.tm_mday = 1; + int usec = 0; + mrn::TimeConverter time_converter; + long long int time = time_converter.tm_to_grn_time(&datetime, usec, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &time, 8); + *size = 8; + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_datetime(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + long long int time; +#ifdef MRN_MARIADB_P + if (field->decimals() > 0) { + Field_datetime_hires *datetime_hires_field = (Field_datetime_hires *)field; + MYSQL_TIME mysql_time; + uint fuzzy_date = 0; + uchar *ptr_backup = field->ptr; + uchar *null_ptr_backup = field->null_ptr; + field->ptr = (uchar *)key; + field->null_ptr = (uchar *)(key - 1); + datetime_hires_field->get_date(&mysql_time, fuzzy_date); + field->ptr = ptr_backup; + field->null_ptr = null_ptr_backup; + mrn::TimeConverter time_converter; + time = time_converter.mysql_time_to_grn_time(&mysql_time, &truncated); + } else +#endif + { + long long int encoded_datetime = sint8korr(key); + uint32 part1 = (uint32)(encoded_datetime / 1000000LL); + uint32 part2 = (uint32)(encoded_datetime - + (unsigned long long int)part1 * 1000000LL); + struct tm date; + memset(&date, 0, sizeof(struct tm)); + date.tm_year = part1 / 10000 - mrn::TimeConverter::TM_YEAR_BASE; + date.tm_mon = part1 / 100 % 100 - 1; + date.tm_mday = part1 % 100; + date.tm_hour = part2 / 10000; + date.tm_min = part2 / 100 % 100; + date.tm_sec = part2 % 100; + int usec = 0; + mrn::TimeConverter time_converter; + time = time_converter.tm_to_grn_time(&date, usec, &truncated); + } + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &time, 8); + *size = 8; + DBUG_RETURN(error); +} + +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 +int ha_mroonga::storage_encode_key_timestamp2(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + + Field_timestampf *timestamp2_field = (Field_timestampf *)field; + struct timeval tm; + my_timestamp_from_binary(&tm, key, timestamp2_field->decimals()); + MYSQL_TIME mysql_time; + mrn_my_tz_UTC->gmt_sec_to_TIME(&mysql_time, (my_time_t)tm.tv_sec); + mysql_time.second_part = tm.tv_usec; + mrn::TimeConverter time_converter; + long long int grn_time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &grn_time, 8); + *size = 8; + + DBUG_RETURN(error); +} +#endif + +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 +int ha_mroonga::storage_encode_key_datetime2(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + + Field_datetimef *datetime2_field = (Field_datetimef *)field; + longlong packed_time = + my_datetime_packed_from_binary(key, datetime2_field->decimals()); + MYSQL_TIME mysql_time; + TIME_from_longlong_datetime_packed(&mysql_time, packed_time); + mrn::TimeConverter time_converter; + long long int grn_time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &grn_time, 8); + *size = 8; + + DBUG_RETURN(error); +} +#endif + +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 +int ha_mroonga::storage_encode_key_time2(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + bool truncated = false; + + Field_timef *time2_field = (Field_timef *)field; + longlong packed_time = + my_time_packed_from_binary(key, time2_field->decimals()); + MYSQL_TIME mysql_time; + TIME_from_longlong_time_packed(&mysql_time, packed_time); + mrn::TimeConverter time_converter; + long long int grn_time = time_converter.mysql_time_to_grn_time(&mysql_time, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &grn_time, 8); + *size = 8; + + DBUG_RETURN(error); +} +#endif + +int ha_mroonga::storage_encode_key_enum(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (field->pack_length() == 1) { + uchar value; + value = key[0]; + *size = 1; + memcpy(buf, &value, *size); + } else { + uint16 value; + shortget(value, key); + *size = 2; + memcpy(buf, &value, *size); + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key_set(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + Field_set unpacker((uchar *)key, field->field_length, (uchar *)(key - 1), + field->null_bit, field->unireg_check, field->field_name, + field->pack_length(), + static_cast(field)->typelib, + static_cast(field)->charset()); + switch (field->pack_length()) { + case 1: + { + int8 signed_value = (int8)(unpacker.val_int()); + uint8 unsigned_value = *((uint8 *)&signed_value); + *size = 1; + memcpy(buf, &unsigned_value, *size); + } + break; + case 2: + { + int16 signed_value = (int16)(unpacker.val_int()); + uint16 unsigned_value = *((uint16 *)&signed_value); + *size = 2; + memcpy(buf, &unsigned_value, *size); + } + break; + case 3: + case 4: + { + int32 signed_value = (int32)(unpacker.val_int()); + uint32 unsigned_value = *((uint32 *)&signed_value); + *size = 4; + memcpy(buf, &unsigned_value, *size); + } + break; + case 8: + default: + { + int64 signed_value = (int64)(unpacker.val_int()); + uint64 unsigned_value = *((uint64 *)&signed_value); + *size = 8; + memcpy(buf, &unsigned_value, *size); + } + break; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_key(Field *field, const uchar *key, + uchar *buf, uint *size) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + bool truncated = false; + const uchar *ptr = key; + + error = mrn_change_encoding(ctx, field->charset()); + if (error) + DBUG_RETURN(error); + + if (field->null_bit) { + ptr += 1; + } + + switch (field->real_type()) { + case MYSQL_TYPE_BIT: + case MYSQL_TYPE_TINY: + { + memcpy(buf, ptr, 1); + *size = 1; + break; + } + case MYSQL_TYPE_SHORT: + { + memcpy(buf, ptr, 2); + *size = 2; + break; + } + case MYSQL_TYPE_INT24: + { + memcpy(buf, ptr, 3); + buf[3] = 0; + *size = 4; + break; + } + case MYSQL_TYPE_LONG: + { + memcpy(buf, ptr, 4); + *size = 4; + break; + } + case MYSQL_TYPE_TIMESTAMP: + error = storage_encode_key_timestamp(field, ptr, buf, size); + break; + case MYSQL_TYPE_LONGLONG: + { + memcpy(buf, ptr, 8); + *size = 8; + break; + } + case MYSQL_TYPE_FLOAT: + { + float float_value; + double double_value; + float4get(float_value, ptr); + double_value = float_value; + memcpy(buf, &double_value, 8); + *size = 8; + break; + } + case MYSQL_TYPE_DOUBLE: + { + double val; + float8get(val, ptr); + memcpy(buf, &val, 8); + *size = 8; + break; + } + case MYSQL_TYPE_TIME: + error = storage_encode_key_time(field, ptr, buf, size); + break; + case MYSQL_TYPE_YEAR: + error = storage_encode_key_year(field, ptr, buf, size); + break; + case MYSQL_TYPE_DATETIME: + error = storage_encode_key_datetime(field, ptr, buf, size); + break; + case MYSQL_TYPE_NEWDATE: + { + uint32 encoded_date = uint3korr(ptr); + struct tm date; + memset(&date, 0, sizeof(struct tm)); + date.tm_year = encoded_date / (16 * 32) - mrn::TimeConverter::TM_YEAR_BASE; + date.tm_mon = encoded_date / 32 % 16 - 1; + date.tm_mday = encoded_date % 32; + int usec = 0; + mrn::TimeConverter time_converter; + long long int time = time_converter.tm_to_grn_time(&date, usec, + &truncated); + if (truncated) { + field->set_warning(Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, 1); + } + memcpy(buf, &time, 8); + *size = 8; + break; + } +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: + error = storage_encode_key_timestamp2(field, ptr, buf, size); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: + error = storage_encode_key_datetime2(field, ptr, buf, size); + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: + error = storage_encode_key_time2(field, ptr, buf, size); + break; +#endif + case MYSQL_TYPE_STRING: + error = storage_encode_key_fixed_size_string(field, ptr, buf, size); + break; + case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_BLOB: + error = storage_encode_key_variable_size_string(field, ptr, buf, size); + break; + case MYSQL_TYPE_ENUM: + error = storage_encode_key_enum(field, ptr, buf, size); + break; + case MYSQL_TYPE_SET: + error = storage_encode_key_set(field, ptr, buf, size); + break; + default: + error = HA_ERR_UNSUPPORTED; + break; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_encode_multiple_column_key(KEY *key_info, + const uchar *key, + uint key_length, + uchar *buffer, + uint *encoded_length) +{ + MRN_DBUG_ENTER_METHOD(); + mrn::MultipleColumnKeyCodec codec(ctx, ha_thd(), key_info); + int error = codec.encode(key, key_length, buffer, encoded_length); + 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(); + int error = 0; + mrn::MultipleColumnKeyCodec codec(ctx, ha_thd(), key_info); + uint encoded_key_size = codec.size(); + if (start) { + memset(min_buffer, 0, encoded_key_size); + error = codec.encode(start->key, start->length, + 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, + max_buffer, max_encoded_size); + // TODO: handle error? + *max_encoded_size = encoded_key_size; + } + DBUG_RETURN(error); +} + +int ha_mroonga::generic_reset() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (thd_sql_command(ha_thd()) == SQLCOM_SELECT) { + st_select_lex *select_lex = table->pos_in_table_list->select_lex; + List_iterator iterator(*(select_lex->ftfunc_list)); + Item_func_match *item; + while ((item = iterator++)) { + if (item->ft_handler) { + mrn_generic_ft_clear(item->ft_handler); + } + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_reset() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + error = wrap_handler->ha_reset(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + if (alter_key_info_buffer) { + my_free(alter_key_info_buffer, MYF(0)); + alter_key_info_buffer = NULL; + } +#else + if (wrap_alter_key_info) { + my_free(wrap_alter_key_info, MYF(0)); + wrap_alter_key_info = NULL; + } +#endif + wrap_ft_init_count = 0; + int generic_error = generic_reset(); + if (error == 0) { + error = generic_error; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_reset() +{ + MRN_DBUG_ENTER_METHOD(); + int error; + error = generic_reset(); + DBUG_RETURN(error); +} + +int ha_mroonga::reset() +{ + int error = 0; + THD *thd = ha_thd(); + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: this=%p", this)); + clear_empty_value_records(); + clear_search_result(); + clear_search_result_geo(); + if (share->wrapper_mode) + error = wrapper_reset(); + else + error = storage_reset(); + ignoring_no_key_columns = false; + inserting_with_update = false; + ignoring_duplicated_key = false; + fulltext_searching = false; + replacing_ = false; + written_by_row_based_binlog = 0; + mrn_lock_type = F_UNLCK; + mrn_clear_alter_share(thd); + current_ft_item = NULL; + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_CLONE_NEED_NAME +handler *ha_mroonga::wrapper_clone(const char *name, MEM_ROOT *mem_root) +{ + handler *cloned_handler; + MRN_DBUG_ENTER_METHOD(); + if (!(cloned_handler = get_new_handler(table->s, mem_root, + table->s->db_type()))) + DBUG_RETURN(NULL); + ((ha_mroonga *) cloned_handler)->is_clone = true; + ((ha_mroonga *) cloned_handler)->parent_for_clone = this; + ((ha_mroonga *) cloned_handler)->mem_root_for_clone = mem_root; + if (cloned_handler->ha_open(table, table->s->normalized_path.str, + table->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) + { + delete cloned_handler; + DBUG_RETURN(NULL); + } + DBUG_RETURN(cloned_handler); +} + +handler *ha_mroonga::storage_clone(const char *name, MEM_ROOT *mem_root) +{ + MRN_DBUG_ENTER_METHOD(); + handler *cloned_handler; + cloned_handler = handler::clone(name, mem_root); + DBUG_RETURN(cloned_handler); +} + +handler *ha_mroonga::clone(const char *name, MEM_ROOT *mem_root) +{ + MRN_DBUG_ENTER_METHOD(); + handler *cloned_handler; + if (share->wrapper_mode) + { + cloned_handler = wrapper_clone(name, mem_root); + } else { + cloned_handler = storage_clone(name, mem_root); + } + DBUG_RETURN(cloned_handler); +} +#else +handler *ha_mroonga::wrapper_clone(MEM_ROOT *mem_root) +{ + handler *cloned_handler; + MRN_DBUG_ENTER_METHOD(); + if (!(cloned_handler = get_new_handler(table->s, mem_root, + table->s->db_type()))) + DBUG_RETURN(NULL); + ((ha_mroonga *) cloned_handler)->is_clone = true; + ((ha_mroonga *) cloned_handler)->parent_for_clone = this; + ((ha_mroonga *) cloned_handler)->mem_root_for_clone = mem_root; + if (cloned_handler->ha_open(table, table->s->normalized_path.str, + table->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) + { + delete cloned_handler; + DBUG_RETURN(NULL); + } + DBUG_RETURN(cloned_handler); +} + +handler *ha_mroonga::storage_clone(MEM_ROOT *mem_root) +{ + MRN_DBUG_ENTER_METHOD(); + handler *cloned_handler; + cloned_handler = handler::clone(mem_root); + DBUG_RETURN(cloned_handler); +} + +handler *ha_mroonga::clone(MEM_ROOT *mem_root) +{ + MRN_DBUG_ENTER_METHOD(); + handler *cloned_handler; + if (share->wrapper_mode) + { + cloned_handler = wrapper_clone(mem_root); + } else { + cloned_handler = storage_clone(mem_root); + } + DBUG_RETURN(cloned_handler); +} +#endif + +uint8 ha_mroonga::wrapper_table_cache_type() +{ + uint8 res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->table_cache_type(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +uint8 ha_mroonga::storage_table_cache_type() +{ + MRN_DBUG_ENTER_METHOD(); + uint8 type = handler::table_cache_type(); + DBUG_RETURN(type); +} + +uint8 ha_mroonga::table_cache_type() +{ + MRN_DBUG_ENTER_METHOD(); + uint8 type; + if (share->wrapper_mode) + { + type = wrapper_table_cache_type(); + } else { + type = storage_table_cache_type(); + } + DBUG_RETURN(type); +} + +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ +ha_rows ha_mroonga::wrapper_multi_range_read_info_const(uint keyno, + RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, + uint *bufsz, + uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows; + KEY key_info = table->key_info[keyno]; + if (mrn_is_geo_key(&key_info)) { + rows = handler::multi_range_read_info_const(keyno, seq, seq_init_param, + n_ranges, bufsz, flags, cost); + DBUG_RETURN(rows); + } + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); + rows = wrap_handler->multi_range_read_info_const(keyno, seq, seq_init_param, + n_ranges, bufsz, flags, + cost); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::storage_multi_range_read_info_const(uint keyno, + RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, + uint *bufsz, + uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows = handler::multi_range_read_info_const(keyno, seq, + seq_init_param, + n_ranges, bufsz, flags, + cost); + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint *bufsz, + uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows; + if (share->wrapper_mode) + { + rows = wrapper_multi_range_read_info_const(keyno, seq, seq_init_param, + n_ranges, bufsz, + flags, cost); + } else { + rows = storage_multi_range_read_info_const(keyno, seq, seq_init_param, + n_ranges, bufsz, + flags, cost); + } + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::wrapper_multi_range_read_info(uint keyno, uint n_ranges, + uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, + uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows; + KEY key_info = table->key_info[keyno]; + if (mrn_is_geo_key(&key_info)) { + rows = handler::multi_range_read_info(keyno, n_ranges, keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + key_parts, +#endif + bufsz, flags, cost); + DBUG_RETURN(rows); + } + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + if (fulltext_searching) + set_pk_bitmap(); + rows = wrap_handler->multi_range_read_info(keyno, n_ranges, keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + key_parts, +#endif + bufsz, flags, cost); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::storage_multi_range_read_info(uint keyno, uint n_ranges, + uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, + uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows = handler::multi_range_read_info(keyno, n_ranges, keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + key_parts, +#endif + bufsz, flags, cost); + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::multi_range_read_info(uint keyno, uint n_ranges, uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, uint *flags, + Cost_estimate *cost) +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows; + if (share->wrapper_mode) + { + rows = wrapper_multi_range_read_info(keyno, n_ranges, keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + key_parts, +#endif + bufsz, flags, cost); + } else { + rows = storage_multi_range_read_info(keyno, n_ranges, keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + key_parts, +#endif + bufsz, flags, cost); + } + DBUG_RETURN(rows); +} + +int ha_mroonga::wrapper_multi_range_read_init(RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + KEY key_info = table->key_info[active_index]; + if (mrn_is_geo_key(&key_info)) { + error = handler::multi_range_read_init(seq, seq_init_param, + n_ranges, mode, buf); + 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->multi_range_read_init(seq, seq_init_param, + n_ranges, mode, buf); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_multi_range_read_init(RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = handler::multi_range_read_init(seq, seq_init_param, + n_ranges, mode, buf); + DBUG_RETURN(error); +} + +int ha_mroonga::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_multi_range_read_init(seq, seq_init_param, + n_ranges, mode, buf); + } else { + error = storage_multi_range_read_init(seq, seq_init_param, + n_ranges, mode, buf); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_multi_range_read_next(range_id_t *range_info) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + KEY key_info = table->key_info[active_index]; + if (mrn_is_geo_key(&key_info)) { + error = handler::multi_range_read_next(range_info); + 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->multi_range_read_next(range_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_multi_range_read_next(range_id_t *range_info) +{ + MRN_DBUG_ENTER_METHOD(); + int error = handler::multi_range_read_next(range_info); + DBUG_RETURN(error); +} + +int ha_mroonga::multi_range_read_next(range_id_t *range_info) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_multi_range_read_next(range_info); + } else { + error = storage_multi_range_read_next(range_info); + } + DBUG_RETURN(error); +} +#else // MRN_HANDLER_HAVE_MULTI_RANGE_READ +int ha_mroonga::wrapper_read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + KEY key_info = table->key_info[active_index]; + if (mrn_is_geo_key(&key_info)) { + error = handler::read_multi_range_first(found_range_p, ranges, + range_count, sorted, buffer); + 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_multi_range_first(found_range_p, ranges, + range_count, sorted, buffer); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer) +{ + MRN_DBUG_ENTER_METHOD(); + int error = handler::read_multi_range_first(found_range_p, ranges, + range_count, sorted, buffer); + DBUG_RETURN(error); +} + +int ha_mroonga::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_read_multi_range_first(found_range_p, ranges, + range_count, sorted, buffer); + } else { + error = storage_read_multi_range_first(found_range_p, ranges, + range_count, sorted, buffer); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_read_multi_range_next(KEY_MULTI_RANGE **found_range_p) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + KEY key_info = table->key_info[active_index]; + if (mrn_is_geo_key(&key_info)) { + error = handler::read_multi_range_next(found_range_p); + 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_multi_range_next(found_range_p); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_read_multi_range_next(KEY_MULTI_RANGE **found_range_p) +{ + MRN_DBUG_ENTER_METHOD(); + int error = handler::read_multi_range_next(found_range_p); + DBUG_RETURN(error); +} + +int ha_mroonga::read_multi_range_next(KEY_MULTI_RANGE **found_range_p) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_read_multi_range_next(found_range_p); + } else { + error = storage_read_multi_range_next(found_range_p); + } + DBUG_RETURN(error); +} +#endif // MRN_HANDLER_HAVE_MULTI_RANGE_READ + +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS +void ha_mroonga::wrapper_start_bulk_insert(ha_rows rows, uint flags) +#else +void ha_mroonga::wrapper_start_bulk_insert(ha_rows rows) +#endif +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS + wrap_handler->ha_start_bulk_insert(rows, flags); +#else + wrap_handler->ha_start_bulk_insert(rows); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS +void ha_mroonga::storage_start_bulk_insert(ha_rows rows, uint flags) +#else +void ha_mroonga::storage_start_bulk_insert(ha_rows rows) +#endif +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS +void ha_mroonga::start_bulk_insert(ha_rows rows, uint flags) +#else +void ha_mroonga::start_bulk_insert(ha_rows rows) +#endif +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) { +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS + wrapper_start_bulk_insert(rows, flags); +#else + wrapper_start_bulk_insert(rows); +#endif + } else { +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS + storage_start_bulk_insert(rows, flags); +#else + storage_start_bulk_insert(rows); +#endif + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::wrapper_end_bulk_insert() +{ + 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_end_bulk_insert(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_end_bulk_insert() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::end_bulk_insert() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_end_bulk_insert(); + } else { + error = storage_end_bulk_insert(); + } + DBUG_RETURN(error); +} + +int ha_mroonga::generic_delete_all_rows(grn_obj *target_grn_table, + const char *function_name) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + if (is_dry_write()) { + DBUG_PRINT("info", + ("mroonga: dry write: %s::%s", MRN_CLASS_NAME, function_name)); + DBUG_RETURN(error); + } + + grn_table_cursor *cursor; + cursor = grn_table_cursor_open(ctx, target_grn_table, + NULL, 0, + NULL, 0, + 0, -1, + 0); + if (cursor) { + while (grn_table_cursor_next(ctx, cursor) != GRN_ID_NIL) { + grn_table_cursor_delete(ctx, cursor); + } + grn_table_cursor_close(ctx, cursor); + } else { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_delete_all_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_delete_all_rows(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + if (error) { + DBUG_RETURN(error); + } + + if (!wrapper_have_target_index()) { + DBUG_RETURN(error); + } + + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + if (!grn_index_tables[i]) { + /* disable keys */ + continue; + } + + error = generic_delete_all_rows(grn_index_tables[i], __FUNCTION__); + if (error) { + break; + } + } + + int grn_table_error; + grn_table_error = generic_delete_all_rows(grn_table, __FUNCTION__); + if (!error) { + error = grn_table_error; + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_delete_all_rows() +{ + MRN_DBUG_ENTER_METHOD(); + int error = generic_delete_all_rows(grn_table, __FUNCTION__); + DBUG_RETURN(error); +} + +int ha_mroonga::delete_all_rows() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_delete_all_rows(); + } else { + error = storage_delete_all_rows(); + } + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_HAVE_TRUNCATE +int ha_mroonga::wrapper_truncate() +{ + 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_truncate(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + + if (!error && wrapper_have_target_index()) { + error = wrapper_truncate_index(); + } + + DBUG_RETURN(error); +} +#endif + +int ha_mroonga::wrapper_truncate_index() +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + if (is_dry_write()) { + DBUG_PRINT("info", + ("mroonga: dry write: %s::%s", MRN_CLASS_NAME, __FUNCTION__)); + DBUG_RETURN(error); + } + + grn_rc rc; + uint i; + uint n_keys = table->s->keys; + for (i = 0; i < n_keys; i++) { + KEY key_info = table->key_info[i]; + + if (!(wrapper_is_target_index(&key_info))) { + continue; + } + + if (!grn_index_tables[i]) { + /* disable keys */ + continue; + } + + rc = grn_table_truncate(ctx, grn_index_tables[i]); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } +err: + rc = grn_table_truncate(ctx, grn_table); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_truncate() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + if (is_dry_write()) { + DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__)); + DBUG_RETURN(error); + } + + grn_rc rc; + rc = grn_table_truncate(ctx, grn_table); + if (rc) { + my_message(ER_ERROR_ON_WRITE, ctx->errbuf, MYF(0)); + DBUG_RETURN(ER_ERROR_ON_WRITE); + } + error = storage_truncate_index(); + + if (!error && thd_sql_command(ha_thd()) == SQLCOM_TRUNCATE) { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + mrn::Lock lock(&long_term_share->auto_inc_mutex); + long_term_share->auto_inc_value = 0; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + long_term_share->auto_inc_inited = false; + } + + DBUG_RETURN(error); +} + +int ha_mroonga::storage_truncate_index() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + grn_rc rc; + uint i; + uint n_keys = table->s->keys; + for (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) && + (KEY_N_KEY_PARTS(&key_info) == 1 || (key_info.flags & HA_FULLTEXT)) + ) { + continue; + } + + if (!grn_index_tables[i]) { + /* disable keys */ + continue; + } + + rc = grn_table_truncate(ctx, grn_index_tables[i]); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + goto err; + } + } +err: + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_HAVE_TRUNCATE +int ha_mroonga::truncate() +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_truncate(); + } else { + error = storage_truncate(); + } + DBUG_RETURN(error); +} +#endif + +double ha_mroonga::wrapper_scan_time() +{ + double res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->scan_time(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +double ha_mroonga::storage_scan_time() +{ + MRN_DBUG_ENTER_METHOD(); + double time = handler::scan_time(); + DBUG_RETURN(time); +} + +double ha_mroonga::scan_time() +{ + MRN_DBUG_ENTER_METHOD(); + double time; + if (share->wrapper_mode) + { + time = wrapper_scan_time(); + } else { + time = storage_scan_time(); + } + DBUG_RETURN(time); +} + +double ha_mroonga::wrapper_read_time(uint index, uint ranges, ha_rows rows) +{ + double res; + MRN_DBUG_ENTER_METHOD(); + if (index < MAX_KEY) { + KEY key_info = table->key_info[index]; + if (mrn_is_geo_key(&key_info)) { + res = handler::read_time(index, ranges, rows); + DBUG_RETURN(res); + } + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->read_time(share->wrap_key_nr[index], ranges, rows); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } else { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->read_time(index, ranges, rows); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + DBUG_RETURN(res); +} + +double ha_mroonga::storage_read_time(uint index, uint ranges, ha_rows rows) +{ + MRN_DBUG_ENTER_METHOD(); + double time = handler::read_time(index, ranges, rows); + DBUG_RETURN(time); +} + +double ha_mroonga::read_time(uint index, uint ranges, ha_rows rows) +{ + MRN_DBUG_ENTER_METHOD(); + double time; + if (share->wrapper_mode) + { + time = wrapper_read_time(index, ranges, rows); + } else { + time = storage_read_time(index, ranges, rows); + } + DBUG_RETURN(time); +} + +const key_map *ha_mroonga::wrapper_keys_to_use_for_scanning() +{ + const key_map *res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->keys_to_use_for_scanning(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +const key_map *ha_mroonga::storage_keys_to_use_for_scanning() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(&key_map_full); +} + +const key_map *ha_mroonga::keys_to_use_for_scanning() +{ + MRN_DBUG_ENTER_METHOD(); + const key_map *key_map; + if (share->wrapper_mode) + { + key_map = wrapper_keys_to_use_for_scanning(); + } else { + key_map = storage_keys_to_use_for_scanning(); + } + DBUG_RETURN(key_map); +} + +ha_rows ha_mroonga::wrapper_estimate_rows_upper_bound() +{ + ha_rows res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->estimate_rows_upper_bound(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +ha_rows ha_mroonga::storage_estimate_rows_upper_bound() +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows = handler::estimate_rows_upper_bound(); + DBUG_RETURN(rows); +} + +ha_rows ha_mroonga::estimate_rows_upper_bound() +{ + MRN_DBUG_ENTER_METHOD(); + ha_rows rows; + if (share->wrapper_mode) + { + rows = wrapper_estimate_rows_upper_bound(); + } else { + rows = storage_estimate_rows_upper_bound(); + } + DBUG_RETURN(rows); +} + +void ha_mroonga::wrapper_update_create_info(HA_CREATE_INFO* create_info) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->update_create_info(create_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_update_create_info(HA_CREATE_INFO* create_info) +{ + MRN_DBUG_ENTER_METHOD(); + handler::update_create_info(create_info); + if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + if (!long_term_share->auto_inc_inited) { + storage_info(HA_STATUS_AUTO); + } + create_info->auto_increment_value = long_term_share->auto_inc_value; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::update_create_info(HA_CREATE_INFO* create_info) +{ + MRN_DBUG_ENTER_METHOD(); + if (!create_info->connect_string.str) + { + create_info->connect_string.str = table->s->connect_string.str; + create_info->connect_string.length = table->s->connect_string.length; + } + if (share->wrapper_mode) + wrapper_update_create_info(create_info); + else + storage_update_create_info(create_info); + st_mrn_slot_data *slot_data = mrn_get_slot_data(ha_thd(), true); + if (slot_data) { + slot_data->alter_create_info = create_info; + if (slot_data->alter_connect_string) { + my_free(slot_data->alter_connect_string, MYF(0)); + slot_data->alter_connect_string = NULL; + } + if (create_info->connect_string.str) { + slot_data->alter_connect_string = + my_strndup(create_info->connect_string.str, + create_info->connect_string.length, + MYF(MY_WME)); + } + if (slot_data->alter_comment) { + my_free(slot_data->alter_comment, MYF(0)); + slot_data->alter_comment = NULL; + } + if (create_info->comment.str) { + slot_data->alter_comment = + my_strndup(create_info->comment.str, + create_info->comment.length, + MYF(MY_WME)); + } + if (share && share->disable_keys) { + slot_data->disable_keys_create_info = create_info; + } + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::wrapper_rename_table(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name) +{ + int error = 0; + handler *hnd; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(tmp_share, tmp_share->table_share); + if (!(hnd = + tmp_share->hton->create(tmp_share->hton, tmp_share->table_share, + current_thd->mem_root))) + { + MRN_SET_BASE_SHARE_KEY(tmp_share, tmp_share->table_share); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + hnd->init(); + MRN_SET_BASE_SHARE_KEY(tmp_share, tmp_share->table_share); + + if ((error = hnd->ha_rename_table(from, to))) + { + delete hnd; + DBUG_RETURN(error); + } + + error = wrapper_rename_index(from, to, tmp_share, + from_table_name, to_table_name); + + delete hnd; + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_rename_index(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name) +{ + int error; + grn_rc rc; + MRN_DBUG_ENTER_METHOD(); + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + error = ensure_database_open(from); + if (error) + DBUG_RETURN(error); + + TABLE_SHARE *tmp_table_share = tmp_share->table_share; + + uint i; + 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); + grn_obj *index_table; + index_table = grn_ctx_get(ctx, + from_index_table_name.c_str(), + from_index_table_name.length()); + if (index_table) { + rc = grn_table_rename(ctx, index_table, + to_index_table_name.c_str(), + to_index_table_name.length()); + if (rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + } + } + + grn_obj *table = grn_ctx_get(ctx, from_table_name, strlen(from_table_name)); + if (ctx->rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + rc = grn_table_rename(ctx, table, to_table_name, + strlen(to_table_name)); + if (rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + DBUG_RETURN(0); +} + +int ha_mroonga::storage_rename_table(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name) +{ + int error; + grn_rc rc; + TABLE_SHARE *tmp_table_share = tmp_share->table_share; + MRN_LONG_TERM_SHARE *from_long_term_share = tmp_share->long_term_share, + *to_long_term_share; + MRN_DBUG_ENTER_METHOD(); + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + error = ensure_database_open(from); + if (error) + DBUG_RETURN(error); + + if (!(to_long_term_share = mrn_get_long_term_share(to, strlen(to), &error))) + DBUG_RETURN(error); + to_long_term_share->auto_inc_value = from_long_term_share->auto_inc_value; + DBUG_PRINT("info", ("mroonga: to_auto_inc_value=%llu", + to_long_term_share->auto_inc_value)); + to_long_term_share->auto_inc_inited = from_long_term_share->auto_inc_inited; + + uint i; + 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); + grn_obj *index_table; + index_table = grn_ctx_get(ctx, + from_index_table_name.c_str(), + from_index_table_name.length()); + if (index_table) { + rc = grn_table_rename(ctx, index_table, + to_index_table_name.c_str(), + to_index_table_name.length()); + if (rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error_end; + } + } + } +#ifdef MRN_SUPPORT_FOREIGN_KEYS + error = storage_rename_foreign_key(tmp_share, from_table_name, to_table_name); + if (error) { + goto error_end; + } +#endif + { + grn_obj *table_obj = grn_ctx_get(ctx, from_table_name, strlen(from_table_name)); + if (ctx->rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error_end; + } + rc = grn_table_rename(ctx, table_obj, to_table_name, + strlen(to_table_name)); + if (rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + goto error_end; + } + } + DBUG_RETURN(0); + +error_end: + mrn_free_long_term_share(to_long_term_share); + DBUG_RETURN(error); +} + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +int ha_mroonga::storage_rename_foreign_key(MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name) +{ + int error; + uint i; + grn_obj *column, *ref_column; + grn_rc rc; + TABLE_SHARE *tmp_table_share = tmp_share->table_share; + uint n_columns = tmp_table_share->fields; + 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) { + continue; + } + + column = grn_obj_column(ctx, grn_table, + column_name, column_name_size); + 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); + 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); + rc = grn_column_rename(ctx, ref_column, + to_index_column_name.c_str(), + to_index_column_name.length()); + if (rc != GRN_SUCCESS) { + error = ER_CANT_OPEN_FILE; + my_message(error, ctx->errbuf, MYF(0)); + DBUG_RETURN(error); + } + } + DBUG_RETURN(0); +} +#endif + +int ha_mroonga::rename_table(const char *from, const char *to) +{ + int error = 0; + TABLE_LIST table_list; + TABLE_SHARE *tmp_table_share; + TABLE tmp_table; + MRN_SHARE *tmp_share; + MRN_DBUG_ENTER_METHOD(); + mrn::PathMapper to_mapper(to); + mrn::PathMapper from_mapper(from); + if (strcmp(from_mapper.db_name(), to_mapper.db_name())) + DBUG_RETURN(HA_ERR_WRONG_COMMAND); + +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + table_list.init_one_table(from_mapper.db_name(), + strlen(from_mapper.db_name()), + from_mapper.mysql_table_name(), + strlen(from_mapper.mysql_table_name()), + from_mapper.mysql_table_name(), TL_WRITE); +#else + table_list.init_one_table(from_mapper.db_name(), + from_mapper.mysql_table_name(), + TL_WRITE); +#endif + mrn_open_mutex_lock(NULL); + tmp_table_share = mrn_create_tmp_table_share(&table_list, from, &error); + mrn_open_mutex_unlock(NULL); + if (!tmp_table_share) { + DBUG_RETURN(error); + } + tmp_table.s = tmp_table_share; +#ifdef WITH_PARTITION_STORAGE_ENGINE + tmp_table.part_info = NULL; +#endif + if (!(tmp_share = mrn_get_share(from, &tmp_table, &error))) + { + mrn_open_mutex_lock(NULL); + mrn_free_tmp_table_share(tmp_table_share); + mrn_open_mutex_unlock(NULL); + DBUG_RETURN(error); + } + + if (tmp_share->wrapper_mode) + { + error = wrapper_rename_table(from, to, tmp_share, + from_mapper.table_name(), + to_mapper.table_name()); + } else { + error = storage_rename_table(from, to, tmp_share, + from_mapper.table_name(), + to_mapper.table_name()); + } + + if (!error) { + mrn_free_long_term_share(tmp_share->long_term_share); + tmp_share->long_term_share = NULL; + } + mrn_free_share(tmp_share); + if (!error && to_mapper.table_name()[0] == '#') { + if ((error = alter_share_add(to, tmp_table_share))) + DBUG_RETURN(error); + } else if (error && from_mapper.table_name()[0] == '#') { + alter_share_add(from, tmp_table_share); + } else { + mrn_open_mutex_lock(NULL); + mrn_free_tmp_table_share(tmp_table_share); + mrn_open_mutex_unlock(NULL); + } + DBUG_RETURN(error); +} + +bool ha_mroonga::wrapper_is_crashed() const +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->is_crashed(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_is_crashed() const +{ + MRN_DBUG_ENTER_METHOD(); + bool crashed = handler::is_crashed(); + DBUG_RETURN(crashed); +} + +bool ha_mroonga::is_crashed() const +{ + MRN_DBUG_ENTER_METHOD(); + int crashed; + if (share->wrapper_mode) + { + crashed = wrapper_is_crashed(); + } else { + crashed = storage_is_crashed(); + } + DBUG_RETURN(crashed); +} + +bool ha_mroonga::wrapper_auto_repair(int error) const +{ + bool crashed; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR + crashed = wrap_handler->auto_repair(error); +#else + crashed = wrap_handler->auto_repair(); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(crashed); +} + +bool ha_mroonga::storage_auto_repair(int error) const +{ + MRN_DBUG_ENTER_METHOD(); + bool crashed; +#ifdef MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR + crashed = handler::auto_repair(error); +#else + crashed = handler::auto_repair(); +#endif + DBUG_RETURN(crashed); +} + +bool ha_mroonga::auto_repair(int error) const +{ + MRN_DBUG_ENTER_METHOD(); + bool crashed; + // TODO: We should consider about creating share for error = + // ER_CANT_OPEN_FILE. The following code just ignores the error. + if (share && share->wrapper_mode) + { + crashed = wrapper_auto_repair(error); + } else { + crashed = storage_auto_repair(error); + } + DBUG_RETURN(crashed); +} + +bool ha_mroonga::auto_repair() const +{ + MRN_DBUG_ENTER_METHOD(); + bool crashed = auto_repair(HA_ERR_CRASHED_ON_USAGE); + DBUG_RETURN(crashed); +} + +int ha_mroonga::wrapper_disable_indexes(uint mode) +{ + 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_disable_indexes(mode); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (error == HA_ERR_WRONG_COMMAND) { + 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; + mrn::PathMapper mapper(share->table_name); + for (i = 0; i < table_share->keys; i++) { + if (!(key_info[i].flags & HA_FULLTEXT) && + !mrn_is_geo_key(&key_info[i])) { + continue; + } + + mrn::IndexTableName index_table_name(mapper.table_name(), + key_info[i].name); + grn_obj *index_table = grn_ctx_get(ctx, + index_table_name.c_str(), + index_table_name.length()); + if (index_table) { + grn_obj_remove(ctx, index_table); + } + grn_index_tables[i] = NULL; + grn_index_columns[i] = NULL; + } + } else { + error = HA_ERR_WRONG_COMMAND; + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_disable_indexes(uint mode) +{ + 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 (!grn_index_tables[i]) { + DBUG_PRINT("info", ("mroonga: keys are disabled already %u", i)); + DBUG_RETURN(0); + } + } + KEY *key_info = table_share->key_info; + mrn::PathMapper mapper(share->table_name); + for (i = 0; i < table_share->keys; i++) { + if (i == table->s->primary_key) { + continue; + } + if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE && + (key_info[i].flags & HA_NOSAME)) { + continue; + } + + mrn::IndexTableName index_table_name(mapper.table_name(), + key_info[i].name); + grn_obj *index_table = grn_ctx_get(ctx, + index_table_name.c_str(), + index_table_name.length()); + if (index_table) { + grn_obj_remove(ctx, index_table); + } + grn_index_tables[i] = NULL; + grn_index_columns[i] = NULL; + } + } else { + DBUG_RETURN(HA_ERR_WRONG_COMMAND); + } + DBUG_RETURN(0); +} + +int ha_mroonga::disable_indexes(uint mode) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + error = wrapper_disable_indexes(mode); + } else { + error = storage_disable_indexes(mode); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_enable_indexes(uint mode) +{ + int error = 0, tmp_error = 0; + MRN_DBUG_ENTER_METHOD(); + if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE || mode == HA_KEY_SWITCH_ALL) { + uint i, j; + 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]) { + break; + } + } + if (i == table_share->keys) { + DBUG_PRINT("info", ("mroonga: keys are enabled already")); + DBUG_RETURN(0); + } + KEY *p_key_info = &table->key_info[table_share->primary_key]; + KEY *key_info = table_share->key_info; + uint n_keys = table_share->keys; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, n_keys); + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_columns, n_keys); + bitmap_clear_all(table->read_set); + mrn_set_bitmap_by_key(table->read_set, p_key_info); + mrn::PathMapper mapper(share->table_name); + for (i = 0, j = 0; i < n_keys; i++) { + if (!(key_info[i].flags & HA_FULLTEXT) && + !mrn_is_geo_key(&key_info[i])) { + j++; + continue; + } + + if ((error = mrn_add_index_param(share, &key_info[i], i))) + { + break; + } + index_tables[i] = NULL; + index_columns[i] = NULL; + if (!grn_index_tables[i]) { + if ( + (key_info[i].flags & HA_FULLTEXT) && + (error = wrapper_create_index_fulltext(mapper.table_name(), + i, &key_info[i], + index_tables, index_columns, + share)) + ) { + break; + } else if ( + mrn_is_geo_key(&key_info[i]) && + (error = wrapper_create_index_geo(mapper.table_name(), + i, &key_info[i], + index_tables, index_columns, + share)) + ) { + break; + } + grn_index_columns[i] = index_columns[i]; + } + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); + } + if (!error && i > j) + { + error = wrapper_fill_indexes(ha_thd(), table->key_info, index_columns, + n_keys); + } + bitmap_set_all(table->read_set); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + } else { + tmp_error = HA_ERR_WRONG_COMMAND; + } + + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + error = wrap_handler->ha_enable_indexes(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; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_enable_indexes(uint mode) +{ + int error = 0; + uint n_keys = table_share->keys; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, n_keys); + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_columns, n_keys); + bool have_multiple_column_index = false; + bool skip_unique_key = (mode == HA_KEY_SWITCH_NONUNIQ_SAVE); + 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 (!grn_index_tables[i]) { + break; + } + } + if (i == table_share->keys) { + DBUG_PRINT("info", ("mroonga: keys are enabled already")); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(0); + } + KEY *key_info = table->key_info; + bitmap_clear_all(table->read_set); + mrn::PathMapper mapper(share->table_name); + for (i = 0; i < n_keys; i++) { + if (i == table->s->primary_key) { + continue; + } + if (skip_unique_key && (key_info[i].flags & HA_NOSAME)) { + continue; + } + + if ((error = mrn_add_index_param(share, &key_info[i], i))) + { + break; + } + index_tables[i] = NULL; + if (!grn_index_tables[i]) { + if ((error = storage_create_index(table, mapper.table_name(), grn_table, + share, &key_info[i], index_tables, + index_columns, i))) + { + break; + } + if ( + KEY_N_KEY_PARTS(&(key_info[i])) != 1 && + !(key_info[i].flags & HA_FULLTEXT) + ) { + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); + have_multiple_column_index = true; + } + } else { + index_columns[i] = NULL; + } + } + if (!error && have_multiple_column_index) + { + error = storage_add_index_multiple_columns(key_info, n_keys, + index_tables, + index_columns, + skip_unique_key); + } + bitmap_set_all(table->read_set); + } else { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(error); +} + +int ha_mroonga::enable_indexes(uint mode) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + share->disable_keys = false; + if (share->wrapper_mode) + { + error = wrapper_enable_indexes(mode); + } else { + error = storage_enable_indexes(mode); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_check(THD* thd, HA_CHECK_OPT* check_opt) +{ + 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_check(thd, check_opt); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_check(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); +} + +int ha_mroonga::check(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_check(thd, check_opt); + } else { + error = storage_check(thd, check_opt); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_fill_indexes(THD *thd, KEY *key_info, + grn_obj **index_columns, uint n_keys) +{ + int error = 0; + KEY *p_key_info = &table->key_info[table_share->primary_key]; + KEY *tmp_key_info; +#ifdef MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK + int wrapper_lock_type_backup = wrap_handler->get_lock_type(); +#endif + MRN_DBUG_ENTER_METHOD(); + DBUG_PRINT("info", ("mroonga: n_keys=%u", n_keys)); + + grn_bool need_lock = true; + if (mrn_lock_type != F_UNLCK) { + need_lock = false; + } +#ifdef MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK + if (wrapper_lock_type_backup != F_UNLCK) { + need_lock = false; + } +#endif + if (need_lock) { + error = wrapper_external_lock(thd, F_WRLCK); + } + if (!error) { + if ( + !(error = wrapper_start_stmt(thd, thr_lock_data.type)) && + !(error = wrapper_rnd_init(true)) + ) { + grn_obj key; + GRN_TEXT_INIT(&key, 0); + grn_bulk_space(ctx, &key, p_key_info->key_length); + while (!(error = wrapper_rnd_next(table->record[0]))) + { + key_copy((uchar *)(GRN_TEXT_VALUE(&key)), table->record[0], + p_key_info, p_key_info->key_length); + int added; + grn_id record_id; + mrn_change_encoding(ctx, NULL); + record_id = grn_table_add(ctx, grn_table, + GRN_TEXT_VALUE(&key), p_key_info->key_length, + &added); + if (record_id == GRN_ID_NIL) + { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "failed to add a new record into groonga: key=<%.*s>", + (int) p_key_info->key_length, GRN_TEXT_VALUE(&key)); + error = ER_ERROR_ON_WRITE; + my_message(error, error_message, MYF(0)); + } + if (error) + break; + + uint k; + for (k = 0; k < n_keys; k++) { + tmp_key_info = &key_info[k]; + if (!(tmp_key_info->flags & HA_FULLTEXT) && + !mrn_is_geo_key(tmp_key_info)) { + continue; + } + if (!index_columns[k]) { + continue; + } + DBUG_PRINT("info", ("mroonga: key_num=%u", k)); + + uint l; + for (l = 0; l < KEY_N_KEY_PARTS(tmp_key_info); l++) { + Field *field = tmp_key_info->key_part[l].field; + + if (field->is_null()) + continue; + error = mrn_change_encoding(ctx, field->charset()); + if (error) + break; + + error = generic_store_bulk(field, &new_value_buffer); + if (error) { + my_message(error, + "mroonga: wrapper: " + "failed to get new value for updating index.", + MYF(0)); + break; + } + + grn_obj *index_column = index_columns[k]; + grn_rc rc; + rc = grn_column_index_update(ctx, index_column, record_id, l + 1, + NULL, &new_value_buffer); + grn_obj_unlink(ctx, index_column); + if (rc) { + error = ER_ERROR_ON_WRITE; + my_message(error, ctx->errbuf, MYF(0)); + break; + } + } + if (error) + break; + } + if (error) + break; + } + grn_obj_unlink(ctx, &key); + if (error != HA_ERR_END_OF_FILE) + wrapper_rnd_end(); + else + error = wrapper_rnd_end(); + } + if (need_lock) { + wrapper_external_lock(thd, F_UNLCK); + } + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_recreate_indexes(THD *thd) +{ + int error; + uint i, n_keys = table_share->keys; + KEY *p_key_info = &table->key_info[table_share->primary_key]; + KEY *key_info = table->key_info; + MRN_DBUG_ENTER_METHOD(); + mrn::PathMapper mapper(table_share->normalized_path.str); + bitmap_clear_all(table->read_set); + clear_indexes(); + remove_grn_obj_force(mapper.table_name()); + grn_table = NULL; + mrn_set_bitmap_by_key(table->read_set, p_key_info); + for (i = 0; i < n_keys; i++) { + if (!(key_info[i].flags & HA_FULLTEXT) && !mrn_is_geo_key(&key_info[i])) { + continue; + } + mrn::IndexTableName index_table_name(mapper.table_name(), + table_share->key_info[i].name); + char index_column_full_name[MRN_MAX_PATH_SIZE]; + snprintf(index_column_full_name, MRN_MAX_PATH_SIZE, + "%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()); + 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()); + if (error) + DBUG_RETURN(error); + error = wrapper_open_indexes(table_share->normalized_path.str); + if (error) + DBUG_RETURN(error); + error = wrapper_fill_indexes(thd, key_info, grn_index_columns, n_keys); + bitmap_set_all(table->read_set); + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_repair(THD* thd, HA_CHECK_OPT* check_opt) +{ + int error; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + error = wrap_handler->ha_repair(thd, check_opt); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (error && error != HA_ADMIN_NOT_IMPLEMENTED) + DBUG_RETURN(error); + error = wrapper_recreate_indexes(thd); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_repair(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); +} + +int ha_mroonga::repair(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + share->disable_keys = false; + if (share->wrapper_mode) + { + error = wrapper_repair(thd, check_opt); + } else { + error = storage_repair(thd, check_opt); + } + DBUG_RETURN(error); +} + +bool ha_mroonga::wrapper_check_and_repair(THD *thd) +{ + // XXX: success is valid variable name? + bool success; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + success = wrap_handler->ha_check_and_repair(thd); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(success); +} + +bool ha_mroonga::storage_check_and_repair(THD *thd) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(true); +} + +bool ha_mroonga::check_and_repair(THD *thd) +{ + MRN_DBUG_ENTER_METHOD(); + // XXX: success is valid variable name? + bool success; + if (share->wrapper_mode) + { + success = wrapper_check_and_repair(thd); + } else { + success = storage_check_and_repair(thd); + } + DBUG_RETURN(success); +} + +int ha_mroonga::wrapper_analyze(THD* thd, HA_CHECK_OPT* check_opt) +{ + 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_analyze(thd, check_opt); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_analyze(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); +} + +int ha_mroonga::analyze(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_analyze(thd, check_opt); + } else { + error = storage_analyze(thd, check_opt); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_optimize(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_ADMIN_TRY_ALTER); +} + +int ha_mroonga::storage_optimize(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); +} + +int ha_mroonga::optimize(THD* thd, HA_CHECK_OPT* check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + int error = 0; + if (share->wrapper_mode) + { + error = wrapper_optimize(thd, check_opt); + } else { + error = storage_optimize(thd, check_opt); + } + DBUG_RETURN(error); +} + +bool ha_mroonga::wrapper_is_fatal_error(int error_num, uint flags) +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->is_fatal_error(error_num, flags); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_is_fatal_error(int error_num, uint flags) +{ + MRN_DBUG_ENTER_METHOD(); + bool is_fatal_error = handler::is_fatal_error(error_num, flags); + DBUG_RETURN(is_fatal_error); +} + +bool ha_mroonga::is_fatal_error(int error_num, uint flags) +{ + MRN_DBUG_ENTER_METHOD(); + bool is_fatal_error; + if (share->wrapper_mode) + { + is_fatal_error = wrapper_is_fatal_error(error_num, flags); + } else { + is_fatal_error = storage_is_fatal_error(error_num, flags); + } + DBUG_RETURN(is_fatal_error); +} + +bool ha_mroonga::wrapper_check_if_incompatible_data( + HA_CREATE_INFO *create_info, uint table_changes) +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->check_if_incompatible_data(create_info, table_changes); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_check_if_incompatible_data( + HA_CREATE_INFO *create_info, uint table_changes) +{ + MRN_DBUG_ENTER_METHOD(); + uint n = table_share->fields; + for (uint i = 0; i < n; i++) { + Field *field = table->field[i]; + if (field->flags & FIELD_IS_RENAMED) { + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + } + DBUG_RETURN(COMPATIBLE_DATA_YES); +} + +bool ha_mroonga::check_if_incompatible_data( + HA_CREATE_INFO *create_info, uint table_changes) +{ + MRN_DBUG_ENTER_METHOD(); + bool res; + if ( + create_info->comment.str != table_share->comment.str || + create_info->connect_string.str != table_share->connect_string.str + ) { + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + if (share->wrapper_mode) + { + res = wrapper_check_if_incompatible_data(create_info, table_changes); + } else { + res = storage_check_if_incompatible_data(create_info, table_changes); + } + DBUG_RETURN(res); +} + +int ha_mroonga::storage_add_index_multiple_columns(KEY *key_info, + uint num_of_keys, + grn_obj **index_tables, + grn_obj **index_columns, + bool skip_unique_key) +{ + MRN_DBUG_ENTER_METHOD(); + + int error = 0; + + if (!(error = storage_rnd_init(true))) + { + while (!(error = storage_rnd_next(table->record[0]))) + { + for (uint i = 0; i < num_of_keys; i++) { + KEY *current_key_info = key_info + i; + if ( + KEY_N_KEY_PARTS(current_key_info) == 1 || + (current_key_info->flags & HA_FULLTEXT) + ) { + continue; + } + if (skip_unique_key && (key_info[i].flags & HA_NOSAME)) { + continue; + } + if (!index_columns[i]) { + continue; + } + + /* fix key_info.key_length */ + for (uint j = 0; j < KEY_N_KEY_PARTS(current_key_info); j++) { + if ( + !current_key_info->key_part[j].null_bit && + current_key_info->key_part[j].field->null_bit + ) { + current_key_info->key_length++; + current_key_info->key_part[j].null_bit = + current_key_info->key_part[j].field->null_bit; + } + } + if (key_info[i].flags & HA_NOSAME) { + grn_id key_id; + if ((error = storage_write_row_unique_index(table->record[0], + current_key_info, + index_tables[i], + &key_id))) + { + if (error == HA_ERR_FOUND_DUPP_KEY) + { + error = HA_ERR_FOUND_DUPP_UNIQUE; + } + break; + } + } + if ((error = storage_write_row_multiple_column_index(table->record[0], + record_id, + current_key_info, + index_columns[i]))) + { + break; + } + } + if (error) + break; + } + if (error != HA_ERR_END_OF_FILE) { + storage_rnd_end(); + } else { + error = storage_rnd_end(); + } + } + + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER +bool ha_mroonga::wrapper_is_comment_changed(TABLE *table1, TABLE *table2) +{ + MRN_DBUG_ENTER_METHOD(); + + if (table1->s->comment.length != table2->s->comment.length) { + DBUG_RETURN(true); + } + + if (strncmp(table1->s->comment.str, + table2->s->comment.str, + table1->s->comment.length) == 0) { + DBUG_RETURN(false); + } else { + DBUG_RETURN(true); + } +} + +enum_alter_inplace_result ha_mroonga::wrapper_check_if_supported_inplace_alter( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + uint n_keys; + uint i; + enum_alter_inplace_result result_mroonga = HA_ALTER_INPLACE_NO_LOCK; + DBUG_PRINT("info", ("mroonga: handler_flags=%lu", ha_alter_info->handler_flags)); + + if (wrapper_is_comment_changed(table, altered_table)) { + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + if ( + (ha_alter_info->handler_flags & Alter_inplace_info::ADD_INDEX) && + (ha_alter_info->handler_flags & + ( + Alter_inplace_info::ADD_COLUMN | + Alter_inplace_info::DROP_COLUMN | + Alter_inplace_info::ALTER_COLUMN_TYPE | + Alter_inplace_info::ALTER_COLUMN_ORDER | + Alter_inplace_info::ALTER_COLUMN_NULLABLE | + Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE | + Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE | + Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT + ) + ) + ) { + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + if (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_RENAME) + { + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + + DBUG_ASSERT(ha_alter_info->key_count == altered_table->s->keys); + alter_key_count = 0; + alter_index_drop_count = 0; + alter_index_add_count = 0; + alter_handler_flags = ha_alter_info->handler_flags; + if (!(alter_key_info_buffer = (KEY *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &alter_key_info_buffer, sizeof(KEY) * ha_alter_info->key_count, + &alter_index_drop_buffer, sizeof(KEY) * ha_alter_info->index_drop_count, + &alter_index_add_buffer, sizeof(uint) * ha_alter_info->index_add_count, + &wrap_altered_table, sizeof(TABLE), + &wrap_altered_table_key_info, sizeof(KEY) * altered_table->s->keys, + &wrap_altered_table_share, sizeof(TABLE_SHARE), + &wrap_altered_table_share_key_info, sizeof(KEY) * altered_table->s->keys, + NullS)) + ) { + DBUG_RETURN(HA_ALTER_ERROR); + } + memcpy(wrap_altered_table, altered_table, sizeof(TABLE)); + memcpy(wrap_altered_table_share, altered_table->s, sizeof(TABLE_SHARE)); + + n_keys = ha_alter_info->index_drop_count; + for (i = 0; i < n_keys; ++i) { + const KEY *key = ha_alter_info->index_drop_buffer[i]; + if (key->flags & HA_FULLTEXT || mrn_is_geo_key(key)) { + result_mroonga = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; + } else { + memcpy(&alter_index_drop_buffer[alter_index_drop_count], + ha_alter_info->index_drop_buffer[i], sizeof(KEY)); + ++alter_index_drop_count; + } + } + if (!alter_index_drop_count) { + alter_handler_flags &= ~Alter_inplace_info::DROP_INDEX; + } + n_keys = ha_alter_info->index_add_count; + for (i = 0; i < n_keys; ++i) { + const KEY *key = + &altered_table->key_info[ha_alter_info->index_add_buffer[i]]; + if (key->flags & HA_FULLTEXT || mrn_is_geo_key(key)) { + result_mroonga = HA_ALTER_INPLACE_EXCLUSIVE_LOCK; + } else { + alter_index_add_buffer[alter_index_add_count] = + ha_alter_info->index_add_buffer[i]; + ++alter_index_add_count; + } + } + if (!alter_index_add_count) { + alter_handler_flags &= ~Alter_inplace_info::ADD_INDEX; + } + uint add_index_pos = 0; + n_keys = ha_alter_info->key_count; + for (i = 0; i < n_keys; ++i) { + const KEY *key = &altered_table->key_info[i]; + if (!(key->flags & HA_FULLTEXT || mrn_is_geo_key(key))) { + memcpy(&alter_key_info_buffer[alter_key_count], + &ha_alter_info->key_info_buffer[i], sizeof(KEY)); + memcpy(&wrap_altered_table_key_info[alter_key_count], + &altered_table->key_info[i], sizeof(KEY)); + memcpy(&wrap_altered_table_share_key_info[alter_key_count], + &altered_table->s->key_info[i], sizeof(KEY)); + if (add_index_pos < alter_index_add_count && + alter_index_add_buffer[add_index_pos] == i) { + alter_index_add_buffer[add_index_pos] = alter_key_count; + ++add_index_pos; + } + ++alter_key_count; + } + } + wrap_altered_table->key_info = wrap_altered_table_key_info; + wrap_altered_table_share->key_info = wrap_altered_table_share_key_info; + wrap_altered_table_share->keys = alter_key_count; + wrap_altered_table->s = wrap_altered_table_share; + + if (!alter_handler_flags) { + DBUG_RETURN(result_mroonga); + } + enum_alter_inplace_result result; + MRN_SET_WRAP_ALTER_KEY(this, ha_alter_info); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + result = wrap_handler->check_if_supported_inplace_alter(wrap_altered_table, + ha_alter_info); + MRN_SET_BASE_ALTER_KEY(this, ha_alter_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + if (result_mroonga > result) + DBUG_RETURN(result); + DBUG_RETURN(result_mroonga); +} + +enum_alter_inplace_result ha_mroonga::storage_check_if_supported_inplace_alter( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + 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_PK_INDEX | + Alter_inplace_info::DROP_PK_INDEX | + Alter_inplace_info::ADD_COLUMN | + Alter_inplace_info::DROP_COLUMN | + Alter_inplace_info::ALTER_COLUMN_NAME; + if (ha_alter_info->handler_flags & supported_flags) { + DBUG_RETURN(HA_ALTER_INPLACE_EXCLUSIVE_LOCK); + } else { + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } +} + +enum_alter_inplace_result ha_mroonga::check_if_supported_inplace_alter( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + enum_alter_inplace_result result; + if (share->wrapper_mode) { + result = wrapper_check_if_supported_inplace_alter(altered_table, + ha_alter_info); + } else { + result = storage_check_if_supported_inplace_alter(altered_table, + ha_alter_info); + } + DBUG_RETURN(result); +} + +bool ha_mroonga::wrapper_prepare_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + bool result; + MRN_DBUG_ENTER_METHOD(); + if (!alter_handler_flags) { + DBUG_RETURN(false); + } + MRN_SET_WRAP_ALTER_KEY(this, ha_alter_info); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + result = wrap_handler->ha_prepare_inplace_alter_table(wrap_altered_table, + ha_alter_info); + MRN_SET_BASE_ALTER_KEY(this, ha_alter_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(result); +} + +bool ha_mroonga::storage_prepare_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(false); +} + +bool ha_mroonga::prepare_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + bool result; + if (share->wrapper_mode) { + result = wrapper_prepare_inplace_alter_table(altered_table, ha_alter_info); + } else { + result = storage_prepare_inplace_alter_table(altered_table, ha_alter_info); + } + DBUG_RETURN(result); +} + +bool ha_mroonga::wrapper_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + int error; + bool result = false; + uint n_keys; + uint i, j = 0; + KEY *key_info = table_share->key_info; + MRN_DBUG_ENTER_METHOD(); + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(true); + + DBUG_PRINT("info", ("mroonga: table_name=%s", share->table_name)); + mrn::PathMapper mapper(share->table_name); + n_keys = ha_alter_info->index_drop_count; + for (i = 0; i < n_keys; ++i) { + const KEY *key = ha_alter_info->index_drop_buffer[i]; + if (!(key->flags & HA_FULLTEXT || mrn_is_geo_key(key))) { + continue; + } + while (strcmp(key_info[j].name, key->name)) { + ++j; + } + DBUG_PRINT("info", ("mroonga: key_name=%s", key->name)); + 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, + ha_alter_info->key_count); + MRN_SHARE *tmp_share; + TABLE_SHARE tmp_table_share; + char **key_parser; + uint *key_parser_length; + KEY *p_key_info = &table->key_info[table_share->primary_key]; + bool need_fill_index = false; + memset(index_tables, 0, sizeof(grn_obj *) * ha_alter_info->key_count); + memset(index_columns, 0, sizeof(grn_obj *) * ha_alter_info->key_count); + tmp_table_share.keys = ha_alter_info->key_count; + tmp_table_share.fields = 0; + if (!(tmp_share = (MRN_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &tmp_share, sizeof(*tmp_share), + &key_parser, sizeof(char *) * (tmp_table_share.keys), + &key_parser_length, sizeof(uint) * (tmp_table_share.keys), + NullS)) + ) { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(true); + } + tmp_share->engine = NULL; + tmp_share->table_share = &tmp_table_share; + tmp_share->index_table = NULL; + tmp_share->index_table_length = NULL; + tmp_share->key_parser = key_parser; + tmp_share->key_parser_length = key_parser_length; + bitmap_clear_all(table->read_set); + 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) { + uint key_pos = ha_alter_info->index_add_buffer[i]; + KEY *key = &altered_table->key_info[key_pos]; + if (!(key->flags & HA_FULLTEXT || mrn_is_geo_key(key))) { + continue; + } + if (share->disable_keys) { + continue; + } + if ((error = mrn_add_index_param(tmp_share, key, key_pos))) + { + break; + } + DBUG_PRINT("info", ("mroonga: add key pos=%u", key_pos)); + if ( + (key->flags & HA_FULLTEXT) && + (error = wrapper_create_index_fulltext(mapper.table_name(), + key_pos, + key, index_tables, NULL, + tmp_share)) + ) { + break; + } else if ( + mrn_is_geo_key(key) && + (error = wrapper_create_index_geo(mapper.table_name(), + key_pos, key, + index_tables, NULL, tmp_share)) + ) { + break; + } + mrn_set_bitmap_by_key(table->read_set, key); + index_columns[key_pos] = grn_obj_column(ctx, + index_tables[key_pos], + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME)); + 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); + } + 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); + + if (!error && alter_handler_flags) { + MRN_SET_WRAP_ALTER_KEY(this, ha_alter_info); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + result = wrap_handler->ha_inplace_alter_table(wrap_altered_table, + ha_alter_info); + MRN_SET_BASE_ALTER_KEY(this, ha_alter_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + + if (result || error) + { + n_keys = ha_alter_info->index_add_count; + for (i = 0; i < n_keys; ++i) { + uint key_pos = ha_alter_info->index_add_buffer[i]; + KEY *key = + &altered_table->key_info[key_pos]; + if (!(key->flags & HA_FULLTEXT || mrn_is_geo_key(key))) { + continue; + } + if (share->disable_keys) { + continue; + } + if (index_tables[key_pos]) + { + grn_obj_remove(ctx, index_tables[key_pos]); + } + } + result = true; + } + mrn_free_share_alloc(tmp_share); + my_free(tmp_share, MYF(0)); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(result); +} + +bool ha_mroonga::storage_inplace_alter_table_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, + ha_alter_info->key_count); + MRN_SHARE *tmp_share; + TABLE_SHARE tmp_table_share; + char **index_table, **key_parser, **col_flags, **col_type; + uint *index_table_length, *key_parser_length, *col_flags_length, *col_type_length; + bool have_multiple_column_index = false; + memset(index_tables, 0, sizeof(grn_obj *) * ha_alter_info->key_count); + memset(index_columns, 0, sizeof(grn_obj *) * ha_alter_info->key_count); + tmp_table_share.keys = ha_alter_info->key_count; + tmp_table_share.fields = 0; + if (!(tmp_share = (MRN_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &tmp_share, sizeof(*tmp_share), + &index_table, sizeof(char *) * tmp_table_share.keys, + &index_table_length, sizeof(uint) * tmp_table_share.keys, + &key_parser, sizeof(char *) * tmp_table_share.keys, + &key_parser_length, sizeof(uint) * tmp_table_share.keys, + &col_flags, sizeof(char *) * tmp_table_share.fields, + &col_flags_length, sizeof(uint) * tmp_table_share.fields, + &col_type, sizeof(char *) * tmp_table_share.fields, + &col_type_length, sizeof(uint) * tmp_table_share.fields, + NullS)) + ) { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(true); + } + tmp_share->engine = NULL; + tmp_share->table_share = &tmp_table_share; + tmp_share->index_table = index_table; + tmp_share->index_table_length = index_table_length; + tmp_share->key_parser = key_parser; + tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = col_flags; + tmp_share->col_flags_length = col_flags_length; + tmp_share->col_type = col_type; + tmp_share->col_type_length = col_type_length; + bitmap_clear_all(table->read_set); + if (table_share->primary_key != MAX_KEY) { + 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) { + uint key_pos = ha_alter_info->index_add_buffer[i]; + KEY *key = + &altered_table->key_info[key_pos]; + if (share->disable_keys && !(key->flags & HA_NOSAME)) { + continue; // key is disabled + } + if ((error = mrn_add_index_param(tmp_share, key, key_pos))) + { + break; + } + DBUG_PRINT("info", ("mroonga: add key pos=%u", key_pos)); + if ((error = storage_create_index(table, mapper.table_name(), grn_table, + tmp_share, key, index_tables, + index_columns, key_pos))) + { + break; + } + if ( + KEY_N_KEY_PARTS(key) == 1 && + (key->flags & HA_NOSAME) && + grn_table_size(ctx, grn_table) != + grn_table_size(ctx, index_tables[key_pos]) + ) { + error = HA_ERR_FOUND_DUPP_UNIQUE; + ++i; + break; + } + if ( + KEY_N_KEY_PARTS(key) != 1 && + !(key->flags & HA_FULLTEXT) + ) { + mrn_set_bitmap_by_key(table->read_set, key); + have_multiple_column_index = true; + } + } + 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); + } + error = storage_add_index_multiple_columns(altered_table->key_info, + ha_alter_info->key_count, + index_tables, + index_columns, false); + 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); + + if (error) + { + n_keys = ha_alter_info->index_add_count; + for (i = 0; i < n_keys; ++i) { + uint key_pos = ha_alter_info->index_add_buffer[i]; + KEY *key = + &altered_table->key_info[key_pos]; + if (share->disable_keys && !(key->flags & HA_NOSAME)) { + continue; + } + if (index_tables[key_pos]) + { + grn_obj_remove(ctx, index_columns[key_pos]); + grn_obj_remove(ctx, index_tables[key_pos]); + } + } + have_error = true; + } + mrn_free_share_alloc(tmp_share); + my_free(tmp_share, MYF(0)); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + + DBUG_RETURN(have_error); +} + +bool ha_mroonga::storage_inplace_alter_table_add_column( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_error = false; + + MRN_SHARE *tmp_share; + TABLE_SHARE tmp_table_share; + char **index_table, **key_parser, **col_flags, **col_type; + uint *index_table_length, *key_parser_length, *col_flags_length, *col_type_length; + tmp_table_share.keys = 0; + tmp_table_share.fields = altered_table->s->fields; + tmp_share = (MRN_SHARE *)my_multi_malloc( + MYF(MY_WME | MY_ZEROFILL), + &tmp_share, sizeof(*tmp_share), + &index_table, sizeof(char *) * tmp_table_share.keys, + &index_table_length, sizeof(uint) * tmp_table_share.keys, + &key_parser, sizeof(char *) * tmp_table_share.keys, + &key_parser_length, sizeof(uint) * tmp_table_share.keys, + &col_flags, sizeof(char *) * tmp_table_share.fields, + &col_flags_length, sizeof(uint) * tmp_table_share.fields, + &col_type, sizeof(char *) * tmp_table_share.fields, + &col_type_length, sizeof(uint) * tmp_table_share.fields, + NullS); + if (!tmp_share) { + have_error = true; + DBUG_RETURN(have_error); + } + tmp_share->engine = NULL; + tmp_share->table_share = &tmp_table_share; + tmp_share->index_table = index_table; + tmp_share->index_table_length = index_table_length; + tmp_share->key_parser = key_parser; + tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = col_flags; + tmp_share->col_flags_length = col_flags_length; + tmp_share->col_type = col_type; + tmp_share->col_type_length = col_type_length; + + mrn::PathMapper mapper(share->table_name); + grn_obj *table_obj; + table_obj = grn_ctx_get(ctx, mapper.table_name(), strlen(mapper.table_name())); + + Alter_info *alter_info = ha_alter_info->alter_info; + List_iterator_fast create_fields(alter_info->create_list); + for (uint i = 0; Create_field *create_field = create_fields++; i++) { + if (create_field->field) { + continue; + } + + grn_obj *col_type; + Field *field = altered_table->s->field[i]; + const char *column_name = field->field_name; + int column_name_size = strlen(column_name); + + int error = mrn_add_column_param(tmp_share, field, i); + if (error) { + have_error = true; + break; + } + + grn_obj_flags col_flags = GRN_OBJ_PERSISTENT; + if (tmp_share->col_flags[i]) { + // TODO: parse flags + if (strcmp(tmp_share->col_flags[i], "COLUMN_VECTOR") == 0) { + col_flags |= GRN_OBJ_COLUMN_VECTOR; + } else { + col_flags |= GRN_OBJ_COLUMN_SCALAR; + } + } else { + col_flags |= GRN_OBJ_COLUMN_SCALAR; + } + + grn_builtin_type gtype = mrn_grn_type_from_field(ctx, field, false); + if (tmp_share->col_type[i]) { + col_type = grn_ctx_get(ctx, tmp_share->col_type[i], -1); + } else { + col_type = grn_ctx_at(ctx, gtype); + } + char *col_path = NULL; // we don't specify path + + grn_obj *column_obj = + grn_column_create(ctx, table_obj, column_name, column_name_size, + 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); + } + + if (have_error) { + break; + } + } + + grn_obj_unlink(ctx, table_obj); + + mrn_free_share_alloc(tmp_share); + my_free(tmp_share, MYF(0)); + + DBUG_RETURN(have_error); +} + +bool ha_mroonga::storage_inplace_alter_table_drop_column( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_error = false; + + mrn::PathMapper mapper(share->table_name); + grn_obj *table_obj; + table_obj = grn_ctx_get(ctx, mapper.table_name(), strlen(mapper.table_name())); + + Alter_info *alter_info = ha_alter_info->alter_info; + + uint n_fields = table->s->fields; + for (uint i = 0; i < n_fields; i++) { + Field *field = table->field[i]; + + bool dropped = true; + List_iterator_fast create_fields(alter_info->create_list); + while (Create_field *create_field = create_fields++) { + if (create_field->field == field) { + dropped = false; + break; + } + } + if (!dropped) { + continue; + } + + const char *column_name = field->field_name; + int column_name_size = strlen(column_name); + + grn_obj *column_obj; + column_obj = grn_obj_column(ctx, table_obj, column_name, column_name_size); + if (column_obj) { + grn_obj_remove(ctx, column_obj); + } + if (ctx->rc) { + int error = ER_WRONG_COLUMN_NAME; + my_message(error, ctx->errbuf, MYF(0)); + have_error = true; + break; + } + } + grn_obj_unlink(ctx, table_obj); + + DBUG_RETURN(have_error); +} + +bool ha_mroonga::storage_inplace_alter_table_rename_column( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_error = false; + + mrn::PathMapper mapper(share->table_name); + grn_obj *table_obj; + table_obj = grn_ctx_get(ctx, mapper.table_name(), strlen(mapper.table_name())); + + Alter_info *alter_info = ha_alter_info->alter_info; + uint n_fields = table->s->fields; + for (uint i = 0; i < n_fields; i++) { + Field *field = table->field[i]; + + if (!(field->flags & FIELD_IS_RENAMED)) { + continue; + } + + const char *new_name = NULL; + List_iterator_fast create_fields(alter_info->create_list); + while (Create_field *create_field = create_fields++) { + if (create_field->field == field) { + new_name = create_field->field_name; + break; + } + } + + if (!new_name) { + continue; + } + + const char *old_name = field->field_name; + grn_obj *column_obj; + column_obj = grn_obj_column(ctx, table_obj, old_name, strlen(old_name)); + if (column_obj) { + grn_column_rename(ctx, column_obj, new_name, strlen(new_name)); + if (ctx->rc) { + int error = ER_WRONG_COLUMN_NAME; + my_message(error, ctx->errbuf, MYF(0)); + have_error = true; + } + grn_obj_unlink(ctx, column_obj); + } + + if (have_error) { + break; + } + } + grn_obj_unlink(ctx, table_obj); + + DBUG_RETURN(have_error); +} + +bool ha_mroonga::storage_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + + bool have_error = false; + + int error = mrn_change_encoding(ctx, system_charset_info); + if (error) { + have_error = true; + } + + Alter_inplace_info::HA_ALTER_FLAGS index_related_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_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); + } + + Alter_inplace_info::HA_ALTER_FLAGS add_column_related_flags = + Alter_inplace_info::ADD_COLUMN; + if (!have_error && + (ha_alter_info->handler_flags & add_column_related_flags)) { + have_error = storage_inplace_alter_table_add_column(altered_table, ha_alter_info); + } + + Alter_inplace_info::HA_ALTER_FLAGS drop_column_related_flags = + Alter_inplace_info::DROP_COLUMN; + if (!have_error && + (ha_alter_info->handler_flags & drop_column_related_flags)) { + have_error = storage_inplace_alter_table_drop_column(altered_table, ha_alter_info); + } + + Alter_inplace_info::HA_ALTER_FLAGS rename_column_related_flags = + Alter_inplace_info::ALTER_COLUMN_NAME; + if (!have_error && + (ha_alter_info->handler_flags & rename_column_related_flags)) { + have_error = storage_inplace_alter_table_rename_column(altered_table, ha_alter_info); + } + + DBUG_RETURN(have_error); +} + +bool ha_mroonga::inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info) +{ + MRN_DBUG_ENTER_METHOD(); + bool result; + if (share->wrapper_mode) { + result = wrapper_inplace_alter_table(altered_table, ha_alter_info); + } else { + result = storage_inplace_alter_table(altered_table, ha_alter_info); + } + DBUG_RETURN(result); +} + +bool ha_mroonga::wrapper_commit_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit) +{ + bool result; + MRN_DBUG_ENTER_METHOD(); + if (!alter_handler_flags) { + my_free(alter_key_info_buffer, MYF(0)); + alter_key_info_buffer = NULL; + DBUG_RETURN(false); + } + MRN_SET_WRAP_ALTER_KEY(this, ha_alter_info); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + result = wrap_handler->ha_commit_inplace_alter_table(wrap_altered_table, + ha_alter_info, + commit); + MRN_SET_BASE_ALTER_KEY(this, ha_alter_info); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + my_free(alter_key_info_buffer, MYF(0)); + alter_key_info_buffer = NULL; + DBUG_RETURN(result); +} + +bool ha_mroonga::storage_commit_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(false); +} + +bool ha_mroonga::commit_inplace_alter_table( + TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit) +{ + MRN_DBUG_ENTER_METHOD(); + bool result; + if (share->wrapper_mode) { + result = wrapper_commit_inplace_alter_table(altered_table, ha_alter_info, + commit); + } else { + result = storage_commit_inplace_alter_table(altered_table, ha_alter_info, + commit); + } + DBUG_RETURN(result); +} + +void ha_mroonga::wrapper_notify_table_changed() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->ha_notify_table_changed(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_notify_table_changed() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::notify_table_changed() +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) { + wrapper_notify_table_changed(); + } else { + storage_notify_table_changed(); + } + DBUG_VOID_RETURN; +} +#else +uint ha_mroonga::wrapper_alter_table_flags(uint flags) +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->alter_table_flags(flags); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_alter_table_flags(uint flags) +{ + MRN_DBUG_ENTER_METHOD(); + uint res = handler::alter_table_flags(flags); + DBUG_RETURN(res); +} + +uint ha_mroonga::alter_table_flags(uint flags) +{ + MRN_DBUG_ENTER_METHOD(); + uint res; + if (share->wrapper_mode) + { + res = wrapper_alter_table_flags(flags); + } else { + res = storage_alter_table_flags(flags); + } + DBUG_RETURN(res); +} + +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX +int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys, handler_add_index **add) +#else +int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys) +#endif +{ + int error = 0; + uint i, j, k; + uint n_keys = table->s->keys; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, num_of_keys + n_keys); + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_columns, num_of_keys + n_keys); + THD *thd = ha_thd(); + MRN_SHARE *tmp_share; + TABLE_SHARE tmp_table_share; + char **key_parser; + uint *key_parser_length; + MRN_DBUG_ENTER_METHOD(); + if (!(wrap_alter_key_info = (KEY *) my_malloc(sizeof(KEY) * num_of_keys, + MYF(MY_WME)))) { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + KEY *p_key_info = &table->key_info[table_share->primary_key], *tmp_key_info; + tmp_table_share.keys = n_keys + num_of_keys; + tmp_table_share.fields = 0; + if (!(tmp_share = (MRN_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &tmp_share, sizeof(*tmp_share), + &key_parser, sizeof(char *) * (n_keys + num_of_keys), + &key_parser_length, sizeof(uint) * (n_keys + num_of_keys), + NullS)) + ) { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + tmp_share->engine = NULL; + tmp_share->table_share = &tmp_table_share; + tmp_share->index_table = NULL; + tmp_share->index_table_length = NULL; + tmp_share->key_parser = key_parser; + tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = NULL; + tmp_share->col_type = NULL; +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + hnd_add_index = NULL; +#endif + bitmap_clear_all(table->read_set); + mrn_set_bitmap_by_key(table->read_set, p_key_info); + mrn::PathMapper mapper(share->table_name); + for (i = 0, j = 0; i < num_of_keys; i++) { + if (!(key_info[i].flags & HA_FULLTEXT) && !mrn_is_geo_key(&key_info[i])) { + wrap_alter_key_info[j] = key_info[i]; + j++; + continue; + } + if (share->disable_keys) { + continue; + } + if ((error = mrn_add_index_param(tmp_share, &key_info[i], i + n_keys))) + { + break; + } + index_tables[i + n_keys] = NULL; + if ( + (key_info[i].flags & HA_FULLTEXT) && + (error = wrapper_create_index_fulltext(mapper.table_name(), + i + n_keys, + &key_info[i], index_tables, NULL, + tmp_share)) + ) { + break; + } else if ( + mrn_is_geo_key(&key_info[i]) && + (error = wrapper_create_index_geo(mapper.table_name(), + i + n_keys, &key_info[i], + index_tables, NULL, tmp_share)) + ) { + break; + } + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); + } + if (!error && i > j && !share->disable_keys) { + for (k = 0; k < num_of_keys; k++) { + tmp_key_info = &key_info[k]; + if (!(tmp_key_info->flags & HA_FULLTEXT) && + !mrn_is_geo_key(tmp_key_info)) { + continue; + } + index_columns[k + n_keys] = grn_obj_column(ctx, + index_tables[k + n_keys], + INDEX_COLUMN_NAME, + strlen(INDEX_COLUMN_NAME)); + } + error = wrapper_fill_indexes(thd, key_info, &index_columns[n_keys], + num_of_keys); + } + bitmap_set_all(table->read_set); + + if (!error && j) + { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + error = wrap_handler->add_index(table_arg, wrap_alter_key_info, j, + &hnd_add_index); +#else + error = wrap_handler->add_index(table_arg, wrap_alter_key_info, j); +#endif + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + if (error) + { + for (k = 0; k < i; k++) { + if (!(key_info[k].flags & HA_FULLTEXT) && !mrn_is_geo_key(&key_info[k])) + { + continue; + } + if (index_tables[k + n_keys]) + { + grn_obj_remove(ctx, index_tables[k + n_keys]); + } + } + } +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + else { + *add = new handler_add_index(table_arg, key_info, num_of_keys); + } +#endif + mrn_free_share_alloc(tmp_share); + my_free(tmp_share, MYF(0)); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(error); +} + +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX +int ha_mroonga::storage_add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys, handler_add_index **add) +#else +int ha_mroonga::storage_add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys) +#endif +{ + int error = 0; + uint i; + uint n_keys = table->s->keys; + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_tables, num_of_keys + n_keys); + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(grn_obj *, index_columns, num_of_keys + n_keys); + MRN_SHARE *tmp_share; + TABLE_SHARE tmp_table_share; + char **index_table, **key_parser, **col_flags, **col_type; + uint *index_table_length, *key_parser_length, *col_flags_length, *col_type_length; + bool have_multiple_column_index = false; + + MRN_DBUG_ENTER_METHOD(); + tmp_table_share.keys = n_keys + num_of_keys; + tmp_table_share.fields = 0; + if (!(tmp_share = (MRN_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &tmp_share, sizeof(*tmp_share), + &index_table, sizeof(char*) * tmp_table_share.keys, + &index_table_length, sizeof(uint) * tmp_table_share.keys, + &key_parser, sizeof(char *) * tmp_table_share.keys, + &key_parser_length, sizeof(uint) * tmp_table_share.keys, + &col_flags, sizeof(char *) * tmp_table_share.fields, + &col_flags_length, sizeof(uint) * tmp_table_share.fields, + &col_type, sizeof(char *) * tmp_table_share.fields, + &col_type_length, sizeof(uint) * tmp_table_share.fields, + NullS)) + ) { + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + tmp_share->engine = NULL; + tmp_share->table_share = &tmp_table_share; + tmp_share->index_table = index_table; + tmp_share->index_table_length = index_table_length; + tmp_share->key_parser = key_parser; + tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = col_flags; + tmp_share->col_flags_length = col_flags_length; + tmp_share->col_type = col_type; + tmp_share->col_type_length = col_type_length; + bitmap_clear_all(table->read_set); + mrn::PathMapper mapper(share->table_name); + for (i = 0; i < num_of_keys; i++) { + if (share->disable_keys && !(key_info[i].flags & HA_NOSAME)) { + continue; // key is disabled + } + index_tables[i + n_keys] = NULL; + index_columns[i + n_keys] = NULL; + if ((error = mrn_add_index_param(tmp_share, &key_info[i], i + n_keys))) + { + break; + } + if ((error = storage_create_index(table, mapper.table_name(), grn_table, + tmp_share, &key_info[i], index_tables, + index_columns, i + n_keys))) + { + break; + } + if ( + KEY_N_KEY_PARTS(&(key_info[i])) == 1 && + (key_info[i].flags & HA_NOSAME) && + grn_table_size(ctx, grn_table) != + grn_table_size(ctx, index_tables[i + n_keys]) + ) { + error = HA_ERR_FOUND_DUPP_UNIQUE; + i++; + break; + } + if ( + KEY_N_KEY_PARTS(&(key_info[i])) != 1 && + !(key_info[i].flags & HA_FULLTEXT) + ) { + mrn_set_bitmap_by_key(table->read_set, &key_info[i]); + have_multiple_column_index = true; + } + } + if (!error && have_multiple_column_index) + { + error = storage_add_index_multiple_columns(key_info, num_of_keys, + index_tables + n_keys, + index_columns + n_keys, false); + } + bitmap_set_all(table->read_set); + if (error) + { + for (uint j = 0; j < i; j++) { + if (index_tables[j + n_keys]) + { + grn_obj_remove(ctx, index_columns[j + n_keys]); + grn_obj_remove(ctx, index_tables[j + n_keys]); + } + } + } +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + else { + *add = new handler_add_index(table_arg, key_info, num_of_keys); + } +#endif + mrn_free_share_alloc(tmp_share); + my_free(tmp_share, MYF(0)); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); + MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_columns); + DBUG_RETURN(error); +} +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX +int ha_mroonga::add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys, handler_add_index **add) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + if (share->wrapper_mode) + { + error = wrapper_add_index(table_arg, key_info, num_of_keys, add); + } else { + error = storage_add_index(table_arg, key_info, num_of_keys, add); + } + DBUG_RETURN(error); +} +#else +int ha_mroonga::add_index(TABLE *table_arg, KEY *key_info, + uint num_of_keys) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + if (share->wrapper_mode) + { + error = wrapper_add_index(table_arg, key_info, num_of_keys); + } else { + error = storage_add_index(table_arg, key_info, num_of_keys); + } + DBUG_RETURN(error); +} +#endif + +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX +int ha_mroonga::wrapper_final_add_index(handler_add_index *add, bool commit) +{ + int error = 0; + MRN_DBUG_ENTER_METHOD(); + if (hnd_add_index) + { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + error = wrap_handler->final_add_index(hnd_add_index, commit); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + if (add) + { + delete add; + } + DBUG_RETURN(error); +} + +int ha_mroonga::storage_final_add_index(handler_add_index *add, bool commit) +{ + MRN_DBUG_ENTER_METHOD(); + if (add) + { + delete add; + } + DBUG_RETURN(0); +} + +int ha_mroonga::final_add_index(handler_add_index *add, bool commit) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + if (share->wrapper_mode) + { + error = wrapper_final_add_index(add, commit); + } else { + error = storage_final_add_index(add, commit); + } + DBUG_RETURN(error); +} +#endif + +int ha_mroonga::wrapper_prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys) +{ + int res = 0; + uint i, j; + KEY *key_info = table_share->key_info; + MRN_DBUG_ENTER_METHOD(); + res = mrn_change_encoding(ctx, system_charset_info); + if (res) + DBUG_RETURN(res); + + MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(uint, wrap_key_num, num_of_keys); + for (i = 0, j = 0; i < num_of_keys; i++) { + uint key_index = key_num[i]; + if (!(key_info[key_index].flags & HA_FULLTEXT) && + !mrn_is_geo_key(&key_info[key_index])) { + wrap_key_num[j] = share->wrap_key_nr[key_index]; + j++; + continue; + } + + res = drop_index(share, key_index); + if (res) + DBUG_RETURN(res); + grn_index_tables[key_index] = NULL; + grn_index_columns[key_index] = NULL; + } + if (j) + { + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->prepare_drop_index(table_arg, wrap_key_num, j); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + } + MRN_FREE_VARIABLE_LENGTH_ARRAYS(wrap_key_num); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys) +{ + int error; + uint i; + MRN_DBUG_ENTER_METHOD(); + error = mrn_change_encoding(ctx, system_charset_info); + if (error) + DBUG_RETURN(error); + + for (i = 0; i < num_of_keys; i++) { + uint key_index = key_num[i]; + error = drop_index(share, key_index); + if (error) + break; + grn_index_tables[key_index] = NULL; + grn_index_columns[key_index] = NULL; + } + DBUG_RETURN(error); +} + +int ha_mroonga::prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + if (share->wrapper_mode) + { + res = wrapper_prepare_drop_index(table_arg, key_num, num_of_keys); + } else { + res = storage_prepare_drop_index(table_arg, key_num, num_of_keys); + } + DBUG_RETURN(res); +} + +int ha_mroonga::wrapper_final_drop_index(TABLE *table_arg) +{ + uint res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->final_drop_index(table_arg); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_final_drop_index(TABLE *table_arg) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_RETURN(0); +} + +int ha_mroonga::final_drop_index(TABLE *table_arg) +{ + MRN_DBUG_ENTER_METHOD(); + uint res; + if (share->wrapper_mode) + { + res = wrapper_final_drop_index(table_arg); + } else { + res = storage_final_drop_index(table_arg); + } + DBUG_RETURN(res); +} +#endif + +int ha_mroonga::wrapper_update_auto_increment() +{ + int res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->update_auto_increment(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_update_auto_increment() +{ + MRN_DBUG_ENTER_METHOD(); + int res = handler::update_auto_increment(); + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + table->next_number_field->val_int())); + DBUG_RETURN(res); +} + +int ha_mroonga::update_auto_increment() +{ + MRN_DBUG_ENTER_METHOD(); + int res; + if (share->wrapper_mode) + { + res = wrapper_update_auto_increment(); + } else { + res = storage_update_auto_increment(); + } + DBUG_RETURN(res); +} + +void ha_mroonga::wrapper_set_next_insert_id(ulonglong id) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->set_next_insert_id(id); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_set_next_insert_id(ulonglong id) +{ + MRN_DBUG_ENTER_METHOD(); + handler::set_next_insert_id(id); + DBUG_VOID_RETURN; +} + +void ha_mroonga::set_next_insert_id(ulonglong id) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_set_next_insert_id(id); + } else { + storage_set_next_insert_id(id); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_get_auto_increment(ulonglong offset, + ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->get_auto_increment(offset, increment, nb_desired_values, + first_value, nb_reserved_values); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_get_auto_increment(ulonglong offset, + ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) +{ + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + MRN_DBUG_ENTER_METHOD(); + if (table->found_next_number_field && + !table->s->next_number_keypart) { + if (long_term_share->auto_inc_inited) { + *first_value = long_term_share->auto_inc_value; + DBUG_PRINT("info", ("mroonga: *first_value(auto_inc_value)=%llu", + *first_value)); + *nb_reserved_values = ULONGLONG_MAX; + } else { + handler::get_auto_increment(offset, increment, nb_desired_values, + first_value, nb_reserved_values); + long_term_share->auto_inc_value = *first_value; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + long_term_share->auto_inc_inited = true; + } + } else { + handler::get_auto_increment(offset, increment, nb_desired_values, + first_value, nb_reserved_values); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_get_auto_increment(offset, increment, nb_desired_values, + first_value, nb_reserved_values); + } else { + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + mrn::Lock lock(&long_term_share->auto_inc_mutex); + storage_get_auto_increment(offset, increment, nb_desired_values, + first_value, nb_reserved_values); + long_term_share->auto_inc_value += nb_desired_values * increment; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_restore_auto_increment(ulonglong prev_insert_id) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->restore_auto_increment(prev_insert_id); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_restore_auto_increment(ulonglong prev_insert_id) +{ + MRN_DBUG_ENTER_METHOD(); + handler::restore_auto_increment(prev_insert_id); + DBUG_VOID_RETURN; +} + +void ha_mroonga::restore_auto_increment(ulonglong prev_insert_id) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_restore_auto_increment(prev_insert_id); + } else { + storage_restore_auto_increment(prev_insert_id); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_release_auto_increment() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->ha_release_auto_increment(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_release_auto_increment() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::release_auto_increment() +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_release_auto_increment(); + } else { + storage_release_auto_increment(); + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::wrapper_check_for_upgrade(HA_CHECK_OPT *check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + int error = wrap_handler->ha_check_for_upgrade(check_opt); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(error); +} + +int ha_mroonga::storage_check_for_upgrade(HA_CHECK_OPT *check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + for (uint i = 0; i < table->s->fields; ++i) { + grn_obj *column = grn_columns[i]; + if (!column) { + continue; + } + Field *field = table->field[i]; + grn_id column_range = grn_obj_get_range(ctx, column); + switch (field->real_type()) { + case MYSQL_TYPE_ENUM: + if (column_range != GRN_DB_UINT16) { + DBUG_RETURN(HA_ADMIN_NEEDS_ALTER); + } + break; + case MYSQL_TYPE_SET: + if (column_range != GRN_DB_UINT64) { + DBUG_RETURN(HA_ADMIN_NEEDS_ALTER); + } + break; + default: + break; + } + } + DBUG_RETURN(HA_ADMIN_OK); +} + +int ha_mroonga::check_for_upgrade(HA_CHECK_OPT *check_opt) +{ + MRN_DBUG_ENTER_METHOD(); + int error; + if (share->wrapper_mode) { + error = wrapper_check_for_upgrade(check_opt); + } else { + error = storage_check_for_upgrade(check_opt); + } + DBUG_RETURN(error); +} + +int ha_mroonga::wrapper_reset_auto_increment(ulonglong value) +{ + int res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->ha_reset_auto_increment(value); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_reset_auto_increment(ulonglong value) +{ + MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; + MRN_DBUG_ENTER_METHOD(); + mrn::Lock lock(&long_term_share->auto_inc_mutex); + long_term_share->auto_inc_value = value; + DBUG_PRINT("info", ("mroonga: auto_inc_value=%llu", + long_term_share->auto_inc_value)); + long_term_share->auto_inc_inited = true; + DBUG_RETURN(0); +} + +int ha_mroonga::reset_auto_increment(ulonglong value) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + if (share->wrapper_mode) + { + res = wrapper_reset_auto_increment(value); + } else { + res = storage_reset_auto_increment(value); + } + DBUG_RETURN(res); +} + +void ha_mroonga::set_pk_bitmap() +{ + KEY key_info = table->key_info[table_share->primary_key]; + uint j; + MRN_DBUG_ENTER_METHOD(); + for (j = 0; j < KEY_N_KEY_PARTS(&key_info); j++) { + Field *field = key_info.key_part[j].field; + bitmap_set_bit(table->read_set, field->field_index); + } + DBUG_VOID_RETURN; +} + +bool ha_mroonga::wrapper_was_semi_consistent_read() +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->was_semi_consistent_read(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_was_semi_consistent_read() +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + res = handler::was_semi_consistent_read(); + DBUG_RETURN(res); +} + +bool ha_mroonga::was_semi_consistent_read() +{ + bool res; + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + res = wrapper_was_semi_consistent_read(); + } else { + res = storage_was_semi_consistent_read(); + } + DBUG_RETURN(res); +} + +void ha_mroonga::wrapper_try_semi_consistent_read(bool yes) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->try_semi_consistent_read(yes); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_try_semi_consistent_read(bool yes) +{ + MRN_DBUG_ENTER_METHOD(); + handler::try_semi_consistent_read(yes); + DBUG_VOID_RETURN; +} + +void ha_mroonga::try_semi_consistent_read(bool yes) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_try_semi_consistent_read(yes); + } else { + storage_try_semi_consistent_read(yes); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_unlock_row() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->unlock_row(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_unlock_row() +{ + MRN_DBUG_ENTER_METHOD(); + handler::unlock_row(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::unlock_row() +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_unlock_row(); + } else { + storage_unlock_row(); + } + DBUG_VOID_RETURN; +} + +int ha_mroonga::wrapper_start_stmt(THD *thd, thr_lock_type lock_type) +{ + int res; + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->start_stmt(thd, lock_type); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_start_stmt(THD *thd, thr_lock_type lock_type) +{ + int res; + MRN_DBUG_ENTER_METHOD(); + res = handler::start_stmt(thd, lock_type); + DBUG_RETURN(res); +} + +int ha_mroonga::start_stmt(THD *thd, thr_lock_type lock_type) +{ + int res; + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + res = wrapper_start_stmt(thd, lock_type); + } else { + res = storage_start_stmt(thd, lock_type); + } + DBUG_RETURN(res); +} + +void ha_mroonga::wrapper_change_table_ptr(TABLE *table_arg, + TABLE_SHARE *share_arg) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->change_table_ptr(table_arg, share->wrap_table_share); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_change_table_ptr(TABLE *table_arg, + TABLE_SHARE *share_arg) +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg) +{ + MRN_DBUG_ENTER_METHOD(); + handler::change_table_ptr(table_arg, share_arg); + if (share && share->wrapper_mode) + { + wrapper_change_table_ptr(table_arg, share_arg); + } else { + storage_change_table_ptr(table_arg, share_arg); + } + DBUG_VOID_RETURN; +} + +bool ha_mroonga::wrapper_primary_key_is_clustered() +{ + MRN_DBUG_ENTER_METHOD(); + bool is_clustered; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + is_clustered = wrap_handler->primary_key_is_clustered(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(is_clustered); +} + +bool ha_mroonga::storage_primary_key_is_clustered() +{ + MRN_DBUG_ENTER_METHOD(); + bool is_clustered = handler::primary_key_is_clustered(); + DBUG_RETURN(is_clustered); +} + +bool ha_mroonga::primary_key_is_clustered() +{ + MRN_DBUG_ENTER_METHOD(); + bool is_clustered; + if (share && share->wrapper_mode) + { + is_clustered = wrapper_primary_key_is_clustered(); + } else { + is_clustered = storage_primary_key_is_clustered(); + } + DBUG_RETURN(is_clustered); +} + +bool ha_mroonga::wrapper_is_fk_defined_on_table_or_index(uint index) +{ + MRN_DBUG_ENTER_METHOD(); + bool res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->is_fk_defined_on_table_or_index(index); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_is_fk_defined_on_table_or_index(uint index) +{ + MRN_DBUG_ENTER_METHOD(); + bool res = handler::is_fk_defined_on_table_or_index(index); + DBUG_RETURN(res); +} + +bool ha_mroonga::is_fk_defined_on_table_or_index(uint index) +{ + MRN_DBUG_ENTER_METHOD(); + bool res; + if (share->wrapper_mode) + { + res = wrapper_is_fk_defined_on_table_or_index(index); + } else { + res = storage_is_fk_defined_on_table_or_index(index); + } + DBUG_RETURN(res); +} + +char *ha_mroonga::wrapper_get_foreign_key_create_info() +{ + MRN_DBUG_ENTER_METHOD(); + char *res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->get_foreign_key_create_info(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +char *ha_mroonga::storage_get_foreign_key_create_info() +{ + int error; + uint i; + grn_obj *column; + uint n_columns = table_share->fields; + char create_info_buff[2048], *create_info; + String create_info_str(create_info_buff, sizeof(create_info_buff), + system_charset_info); + MRN_DBUG_ENTER_METHOD(); + 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) { + continue; + } + + column = grn_obj_column(ctx, grn_table, + column_name, column_name_size); + 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); + ref_table_buff[ref_table_name_length] = '\0'; + + if (create_info_str.reserve(15)) { + DBUG_RETURN(NULL); + } + create_info_str.q_append(",\n CONSTRAINT ", 15); + append_identifier(ha_thd(), &create_info_str, column_name, + column_name_size); + 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); + if (create_info_str.reserve(13)) { + DBUG_RETURN(NULL); + } + create_info_str.q_append(") REFERENCES ", 13); + append_identifier(ha_thd(), &create_info_str, table_share->db.str, + table_share->db.length); + if (create_info_str.reserve(1)) { + DBUG_RETURN(NULL); + } + create_info_str.q_append(".", 1); + append_identifier(ha_thd(), &create_info_str, ref_table_buff, + ref_table_name_length); + if (create_info_str.reserve(2)) { + DBUG_RETURN(NULL); + } + create_info_str.q_append(" (", 2); + + char ref_path[FN_REFLEN + 1]; + TABLE_LIST table_list; + TABLE_SHARE *tmp_ref_table_share; + build_table_filename(ref_path, sizeof(ref_path) - 1, + table_share->db.str, ref_table_buff, "", 0); + DBUG_PRINT("info", ("mroonga: ref_path=%s", ref_path)); +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + table_list.init_one_table(table_share->db.str, + table_share->db.length, + ref_table_buff, + ref_table_name_length, + ref_table_buff, TL_WRITE); +#else + table_list.init_one_table(table_share->db.str, + ref_table_buff, + TL_WRITE); +#endif + mrn_open_mutex_lock(table_share); + tmp_ref_table_share = + mrn_create_tmp_table_share(&table_list, ref_path, &error); + mrn_open_mutex_unlock(table_share); + if (!tmp_ref_table_share) { + DBUG_RETURN(NULL); + } + uint ref_pkey_nr = tmp_ref_table_share->primary_key; + KEY *ref_key_info = &tmp_ref_table_share->key_info[ref_pkey_nr]; + Field *ref_field = &ref_key_info->key_part->field[0]; + append_identifier(ha_thd(), &create_info_str, ref_field->field_name, + strlen(ref_field->field_name)); + mrn_open_mutex_lock(table_share); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table_share); + if (create_info_str.reserve(39)) { + DBUG_RETURN(NULL); + } + create_info_str.q_append(") ON DELETE RESTRICT ON UPDATE RESTRICT", 39); + } + if (!(create_info = (char *) my_malloc(create_info_str.length() + 1, + MYF(MY_WME)))) { + DBUG_RETURN(NULL); + } + memcpy(create_info, create_info_str.ptr(), create_info_str.length()); + create_info[create_info_str.length()] = '\0'; + DBUG_RETURN(create_info); +} +#else +char *ha_mroonga::storage_get_foreign_key_create_info() +{ + MRN_DBUG_ENTER_METHOD(); + char *res = handler::get_foreign_key_create_info(); + DBUG_RETURN(res); +} +#endif + +char *ha_mroonga::get_foreign_key_create_info() +{ + MRN_DBUG_ENTER_METHOD(); + char *res; + if (share->wrapper_mode) + { + res = wrapper_get_foreign_key_create_info(); + } else { + res = storage_get_foreign_key_create_info(); + } + DBUG_RETURN(res); +} + +#ifdef MRN_HANDLER_HAVE_GET_TABLESPACE_NAME +char *ha_mroonga::wrapper_get_tablespace_name(THD *thd, char *name, + uint name_len) +{ + MRN_DBUG_ENTER_METHOD(); + char *res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->get_tablespace_name(thd, name, name_len); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +char *ha_mroonga::storage_get_tablespace_name(THD *thd, char *name, + uint name_len) +{ + MRN_DBUG_ENTER_METHOD(); + char *res = handler::get_tablespace_name(thd, name, name_len); + DBUG_RETURN(res); +} + +char *ha_mroonga::get_tablespace_name(THD *thd, char *name, uint name_len) +{ + MRN_DBUG_ENTER_METHOD(); + char *res; + if (share->wrapper_mode) + { + res = wrapper_get_tablespace_name(thd, name, name_len); + } else { + res = storage_get_tablespace_name(thd, name, name_len); + } + DBUG_RETURN(res); +} +#endif + +bool ha_mroonga::wrapper_can_switch_engines() +{ + MRN_DBUG_ENTER_METHOD(); + bool res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->can_switch_engines(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +bool ha_mroonga::storage_can_switch_engines() +{ + MRN_DBUG_ENTER_METHOD(); + bool res = handler::can_switch_engines(); + DBUG_RETURN(res); +} + +bool ha_mroonga::can_switch_engines() +{ + MRN_DBUG_ENTER_METHOD(); + bool res; + if (share->wrapper_mode) + { + res = wrapper_can_switch_engines(); + } else { + res = storage_can_switch_engines(); + } + DBUG_RETURN(res); +} + +int ha_mroonga::wrapper_get_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->get_foreign_key_list(thd, f_key_list); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +int ha_mroonga::storage_get_foreign_key_list(THD *thd, + List *f_key_list) +{ + int error; + uint i; + grn_obj *column; + uint n_columns = table_share->fields; + 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) { + continue; + } + + column = grn_obj_column(ctx, grn_table, + column_name, column_name_size); + 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_db = thd_make_lex_string(thd, NULL, + 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); + f_key_info.referenced_db = f_key_info.foreign_db; + + char ref_table_buff[NAME_LEN + 1]; + int ref_table_name_length = grn_obj_name(ctx, ref_table, ref_table_buff, + NAME_LEN); + ref_table_buff[ref_table_name_length] = '\0'; + DBUG_PRINT("info", ("mroonga: ref_table_buff=%s", ref_table_buff)); + DBUG_PRINT("info", ("mroonga: ref_table_name_length=%d", ref_table_name_length)); + f_key_info.referenced_table = thd_make_lex_string(thd, NULL, + ref_table_buff, + ref_table_name_length, + TRUE); + 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); + 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); + f_key_info.foreign_fields.push_back(field_name); + + char ref_path[FN_REFLEN + 1]; + TABLE_LIST table_list; + TABLE_SHARE *tmp_ref_table_share; + build_table_filename(ref_path, sizeof(ref_path) - 1, + table_share->db.str, ref_table_buff, "", 0); + DBUG_PRINT("info", ("mroonga: ref_path=%s", ref_path)); +#ifdef MRN_TABLE_LIST_INIT_REQUIRE_ALIAS + table_list.init_one_table(table_share->db.str, + table_share->db.length, + ref_table_buff, + ref_table_name_length, + ref_table_buff, TL_WRITE); +#else + table_list.init_one_table(table_share->db.str, + ref_table_buff, + TL_WRITE); +#endif + mrn_open_mutex_lock(table_share); + tmp_ref_table_share = + mrn_create_tmp_table_share(&table_list, ref_path, &error); + mrn_open_mutex_unlock(table_share); + if (!tmp_ref_table_share) { + DBUG_RETURN(error); + } + uint ref_pkey_nr = tmp_ref_table_share->primary_key; + KEY *ref_key_info = &tmp_ref_table_share->key_info[ref_pkey_nr]; + Field *ref_field = &ref_key_info->key_part->field[0]; + LEX_STRING *ref_col_name = thd_make_lex_string(thd, NULL, + ref_field->field_name, + strlen(ref_field->field_name), + TRUE); + f_key_info.referenced_fields.push_back(ref_col_name); + mrn_open_mutex_lock(table_share); + mrn_free_tmp_table_share(tmp_ref_table_share); + mrn_open_mutex_unlock(table_share); + FOREIGN_KEY_INFO *p_f_key_info = + (FOREIGN_KEY_INFO *) thd_memdup(thd, &f_key_info, + sizeof(FOREIGN_KEY_INFO)); + if (!p_f_key_info) { + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + f_key_list->push_back(p_f_key_info); + } + DBUG_RETURN(0); +} +#else +int ha_mroonga::storage_get_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res = handler::get_foreign_key_list(thd, f_key_list); + DBUG_RETURN(res); +} +#endif + +int ha_mroonga::get_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + if (share->wrapper_mode) + { + res = wrapper_get_foreign_key_list(thd, f_key_list); + } else { + res = storage_get_foreign_key_list(thd, f_key_list); + } + DBUG_RETURN(res); +} + +#ifdef MRN_HANDLER_HAVE_GET_PARENT_FOREIGN_KEY_LIST +int ha_mroonga::wrapper_get_parent_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->get_parent_foreign_key_list(thd, f_key_list); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +int ha_mroonga::storage_get_parent_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res = handler::get_parent_foreign_key_list(thd, f_key_list); + DBUG_RETURN(res); +} + +int ha_mroonga::get_parent_foreign_key_list(THD *thd, + List *f_key_list) +{ + MRN_DBUG_ENTER_METHOD(); + int res; + if (share->wrapper_mode) + { + res = wrapper_get_parent_foreign_key_list(thd, f_key_list); + } else { + res = storage_get_parent_foreign_key_list(thd, f_key_list); + } + DBUG_RETURN(res); +} +#endif + +uint ha_mroonga::wrapper_referenced_by_foreign_key() +{ + MRN_DBUG_ENTER_METHOD(); + uint res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->referenced_by_foreign_key(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +uint ha_mroonga::storage_referenced_by_foreign_key() +{ + MRN_DBUG_ENTER_METHOD(); + uint res = handler::referenced_by_foreign_key(); + DBUG_RETURN(res); +} + +uint ha_mroonga::referenced_by_foreign_key() +{ + MRN_DBUG_ENTER_METHOD(); + uint res; + if (share->wrapper_mode) + { + res = wrapper_referenced_by_foreign_key(); + } else { + res = storage_referenced_by_foreign_key(); + } + DBUG_RETURN(res); +} + +void ha_mroonga::wrapper_init_table_handle_for_HANDLER() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->init_table_handle_for_HANDLER(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_init_table_handle_for_HANDLER() +{ + MRN_DBUG_ENTER_METHOD(); + handler::init_table_handle_for_HANDLER(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::init_table_handle_for_HANDLER() +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_init_table_handle_for_HANDLER(); + } else { + storage_init_table_handle_for_HANDLER(); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_free_foreign_key_create_info(char* str) +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->free_foreign_key_create_info(str); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +#ifdef MRN_SUPPORT_FOREIGN_KEYS +void ha_mroonga::storage_free_foreign_key_create_info(char* str) +{ + MRN_DBUG_ENTER_METHOD(); + my_free(str, MYF(0)); + DBUG_VOID_RETURN; +} +#else +void ha_mroonga::storage_free_foreign_key_create_info(char* str) +{ + MRN_DBUG_ENTER_METHOD(); + handler::free_foreign_key_create_info(str); + DBUG_VOID_RETURN; +} +#endif + +void ha_mroonga::free_foreign_key_create_info(char* str) +{ + MRN_DBUG_ENTER_METHOD(); + if (share->wrapper_mode) + { + wrapper_free_foreign_key_create_info(str); + } else { + storage_free_foreign_key_create_info(str); + } + DBUG_VOID_RETURN; +} + +bool ha_mroonga::check_written_by_row_based_binlog() +{ + MRN_DBUG_ENTER_METHOD(); + THD *thd = ha_thd(); + + int current_stmt_binlog_row; +#ifdef MRN_ROW_BASED_CHECK_IS_METHOD + current_stmt_binlog_row = thd->is_current_stmt_binlog_format_row(); +#else + current_stmt_binlog_row = thd->current_stmt_binlog_row_based; +#endif + if (!current_stmt_binlog_row) { + DBUG_RETURN(false); + } + + if (table->s->tmp_table != NO_TMP_TABLE) { + DBUG_RETURN(false); + } + + if (!mrn_binlog_filter->db_ok(table->s->db.str)) { + DBUG_RETURN(false); + } + + if (!thd_test_options(thd, OPTION_BIN_LOG)) { + DBUG_RETURN(false); + } + + if (!mysql_bin_log.is_open()) { + DBUG_RETURN(false); + } + + DBUG_RETURN(true); +} + +#ifdef MRN_HAVE_HA_REBIND_PSI +void ha_mroonga::wrapper_unbind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->unbind_psi(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_unbind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::unbind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + handler::unbind_psi(); + if (share->wrapper_mode) + { + wrapper_unbind_psi(); + } else { + storage_unbind_psi(); + } + DBUG_VOID_RETURN; +} + +void ha_mroonga::wrapper_rebind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + wrap_handler->rebind_psi(); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_VOID_RETURN; +} + +void ha_mroonga::storage_rebind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + DBUG_VOID_RETURN; +} + +void ha_mroonga::rebind_psi() +{ + MRN_DBUG_ENTER_METHOD(); + handler::rebind_psi(); + if (share->wrapper_mode) + { + wrapper_rebind_psi(); + } else { + storage_rebind_psi(); + } + DBUG_VOID_RETURN; +} +#endif + +my_bool ha_mroonga::wrapper_register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) +{ + MRN_DBUG_ENTER_METHOD(); + my_bool res; + MRN_SET_WRAP_SHARE_KEY(share, table->s); + MRN_SET_WRAP_TABLE_KEY(this, table); + res = wrap_handler->register_query_cache_table(thd, + table_key, + key_length, + engine_callback, + engine_data); + MRN_SET_BASE_SHARE_KEY(share, table->s); + MRN_SET_BASE_TABLE_KEY(this, table); + DBUG_RETURN(res); +} + +my_bool ha_mroonga::storage_register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) +{ + MRN_DBUG_ENTER_METHOD(); + my_bool res = handler::register_query_cache_table(thd, + table_key, + key_length, + engine_callback, + engine_data); + DBUG_RETURN(res); +} + +my_bool ha_mroonga::register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) +{ + MRN_DBUG_ENTER_METHOD(); + my_bool res; + if (share->wrapper_mode) + { + res = wrapper_register_query_cache_table(thd, + table_key, + key_length, + engine_callback, + engine_data); + } else { + res = storage_register_query_cache_table(thd, + table_key, + key_length, + engine_callback, + engine_data); + } + DBUG_RETURN(res); +} + +#ifdef __cplusplus +} +#endif diff --git a/storage/mroonga/ha_mroonga.def b/storage/mroonga/ha_mroonga.def new file mode 100644 index 00000000000..5770cde72e7 --- /dev/null +++ b/storage/mroonga/ha_mroonga.def @@ -0,0 +1,15 @@ +LIBRARY ha_mroonga +VERSION 1.0 +EXPORTS + last_insert_grn_id + last_insert_grn_id_init + last_insert_grn_id_deinit + mroonga_snippet + mroonga_snippet_init + mroonga_snippet_deinit + mroonga_command + mroonga_command_init + mroonga_command_deinit + mroonga_escape + mroonga_escape_init + mroonga_escape_deinit diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp new file mode 100644 index 00000000000..0aec57c87ae --- /dev/null +++ b/storage/mroonga/ha_mroonga.hpp @@ -0,0 +1,1190 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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 HA_MROONGA_HPP_ +#define HA_MROONGA_HPP_ + +#ifdef USE_PRAGMA_INTERFACE +#pragma interface +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "mrn_sys.hpp" +#include "mrn_mysql_compat.h" + +#if (MYSQL_VERSION_ID >= 50603) || \ + (MYSQL_VERSION_ID >= 50513 && MYSQL_VERSION_ID < 50600) || \ + (MYSQL_VERSION_ID >= 50158 && MYSQL_VERSION_ID < 50500) +# define MRN_HANDLER_CLONE_NEED_NAME 1 +#endif + +#if (MYSQL_VERSION_ID >= 50514 && MYSQL_VERSION_ID < 50600) +# define MRN_HANDLER_HAVE_FINAL_ADD_INDEX 1 +#endif + +#if (MYSQL_VERSION_ID >= 50603) || \ + (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50209) +# define MRN_HANDLER_HAVE_HA_RND_NEXT 1 +# define MRN_HANDLER_HAVE_HA_RND_POS 1 +# define MRN_HANDLER_HAVE_HA_INDEX_READ_MAP 1 +# define MRN_HANDLER_HAVE_HA_INDEX_READ_IDX_MAP 1 +# define MRN_HANDLER_HAVE_HA_INDEX_NEXT 1 +# define MRN_HANDLER_HAVE_HA_INDEX_PREV 1 +# define MRN_HANDLER_HAVE_HA_INDEX_FIRST 1 +# define MRN_HANDLER_HAVE_HA_INDEX_LAST 1 +# define MRN_HANDLER_HAVE_HA_INDEX_NEXT_SAME 1 +#endif + +#if (MYSQL_VERSION_ID >= 50604) || \ + (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50302) +# define MRN_HANDLER_HAVE_HA_CLOSE 1 +# define MRN_HANDLER_HAVE_MULTI_RANGE_READ 1 +#endif + +#if (MYSQL_VERSION_ID >= 50607) +# define MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER 1 +# define MRN_HANDLER_HAVE_HA_PREPARE_INPLACE_ALTER_TABLE 1 +# define MRN_HANDLER_HAVE_HA_INPLACE_ALTER_TABLE 1 +# define MRN_HANDLER_HAVE_HA_COMMIT_INPLACE_ALTER_TABLE 1 +# define MRN_SUPPORT_FOREIGN_KEYS 1 +#endif + +#ifndef MRN_MARIADB_P +# define MRN_HANDLER_HAVE_INDEX_READ_LAST_MAP +# if MYSQL_VERSION_ID >= 50611 +# define MRN_HANDLER_HAVE_HA_INDEX_READ_LAST_MAP +# endif +#endif + +#if (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50302) +# define MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS +#endif + +#if MYSQL_VERSION_ID >= 50500 +# define MRN_HANDLER_HAVE_TRUNCATE +# define MRN_HANDLER_HAVE_GET_PARENT_FOREIGN_KEY_LIST +#endif + +#if MYSQL_VERSION_ID < 50600 +# define MRN_HANDLER_HAVE_GET_TABLESPACE_NAME +#endif + +#if MYSQL_VERSION_ID >= 50607 +# define MRN_HANDLER_HAVE_SET_HA_SHARE_REF +#endif + +#if MYSQL_VERSION_ID >= 50500 +# define MRN_TABLE_LIST_INIT_REQUIRE_ALIAS +#endif + +#ifdef BIG_TABLES +# define MRN_HA_ROWS_FORMAT "llu" +#else +# define MRN_HA_ROWS_FORMAT "lu" +#endif + +#if (MYSQL_VERSION_ID < 50519) || \ + defined(MRN_MARIADB_P) || \ + (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID < 50604) +# define MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR +#endif + +#if MYSQL_VERSION_ID >= 50500 +# define MRN_HAVE_HA_EXTRA_ADD_CHILDREN_LIST +# define MRN_HAVE_HA_EXTRA_IS_ATTACHED_CHILDREN +#endif + +#ifdef MRN_MARIADB_P +# define MRN_HAVE_HA_EXTRA_DETACH_CHILD +# define MRN_HAVE_HA_EXTRA_PREPARE_FOR_FORCED_CLOSE +#endif + +#if MYSQL_VERSION_ID >= 50607 && \ + (!defined(MRN_MARIADB_P) || MYSQL_VERSION_ID < 100008) +# define MRN_HAVE_HA_EXTRA_EXPORT +#endif + +#if MYSQL_VERSION_ID >= 50617 && !defined(MRN_MARIADB_P) +# define MRN_HAVE_HA_EXTRA_SECONDARY_SORT_ROWID +#endif + +#if MYSQL_VERSION_ID >= 50604 && !defined(MRN_MARIADB_P) +# define MRN_TIMESTAMP_USE_TIMEVAL +#elif defined(MRN_MARIADB_P) +# define MRN_TIMESTAMP_USE_MY_TIME_T +#else +# define MRN_TIMESTAMP_USE_LONG +#endif + +#if MYSQL_VERSION_ID < 50600 && !defined(MRN_MARIADB_P) +# define MRN_FIELD_STORE_TIME_NEED_TYPE +#endif + +#if MYSQL_VERSION_ID < 50500 +# define MRN_HAVE_TL_WRITE_ALLOW_READ +#endif + +#if (defined(MRN_MARIADB_P) && \ + ((MYSQL_VERSION_ID >= 50306 && MYSQL_VERSION_ID < 50500) || \ + MYSQL_VERSION_ID >= 50523)) +# define MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR +#endif + +#if MYSQL_VERSION_ID >= 50604 +# define MRN_JOIN_TAB_HAVE_CONDITION +#endif + +#if MYSQL_VERSION_ID < 50600 +# define MRN_RBR_UPDATE_NEED_ALL_COLUMNS +#endif + +#if MYSQL_VERSION_ID >= 50500 +# define MRN_ROW_BASED_CHECK_IS_METHOD +#endif + +#if MYSQL_VERSION_ID >= 50600 +# define MRN_HAVE_HA_REBIND_PSI +#endif + +#if MYSQL_VERSION_ID >= 50612 && !defined(MRN_MARIADB_P) +# define MRN_HAVE_POINT_XY +#endif + +#if (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100000) +# define MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS +#endif + +#if (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100010) +# define MRN_HAVE_TDC_LOCK_TABLE_SHARE +#endif + +class ha_mroonga; + +/* structs */ +struct st_mrn_ft_info +{ + struct _ft_vft *please; +#ifdef HA_CAN_FULLTEXT_EXT + struct _ft_vft_ext *could_you; +#endif + grn_ctx *ctx; + grn_encoding encoding; + grn_obj *table; + grn_obj *result; + grn_obj *score_column; + grn_obj key; + grn_obj score; + uint active_index; + KEY *key_info; + KEY *primary_key_info; + grn_obj *cursor; + grn_obj *id_accessor; + grn_obj *key_accessor; + ha_mroonga *mroonga; +}; + +/* handler class */ +class ha_mroonga: public handler +{ +public: + handler *wrap_handler; + bool is_clone; + ha_mroonga *parent_for_clone; + MEM_ROOT *mem_root_for_clone; + grn_obj key_buffer; + grn_id record_id; + grn_id *key_id; + grn_id *del_key_id; + MY_BITMAP multiple_column_key_bitmap; + +private: + THR_LOCK_DATA thr_lock_data; + + // for wrapper mode (TODO: need to be confirmed) + uint wrap_ft_init_count; + MRN_SHARE *share; + KEY *wrap_key_info; + KEY *base_key_info; + key_part_map pk_keypart_map; + MEM_ROOT mem_root; + /// for create table and alter table + mutable bool analyzed_for_create; + mutable TABLE table_for_create; + mutable MRN_SHARE share_for_create; + mutable TABLE_SHARE table_share_for_create; + mutable MEM_ROOT mem_root_for_create; + mutable handler *wrap_handler_for_create; +#ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + handler_add_index *hnd_add_index; +#endif +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + Alter_inplace_info::HA_ALTER_FLAGS alter_handler_flags; + KEY *alter_key_info_buffer; + uint alter_key_count; + uint alter_index_drop_count; + KEY *alter_index_drop_buffer; + uint alter_index_add_count; + uint *alter_index_add_buffer; + TABLE *wrap_altered_table; + KEY *wrap_altered_table_key_info; + TABLE_SHARE *wrap_altered_table_share; + KEY *wrap_altered_table_share_key_info; +#else + KEY *wrap_alter_key_info; +#endif + int mrn_lock_type; + + // for groonga objects + grn_ctx ctx_entity_; + grn_ctx *ctx; + grn_obj *grn_table; + grn_obj **grn_columns; + grn_obj **grn_column_ranges; + grn_obj **grn_index_tables; + grn_obj **grn_index_columns; + bool grn_table_is_referenced; + + // buffers + grn_obj encoded_key_buffer; + grn_obj old_value_buffer; + grn_obj new_value_buffer; + grn_obj top_left_point; + grn_obj bottom_right_point; + grn_obj source_point; + double top_left_longitude_in_degree; + double bottom_right_longitude_in_degree; + double bottom_right_latitude_in_degree; + double top_left_latitude_in_degree; + + // for search + grn_obj *grn_source_column_geo; + grn_obj *cursor_geo; + grn_table_cursor *cursor; + grn_table_cursor *index_table_cursor; + grn_obj *empty_value_records; + grn_table_cursor *empty_value_records_cursor; + grn_obj *sorted_result; + grn_obj *matched_record_keys; + String *blob_buffers; + + // for error report + uint dup_key; + + // for optimization + bool count_skip; + bool fast_order_limit; + bool fast_order_limit_with_index; + + // for context + bool ignoring_duplicated_key; + bool inserting_with_update; + bool fulltext_searching; + bool ignoring_no_key_columns; + bool replacing_; + uint written_by_row_based_binlog; + + // for ft in where clause test + Item_func_match *current_ft_item; + +public: + ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg); + ~ha_mroonga(); + const char *table_type() const; // required + const char *index_type(uint inx); + const char **bas_ext() const; // required + + 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 +#ifndef MRN_HANDLER_HAVE_HA_CLOSE + int close(); // required +#endif + int info(uint flag); // required + + uint lock_count() const; + THR_LOCK_DATA **store_lock(THD *thd, // required + THR_LOCK_DATA **to, + enum thr_lock_type lock_type); + int external_lock(THD *thd, int lock_type); + + int rnd_init(bool scan); // required + int rnd_end(); +#ifndef MRN_HANDLER_HAVE_HA_RND_NEXT + int rnd_next(uchar *buf); // required +#endif +#ifndef MRN_HANDLER_HAVE_HA_RND_POS + int rnd_pos(uchar *buf, uchar *pos); // required +#endif + void position(const uchar *record); // required + int extra(enum ha_extra_function operation); + int extra_opt(enum ha_extra_function operation, ulong cache_size); + + int delete_table(const char *name); + int write_row(uchar *buf); + int update_row(const uchar *old_data, uchar *new_data); + int delete_row(const uchar *buf); + + uint max_supported_record_length() const; + uint max_supported_keys() const; + uint max_supported_key_parts(); + uint max_supported_key_length() const; + uint max_supported_key_part_length() const; + + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); + int index_init(uint idx, bool sorted); + int index_end(); +#ifndef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP + int index_read_map(uchar * buf, const uchar * key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); +#endif +#ifdef MRN_HANDLER_HAVE_INDEX_READ_LAST_MAP + int index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map); +#endif +#ifndef MRN_HANDLER_HAVE_HA_INDEX_NEXT + int index_next(uchar *buf); +#endif +#ifndef MRN_HANDLER_HAVE_HA_INDEX_PREV + int index_prev(uchar *buf); +#endif +#ifndef MRN_HANDLER_HAVE_HA_INDEX_FIRST + int index_first(uchar *buf); +#endif +#ifndef MRN_HANDLER_HAVE_HA_INDEX_LAST + int index_last(uchar *buf); +#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); + + const Item *cond_push(const Item *cond); + void cond_pop(); + + bool get_error_message(int error, String *buf); + + int reset(); + +#ifdef MRN_HANDLER_CLONE_NEED_NAME + handler *clone(const char *name, MEM_ROOT *mem_root); +#else + handler *clone(MEM_ROOT *mem_root); +#endif + uint8 table_cache_type(); +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ + ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint *bufsz, + uint *flags, Cost_estimate *cost); + ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, uint *flags, Cost_estimate *cost); + int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf); + int multi_range_read_next(range_id_t *range_info); +#else // MRN_HANDLER_HAVE_MULTI_RANGE_READ + int read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer); + int read_multi_range_next(KEY_MULTI_RANGE **found_range_p); +#endif // MRN_HANDLER_HAVE_MULTI_RANGE_READ +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS + void start_bulk_insert(ha_rows rows, uint flags); +#else + void start_bulk_insert(ha_rows rows); +#endif + int end_bulk_insert(); + int delete_all_rows(); +#ifdef MRN_HANDLER_HAVE_TRUNCATE + int truncate(); +#endif // MRN_HANDLER_HAVE_TRUNCATE + double scan_time(); + double read_time(uint index, uint ranges, ha_rows rows); + const key_map *keys_to_use_for_scanning(); + ha_rows estimate_rows_upper_bound(); + void update_create_info(HA_CREATE_INFO* create_info); + int rename_table(const char *from, const char *to); + bool is_crashed() const; + bool auto_repair(int error) const; + bool auto_repair() const; + int disable_indexes(uint mode); + int enable_indexes(uint mode); + int check(THD* thd, HA_CHECK_OPT* check_opt); + int repair(THD* thd, HA_CHECK_OPT* check_opt); + bool check_and_repair(THD *thd); + int analyze(THD* thd, HA_CHECK_OPT* check_opt); + int optimize(THD* thd, HA_CHECK_OPT* check_opt); + bool is_fatal_error(int error_num, uint flags); + bool check_if_incompatible_data(HA_CREATE_INFO *create_info, + uint table_changes); +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + enum_alter_inplace_result + check_if_supported_inplace_alter(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); +#else + uint alter_table_flags(uint flags); +# ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, + handler_add_index **add); + int final_add_index(handler_add_index *add, bool commit); +# else + int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys); +# endif + int prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys); + int final_drop_index(TABLE *table_arg); +#endif + int update_auto_increment(); + void set_next_insert_id(ulonglong id); + void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, + ulonglong *first_value, ulonglong *nb_reserved_values); + void restore_auto_increment(ulonglong prev_insert_id); + void release_auto_increment(); + int check_for_upgrade(HA_CHECK_OPT *check_opt); + int reset_auto_increment(ulonglong value); + bool was_semi_consistent_read(); + void try_semi_consistent_read(bool yes); + void unlock_row(); + int start_stmt(THD *thd, thr_lock_type lock_type); + +protected: +#ifdef MRN_HANDLER_HAVE_HA_RND_NEXT + int rnd_next(uchar *buf); +#endif +#ifdef MRN_HANDLER_HAVE_HA_RND_POS + int rnd_pos(uchar *buf, uchar *pos); +#endif +#ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP + int index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); +#endif +#ifdef MRN_HANDLER_HAVE_HA_INDEX_NEXT + int index_next(uchar *buf); +#endif +#ifdef MRN_HANDLER_HAVE_HA_INDEX_PREV + int index_prev(uchar *buf); +#endif +#ifdef MRN_HANDLER_HAVE_HA_INDEX_FIRST + int index_first(uchar *buf); +#endif +#ifdef MRN_HANDLER_HAVE_HA_INDEX_LAST + int index_last(uchar *buf); +#endif + void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg); + bool primary_key_is_clustered(); + bool is_fk_defined_on_table_or_index(uint index); + char *get_foreign_key_create_info(); +#ifdef MRN_HANDLER_HAVE_GET_TABLESPACE_NAME + char *get_tablespace_name(THD *thd, char *name, uint name_len); +#endif + bool can_switch_engines(); + int get_foreign_key_list(THD *thd, List *f_key_list); +#ifdef MRN_HANDLER_HAVE_GET_PARENT_FOREIGN_KEY_LIST + int get_parent_foreign_key_list(THD *thd, List *f_key_list); +#endif + uint referenced_by_foreign_key(); + void init_table_handle_for_HANDLER(); + void free_foreign_key_create_info(char* str); +#ifdef MRN_HAVE_HA_REBIND_PSI + void unbind_psi(); + void rebind_psi(); +#endif + my_bool register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback *engine_callback, + ulonglong *engine_data); +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + bool prepare_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool commit_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit); + void notify_table_changed(); +#endif + +private: + void mkdir_p(const char *directory); + ulonglong file_size(const char *path); + + void push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag); + void clear_cursor(); + void clear_cursor_geo(); + void clear_empty_value_records(); + void clear_search_result(); + void clear_search_result_geo(); + void clear_indexes(); + int alter_share_add(const char *path, TABLE_SHARE *table_share); + void remove_related_files(const char *base_path); + void remove_grn_obj_force(const char *name); + int drop_index(MRN_SHARE *target_share, uint key_index); + grn_obj *find_tokenizer(const char *name, int name_length); + grn_obj *find_normalizer(KEY *key_info); + int wrapper_get_record(uchar *buf, const uchar *key); + int wrapper_get_next_geo_record(uchar *buf); + int storage_get_next_record(uchar *buf); + void geo_store_rectangle(const uchar *rectangle); + int generic_geo_open_cursor(const uchar *key, enum ha_rkey_function find_flag); + +#ifdef MRN_HANDLER_HAVE_HA_CLOSE + int close(); +#endif + 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); + bool is_grn_zero_column_value(grn_obj *column, grn_obj *value); + void check_fast_order_limit(grn_table_sort_key **sort_keys, int *n_sort_keys, + longlong *limit); + + long long int get_grn_time_from_timestamp_field(Field_timestamp *field); + + int generic_store_bulk_fixed_size_string(Field *field, grn_obj *buf); + int generic_store_bulk_variable_size_string(Field *field, grn_obj *buf); + int generic_store_bulk_integer(Field *field, grn_obj *buf); + int generic_store_bulk_unsigned_integer(Field *field, grn_obj *buf); + int generic_store_bulk_float(Field *field, grn_obj *buf); + int generic_store_bulk_timestamp(Field *field, grn_obj *buf); + int generic_store_bulk_date(Field *field, grn_obj *buf); + int generic_store_bulk_time(Field *field, grn_obj *buf); + int generic_store_bulk_datetime(Field *field, grn_obj *buf); + int generic_store_bulk_year(Field *field, grn_obj *buf); + int generic_store_bulk_new_date(Field *field, grn_obj *buf); +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + int generic_store_bulk_datetime2(Field *field, grn_obj *buf); +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + int generic_store_bulk_time2(Field *field, grn_obj *buf); +#endif + 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); + int generic_store_bulk(Field *field, grn_obj *buf); + + void storage_store_field_string(Field *field, + const char *value, uint value_length); + void storage_store_field_integer(Field *field, + const char *value, uint value_length); + void storage_store_field_unsigned_integer(Field *field, + const char *value, + uint value_length); + void storage_store_field_float(Field *field, + const char *value, uint value_length); + void storage_store_field_timestamp(Field *field, + const char *value, uint value_length); + void storage_store_field_date(Field *field, + const char *value, uint value_length); + void storage_store_field_time(Field *field, + const char *value, uint value_length); + void storage_store_field_datetime(Field *field, + const char *value, uint value_length); + void storage_store_field_year(Field *field, + const char *value, uint value_length); + void storage_store_field_new_date(Field *field, + const char *value, uint value_length); +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + void storage_store_field_datetime2(Field *field, + const char *value, uint value_length); +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + void storage_store_field_time2(Field *field, + const char *value, uint value_length); +#endif + void storage_store_field_blob(Field *field, + const char *value, uint value_length); + void storage_store_field_geometry(Field *field, + const char *value, uint value_length); + void storage_store_field(Field *field, const char *value, uint value_length); + void storage_store_fields(uchar *buf, grn_id record_id); + void storage_store_fields_for_prep_update(const uchar *old_data, + uchar *new_data, + grn_id record_id); + void storage_store_fields_by_index(uchar *buf); + + int storage_encode_key_normalize_min_sort_chars(Field *field, + uchar *buf, + uint size); + int storage_encode_key_fixed_size_string(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_variable_size_string(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_timestamp(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_time(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_year(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_datetime(Field *field, const uchar *key, + uchar *buf, uint *size); +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + int storage_encode_key_timestamp2(Field *field, const uchar *key, + uchar *buf, uint *size); +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + int storage_encode_key_datetime2(Field *field, const uchar *key, + uchar *buf, uint *size); +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + int storage_encode_key_time2(Field *field, const uchar *key, + uchar *buf, uint *size); +#endif + int storage_encode_key_enum(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key_set(Field *field, const uchar *key, + uchar *buf, uint *size); + int storage_encode_key(Field *field, const uchar *key, uchar *buf, uint *size); + 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 key_range *start, + const key_range *end, + uchar *min_buffer, + uint *min_encoded_size, + uchar *max_buffer, + uint *max_encoded_size); + + void set_pk_bitmap(); + int create_share_for_create() const; + int wrapper_create(const char *name, TABLE *table, + HA_CREATE_INFO *info, MRN_SHARE *tmp_share); + int storage_create(const char *name, TABLE *table, + HA_CREATE_INFO *info, MRN_SHARE *tmp_share); + int wrapper_create_index_fulltext_validate(KEY *key_info); + int wrapper_create_index_fulltext(const char *grn_table_name, + int i, + KEY *key_info, + grn_obj **index_tables, + grn_obj **index_columns, + MRN_SHARE *tmp_share); + int wrapper_create_index_geo(const char *grn_table_name, + int i, + KEY *key_info, + 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 storage_create_validate_pseudo_column(TABLE *table); +#ifdef MRN_SUPPORT_FOREIGN_KEYS + bool storage_create_foreign_key(TABLE *table, const char *grn_table_name, + Field *field, grn_obj *table_obj, int &error); +#endif + int storage_create_validate_index(TABLE *table); + int storage_create_index_table(TABLE *table, const char *grn_table_name, + grn_obj *grn_table, MRN_SHARE *tmp_share, + KEY *key_info, grn_obj **index_tables, + uint i); + int storage_create_index(TABLE *table, const char *grn_table_name, + grn_obj *grn_table, MRN_SHARE *tmp_share, + KEY *key_info, grn_obj **index_tables, + grn_obj **index_columns, uint i); + int storage_create_indexes(TABLE *table, const char *grn_table_name, + grn_obj *grn_table, MRN_SHARE *tmp_share); + int close_databases(); + void ensure_database_directory(); + int ensure_normalizers_register(); + int ensure_database_create(const char *name); + int ensure_database_open(const char *name); + int ensure_database_remove(const char *name); + int wrapper_delete_table(const char *name, MRN_SHARE *tmp_share, + const char *table_name); + int wrapper_delete_index(const char *name, MRN_SHARE *tmp_share, + const char *table_name); + int storage_delete_table(const char *name, MRN_SHARE *tmp_share, + const char *table_name); + int wrapper_open(const char *name, int mode, uint test_if_locked); + int wrapper_open_indexes(const char *name); + int storage_open(const char *name, int mode, uint test_if_locked); + void update_grn_table_is_referenced(); + int open_table(const char *name); + int storage_open_columns(void); + int storage_open_indexes(const char *name); + void wrapper_overwrite_index_bits(); + int wrapper_close(); + int storage_close(); + int generic_extra(enum ha_extra_function operation); + int wrapper_extra(enum ha_extra_function operation); + int storage_extra(enum ha_extra_function operation); + int wrapper_extra_opt(enum ha_extra_function operation, ulong cache_size); + int storage_extra_opt(enum ha_extra_function operation, ulong cache_size); + int generic_reset(); + int wrapper_reset(); + int storage_reset(); + uint wrapper_lock_count() const; + uint storage_lock_count() const; + THR_LOCK_DATA **wrapper_store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); + THR_LOCK_DATA **storage_store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); + int wrapper_external_lock(THD *thd, int lock_type); + int storage_external_lock(THD *thd, int lock_type); +#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS + void wrapper_start_bulk_insert(ha_rows rows, uint flags); + void storage_start_bulk_insert(ha_rows rows, uint flags); +#else + void wrapper_start_bulk_insert(ha_rows rows); + void storage_start_bulk_insert(ha_rows rows); +#endif + int wrapper_end_bulk_insert(); + int storage_end_bulk_insert(); + bool wrapper_is_target_index(KEY *key_info); + bool wrapper_have_target_index(); + int wrapper_write_row(uchar *buf); + int wrapper_write_row_index(uchar *buf); + int storage_write_row(uchar *buf); + int storage_write_row_multiple_column_index(uchar *buf, + grn_id record_id, + KEY *key_info, + grn_obj *index_column); + int storage_write_row_multiple_column_indexes(uchar *buf, grn_id record_id); + int storage_write_row_unique_index(uchar *buf, + KEY *key_info, grn_obj *index_table, + grn_id *key_id); + int storage_write_row_unique_indexes(uchar *buf); + int wrapper_get_record_id(uchar *data, grn_id *record_id, const char *context); + int wrapper_update_row(const uchar *old_data, uchar *new_data); + int wrapper_update_row_index(const uchar *old_data, uchar *new_data); + int storage_update_row(const uchar *old_data, uchar *new_data); + int storage_update_row_index(const uchar *old_data, uchar *new_data); + int storage_update_row_unique_indexes(uchar *new_data); + int wrapper_delete_row(const uchar *buf); + int wrapper_delete_row_index(const uchar *buf); + int storage_delete_row(const uchar *buf); + int storage_delete_row_index(const uchar *buf); + int storage_delete_row_unique_index(grn_obj *index_table, grn_id del_key_id); + int storage_delete_row_unique_indexes(); + int storage_prepare_delete_row_unique_index(const uchar *buf, + grn_id record_id, + KEY *key_info, + grn_obj *index_table, + grn_obj *index_column, + grn_id *del_key_id); + int storage_prepare_delete_row_unique_indexes(const uchar *buf, + grn_id record_id); + uint wrapper_max_supported_record_length() const; + uint storage_max_supported_record_length() const; + uint wrapper_max_supported_keys() const; + uint storage_max_supported_keys() const; + uint wrapper_max_supported_key_parts(); + uint storage_max_supported_key_parts(); + uint wrapper_max_supported_key_length() const; + uint storage_max_supported_key_length() const; + uint wrapper_max_supported_key_part_length() const; + uint storage_max_supported_key_part_length() const; + ulonglong wrapper_table_flags() const; + ulonglong storage_table_flags() const; + ulong wrapper_index_flags(uint idx, uint part, bool all_parts) const; + ulong storage_index_flags(uint idx, uint part, bool all_parts) const; + int wrapper_info(uint flag); + int storage_info(uint flag); + void storage_info_variable(); + void storage_info_variable_records(); + void storage_info_variable_data_file_length(); + int wrapper_rnd_init(bool scan); + int storage_rnd_init(bool scan); + int wrapper_rnd_end(); + int storage_rnd_end(); + int wrapper_rnd_next(uchar *buf); + int storage_rnd_next(uchar *buf); + int wrapper_rnd_pos(uchar *buf, uchar *pos); + int storage_rnd_pos(uchar *buf, uchar *pos); + void wrapper_position(const uchar *record); + void storage_position(const uchar *record); + ha_rows wrapper_records_in_range(uint key_nr, key_range *range_min, + key_range *range_max); + ha_rows storage_records_in_range(uint key_nr, key_range *range_min, + key_range *range_max); + ha_rows generic_records_in_range_geo(uint key_nr, key_range *range_min, + key_range *range_max); + int wrapper_index_init(uint idx, bool sorted); + int storage_index_init(uint idx, bool sorted); + int wrapper_index_end(); + int storage_index_end(); + int wrapper_index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); + int storage_index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); +#ifdef MRN_HANDLER_HAVE_INDEX_READ_LAST_MAP + int wrapper_index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map); + int storage_index_read_last_map(uchar *buf, const uchar *key, + key_part_map keypart_map); +#endif + int wrapper_index_next(uchar *buf); + int storage_index_next(uchar *buf); + int wrapper_index_prev(uchar *buf); + int storage_index_prev(uchar *buf); + int wrapper_index_first(uchar *buf); + int storage_index_first(uchar *buf); + int wrapper_index_last(uchar *buf); + 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(); + FT_INFO *wrapper_ft_init_ext(uint flags, uint key_nr, String *key); + 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_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_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); + struct st_mrn_ft_info *generic_ft_init_ext_select(uint flags, + uint key_nr, + String *key); + FT_INFO *generic_ft_init_ext(uint flags, uint key_nr, String *key); + int wrapper_ft_read(uchar *buf); + int storage_ft_read(uchar *buf); + const Item *wrapper_cond_push(const Item *cond); + const Item *storage_cond_push(const Item *cond); + void wrapper_cond_pop(); + void storage_cond_pop(); + bool wrapper_get_error_message(int error, String *buf); + bool storage_get_error_message(int error, String *buf); +#ifdef MRN_HANDLER_CLONE_NEED_NAME + handler *wrapper_clone(const char *name, MEM_ROOT *mem_root); + handler *storage_clone(const char *name, MEM_ROOT *mem_root); +#else + handler *wrapper_clone(MEM_ROOT *mem_root); + handler *storage_clone(MEM_ROOT *mem_root); +#endif + uint8 wrapper_table_cache_type(); + uint8 storage_table_cache_type(); +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ + ha_rows wrapper_multi_range_read_info_const(uint keyno, + RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, + uint *bufsz, + uint *flags, + Cost_estimate *cost); + ha_rows storage_multi_range_read_info_const(uint keyno, + RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, + uint *bufsz, + uint *flags, + Cost_estimate *cost); + ha_rows wrapper_multi_range_read_info(uint keyno, uint n_ranges, uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, uint *flags, + Cost_estimate *cost); + ha_rows storage_multi_range_read_info(uint keyno, uint n_ranges, uint keys, +#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS + uint key_parts, +#endif + uint *bufsz, uint *flags, + Cost_estimate *cost); + int wrapper_multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf); + int storage_multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, + HANDLER_BUFFER *buf); + int wrapper_multi_range_read_next(range_id_t *range_info); + int storage_multi_range_read_next(range_id_t *range_info); +#else // MRN_HANDLER_HAVE_MULTI_RANGE_READ + int wrapper_read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer); + int storage_read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, + uint range_count, + bool sorted, + HANDLER_BUFFER *buffer); + int wrapper_read_multi_range_next(KEY_MULTI_RANGE **found_range_p); + int storage_read_multi_range_next(KEY_MULTI_RANGE **found_range_p); +#endif // MRN_HANDLER_HAVE_MULTI_RANGE_READ + int generic_delete_all_rows(grn_obj *target_grn_table, + const char *function_name); + int wrapper_delete_all_rows(); + int storage_delete_all_rows(); +#ifdef MRN_HANDLER_HAVE_TRUNCATE + int wrapper_truncate(); +#endif // MRN_HANDLER_HAVE_TRUNCATE + int wrapper_truncate_index(); + int storage_truncate(); + int storage_truncate_index(); + double wrapper_scan_time(); + 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); + const key_map *wrapper_keys_to_use_for_scanning(); + const key_map *storage_keys_to_use_for_scanning(); + ha_rows wrapper_estimate_rows_upper_bound(); + ha_rows storage_estimate_rows_upper_bound(); + void wrapper_update_create_info(HA_CREATE_INFO* create_info); + void storage_update_create_info(HA_CREATE_INFO* create_info); + int wrapper_rename_table(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name); + int wrapper_rename_index(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name); + int storage_rename_table(const char *from, const char *to, + MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name); +#ifdef MRN_SUPPORT_FOREIGN_KEYS + int storage_rename_foreign_key(MRN_SHARE *tmp_share, + const char *from_table_name, + const char *to_table_name); +#endif + bool wrapper_is_crashed() const; + bool storage_is_crashed() const; + bool wrapper_auto_repair(int error) const; + bool storage_auto_repair(int error) const; + int wrapper_disable_indexes(uint mode); + int storage_disable_indexes(uint mode); + int wrapper_enable_indexes(uint mode); + int storage_enable_indexes(uint mode); + int wrapper_check(THD* thd, HA_CHECK_OPT* check_opt); + int storage_check(THD* thd, HA_CHECK_OPT* check_opt); + int wrapper_fill_indexes(THD *thd, KEY *key_info, + grn_obj **index_columns, uint n_keys); + int wrapper_recreate_indexes(THD *thd); + int wrapper_repair(THD* thd, HA_CHECK_OPT* check_opt); + int storage_repair(THD* thd, HA_CHECK_OPT* check_opt); + bool wrapper_check_and_repair(THD *thd); + bool storage_check_and_repair(THD *thd); + int wrapper_analyze(THD* thd, HA_CHECK_OPT* check_opt); + int storage_analyze(THD* thd, HA_CHECK_OPT* check_opt); + int wrapper_optimize(THD* thd, HA_CHECK_OPT* check_opt); + int storage_optimize(THD* thd, HA_CHECK_OPT* check_opt); + bool wrapper_is_fatal_error(int error_num, uint flags); + bool storage_is_fatal_error(int error_num, uint flags); + bool wrapper_is_comment_changed(TABLE *table1, TABLE *table2); + bool wrapper_check_if_incompatible_data(HA_CREATE_INFO *create_info, + uint table_changes); + bool storage_check_if_incompatible_data(HA_CREATE_INFO *create_info, + uint table_changes); + int storage_add_index_multiple_columns(KEY *key_info, uint num_of_keys, + grn_obj **index_tables, + grn_obj **index_columns, + bool skip_unique_key); +#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER + enum_alter_inplace_result + wrapper_check_if_supported_inplace_alter(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + enum_alter_inplace_result + storage_check_if_supported_inplace_alter(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool wrapper_prepare_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool storage_prepare_inplace_alter_table(TABLE *altered_table, + 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_column(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool storage_inplace_alter_table_drop_column(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool storage_inplace_alter_table_rename_column(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool storage_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info); + bool wrapper_commit_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit); + bool storage_commit_inplace_alter_table(TABLE *altered_table, + Alter_inplace_info *ha_alter_info, + bool commit); + void wrapper_notify_table_changed(); + void storage_notify_table_changed(); +#else + uint wrapper_alter_table_flags(uint flags); + uint storage_alter_table_flags(uint flags); +# ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + int wrapper_add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, + handler_add_index **add); + int storage_add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys, + handler_add_index **add); +# else + int wrapper_add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys); + int storage_add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys); +# endif +# ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX + int wrapper_final_add_index(handler_add_index *add, bool commit); + int storage_final_add_index(handler_add_index *add, bool commit); +# endif + int wrapper_prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys); + int storage_prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys); + int wrapper_final_drop_index(TABLE *table_arg); + int storage_final_drop_index(TABLE *table_arg); +#endif + int wrapper_update_auto_increment(); + int storage_update_auto_increment(); + void wrapper_set_next_insert_id(ulonglong id); + void storage_set_next_insert_id(ulonglong id); + void wrapper_get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values); + void storage_get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values); + void wrapper_restore_auto_increment(ulonglong prev_insert_id); + void storage_restore_auto_increment(ulonglong prev_insert_id); + void wrapper_release_auto_increment(); + void storage_release_auto_increment(); + int wrapper_check_for_upgrade(HA_CHECK_OPT *check_opt); + int storage_check_for_upgrade(HA_CHECK_OPT *check_opt); + int wrapper_reset_auto_increment(ulonglong value); + int storage_reset_auto_increment(ulonglong value); + bool wrapper_was_semi_consistent_read(); + bool storage_was_semi_consistent_read(); + void wrapper_try_semi_consistent_read(bool yes); + void storage_try_semi_consistent_read(bool yes); + void wrapper_unlock_row(); + void storage_unlock_row(); + int wrapper_start_stmt(THD *thd, thr_lock_type lock_type); + int storage_start_stmt(THD *thd, thr_lock_type lock_type); + void wrapper_change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg); + void storage_change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg); + bool wrapper_primary_key_is_clustered(); + bool storage_primary_key_is_clustered(); + bool wrapper_is_fk_defined_on_table_or_index(uint index); + bool storage_is_fk_defined_on_table_or_index(uint index); + char *wrapper_get_foreign_key_create_info(); + char *storage_get_foreign_key_create_info(); +#ifdef MRN_HANDLER_HAVE_GET_TABLESPACE_NAME + char *wrapper_get_tablespace_name(THD *thd, char *name, uint name_len); + char *storage_get_tablespace_name(THD *thd, char *name, uint name_len); +#endif + bool wrapper_can_switch_engines(); + bool storage_can_switch_engines(); + int wrapper_get_foreign_key_list(THD *thd, List *f_key_list); + int storage_get_foreign_key_list(THD *thd, List *f_key_list); +#ifdef MRN_HANDLER_HAVE_GET_PARENT_FOREIGN_KEY_LIST + int wrapper_get_parent_foreign_key_list(THD *thd, List *f_key_list); + int storage_get_parent_foreign_key_list(THD *thd, List *f_key_list); +#endif + uint wrapper_referenced_by_foreign_key(); + uint storage_referenced_by_foreign_key(); + void wrapper_init_table_handle_for_HANDLER(); + void storage_init_table_handle_for_HANDLER(); + void wrapper_free_foreign_key_create_info(char* str); + void storage_free_foreign_key_create_info(char* str); + void wrapper_set_keys_in_use(); + void storage_set_keys_in_use(); + bool check_written_by_row_based_binlog(); +#ifdef MRN_HAVE_HA_REBIND_PSI + void wrapper_unbind_psi(); + void storage_unbind_psi(); + void wrapper_rebind_psi(); + void storage_rebind_psi(); +#endif + my_bool wrapper_register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data); + my_bool storage_register_query_cache_table(THD *thd, + char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data); +}; + +#ifdef __cplusplus +} +#endif + +#endif /* HA_MROONGA_HPP_ */ diff --git a/storage/mroonga/lib/Makefile.am b/storage/mroonga/lib/Makefile.am new file mode 100644 index 00000000000..300131db70a --- /dev/null +++ b/storage/mroonga/lib/Makefile.am @@ -0,0 +1,23 @@ +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + $(MYSQL_INCLUDES) \ + $(GROONGA_CFLAGS) \ + $(MYSQL_VERSION_CFLAGS) + +libmrn_need_mysql_la_CXXFLAGS = $(AM_CXXFLAGS) $(MYSQL_CFLAGS) + +if WITH_LIBMYSQLSERVICES_COMPAT +LIBMYSQLSERVICES_COMPAT = libmysqlservices.la +endif + +noinst_LTLIBRARIES = \ + $(LIBMYSQLSERVICES_COMPAT) \ + libmrn_no_mysql.la \ + libmrn_need_mysql.la + +include libmrn_no_mysql_sources.am +include libmrn_need_mysql_sources.am +if WITH_LIBMYSQLSERVICES_COMPAT +include libmysqlservices_compat_sources.am +endif diff --git a/storage/mroonga/lib/libmrn_need_mysql_sources.am b/storage/mroonga/lib/libmrn_need_mysql_sources.am new file mode 100644 index 00000000000..9dca2b6fb04 --- /dev/null +++ b/storage/mroonga/lib/libmrn_need_mysql_sources.am @@ -0,0 +1,25 @@ +libmrn_need_mysql_la_SOURCES = \ + mrn_index_table_name.cpp \ + mrn_index_table_name.hpp \ + mrn_index_column_name.cpp \ + mrn_index_column_name.hpp \ + mrn_debug_column_access.cpp \ + mrn_debug_column_access.hpp \ + mrn_auto_increment_value_lock.cpp \ + mrn_auto_increment_value_lock.hpp \ + mrn_external_lock.cpp \ + mrn_external_lock.hpp \ + mrn_multiple_column_key_codec.cpp \ + mrn_multiple_column_key_codec.hpp \ + mrn_field_normalizer.cpp \ + mrn_field_normalizer.hpp \ + mrn_encoding.cpp \ + mrn_encoding.hpp \ + mrn_parameters_parser.cpp \ + mrn_parameters_parser.hpp \ + mrn_lock.cpp \ + mrn_lock.hpp \ + mrn_condition_converter.cpp \ + mrn_condition_converter.hpp \ + mrn_time_converter.cpp \ + mrn_time_converter.hpp diff --git a/storage/mroonga/lib/libmrn_no_mysql_sources.am b/storage/mroonga/lib/libmrn_no_mysql_sources.am new file mode 100644 index 00000000000..89cfb277595 --- /dev/null +++ b/storage/mroonga/lib/libmrn_no_mysql_sources.am @@ -0,0 +1,8 @@ +libmrn_no_mysql_la_SOURCES = \ + mrn_match_escalation_threshold_scope.cpp \ + mrn_match_escalation_threshold_scope.hpp \ + mrn_path_mapper.cpp \ + mrn_path_mapper.hpp \ + mrn_windows.hpp \ + mrn_smart_grn_obj.cpp \ + mrn_smart_grn_obj.hpp diff --git a/storage/mroonga/lib/libmysqlservices_compat_sources.am b/storage/mroonga/lib/libmysqlservices_compat_sources.am new file mode 100644 index 00000000000..bb0712a4add --- /dev/null +++ b/storage/mroonga/lib/libmysqlservices_compat_sources.am @@ -0,0 +1,2 @@ +libmysqlservices_la_SOURCES = \ + mrn_mysqlservices.cpp diff --git a/storage/mroonga/lib/mrn_auto_increment_value_lock.cpp b/storage/mroonga/lib/mrn_auto_increment_value_lock.cpp new file mode 100644 index 00000000000..3bac5e31c6c --- /dev/null +++ b/storage/mroonga/lib/mrn_auto_increment_value_lock.cpp @@ -0,0 +1,42 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_auto_increment_value_lock.hpp" + +#if MYSQL_VERSION_ID >= 50500 +# define AUTO_INCREMENT_VALUE_MUTEX(table_share) (&(table_share->LOCK_ha_data)) +#else +# define AUTO_INCREMENT_VALUE_MUTEX(table_share) (&(table_share->mutex)) +#endif + +namespace mrn { + AutoIncrementValueLock::AutoIncrementValueLock(TABLE_SHARE *table_share) + : table_share_(table_share), + need_lock_(table_share_->tmp_table == NO_TMP_TABLE) { + if (need_lock_) { + mysql_mutex_lock(AUTO_INCREMENT_VALUE_MUTEX(table_share_)); + } + } + + AutoIncrementValueLock::~AutoIncrementValueLock() { + if (need_lock_) { + mysql_mutex_unlock(AUTO_INCREMENT_VALUE_MUTEX(table_share_)); + } + } +} diff --git a/storage/mroonga/lib/mrn_auto_increment_value_lock.hpp b/storage/mroonga/lib/mrn_auto_increment_value_lock.hpp new file mode 100644 index 00000000000..8aabe6a8a7f --- /dev/null +++ b/storage/mroonga/lib/mrn_auto_increment_value_lock.hpp @@ -0,0 +1,36 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_AUTO_INCREMENT_VALUE_LOCK_HPP_ +#define MRN_AUTO_INCREMENT_VALUE_LOCK_HPP_ + +#include +#include + +namespace mrn { + class AutoIncrementValueLock { + TABLE_SHARE *table_share_; + bool need_lock_; + public: + AutoIncrementValueLock(TABLE_SHARE *table_share); + ~AutoIncrementValueLock(); + }; +} + +#endif // MRN_AUTO_INCREMENT_VALUE_LOCK_HPP_ diff --git a/storage/mroonga/lib/mrn_condition_converter.cpp b/storage/mroonga/lib/mrn_condition_converter.cpp new file mode 100644 index 00000000000..1bfae1d4f8a --- /dev/null +++ b/storage/mroonga/lib/mrn_condition_converter.cpp @@ -0,0 +1,608 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013-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 +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "mrn_condition_converter.hpp" +#include "mrn_time_converter.hpp" +#include "mrn_smart_grn_obj.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::ConditionConverter" + +#ifdef MRN_ITEM_HAVE_ITEM_NAME +# define MRN_ITEM_FIELD_GET_NAME(item) ((item)->item_name.ptr()) +# define MRN_ITEM_FIELD_GET_NAME_LENGTH(item) ((item)->item_name.length()) +#else +# define MRN_ITEM_FIELD_GET_NAME(item) ((item)->name) +# define MRN_ITEM_FIELD_GET_NAME_LENGTH(item) (strlen((item)->name)) +#endif + +namespace mrn { + ConditionConverter::ConditionConverter(grn_ctx *ctx, grn_obj *table, + bool is_storage_mode) + : ctx_(ctx), + table_(table), + is_storage_mode_(is_storage_mode) { + GRN_TEXT_INIT(&column_name_, 0); + GRN_VOID_INIT(&value_); + } + + ConditionConverter::~ConditionConverter() { + grn_obj_unlink(ctx_, &column_name_); + grn_obj_unlink(ctx_, &value_); + } + + bool ConditionConverter::is_convertable(const Item *item) { + MRN_DBUG_ENTER_METHOD(); + + if (!item) { + DBUG_RETURN(false); + } + + switch (item->type()) { + case Item::COND_ITEM: + { + const Item_cond *cond_item = reinterpret_cast(item); + bool convertable = is_convertable(cond_item); + DBUG_RETURN(convertable); + } + break; + case Item::FUNC_ITEM: + { + const Item_func *func_item = reinterpret_cast(item); + bool convertable = is_convertable(func_item); + DBUG_RETURN(convertable); + } + break; + default: + DBUG_RETURN(false); + break; + } + + DBUG_RETURN(false); + } + + bool ConditionConverter::is_convertable(const Item_cond *cond_item) { + MRN_DBUG_ENTER_METHOD(); + + if (!is_storage_mode_) { + DBUG_RETURN(false); + } + + if (cond_item->functype() != Item_func::COND_AND_FUNC) { + DBUG_RETURN(false); + } + + List *argument_list = + const_cast(cond_item)->argument_list(); + List_iterator iterator(*argument_list); + const Item *sub_item; + while ((sub_item = iterator++)) { + if (!is_convertable(sub_item)) { + DBUG_RETURN(false); + } + } + + DBUG_RETURN(true); + } + + bool ConditionConverter::is_convertable(const Item_func *func_item) { + MRN_DBUG_ENTER_METHOD(); + + switch (func_item->functype()) { + case Item_func::EQ_FUNC: + case Item_func::LT_FUNC: + case Item_func::LE_FUNC: + case Item_func::GE_FUNC: + case Item_func::GT_FUNC: + if (!is_storage_mode_) { + DBUG_RETURN(false); + } + { + Item **arguments = func_item->arguments(); + Item *left_item = arguments[0]; + Item *right_item = arguments[1]; + if (left_item->type() != Item::FIELD_ITEM) { + DBUG_RETURN(false); + } + if (!right_item->basic_const_item()) { + DBUG_RETURN(false); + } + + bool convertable = + is_convertable_binary_operation(static_cast(left_item), + right_item, + func_item->functype()); + DBUG_RETURN(convertable); + } + break; + case Item_func::FT_FUNC: + DBUG_RETURN(true); + break; + case Item_func::BETWEEN: + if (!is_storage_mode_) { + DBUG_RETURN(false); + } + { + Item **arguments = func_item->arguments(); + Item *target_item = arguments[0]; + Item *min_item = arguments[1]; + Item *max_item = arguments[2]; + if (target_item->type() != Item::FIELD_ITEM) { + DBUG_RETURN(false); + } + if (!min_item->basic_const_item()) { + DBUG_RETURN(false); + } + if (!max_item->basic_const_item()) { + DBUG_RETURN(false); + } + + bool convertable = + is_convertable_between(static_cast(target_item), + min_item, + max_item); + DBUG_RETURN(convertable); + } + default: + DBUG_RETURN(false); + break; + } + + DBUG_RETURN(true); + } + + bool ConditionConverter::is_convertable_binary_operation( + const Item_field *field_item, + Item *value_item, + Item_func::Functype func_type) { + MRN_DBUG_ENTER_METHOD(); + + bool convertable = false; + + enum_field_types field_type = field_item->field_type(); + NormalizedType normalized_type = normalize_field_type(field_type); + switch (normalized_type) { + case STRING_TYPE: + if (value_item->type() == Item::STRING_ITEM && + func_type == Item_func::EQ_FUNC) { + convertable = have_index(field_item, GRN_OP_EQUAL); + } + break; + case INT_TYPE: + convertable = value_item->type() == Item::INT_ITEM; + break; + case TIME_TYPE: + if (is_valid_time_value(field_item, value_item)) { + convertable = have_index(field_item, func_type); + } + break; + case UNSUPPORTED_TYPE: + break; + } + + DBUG_RETURN(convertable); + } + + bool ConditionConverter::is_convertable_between(const Item_field *field_item, + Item *min_item, + Item *max_item) { + MRN_DBUG_ENTER_METHOD(); + + bool convertable = false; + + enum_field_types field_type = field_item->field_type(); + NormalizedType normalized_type = normalize_field_type(field_type); + switch (normalized_type) { + case STRING_TYPE: + if (min_item->type() == Item::STRING_ITEM && + max_item->type() == Item::STRING_ITEM) { + convertable = have_index(field_item, GRN_OP_LESS); + } + break; + case INT_TYPE: + if (min_item->type() == Item::INT_ITEM && + max_item->type() == Item::INT_ITEM) { + convertable = have_index(field_item, GRN_OP_LESS); + } + break; + case TIME_TYPE: + if (is_valid_time_value(field_item, min_item) && + is_valid_time_value(field_item, max_item)) { + convertable = have_index(field_item, GRN_OP_LESS); + } + break; + case UNSUPPORTED_TYPE: + break; + } + + DBUG_RETURN(convertable); + } + + bool ConditionConverter::is_valid_time_value(const Item_field *field_item, + Item *value_item) { + MRN_DBUG_ENTER_METHOD(); + + MYSQL_TIME mysql_time; + bool error = get_time_value(field_item, value_item, &mysql_time); + + DBUG_RETURN(!error); + } + + bool ConditionConverter::get_time_value(const Item_field *field_item, + Item *value_item, + MYSQL_TIME *mysql_time) { + MRN_DBUG_ENTER_METHOD(); + + bool error; + Item *real_value_item = value_item->real_item(); + switch (field_item->field_type()) { + case MYSQL_TYPE_TIME: + error = real_value_item->get_time(mysql_time); + break; + case MYSQL_TYPE_YEAR: + mysql_time->year = static_cast(value_item->val_int()); + mysql_time->month = 1; + mysql_time->day = 1; + mysql_time->hour = 0; + mysql_time->hour = 0; + mysql_time->minute = 0; + mysql_time->second_part = 0; + mysql_time->neg = false; + mysql_time->time_type = MYSQL_TIMESTAMP_DATE; + error = false; + break; + default: + error = real_value_item->get_date(mysql_time, TIME_FUZZY_DATE); + break; + } + + DBUG_RETURN(error); + } + + ConditionConverter::NormalizedType + ConditionConverter::normalize_field_type(enum_field_types field_type) { + MRN_DBUG_ENTER_METHOD(); + + NormalizedType type = UNSUPPORTED_TYPE; + + switch (field_type) { + case MYSQL_TYPE_DECIMAL: + type = STRING_TYPE; + break; + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_LONG: + type = INT_TYPE; + break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + type = UNSUPPORTED_TYPE; + break; + case MYSQL_TYPE_NULL: + type = UNSUPPORTED_TYPE; + break; + case MYSQL_TYPE_TIMESTAMP: + type = TIME_TYPE; + break; + case MYSQL_TYPE_LONGLONG: + case MYSQL_TYPE_INT24: + type = INT_TYPE; + break; + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_TIME: + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_NEWDATE: + type = TIME_TYPE; + break; + case MYSQL_TYPE_VARCHAR: + type = STRING_TYPE; + break; + case MYSQL_TYPE_BIT: + type = INT_TYPE; + break; +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: + type = TIME_TYPE; + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: + type = TIME_TYPE; + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: + type = TIME_TYPE; + break; +#endif + case MYSQL_TYPE_NEWDECIMAL: + type = STRING_TYPE; + break; + case MYSQL_TYPE_ENUM: + type = INT_TYPE; + break; + case MYSQL_TYPE_SET: + type = INT_TYPE; + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + type = STRING_TYPE; + break; + case MYSQL_TYPE_GEOMETRY: + type = UNSUPPORTED_TYPE; + break; + } + + DBUG_RETURN(type); + } + + bool ConditionConverter::have_index(const Item_field *field_item, + grn_operator _operator) { + MRN_DBUG_ENTER_METHOD(); + + grn_obj *column; + column = grn_obj_column(ctx_, table_, + MRN_ITEM_FIELD_GET_NAME(field_item), + MRN_ITEM_FIELD_GET_NAME_LENGTH(field_item)); + if (!column) { + DBUG_RETURN(false); + } + mrn::SmartGrnObj smart_column(ctx_, column); + + int n_indexes = grn_column_index(ctx_, column, _operator, NULL, 0, NULL); + bool convertable = (n_indexes > 0); + + DBUG_RETURN(convertable); + } + + bool ConditionConverter::have_index(const Item_field *field_item, + Item_func::Functype func_type) { + MRN_DBUG_ENTER_METHOD(); + + bool have = false; + switch (func_type) { + case Item_func::EQ_FUNC: + have = have_index(field_item, GRN_OP_EQUAL); + break; + case Item_func::LT_FUNC: + have = have_index(field_item, GRN_OP_LESS); + break; + case Item_func::LE_FUNC: + have = have_index(field_item, GRN_OP_LESS_EQUAL); + break; + case Item_func::GE_FUNC: + have = have_index(field_item, GRN_OP_GREATER_EQUAL); + break; + case Item_func::GT_FUNC: + have = have_index(field_item, GRN_OP_GREATER); + break; + default: + break; + } + + DBUG_RETURN(have); + } + + const Item_func *ConditionConverter::find_match_against(const Item *item) { + MRN_DBUG_ENTER_METHOD(); + + if (!item) { + DBUG_RETURN(NULL); + } + + switch (item->type()) { + case Item::COND_ITEM: + if (is_storage_mode_) { + Item_cond *cond_item = (Item_cond *)item; + if (cond_item->functype() == Item_func::COND_AND_FUNC) { + 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); + } + } + } + } + break; + case Item::FUNC_ITEM: + { + const Item_func *func_item = (const Item_func *)item; + switch (func_item->functype()) { + case Item_func::FT_FUNC: + DBUG_RETURN(func_item); + break; + default: + break; + } + } + break; + default: + break; + } + + DBUG_RETURN(NULL); + } + + void ConditionConverter::convert(const Item *where, grn_obj *expression) { + MRN_DBUG_ENTER_METHOD(); + + if (!where || where->type() != Item::COND_ITEM) { + DBUG_VOID_RETURN; + } + + Item_cond *cond_item = (Item_cond *)where; + List_iterator iterator(*((cond_item)->argument_list())); + const Item *sub_item; + while ((sub_item = iterator++)) { + switch (sub_item->type()) { + case Item::FUNC_ITEM: + { + const Item_func *func_item = (const Item_func *)sub_item; + switch (func_item->functype()) { + case Item_func::EQ_FUNC: + convert_binary_operation(func_item, expression, GRN_OP_EQUAL); + break; + case Item_func::LT_FUNC: + convert_binary_operation(func_item, expression, GRN_OP_LESS); + break; + case Item_func::LE_FUNC: + convert_binary_operation(func_item, expression, GRN_OP_LESS_EQUAL); + break; + case Item_func::GE_FUNC: + convert_binary_operation(func_item, expression, + GRN_OP_GREATER_EQUAL); + break; + case Item_func::GT_FUNC: + convert_binary_operation(func_item, expression, GRN_OP_GREATER); + break; + case Item_func::BETWEEN: + convert_between(func_item, expression); + break; + default: + break; + } + } + break; + default: + break; + } + } + + DBUG_VOID_RETURN; + } + + void ConditionConverter::convert_binary_operation(const Item_func *func_item, + grn_obj *expression, + grn_operator _operator) { + Item **arguments = func_item->arguments(); + Item *left_item = arguments[0]; + Item *right_item = arguments[1]; + if (left_item->type() == Item::FIELD_ITEM) { + const Item_field *field_item = static_cast(left_item); + append_field_value(field_item, expression); + append_const_item(field_item, right_item, expression); + grn_expr_append_op(ctx_, expression, _operator, 2); + grn_expr_append_op(ctx_, expression, GRN_OP_AND, 2); + } + } + + void ConditionConverter::convert_between(const Item_func *func_item, + grn_obj *expression) { + MRN_DBUG_ENTER_METHOD(); + + Item **arguments = func_item->arguments(); + Item *target_item = arguments[0]; + Item *min_item = arguments[1]; + Item *max_item = arguments[2]; + + grn_obj *between_func = grn_ctx_get(ctx_, "between", strlen("between")); + grn_expr_append_obj(ctx_, expression, between_func, GRN_OP_PUSH, 1); + + const Item_field *field_item = static_cast(target_item); + append_field_value(field_item, expression); + + grn_obj include; + mrn::SmartGrnObj smart_include(ctx_, &include); + GRN_TEXT_INIT(&include, 0); + GRN_TEXT_PUTS(ctx_, &include, "include"); + append_const_item(field_item, min_item, expression); + grn_expr_append_const(ctx_, expression, &include, GRN_OP_PUSH, 1); + append_const_item(field_item, max_item, expression); + grn_expr_append_const(ctx_, expression, &include, GRN_OP_PUSH, 1); + + grn_expr_append_op(ctx_, expression, GRN_OP_CALL, 5); + + grn_expr_append_op(ctx_, expression, GRN_OP_AND, 2); + + DBUG_VOID_RETURN; + } + + void ConditionConverter::append_field_value(const Item_field *field_item, + grn_obj *expression) { + MRN_DBUG_ENTER_METHOD(); + + GRN_BULK_REWIND(&column_name_); + GRN_TEXT_PUT(ctx_, &column_name_, + MRN_ITEM_FIELD_GET_NAME(field_item), + MRN_ITEM_FIELD_GET_NAME_LENGTH(field_item)); + grn_expr_append_const(ctx_, expression, &column_name_, + GRN_OP_PUSH, 1); + grn_expr_append_op(ctx_, expression, GRN_OP_GET_VALUE, 1); + + DBUG_VOID_RETURN; + } + + void ConditionConverter::append_const_item(const Item_field *field_item, + Item *const_item, + grn_obj *expression) { + MRN_DBUG_ENTER_METHOD(); + + enum_field_types field_type = field_item->field_type(); + NormalizedType normalized_type = normalize_field_type(field_type); + + switch (normalized_type) { + case STRING_TYPE: + grn_obj_reinit(ctx_, &value_, GRN_DB_TEXT, 0); + { + String *string; + string = const_item->val_str(NULL); + GRN_TEXT_SET(ctx_, &value_, string->ptr(), string->length()); + } + break; + case INT_TYPE: + grn_obj_reinit(ctx_, &value_, GRN_DB_INT64, 0); + GRN_INT64_SET(ctx_, &value_, const_item->val_int()); + break; + case TIME_TYPE: + grn_obj_reinit(ctx_, &value_, GRN_DB_TIME, 0); + { + MYSQL_TIME mysql_time; + get_time_value(field_item, const_item, &mysql_time); + bool truncated = false; + TimeConverter time_converter; + long long int time = + time_converter.mysql_time_to_grn_time(&mysql_time, &truncated); + GRN_TIME_SET(ctx_, &value_, time); + } + break; + case UNSUPPORTED_TYPE: + // Should not be occurred. + DBUG_PRINT("error", + ("mroonga: append_const_item: unsupported type: <%d> " + "This case should not be occurred.", + field_type)); + grn_obj_reinit(ctx_, &value_, GRN_DB_VOID, 0); + break; + } + grn_expr_append_const(ctx_, expression, &value_, GRN_OP_PUSH, 1); + + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_condition_converter.hpp b/storage/mroonga/lib/mrn_condition_converter.hpp new file mode 100644 index 00000000000..3cf97c62bbe --- /dev/null +++ b/storage/mroonga/lib/mrn_condition_converter.hpp @@ -0,0 +1,82 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_CONDITION_CONVERTER_HPP_ +#define MRN_CONDITION_CONVERTER_HPP_ + +#include +#include + +namespace mrn { + class ConditionConverter { + public: + ConditionConverter(grn_ctx *ctx, grn_obj *table, bool is_storage_mode); + ~ConditionConverter(); + + bool is_convertable(const Item *item); + const Item_func *find_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); + + private: + enum NormalizedType { + STRING_TYPE, + INT_TYPE, + TIME_TYPE, + UNSUPPORTED_TYPE, + }; + + grn_ctx *ctx_; + grn_obj *table_; + bool is_storage_mode_; + grn_obj column_name_; + grn_obj value_; + + bool is_convertable(const Item_cond *cond_item); + bool is_convertable(const Item_func *func_item); + bool is_convertable_binary_operation(const Item_field *field_item, + Item *value_item, + Item_func::Functype func_type); + bool is_convertable_between(const Item_field *field_item, + Item *min_item, + Item *max_item); + bool is_valid_time_value(const Item_field *field_item, + Item *value_item); + bool get_time_value(const Item_field *field_item, + Item *value_item, + MYSQL_TIME *mysql_time); + bool have_index(const Item_field *field_item, grn_operator _operator); + bool have_index(const Item_field *field_item, Item_func::Functype func_type); + + NormalizedType normalize_field_type(enum_field_types field_type); + + void convert_binary_operation(const Item_func *func_item, + grn_obj *expression, + grn_operator _operator); + void convert_between(const Item_func *func_item, grn_obj *expression); + void append_field_value(const Item_field *field_item, + grn_obj *expression); + void append_const_item(const Item_field *field_item, + Item *const_item, + grn_obj *expression); + }; +} + +#endif /* MRN_CONDITION_CONVERTER_HPP_ */ diff --git a/storage/mroonga/lib/mrn_debug_column_access.cpp b/storage/mroonga/lib/mrn_debug_column_access.cpp new file mode 100644 index 00000000000..ed7cacae90f --- /dev/null +++ b/storage/mroonga/lib/mrn_debug_column_access.cpp @@ -0,0 +1,36 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_debug_column_access.hpp" + +namespace mrn { + DebugColumnAccess::DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap) + : table_(table), + bitmap_(bitmap) { +#ifndef DBUG_OFF + map_ = dbug_tmp_use_all_columns(table_, bitmap_); +#endif + } + + DebugColumnAccess::~DebugColumnAccess() { +#ifndef DBUG_OFF + dbug_tmp_restore_column_map(bitmap_, map_); +#endif + } +} diff --git a/storage/mroonga/lib/mrn_debug_column_access.hpp b/storage/mroonga/lib/mrn_debug_column_access.hpp new file mode 100644 index 00000000000..1548b4d8459 --- /dev/null +++ b/storage/mroonga/lib/mrn_debug_column_access.hpp @@ -0,0 +1,38 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_DEBUG_COLUMN_ACCESS_HPP_ +#define MRN_DEBUG_COLUMN_ACCESS_HPP_ + +#include + +namespace mrn { + class DebugColumnAccess { + TABLE *table_; + MY_BITMAP *bitmap_; +#ifndef DBUG_OFF + my_bitmap_map *map_; +#endif + public: + DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap); + ~DebugColumnAccess(); + }; +} + +#endif // MRN_DEBUG_COLUMN_ACCESS_HPP_ diff --git a/storage/mroonga/lib/mrn_encoding.cpp b/storage/mroonga/lib/mrn_encoding.cpp new file mode 100644 index 00000000000..a69a849c053 --- /dev/null +++ b/storage/mroonga/lib/mrn_encoding.cpp @@ -0,0 +1,222 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 Kouhei Sutou + Copyright(C) 2011-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 +*/ + +#include +#include "mrn_encoding.hpp" + +namespace mrn { + namespace encoding { + CHARSET_INFO *mrn_charset_utf8 = NULL; + CHARSET_INFO *mrn_charset_utf8mb4 = NULL; + CHARSET_INFO *mrn_charset_binary = NULL; + CHARSET_INFO *mrn_charset_ascii = NULL; + CHARSET_INFO *mrn_charset_latin1_1 = NULL; + CHARSET_INFO *mrn_charset_latin1_2 = NULL; + CHARSET_INFO *mrn_charset_cp932 = NULL; + CHARSET_INFO *mrn_charset_sjis = NULL; + CHARSET_INFO *mrn_charset_eucjpms = NULL; + CHARSET_INFO *mrn_charset_ujis = NULL; + CHARSET_INFO *mrn_charset_koi8r = NULL; + + void init(void) { + CHARSET_INFO **cs; + MRN_DBUG_ENTER_FUNCTION(); + for (cs = all_charsets; cs < all_charsets + MY_ALL_CHARSETS_SIZE; cs++) + { + if (!cs[0]) + continue; + if (!strcmp(cs[0]->csname, "utf8")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_utf8) + mrn_charset_utf8 = cs[0]; + else if (mrn_charset_utf8->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "utf8mb4")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_utf8mb4) + mrn_charset_utf8mb4 = cs[0]; + else if (mrn_charset_utf8mb4->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "binary")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_binary) + mrn_charset_binary = cs[0]; + else if (mrn_charset_binary->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "ascii")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_ascii) + mrn_charset_ascii = cs[0]; + else if (mrn_charset_ascii->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "latin1")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_latin1_1) + mrn_charset_latin1_1 = cs[0]; + else if (mrn_charset_latin1_1->cset != cs[0]->cset) + { + if (!mrn_charset_latin1_2) + mrn_charset_latin1_2 = cs[0]; + else if (mrn_charset_latin1_2->cset != cs[0]->cset) + DBUG_ASSERT(0); + } + continue; + } + if (!strcmp(cs[0]->csname, "cp932")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_cp932) + mrn_charset_cp932 = cs[0]; + else if (mrn_charset_cp932->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "sjis")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_sjis) + mrn_charset_sjis = cs[0]; + else if (mrn_charset_sjis->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "eucjpms")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_eucjpms) + mrn_charset_eucjpms = cs[0]; + else if (mrn_charset_eucjpms->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "ujis")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_ujis) + mrn_charset_ujis = cs[0]; + else if (mrn_charset_ujis->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + if (!strcmp(cs[0]->csname, "koi8r")) + { + DBUG_PRINT("info", ("mroonga: %s is %s [%p]", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + if (!mrn_charset_koi8r) + mrn_charset_koi8r = cs[0]; + else if (mrn_charset_koi8r->cset != cs[0]->cset) + DBUG_ASSERT(0); + continue; + } + DBUG_PRINT("info", ("mroonga: %s[%s][%p] is not supported", + cs[0]->name, cs[0]->csname, cs[0]->cset)); + } + DBUG_VOID_RETURN; + } + + bool set(grn_ctx *ctx, const CHARSET_INFO *charset) { + MRN_DBUG_ENTER_FUNCTION(); + if (!charset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_NONE); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_utf8->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_UTF8); + DBUG_RETURN(true); + } + if (mrn_charset_utf8mb4 && charset->cset == mrn_charset_utf8mb4->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_UTF8); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_cp932->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_SJIS); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_eucjpms->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_EUC_JP); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_latin1_1->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_LATIN1); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_latin1_2->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_LATIN1); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_koi8r->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_KOI8R); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_binary->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_NONE); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_ascii->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_UTF8); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_sjis->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_SJIS); + DBUG_RETURN(true); + } + if (charset->cset == mrn_charset_ujis->cset) + { + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_EUC_JP); + DBUG_RETURN(true); + } + GRN_CTX_SET_ENCODING(ctx, GRN_ENC_NONE); + DBUG_RETURN(false); + } + } +} diff --git a/storage/mroonga/lib/mrn_encoding.hpp b/storage/mroonga/lib/mrn_encoding.hpp new file mode 100644 index 00000000000..b4f21e1a274 --- /dev/null +++ b/storage/mroonga/lib/mrn_encoding.hpp @@ -0,0 +1,35 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_ENCODING_HPP_ +#define MRN_ENCODING_HPP_ + +#include + +#include +#include + +namespace mrn { + namespace encoding { + void init(void); + bool set(grn_ctx *ctx, const CHARSET_INFO *charset); + } +} + +#endif // MRN_ENCODING_HPP_ diff --git a/storage/mroonga/lib/mrn_external_lock.cpp b/storage/mroonga/lib/mrn_external_lock.cpp new file mode 100644 index 00000000000..b266b6594ca --- /dev/null +++ b/storage/mroonga/lib/mrn_external_lock.cpp @@ -0,0 +1,43 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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 +*/ + +#include "mrn_external_lock.hpp" + +namespace mrn { + ExternalLock::ExternalLock(THD *thd, handler *handler, int lock_type) + : thd_(thd), + handler_(handler), + lock_type_(lock_type) { + if (lock_type_ != F_UNLCK) { + error_ = handler_->ha_external_lock(thd_, lock_type); + } else { + error_ = 0; + } + } + + ExternalLock::~ExternalLock() { + if (lock_type_ != F_UNLCK) { + handler_->ha_external_lock(thd_, F_UNLCK); + } + } + + int ExternalLock::error() { + return error_; + } +} diff --git a/storage/mroonga/lib/mrn_external_lock.hpp b/storage/mroonga/lib/mrn_external_lock.hpp new file mode 100644 index 00000000000..f78b436f6e8 --- /dev/null +++ b/storage/mroonga/lib/mrn_external_lock.hpp @@ -0,0 +1,38 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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 +*/ + +#ifndef MRN_EXTERNAL_LOCK_HPP_ +#define MRN_EXTERNAL_LOCK_HPP_ + +#include + +namespace mrn { + class ExternalLock { + THD *thd_; + handler *handler_; + int lock_type_; + int error_; + public: + ExternalLock(THD *thd, handler *handler, int lock_type); + ~ExternalLock(); + int error(); + }; +} + +#endif // MRN_EXTERNAL_LOCK_HPP_ diff --git a/storage/mroonga/lib/mrn_field_normalizer.cpp b/storage/mroonga/lib/mrn_field_normalizer.cpp new file mode 100644 index 00000000000..bb91b3ab98d --- /dev/null +++ b/storage/mroonga/lib/mrn_field_normalizer.cpp @@ -0,0 +1,142 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_field_normalizer.hpp" +#include "mrn_encoding.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::FieldNormalizer" + +namespace mrn { + FieldNormalizer::FieldNormalizer(grn_ctx *ctx, THD *thread, Field *field) + : ctx_(ctx), + thread_(thread), + field_(field) { + } + + FieldNormalizer::~FieldNormalizer() { + } + + bool FieldNormalizer::should_normalize() { + MRN_DBUG_ENTER_METHOD(); + + DBUG_PRINT("info", + ("mroonga: result_type = %u", field_->result_type())); + DBUG_PRINT("info", + ("mroonga: charset->name = %s", field_->charset()->name)); + DBUG_PRINT("info", + ("mroonga: charset->csname = %s", field_->charset()->csname)); + DBUG_PRINT("info", + ("mroonga: charset->state = %u", field_->charset()->state)); + bool need_normalize_p; + if (field_->charset()->state & (MY_CS_BINSORT | MY_CS_CSSORT)) { + need_normalize_p = false; + DBUG_PRINT("info", + ("mroonga: should_normalize: false: sort is required")); + } else { + if (is_text_type()) { + need_normalize_p = true; + DBUG_PRINT("info", ("mroonga: should_normalize: true: text type")); + } else { + need_normalize_p = false; + DBUG_PRINT("info", ("mroonga: should_normalize: false: no text type")); + } + } + + DBUG_RETURN(need_normalize_p); + } + + bool FieldNormalizer::is_text_type() { + MRN_DBUG_ENTER_METHOD(); + bool text_type_p; + switch (field_->type()) { + case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + text_type_p = true; + break; + case MYSQL_TYPE_STRING: + switch (field_->real_type()) { + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + text_type_p = false; + break; + default: + text_type_p = true; + break; + } + break; + default: + text_type_p = false; + break; + } + DBUG_RETURN(text_type_p); + } + + grn_obj *FieldNormalizer::normalize(const char *string, + unsigned int string_length) { + MRN_DBUG_ENTER_METHOD(); + grn_obj *normalizer = find_grn_normalizer(); + int flags = 0; + grn_encoding original_encoding = GRN_CTX_GET_ENCODING(ctx_); + encoding::set(ctx_, field_->charset()); + grn_obj *grn_string = grn_string_open(ctx_, string, string_length, + normalizer, flags); + GRN_CTX_SET_ENCODING(ctx_, original_encoding); + DBUG_RETURN(grn_string); + } + + grn_obj *FieldNormalizer::find_grn_normalizer() { + MRN_DBUG_ENTER_METHOD(); + + const CHARSET_INFO *charset_info = field_->charset(); + const char *normalizer_name = NULL; + const char *default_normalizer_name = "NormalizerAuto"; + if ((strcmp(charset_info->name, "utf8_general_ci") == 0) || + (strcmp(charset_info->name, "utf8mb4_general_ci") == 0)) { + normalizer_name = "NormalizerMySQLGeneralCI"; + } else if ((strcmp(charset_info->name, "utf8_unicode_ci") == 0) || + (strcmp(charset_info->name, "utf8mb4_unicode_ci") == 0)) { + normalizer_name = "NormalizerMySQLUnicodeCI"; + } + + grn_obj *normalizer = NULL; + if (normalizer_name) { + normalizer = grn_ctx_get(ctx_, normalizer_name, -1); + if (!normalizer) { + char error_message[MRN_MESSAGE_BUFFER_SIZE]; + snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE, + "%s normalizer isn't found for %s. " + "Install groonga-normalizer-mysql normalizer. " + "%s is used as fallback.", + normalizer_name, + charset_info->name, + default_normalizer_name); + push_warning(thread_, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, error_message); + } + } + + if (!normalizer) { + normalizer = grn_ctx_get(ctx_, default_normalizer_name, -1); + } + + DBUG_RETURN(normalizer); + } +} diff --git a/storage/mroonga/lib/mrn_field_normalizer.hpp b/storage/mroonga/lib/mrn_field_normalizer.hpp new file mode 100644 index 00000000000..5fd8974ce5b --- /dev/null +++ b/storage/mroonga/lib/mrn_field_normalizer.hpp @@ -0,0 +1,47 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_FIELD_NORMALIZER_HPP_ +#define MRN_FIELD_NORMALIZER_HPP_ + +#include + +#include +#include + +namespace mrn { + class FieldNormalizer { + public: + FieldNormalizer(grn_ctx *ctx, THD *thread, Field *field); + ~FieldNormalizer(); + + bool should_normalize(); + grn_obj *normalize(const char *string, unsigned int string_length); + grn_obj *find_grn_normalizer(); + + private: + grn_ctx *ctx_; + THD *thread_; + Field *field_; + + bool is_text_type(); + }; +} + +#endif // MRN_FIELD_NORMALIZER_HPP_ diff --git a/storage/mroonga/lib/mrn_index_column_name.cpp b/storage/mroonga/lib/mrn_index_column_name.cpp new file mode 100644 index 00000000000..14e83ec8e34 --- /dev/null +++ b/storage/mroonga/lib/mrn_index_column_name.cpp @@ -0,0 +1,96 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2012 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_index_column_name.hpp" + +#define MRN_MIN_INDEX_COLUMN_NAME_LENGTH 65 + +// for debug +#define MRN_CLASS_NAME "mrn::IndexColumnName" + +namespace mrn { + IndexColumnName::IndexColumnName(const char *table_name, + const char *mysql_column_name) + : table_name_(table_name), + mysql_column_name_(mysql_column_name) { + uchar encoded_mysql_column_name_multibyte[MRN_MAX_KEY_SIZE]; + const uchar *mysql_column_name_multibyte = + reinterpret_cast(mysql_column_name_); + encode(encoded_mysql_column_name_multibyte, + encoded_mysql_column_name_multibyte + MRN_MAX_KEY_SIZE, + mysql_column_name_multibyte, + mysql_column_name_multibyte + strlen(mysql_column_name_)); + snprintf(name_, MRN_MAX_KEY_SIZE, + "%s-%s", table_name_, encoded_mysql_column_name_multibyte); + length_ = strlen(name_); + if (length_ < MRN_MIN_INDEX_COLUMN_NAME_LENGTH) { + memset(name_ + length_, '-', MRN_MIN_INDEX_COLUMN_NAME_LENGTH - length_); + length_ = MRN_MIN_INDEX_COLUMN_NAME_LENGTH; + name_[length_] = '\0'; + } + } + + const char *IndexColumnName::c_str() { + return name_; + } + + size_t IndexColumnName::length() { + return length_; + } + + uint IndexColumnName::encode(uchar *encoded_start, + uchar *encoded_end, + const uchar *mysql_string_start, + const uchar *mysql_string_end) { + MRN_DBUG_ENTER_METHOD(); + my_charset_conv_mb_wc mb_wc = system_charset_info->cset->mb_wc; + my_charset_conv_wc_mb wc_mb = my_charset_filename.cset->wc_mb; + DBUG_PRINT("info", ("mroonga: in=%s", mysql_string_start)); + encoded_end--; + uchar *encoded = encoded_start; + const uchar *mysql_string = mysql_string_start; + while (mysql_string < mysql_string_end && encoded < encoded_end) { + my_wc_t wc; + int mb_wc_converted_length; + int wc_mb_converted_length; + mb_wc_converted_length = + (*mb_wc)(NULL, &wc, mysql_string, mysql_string_end); + if (mb_wc_converted_length > 0) { + wc_mb_converted_length = (*wc_mb)(NULL, wc, encoded, encoded_end); + if (wc_mb_converted_length <= 0) { + break; + } + } else if (mb_wc_converted_length == MY_CS_ILSEQ) { + *encoded = *mysql_string; + mb_wc_converted_length = 1; + wc_mb_converted_length = 1; + } else { + break; + } + mysql_string += mb_wc_converted_length; + encoded += wc_mb_converted_length; + } + *encoded = '\0'; + DBUG_PRINT("info", ("mroonga: out=%s", encoded_start)); + DBUG_RETURN(encoded - encoded_start); + } +} diff --git a/storage/mroonga/lib/mrn_index_column_name.hpp b/storage/mroonga/lib/mrn_index_column_name.hpp new file mode 100644 index 00000000000..5cd24623abd --- /dev/null +++ b/storage/mroonga/lib/mrn_index_column_name.hpp @@ -0,0 +1,43 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2012 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_INDEX_COLUMN_NAME_HPP_ +#define MRN_INDEX_COLUMN_NAME_HPP_ + +#include + +namespace mrn { + class IndexColumnName { + public: + IndexColumnName(const char *table_name, const char *mysql_column_name); + const char *c_str(); + size_t length(); + private: + const char *table_name_; + const char *mysql_column_name_; + char name_[MRN_MAX_KEY_SIZE]; + size_t length_; + + uint encode(uchar *encoded_start, uchar *encoded_end, + const uchar *mysql_string_start, const uchar *mysql_string_end); + }; +} + +#endif /* MRN_INDEX_COLUMN_NAME_HPP_ */ diff --git a/storage/mroonga/lib/mrn_index_table_name.cpp b/storage/mroonga/lib/mrn_index_table_name.cpp new file mode 100644 index 00000000000..93f4ff8f8fd --- /dev/null +++ b/storage/mroonga/lib/mrn_index_table_name.cpp @@ -0,0 +1,89 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011 Kentoku SHIBA + Copyright(C) 2011-2012 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_index_table_name.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::IndexTableName" + +namespace mrn { + IndexTableName::IndexTableName(const char *table_name, + const char *mysql_index_name) + : table_name_(table_name), + mysql_index_name_(mysql_index_name) { + uchar encoded_mysql_index_name_multibyte[MRN_MAX_KEY_SIZE]; + const uchar *mysql_index_name_multibyte = + reinterpret_cast(mysql_index_name_); + encode(encoded_mysql_index_name_multibyte, + encoded_mysql_index_name_multibyte + MRN_MAX_KEY_SIZE, + mysql_index_name_multibyte, + mysql_index_name_multibyte + strlen(mysql_index_name_)); + snprintf(name_, MRN_MAX_KEY_SIZE, + "%s-%s", table_name_, encoded_mysql_index_name_multibyte); + length_ = strlen(name_); + } + + const char *IndexTableName::c_str() { + return name_; + } + + size_t IndexTableName::length() { + return length_; + } + + uint IndexTableName::encode(uchar *encoded_start, + uchar *encoded_end, + const uchar *mysql_string_start, + const uchar *mysql_string_end) { + MRN_DBUG_ENTER_METHOD(); + my_charset_conv_mb_wc mb_wc = system_charset_info->cset->mb_wc; + my_charset_conv_wc_mb wc_mb = my_charset_filename.cset->wc_mb; + DBUG_PRINT("info", ("mroonga: in=%s", mysql_string_start)); + encoded_end--; + uchar *encoded = encoded_start; + const uchar *mysql_string = mysql_string_start; + while (mysql_string < mysql_string_end && encoded < encoded_end) { + my_wc_t wc; + int mb_wc_converted_length; + int wc_mb_converted_length; + mb_wc_converted_length = + (*mb_wc)(NULL, &wc, mysql_string, mysql_string_end); + if (mb_wc_converted_length > 0) { + wc_mb_converted_length = (*wc_mb)(NULL, wc, encoded, encoded_end); + if (wc_mb_converted_length <= 0) { + break; + } + } else if (mb_wc_converted_length == MY_CS_ILSEQ) { + *encoded = *mysql_string; + mb_wc_converted_length = 1; + wc_mb_converted_length = 1; + } else { + break; + } + mysql_string += mb_wc_converted_length; + encoded += wc_mb_converted_length; + } + *encoded = '\0'; + DBUG_PRINT("info", ("mroonga: out=%s", encoded_start)); + DBUG_RETURN(encoded - encoded_start); + } +} diff --git a/storage/mroonga/lib/mrn_index_table_name.hpp b/storage/mroonga/lib/mrn_index_table_name.hpp new file mode 100644 index 00000000000..4ac4bfe087b --- /dev/null +++ b/storage/mroonga/lib/mrn_index_table_name.hpp @@ -0,0 +1,43 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011 Kentoku SHIBA + Copyright(C) 2011-2012 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_INDEX_TABLE_NAME_HPP_ +#define MRN_INDEX_TABLE_NAME_HPP_ + +#include + +namespace mrn { + class IndexTableName { + public: + IndexTableName(const char *table_name, const char *mysql_index_name); + const char *c_str(); + size_t length(); + private: + const char *table_name_; + const char *mysql_index_name_; + char name_[MRN_MAX_KEY_SIZE]; + size_t length_; + + uint encode(uchar *encoded_start, uchar *encoded_end, + const uchar *mysql_string_start, const uchar *mysql_string_end); + }; +} + +#endif /* MRN_INDEX_TABLE_NAME_HPP_ */ diff --git a/storage/mroonga/lib/mrn_lock.cpp b/storage/mroonga/lib/mrn_lock.cpp new file mode 100644 index 00000000000..94f8a4774af --- /dev/null +++ b/storage/mroonga/lib/mrn_lock.cpp @@ -0,0 +1,31 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_lock.hpp" + +namespace mrn { + Lock::Lock(pthread_mutex_t *mutex) + : mutex_(mutex) { + pthread_mutex_lock(mutex_); + } + + Lock::~Lock() { + pthread_mutex_unlock(mutex_); + } +} diff --git a/storage/mroonga/lib/mrn_lock.hpp b/storage/mroonga/lib/mrn_lock.hpp new file mode 100644 index 00000000000..31dd7b3e53b --- /dev/null +++ b/storage/mroonga/lib/mrn_lock.hpp @@ -0,0 +1,36 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2013 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_LOCK_HPP_ +#define MRN_LOCK_HPP_ + +#include +#include + +namespace mrn { + class Lock { + public: + Lock(pthread_mutex_t *mutex); + ~Lock(); + private: + pthread_mutex_t *mutex_; + }; +} + +#endif /* MRN_LOCK_HPP_ */ diff --git a/storage/mroonga/lib/mrn_match_escalation_threshold_scope.cpp b/storage/mroonga/lib/mrn_match_escalation_threshold_scope.cpp new file mode 100644 index 00000000000..c944b4a4bc0 --- /dev/null +++ b/storage/mroonga/lib/mrn_match_escalation_threshold_scope.cpp @@ -0,0 +1,33 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_match_escalation_threshold_scope.hpp" + +namespace mrn { + MatchEscalationThresholdScope::MatchEscalationThresholdScope( + grn_ctx *ctx, long long int threshold) + : ctx_(ctx), + original_threshold_(grn_ctx_get_match_escalation_threshold(ctx_)) { + grn_ctx_set_match_escalation_threshold(ctx_, threshold); + } + + MatchEscalationThresholdScope::~MatchEscalationThresholdScope() { + grn_ctx_set_match_escalation_threshold(ctx_, original_threshold_); + } +} diff --git a/storage/mroonga/lib/mrn_match_escalation_threshold_scope.hpp b/storage/mroonga/lib/mrn_match_escalation_threshold_scope.hpp new file mode 100644 index 00000000000..352e6589f0d --- /dev/null +++ b/storage/mroonga/lib/mrn_match_escalation_threshold_scope.hpp @@ -0,0 +1,35 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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_MATCH_ESCALATION_THRESHOLD_SCOPE_HPP_ +#define MRN_MATCH_ESCALATION_THRESHOLD_SCOPE_HPP_ + +#include + +namespace mrn { + class MatchEscalationThresholdScope { + grn_ctx *ctx_; + long long int original_threshold_; + public: + MatchEscalationThresholdScope(grn_ctx *ctx, long long int threshold); + ~MatchEscalationThresholdScope(); + }; +} + +#endif // MRN_MATCH_ESCALATION_THRESHOLD_SCOPE_HPP_ diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp new file mode 100644 index 00000000000..5ce736a49b8 --- /dev/null +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp @@ -0,0 +1,548 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012-2014 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 +*/ + +#include + +#include "mrn_multiple_column_key_codec.hpp" +#include "mrn_field_normalizer.hpp" +#include "mrn_smart_grn_obj.hpp" + +// for debug +#define MRN_CLASS_NAME "mrn::MultipleColumnKeyCodec" + +#ifdef WORDS_BIGENDIAN +#define mrn_byte_order_host_to_network(buf, key, size) \ +{ \ + uint32 size_ = (uint32)(size); \ + uint8 *buf_ = (uint8 *)(buf); \ + uint8 *key_ = (uint8 *)(key); \ + while (size_--) { *buf_++ = *key_++; } \ +} +#else /* WORDS_BIGENDIAN */ +#define mrn_byte_order_host_to_network(buf, key, size) \ +{ \ + uint32 size_ = (uint32)(size); \ + uint8 *buf_ = (uint8 *)(buf); \ + uint8 *key_ = (uint8 *)(key) + size_; \ + while (size_--) { *buf_++ = *(--key_); } \ +} +#endif /* WORDS_BIGENDIAN */ + +namespace mrn { + MultipleColumnKeyCodec::MultipleColumnKeyCodec(grn_ctx *ctx, + THD *thread, + KEY *key_info) + : ctx_(ctx), + thread_(thread), + key_info_(key_info) { + } + + MultipleColumnKeyCodec::~MultipleColumnKeyCodec() { + } + + int MultipleColumnKeyCodec::encode(const uchar *mysql_key, + uint mysql_key_length, + uchar *grn_key, + uint *grn_key_length) { + MRN_DBUG_ENTER_METHOD(); + int error = 0; + const uchar *current_mysql_key = mysql_key; + const uchar *mysql_key_end = mysql_key + mysql_key_length; + uchar *current_grn_key = grn_key; + + int n_key_parts = KEY_N_KEY_PARTS(key_info_); + DBUG_PRINT("info", ("mroonga: n_key_parts=%d", n_key_parts)); + *grn_key_length = 0; + for (int i = 0; i < n_key_parts && current_mysql_key < mysql_key_end; i++) { + KEY_PART_INFO *key_part = &(key_info_->key_part[i]); + Field *field = key_part->field; + DBUG_PRINT("info", ("mroonga: key_part->length=%u", key_part->length)); + + if (field->null_bit) { + DBUG_PRINT("info", ("mroonga: field has null bit")); + *current_grn_key = 0; + current_mysql_key += 1; + current_grn_key += 1; + (*grn_key_length)++; + } + + DataType data_type = TYPE_UNKNOWN; + uint data_size = 0; + get_key_info(key_part, &data_type, &data_size); + + switch (data_type) { + case TYPE_UNKNOWN: + // TODO: This will not be happen. This is just for + // suppressing warnings by gcc -O2. :< + error = HA_ERR_UNSUPPORTED; + break; + case TYPE_LONG_LONG_NUMBER: + { + long long int long_long_value = 0; + switch (data_size) { + case 3: + long_long_value = (long long int)sint3korr(current_mysql_key); + break; + case 8: + long_long_value = (long long int)sint8korr(current_mysql_key); + break; + } + mrn_byte_order_host_to_network(current_grn_key, &long_long_value, + data_size); + *((uint8 *)(current_grn_key)) ^= 0x80; + } + break; + case TYPE_NUMBER: + mrn_byte_order_host_to_network(current_grn_key, current_mysql_key, data_size); + { + Field_num *number_field = (Field_num *)field; + if (!number_field->unsigned_flag) { + *((uint8 *)(current_grn_key)) ^= 0x80; + } + } + break; + case TYPE_FLOAT: + { + float value; + float4get(value, current_mysql_key); + encode_float(value, data_size, current_grn_key); + } + break; + case TYPE_DOUBLE: + { + double value; + float8get(value, current_mysql_key); + encode_double(value, data_size, current_grn_key); + } + break; + case TYPE_BYTE_SEQUENCE: + memcpy(current_grn_key, current_mysql_key, data_size); + break; + case TYPE_BYTE_REVERSE: + encode_reverse(current_mysql_key, data_size, current_grn_key); + break; + case TYPE_BYTE_BLOB: + encode_blob(field, current_mysql_key, current_grn_key, &data_size); + break; + } + + if (error) { + break; + } + + current_mysql_key += data_size; + current_grn_key += data_size; + *grn_key_length += data_size; + } + + DBUG_RETURN(error); + } + + int MultipleColumnKeyCodec::decode(const uchar *grn_key, + uint grn_key_length, + uchar *mysql_key, + uint *mysql_key_length) { + MRN_DBUG_ENTER_METHOD(); + int error = 0; + const uchar *current_grn_key = grn_key; + const uchar *grn_key_end = grn_key + grn_key_length; + uchar *current_mysql_key = mysql_key; + + int n_key_parts = KEY_N_KEY_PARTS(key_info_); + DBUG_PRINT("info", ("mroonga: n_key_parts=%d", n_key_parts)); + *mysql_key_length = 0; + for (int i = 0; i < n_key_parts && current_grn_key < grn_key_end; i++) { + KEY_PART_INFO *key_part = &(key_info_->key_part[i]); + Field *field = key_part->field; + DBUG_PRINT("info", ("mroonga: key_part->length=%u", key_part->length)); + + if (field->null_bit) { + DBUG_PRINT("info", ("mroonga: field has null bit")); + *current_mysql_key = 0; + current_grn_key += 1; + current_mysql_key += 1; + (*mysql_key_length)++; + } + + DataType data_type = TYPE_UNKNOWN; + uint data_size = 0; + get_key_info(key_part, &data_type, &data_size); + + switch (data_type) { + case TYPE_UNKNOWN: + // TODO: This will not be happen. This is just for + // suppressing warnings by gcc -O2. :< + error = HA_ERR_UNSUPPORTED; + break; + case TYPE_LONG_LONG_NUMBER: + { + long long int long_long_value = 0; + switch (data_size) { + case 3: + long_long_value = (long long int)sint3korr(current_grn_key); + break; + case 8: + long_long_value = (long long int)sint8korr(current_grn_key); + break; + } + *((uint8 *)(&long_long_value)) ^= 0x80; + mrn_byte_order_host_to_network(current_mysql_key, &long_long_value, + data_size); + } + break; + case TYPE_NUMBER: + { + uchar buffer[8]; + memcpy(buffer, current_grn_key, data_size); + Field_num *number_field = (Field_num *)field; + if (!number_field->unsigned_flag) { + buffer[0] ^= 0x80; + } + mrn_byte_order_host_to_network(current_mysql_key, buffer, + data_size); + } + break; + case TYPE_FLOAT: + decode_float(current_grn_key, current_mysql_key, data_size); + break; + case TYPE_DOUBLE: + decode_double(current_grn_key, current_mysql_key, data_size); + break; + case TYPE_BYTE_SEQUENCE: + memcpy(current_mysql_key, current_grn_key, data_size); + break; + case TYPE_BYTE_REVERSE: + decode_reverse(current_grn_key, current_mysql_key, data_size); + break; + case TYPE_BYTE_BLOB: + memcpy(current_mysql_key, + current_grn_key + data_size, + HA_KEY_BLOB_LENGTH); + memcpy(current_mysql_key + HA_KEY_BLOB_LENGTH, + current_grn_key, + data_size); + data_size += HA_KEY_BLOB_LENGTH; + break; + } + + if (error) { + break; + } + + current_grn_key += data_size; + current_mysql_key += data_size; + *mysql_key_length += data_size; + } + + DBUG_RETURN(error); + } + + uint MultipleColumnKeyCodec::size() { + MRN_DBUG_ENTER_METHOD(); + + int n_key_parts = KEY_N_KEY_PARTS(key_info_); + DBUG_PRINT("info", ("mroonga: n_key_parts=%d", n_key_parts)); + + uint total_size = 0; + for (int i = 0; i < n_key_parts; ++i) { + KEY_PART_INFO *key_part = &(key_info_->key_part[i]); + Field *field = key_part->field; + DBUG_PRINT("info", ("mroonga: key_part->length=%u", key_part->length)); + + if (field->null_bit) { + DBUG_PRINT("info", ("mroonga: field has null bit")); + ++total_size; + } + + DataType data_type = TYPE_UNKNOWN; + uint data_size = 0; + get_key_info(key_part, &data_type, &data_size); + total_size += data_size; + if (data_type == TYPE_BYTE_BLOB) { + total_size += HA_KEY_BLOB_LENGTH; + } + } + + DBUG_RETURN(total_size); + } + + void MultipleColumnKeyCodec::get_key_info(KEY_PART_INFO *key_part, + DataType *data_type, + uint *data_size) { + MRN_DBUG_ENTER_METHOD(); + + *data_type = TYPE_UNKNOWN; + *data_size = 0; + + Field *field = key_part->field; + switch (field->real_type()) { + case MYSQL_TYPE_DECIMAL: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_DECIMAL")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_YEAR: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_TINY")); + *data_type = TYPE_NUMBER; + *data_size = 1; + break; + case MYSQL_TYPE_SHORT: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_SHORT")); + *data_type = TYPE_NUMBER; + *data_size = 2; + break; + case MYSQL_TYPE_LONG: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_LONG")); + *data_type = TYPE_NUMBER; + *data_size = 4; + break; + case MYSQL_TYPE_FLOAT: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_FLOAT")); + *data_type = TYPE_FLOAT; + *data_size = 4; + break; + case MYSQL_TYPE_DOUBLE: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_DOUBLE")); + *data_type = TYPE_DOUBLE; + *data_size = 8; + break; + case MYSQL_TYPE_NULL: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_NULL")); + *data_type = TYPE_NUMBER; + *data_size = 1; + break; + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_NEWDATE: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_DATETIME")); + *data_type = TYPE_BYTE_REVERSE; + *data_size = key_part->length; + break; + case MYSQL_TYPE_LONGLONG: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_LONGLONG")); + *data_type = TYPE_NUMBER; + *data_size = 8; + break; + case MYSQL_TYPE_INT24: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_INT24")); + *data_type = TYPE_NUMBER; + *data_size = 3; + break; + case MYSQL_TYPE_TIME: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_TIME")); + *data_type = TYPE_LONG_LONG_NUMBER; + *data_size = 3; + break; + case MYSQL_TYPE_VARCHAR: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_VARCHAR")); + *data_type = TYPE_BYTE_BLOB; + *data_size = key_part->length; + break; + case MYSQL_TYPE_BIT: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_BIT")); + *data_type = TYPE_NUMBER; + *data_size = 1; + break; +#ifdef MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 + case MYSQL_TYPE_TIMESTAMP2: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_TIMESTAMP2")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_DATETIME2 + case MYSQL_TYPE_DATETIME2: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_DATETIME2")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; +#endif +#ifdef MRN_HAVE_MYSQL_TYPE_TIME2 + case MYSQL_TYPE_TIME2: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_TIME2")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; +#endif + case MYSQL_TYPE_NEWDECIMAL: + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_NEWDECIMAL")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; + case MYSQL_TYPE_ENUM: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_ENUM")); + *data_type = TYPE_NUMBER; + *data_size = 1; + break; + case MYSQL_TYPE_SET: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_SET")); + *data_type = TYPE_NUMBER; + *data_size = 1; + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_BLOB")); + *data_type = TYPE_BYTE_BLOB; + *data_size = key_part->length; + break; + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_STRING")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; + case MYSQL_TYPE_GEOMETRY: + // TODO + DBUG_PRINT("info", ("mroonga: MYSQL_TYPE_GEOMETRY")); + *data_type = TYPE_BYTE_SEQUENCE; + *data_size = key_part->length; + break; + } + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::encode_float(volatile float value, uint data_size, + uchar *grn_key) { + MRN_DBUG_ENTER_METHOD(); + int n_bits = (data_size * 8 - 1); + volatile int *int_value_pointer = (int *)(&value); + int int_value = *int_value_pointer; + int_value ^= ((int_value >> n_bits) | (1 << n_bits)); + mrn_byte_order_host_to_network(grn_key, &int_value, data_size); + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::decode_float(const uchar *grn_key, + uchar *mysql_key, + uint data_size) { + MRN_DBUG_ENTER_METHOD(); + int int_value; + mrn_byte_order_host_to_network(&int_value, grn_key, data_size); + int max_bit = (data_size * 8 - 1); + *((int *)mysql_key) = + int_value ^ (((int_value ^ (1 << max_bit)) >> max_bit) | + (1 << max_bit)); + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::encode_double(volatile double value, uint data_size, + uchar *grn_key) { + MRN_DBUG_ENTER_METHOD(); + int n_bits = (data_size * 8 - 1); + volatile long long int *long_long_value_pointer = (long long int *)(&value); + volatile long long int long_long_value = *long_long_value_pointer; + long_long_value ^= ((long_long_value >> n_bits) | (1LL << n_bits)); + mrn_byte_order_host_to_network(grn_key, &long_long_value, data_size); + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::decode_double(const uchar *grn_key, + uchar *mysql_key, + uint data_size) { + MRN_DBUG_ENTER_METHOD(); + long long int long_long_value; + mrn_byte_order_host_to_network(&long_long_value, grn_key, data_size); + int max_bit = (data_size * 8 - 1); + *((long long int *)mysql_key) = + long_long_value ^ (((long_long_value ^ (1LL << max_bit)) >> max_bit) | + (1LL << max_bit)); + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::encode_reverse(const uchar *mysql_key, uint data_size, + uchar *grn_key) { + MRN_DBUG_ENTER_METHOD(); + for (uint i = 0; i < data_size; i++) { + grn_key[i] = mysql_key[data_size - i - 1]; + } + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::decode_reverse(const uchar *grn_key, + uchar *mysql_key, + uint data_size) { + MRN_DBUG_ENTER_METHOD(); + for (uint i = 0; i < data_size; i++) { + mysql_key[i] = grn_key[data_size - i - 1]; + } + DBUG_VOID_RETURN; + } + + void MultipleColumnKeyCodec::encode_blob(Field *field, + const uchar *mysql_key, + uchar *grn_key, + uint *data_size) { + FieldNormalizer normalizer(ctx_, thread_, field); + if (normalizer.should_normalize()) { +#if HA_KEY_BLOB_LENGTH != 2 +# error "TODO: support HA_KEY_BLOB_LENGTH != 2 case if it is needed" +#endif + const char *blob_data = + reinterpret_cast(mysql_key + HA_KEY_BLOB_LENGTH); + uint16 blob_data_length = *((uint16 *)(mysql_key)); + grn_obj *grn_string = normalizer.normalize(blob_data, + blob_data_length); + mrn::SmartGrnObj smart_grn_string(ctx_, grn_string); + const char *normalized; + unsigned int normalized_length = 0; + grn_string_get_normalized(ctx_, grn_string, + &normalized, &normalized_length, NULL); + uint16 new_blob_data_length; + if (normalized_length <= UINT_MAX16) { + memcpy(grn_key, normalized, normalized_length); + if (normalized_length < *data_size) { + memset(grn_key + normalized_length, + '\0', *data_size - normalized_length); + } + new_blob_data_length = normalized_length; + } else { + push_warning_printf(thread_, + Sql_condition::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, + "normalized data truncated " + "for multiple column index: " + "normalized-data-size: <%u> " + "max-data-size: <%u> " + "column-name: <%s> " + "data: <%.*s>", + normalized_length, + UINT_MAX16, + field->field_name, + blob_data_length, blob_data); + memcpy(grn_key, normalized, blob_data_length); + new_blob_data_length = blob_data_length; + } + memcpy(grn_key + *data_size, &new_blob_data_length, HA_KEY_BLOB_LENGTH); + } else { + memcpy(grn_key + *data_size, mysql_key, HA_KEY_BLOB_LENGTH); + memcpy(grn_key, mysql_key + HA_KEY_BLOB_LENGTH, *data_size); + } + *data_size += HA_KEY_BLOB_LENGTH; + } +} diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp new file mode 100644 index 00000000000..fc6ae285357 --- /dev/null +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.hpp @@ -0,0 +1,70 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012-2013 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_MULTIPLE_COLUMN_KEY_CODEC_HPP_ +#define MRN_MULTIPLE_COLUMN_KEY_CODEC_HPP_ + +#include + +#include +#include + +namespace mrn { + class MultipleColumnKeyCodec { + public: + MultipleColumnKeyCodec(grn_ctx *ctx, THD *thread, KEY *key_info); + ~MultipleColumnKeyCodec(); + + int encode(const uchar *mysql_key, uint mysql_key_length, + uchar *grn_key, uint *grn_key_length); + int decode(const uchar *grn_key, uint grn_key_length, + uchar *mysql_key, uint *mysql_key_length); + uint size(); + + private: + enum DataType { + TYPE_UNKNOWN, + TYPE_LONG_LONG_NUMBER, + TYPE_NUMBER, + TYPE_FLOAT, + TYPE_DOUBLE, + TYPE_BYTE_SEQUENCE, + TYPE_BYTE_REVERSE, + TYPE_BYTE_BLOB + }; + + grn_ctx *ctx_; + THD *thread_; + KEY *key_info_; + + void get_key_info(KEY_PART_INFO *key_part, + DataType *data_type, uint *data_size); + + void encode_float(volatile float value, uint data_size, uchar *grn_key); + void decode_float(const uchar *grn_key, uchar *mysql_key, uint data_size); + void encode_double(volatile double value, uint data_size, uchar *grn_key); + void decode_double(const uchar *grn_key, uchar *mysql_key, uint data_size); + void encode_reverse(const uchar *mysql_key, uint data_size, uchar *grn_key); + void decode_reverse(const uchar *grn_key, uchar *mysql_key, uint data_size); + void encode_blob(Field *field, + const uchar *mysql_key, uchar *grn_key, uint *data_size); + }; +} + +#endif // MRN_MULTIPLE_COLUMN_KEY_CODEC_HPP_ diff --git a/storage/mroonga/lib/mrn_mysqlservices.cpp b/storage/mroonga/lib/mrn_mysqlservices.cpp new file mode 100644 index 00000000000..9c7af9acfe0 --- /dev/null +++ b/storage/mroonga/lib/mrn_mysqlservices.cpp @@ -0,0 +1,32 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2011-2013 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 +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +/* +void *thd_alloc(MYSQL_THD thd, unsigned int size) +{ + return thd->alloc(size); +} +*/ diff --git a/storage/mroonga/lib/mrn_parameters_parser.cpp b/storage/mroonga/lib/mrn_parameters_parser.cpp new file mode 100644 index 00000000000..9a05097e548 --- /dev/null +++ b/storage/mroonga/lib/mrn_parameters_parser.cpp @@ -0,0 +1,176 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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_parameters_parser.hpp" + +#include + +namespace mrn { + class Parameter { + public: + char *key_; + char *value_; + + Parameter(const char *key, unsigned int key_length, + const char *value, unsigned int value_length) + : key_(my_strndup(key, key_length, MYF(0))), + value_(my_strndup(value, value_length, MYF(0))) { + }; + ~Parameter() { + if (key_) { + my_free(key_, MYF(0)); + } + if (value_) { + my_free(value_, MYF(0)); + } + }; + }; + + ParametersParser::ParametersParser(const char *input, + unsigned int input_length) + : input_(input), + input_length_(input_length), + parameters_(NULL) { + } + + ParametersParser::~ParametersParser() { + for (LIST *next = parameters_; next; next = next->next) { + Parameter *parameter = static_cast(next->data); + delete parameter; + } + list_free(parameters_, false); + } + + void ParametersParser::parse() { + const char *current = input_; + const char *end = input_ + input_length_; + for (; current < end; ++current) { + if (is_white_space(current[0])) { + continue; + } + + const char *key = current; + unsigned int key_length = 0; + while (current < end && + !is_white_space(current[0]) && + current[0] != '\'' && current[0] != '"' && current[0] != ',') { + ++current; + ++key_length; + } + if (current == end) { + break; + } + + while (current < end && is_white_space(current[0])) { + ++current; + } + if (current == end) { + break; + } + current = parse_value(current, end, key, key_length); + if (!current) { + break; + } + + while (current < end && is_white_space(current[0])) { + ++current; + } + if (current == end) { + break; + } + if (current[0] != ',') { + // TODO: report error + break; + } + } + } + + const char *ParametersParser::parse_value(const char *current, + const char *end, + const char *key, + unsigned int key_length) { + char quote = current[0]; + if (quote != '\'' && quote != '"') { + // TODO: report error + return NULL; + } + ++current; + + bool found = false; + static const unsigned int max_value_length = 4096; + char value[max_value_length]; + unsigned int value_length = 0; + for (; current < end && value_length < max_value_length; ++current) { + if (current[0] == quote) { + Parameter *parameter = new Parameter(key, key_length, + value, value_length); + list_push(parameters_, parameter); + found = true; + ++current; + break; + } + + switch (current[0]) { + case '\\': + if (current + 1 == end) { + break; + } + switch (current[1]) { + case 'b': + value[value_length] = '\b'; + break; + case 'n': + value[value_length] = '\n'; + break; + case 'r': + value[value_length] = '\r'; + break; + case 't': + value[value_length] = '\t'; + break; + default: + value[value_length] = current[1]; + break; + } + break; + default: + value[value_length] = current[0]; + break; + } + ++value_length; + } + + if (!found) { + // TODO: report error + } + + return current; + } + + const char *ParametersParser::operator[](const char *key) { + for (LIST *next = parameters_; next; next = next->next) { + Parameter *parameter = static_cast(next->data); + if (strcasecmp(parameter->key_, key) == 0) { + return parameter->value_; + } + } + return NULL; + } +} diff --git a/storage/mroonga/lib/mrn_parameters_parser.hpp b/storage/mroonga/lib/mrn_parameters_parser.hpp new file mode 100644 index 00000000000..a15371ca72e --- /dev/null +++ b/storage/mroonga/lib/mrn_parameters_parser.hpp @@ -0,0 +1,59 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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_PARAMETERS_PARSER_HPP_ +#define MRN_PARAMETERS_PARSER_HPP_ + +#include +#include + +namespace mrn { + class ParametersParser { + public: + ParametersParser(const char *input, unsigned int input_length); + ~ParametersParser(); + void parse(); + const char *operator[](const char *key); + + private: + const char *input_; + unsigned int input_length_; + + LIST *parameters_; + + bool is_white_space(char character) { + switch (character) { + case ' ': + case '\r': + case '\n': + case '\t': + return true; + break; + default: + return false; + break; + } + }; + const char *parse_value(const char *current, const char *end, + const char *key, unsigned int key_length); + }; +} + +#endif /* MRN_PARAMETERS_PARSER_HPP_ */ diff --git a/storage/mroonga/lib/mrn_path_mapper.cpp b/storage/mroonga/lib/mrn_path_mapper.cpp new file mode 100644 index 00000000000..8856e6f6082 --- /dev/null +++ b/storage/mroonga/lib/mrn_path_mapper.cpp @@ -0,0 +1,196 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2012 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 +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "mrn_path_mapper.hpp" + +#include + +#include + +namespace mrn { + char *PathMapper::default_path_prefix = NULL; + char *PathMapper::default_mysql_data_home_path = NULL; + + PathMapper::PathMapper(const char *mysql_path, + const char *path_prefix, + const char *mysql_data_home_path) + : mysql_path_(mysql_path), + path_prefix_(path_prefix), + mysql_data_home_path_(mysql_data_home_path) { + db_path_[0] = '\0'; + db_name_[0] = '\0'; + table_name_[0] = '\0'; + mysql_table_name_[0] = '\0'; + } + + /** + * "./${db}/${table}" ==> "${db}.mrn" + * "./${db}/" ==> "${db}.mrn" + * "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0" ==> + * "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0.mrn" + */ + const char *PathMapper::db_path() { + if (db_path_[0] != '\0') { + return db_path_; + } + + if (mysql_path_[0] == FN_CURLIB && mysql_path_[1] == FN_LIBCHAR) { + if (path_prefix_) { + strcpy(db_path_, path_prefix_); + } + + int i = 2, j = strlen(db_path_), len; + len = strlen(mysql_path_); + while (mysql_path_[i] != FN_LIBCHAR && i < len) { + db_path_[j++] = mysql_path_[i++]; + } + db_path_[j] = '\0'; + } else if (mysql_data_home_path_) { + int len = strlen(mysql_path_); + int mysql_data_home_len = strlen(mysql_data_home_path_); + if (len > mysql_data_home_len && + !strncmp(mysql_path_, mysql_data_home_path_, mysql_data_home_len)) { + int i = mysql_data_home_len, j; + if (path_prefix_ && path_prefix_[0] == FN_LIBCHAR) { + strcpy(db_path_, path_prefix_); + j = strlen(db_path_); + } else { + memcpy(db_path_, mysql_data_home_path_, mysql_data_home_len); + if (path_prefix_) { + if (path_prefix_[0] == FN_CURLIB && + path_prefix_[1] == FN_LIBCHAR) { + strcpy(&db_path_[mysql_data_home_len], &path_prefix_[2]); + } else { + strcpy(&db_path_[mysql_data_home_len], path_prefix_); + } + j = strlen(db_path_); + } else { + j = mysql_data_home_len; + } + } + + while (mysql_path_[i] != FN_LIBCHAR && i < len) { + db_path_[j++] = mysql_path_[i++]; + } + if (i == len) { + memcpy(db_path_, mysql_path_, len); + } else { + db_path_[j] = '\0'; + } + } else { + strcpy(db_path_, mysql_path_); + } + } else { + strcpy(db_path_, mysql_path_); + } + strcat(db_path_, MRN_DB_FILE_SUFFIX); + return db_path_; + } + + /** + * "./${db}/${table}" ==> "${db}" + * "./${db}/" ==> "${db}" + * "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0" ==> + * "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0" + */ + const char *PathMapper::db_name() { + if (db_name_[0] != '\0') { + return db_name_; + } + + if (mysql_path_[0] == FN_CURLIB && mysql_path_[1] == FN_LIBCHAR) { + int i = 2, j = 0, len; + len = strlen(mysql_path_); + while (mysql_path_[i] != FN_LIBCHAR && i < len) { + db_name_[j++] = mysql_path_[i++]; + } + db_name_[j] = '\0'; + } else if (mysql_data_home_path_) { + int len = strlen(mysql_path_); + int mysql_data_home_len = strlen(mysql_data_home_path_); + if (len > mysql_data_home_len && + !strncmp(mysql_path_, mysql_data_home_path_, mysql_data_home_len)) { + int i = mysql_data_home_len, j = 0; + while (mysql_path_[i] != FN_LIBCHAR && i < len) { + db_name_[j++] = mysql_path_[i++]; + } + if (i == len) { + memcpy(db_name_, mysql_path_, len); + } else { + db_name_[j] = '\0'; + } + } else { + strcpy(db_name_, mysql_path_); + } + } else { + strcpy(db_name_, mysql_path_); + } + return db_name_; + } + + /** + * "./${db}/${table}" ==> "${table}" (with encoding first '_') + */ + const char *PathMapper::table_name() { + if (table_name_[0] != '\0') { + return table_name_; + } + + int len = strlen(mysql_path_); + int i = len, j = 0; + for (; mysql_path_[--i] != FN_LIBCHAR ;) {} + if (mysql_path_[i + 1] == '_') { + table_name_[j++] = '@'; + table_name_[j++] = '0'; + table_name_[j++] = '0'; + table_name_[j++] = '5'; + table_name_[j++] = 'f'; + i++; + } + for (; i < len ;) { + table_name_[j++] = mysql_path_[++i]; + } + table_name_[j] = '\0'; + return table_name_; + } + + /** + * "./${db}/${table}" ==> "${table}" (without encoding first '_') + */ + const char *PathMapper::mysql_table_name() { + if (mysql_table_name_[0] != '\0') { + return mysql_table_name_; + } + + int len = strlen(mysql_path_); + int i = len, j = 0; + for (; mysql_path_[--i] != FN_LIBCHAR ;) {} + for (; i < len ;) { + mysql_table_name_[j++] = mysql_path_[++i]; + } + mysql_table_name_[j] = '\0'; + return mysql_table_name_; + } +} diff --git a/storage/mroonga/lib/mrn_path_mapper.hpp b/storage/mroonga/lib/mrn_path_mapper.hpp new file mode 100644 index 00000000000..f70cd7b5587 --- /dev/null +++ b/storage/mroonga/lib/mrn_path_mapper.hpp @@ -0,0 +1,51 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2012 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_PATH_MAPPER_HPP_ +#define MRN_PATH_MAPPER_HPP_ + +#include + +namespace mrn { + class PathMapper { + public: + static char *default_path_prefix; + static char *default_mysql_data_home_path; + + PathMapper(const char *mysql_path, + const char *path_prefix=default_path_prefix, + const char *mysql_data_home_path=default_mysql_data_home_path); + const char *db_path(); + const char *db_name(); + const char *table_name(); + const char *mysql_table_name(); + private: + const char *mysql_path_; + const char *path_prefix_; + const char *mysql_data_home_path_; + char db_path_[MRN_MAX_PATH_SIZE]; + char db_name_[MRN_MAX_PATH_SIZE]; + char table_name_[MRN_MAX_PATH_SIZE]; + char mysql_table_name_[MRN_MAX_PATH_SIZE]; + }; +} + +#endif /* MRN_PATH_MAPPER_HPP_ */ diff --git a/storage/mroonga/lib/mrn_smart_grn_obj.cpp b/storage/mroonga/lib/mrn_smart_grn_obj.cpp new file mode 100644 index 00000000000..9dbae6528f9 --- /dev/null +++ b/storage/mroonga/lib/mrn_smart_grn_obj.cpp @@ -0,0 +1,53 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + 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 +*/ + +#include + +#include "mrn_smart_grn_obj.hpp" + +namespace mrn { + SmartGrnObj::SmartGrnObj(grn_ctx *ctx, grn_obj *obj) + : ctx_(ctx), + obj_(obj) { + } + + SmartGrnObj::SmartGrnObj(grn_ctx *ctx, const char *name, int name_size) + : ctx_(ctx), + obj_(NULL) { + if (name_size < 0) { + name_size = strlen(name); + } + obj_ = grn_ctx_get(ctx_, name, name_size); + } + + SmartGrnObj::SmartGrnObj(grn_ctx *ctx, grn_id id) + : ctx_(ctx), + obj_(grn_ctx_at(ctx_, id)) { + } + + SmartGrnObj::~SmartGrnObj() { + if (obj_) { + grn_obj_unlink(ctx_, obj_); + } + } + + grn_obj *SmartGrnObj::get() { + return obj_; + } +} diff --git a/storage/mroonga/lib/mrn_smart_grn_obj.hpp b/storage/mroonga/lib/mrn_smart_grn_obj.hpp new file mode 100644 index 00000000000..c9c86f3e46e --- /dev/null +++ b/storage/mroonga/lib/mrn_smart_grn_obj.hpp @@ -0,0 +1,39 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + 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 +*/ + +#ifndef MRN_SMART_GRN_OBJ_HPP_ +#define MRN_SMART_GRN_OBJ_HPP_ + +#include + +namespace mrn { + class SmartGrnObj { + grn_ctx *ctx_; + grn_obj *obj_; + public: + SmartGrnObj(grn_ctx *ctx, grn_obj *obj); + SmartGrnObj(grn_ctx *ctx, const char *name, int name_size=-1); + SmartGrnObj(grn_ctx *ctx, grn_id id); + ~SmartGrnObj(); + + grn_obj *get(); + }; +} + +#endif // MRN_SMART_GRN_OBJ_HPP_ diff --git a/storage/mroonga/lib/mrn_time_converter.cpp b/storage/mroonga/lib/mrn_time_converter.cpp new file mode 100644 index 00000000000..63b2e53766d --- /dev/null +++ b/storage/mroonga/lib/mrn_time_converter.cpp @@ -0,0 +1,260 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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 +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "mrn_time_converter.hpp" + +#ifdef min +# undef min +#endif +#ifdef max +# undef max +#endif + +#include + +// for debug +#define MRN_CLASS_NAME "mrn::TimeConverter" + +namespace mrn { + TimeConverter::TimeConverter() { + } + + TimeConverter::~TimeConverter() { + } + + time_t TimeConverter::tm_to_time_gm(struct tm *time, bool *truncated) { + MRN_DBUG_ENTER_METHOD(); + *truncated = true; + struct tm gmdate; + time->tm_yday = -1; + time->tm_isdst = -1; + time_t sec_t = mktime(time); + if (time->tm_yday == -1) { + DBUG_RETURN(-1); + } + if (!gmtime_r(&sec_t, &gmdate)) { + DBUG_RETURN(-1); + } + int32 mrn_utc_diff_in_seconds = + ( + time->tm_mday > 25 && gmdate.tm_mday == 1 ? -1 : + time->tm_mday == 1 && gmdate.tm_mday > 25 ? 1 : + time->tm_mday - gmdate.tm_mday + ) * 24 * 60 * 60 + + (time->tm_hour - gmdate.tm_hour) * 60 * 60 + + (time->tm_min - gmdate.tm_min) * 60 + + (time->tm_sec - gmdate.tm_sec); + DBUG_PRINT("info", ("mroonga: time->tm_year=%d", time->tm_year)); + DBUG_PRINT("info", ("mroonga: time->tm_mon=%d", time->tm_mon)); + DBUG_PRINT("info", ("mroonga: time->tm_mday=%d", time->tm_mday)); + DBUG_PRINT("info", ("mroonga: time->tm_hour=%d", time->tm_hour)); + DBUG_PRINT("info", ("mroonga: time->tm_min=%d", time->tm_min)); + DBUG_PRINT("info", ("mroonga: time->tm_sec=%d", time->tm_sec)); + DBUG_PRINT("info", ("mroonga: mrn_utc_diff_in_seconds=%d", + mrn_utc_diff_in_seconds)); + if (mrn_utc_diff_in_seconds > 0) { + if (sec_t > std::numeric_limits::max() - mrn_utc_diff_in_seconds) { + DBUG_RETURN(-1); + } + } else { + if (sec_t < std::numeric_limits::min() - mrn_utc_diff_in_seconds) { + DBUG_RETURN(-1); + } + } + *truncated = false; + DBUG_RETURN(sec_t + mrn_utc_diff_in_seconds); + } + + long long int TimeConverter::tm_to_grn_time(struct tm *time, int usec, + bool *truncated) { + MRN_DBUG_ENTER_METHOD(); + + long long int sec = tm_to_time_gm(time, truncated); + + DBUG_PRINT("info", ("mroonga: sec=%lld", sec)); + DBUG_PRINT("info", ("mroonga: usec=%d", usec)); + + long long int grn_time = *truncated ? 0 : GRN_TIME_PACK(sec, usec); + + DBUG_RETURN(grn_time); + } + + long long int TimeConverter::mysql_time_to_grn_time(MYSQL_TIME *mysql_time, + bool *truncated) { + MRN_DBUG_ENTER_METHOD(); + + int usec = mysql_time->second_part; + long long int grn_time = 0; + + *truncated = false; + switch (mysql_time->time_type) { + case MYSQL_TIMESTAMP_DATE: + { + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_DATE")); + struct tm date; + memset(&date, 0, sizeof(struct tm)); + date.tm_year = mysql_time->year - TM_YEAR_BASE; + if (mysql_time->month > 0) { + date.tm_mon = mysql_time->month - 1; + } else { + date.tm_mon = 0; + *truncated = true; + } + if (mysql_time->day > 0) { + date.tm_mday = mysql_time->day; + } else { + date.tm_mday = 1; + *truncated = true; + } + DBUG_PRINT("info", ("mroonga: tm_year=%d", date.tm_year)); + DBUG_PRINT("info", ("mroonga: tm_mon=%d", date.tm_mon)); + DBUG_PRINT("info", ("mroonga: tm_mday=%d", date.tm_mday)); + bool tm_truncated = false; + grn_time = tm_to_grn_time(&date, usec, &tm_truncated); + if (tm_truncated) { + *truncated = true; + } + } + break; + case MYSQL_TIMESTAMP_DATETIME: + { + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_DATETIME")); + struct tm datetime; + memset(&datetime, 0, sizeof(struct tm)); + datetime.tm_year = mysql_time->year - TM_YEAR_BASE; + if (mysql_time->month > 0) { + datetime.tm_mon = mysql_time->month - 1; + } else { + datetime.tm_mon = 0; + *truncated = true; + } + if (mysql_time->day > 0) { + datetime.tm_mday = mysql_time->day; + } else { + datetime.tm_mday = 1; + *truncated = true; + } + datetime.tm_hour = mysql_time->hour; + datetime.tm_min = mysql_time->minute; + datetime.tm_sec = mysql_time->second; + DBUG_PRINT("info", ("mroonga: tm_year=%d", datetime.tm_year)); + DBUG_PRINT("info", ("mroonga: tm_mon=%d", datetime.tm_mon)); + DBUG_PRINT("info", ("mroonga: tm_mday=%d", datetime.tm_mday)); + DBUG_PRINT("info", ("mroonga: tm_hour=%d", datetime.tm_hour)); + DBUG_PRINT("info", ("mroonga: tm_min=%d", datetime.tm_min)); + DBUG_PRINT("info", ("mroonga: tm_sec=%d", datetime.tm_sec)); + bool tm_truncated = false; + grn_time = tm_to_grn_time(&datetime, usec, &tm_truncated); + if (tm_truncated) { + *truncated = true; + } + } + break; + case MYSQL_TIMESTAMP_TIME: + { + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_TIME")); + int sec = + mysql_time->hour * 60 * 60 + + mysql_time->minute * 60 + + mysql_time->second; + DBUG_PRINT("info", ("mroonga: sec=%d", sec)); + grn_time = GRN_TIME_PACK(sec, usec); + if (mysql_time->neg) { + grn_time = -grn_time; + } + } + break; + default: + DBUG_PRINT("info", ("mroonga: default")); + grn_time = 0; + break; + } + + DBUG_RETURN(grn_time); + } + + void TimeConverter::grn_time_to_mysql_time(long long int grn_time, + MYSQL_TIME *mysql_time) { + MRN_DBUG_ENTER_METHOD(); + long long int sec; + int usec; + GRN_TIME_UNPACK(grn_time, sec, usec); + DBUG_PRINT("info", ("mroonga: sec=%lld", sec)); + DBUG_PRINT("info", ("mroonga: usec=%d", usec)); + switch (mysql_time->time_type) { + case MYSQL_TIMESTAMP_DATE: + { + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_DATE")); + struct tm date; + time_t sec_t = sec; + // TODO: Add error check + gmtime_r(&sec_t, &date); + DBUG_PRINT("info", ("mroonga: tm_year=%d", date.tm_year)); + mysql_time->year = date.tm_year + TM_YEAR_BASE; + DBUG_PRINT("info", ("mroonga: tm_mon=%d", date.tm_mon)); + mysql_time->month = date.tm_mon + 1; + DBUG_PRINT("info", ("mroonga: tm_mday=%d", date.tm_mday)); + mysql_time->day = date.tm_mday; + } + break; + case MYSQL_TIMESTAMP_DATETIME: + { + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_DATETIME")); + struct tm date; + time_t sec_t = sec; + // TODO: Add error check + gmtime_r(&sec_t, &date); + DBUG_PRINT("info", ("mroonga: tm_year=%d", date.tm_year)); + mysql_time->year = date.tm_year + TM_YEAR_BASE; + DBUG_PRINT("info", ("mroonga: tm_mon=%d", date.tm_mon)); + mysql_time->month = date.tm_mon + 1; + DBUG_PRINT("info", ("mroonga: tm_mday=%d", date.tm_mday)); + mysql_time->day = date.tm_mday; + DBUG_PRINT("info", ("mroonga: tm_hour=%d", date.tm_hour)); + mysql_time->hour = date.tm_hour; + DBUG_PRINT("info", ("mroonga: tm_min=%d", date.tm_min)); + mysql_time->minute = date.tm_min; + DBUG_PRINT("info", ("mroonga: tm_sec=%d", date.tm_sec)); + mysql_time->second = date.tm_sec; + mysql_time->second_part = usec; + } + break; + case MYSQL_TIMESTAMP_TIME: + DBUG_PRINT("info", ("mroonga: MYSQL_TIMESTAMP_TIME")); + if (sec < 0) { + mysql_time->neg = true; + sec = -sec; + } + mysql_time->hour = static_cast(sec / 60 / 60); + mysql_time->minute = sec / 60 % 60; + mysql_time->second = sec % 60; + mysql_time->second_part = usec; + break; + default: + DBUG_PRINT("info", ("mroonga: default")); + break; + } + DBUG_VOID_RETURN; + } +} diff --git a/storage/mroonga/lib/mrn_time_converter.hpp b/storage/mroonga/lib/mrn_time_converter.hpp new file mode 100644 index 00000000000..c5c69a0a8ad --- /dev/null +++ b/storage/mroonga/lib/mrn_time_converter.hpp @@ -0,0 +1,47 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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_TIME_CONVERTER_HPP_ +#define MRN_TIME_CONVERTER_HPP_ + +#include +#include + +namespace mrn { + class TimeConverter { + public: + static const long long int TM_YEAR_BASE = 1900; + + TimeConverter(); + ~TimeConverter(); + + long long int mysql_time_to_grn_time(MYSQL_TIME *mysql_time, + bool *truncated); + + long long int tm_to_grn_time(struct tm *time, int usec, bool *truncated); + + void grn_time_to_mysql_time(long long int grn_time, MYSQL_TIME *mysql_time); + + private: + time_t tm_to_time_gm(struct tm *time, bool *truncated); + }; +} + +#endif /* MRN_TIME_CONVERTER_HPP_ */ diff --git a/storage/mroonga/lib/mrn_windows.hpp b/storage/mroonga/lib/mrn_windows.hpp new file mode 100644 index 00000000000..f6ae4490254 --- /dev/null +++ b/storage/mroonga/lib/mrn_windows.hpp @@ -0,0 +1,31 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2010-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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_WINDOWS_HPP_ +#define MRN_WINDOWS_HPP_ + +#if defined(_WIN32) || defined(_WIN64) +# define MRN_API __declspec(dllexport) +#else +# define MRN_API +#endif + +#endif /* MRN_WINDOWS_HPP_ */ diff --git a/storage/mroonga/mrn_constants.hpp b/storage/mroonga/mrn_constants.hpp new file mode 100644 index 00000000000..494e08721bd --- /dev/null +++ b/storage/mroonga/mrn_constants.hpp @@ -0,0 +1,47 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2011 Kentoku SHIBA + Copyright(C) 2011-2012 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_CONSTANTS_HPP_ +#define MRN_CONSTANTS_HPP_ + +#include + +#define MRN_BUFFER_SIZE 1024 +#define MRN_MAX_KEY_SIZE GRN_TABLE_MAX_KEY_SIZE +#if defined(MAX_PATH) +# define MRN_MAX_PATH_SIZE (MAX_PATH + 1) +#elif defined(PATH_MAX) +# define MRN_MAX_PATH_SIZE (PATH_MAX) +#elif defined(MAXPATHLEN) +# define MRN_MAX_PATH_SIZE (MAXPATHLEN) +#else +# define MRN_MAX_PATH_SIZE (256) +#endif +#define MRN_DB_FILE_SUFFIX ".mrn" +#define MRN_LOG_FILE_PATH "groonga.log" +#define MRN_COLUMN_NAME_ID "_id" +#define MRN_COLUMN_NAME_KEY "_key" +#define MRN_COLUMN_NAME_SCORE "_score" +#ifndef MRN_PARSER_DEFAULT +# define MRN_PARSER_DEFAULT "TokenBigram" +#endif + +#endif /* MRN_CONSTANTS_HPP_ */ diff --git a/storage/mroonga/mrn_err.h b/storage/mroonga/mrn_err.h new file mode 100644 index 00000000000..c2ca885407a --- /dev/null +++ b/storage/mroonga/mrn_err.h @@ -0,0 +1,32 @@ +/* Copyright(C) 2011 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 +*/ + +#ifndef MRN_ERR_H_ +#define MRN_ERR_H_ + +#define ER_MRN_INVALID_TABLE_PARAM_NUM 16501 +#define ER_MRN_INVALID_TABLE_PARAM_STR "The table parameter '%-.64s' is invalid" +#define ER_MRN_CHARSET_NOT_SUPPORT_NUM 16502 +#define ER_MRN_CHARSET_NOT_SUPPORT_STR "The character set '%s[%s]' is not supported by groonga" +#define ER_MRN_GEOMETRY_NOT_SUPPORT_NUM 16503 +#define ER_MRN_GEOMETRY_NOT_SUPPORT_STR "This geometry type is not supported. Groonga is supported point only" +#define ER_MRN_ERROR_FROM_GROONGA_NUM 16504 +#define ER_MRN_ERROR_FROM_GROONGA_STR "Error from Groonga [%s]" +#define ER_MRN_INVALID_NULL_VALUE_NUM 16505 +#define ER_MRN_INVALID_NULL_VALUE_STR "NULL value can't be used for %s" + +#endif /* MRN_ERR_H_ */ diff --git a/storage/mroonga/mrn_macro.hpp b/storage/mroonga/mrn_macro.hpp new file mode 100644 index 00000000000..b20fdb4c140 --- /dev/null +++ b/storage/mroonga/mrn_macro.hpp @@ -0,0 +1,30 @@ +/* + Copyright(C) 2012 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_MACRO_HPP_ +#define MRN_MACRO_HPP_ + +#ifdef __cplusplus +# define MRN_BEGIN_DECLS extern "C" { +# define MRN_END_DECLS } +#else +# define MRN_BEGIN_DECLS +# define MRN_END_DECLS +#endif + +#endif /* MRN_MACRO_HPP_ */ diff --git a/storage/mroonga/mrn_mysql.h b/storage/mroonga/mrn_mysql.h new file mode 100644 index 00000000000..cf2a54621bb --- /dev/null +++ b/storage/mroonga/mrn_mysql.h @@ -0,0 +1,83 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 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_MYSQL_H_ +#define MRN_MYSQL_H_ + +#ifdef HAVE_CONFIG_H +# include +/* We need to undefine them because my_config.h defines them. :< */ +# undef VERSION +# undef PACKAGE +# undef PACKAGE_BUGREPORT +# undef PACKAGE_NAME +# undef PACKAGE_STRING +# undef PACKAGE_TARNAME +# undef PACKAGE_VERSION +#endif + +#include + +#ifdef FORCE_FAST_MUTEX_DISABLED +# ifdef MY_PTHREAD_FASTMUTEX +# undef MY_PTHREAD_FASTMUTEX +# endif +#endif + +#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 + +#if MYSQL_VERSION_ID >= 50607 +# if !defined(MRN_MARIADB_P) +# define MRN_HAVE_SQL_OPTIMIZER_H +# endif +#endif + +#define MRN_MESSAGE_BUFFER_SIZE 1024 + +#define MRN_DBUG_ENTER_FUNCTION() DBUG_ENTER(__FUNCTION__) + +#if !defined(DBUG_OFF) && !defined(_lint) +# define MRN_DBUG_ENTER_METHOD() \ + char method_name[MRN_MESSAGE_BUFFER_SIZE]; \ + method_name[0] = '\0'; \ + strcat(method_name, MRN_CLASS_NAME); \ + strcat(method_name, "::"); \ + strcat(method_name, __FUNCTION__); \ + DBUG_ENTER(method_name) +#else +# define MRN_DBUG_ENTER_METHOD() MRN_DBUG_ENTER_FUNCTION() +#endif + +#endif /* MRN_MYSQL_H_ */ diff --git a/storage/mroonga/mrn_mysql_compat.h b/storage/mroonga/mrn_mysql_compat.h new file mode 100644 index 00000000000..7312dd70827 --- /dev/null +++ b/storage/mroonga/mrn_mysql_compat.h @@ -0,0 +1,143 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 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_MYSQL_COMPAT_H_ +#define MRN_MYSQL_COMPAT_H_ + +#include "mrn_mysql.h" + +#if MYSQL_VERSION_ID >= 50500 +# define my_free(PTR, FLAG) my_free(PTR) +#endif + +#if MYSQL_VERSION_ID < 50500 +# define mysql_mutex_lock(mutex) pthread_mutex_lock(mutex) +# define mysql_mutex_unlock(mutex) pthread_mutex_unlock(mutex) +#endif + +#if MYSQL_VERSION_ID >= 50604 +# define MRN_HAVE_MYSQL_TYPE_TIMESTAMP2 +# define MRN_HAVE_MYSQL_TYPE_DATETIME2 +# define MRN_HAVE_MYSQL_TYPE_TIME2 +#endif + +#if MYSQL_VERSION_ID < 50603 + typedef MYSQL_ERROR Sql_condition; +#endif + +#if defined(MRN_MARIADB_P) +# if MYSQL_VERSION_ID >= 50302 && MYSQL_VERSION_ID < 100000 + typedef COST_VECT Cost_estimate; +# endif +#endif + +#if MYSQL_VERSION_ID >= 50516 +# define MRN_PLUGIN_HAVE_FLAGS 1 +#endif + +// for MySQL < 5.5 +#ifndef MY_ALL_CHARSETS_SIZE +# define MY_ALL_CHARSETS_SIZE 256 +#endif + +#ifndef MRN_MARIADB_P + typedef char *range_id_t; +#endif + +#if MYSQL_VERSION_ID >= 50609 +# define MRN_KEY_HAS_USER_DEFINED_KEYPARTS +#endif + +#ifdef MRN_KEY_HAS_USER_DEFINED_KEYPARTS +# define KEY_N_KEY_PARTS(key) (key)->user_defined_key_parts +#else +# define KEY_N_KEY_PARTS(key) (key)->key_parts +#endif + +#if MYSQL_VERSION_ID < 100000 || !defined(MRN_MARIADB_P) +# define init_alloc_root(PTR, SZ1, SZ2, FLAG) init_alloc_root(PTR, SZ1, SZ2) +#endif + +#if MYSQL_VERSION_ID < 100002 || !defined(MRN_MARIADB_P) +# define GTS_TABLE 0 +#endif + +/* For MySQL 5.1. MySQL 5.1 doesn't have FN_LIBCHAR2. */ +#ifndef FN_LIBCHAR2 +# define FN_LIBCHAR2 FN_LIBCHAR +#endif + +#if MYSQL_VERSION_ID >= 50607 +# if MYSQL_VERSION_ID >= 100007 && defined(MRN_MARIADB_P) +# define MRN_GET_ERROR_MESSAGE thd_get_error_message(current_thd) +# define MRN_GET_CURRENT_ROW_FOR_WARNING(thd) thd_get_error_row(thd) +# else +# define MRN_GET_ERROR_MESSAGE current_thd->get_stmt_da()->message() +# define MRN_GET_CURRENT_ROW_FOR_WARNING(thd) thd->get_stmt_da()->current_row_for_warning() +# endif +#else +# if MYSQL_VERSION_ID >= 50500 +# define MRN_GET_ERROR_MESSAGE current_thd->stmt_da->message() +# define MRN_GET_CURRENT_ROW_FOR_WARNING(thd) thd->warning_info->current_row_for_warning() +# else +# define MRN_GET_ERROR_MESSAGE current_thd->main_da.message() +# define MRN_GET_CURRENT_ROW_FOR_WARNING(thd) thd->row_count +# endif +#endif + +#if MYSQL_VERSION_ID >= 50607 && !defined(MRN_MARIADB_P) +# define MRN_ITEM_HAVE_ITEM_NAME +#endif + +#if MYSQL_VERSION_ID >= 50500 && MYSQL_VERSION_ID < 50700 +# define MRN_HAVE_TABLE_DEF_CACHE +#endif + +#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100009 +# define MRN_HAVE_TDC_ACQUIRE_SHARE +#endif + +#if MYSQL_VERSION_ID >= 50613 +# define MRN_HAVE_ALTER_INFO +#endif + +#if MYSQL_VERSION_ID >= 50603 +# define MRN_HAVE_GET_TABLE_DEF_KEY +#endif + +#if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100004 +# define MRN_TABLE_SHARE_HAVE_LOCK_SHARE +#endif + +#if MYSQL_VERSION_ID >= 50404 +# define MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA +#endif + +#ifndef TIME_FUZZY_DATE +/* For MariaDB 10. */ +# ifdef TIME_FUZZY_DATES +# define TIME_FUZZY_DATE TIME_FUZZY_DATES +# endif +#endif + +#if MYSQL_VERSION_ID >= 100007 && defined(MRN_MARIADB_P) +# define MRN_USE_MYSQL_DATA_HOME +#endif + +#endif /* MRN_MYSQL_COMPAT_H_ */ diff --git a/storage/mroonga/mrn_sys.cpp b/storage/mroonga/mrn_sys.cpp new file mode 100644 index 00000000000..86cce1cc415 --- /dev/null +++ b/storage/mroonga/mrn_sys.cpp @@ -0,0 +1,88 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2011-2012 Kentoku SHIBA + Copyright(C) 2011 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 +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include "mrn_sys.hpp" + +bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value) +{ + int added; + bool succeed; + void *buf; + grn_hash_add(ctx, hash, (const char *)key, strlen(key), &buf, &added); + // duplicate check + if (added == 0) { + GRN_LOG(ctx, GRN_LOG_WARNING, "hash put duplicated (key=%s)", key); + succeed = false; + } else { + // store address of value + memcpy(buf, &value, sizeof(grn_obj *)); + GRN_LOG(ctx, GRN_LOG_DEBUG, "hash put (key=%s)", key); + succeed = true; + } + return succeed; +} + +bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value) +{ + bool found; + grn_id id; + void *buf; + id = grn_hash_get(ctx, hash, (const char *)key, strlen(key), &buf); + // key not found + if (id == GRN_ID_NIL) { + GRN_LOG(ctx, GRN_LOG_DEBUG, "hash get not found (key=%s)", key); + found = false; + } else { + // restore address of value + memcpy(value, buf, sizeof(grn_obj *)); + found = true; + } + return found; +} + +bool mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key) +{ + bool succeed; + grn_rc rc; + grn_id id; + id = grn_hash_get(ctx, hash, (const char*) key, strlen(key), NULL); + if (id == GRN_ID_NIL) { + GRN_LOG(ctx, GRN_LOG_WARNING, "hash remove not found (key=%s)", key); + succeed = false; + } else { + rc = grn_hash_delete_by_id(ctx, hash, id, NULL); + if (rc != GRN_SUCCESS) { + GRN_LOG(ctx, GRN_LOG_ERROR, "hash remove error (key=%s)", key); + succeed = false; + } else { + GRN_LOG(ctx, GRN_LOG_DEBUG, "hash remove (key=%s)", key); + succeed = true; + } + } + return succeed; +} diff --git a/storage/mroonga/mrn_sys.hpp b/storage/mroonga/mrn_sys.hpp new file mode 100644 index 00000000000..904421682ff --- /dev/null +++ b/storage/mroonga/mrn_sys.hpp @@ -0,0 +1,36 @@ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2011 Kentoku SHIBA + Copyright(C) 2011-2012 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_SYS_HPP_ +#define MRN_SYS_HPP_ + +#include +#include "mrn_macro.hpp" + +MRN_BEGIN_DECLS + +/* functions */ +bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value); +bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value); +bool mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key); + +MRN_END_DECLS + +#endif /* MRN_SYS_HPP_ */ diff --git a/storage/mroonga/mrn_table.cpp b/storage/mroonga/mrn_table.cpp new file mode 100644 index 00000000000..79e1c8388fb --- /dev/null +++ b/storage/mroonga/mrn_table.cpp @@ -0,0 +1,1129 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-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 +*/ + +#include + +#include "mrn_mysql.h" + +#if MYSQL_VERSION_ID >= 50500 +# include +# include +#endif +#include "mrn_err.h" +#include "mrn_sys.hpp" +#include "mrn_table.hpp" +#include "mrn_mysql_compat.h" +#include + +#if MYSQL_VERSION_ID >= 50603 && !defined(MRN_MARIADB_P) +# define MRN_HA_RESOLVE_BY_NAME(name) ha_resolve_by_name(NULL, (name), TRUE) +#else +# define MRN_HA_RESOLVE_BY_NAME(name) ha_resolve_by_name(NULL, (name)) +#endif + +#define LEX_STRING_IS_EMPTY(string) \ + ((string).length == 0 || !(string).str || (string).str[0] == '\0') + +#define MRN_DEFAULT_STR "DEFAULT" +#define MRN_DEFAULT_LEN (sizeof(MRN_DEFAULT_STR) - 1) +#define MRN_GROONGA_STR "GROONGA" +#define MRN_GROONGA_LEN (sizeof(MRN_GROONGA_STR) - 1) + +#ifdef MRN_HAVE_TABLE_DEF_CACHE +extern HASH *mrn_table_def_cache; +#endif + +#ifdef WIN32 +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE +extern PSI_mutex_key *mrn_table_share_lock_share; +# endif +# ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA +extern PSI_mutex_key *mrn_table_share_lock_ha_data; +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern HASH mrn_open_tables; +extern pthread_mutex_t mrn_open_tables_mutex; +extern HASH mrn_long_term_share; +extern pthread_mutex_t mrn_long_term_share_mutex; +extern char *mrn_default_parser; +extern char *mrn_default_wrapper_engine; +extern handlerton *mrn_hton_ptr; +extern HASH mrn_allocated_thds; +extern pthread_mutex_t mrn_allocated_thds_mutex; + +static char *mrn_get_string_between_quote(const char *ptr) +{ + const char *start_ptr, *end_ptr, *tmp_ptr, *esc_ptr; + bool find_flg = FALSE, esc_flg = FALSE; + MRN_DBUG_ENTER_FUNCTION(); + + start_ptr = strchr(ptr, '\''); + end_ptr = strchr(ptr, '"'); + if (start_ptr && (!end_ptr || start_ptr < end_ptr)) + { + tmp_ptr = ++start_ptr; + while (!find_flg) + { + if (!(end_ptr = strchr(tmp_ptr, '\''))) + DBUG_RETURN(NULL); + esc_ptr = tmp_ptr; + while (!find_flg) + { + esc_ptr = strchr(esc_ptr, '\\'); + if (!esc_ptr || esc_ptr > end_ptr) + find_flg = TRUE; + else if (esc_ptr == end_ptr - 1) + { + esc_flg = TRUE; + tmp_ptr = end_ptr + 1; + break; + } else { + esc_flg = TRUE; + esc_ptr += 2; + } + } + } + } else if (end_ptr) + { + start_ptr = end_ptr; + tmp_ptr = ++start_ptr; + while (!find_flg) + { + if (!(end_ptr = strchr(tmp_ptr, '"'))) + DBUG_RETURN(NULL); + esc_ptr = tmp_ptr; + while (!find_flg) + { + esc_ptr = strchr(esc_ptr, '\\'); + if (!esc_ptr || esc_ptr > end_ptr) + find_flg = TRUE; + else if (esc_ptr == end_ptr - 1) + { + esc_flg = TRUE; + tmp_ptr = end_ptr + 1; + break; + } else { + esc_flg = TRUE; + esc_ptr += 2; + } + } + } + } else + DBUG_RETURN(NULL); + + size_t length = end_ptr - start_ptr; + char *extracted_string = (char *)my_malloc(length + 1, MYF(MY_WME)); + if (esc_flg) { + size_t extracted_index = 0; + const char *current_ptr = start_ptr; + while (current_ptr < end_ptr) { + if (*current_ptr != '\\') { + extracted_string[extracted_index] = *current_ptr; + ++extracted_index; + current_ptr++; + continue; + } + + if (current_ptr + 1 == end_ptr) { + break; + } + + switch (*(current_ptr + 1)) + { + case 'b': + extracted_string[extracted_index] = '\b'; + break; + case 'n': + extracted_string[extracted_index] = '\n'; + break; + case 'r': + extracted_string[extracted_index] = '\r'; + break; + case 't': + extracted_string[extracted_index] = '\t'; + break; + default: + extracted_string[extracted_index] = *(current_ptr + 1); + break; + } + ++extracted_index; + } + } else { + memcpy(extracted_string, start_ptr, length); + extracted_string[length] = '\0'; + } + + DBUG_RETURN(extracted_string); +} + +#ifdef WITH_PARTITION_STORAGE_ENGINE +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_LEN]; + 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; + MRN_DBUG_ENTER_FUNCTION(); + *part_elem = NULL; + *sub_elem = NULL; + if (!part_info) + DBUG_VOID_RETURN; + + if (table_name && !memcmp(table_name + table_name_length - 5, "#TMP#", 5)) + tmp_flg = TRUE; + + DBUG_PRINT("info", ("mroonga table_name=%s", table_name)); + List_iterator part_it(part_info->partitions); + while ((*part_elem = part_it++)) + { + if ((*part_elem)->subpartitions.elements) + { + List_iterator sub_it((*part_elem)->subpartitions); + while ((*sub_elem = sub_it++)) + { + create_subpartition_name(tmp_name, table->s->path.str, + (*part_elem)->partition_name, (*sub_elem)->partition_name, + NORMAL_PART_NAME); + DBUG_PRINT("info", ("mroonga tmp_name=%s", tmp_name)); + if (table_name && !memcmp(table_name, tmp_name, table_name_length + 1)) + DBUG_VOID_RETURN; + if ( + tmp_flg && + table_name && + *(tmp_name + table_name_length - 5) == '\0' && + !memcmp(table_name, tmp_name, table_name_length - 5) + ) { + tmp_part_elem = *part_elem; + tmp_sub_elem = *sub_elem; + tmp_flg = FALSE; + tmp_find_flg = TRUE; + } + } + } else { + create_partition_name(tmp_name, table->s->path.str, + (*part_elem)->partition_name, NORMAL_PART_NAME, TRUE); + DBUG_PRINT("info", ("mroonga tmp_name=%s", tmp_name)); + if (table_name && !memcmp(table_name, tmp_name, table_name_length + 1)) + DBUG_VOID_RETURN; + if ( + tmp_flg && + table_name && + *(tmp_name + table_name_length - 5) == '\0' && + !memcmp(table_name, tmp_name, table_name_length - 5) + ) { + tmp_part_elem = *part_elem; + tmp_flg = FALSE; + tmp_find_flg = TRUE; + } + } + } + if (tmp_find_flg) + { + *part_elem = tmp_part_elem; + *sub_elem = tmp_sub_elem; + DBUG_PRINT("info", ("mroonga tmp find")); + DBUG_VOID_RETURN; + } + *part_elem = NULL; + *sub_elem = NULL; + DBUG_PRINT("info", ("mroonga no hit")); + DBUG_VOID_RETURN; +} +#endif + +#define MRN_PARAM_STR_LEN(name) name ## _length +#define MRN_PARAM_STR(title_name, param_name) \ + if (!strncasecmp(tmp_ptr, title_name, title_length)) \ + { \ + DBUG_PRINT("info", ("mroonga "title_name" start")); \ + if (!share->param_name) \ + { \ + if ((share->param_name = mrn_get_string_between_quote( \ + start_ptr))) \ + share->MRN_PARAM_STR_LEN(param_name) = strlen(share->param_name); \ + else { \ + error = ER_MRN_INVALID_TABLE_PARAM_NUM; \ + my_printf_error(error, ER_MRN_INVALID_TABLE_PARAM_STR, \ + MYF(0), tmp_ptr); \ + goto error; \ + } \ + DBUG_PRINT("info", ("mroonga "title_name"=%s", share->param_name)); \ + } \ + break; \ + } + +#define MRN_PARAM_STR_LIST(title_name, param_name, param_pos) \ + if (!strncasecmp(tmp_ptr, title_name, title_length)) \ + { \ + DBUG_PRINT("info", ("mroonga "title_name" start")); \ + if (share->param_name && !share->param_name[param_pos]) \ + { \ + if ((share->param_name[param_pos] = mrn_get_string_between_quote( \ + start_ptr))) \ + share->MRN_PARAM_STR_LEN(param_name)[param_pos] = \ + strlen(share->param_name[param_pos]); \ + else { \ + error = ER_MRN_INVALID_TABLE_PARAM_NUM; \ + my_printf_error(error, ER_MRN_INVALID_TABLE_PARAM_STR, \ + MYF(0), tmp_ptr); \ + goto error; \ + } \ + DBUG_PRINT("info", ("mroonga "title_name"[%d]=%s", param_pos, \ + share->param_name[param_pos])); \ + } \ + break; \ + } + +int mrn_parse_table_param(MRN_SHARE *share, TABLE *table) +{ + int i, error; + int title_length; + const char *sprit_ptr[2]; + const char *tmp_ptr, *start_ptr; +#ifdef WITH_PARTITION_STORAGE_ENGINE + partition_element *part_elem; + partition_element *sub_elem; +#endif + MRN_DBUG_ENTER_FUNCTION(); +#ifdef WITH_PARTITION_STORAGE_ENGINE + mrn_get_partition_info(share->table_name, share->table_name_length, table, + &part_elem, &sub_elem); +#endif +#ifdef WITH_PARTITION_STORAGE_ENGINE + for (i = 4; i > 0; i--) +#else + for (i = 2; i > 0; i--) +#endif + { + const char *params_string_value; + uint params_string_length; + switch (i) + { +#ifdef WITH_PARTITION_STORAGE_ENGINE + case 4: + if (!sub_elem || !sub_elem->part_comment) + continue; + DBUG_PRINT("info", ("mroonga create sub comment string")); + params_string_value = sub_elem->part_comment; + params_string_length = strlen(params_string_value); + DBUG_PRINT("info", + ("mroonga sub comment string=%s", params_string_value)); + break; + case 3: + if (!part_elem || !part_elem->part_comment) + continue; + DBUG_PRINT("info", ("mroonga create part comment string")); + params_string_value = part_elem->part_comment; + params_string_length = strlen(params_string_value); + DBUG_PRINT("info", + ("mroonga part comment string=%s", params_string_value)); + break; +#endif + case 2: + if (LEX_STRING_IS_EMPTY(table->s->comment)) + continue; + DBUG_PRINT("info", ("mroonga create comment string")); + params_string_value = table->s->comment.str; + params_string_length = table->s->comment.length; + DBUG_PRINT("info", + ("mroonga comment string=%.*s", + params_string_length, params_string_value)); + break; + default: + if (LEX_STRING_IS_EMPTY(table->s->connect_string)) + continue; + DBUG_PRINT("info", ("mroonga create connect_string string")); + params_string_value = table->s->connect_string.str; + params_string_length = table->s->connect_string.length; + DBUG_PRINT("info", + ("mroonga connect_string=%.*s", + params_string_length, params_string_value)); + break; + } + + if (!params_string_value) { + continue; + } + + { + std::string params_string(params_string_value, params_string_length); + sprit_ptr[0] = params_string.c_str(); + while (sprit_ptr[0]) + { + if ((sprit_ptr[1] = strchr(sprit_ptr[0], ','))) + { + sprit_ptr[1]++; + } + tmp_ptr = sprit_ptr[0]; + sprit_ptr[0] = sprit_ptr[1]; + while (*tmp_ptr == ' ' || *tmp_ptr == '\r' || + *tmp_ptr == '\n' || *tmp_ptr == '\t') + tmp_ptr++; + + if (*tmp_ptr == '\0') + continue; + + DBUG_PRINT("info", ("mroonga title_str=%s", tmp_ptr)); + title_length = 0; + start_ptr = tmp_ptr; + while (*start_ptr != ' ' && *start_ptr != '\'' && + *start_ptr != '"' && *start_ptr != '\0' && + *start_ptr != '\r' && *start_ptr != '\n' && + *start_ptr != '\t' && *start_ptr != ',') + { + title_length++; + start_ptr++; + } + DBUG_PRINT("info", ("mroonga title_length=%u", title_length)); + + switch (title_length) + { + case 6: + MRN_PARAM_STR("engine", engine); + break; + case 17: + MRN_PARAM_STR("default_tokenizer", default_tokenizer); + break; + default: + break; + } + } + } + } + + if (!share->engine && mrn_default_wrapper_engine) + { + share->engine_length = strlen(mrn_default_wrapper_engine); + if ( + !(share->engine = my_strndup(mrn_default_wrapper_engine, + share->engine_length, + MYF(MY_WME))) + ) { + error = HA_ERR_OUT_OF_MEM; + goto error; + } + } + + if (share->engine) + { + LEX_STRING engine_name; + if ( + ( + share->engine_length == MRN_DEFAULT_LEN && + !strncasecmp(share->engine, MRN_DEFAULT_STR, MRN_DEFAULT_LEN) + ) || + ( + share->engine_length == MRN_GROONGA_LEN && + !strncasecmp(share->engine, MRN_GROONGA_STR, MRN_GROONGA_LEN) + ) + ) { + my_free(share->engine, MYF(0)); + share->engine = NULL; + share->engine_length = 0; + } else { + engine_name.str = share->engine; + engine_name.length = share->engine_length; + if (!(share->plugin = MRN_HA_RESOLVE_BY_NAME(&engine_name))) + { + my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), share->engine); + error = ER_UNKNOWN_STORAGE_ENGINE; + goto error; + } + share->hton = plugin_data(share->plugin, handlerton *); + share->wrapper_mode = TRUE; + } + } + + DBUG_RETURN(0); + +error: + DBUG_RETURN(error); +} + +bool mrn_is_geo_key(const KEY *key_info) +{ + return key_info->algorithm == HA_KEY_ALG_UNDEF && + KEY_N_KEY_PARTS(key_info) == 1 && + key_info->key_part[0].field->type() == MYSQL_TYPE_GEOMETRY; +} + +int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i) +{ + int error; + char *param_string = NULL; +#if MYSQL_VERSION_ID >= 50500 + int title_length; + char *sprit_ptr[2]; + char *tmp_ptr, *start_ptr; +#endif + MRN_DBUG_ENTER_FUNCTION(); + +#if MYSQL_VERSION_ID >= 50500 + if (key_info->comment.length == 0) + { + if (share->key_parser[i]) { + my_free(share->key_parser[i], MYF(0)); + } + if ( + !(share->key_parser[i] = my_strdup(mrn_default_parser, MYF(MY_WME))) + ) { + error = HA_ERR_OUT_OF_MEM; + goto error; + } + share->key_parser_length[i] = strlen(share->key_parser[i]); + DBUG_RETURN(0); + } + DBUG_PRINT("info", ("mroonga create comment string")); + if ( + !(param_string = my_strndup(key_info->comment.str, + key_info->comment.length, + MYF(MY_WME))) + ) { + error = HA_ERR_OUT_OF_MEM; + goto error_alloc_param_string; + } + DBUG_PRINT("info", ("mroonga comment string=%s", param_string)); + + sprit_ptr[0] = param_string; + while (sprit_ptr[0]) + { + if ((sprit_ptr[1] = strchr(sprit_ptr[0], ','))) + { + *sprit_ptr[1] = '\0'; + sprit_ptr[1]++; + } + tmp_ptr = sprit_ptr[0]; + sprit_ptr[0] = sprit_ptr[1]; + while (*tmp_ptr == ' ' || *tmp_ptr == '\r' || + *tmp_ptr == '\n' || *tmp_ptr == '\t') + tmp_ptr++; + + if (*tmp_ptr == '\0') + continue; + + title_length = 0; + start_ptr = tmp_ptr; + while (*start_ptr != ' ' && *start_ptr != '\'' && + *start_ptr != '"' && *start_ptr != '\0' && + *start_ptr != '\r' && *start_ptr != '\n' && + *start_ptr != '\t') + { + title_length++; + start_ptr++; + } + + switch (title_length) + { + case 5: + MRN_PARAM_STR_LIST("table", index_table, i); + break; + case 6: + MRN_PARAM_STR_LIST("parser", key_parser, i); + break; + default: + break; + } + } +#endif + if (!share->key_parser[i]) { + if ( + !(share->key_parser[i] = my_strdup(mrn_default_parser, MYF(MY_WME))) + ) { + error = HA_ERR_OUT_OF_MEM; + goto error; + } + share->key_parser_length[i] = strlen(share->key_parser[i]); + } + + if (param_string) + my_free(param_string, MYF(0)); + DBUG_RETURN(0); + +error: + if (param_string) + my_free(param_string, MYF(0)); +#if MYSQL_VERSION_ID >= 50500 +error_alloc_param_string: +#endif + DBUG_RETURN(error); +} + +int mrn_parse_index_param(MRN_SHARE *share, TABLE *table) +{ + int error; + MRN_DBUG_ENTER_FUNCTION(); + for (uint i = 0; i < table->s->keys; i++) + { + KEY *key_info = &table->s->key_info[i]; + bool is_wrapper_mode = share->engine != NULL; + + if (is_wrapper_mode) { + if (!(key_info->flags & HA_FULLTEXT) && !mrn_is_geo_key(key_info)) { + continue; + } + } + + if ((error = mrn_add_index_param(share, key_info, i))) + goto error; + } + DBUG_RETURN(0); + +error: + DBUG_RETURN(error); +} + +int mrn_add_column_param(MRN_SHARE *share, Field *field, int i) +{ + int error; + char *param_string = NULL; + int title_length; + char *sprit_ptr[2]; + char *tmp_ptr, *start_ptr; + + MRN_DBUG_ENTER_FUNCTION(); + + if (share->wrapper_mode) { + DBUG_RETURN(0); + } + + DBUG_PRINT("info", ("mroonga create comment string")); + if ( + !(param_string = my_strndup(field->comment.str, + field->comment.length, + MYF(MY_WME))) + ) { + error = HA_ERR_OUT_OF_MEM; + goto error_alloc_param_string; + } + DBUG_PRINT("info", ("mroonga comment string=%s", param_string)); + + sprit_ptr[0] = param_string; + while (sprit_ptr[0]) + { + if ((sprit_ptr[1] = strchr(sprit_ptr[0], ','))) + { + *sprit_ptr[1] = '\0'; + sprit_ptr[1]++; + } + tmp_ptr = sprit_ptr[0]; + sprit_ptr[0] = sprit_ptr[1]; + while (*tmp_ptr == ' ' || *tmp_ptr == '\r' || + *tmp_ptr == '\n' || *tmp_ptr == '\t') + tmp_ptr++; + + if (*tmp_ptr == '\0') + continue; + + title_length = 0; + start_ptr = tmp_ptr; + while (*start_ptr != ' ' && *start_ptr != '\'' && + *start_ptr != '"' && *start_ptr != '\0' && + *start_ptr != '\r' && *start_ptr != '\n' && + *start_ptr != '\t') + { + title_length++; + start_ptr++; + } + + switch (title_length) + { + case 4: + MRN_PARAM_STR_LIST("type", col_type, i); + break; + case 5: + MRN_PARAM_STR_LIST("flags", col_flags, i); + break; + default: + break; + } + } + + if (param_string) + my_free(param_string, MYF(0)); + DBUG_RETURN(0); + +error: + if (param_string) + my_free(param_string, MYF(0)); +error_alloc_param_string: + DBUG_RETURN(error); +} + +int mrn_parse_column_param(MRN_SHARE *share, TABLE *table) +{ + int error; + MRN_DBUG_ENTER_FUNCTION(); + for (uint i = 0; i < table->s->fields; i++) + { + Field *field = table->s->field[i]; + + if (LEX_STRING_IS_EMPTY(field->comment)) { + continue; + } + + if ((error = mrn_add_column_param(share, field, i))) + goto error; + } + DBUG_RETURN(0); + +error: + DBUG_RETURN(error); +} + +int mrn_free_share_alloc( + MRN_SHARE *share +) { + uint i; + MRN_DBUG_ENTER_FUNCTION(); + if (share->engine) + my_free(share->engine, MYF(0)); + if (share->default_tokenizer) + my_free(share->default_tokenizer, MYF(0)); + for (i = 0; i < share->table_share->keys; i++) + { + if (share->index_table && share->index_table[i]) + my_free(share->index_table[i], MYF(0)); + if (share->key_parser[i]) + my_free(share->key_parser[i], MYF(0)); + } + for (i = 0; i < share->table_share->fields; i++) + { + if (share->col_flags && share->col_flags[i]) + my_free(share->col_flags[i], MYF(0)); + if (share->col_type && share->col_type[i]) + my_free(share->col_type[i], MYF(0)); + } + DBUG_RETURN(0); +} + +void mrn_free_long_term_share(MRN_LONG_TERM_SHARE *long_term_share) +{ + MRN_DBUG_ENTER_FUNCTION(); + { + mrn::Lock lock(&mrn_long_term_share_mutex); + my_hash_delete(&mrn_long_term_share, (uchar*) long_term_share); + } + pthread_mutex_destroy(&long_term_share->auto_inc_mutex); + my_free(long_term_share, MYF(0)); + DBUG_VOID_RETURN; +} + +MRN_LONG_TERM_SHARE *mrn_get_long_term_share(const char *table_name, + uint table_name_length, + int *error) +{ + MRN_LONG_TERM_SHARE *long_term_share; + char *tmp_name; + MRN_DBUG_ENTER_FUNCTION(); + DBUG_PRINT("info", ("mroonga: table_name=%s", table_name)); + mrn::Lock lock(&mrn_long_term_share_mutex); + if (!(long_term_share = (MRN_LONG_TERM_SHARE*) + my_hash_search(&mrn_long_term_share, (uchar*) table_name, + table_name_length))) + { + if (!(long_term_share = (MRN_LONG_TERM_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &long_term_share, sizeof(*long_term_share), + &tmp_name, table_name_length + 1, + NullS)) + ) { + *error = HA_ERR_OUT_OF_MEM; + goto error_alloc_long_term_share; + } + long_term_share->table_name = tmp_name; + long_term_share->table_name_length = table_name_length; + memcpy(long_term_share->table_name, table_name, table_name_length); + if (pthread_mutex_init(&long_term_share->auto_inc_mutex, + MY_MUTEX_INIT_FAST)) + { + *error = HA_ERR_OUT_OF_MEM; + goto error_init_auto_inc_mutex; + } + if (my_hash_insert(&mrn_long_term_share, (uchar*) long_term_share)) + { + *error = HA_ERR_OUT_OF_MEM; + goto error_hash_insert; + } + } + DBUG_RETURN(long_term_share); + +error_hash_insert: + pthread_mutex_destroy(&long_term_share->auto_inc_mutex); +error_init_auto_inc_mutex: + my_free(long_term_share, MYF(0)); +error_alloc_long_term_share: + DBUG_RETURN(NULL); +} + +MRN_SHARE *mrn_get_share(const char *table_name, TABLE *table, int *error) +{ + MRN_SHARE *share; + char *tmp_name, **index_table, **key_parser, **col_flags, **col_type; + uint length, *wrap_key_nr, *index_table_length; + uint *key_parser_length, *col_flags_length, *col_type_length, i, j; + KEY *wrap_key_info; + TABLE_SHARE *wrap_table_share; + MRN_DBUG_ENTER_FUNCTION(); + length = (uint) strlen(table_name); + mrn::Lock lock(&mrn_open_tables_mutex); + if (!(share = (MRN_SHARE*) my_hash_search(&mrn_open_tables, + (uchar*) table_name, length))) + { + if (!(share = (MRN_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &share, sizeof(*share), + &tmp_name, length + 1, + &index_table, sizeof(char *) * table->s->keys, + &index_table_length, sizeof(uint) * table->s->keys, + &key_parser, sizeof(char *) * table->s->keys, + &key_parser_length, sizeof(uint) * table->s->keys, + &col_flags, sizeof(char *) * table->s->fields, + &col_flags_length, sizeof(uint) * table->s->fields, + &col_type, sizeof(char *) * table->s->fields, + &col_type_length, sizeof(uint) * table->s->fields, + &wrap_key_nr, sizeof(*wrap_key_nr) * table->s->keys, + &wrap_key_info, sizeof(*wrap_key_info) * table->s->keys, + &wrap_table_share, sizeof(*wrap_table_share), + NullS)) + ) { + *error = HA_ERR_OUT_OF_MEM; + goto error_alloc_share; + } + share->use_count = 0; + share->table_name_length = length; + share->table_name = tmp_name; + share->index_table = index_table; + share->index_table_length = index_table_length; + share->key_parser = key_parser; + share->key_parser_length = key_parser_length; + share->col_flags = col_flags; + share->col_flags_length = col_flags_length; + share->col_type = col_type; + share->col_type_length = col_type_length; + strmov(share->table_name, table_name); + share->table_share = table->s; + + if ( + (*error = mrn_parse_table_param(share, table)) || + (*error = mrn_parse_column_param(share, table)) || + (*error = mrn_parse_index_param(share, table)) + ) + goto error_parse_table_param; + + if (share->wrapper_mode) + { + j = 0; + for (i = 0; i < table->s->keys; i++) + { + if (table->s->key_info[i].algorithm != HA_KEY_ALG_FULLTEXT && + !mrn_is_geo_key(&table->s->key_info[i])) + { + wrap_key_nr[i] = j; + memcpy(&wrap_key_info[j], &table->s->key_info[i], + sizeof(*wrap_key_info)); + j++; + } else { + wrap_key_nr[i] = MAX_KEY; + } + } + share->wrap_keys = j; + share->base_keys = table->s->keys; + share->base_key_info = table->s->key_info; + share->base_primary_key = table->s->primary_key; + if (i) + { + share->wrap_key_nr = wrap_key_nr; + share->wrap_key_info = wrap_key_info; + if (table->s->primary_key == MAX_KEY) + share->wrap_primary_key = MAX_KEY; + else + share->wrap_primary_key = wrap_key_nr[table->s->primary_key]; + } else { + share->wrap_key_nr = NULL; + share->wrap_key_info = NULL; + share->wrap_primary_key = MAX_KEY; + } + memcpy(wrap_table_share, table->s, sizeof(*wrap_table_share)); + wrap_table_share->keys = share->wrap_keys; + wrap_table_share->key_info = share->wrap_key_info; + wrap_table_share->primary_key = share->wrap_primary_key; + wrap_table_share->keys_in_use.init(share->wrap_keys); + wrap_table_share->keys_for_keyread.init(share->wrap_keys); +#ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE +# ifdef WIN32 + mysql_mutex_init(*mrn_table_share_lock_share, + &(wrap_table_share->LOCK_share), MY_MUTEX_INIT_SLOW); +# else + mysql_mutex_init(key_TABLE_SHARE_LOCK_share, + &(wrap_table_share->LOCK_share), MY_MUTEX_INIT_SLOW); +# endif +#endif +#ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA +# ifdef WIN32 + mysql_mutex_init(*mrn_table_share_lock_ha_data, + &(wrap_table_share->LOCK_ha_data), MY_MUTEX_INIT_FAST); +# else + mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data, + &(wrap_table_share->LOCK_ha_data), MY_MUTEX_INIT_FAST); +# endif +#endif + share->wrap_table_share = wrap_table_share; + } + + if (pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST)) + { + *error = HA_ERR_OUT_OF_MEM; + goto error_init_mutex; + } + thr_lock_init(&share->lock); + if (!(share->long_term_share = mrn_get_long_term_share(table_name, length, + error))) + { + goto error_get_long_term_share; + } + if (my_hash_insert(&mrn_open_tables, (uchar*) share)) + { + *error = HA_ERR_OUT_OF_MEM; + goto error_hash_insert; + } + } + share->use_count++; + DBUG_RETURN(share); + +error_hash_insert: +error_get_long_term_share: + pthread_mutex_destroy(&share->mutex); +error_init_mutex: +error_parse_table_param: + mrn_free_share_alloc(share); + my_free(share, MYF(0)); +error_alloc_share: + DBUG_RETURN(NULL); +} + +int mrn_free_share(MRN_SHARE *share) +{ + MRN_DBUG_ENTER_FUNCTION(); + mrn::Lock lock(&mrn_open_tables_mutex); + if (!--share->use_count) + { + my_hash_delete(&mrn_open_tables, (uchar*) share); + if (share->wrapper_mode) + plugin_unlock(NULL, share->plugin); + mrn_free_share_alloc(share); + thr_lock_delete(&share->lock); + pthread_mutex_destroy(&share->mutex); + if (share->wrapper_mode) { +#ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE + mysql_mutex_destroy(&(share->wrap_table_share->LOCK_share)); +#endif +#ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA + mysql_mutex_destroy(&(share->wrap_table_share->LOCK_ha_data)); +#endif + } + my_free(share, MYF(0)); + } + DBUG_RETURN(0); +} + +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 + const char *key; + key_length = get_table_def_key(table_list, &key); +#else + char key[MAX_DBKEY_LENGTH]; + key_length = create_table_def_key(thd, key, table_list, FALSE); +#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) + 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 + share = get_table_share(thd, table_list, key, key_length, 0, error); +#endif + DBUG_RETURN(share); +} + +TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path, + int *error) +{ + uint key_length; + TABLE_SHARE *share; + THD *thd = current_thd; + + MRN_DBUG_ENTER_FUNCTION(); +#ifdef MRN_HAVE_GET_TABLE_DEF_KEY + const char *key; + key_length = get_table_def_key(table_list, &key); +#else + char key[MAX_DBKEY_LENGTH]; + key_length = create_table_def_key(thd, key, table_list, FALSE); +#endif +#if MYSQL_VERSION_ID >= 100002 && defined(MRN_MARIADB_P) + share = alloc_table_share(table_list->db, table_list->table_name, key, + key_length); +#else + share = alloc_table_share(table_list, key, key_length); +#endif + if (!share) + { + *error = ER_CANT_OPEN_FILE; + DBUG_RETURN(NULL); + } + share->tmp_table = INTERNAL_TMP_TABLE; // TODO: is this right? + share->path.str = (char *) path; + share->path.length = strlen(path); + share->normalized_path.str = share->path.str; + share->normalized_path.length = share->path.length; + if (open_table_def(thd, share, GTS_TABLE)) + { + *error = ER_CANT_OPEN_FILE; + DBUG_RETURN(NULL); + } + DBUG_RETURN(share); +} + +void mrn_free_tmp_table_share(TABLE_SHARE *tmp_table_share) +{ + MRN_DBUG_ENTER_FUNCTION(); + free_table_share(tmp_table_share); + DBUG_VOID_RETURN; +} + +KEY *mrn_create_key_info_for_table(MRN_SHARE *share, TABLE *table, int *error) +{ + uint *wrap_key_nr = share->wrap_key_nr, i, j; + KEY *wrap_key_info; + MRN_DBUG_ENTER_FUNCTION(); + if (share->wrap_keys) + { + if (!(wrap_key_info = (KEY *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &wrap_key_info, sizeof(*wrap_key_info) * share->wrap_keys, + NullS)) + ) { + *error = HA_ERR_OUT_OF_MEM; + DBUG_RETURN(NULL); + } + for (i = 0; i < table->s->keys; i++) + { + j = wrap_key_nr[i]; + if (j < MAX_KEY) + { + memcpy(&wrap_key_info[j], &table->key_info[i], + sizeof(*wrap_key_info)); + } + } + } else + wrap_key_info = NULL; + *error = 0; + DBUG_RETURN(wrap_key_info); +} + +void mrn_set_bitmap_by_key(MY_BITMAP *map, KEY *key_info) +{ + uint i; + MRN_DBUG_ENTER_FUNCTION(); + for (i = 0; i < KEY_N_KEY_PARTS(key_info); i++) + { + Field *field = key_info->key_part[i].field; + bitmap_set_bit(map, field->field_index); + } + DBUG_VOID_RETURN; +} + +st_mrn_slot_data *mrn_get_slot_data(THD *thd, bool can_create) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_slot_data *slot_data = + (st_mrn_slot_data*) *thd_ha_data(thd, mrn_hton_ptr); + if (slot_data == NULL) { + slot_data = (st_mrn_slot_data*) malloc(sizeof(st_mrn_slot_data)); + slot_data->last_insert_record_id = GRN_ID_NIL; + slot_data->first_alter_share = NULL; + slot_data->alter_create_info = NULL; + slot_data->disable_keys_create_info = NULL; + slot_data->alter_connect_string = NULL; + slot_data->alter_comment = NULL; + *thd_ha_data(thd, mrn_hton_ptr) = (void *) slot_data; + { + mrn::Lock lock(&mrn_allocated_thds_mutex); + if (my_hash_insert(&mrn_allocated_thds, (uchar*) thd)) + { + free(slot_data); + DBUG_RETURN(NULL); + } + } + } + DBUG_RETURN(slot_data); +} + +void mrn_clear_alter_share(THD *thd) +{ + MRN_DBUG_ENTER_FUNCTION(); + st_mrn_slot_data *slot_data = mrn_get_slot_data(thd, FALSE); + if (slot_data) { + if (slot_data->first_alter_share) { + st_mrn_alter_share *tmp_alter_share; + st_mrn_alter_share *alter_share = slot_data->first_alter_share; + while (alter_share) + { + tmp_alter_share = alter_share->next; + mrn_free_tmp_table_share(alter_share->alter_share); + free(alter_share); + alter_share = tmp_alter_share; + } + slot_data->first_alter_share = NULL; + } + slot_data->alter_create_info = NULL; + slot_data->disable_keys_create_info = NULL; + if (slot_data->alter_connect_string) { + my_free(slot_data->alter_connect_string, MYF(0)); + slot_data->alter_connect_string = NULL; + } + if (slot_data->alter_comment) { + my_free(slot_data->alter_comment, MYF(0)); + slot_data->alter_comment = NULL; + } + } + DBUG_VOID_RETURN; +} + +#ifdef __cplusplus +} +#endif diff --git a/storage/mroonga/mrn_table.hpp b/storage/mroonga/mrn_table.hpp new file mode 100644 index 00000000000..25fffa914a0 --- /dev/null +++ b/storage/mroonga/mrn_table.hpp @@ -0,0 +1,172 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2011-2013 Kentoku SHIBA + Copyright(C) 2011-2013 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_TABLE_HPP_ +#define MRN_TABLE_HPP_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct st_mroonga_long_term_share +{ + char *table_name; + uint table_name_length; + + // for auto_increment (storage mode only) + pthread_mutex_t auto_inc_mutex; + bool auto_inc_inited; + ulonglong auto_inc_value; +} MRN_LONG_TERM_SHARE; + +typedef struct st_mroonga_share +{ + char *table_name; + uint table_name_length; + uint use_count; + pthread_mutex_t mutex; + THR_LOCK lock; + TABLE_SHARE *table_share; + TABLE_SHARE *wrap_table_share; + MRN_LONG_TERM_SHARE *long_term_share; + + char *engine; + int engine_length; + char *default_tokenizer; + int default_tokenizer_length; + plugin_ref plugin; + handlerton *hton; + char **index_table; + char **key_parser; + char **col_flags; + char **col_type; + uint *index_table_length; + uint *key_parser_length; + uint *col_flags_length; + uint *col_type_length; + uint *wrap_key_nr; + uint wrap_keys; + uint base_keys; + KEY *wrap_key_info; + KEY *base_key_info; + uint wrap_primary_key; + uint base_primary_key; + bool wrapper_mode; + bool disable_keys; +} MRN_SHARE; + +struct st_mrn_alter_share +{ + char path[FN_REFLEN + 1]; + TABLE_SHARE *alter_share; + st_mrn_alter_share *next; +}; + +struct st_mrn_slot_data +{ + grn_id last_insert_record_id; + st_mrn_alter_share *first_alter_share; + HA_CREATE_INFO *alter_create_info; + HA_CREATE_INFO *disable_keys_create_info; + char *alter_connect_string; + char *alter_comment; +}; + +#define MRN_SET_WRAP_ALTER_KEY(file, ha_alter_info) \ + Alter_inplace_info::HA_ALTER_FLAGS base_handler_flags = ha_alter_info->handler_flags; \ + KEY *base_key_info_buffer = ha_alter_info->key_info_buffer; \ + uint base_key_count = ha_alter_info->key_count; \ + uint base_index_drop_count = ha_alter_info->index_drop_count; \ + KEY **base_index_drop_buffer = ha_alter_info->index_drop_buffer; \ + uint base_index_add_count = ha_alter_info->index_add_count; \ + uint *base_index_add_buffer = ha_alter_info->index_add_buffer; \ + ha_alter_info->handler_flags = file->alter_handler_flags; \ + ha_alter_info->key_info_buffer = file->alter_key_info_buffer; \ + ha_alter_info->key_count = file->alter_key_count; \ + ha_alter_info->index_drop_count = file->alter_index_drop_count; \ + ha_alter_info->index_drop_buffer = &file->alter_index_drop_buffer; \ + ha_alter_info->index_add_count = file->alter_index_add_count; \ + ha_alter_info->index_add_buffer = file->alter_index_add_buffer; + +#define MRN_SET_BASE_ALTER_KEY(share, table_share) \ + ha_alter_info->handler_flags = base_handler_flags; \ + ha_alter_info->key_info_buffer = base_key_info_buffer; \ + ha_alter_info->key_count = base_key_count; \ + ha_alter_info->index_drop_count = base_index_drop_count; \ + ha_alter_info->index_drop_buffer = base_index_drop_buffer; \ + ha_alter_info->index_add_count = base_index_add_count; \ + ha_alter_info->index_add_buffer = base_index_add_buffer; + +#define MRN_SET_WRAP_SHARE_KEY(share, table_share) +/* + table_share->keys = share->wrap_keys; \ + table_share->key_info = share->wrap_key_info; \ + table_share->primary_key = share->wrap_primary_key; +*/ + +#define MRN_SET_BASE_SHARE_KEY(share, table_share) +/* + table_share->keys = share->base_keys; \ + table_share->key_info = share->base_key_info; \ + table_share->primary_key = share->base_primary_key; +*/ + +#define MRN_SET_WRAP_TABLE_KEY(file, table) \ + table->key_info = file->wrap_key_info; \ + table->s = share->wrap_table_share; + +#define MRN_SET_BASE_TABLE_KEY(file, table) \ + table->key_info = file->base_key_info; \ + table->s = share->table_share; + +#ifdef WITH_PARTITION_STORAGE_ENGINE +void mrn_get_partition_info(const char *table_name, uint table_name_length, + const TABLE *table, partition_element **part_elem, + partition_element **sub_elem); +#endif +int mrn_parse_table_param(MRN_SHARE *share, TABLE *table); +bool mrn_is_geo_key(const KEY *key_info); +int mrn_add_index_param(MRN_SHARE *share, KEY *key_info, int i); +int mrn_parse_index_param(MRN_SHARE *share, TABLE *table); +int mrn_add_column_param(MRN_SHARE *share, Field *field, int i); +int mrn_parse_column_param(MRN_SHARE *share, TABLE *table); +MRN_SHARE *mrn_get_share(const char *table_name, TABLE *table, int *error); +int mrn_free_share_alloc(MRN_SHARE *share); +int mrn_free_share(MRN_SHARE *share); +MRN_LONG_TERM_SHARE *mrn_get_long_term_share(const char *table_name, + uint table_name_length, + int *error); +void mrn_free_long_term_share(MRN_LONG_TERM_SHARE *long_term_share); +TABLE_SHARE *mrn_get_table_share(TABLE_LIST *table_list, int *error); +TABLE_SHARE *mrn_create_tmp_table_share(TABLE_LIST *table_list, const char *path, + int *error); +void mrn_free_tmp_table_share(TABLE_SHARE *table_share); +KEY *mrn_create_key_info_for_table(MRN_SHARE *share, TABLE *table, int *error); +void mrn_set_bitmap_by_key(MY_BITMAP *map, KEY *key_info); +st_mrn_slot_data *mrn_get_slot_data(THD *thd, bool can_create); +void mrn_clear_alter_share(THD *thd); + +#ifdef __cplusplus +} +#endif + +#endif /* MRN_TABLE_HPP_ */ diff --git a/storage/mroonga/mrn_version.h.in b/storage/mroonga/mrn_version.h.in new file mode 100644 index 00000000000..dfa0e2dffd5 --- /dev/null +++ b/storage/mroonga/mrn_version.h.in @@ -0,0 +1,40 @@ +/* + Copyright(C) 2011 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_VERSION_H_ +#define MRN_VERSION_H_ + +/* Define mroonga version in string */ +#define MRN_VERSION "@MRN_VERSION@" + +/* Define mroonga version in hex */ +#define MRN_VERSION_IN_HEX @MRN_VERSION_IN_HEX@ + +/* Define mroonga major version */ +#define MRN_VERSION_MAJOR @MRN_VERSION_MAJOR@ + +/* Define mroonga minor version */ +#define MRN_VERSION_MINOR @MRN_VERSION_MINOR@ + +/* Define mroonga micro version */ +#define MRN_VERSION_MICRO @MRN_VERSION_MICRO@ + +/* Define to the full name and version of this package. */ +#define MRN_PACKAGE_STRING "@MRN_PACKAGE_STRING@" + +#endif /* MRN_VERSION_H_ */ diff --git a/storage/mroonga/mysql-test/Makefile.am b/storage/mroonga/mysql-test/Makefile.am new file mode 100644 index 00000000000..9ea677b579a --- /dev/null +++ b/storage/mroonga/mysql-test/Makefile.am @@ -0,0 +1,8 @@ +dist-hook: + if [ -n "`find mroonga -name '*.reject'`" ]; then \ + echo "reject files exist"; \ + exit 1; \ + fi + +EXTRA_DIST = \ + mroonga diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc new file mode 100644 index 00000000000..89700a87cff --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc @@ -0,0 +1,19 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--disable_query_log +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 new file mode 100644 index 00000000000..94cf42dd5ab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc @@ -0,0 +1,26 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_windows.inc + +--disable_query_log +if ($VERSION_COMPILE_OS_WIN) { + let ha_mroonga_so='ha_mroonga.dll'; +} +if (!$VERSION_COMPILE_OS_WIN) { + let ha_mroonga_so='ha_mroonga.so'; +} +--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 new file mode 100644 index 00000000000..13b2f3439e1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc @@ -0,0 +1,19 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--disable_query_log +let $mariadb = `SELECT LOCATE('MariaDB', @@global.version) > 0`; +--enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc new file mode 100644 index 00000000000..8b8387a74fb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc @@ -0,0 +1,19 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--disable_query_log +let $VERSION_COMPILE_OS_OSX=`SELECT IF(@@version_compile_os like 'osx%', 1, 0);`; +--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 new file mode 100644 index 00000000000..b59a981d822 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc @@ -0,0 +1,28 @@ +# Copyright(C) 2012-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_100 = `SELECT $version_major_minor = 10.0`; + +let $version_55_or_later = `SELECT $version_major_minor >= 5.5`; +let $version_56_or_later = `SELECT $version_major_minor >= 5.6`; +let $version_100_or_later = `SELECT $version_major_minor >= 10.0`; +--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 new file mode 100644 index 00000000000..21e61000a06 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc @@ -0,0 +1,20 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--disable_query_log +let $VERSION_COMPILE_OS_WIN=`SELECT IF(@@version_compile_os like 'Win%', 1, 0)`; +--enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc new file mode 100644 index 00000000000..41ab6bf4899 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_32bit.inc @@ -0,0 +1,28 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_64bit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc new file mode 100644 index 00000000000..3774de2f479 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_64bit.inc @@ -0,0 +1,25 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +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 64 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 new file mode 100644 index 00000000000..c4764b83c8a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc @@ -0,0 +1,32 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_mariadb.inc +--source ../../include/mroonga/check_version.inc + +if ($mariadb) { + let $fractional_seconds = 1; +} + +if (!$mariadb) { + if ($version_56) { + 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; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc new file mode 100644 index 00000000000..dfe198ca9ba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc @@ -0,0 +1,21 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_freebsd.inc + +if (!$VERSION_COMPILE_OS_FREEBSD) { + skip Need OS FreeBSD; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fulltext_index_comment.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fulltext_index_comment.inc new file mode 100644 index 00000000000..e8c79936cc6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fulltext_index_comment.inc @@ -0,0 +1,25 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if ($version_55_or_later) { + let $fulltext_index_comment = 1; +} + +if (!$fulltext_index_comment) { + skip Fulltext index comment is available in version 5.5 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 new file mode 100644 index 00000000000..2ebec2df8c4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc @@ -0,0 +1,44 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2013-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_ha_mroonga_so.inc + +disable_query_log; + +let have_mroonga_storage_engine=`SELECT 1 FROM information_schema.plugins WHERE plugin_name = "mroonga"`; +if (!$have_mroonga_storage_engine) { + eval INSTALL PLUGIN mroonga SONAME $ha_mroonga_so; + eval INSTALL PLUGIN mroonga_stats SONAME $ha_mroonga_so; +} + +let have_default_storage_engine_variable=`SELECT 1 FROM information_schema.global_variables WHERE variable_name = "default_storage_engine"`; +if ($have_default_storage_engine_variable) { + let original_default_storage_engine=`SELECT variable_value FROM information_schema.global_variables WHERE variable_name = "default_storage_engine"`; + set default_storage_engine=Mroonga; +} +if (!$have_default_storage_engine_variable) { + let original_storage_engine=`SELECT variable_value FROM information_schema.global_variables WHERE variable_name = "storage_engine"`; + set storage_engine=Mroonga; +} + +let have_default_tmp_storage_engine_variable=`SELECT 1 FROM information_schema.global_variables WHERE variable_name = "default_tmp_storage_engine"`; +if ($have_default_tmp_storage_engine_variable) { + let original_default_tmp_storage_engine=`SELECT variable_value FROM information_schema.global_variables WHERE variable_name = "default_tmp_storage_engine"`; + set default_tmp_storage_engine=Mroonga; +} + +enable_query_log; 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 new file mode 100644 index 00000000000..0b6b7081d00 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc @@ -0,0 +1,36 @@ +# Copyright(C) 2010-2014 Kentoku SHIBA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +disable_query_log; + +if ($have_default_storage_engine_variable) { + eval set default_storage_engine=$original_default_storage_engine; +} +if (!$have_default_storage_engine_variable) { + eval set storage_engine=$original_storage_engine; +} + +if ($have_default_tmp_storage_engine_variable) { + eval set default_tmp_storage_engine=$original_default_tmp_storage_engine; +} + +if (!$have_mroonga_storage_engine) { + UNINSTALL PLUGIN mroonga_stats; + UNINSTALL PLUGIN mroonga; +} + +enable_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 new file mode 100644 index 00000000000..1a7ec750288 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc @@ -0,0 +1,17 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 new file mode 100644 index 00000000000..d054f0a9afd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_mariadb.inc + +if ($mariadb) { + skip This test is for MySQL; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc new file mode 100644 index 00000000000..5643d8c8c2d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_100) { + 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_100_or_later.inc new file mode 100644 index 00000000000..9c9faa00ea2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_100_or_later.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_100_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_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc new file mode 100644 index 00000000000..b34f7876ed8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_55.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_55) { + skip This test is for MySQL version 5.5.x; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc new file mode 100644 index 00000000000..4ecff3e4466 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_56) { + 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_56_or_later.inc new file mode 100644 index 00000000000..ef166fcf590 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_56_or_later.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_56_or_later) { + skip This test is for MySQL version 5.6.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 new file mode 100644 index 00000000000..6df4e88ffc8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_ha_mroonga_so.inc + +--disable_query_log +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; +--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 new file mode 100644 index 00000000000..0c48adfee92 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc @@ -0,0 +1,21 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_freebsd.inc + +if ($VERSION_COMPILE_OS_FREEBSD) { + skip This test is not for FreeBSD; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc new file mode 100644 index 00000000000..8b46d606eec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_55.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2012-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($version_55) { + if ($mariadb) { + skip This test is not for MariaDB 5.5.x; + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc new file mode 100644 index 00000000000..a8f4409f7e7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc @@ -0,0 +1,21 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_osx.inc + +if ($VERSION_COMPILE_OS_OSX) { + skip This test is not for OSX; +} 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 new file mode 100644 index 00000000000..881aa47c629 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc @@ -0,0 +1,22 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--disable_query_log +DROP FUNCTION last_insert_grn_id; +DROP FUNCTION mroonga_snippet; +DROP FUNCTION mroonga_command; +DROP FUNCTION mroonga_escape; +--enable_query_log 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 new file mode 100644 index 00000000000..52a72155af3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +ALTER TABLE diaries ADD title TEXT AFTER id; +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 +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +id title body +1 groonga (1) starting groonga. +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..81feeefc589 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +ALTER TABLE diaries ADD title TEXT FIRST; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `title` text, + `id` int(11) NOT NULL AUTO_INCREMENT, + `body` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +title id body +groonga (1) 1 starting groonga. +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bb157539ac9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT +) DEFAULT CHARSET UTF8; +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 +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; +id title +1 survey +ALTER TABLE diaries +ADD COLUMN body TEXT FIRST, +ADD COLUMN published BOOLEAN AFTER id, +ADD COLUMN created_at DATETIME; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; +body id published title created_at +will start groonga! 1 0 survey 1970-01-01 00:00:00 +INSERT INTO diaries (title, body, published, created_at) +VALUES ("groonga (1)", "starting groonga...", TRUE, "2014-2-9 02:09:00"); +INSERT INTO diaries (title, body, published, created_at) +VALUES ("groonga (2)", "started groonga.", FALSE, "2014-2-9 12:19:00"); +SELECT * FROM diaries; +body id published title created_at +will start groonga! 1 0 survey 1970-01-01 00:00:00 +starting groonga... 2 1 groonga (1) 2014-02-09 02:09:00 +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, + `id` int(11) NOT NULL AUTO_INCREMENT, + `published` tinyint(1) DEFAULT NULL, + `title` text, + `created_at` datetime 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_plain.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result new file mode 100644 index 00000000000..df5a15568d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT +) DEFAULT CHARSET UTF8; +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 +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; +id title +1 survey +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; +id title body +1 survey will start groonga! +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga..."); +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +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 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result new file mode 100644 index 00000000000..1bc15c6efe2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result @@ -0,0 +1,10 @@ +CREATE TABLE tags ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY +) DEFAULT CHARSET=utf8; +ALTER TABLE tags ADD COLUMN name VARCHAR(64) COMMENT 'flags "COLUMN_VECTOR"'; +SELECT mroonga_command("dump"); +mroonga_command("dump") +table_create tags TABLE_PAT_KEY UInt32 +column_create tags id COLUMN_SCALAR UInt32 +column_create tags name COLUMN_VECTOR ShortText +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result new file mode 100644 index 00000000000..6ff92ec8e99 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result @@ -0,0 +1,16 @@ +CREATE TABLE tags ( +id INT UNSIGNED PRIMARY KEY +) DEFAULT CHARSET=utf8; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY +) DEFAULT CHARSET=utf8; +ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'type "tags"'; +SELECT mroonga_command("dump"); +mroonga_command("dump") +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 +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_key_multiple_column_with_data.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_key_multiple_column_with_data.result new file mode 100644 index 00000000000..73fb6a7abe3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_key_multiple_column_with_data.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS scores; +SET NAMES UTF8; +CREATE TABLE scores ( +id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL, +name CHAR(30) NOT NULL, +score INT NOT NULL +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE scores; +Table Create Table +scores CREATE TABLE `scores` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`id`) +) 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 +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +ALTER TABLE scores ADD KEY property (name, score); +SELECT * FROM scores +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_comment_not_for_mroonga.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_comment_not_for_mroonga.result new file mode 100644 index 00000000000..a993756ad62 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_comment_not_for_mroonga.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64) +) DEFAULT CHARSET=utf8; +ALTER TABLE bugs +CHANGE COLUMN +tag +tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.'; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tag` varchar(64) DEFAULT NULL COMMENT 'It must consist of only alphabet and number.', + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_have_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_have_index.result new file mode 100644 index 00000000000..c51c10b6da3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_have_index.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +title VARCHAR(32), +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +ALTER TABLE bugs CHANGE COLUMN title title VARCHAR(64); +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `title` (`title`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +DROP TABLE bugs; 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 new file mode 100644 index 00000000000..19d5d017fb2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +ALTER TABLE diaries CHANGE body description TEXT AFTER id; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `description` text, + `title` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +id description title +1 starting groonga. groonga (1) +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..cf2bcc0fc2c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +ALTER TABLE diaries CHANGE body description TEXT FIRST; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `description` text, + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +description id title +starting groonga. 1 groonga (1) +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bc5b0132e43 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) 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; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `description` text, + `internal_id` int(11) NOT NULL DEFAULT '0', + `subject` text, + PRIMARY KEY (`internal_id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (subject, description) +VALUES ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +description internal_id subject +starting groonga. 0 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 new file mode 100644 index 00000000000..6d60200e5ce --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +ALTER TABLE diaries CHANGE body description TEXT; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` text, + `description` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; +id title description +1 groonga (1) starting groonga. +DROP TABLE diaries; 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.result new file mode 100644 index 00000000000..3a7413e389b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine.result @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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 +INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); +INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND +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 * FROM diaries +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND +MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +id title body +1 survey will start groonga! +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AND +MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +id title body +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_create_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_create_fulltext.result new file mode 100644 index 00000000000..6127df61cb4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_create_fulltext.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +CREATE FULLTEXT INDEX title_index on diaries (title); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_ujis.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_ujis.result new file mode 100644 index 00000000000..ff7bc5e7cea --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_ujis.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES ujis; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=ujis; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "ŷ"); +INSERT INTO diaries VALUES (3, "ٻλ"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("ٻλ"); +id title +3 ٻλ +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("ٻλ"); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_utf8.result new file mode 100644 index 00000000000..cbaa8d62c98 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_utf8.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_multiple_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_multiple_column.result new file mode 100644 index 00000000000..9d6cdcd9ba8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_multiple_column.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY title_and_created_at_index (title, created_at) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_normal.result new file mode 100644 index 00000000000..09399c12a3e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_normal.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY created_at_index (created_at) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_primary.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_primary.result new file mode 100644 index 00000000000..f94c98ff9b2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_primary.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_truncate.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_truncate.result new file mode 100644 index 00000000000..7b71832b84f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_truncate.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +first_name VARCHAR(32) NOT NULL, +last_name VARCHAR(32) NOT NULL, +KEY (first_name, last_name) +); +INSERT INTO users VALUES("Taro", "Yamada"); +INSERT INTO users VALUES("Hanako", "Tanaka"); +INSERT INTO users VALUES("Joe", "Honda"); +SELECT * FROM users; +first_name last_name +Taro Yamada +Hanako Tanaka +Joe Honda +ALTER TABLE users DISABLE KEYS; +TRUNCATE users; +SELECT * FROM users; +first_name last_name +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_updating.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_updating.result new file mode 100644 index 00000000000..8b6f94c0cb5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_updating.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +c1 int NOT NULL, +c2 text NOT NULL, +c3 int NOT NULL, +c4 int NOT NULL, +PRIMARY KEY(c1), +KEY idx1(c3,c4), +FULLTEXT KEY ft1(c2) +); +INSERT INTO t1 VALUES(1, 'test1', 1, 1); +INSERT INTO t1 VALUES(2, 'test2', 2, 2); +INSERT INTO t1 VALUES(3, 'test3', 1, 3); +ALTER TABLE t1 DISABLE KEYS; +DELETE FROM t1 WHERE c1 = 2; +UPDATE t1 SET c4 = 4 WHERE c1 = 1; +INSERT INTO t1 VALUES(4, 'test4', 2, 4); +DROP TABLE t1; 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 new file mode 100644 index 00000000000..6475de51b21 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result @@ -0,0 +1,36 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +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 title, +DROP COLUMN body; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`) +) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 +SELECT * FROM diaries; +id +1 +INSERT INTO diaries () VALUES (); +SELECT * FROM diaries; +id +1 +2 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..cbc94cebccf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +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 +SELECT * FROM diaries; +id title +1 survey +INSERT INTO diaries (title) values ("groonga (1)"); +INSERT INTO diaries (title) values ("groonga (2)"); +SELECT * FROM diaries; +id title +1 survey +2 groonga (1) +3 groonga (2) +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_key_multiple_column_with_data.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_key_multiple_column_with_data.result new file mode 100644 index 00000000000..b0aa59a20b5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_key_multiple_column_with_data.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS scores; +SET NAMES UTF8; +CREATE TABLE scores ( +id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL, +name CHAR(30) NOT NULL, +score INT NOT NULL, +KEY property (name, score) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE scores; +Table Create Table +scores CREATE TABLE `scores` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `property` (`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 +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +ALTER TABLE scores DROP KEY property; +SELECT * FROM scores +WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext.result new file mode 100644 index 00000000000..e5c8a34901f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_ujis.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_ujis.result new file mode 100644 index 00000000000..3853cc849fb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_ujis.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES ujis; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=ujis; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "ŷ"); +INSERT INTO diaries VALUES (3, "ٻλ"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("ٻλ"); +ERROR HY000: Can't find FULLTEXT index matching the column list +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("ٻλ"); +id title +3 ٻλ +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_utf8.result new file mode 100644 index 00000000000..e5c8a34901f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_utf8.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_multiple_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_multiple_column.result new file mode 100644 index 00000000000..e252061d109 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_multiple_column.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY title_and_created_at_index (title, created_at) +) DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_normal.result new file mode 100644 index 00000000000..0e56e78d0c6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_normal.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY created_at_index (created_at) +) DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_primary.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_primary.result new file mode 100644 index 00000000000..722e62f966b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_primary.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +DROP TABLE diaries; 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_engine_decimal.result new file mode 100644 index 00000000000..6bbedd41e95 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_engine_decimal.result @@ -0,0 +1,38 @@ +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); +SELECT * FROM diaries; +id title temperature +1 clear day 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); +SELECT * FROM diaries; +id title temperature +1 clear day 21.281 +2 rainy day 14.213 +3 cloudy day 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 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_no_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_no_primary_key.result new file mode 100644 index 00000000000..bf7593f78eb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_no_primary_key.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +CREATE TABLE memos ( +content varchar(32) +) DEFAULT CHARSET="utf8"; +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` ( + `content` varchar(32) DEFAULT NULL, + FULLTEXT KEY `content_index` (`content`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +SELECT * FROM memos WHERE MATCH(content) AGAINST("groonga"); +content +Starting Groonga... +Started Groonga. +DROP TABLE memos; 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 new file mode 100644 index 00000000000..d98dc431a0b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS memos; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT +) DEFAULT CHARSET="utf8"; +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"); +id content +1 Starting Groonga... +2 Started Groonga. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_table.result new file mode 100644 index 00000000000..705d2f70126 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_table.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS tags; +DROP TABLE IF EXISTS bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags VARCHAR(40) COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO tags (name) VALUES ("Groonga"); +INSERT INTO bugs (id, tags) VALUES (1, "Groonga Mroonga"); +SELECT * FROM bugs; +id tags +1 GROONGA MROONGA +ALTER TABLE bugs ADD FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'; +SELECT * FROM bugs +WHERE MATCH(tags) AGAINST("Groonga"); +id tags +1 GROONGA MROONGA +DROP TABLE bugs; +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_drop_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_drop_table.result new file mode 100644 index 00000000000..2d5e3d55ca7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_drop_table.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS tags; +DROP TABLE IF EXISTS bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags VARCHAR(40) COMMENT 'type "tags"', +FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO tags (name) VALUES ("Groonga"); +INSERT INTO bugs (id, tags) VALUES (1, "Groonga Mroonga"); +ALTER TABLE bugs DROP INDEX bugs_tags_index; +ALTER TABLE bugs +ADD FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'; +SELECT * FROM bugs +WHERE MATCH(tags) AGAINST("Groonga"); +id tags +1 GROONGA MROONGA +DROP TABLE bugs; +DROP TABLE tags; 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 new file mode 100644 index 00000000000..d831d02d76a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) 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; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `body` text, + `title` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +id body title +1 starting groonga. groonga (1) +2 started groonga. groonga (2) +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bd936507211 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) 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; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `body` text, + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +body id title +starting groonga. 1 groonga (1) +started groonga. 2 groonga (2) +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..d8d963d87b4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT +) 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`) +) 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 title VARCHAR(100); +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(100) DEFAULT NULL, + `body` text, + PRIMARY KEY (`id`) +) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +id title body +1 groonga (1) starting groonga. +2 groonga (2) started groonga. +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..64f524de06c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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; +id title body +1 survey will start groonga! +2 survey will start mroonga! +SELECT * FROM diaries +WHERE MATCH (body) AGAINST ("+groonga" IN BOOLEAN MODE); +id title body +1 survey will start groonga! +ALTER TABLE diaries +DROP INDEX body, +ADD FULLTEXT INDEX (body); +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 survey will start mroonga! +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 new file mode 100644 index 00000000000..eac322ceb26 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries, memos; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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!"); +SELECT * FROM diaries; +id title body +1 survey will start groonga! +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("groonga") AND +MATCH(body) AGAINST("starting"); +id title body +ALTER TABLE diaries RENAME memos; +SELECT * FROM memos; +id title body +1 survey will start groonga! +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 +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 new file mode 100644 index 00000000000..d8ed80a157d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result @@ -0,0 +1,132 @@ +DROP TABLE IF EXISTS shops; +CREATE TABLE shops ( +id INT PRIMARY KEY AUTO_INCREMENT, +name TEXT, +location GEOMETRY NOT NULL +); +INSERT INTO shops (name, location) +VALUES ('nezu-no-taiyaki', +GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) +VALUES ('taiyaki-kataoka', +GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) +VALUES ('soba-taiyaki-ku', +GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) +VALUES ('kuruma', +GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) +VALUES ('hirose-ya', +GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) +VALUES ('sazare', +GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) +VALUES ('omede-taiyaki', +GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) +VALUES ('onaga-ya', +GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) +VALUES ('shiro-ya', +GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) +VALUES ('fuji-ya', +GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) +VALUES ('miyoshi', +GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) +VALUES ('juju-ya', +GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) +VALUES ('tatsumi-ya', +GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) +VALUES ('tetsuji', +GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) +VALUES ('gazuma-ya', +GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) +VALUES ('honma-mon', +GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) +VALUES ('naniwa-ya', +GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) +VALUES ('kuro-dai', +GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) +VALUES ('daruma', +GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) +VALUES ('yanagi-ya', +GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) +VALUES ('sharaku', +GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) +VALUES ('takane', +GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) +VALUES ('chiyoda', +GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) +VALUES ('da-ka-po', +GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) +VALUES ('matsushima-ya', +GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) +VALUES ('kazuya', +GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) +VALUES ('furuya-kogane-an', +GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) +VALUES ('hachi-no-ie', +GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) +VALUES ('azuki-chan', +GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) +VALUES ('kuriko-an', +GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) +VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', +GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) +VALUES ('naze-ya', +GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) +VALUES ('sanoki-ya', +GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) +VALUES ('shigeta', +GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) +VALUES ('nishimi-ya', +GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) +VALUES ('hiiragi', +GeomFromText('POINT(139.711517 35.647701)')); +ALTER TABLE shops ADD SPATIAL KEY location_index (location); +SELECT id, name, AsText(location) AS location_text FROM shops +WHERE MBRContains(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) +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 +DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..6a5729af023 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_TODO_SPLIT_ME.result @@ -0,0 +1,53 @@ +drop table if exists t1; +create table t1 (c1 int auto_increment, primary key(c1)); +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +c1 +1 +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +c1 +2 +insert into t1 values(10); +select c1 from t1 order by c1 desc limit 1; +c1 +10 +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +c1 +11 +insert into t1 values(6); +select c1 from t1 order by c1 desc limit 1; +c1 +11 +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +c1 +12 +drop table t1; +create table t1 (c1 int, c2 int auto_increment, primary key(c1), key idx1(c2)); +insert into t1 values(1, null); +select * from t1 order by c2 desc limit 1; +c1 c2 +1 1 +insert into t1 values(2, null); +select * from t1 order by c2 desc limit 1; +c1 c2 +2 2 +insert into t1 values(3, 10); +select * from t1 order by c2 desc limit 1; +c1 c2 +3 10 +insert into t1 values(4, null); +select * from t1 order by c2 desc limit 1; +c1 c2 +4 11 +insert into t1 values(5, 6); +select * from t1 order by c2 desc limit 1; +c1 c2 +4 11 +insert into t1 values(6, null); +select * from t1 order by c2 desc limit 1; +c1 c2 +6 12 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_table_param.result b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_table_param.result new file mode 100644 index 00000000000..f89b74e571a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_table_param.result @@ -0,0 +1,70 @@ +drop table if exists t1; +create table t1 (c1 int auto_increment, primary key(c1)) auto_increment=34129; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +34129 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=Mroonga AUTO_INCREMENT=34130 DEFAULT CHARSET=latin1 +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +34130 +34129 +insert into t1 values(10); +select c1 from t1 order by c1 desc; +c1 +34130 +34129 +10 +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +34131 +34130 +34129 +10 +insert into t1 values(6); +select c1 from t1 order by c1 desc; +c1 +34131 +34130 +34129 +10 +6 +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +34132 +34131 +34130 +34129 +10 +6 +truncate table t1; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +1 +delete from t1; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +c1 +2 +rename table t1 to t2; +insert into t2 values(null); +select c1 from t2 order by c1 desc; +c1 +3 +2 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`c1`) +) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +drop table t2; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_text.result b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_text.result new file mode 100644 index 00000000000..fe5e6409abe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_text.result @@ -0,0 +1,15 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +body text +); +insert into diaries (body) values ("started groonga (long text)"); +select * from diaries; +id body +1 started groonga (long text) +insert into diaries (body) values ("sleeping... (short text)"); +select * from diaries; +id body +1 started groonga (long text) +2 sleeping... (short text) +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/binlog_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/binlog_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..340509f6e53 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/binlog_TODO_SPLIT_ME.result @@ -0,0 +1,34 @@ +drop table if exists t1; +show variables like 'log_bin'; +Variable_name Value +log_bin ON +set binlog_format="STATEMENT"; +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; +set binlog_format="ROW"; +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; +set binlog_format="MIXED"; +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_general_ci_french.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_general_ci_french.result new file mode 100644 index 00000000000..880092f46fb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_general_ci_french.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +content varchar(256) COLLATE utf8_general_ci, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES ("Je suis un garçon."); +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("garcon"); +content +Je suis un garçon. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_french.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_french.result new file mode 100644 index 00000000000..3f24de87035 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_french.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +content varchar(256) COLLATE utf8_unicode_ci, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES ("Je suis un garçon."); +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("garcon"); +content +Je suis un garçon. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_japanese.result new file mode 100644 index 00000000000..94ef2608b81 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_japanese.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +content varchar(256) COLLATE utf8_unicode_ci, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。"); +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("かたかな"); +content +ひらがなとカタカナを覚えました。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_index_not_for_mroonga.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_index_not_for_mroonga.result new file mode 100644 index 00000000000..94b3a603389 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_index_not_for_mroonga.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED, +INDEX (id) COMMENT 'ID search is required.' +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned DEFAULT NULL, + KEY `id` (`id`) COMMENT 'ID search is required.' +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_normal_not_for_mroonga.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_normal_not_for_mroonga.result new file mode 100644 index 00000000000..162b515d898 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_comment_normal_not_for_mroonga.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.' +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tag` varchar(64) DEFAULT NULL COMMENT 'It must consist of only alphabet and number.', + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +DROP TABLE bugs; 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 new file mode 100644 index 00000000000..e24a56be3a2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +created_at DATE, +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` date 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"); +INSERT INTO diaries (title, created_at) VALUES ("rainy day", "2012-01-30"); +INSERT INTO diaries (title, created_at) VALUES ("cloudy day", "2012-01-31"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 +2 rainy day 2012-01-30 +3 cloudy day 2012-01-31 +SELECT * FROM diaries WHERE created_at BETWEEN "2012-01-29" AND "2012-01-30"; +id title created_at +1 clear day 2012-01-29 +2 rainy day 2012-01-30 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..018ee8eb5b8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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, + `created_at` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29"); +INSERT INTO diaries (title, created_at) VALUES ("rainy day", "2012-01-30"); +INSERT INTO diaries (title, created_at) VALUES ("cloudy day", "2012-01-31"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 +2 rainy day 2012-01-30 +3 cloudy day 2012-01-31 +SELECT * FROM diaries WHERE created_at BETWEEN "2012-01-29" AND "2012-01-30"; +id title created_at +1 clear day 2012-01-29 +2 rainy day 2012-01-30 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result new file mode 100644 index 00000000000..b2364e1158e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS timestamps; +CREATE TABLE timestamps ( +id INT PRIMARY KEY AUTO_INCREMENT, +create_dt DATE +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE timestamps; +Table Create Table +timestamps CREATE TABLE `timestamps` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `create_dt` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01"); +Warnings: +Warning 1265 Data truncated for column 'create_dt' at row 1 +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00"); +Warnings: +Warning 1265 Data truncated for column 'create_dt' at row 1 +SELECT * FROM timestamps; +id create_dt +1 2012-01-01 +2 2012-01-01 +SELECT * FROM timestamps WHERE create_dt = "2012-01-01"; +id create_dt +1 2012-01-01 +2 2012-01-01 +DROP TABLE timestamps; 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 new file mode 100644 index 00000000000..453f641968b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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) +VALUES ('2038-01-20 03:14:08', '2038-01-20 03:14:08'); +Warnings: +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 2038-01-18 03:14:07 2038-01-18 03:14:07 +2 2038-01-20 03:14:08 1970-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..10824d7c28d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 1000-01-01 00:00:00 1970-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..f3a7b27f342 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 9999-12-31 23:59:59 1970-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..d7acad79bab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1265 Data truncated for column 'created_at' at row 1 +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 2012 1970-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..56e38902f28 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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) +VALUES ('2038-01-19 03:14:08', '2038-01-19 03:14:08'); +SELECT * FROM diaries; +id title created_at +1 2038-01-19 03:14:07 2038-01-19 03:14:07 +2 2038-01-19 03:14:08 2038-01-19 03:14:08 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..c3ca2628bca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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'); +SELECT * FROM diaries; +id title created_at +1 1000-01-01 00:00:00 1000-01-01 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 new file mode 100644 index 00000000000..0373d17530e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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; +id title created_at +1 9999-12-31 23:59:59 9999-12-31 23:59:59 +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_55_out_of_range.result new file mode 100644 index 00000000000..733217fda85 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_55_out_of_range.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1264 Out of range value for column 'created_at' at row 1 +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 2012 0000-01-01 00:00:00 +DROP TABLE diaries; 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_56_or_later_out_of_range.result new file mode 100644 index 00000000000..962212c86f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_56_or_later_out_of_range.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1265 Data truncated for column 'created_at' at row 1 +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 2012 0000-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..a31042f768d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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) +VALUES ("rainy day", "2012-01-30 01:23:45.333"); +INSERT INTO diaries (title, created_at) +VALUES ("cloudy day", "2012-01-31 08:32:10.5555"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 21:51:01.111111 +2 rainy day 2012-01-30 01:23:45.333000 +3 cloudy day 2012-01-31 08:32:10.555500 +SELECT * FROM diaries +WHERE created_at BETWEEN "2012-01-29 00:00:00.123456" AND +"2012-01-31 00:00:00.999999"; +id title created_at +1 clear day 2012-01-29 21:51:01.111111 +2 rainy day 2012-01-30 01:23:45.333000 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..0b1bf0f0eb4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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) +VALUES ("rainy day", "2012-01-30 01:23:45.333"); +INSERT INTO diaries (title, created_at) +VALUES ("cloudy day", "2012-01-31 08:32:10.5555"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 21:51:01.111111 +2 rainy day 2012-01-30 01:23:45.333000 +3 cloudy day 2012-01-31 08:32:10.555500 +SELECT * FROM diaries +WHERE created_at BETWEEN "2012-01-29 00:00:00.123456" AND +"2012-01-31 00:00:00.999999"; +id title created_at +1 clear day 2012-01-29 21:51:01.111111 +2 rainy day 2012-01-30 01:23:45.333000 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..10824d7c28d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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: +Warning 1265 Data truncated for column 'created_at' at row 1 +SELECT * FROM diaries; +id title created_at +1 1000-01-01 00:00:00 1970-01-01 00:00:00 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..82f01b9f237 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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; +id title created_at +1 NULL 1970-01-01 00:00:00 +DROP TABLE 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 new file mode 100644 index 00000000000..b205031dec1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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) +VALUES ("rainy day", "2012-01-30 01:23:45"); +INSERT INTO diaries (title, created_at) +VALUES ("cloudy day", "2012-01-31 08:32:10"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 21:51:01 +2 rainy day 2012-01-30 01:23:45 +3 cloudy day 2012-01-31 08:32:10 +SELECT * FROM diaries +WHERE created_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; +id title created_at +1 clear day 2012-01-29 21:51:01 +2 rainy day 2012-01-30 01:23:45 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..6592df35fcb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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) +VALUES ("rainy day", "2012-01-30 01:23:45"); +INSERT INTO diaries (title, created_at) +VALUES ("cloudy day", "2012-01-31 08:32:10"); +SELECT * FROM diaries; +id title created_at +1 clear day 2012-01-29 21:51:01 +2 rainy day 2012-01-30 01:23:45 +3 cloudy day 2012-01-31 08:32:10 +SELECT * FROM diaries +WHERE created_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; +id title created_at +1 clear day 2012-01-29 21:51:01 +2 rainy day 2012-01-30 01:23:45 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..c22a63f9744 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS timestamps; +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 +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 new file mode 100644 index 00000000000..4a21d62dd14 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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); +SELECT * FROM diaries; +id title temperature +1 clear day 21.281 +2 rainy day 14.213 +3 cloudy day 17.821 +SELECT * FROM diaries WHERE temperature BETWEEN "14.213" AND "17.821"; +id title temperature +2 rainy day 14.213 +3 cloudy day 17.821 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..cd939fa5483 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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); +SELECT * FROM diaries; +id title temperature +1 clear day 21.281 +2 rainy day 14.213 +3 cloudy day 17.821 +SELECT * FROM diaries WHERE temperature BETWEEN "14.213" AND "17.821"; +id title temperature +2 rainy day 14.213 +3 cloudy day 17.821 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..56a6a360dc9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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); +SELECT * FROM diaries; +id title temperature +1 clear day 21 +2 rainy day 14 +3 cloudy day 17 +SELECT * FROM diaries WHERE temperature BETWEEN "14" AND "17"; +id title temperature +2 rainy day 14 +3 cloudy day 17 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..06162f76ddd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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); +SELECT * FROM diaries; +id title temperature +1 clear day 21 +2 rainy day 14 +3 cloudy day 17 +SELECT * FROM diaries WHERE temperature BETWEEN "14" AND "17"; +id title temperature +2 rainy day 14 +3 cloudy day 17 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_less_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_less_with_index.result new file mode 100644 index 00000000000..28c80dcc6f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_less_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +size ENUM("small", "medium", "large"), +INDEX (size) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `size` enum('small','medium','large') DEFAULT NULL, + KEY `size` (`size`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart for child", "small"); +INSERT INTO items VALUES ("leadies' coat", "medium"); +INSERT INTO items VALUES ("parka", "large"); +INSERT INTO items VALUES ("hat", "medium"); +SELECT * FROM items; +name size +t-shart for child small +leadies' coat medium +parka large +hat medium +SELECT * FROM items WHERE size = "medium"; +name size +leadies' coat medium +hat medium +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_many_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_many_with_index.result new file mode 100644 index 00000000000..731a9690702 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_enum_many_with_index.result @@ -0,0 +1,287 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +size ENUM("size1", +"size2", +"size3", +"size4", +"size5", +"size6", +"size7", +"size8", +"size9", +"size10", +"size11", +"size12", +"size13", +"size14", +"size15", +"size16", +"size17", +"size18", +"size19", +"size20", +"size21", +"size22", +"size23", +"size24", +"size25", +"size26", +"size27", +"size28", +"size29", +"size30", +"size31", +"size32", +"size33", +"size34", +"size35", +"size36", +"size37", +"size38", +"size39", +"size40", +"size41", +"size42", +"size43", +"size44", +"size45", +"size46", +"size47", +"size48", +"size49", +"size50", +"size51", +"size52", +"size53", +"size54", +"size55", +"size56", +"size57", +"size58", +"size59", +"size60", +"size61", +"size62", +"size63", +"size64", +"size65", +"size66", +"size67", +"size68", +"size69", +"size70", +"size71", +"size72", +"size73", +"size74", +"size75", +"size76", +"size77", +"size78", +"size79", +"size80", +"size81", +"size82", +"size83", +"size84", +"size85", +"size86", +"size87", +"size88", +"size89", +"size90", +"size91", +"size92", +"size93", +"size94", +"size95", +"size96", +"size97", +"size98", +"size99", +"size100", +"size101", +"size102", +"size103", +"size104", +"size105", +"size106", +"size107", +"size108", +"size109", +"size110", +"size111", +"size112", +"size113", +"size114", +"size115", +"size116", +"size117", +"size118", +"size119", +"size120", +"size121", +"size122", +"size123", +"size124", +"size125", +"size126", +"size127", +"size128", +"size129", +"size130", +"size131", +"size132", +"size133", +"size134", +"size135", +"size136", +"size137", +"size138", +"size139", +"size140", +"size141", +"size142", +"size143", +"size144", +"size145", +"size146", +"size147", +"size148", +"size149", +"size150", +"size151", +"size152", +"size153", +"size154", +"size155", +"size156", +"size157", +"size158", +"size159", +"size160", +"size161", +"size162", +"size163", +"size164", +"size165", +"size166", +"size167", +"size168", +"size169", +"size170", +"size171", +"size172", +"size173", +"size174", +"size175", +"size176", +"size177", +"size178", +"size179", +"size180", +"size181", +"size182", +"size183", +"size184", +"size185", +"size186", +"size187", +"size188", +"size189", +"size190", +"size191", +"size192", +"size193", +"size194", +"size195", +"size196", +"size197", +"size198", +"size199", +"size200", +"size201", +"size202", +"size203", +"size204", +"size205", +"size206", +"size207", +"size208", +"size209", +"size210", +"size211", +"size212", +"size213", +"size214", +"size215", +"size216", +"size217", +"size218", +"size219", +"size220", +"size221", +"size222", +"size223", +"size224", +"size225", +"size226", +"size227", +"size228", +"size229", +"size230", +"size231", +"size232", +"size233", +"size234", +"size235", +"size236", +"size237", +"size238", +"size239", +"size240", +"size241", +"size242", +"size243", +"size244", +"size245", +"size246", +"size247", +"size248", +"size249", +"size250", +"size251", +"size252", +"size253", +"size254", +"size255", +"size256"), +INDEX (size) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `size` enum('size1','size2','size3','size4','size5','size6','size7','size8','size9','size10','size11','size12','size13','size14','size15','size16','size17','size18','size19','size20','size21','size22','size23','size24','size25','size26','size27','size28','size29','size30','size31','size32','size33','size34','size35','size36','size37','size38','size39','size40','size41','size42','size43','size44','size45','size46','size47','size48','size49','size50','size51','size52','size53','size54','size55','size56','size57','size58','size59','size60','size61','size62','size63','size64','size65','size66','size67','size68','size69','size70','size71','size72','size73','size74','size75','size76','size77','size78','size79','size80','size81','size82','size83','size84','size85','size86','size87','size88','size89','size90','size91','size92','size93','size94','size95','size96','size97','size98','size99','size100','size101','size102','size103','size104','size105','size106','size107','size108','size109','size110','size111','size112','size113','size114','size115','size116','size117','size118','size119','size120','size121','size122','size123','size124','size125','size126','size127','size128','size129','size130','size131','size132','size133','size134','size135','size136','size137','size138','size139','size140','size141','size142','size143','size144','size145','size146','size147','size148','size149','size150','size151','size152','size153','size154','size155','size156','size157','size158','size159','size160','size161','size162','size163','size164','size165','size166','size167','size168','size169','size170','size171','size172','size173','size174','size175','size176','size177','size178','size179','size180','size181','size182','size183','size184','size185','size186','size187','size188','size189','size190','size191','size192','size193','size194','size195','size196','size197','size198','size199','size200','size201','size202','size203','size204','size205','size206','size207','size208','size209','size210','size211','size212','size213','size214','size215','size216','size217','size218','size219','size220','size221','size222','size223','size224','size225','size226','size227','size228','size229','size230','size231','size232','size233','size234','size235','size236','size237','size238','size239','size240','size241','size242','size243','size244','size245','size246','size247','size248','size249','size250','size251','size252','size253','size254','size255','size256') DEFAULT NULL, + KEY `size` (`size`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart for child", "size1"); +INSERT INTO items VALUES ("leadies' coat", "size1"); +INSERT INTO items VALUES ("parka", "size256"); +INSERT INTO items VALUES ("hat", "size256"); +SELECT * FROM items; +name size +t-shart for child size1 +leadies' coat size1 +parka size256 +hat size256 +SELECT * FROM items WHERE size = "size1"; +name size +t-shart for child size1 +leadies' coat size1 +SELECT * FROM items WHERE size = "size256"; +name size +parka size256 +hat size256 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result new file mode 100644 index 00000000000..33f31ed38df --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS contents; +CREATE TABLE contents ( +_id INT, +content TEXT NOT NULL, +FULLTEXT INDEX(content) +) DEFAULT CHARSET=utf8; +INSERT INTO contents (content) VALUES ('first'); +INSERT INTO contents (content) VALUES ('second'); +SELECT _id, content FROM contents; +_id content +1 first +2 second +DROP TABLE contents; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id_invalid_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id_invalid_id.result new file mode 100644 index 00000000000..903e3a85cab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id_invalid_id.result @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS contents; +CREATE TABLE contents ( +_i INT, +content TEXT NOT NULL, +FULLTEXT INDEX(content) +) DEFAULT CHARSET=utf8; +ERROR HY000: [column][create] name can't start with '_' and contains only 0-9, A-Z, a-z, #, @, - or _: <_i> +DROP TABLE IF EXISTS contents; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result new file mode 100644 index 00000000000..87c14a98f15 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result @@ -0,0 +1,42 @@ +DROP DATABASE IF EXISTS mroonga; +CREATE DATABASE mroonga; +USE mroonga; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"', +FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); +SELECT mroonga_command("dump"); +mroonga_command("dump") +table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit +column_create tags name COLUMN_SCALAR ShortText +table_create bugs TABLE_PAT_KEY UInt32 +column_create bugs id COLUMN_SCALAR UInt32 +column_create bugs tags COLUMN_VECTOR tags +column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags +load --table tags +[ +["_key","name"], +["Linux",""], +["MySQL",""], +["groonga",""] +] +load --table bugs +[ +["_key","id","tags"], +[1,1,["Linux","MySQL","groonga"]] +] +SELECT *, MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE) AS score +FROM bugs +WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE); +id tags score +1 Linux MySQL groonga 1 +DROP TABLE bugs; +DROP TABLE tags; +DROP DATABASE mroonga; 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 new file mode 100644 index 00000000000..e46ed71d0fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result @@ -0,0 +1,45 @@ +DROP DATABASE IF EXISTS mroonga; +CREATE DATABASE mroonga; +USE mroonga; +CREATE TABLE priorities ( +id INT PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +priority INT COMMENT 'type "priorities"', +INDEX bugs_priority_index (priority) COMMENT 'table "priorities"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, priority) VALUES (1, 10); +INSERT INTO bugs (id, priority) VALUES (2, 3); +INSERT INTO bugs (id, priority) VALUES (3, -2); +SELECT mroonga_command("dump"); +mroonga_command("dump") +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 +column_create bugs priority COLUMN_SCALAR priorities +column_create priorities bugs_priority_index COLUMN_INDEX|WITH_POSITION bugs priority +load --table priorities +[ +["_key","id"], +[-2,0], +[3,0], +[10,0] +] +load --table bugs +[ +["_key","id","priority"], +[1,1,10], +[2,2,3], +[3,3,-2] +] +SELECT * +FROM bugs +WHERE priority = 3; +id priority +2 3 +DROP TABLE bugs; +DROP TABLE priorities; +DROP DATABASE mroonga; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_reference.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_reference.result new file mode 100644 index 00000000000..8acf8aab220 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_reference.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS tags, bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag TEXT COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, tag) VALUES (1, "Linux"); +INSERT INTO bugs (id, tag) VALUES (2, "MySQL"); +INSERT INTO bugs (id, tag) VALUES (3, "groonga"); +SELECT * FROM bugs; +id tag +1 Linux +2 MySQL +3 groonga +SELECT * FROM tags; +name +Linux +MySQL +groonga +DROP TABLE bugs; +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_with_not_for_mroonga_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_with_not_for_mroonga_comment.result new file mode 100644 index 00000000000..cd910206a3d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_with_not_for_mroonga_comment.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS tags, bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag TEXT COMMENT 'It references to tags.name, type "tags"' +) DEFAULT CHARSET=utf8; +SHOW FULL COLUMNS FROM bugs LIKE 'tag'; +Field Type Collation Null Key Default Extra Privileges Comment +tag text utf8_general_ci YES NULL select,insert,update,references It references to tags.name, type "tags" +INSERT INTO bugs (id, tag) VALUES (1, "Linux"); +INSERT INTO bugs (id, tag) VALUES (2, "MySQL"); +INSERT INTO bugs (id, tag) VALUES (3, "groonga"); +SELECT * FROM bugs; +id tag +1 Linux +2 MySQL +3 groonga +SELECT * FROM tags; +name +Linux +MySQL +groonga +DROP TABLE bugs; +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_order_by_with_function.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_order_by_with_function.result new file mode 100644 index 00000000000..468115e8a20 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_order_by_with_function.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS tags, bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL Groonga"); +INSERT INTO bugs (id, tags) VALUES (2, "MySQL Mroonga"); +INSERT INTO bugs (id, tags) VALUES (3, "Ruby Rroonga"); +SELECT * FROM tags ORDER BY SUBSTRING(name, 1, 1) ASC; +name +Groonga +Linux +Mroonga +MySQL +Rroonga +Ruby +DROP TABLE bugs; +DROP TABLE tags; 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 new file mode 100644 index 00000000000..515dad1da2e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS tags, bugs; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); +SELECT * FROM bugs; +id tags +1 Linux MySQL groonga +SELECT * FROM tags; +name +Linux +MySQL +groonga +DROP TABLE bugs; +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_int_with_index_zero_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_int_with_index_zero_value.result new file mode 100644 index 00000000000..1afd7da9839 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_int_with_index_zero_value.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price INT KEY +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("hamburger", 200); +INSERT INTO items VALUES ("smile", 0); +INSERT INTO items VALUES ("coke", 100); +SELECT * FROM items; +name price +smile 0 +coke 100 +hamburger 200 +SELECT * FROM items WHERE price = 0; +name price +smile 0 +SELECT * FROM items WHERE price <= 100; +name price +smile 0 +coke 100 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result new file mode 100644 index 00000000000..ee818a62e75 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +colors SET("black", +"dim gray", +"dark gray", +"gray", +"light gray", +"gainsboro", +"white smoke", +"white", +"red", +"orange red", +"dark orange", +"orange", +"gold", +"yellow", +"chartreuse", +"lawn green"), +INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `colors` set('black','dim gray','dark gray','gray','light gray','gainsboro','white smoke','white','red','orange red','dark orange','orange','gold','yellow','chartreuse','lawn green') DEFAULT NULL, + KEY `colors` (`colors`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart", "black,gray"); +INSERT INTO items VALUES ("hat", "white,dark gray"); +INSERT INTO items VALUES ("parka", "chartreuse,orange"); +SELECT * FROM items; +name colors +t-shart black,gray +hat dark gray,white +parka orange,chartreuse +SELECT * FROM items WHERE colors = "dark gray,white"; +name colors +hat dark gray,white +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_24_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_24_with_index.result new file mode 100644 index 00000000000..10d4fd8bd1c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_24_with_index.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +colors SET("black", +"dim gray", +"dark gray", +"gray", +"light gray", +"gainsboro", +"white smoke", +"white", +"red", +"orange red", +"dark orange", +"orange", +"gold", +"yellow", +"chartreuse", +"lawn green", +"green", +"spring green", +"medium spring green", +"cyan", +"deep sky blue", +"blue", +"medium blue", +"dark violet"), +INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `colors` set('black','dim gray','dark gray','gray','light gray','gainsboro','white smoke','white','red','orange red','dark orange','orange','gold','yellow','chartreuse','lawn green','green','spring green','medium spring green','cyan','deep sky blue','blue','medium blue','dark violet') DEFAULT NULL, + KEY `colors` (`colors`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart", "black,white"); +INSERT INTO items VALUES ("hat", "white,lawn green"); +INSERT INTO items VALUES ("parka", "gray,medium blue"); +SELECT * FROM items; +name colors +t-shart black,white +hat white,lawn green +parka gray,medium blue +SELECT * FROM items WHERE colors = "white,lawn green"; +name colors +hat white,lawn green +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_32_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_32_with_index.result new file mode 100644 index 00000000000..0432970aa9e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_32_with_index.result @@ -0,0 +1,56 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +colors SET("black", +"dim gray", +"dark gray", +"gray", +"light gray", +"gainsboro", +"white smoke", +"white", +"red", +"orange red", +"dark orange", +"orange", +"gold", +"yellow", +"chartreuse", +"lawn green", +"green", +"spring green", +"medium spring green", +"cyan", +"deep sky blue", +"blue", +"medium blue", +"dark violet", +"dark magenta", +"magenta", +"dark red", +"brown", +"firebrick", +"indian red", +"light coral", +"salmon"), +INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `colors` set('black','dim gray','dark gray','gray','light gray','gainsboro','white smoke','white','red','orange red','dark orange','orange','gold','yellow','chartreuse','lawn green','green','spring green','medium spring green','cyan','deep sky blue','blue','medium blue','dark violet','dark magenta','magenta','dark red','brown','firebrick','indian red','light coral','salmon') DEFAULT NULL, + KEY `colors` (`colors`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart", "black,white"); +INSERT INTO items VALUES ("hat", "white,dark violet"); +INSERT INTO items VALUES ("parka", "green,brown,red"); +SELECT * FROM items; +name colors +t-shart black,white +hat white,dark violet +parka red,green,brown +SELECT * FROM items WHERE colors = "white,dark violet"; +name colors +hat white,dark violet +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_64_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_64_with_index.result new file mode 100644 index 00000000000..5b6d4511adf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_64_with_index.result @@ -0,0 +1,88 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +colors SET("black", +"dim gray", +"dark gray", +"gray", +"light gray", +"gainsboro", +"white smoke", +"white", +"red", +"orange red", +"dark orange", +"orange", +"gold", +"yellow", +"chartreuse", +"lawn green", +"green", +"spring green", +"medium spring green", +"cyan", +"deep sky blue", +"blue", +"medium blue", +"dark violet", +"dark magenta", +"magenta", +"dark red", +"brown", +"firebrick", +"indian red", +"light coral", +"salmon", +"light salmon", +"tomato", +"coral", +"dark salmon", +"rosy brown", +"sienna", +"saddle brown", +"chocolate", +"peru", +"sandy brown", +"burlywood", +"tan", +"navajo white", +"wheat", +"dark goldenrod", +"goldenrod", +"light goldenrod", +"pale goldenrod", +"cornsilk", +"dark khaki", +"khaki", +"lemon chiffon", +"dark olive green", +"olive drab", +"yellow green", +"green yellow", +"light green", +"forest green", +"dark green", +"lime green", +"pale green", +"dark sea green"), +INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `colors` set('black','dim gray','dark gray','gray','light gray','gainsboro','white smoke','white','red','orange red','dark orange','orange','gold','yellow','chartreuse','lawn green','green','spring green','medium spring green','cyan','deep sky blue','blue','medium blue','dark violet','dark magenta','magenta','dark red','brown','firebrick','indian red','light coral','salmon','light salmon','tomato','coral','dark salmon','rosy brown','sienna','saddle brown','chocolate','peru','sandy brown','burlywood','tan','navajo white','wheat','dark goldenrod','goldenrod','light goldenrod','pale goldenrod','cornsilk','dark khaki','khaki','lemon chiffon','dark olive green','olive drab','yellow green','green yellow','light green','forest green','dark green','lime green','pale green','dark sea green') DEFAULT NULL, + KEY `colors` (`colors`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart", "black,white,lawn green,dark violet"); +INSERT INTO items VALUES ("hat", "white,dark violet,yellow green"); +INSERT INTO items VALUES ("parka", "green,brown,red,lime green"); +SELECT * FROM items; +name colors +t-shart black,white,lawn green,dark violet +hat white,dark violet,yellow green +parka red,green,brown,lime green +SELECT * FROM items WHERE colors = "white,dark violet,yellow green"; +name colors +hat white,dark violet,yellow green +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_8_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_8_with_index.result new file mode 100644 index 00000000000..3e6bf4e1939 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_8_with_index.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +colors SET("black", +"dim gray", +"dark gray", +"gray", +"light gray", +"gainsboro", +"white smoke", +"white"), +INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; +Table Create Table +items CREATE TABLE `items` ( + `name` varchar(255) DEFAULT NULL, + `colors` set('black','dim gray','dark gray','gray','light gray','gainsboro','white smoke','white') DEFAULT NULL, + KEY `colors` (`colors`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO items VALUES ("t-shart", "black,gray"); +INSERT INTO items VALUES ("hat", "dim gray,dark gray"); +INSERT INTO items VALUES ("parka", "white smoke,light gray"); +SELECT * FROM items; +name colors +t-shart black,gray +hat dim gray,dark gray +parka light gray,white smoke +SELECT * FROM items WHERE colors = "dim gray,dark gray"; +name colors +hat dim gray,dark gray +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_bigint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_bigint_with_index.result new file mode 100644 index 00000000000..262f77556c6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_bigint_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price BIGINT KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("house", 9223372036854775807); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -9223372036854775808); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("super car", 2147483648); +SELECT * FROM items; +name price +discount -9223372036854775808 +coke 100 +note PC 32767 +super car 2147483648 +house 9223372036854775807 +SELECT * FROM items WHERE price <= 2147483648; +name price +discount -9223372036854775808 +coke 100 +note PC 32767 +super car 2147483648 +SELECT * FROM items WHERE price > 2147483647; +name price +super car 2147483648 +house 9223372036854775807 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_int_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_int_with_index.result new file mode 100644 index 00000000000..867b887182f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_int_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price INT KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("car", 2147483647); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -2147483647); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 16777216); +SELECT * FROM items; +name price +discount -2147483647 +coke 100 +note PC 32767 +bike 16777216 +car 2147483647 +SELECT * FROM items WHERE price <= 16777216; +name price +discount -2147483647 +coke 100 +note PC 32767 +bike 16777216 +SELECT * FROM items WHERE price > 16777215; +name price +bike 16777216 +car 2147483647 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_mediumint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_mediumint_with_index.result new file mode 100644 index 00000000000..c8b4f895a9c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_mediumint_with_index.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price MEDIUMINT KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("car", 8388607); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -8388608); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 32768); +SELECT * FROM items; +name price +discount -8388608 +coke 100 +note PC 32767 +bike 32768 +car 8388607 +SELECT * FROM items WHERE price <= 127; +name price +discount -8388608 +coke 100 +SELECT * FROM items WHERE price >= 32768; +name price +bike 32768 +car 8388607 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_smallint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_smallint_with_index.result new file mode 100644 index 00000000000..8a51ee5fd8f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_smallint_with_index.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price SMALLINT KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -32768); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("tablet PC", 20000); +SELECT * FROM items; +name price +discount -32768 +coke 100 +tablet PC 20000 +note PC 32767 +SELECT * FROM items WHERE price <= 127; +name price +discount -32768 +coke 100 +SELECT * FROM items WHERE price >= 128; +name price +tablet PC 20000 +note PC 32767 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_tinyint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_tinyint_with_index.result new file mode 100644 index 00000000000..d14efcca9a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_signed_tinyint_with_index.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price TINYINT KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("hamburger", 120); +INSERT INTO items VALUES ("discount", -10); +INSERT INTO items VALUES ("coke", 100); +SELECT * FROM items; +name price +discount -10 +coke 100 +hamburger 120 +SELECT * FROM items WHERE price <= 100; +name price +discount -10 +coke 100 +DROP TABLE items; 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 new file mode 100644 index 00000000000..9c2a8e876e3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS running_records; +CREATE TABLE running_records ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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) +VALUES ("bad condition", "12:23:34.123456", "838:59:58.999999"); +INSERT INTO running_records (title, average, max) +VALUES ("record failure", "-838:59:59.000000", "-838:59:59.000000"); +SELECT * FROM running_records; +id title average max +1 normal condition 01:00:00.000001 01:05:00.000001 +2 bad condition 12:23:34.123456 838:59:58.999999 +3 record failure -838:59:59.000000 -838:59:59.000000 +SELECT * FROM running_records +WHERE average BETWEEN "00:59:59.999999" AND "100:10:10.101010"; +id title average max +1 normal condition 01:00:00.000001 01:05:00.000001 +2 bad condition 12:23:34.123456 838:59:58.999999 +SELECT * FROM running_records +WHERE average BETWEEN "-838:59:59.000000" AND "01:00:00.000001"; +id title average max +3 record failure -838:59:59.000000 -838:59:59.000000 +1 normal condition 01:00:00.000001 01:05:00.000001 +DROP TABLE running_records; 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 new file mode 100644 index 00000000000..da75fd97424 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS running_records; +CREATE TABLE running_records ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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) +VALUES ("bad condition", "12:23:34", "838:59:59"); +INSERT INTO running_records (title, average, max) +VALUES ("record failure", "-838:59:59", "-838:59:59"); +SELECT * FROM running_records; +id title average max +1 normal condition 01:00:00 01:05:00 +2 bad condition 12:23:34 838:59:59 +3 record failure -838:59:59 -838:59:59 +SELECT * FROM running_records +WHERE average BETWEEN "00:59:59" AND "100:10:10"; +id title average max +1 normal condition 01:00:00 01:05:00 +2 bad condition 12:23:34 838:59:59 +SELECT * FROM running_records +WHERE average BETWEEN "-838:59:59" AND "01:00:00"; +id title average max +3 record failure -838:59:59 -838:59:59 +1 normal condition 01:00:00 01:05:00 +DROP TABLE running_records; 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 new file mode 100644 index 00000000000..da245535f2c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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", +"2012-01-29 21:51:02.222222"); +INSERT INTO diaries (title, created_at, updated_at) +VALUES ("rainy day", +"2012-01-30 01:23:45.333", +"2012-01-30 01:23:46.444"); +INSERT INTO diaries (title, created_at, updated_at) +VALUES ("cloudy day", +"2012-01-31 08:32:10.5555", +"2012-01-31 08:32:11.6666"); +SELECT * FROM diaries; +id title created_at updated_at +1 clear day 2012-01-29 21:51:01.111111 2012-01-29 21:51:02.222222 +2 rainy day 2012-01-30 01:23:45.333000 2012-01-30 01:23:46.444000 +3 cloudy day 2012-01-31 08:32:10.555500 2012-01-31 08:32:11.666600 +SELECT * FROM diaries +WHERE updated_at BETWEEN "2012-01-29 00:00:00.123456" AND +"2012-01-31 00:00:00.999999"; +id title created_at updated_at +1 clear day 2012-01-29 21:51:01.111111 2012-01-29 21:51:02.222222 +2 rainy day 2012-01-30 01:23:45.333000 2012-01-30 01:23:46.444000 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..b310de48111 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +created_at TIMESTAMP, +updated_at TIMESTAMP, +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) +VALUES ("rainy day", "2012-01-30 01:23:45", "2012-01-30 01:23:46"); +INSERT INTO diaries (title, created_at, updated_at) +VALUES ("cloudy day", "2012-01-31 08:32:10", "2012-01-31 08:32:11"); +SELECT * FROM diaries; +id title created_at updated_at +1 clear day 2012-01-29 21:51:01 2012-01-29 21:51:02 +2 rainy day 2012-01-30 01:23:45 2012-01-30 01:23:46 +3 cloudy day 2012-01-31 08:32:10 2012-01-31 08:32:11 +SELECT * FROM diaries +WHERE updated_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; +id title created_at updated_at +1 clear day 2012-01-29 21:51:01 2012-01-29 21:51:02 +2 rainy day 2012-01-30 01:23:45 2012-01-30 01:23:46 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_tinyint_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_tinyint_without_index.result new file mode 100644 index 00000000000..8dde1bdde6d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_tinyint_without_index.result @@ -0,0 +1,18 @@ +drop table if exists books; +create table books(title varchar(255), published tinyint); +insert into books values ("MySQL", 1); +insert into books values ("groonga", 1); +insert into books values ("mroonga", 0); +select count(*) from books where published = 0; +count(*) +1 +select count(*) from books where published = 1; +count(*) +2 +select count(*) from books where published != 2; +count(*) +3 +select count(*) from books where published != 1; +count(*) +1 +drop table books; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_with_index.result new file mode 100644 index 00000000000..d16004e3b82 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price BIGINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("house", 18446744073709551615); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("super car", 9223372036854775808); +SELECT * FROM items; +name price +discount 0 +coke 100 +note PC 32767 +super car 9223372036854775808 +house 18446744073709551615 +SELECT * FROM items WHERE price <= 9223372036854775808; +name price +discount 0 +coke 100 +note PC 32767 +super car 9223372036854775808 +SELECT * FROM items WHERE price > 9223372036854775807; +name price +super car 9223372036854775808 +house 18446744073709551615 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_without_index.result new file mode 100644 index 00000000000..277580c7710 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_without_index.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id BIGINT UNSIGNED +) DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES (317173755057152000); +INSERT INTO ids VALUES (317173755057152002); +SELECT * FROM ids; +id +317173755057152000 +317173755057152002 +SELECT * FROM ids WHERE id = 317173755057152000; +id +317173755057152000 +SELECT * FROM ids WHERE id = 317173755057152002; +id +317173755057152002 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_int_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_int_with_index.result new file mode 100644 index 00000000000..d14ef87702d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_int_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price INT UNSIGNED KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("car", 4294967295); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 2147483648); +SELECT * FROM items; +name price +discount 0 +coke 100 +note PC 32767 +bike 2147483648 +car 4294967295 +SELECT * FROM items WHERE price <= 2147483648; +name price +discount 0 +coke 100 +note PC 32767 +bike 2147483648 +SELECT * FROM items WHERE price > 2147483647; +name price +bike 2147483648 +car 4294967295 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_mediumint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_mediumint_with_index.result new file mode 100644 index 00000000000..2825aadae48 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_mediumint_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price MEDIUMINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("car", 16777215); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 8388607); +SELECT * FROM items; +name price +discount 0 +coke 100 +note PC 32767 +bike 8388607 +car 16777215 +SELECT * FROM items WHERE price <= 8388608; +name price +discount 0 +coke 100 +note PC 32767 +bike 8388607 +SELECT * FROM items WHERE price >= 8388607; +name price +bike 8388607 +car 16777215 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_smallint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_smallint_with_index.result new file mode 100644 index 00000000000..8586d091386 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_smallint_with_index.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price SMALLINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("note PC", 65535); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("tablet PC", 32767); +SELECT * FROM items; +name price +discount 0 +coke 100 +tablet PC 32767 +note PC 65535 +SELECT * FROM items WHERE price <= 32768; +name price +discount 0 +coke 100 +tablet PC 32767 +SELECT * FROM items WHERE price >= 32767; +name price +tablet PC 32767 +note PC 65535 +DROP TABLE items; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_tinyint_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_tinyint_with_index.result new file mode 100644 index 00000000000..90adb048361 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_tinyint_with_index.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS items; +CREATE TABLE items ( +name VARCHAR(255), +price TINYINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; +INSERT INTO items VALUES ("hamburger", 255); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +SELECT * FROM items; +name price +discount 0 +coke 100 +hamburger 255 +SELECT * FROM items WHERE price <= 100; +name price +discount 0 +coke 100 +DROP TABLE items; 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 new file mode 100644 index 00000000000..3ee91c1a408 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS aniversary_memos; +CREATE TABLE aniversary_memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +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) +VALUES ("Invitations are sent.", "2012"); +INSERT INTO aniversary_memos (title, party_year) +VALUES ("Tommorow is the anniversary party day!", "2012"); +INSERT INTO aniversary_memos (title, party_year) +VALUES ("Wow! Today is the anniversary party day!", "13"); +SELECT * FROM aniversary_memos; +id title party_year +1 We need a big cake! 2011 +2 Invitations are sent. 2012 +3 Tommorow is the anniversary party day! 2012 +4 Wow! Today is the anniversary party day! 2013 +SELECT * FROM aniversary_memos +WHERE party_year BETWEEN "12" AND "2013"; +id title party_year +2 Invitations are sent. 2012 +3 Tommorow is the anniversary party day! 2012 +4 Wow! Today is the anniversary party day! 2013 +DROP TABLE aniversary_memos; 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 new file mode 100644 index 00000000000..254a0c0718a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS aniversary_memos; +CREATE TABLE aniversary_memos ( +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) +VALUES ("Invitations are sent.", "2012"); +INSERT INTO aniversary_memos (title, party_year) +VALUES ("Tommorow is the anniversary party day!", "2012"); +INSERT INTO aniversary_memos (title, party_year) +VALUES ("Wow! Today is the anniversary party day!", "13"); +SELECT * FROM aniversary_memos; +id title party_year +1 We need a big cake! 2011 +2 Invitations are sent. 2012 +3 Tommorow is the anniversary party day! 2012 +4 Wow! Today is the anniversary party day! 2013 +SELECT * FROM aniversary_memos +WHERE party_year BETWEEN "12" AND "2013"; +id title party_year +2 Invitations are sent. 2012 +3 Tommorow is the anniversary party day! 2012 +4 Wow! Today is the anniversary party day! 2013 +DROP TABLE aniversary_memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result new file mode 100644 index 00000000000..56c868b2aa9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result @@ -0,0 +1,33 @@ +DROP DATABASE IF EXISTS `master/production`; +DROP DATABASE IF EXISTS `master/development`; +CREATE DATABASE `master/production`; +USE `master/production`; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT +) DEFAULT CHARSET=UTF8; +INSERT INTO diaries (title) VALUES ("clear day (production)"); +INSERT INTO diaries (title) VALUES ("rainy day (production)"); +INSERT INTO diaries (title) VALUES ("cloudy day (production)"); +SELECT * FROM diaries; +id title +1 clear day (production) +2 rainy day (production) +3 cloudy day (production) +CREATE DATABASE `master/development`; +USE `master/development`; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT +) DEFAULT CHARSET=UTF8; +INSERT INTO diaries (title) VALUES ("clear day (development)"); +INSERT INTO diaries (title) VALUES ("rainy day (development)"); +INSERT INTO diaries (title) VALUES ("cloudy day (development)"); +SELECT * FROM diaries; +id title +1 clear day (development) +2 rainy day (development) +3 cloudy day (development) +USE test; +DROP DATABASE `master/production`; +DROP DATABASE `master/development`; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..d2a00b777ec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result @@ -0,0 +1,172 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int); +create table t2 (c1 int); +create table t3 (c1 int); +drop table t1,t2,t3; +create table t1 (c1 int, c2 int, c3 int); +create table t2 (c1 int primary key, c2 int, c3 int); +drop table t1,t2; +create table t1 (c1 bit); +desc t1; +Field Type Null Key Default Extra +c1 bit(1) YES NULL +drop table t1; +create table t1 (c1 tinyint); +desc t1; +Field Type Null Key Default Extra +c1 tinyint(4) YES NULL +drop table t1; +create table t1 (c1 smallint); +desc t1; +Field Type Null Key Default Extra +c1 smallint(6) YES NULL +drop table t1; +create table t1 (c1 mediumint); +desc t1; +Field Type Null Key Default Extra +c1 mediumint(9) YES NULL +drop table t1; +create table t1 (c1 int); +desc t1; +Field Type Null Key Default Extra +c1 int(11) YES NULL +drop table t1; +create table t1 (c1 bigint); +desc t1; +Field Type Null Key Default Extra +c1 bigint(20) YES NULL +drop table t1; +create table t1 (c1 double); +desc t1; +Field Type Null Key Default Extra +c1 double YES NULL +drop table t1; +create table t1 (c1 float); +desc t1; +Field Type Null Key Default Extra +c1 float YES NULL +drop table t1; +create table t1 (c1 decimal); +desc t1; +Field Type Null Key Default Extra +c1 decimal(10,0) YES NULL +drop table t1; +create table t1 (c1 date); +desc t1; +Field Type Null Key Default Extra +c1 date YES NULL +drop table t1; +create table t1 (c1 time); +desc t1; +Field Type Null Key Default Extra +c1 time YES NULL +drop table t1; +create table t1 (c1 timestamp); +desc t1; +Field Type Null Key Default Extra +c1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +drop table t1; +create table t1 (c1 datetime); +desc t1; +Field Type Null Key Default Extra +c1 datetime YES NULL +drop table t1; +create table t1 (c1 year); +desc t1; +Field Type Null Key Default Extra +c1 year(4) YES NULL +drop table t1; +create table t1 (c1 char(10)); +desc t1; +Field Type Null Key Default Extra +c1 char(10) YES NULL +drop table t1; +create table t1 (c1 varchar(10)); +desc t1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +create table t1 (c1 binary(10)); +desc t1; +Field Type Null Key Default Extra +c1 binary(10) YES NULL +drop table t1; +create table t1 (c1 varbinary(10)); +desc t1; +Field Type Null Key Default Extra +c1 varbinary(10) YES NULL +drop table t1; +create table t1 (c1 tinyblob); +desc t1; +Field Type Null Key Default Extra +c1 tinyblob YES NULL +drop table t1; +create table t1 (c1 blob); +desc t1; +Field Type Null Key Default Extra +c1 blob YES NULL +drop table t1; +create table t1 (c1 mediumblob); +desc t1; +Field Type Null Key Default Extra +c1 mediumblob YES NULL +drop table t1; +create table t1 (c1 longblob); +desc t1; +Field Type Null Key Default Extra +c1 longblob YES NULL +drop table t1; +create table t1 (c1 tinytext); +desc t1; +Field Type Null Key Default Extra +c1 tinytext YES NULL +drop table t1; +create table t1 (c1 text); +desc t1; +Field Type Null Key Default Extra +c1 text YES NULL +drop table t1; +create table t1 (c1 mediumtext); +desc t1; +Field Type Null Key Default Extra +c1 mediumtext YES NULL +drop table t1; +create table t1 (c1 longtext); +desc t1; +Field Type Null Key Default Extra +c1 longtext YES NULL +drop table t1; +create table t1 (c1 enum("yes","no")); +desc t1; +Field Type Null Key Default Extra +c1 enum('yes','no') YES NULL +drop table t1; +create table t1 (c1 set("A","B","AB","O")); +desc t1; +Field Type Null Key Default Extra +c1 set('A','B','AB','O') YES NULL +drop table t1; +create table t1 (c1 int, `_id` int) engine = mroonga; +desc t1; +Field Type Null Key Default Extra +c1 int(11) YES NULL +_id int(11) YES NULL +drop table t1; +create table t1 (c1 int, `_score` float) engine = mroonga; +ERROR HY000: [column][create] name can't start with '_' and contains only 0-9, A-Z, a-z, #, @, - or _: <_score> +create table t1 (c1 int, `_id` text) engine = mroonga; +ERROR HY000: _id must be numeric data type +create table t1 (c1 int, `_id` int, index(`_id`)) engine = mroonga; +ERROR HY000: only hash index can be defined for _id +create table t1 (_id int, c1 int, primary key (_id)); +ERROR HY000: only hash index can be defined for _id +create table t1 (_id int, c1 int, primary key (_id) using hash); +drop table t1; +create table t1 (_id int, c1 int, unique key (_id)); +ERROR HY000: only hash index can be defined for _id +create table t1 (_id int, c1 int, unique key (_id) using hash); +drop table t1; +create table t1 (_id int, c1 int, key (_id)); +ERROR HY000: only hash index can be defined for _id +create table t1 (_id int, c1 int, key (_id) using hash); +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_comment_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_comment_normal.result new file mode 100644 index 00000000000..edda98cd034 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_comment_normal.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED +) DEFAULT CHARSET=utf8 +COMMENT='Free style normal comment'; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned DEFAULT NULL +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='Free style normal comment' +DROP TABLE bugs; 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 new file mode 100644 index 00000000000..1a9888d71da --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS tags; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +SELECT mroonga_command("dump"); +mroonga_command("dump") +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_normalizer_fulltext_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_fulltext_index.result new file mode 100644 index 00000000000..e2d405a1e35 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_fulltext_index.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_unicode_ci; +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_normalizer_no_utf8_charset_with_utf8_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.result new file mode 100644 index 00000000000..9d12e2d0e39 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES latin1; +CREATE TABLE diaries ( +day DATE PRIMARY KEY, +content VARCHAR(64) NOT NULL, +FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerMySQLGeneralCI"' +) DEFAULT CHARSET=latin1; +INSERT INTO diaries VALUES ("2013-04-23", "I drunk a black cookie."); +ERROR HY000: [tokenizer] failed to open normalized string +SELECT * FROM diaries; +day content +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result new file mode 100644 index 00000000000..68a6bc8012f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result @@ -0,0 +1,16 @@ +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64) COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump"); +mroonga_command("dump") +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 +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_vector.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result new file mode 100644 index 00000000000..cb6248ec3d5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags TEXT COMMENT 'flags "COLUMN_VECTOR"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump"); +mroonga_command("dump") +table_create bugs TABLE_PAT_KEY UInt32 +column_create bugs id COLUMN_SCALAR UInt32 +column_create bugs tags COLUMN_VECTOR LongText +DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_fulltext_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_fulltext_column.result new file mode 100644 index 00000000000..5fb52294758 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_fulltext_column.result @@ -0,0 +1,21 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 text, fulltext index (c2)); +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); +select * from t1; +c1 c2 +10 aa ii uu ee +20 ka ki ku ke +30 sa si su se +select * from t1 where match(c2) against("ki"); +c1 c2 +20 ka ki ku ke +delete from t1 where c1=20; +select * from t1; +c1 c2 +10 aa ii uu ee +30 sa si su se +select * from t1 where match(c2) against("ki"); +c1 c2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_btree_many_records.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_btree_many_records.result new file mode 100644 index 00000000000..f318e1255fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_btree_many_records.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT, +KEY (id) +) DEFAULT CHARSET UTF8; +INSERT INTO ids VALUES(1); +INSERT INTO ids VALUES(2); +INSERT INTO ids VALUES(3); +SELECT * FROM ids ORDER BY id; +id +1 +2 +3 +DELETE FROM ids WHERE id = 1; +SELECT * FROM ids ORDER BY id; +id +2 +3 +DELETE FROM ids WHERE id = 2; +SELECT * FROM ids ORDER BY id; +id +3 +DELETE FROM ids WHERE id = 3; +SELECT * FROM ids ORDER BY id; +id +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_no_unique.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_no_unique.result new file mode 100644 index 00000000000..76a4ed8835b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_no_unique.result @@ -0,0 +1,19 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, c1 int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id c1 +1 100 +2 100 +3 100 +4 100 +delete from t1 where _id = 2; +select * from t1; +_id c1 +1 100 +3 100 +4 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_unique.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_unique.result new file mode 100644 index 00000000000..6307c55fcc0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_unique.result @@ -0,0 +1,19 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, c1 int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id c1 +1 100 +2 100 +3 100 +4 100 +delete from t1 where _id = 2; +select * from t1; +_id c1 +1 100 +3 100 +4 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_normal_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_normal_column.result new file mode 100644 index 00000000000..7503c0b801e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_normal_column.result @@ -0,0 +1,34 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int, c2 int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL, + `c2` int(11) DEFAULT NULL +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +insert into t1 values (4, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +4 102 +delete from t1 where c1=3; +select * from t1; +c1 c2 +1 100 +2 101 +4 102 +flush tables; +delete from t1 where c1=2; +select * from t1; +c1 c2 +1 100 +4 102 +delete from t1; +select * from t1; +c1 c2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/delete_unsigned_bigint.result b/storage/mroonga/mysql-test/mroonga/storage/r/delete_unsigned_bigint.result new file mode 100644 index 00000000000..23cc23eeef6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/delete_unsigned_bigint.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS numbers; +CREATE TABLE numbers ( +data BIGINT UNSIGNED +); +INSERT INTO numbers VALUES(18446744073709551615); +SELECT * FROM numbers ORDER BY data; +data +18446744073709551615 +DELETE FROM numbers WHERE data = 18446744073709551615; +SELECT * FROM numbers ORDER BY data; +data +DROP TABLE numbers; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..4bd97162a6b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_TODO_SPLIT_ME.result @@ -0,0 +1,14 @@ +drop database if exists groonga; +create database groonga; +drop database groonga; +create database groonga; +use groonga; +create table t1 (c1 int primary key, c2 varchar(255)) default charset utf8; +create table t2 (c1 int primary key, c2 varchar(255)) default charset utf8; +drop database groonga; +create database groonga; +use groonga; +create table t1 (c1 int primary key, c2 varchar(255)) default charset utf8; +create table t2 (c1 int primary key, c2 varchar(255)) default charset utf8; +drop table t1, t2; +drop database groonga; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/drop_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/drop_table_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..99896765e28 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/drop_table_TODO_SPLIT_ME.result @@ -0,0 +1,5 @@ +drop table if exists alphabet, `with-hyphen`; +create table alphabet (c1 int primary key, c2 int, c3 int); +drop table alphabet; +create table `with-hyphen` (c1 int primary key, c2 int, c3 int); +drop table `with-hyphen`; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/flush_logs.result b/storage/mroonga/mysql-test/mroonga/storage/r/flush_logs.result new file mode 100644 index 00000000000..449f6437501 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/flush_logs.result @@ -0,0 +1 @@ +flush logs; 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 new file mode 100644 index 00000000000..fc550d97f87 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result @@ -0,0 +1,147 @@ +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) +); +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; +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 +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; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_empty_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_empty_query.result new file mode 100644 index 00000000000..96c6ae4150c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_empty_query.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT * +FROM diaries +WHERE MATCH(title) AGAINST("" IN BOOLEAN MODE); +title +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..a48eb25dece --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +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("\\(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/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result new file mode 100644 index 00000000000..d0e1a68f76b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +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, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT * FROM diaries WHERE MATCH(content) AGAINST("-明日 +天気" IN BOOLEAN MODE); +id title content +3 富士山 今日も天気がよくてきれいに見える。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result new file mode 100644 index 00000000000..d10b5dad815 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- fine is be" IN BOOLEAN MODE); +content +Yesterday was fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result new file mode 100644 index 00000000000..82c7e799fd4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- is OR be fine" IN BOOLEAN MODE); +content +Today is good day. +Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result new file mode 100644 index 00000000000..c4c7b0e8546 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- good +day be" IN BOOLEAN MODE); +content +Today is good day. +Yesterday was good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result new file mode 100644 index 00000000000..f45e8fd4fb6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today good" IN BOOLEAN MODE); +content +Today is good day. +Today is fine. +Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result new file mode 100644 index 00000000000..103866902c2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today -good tomorrow" IN BOOLEAN MODE); +content +Tomorrow will be good day. +Today is fine. +Tomorrow will be fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result new file mode 100644 index 00000000000..fd52868b4bc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today +good tomorrow" IN BOOLEAN MODE); +content +Today is good day. +Tomorrow will be good day. +Tomorrow will be fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result new file mode 100644 index 00000000000..4d1f65923c4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today good" IN BOOLEAN MODE); +content +Today is good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result new file mode 100644 index 00000000000..deda6f3bb1a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today -good is" IN BOOLEAN MODE); +content +Today is fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result new file mode 100644 index 00000000000..2d25388fada --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today OR tomorrow day" IN BOOLEAN MODE); +content +Today is good day. +Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_full_spec.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_full_spec.result new file mode 100644 index 00000000000..b8f15d9847e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_full_spec.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("*W1:10,2:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1:10,2:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 12 +3 富士山 今日も天気がよくてきれいに見える。 2 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_no_weight.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_no_weight.result new file mode 100644 index 00000000000..42aa068a547 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_no_weight.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("*W1,2:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1,2:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 3 +3 富士山 今日も天気がよくてきれいに見える。 2 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_omit_section.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_omit_section.result new file mode 100644 index 00000000000..c73d2660d54 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_omit_section.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("*W1:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 3 +3 富士山 今日も天気がよくてきれいに見える。 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.result new file mode 100644 index 00000000000..b1b9d5f4f41 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +title VARCHAR(255), +tag1 VARCHAR(10), +tag2 VARCHAR(10), +tag3 VARCHAR(10), +tag4 VARCHAR(10), +tag5 VARCHAR(10), +tag6 VARCHAR(10), +tag7 VARCHAR(10), +tag8 VARCHAR(10), +tag9 VARCHAR(10), +tag10 VARCHAR(10), +FULLTEXT INDEX (tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) +) DEFAULT CHARSET=utf8; +INSERT INTO memos +VALUES("Groonga", +"tag 1", +"tag 2", +"tag 3", +"tag 4", +"tag 5", +"tag 6", +"tag 7", +"tag 8", +"tag 9", +"tag 10"); +SELECT title, +MATCH(tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) +AGAINST("*W1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20 +tag" + in BOOLEAN MODE) AS score +FROM memos +WHERE MATCH(tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) +AGAINST("*W1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20 +tag" + in BOOLEAN MODE); +title score +Groonga 110 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_three_or_more_sections.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_three_or_more_sections.result new file mode 100644 index 00000000000..02db17e61da --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_three_or_more_sections.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +title VARCHAR(255), +category VARCHAR(10), +content TEXT, +FULLTEXT INDEX (title, category, content) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES(1, "Hello", "日記", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気予報", "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "天気", "今日も天気がよくてきれいに見える。"); +SELECT *, MATCH(title, category, content) +AGAINST("*W1:2,2:10,3:1 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, category, content) +AGAINST("*W1:2,2:10,3:1 +天気" in BOOLEAN MODE); +id title category content score +2 天気予報 天気 明日の富士山の天気について 13 +3 富士山 天気 今日も天気がよくてきれいに見える。 11 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..5746ce89cb7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = ERROR; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +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("(groonga" IN BOOLEAN MODE); +ERROR 42000: failed to parse fulltext search keyword: <(groonga>: > +DROP TABLE memos; +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..1811994b67e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = ERROR_AND_LOG; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +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("(groonga" IN BOOLEAN MODE); +ERROR 42000: failed to parse fulltext search keyword: <(groonga>: > +DROP TABLE memos; +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..6a4759963a3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = "IGNORE"; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +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("(groonga" IN BOOLEAN MODE); +id content +DROP TABLE memos; +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..384d677c427 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS memos; +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = IGNORE_AND_LOG; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; +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("(groonga" IN BOOLEAN MODE); +id content +DROP TABLE memos; +SET GLOBAL mroonga_default_parser = TokenBigram; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_ascii.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_ascii.result new file mode 100644 index 00000000000..c542ba1adae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_ascii.result @@ -0,0 +1,29 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, c3 text, 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"); +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 +select * from t1 where match(c3) against("su"); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("ii"); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +select * from t1 where match(c3) against("+su" in boolean mode); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("+ii" in boolean mode); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_cp932.result new file mode 100644 index 00000000000..bd208d520c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_cp932.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932; +insert into t1 values(1, "̕xmR̓VCɂ‚",""); +insert into t1 values(2, "","̕xmR̓VC͕܂"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 ̕xmR̓VCɂ‚ +2 ̕xmR̓VC͕܂ +3 dummy dummy +select * from t1 where match(c2) against("xmR"); +c1 c2 c3 +1 ̕xmR̓VCɂ‚ +select * from t1 where match(c3) against("xmR"); +c1 c2 c3 +2 ̕xmR̓VC͕܂ +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_eucjpms.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_eucjpms.result new file mode 100644 index 00000000000..51360875cf1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_eucjpms.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms; +insert into t1 values(1, "ٻλŷˤĤ",""); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 ٻλŷˤĤ +2 ٻλŷʬޤ +3 dummy dummy +select * from t1 where match(c2) against("ٻλ"); +c1 c2 c3 +1 ٻλŷˤĤ +select * from t1 where match(c3) against("ٻλ"); +c1 c2 c3 +2 ٻλŷʬޤ +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_japanese.result new file mode 100644 index 00000000000..cfff3f2e29b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_japanese.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 明日の富士山の天気について あああああああ +2 いいいいい 明日の富士山の天気は分かりません +3 dummy dummy +select * from t1 where match(c2) against("富士山"); +c1 c2 c3 +1 明日の富士山の天気について あああああああ +select * from t1 where match(c3) against("富士山"); +c1 c2 c3 +2 いいいいい 明日の富士山の天気は分かりません +drop table t1; 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 new file mode 100644 index 00000000000..31d45181c96 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8mb4; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +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, "ひらがな", "あいうえお"); +SELECT * +FROM diaries +WHERE MATCH (content) AGAINST("ABCDE" IN BOOLEAN MODE); +id title content +1 Alphabet ABCDE +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_empty_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_empty_query.result new file mode 100644 index 00000000000..bb7b3b63752 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_empty_query.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT * +FROM diaries +WHERE MATCH(title) AGAINST(""); +title +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..c107991d151 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT SQL_CALC_FOUND_ROWS * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; +id year month day title content +5 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +6 2011 12 2 初雪 今日の天気は雪! +1 2011 11 9 Hello 今日からはじめました。 +2 2011 11 10 天気 明日の富士山の天気について +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +SELECT FOUND_ROWS(); +FOUND_ROWS() +6 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_groonga_varchar_vector.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_groonga_varchar_vector.result new file mode 100644 index 00000000000..a23d8e5b542 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_groonga_varchar_vector.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS bugs, tags; +CREATE TABLE tags ( +name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COLLATE=utf8_bin +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tags VARCHAR(40) COMMENT 'type "tags", flags "COLUMN_VECTOR"', +FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL"); +INSERT INTO bugs (id, tags) VALUES (2, "MySQL groonga"); +INSERT INTO bugs (id, tags) VALUES (3, "mroonga"); +SELECT * +FROM bugs +WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE); +id tags +1 Linux MySQL +2 MySQL groonga +DROP TABLE bugs, tags; 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 new file mode 100644 index 00000000000..04996d30f36 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result @@ -0,0 +1,41 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +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, "富士山", "今日もきれい。"); +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +drop index title on diaries; +select * from diaries where match(title) against("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +create fulltext index new_title_index on diaries (title); +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result new file mode 100644 index 00000000000..6c268ff7641 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result @@ -0,0 +1,66 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t2; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t2 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t1 where c1>3 order by c1 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c1>3 order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c2>"s" order by c2 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c2>"s" order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select * from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +c1 c2 +3 aa ii ii ii oo +5 ta ti ii ii to +1 aa ii uu ee oo +select * from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +c1 c2 +1 aa ii uu ee oo +5 ta ti ii ii to +3 aa ii ii ii oo +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +select c1,c2,match(c2) against("ii") from t2 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +drop table t1,t2; 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 new file mode 100644 index 00000000000..623c66daaf4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result @@ -0,0 +1,25 @@ +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"); +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +flush tables; +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +drop table t1; 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 new file mode 100644 index 00000000000..843c4b958ba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result @@ -0,0 +1,34 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +delete from diaries where id = 2; +select * from diaries where match(title, content) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(content) against("富士山"); +id title content +drop table diaries; 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 new file mode 100644 index 00000000000..3856d7ecc10 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result @@ -0,0 +1,40 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +drop table diaries; 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 new file mode 100644 index 00000000000..59b26574c73 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result @@ -0,0 +1,42 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +drop index title on diaries; +select * from diaries where match(title, content) against("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +create fulltext index new_title_content_index on diaries (title, content); +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +drop table diaries; 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 new file mode 100644 index 00000000000..d17ff6adf83 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result @@ -0,0 +1,37 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +update diaries set title = "チョモランマ" where id = 3; +update diaries set content = "チョモランマと富士山" where id = 1; +select * from diaries where match(title, content) against("富士山"); +id title content +1 Hello チョモランマと富士山 +2 天気 明日の富士山の天気について +select * from diaries where match(title) against("富士山"); +id title content +select * from diaries where match(content) against("富士山"); +id title content +1 Hello チョモランマと富士山 +2 天気 明日の富士山の天気について +drop table diaries; 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 new file mode 100644 index 00000000000..81b40261a4c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result @@ -0,0 +1,33 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +title text, +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."); +select * from diaries +where match(title) against("survey") and +match(body) against("groonga"); +id title body +1 survey will start groonga! +select *, match(title) against("survey"), match(body) against("groonga") +from diaries +where match(title) against("survey") and +match(body) against("groonga"); +id title body match(title) against("survey") match(body) against("groonga") +1 survey will start groonga! 1048577 149797 +drop table diaries; 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 new file mode 100644 index 00000000000..5f85632575b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +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("富士山", "今日も天気がよくてきれいに見える。"); +SELECT * FROM diaries WHERE MATCH(content) AGAINST("*D+ 今日 天気" IN BOOLEAN MODE); +title content +富士山 今日も天気がよくてきれいに見える。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_not_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_not_match_against.result new file mode 100644 index 00000000000..2c1666369a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_not_match_against.result @@ -0,0 +1,68 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)); +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select * from t1 where match(c3) against("uu"); +c1 c2 c3 +1 10 aa ii uu ee oo +3 10 aa ii uu ee oo +5 20 aa ii uu ee oo +7 20 aa ii uu ee oo +select * from t1 where not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where match(c3) against("dummy"); +c1 c2 c3 +select * from t1 where not match(c3) against("dummy"); +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select * from t1 where c1 = 4 and not match(c3) against("uu"); +c1 c2 c3 +4 10 ka ki ku ke ko +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c1 > 4 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 = 10 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 < 15 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_or.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_or.result new file mode 100644 index 00000000000..f1f7888ceeb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_or.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT * +FROM diaries +WHERE MATCH(title) AGAINST("Ruby" IN BOOLEAN MODE) OR +MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +title +Start mroonga +Start groonga and Ruby +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_against.result new file mode 100644 index 00000000000..d1f0d6bc0ab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_against.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga mroonga" IN BOOLEAN MODE) +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start mroonga 0 +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_match.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_match.result new file mode 100644 index 00000000000..b4a07cd0b66 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_different_match.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +body TEXT, +FULLTEXT KEY (title), +FULLTEXT KEY (body) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga", "I read groonga's tutorial."); +INSERT INTO diaries VALUES("Start mroonga", "I read mroonga's tutorial."); +INSERT INTO diaries VALUES("Start groonga and Ruby", "I installed rroonga."); +SELECT * FROM diaries; +title body +Start groonga I read groonga's tutorial. +Start mroonga I read mroonga's tutorial. +Start groonga and Ruby I installed rroonga. +SELECT *, MATCH(body) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) +ORDER BY MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +title body score +Start groonga and Ruby I installed rroonga. 0 +Start groonga I read groonga's tutorial. 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_no_where.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_no_where.result new file mode 100644 index 00000000000..125b35fb96e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_no_where.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start mroonga 0 +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_same_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_same_match_against.result new file mode 100644 index 00000000000..a3a668c4445 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_same_match_against.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_comment.result new file mode 100644 index 00000000000..f2abfe85dd6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_comment.result @@ -0,0 +1,29 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +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 +insert into diaries (body) values ("will start groonga!"); +insert into diaries (body) values ("starting groonga..."); +insert into diaries (body) values ("started groonga."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +select * from diaries where match(body) against("start"); +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_default.result new file mode 100644 index 00000000000..6c04cae59f2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_default.result @@ -0,0 +1,33 @@ +drop table if exists diaries; +set @mroonga_default_parser_backup=@@mroonga_default_parser; +set global mroonga_default_parser=TokenBigramSplitSymbolAlphaDigit; +create table diaries ( +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."); +insert into diaries (body) values ("finished groonga."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +4 finished groonga. +select * from diaries where match(body) against("start"); +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +drop table diaries; +set global mroonga_default_parser=@mroonga_default_parser_backup; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_off.result new file mode 100644 index 00000000000..77765f61dc3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_parser_off.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS variables; +CREATE TABLE variables ( +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 +INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix"); +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"); +INSERT INTO variables (name) VALUES ("mroonga_enable_optimization"); +INSERT INTO variables (name) VALUES ("mroonga_libgroonga_version"); +INSERT INTO variables (name) VALUES ("mroonga_log_file"); +INSERT INTO variables (name) VALUES ("mroonga_log_level"); +INSERT INTO variables (name) VALUES ("mroonga_match_escalation_threshold"); +INSERT INTO variables (name) VALUES ("mroonga_version"); +SELECT * FROM variables; +id name +1 mroonga_database_path_prefix +2 mroonga_default_parser +3 mroonga_default_wrapper_engine +4 mroonga_dry_write +5 mroonga_enable_optimization +6 mroonga_libgroonga_version +7 mroonga_log_file +8 mroonga_log_level +9 mroonga_match_escalation_threshold +10 mroonga_version +SELECT * FROM variables +WHERE MATCH (name) AGAINST ("mroonga_default*" IN BOOLEAN MODE); +id name +3 mroonga_default_wrapper_engine +2 mroonga_default_parser +DROP TABLE variables; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_two_inner_join.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_two_inner_join.result new file mode 100644 index 00000000000..e39790ed5be --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_two_inner_join.result @@ -0,0 +1,41 @@ +DROP TABLE IF EXISTS users, posts, comments; +SET NAMES utf8; +CREATE TABLE users ( +id int NOT NULL, +name varchar(50) NOT NULL, +PRIMARY KEY (id), +KEY (name) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE posts ( +id int NOT NULL, +content mediumtext, +user_id int NOT NULL, +PRIMARY KEY (id), +FULLTEXT KEY (content) +) DEFAULT CHARSET=utf8; +CREATE TABLE comments ( +id int NOT NULL, +user_id int NOT NULL, +post_id int NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO users VALUES (1, "Alice"), +(2, "Bob"), +(3, "Calros"); +INSERT INTO posts VALUES (1, "Hello!", 1), +(2, "World!", 2), +(3, "Great!", 3); +INSERT INTO comments VALUES (1, 1, 1), +(2, 2, 1), +(3, 3, 3); +SELECT * +FROM comments +INNER JOIN posts +ON posts.id = comments.post_id AND +MATCH (posts.content) AGAINST ("Hello!" IN BOOLEAN MODE) +INNER JOIN users +ON users.id = comments.user_id AND +users.name = "Alice"; +id user_id post_id id content user_id id name +1 1 1 1 Hello! 1 1 Alice +DROP TABLE users, posts, comments; 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_100_no_such_key.result new file mode 100644 index 00000000000..d3ac2387586 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_100_no_such_key.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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."); +SELECT * FROM diaries FORCE INDEX(primary) +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; 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_55_no_such_key.result new file mode 100644 index 00000000000..5f7bc98a3d3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_55_no_such_key.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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."); +SELECT * FROM diaries FORCE INDEX(primary) +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); +id title body +DROP TABLE diaries; 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_56_no_such_key.result new file mode 100644 index 00000000000..d3ac2387586 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_56_no_such_key.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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."); +SELECT * FROM diaries FORCE INDEX(primary) +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result new file mode 100644 index 00000000000..1551d32c971 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT mroonga_command('select diaries --match_columns "title" --query "groonga"'); +mroonga_command('select diaries --match_columns "title" --query "groonga"') +[[[2],[["_id","UInt32"],["title","LongText"]],[1,"Start groonga"],[3,"Start groonga and Ruby"]]] +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result new file mode 100644 index 00000000000..98213e81eb9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result @@ -0,0 +1,3 @@ +SET NAMES UTF8; +SELECT mroonga_escape() AS escaped_query; +ERROR HY000: Can't initialize function 'mroonga_escape'; mroonga_escape(): Incorrect number of arguments: 0 for 1..2 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 new file mode 100644 index 00000000000..c1762458199 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result @@ -0,0 +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 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_target_characters_is_not_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_target_characters_is_not_string.result new file mode 100644 index 00000000000..77dc420f0c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_target_characters_is_not_string.result @@ -0,0 +1,3 @@ +SET NAMES UTF8; +SELECT mroonga_escape('+-><~*()\"\\:', 29) AS escaped_query; +ERROR HY000: Can't initialize function 'mroonga_escape'; mroonga_escape(): The 2st argument must be escape target characters as 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_success_all.result new file mode 100644 index 00000000000..b002262a83f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_all.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_escape('+-><~*()\"\\:') AS escaped_query; +escaped_query +\+\-\>\<\~\*\(\)\"\\\: 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_success_custom.result new file mode 100644 index 00000000000..c2e7d8f50ef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_custom.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_escape('+-><~*()\"\\:', '()<>~') 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_success_nested.result new file mode 100644 index 00000000000..5a57c144891 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_success_nested.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT mroonga_escape(mroonga_escape('*groonga*')); +mroonga_escape(mroonga_escape('*groonga*')) +\\\*groonga\\\* +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result new file mode 100644 index 00000000000..42064b7f189 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result @@ -0,0 +1,28 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, c1 int); +select last_insert_grn_id(); +last_insert_grn_id() +0 +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +last_insert_grn_id() +2 +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +last_insert_grn_id() +4 +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +last_insert_grn_id() +6 +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +last_insert_grn_id() +8 +select last_insert_grn_id(1); +ERROR HY000: Can't initialize function 'last_insert_grn_id'; last_insert_grn_id must not have arguments +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_reference.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_reference.result new file mode 100644 index 00000000000..b0db86cb5ec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_reference.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int AUTO_INCREMENT PRIMARY KEY +); +SELECT last_insert_id(); +last_insert_id() +0 +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +last_insert_id() +1 +SELECT * FROM ids; +id +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_set.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_set.result new file mode 100644 index 00000000000..ec6f2f98462 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_set.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int AUTO_INCREMENT PRIMARY KEY +); +SELECT last_insert_id(); +last_insert_id() +0 +SELECT last_insert_id(10); +last_insert_id(10) +10 +SELECT last_insert_id(); +last_insert_id() +10 +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +last_insert_id() +1 +SELECT * FROM ids; +id +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result new file mode 100644 index 00000000000..5766f822ee3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result @@ -0,0 +1,120 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)); +insert into t1 values(1,10,"aa bb cc dd ee >< ff gg hh ii jj kk ll mm nn"); +insert into t1 values(2,20,"nn mm ll kk jj >< ii hh gg ff ee dd cc bb aa"); +insert into t1 values(3,30,"cc dd ee ff gg >< hh ii jj kk ll mm nn oo pp"); +insert into t1 values(4,40,"ee ff gg hh ii >< jj kk ll mm nn oo pp qq rr"); +insert into t1 values(5,50,"AA BB CC DD EE >< FF GG HH II JJ KK LL MM NN"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') +1 10 ...a bb cc dd...
+...e >< ff gg...
+ +2 20 ...g ff ee dd...
+... cc bb aa...
+ +3 30 ...c dd ee ff...
+ +4 40 ...ee ff gg h...
+ +5 50 ...A BB CC DD...
+...E >< FF GG...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') +1 10 ... bb cc dd ...
+... >< ff gg ...
+ +2 20 ... ff ee dd ...
+...cc bb aa...
+ +3 30 ... dd ee ff ...
+ +4 40 ...ee ff gg h...
+ +5 50 +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') +1 10 ... bb cc dd ...
+... >< ff gg ...
+ +2 20 ... ff ee dd ...
+...cc bb aa...
+ +3 30 ... dd ee ff ...
+ +4 40 ...ee ff gg h...
+ +5 50 ... BB CC DD ...
+... >< FF GG ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') +1 10 ... bb cc dd ...
+... >< ff gg ...
+ +2 20 ... ff ee dd ...
+...cc bb aa...
+ +3 30 ... dd ee ff ...
+ +4 40 ...ee ff gg h...
+ +5 50 +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') +1 10 ...a(w1)[ bb] cc(w3)[ dd]... +...e ><(w2)[ ff] gg... + +2 20 ...g(w2)[ ff] ee(w3)[ dd]... +... cc(w1)[ bb] aa... + +3 30 ...c(w3)[ dd] ee(w2)[ ff]... + +4 40 ...ee(w2)[ ff] gg h... + +5 50 ...A(w1)[ BB] CC(w3)[ DD]... +...E ><(w2)[ FF] GG... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') +1 10 ... (w1)[bb] cc (w3)[dd] ... +... >< (w2)[ff] gg ... + +2 20 ... (w2)[ff] ee (w3)[dd] ... +...cc (w1)[bb] aa... + +3 30 ... (w3)[dd] ee (w2)[ff] ... + +4 40 ...ee (w2)[ff] gg h... + +5 50 +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') +1 10 ... (w1)[bb] cc (w3)[dd] ... +... >< (w2)[ff] gg ... + +2 20 ... (w2)[ff] ee (w3)[dd] ... +...cc (w1)[bb] aa... + +3 30 ... (w3)[dd] ee (w2)[ff] ... + +4 40 ...ee (w2)[ff] gg h... + +5 50 ... (w1)[BB] CC (w3)[DD] ... +... >< (w2)[FF] GG ... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') +1 10 ... (w1)[bb] cc (w3)[dd] ... +... >< (w2)[ff] gg ... + +2 20 ... (w2)[ff] ee (w3)[dd] ... +...cc (w1)[bb] aa... + +3 30 ... (w3)[dd] ee (w2)[ff] ... + +4 40 ...ee (w2)[ff] gg h... + +5 50 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_cp932.result new file mode 100644 index 00000000000..a21157a0a18 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_cp932.result @@ -0,0 +1,91 @@ +drop table if exists t1, t2, t3; +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932; +insert into t1 values(1, "","QX̕xmR̓VCɂ‚"); +insert into t1 values(2, "","QX̕xmR̓VC͕܂"); +insert into t1 values(3, "","29̕xmR̓VCɂ‚"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') +1 ...QX̕x...
+...VCɂ...
+ +2 ...QX̕x...
+...VC͕...
+ +3 ...29̕xm...
+...VCɂ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') +1 ...QX̕x...
+...VCɂ...
+ +2 ...QX̕x...
+...VC͕...
+ +3 ...xmR...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') +1 ...QX̕x...
+...VCɂ...
+ +2 ...QX̕x...
+...VC͕...
+ +3 ...29̕xm...
+...VCɂ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') +1 ...QX̕x...
+...VCɂ...
+ +2 ...QX̕x...
+...VC͕...
+ +3 ...xmR...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') +1 ...(w1)[QX]̕x... +...(w2)[VC]ɂ... + +2 ...(w1)[QX]̕x... +...(w2)[VC]͕... + +3 ...(w1)[29]̕xm... +...(w2)[VC]ɂ... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') +1 ...(w1)[QX]̕x... +...(w2)[VC]ɂ... + +2 ...(w1)[QX]̕x... +...(w2)[VC]͕... + +3 ...(w3)[xmR]... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') +1 ...(w1)[QX]̕x... +...(w2)[VC]ɂ... + +2 ...(w1)[QX]̕x... +...(w2)[VC]͕... + +3 ...(w1)[29]̕xm... +...(w2)[VC]ɂ... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') +1 ...(w1)[QX]̕x... +...(w2)[VC]ɂ... + +2 ...(w1)[QX]̕x... +...(w2)[VC]͕... + +3 ...(w3)[xmR]... + +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_eucjpms.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_eucjpms.result new file mode 100644 index 00000000000..e4c6a41773e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_eucjpms.result @@ -0,0 +1,91 @@ +drop table if exists t1, t2, t3; +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms; +insert into t1 values(1, "","ٻλŷˤĤ"); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "","29ٻλŷˤĤ"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') +1 ......
+...ŷˤ...
+ +2 ......
+...ŷʬ...
+ +3 ...29ٻ...
+...ŷˤ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') +1 ......
+...ŷˤ...
+ +2 ......
+...ŷʬ...
+ +3 ...ٻλ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') +1 ......
+...ŷˤ...
+ +2 ......
+...ŷʬ...
+ +3 ...29ٻ...
+...ŷˤ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') +1 ......
+...ŷˤ...
+ +2 ......
+...ŷʬ...
+ +3 ...ٻλ...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') +1 ...(w1)[]... +...(w2)[ŷ]ˤ... + +2 ...(w1)[]... +...(w2)[ŷ]ʬ... + +3 ...(w1)[29]ٻ... +...(w2)[ŷ]ˤ... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') +1 ...(w1)[]... +...(w2)[ŷ]ˤ... + +2 ...(w1)[]... +...(w2)[ŷ]ʬ... + +3 ...(w3)[ٻλ]... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') +1 ...(w1)[]... +...(w2)[ŷ]ˤ... + +2 ...(w1)[]... +...(w2)[ŷ]ʬ... + +3 ...(w1)[29]ٻ... +...(w2)[ŷ]ˤ... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') +1 ...(w1)[]... +...(w2)[ŷ]ˤ... + +2 ...(w1)[]... +...(w2)[ŷ]ʬ... + +3 ...(w3)[ٻλ]... + +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_nonexistent_charset.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_nonexistent_charset.result new file mode 100644 index 00000000000..78cee62696f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_nonexistent_charset.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_snippet("Invalid charset test", 10, 2, "nonexistent_charset", +1, 0, "...", "...", "charset", "<", ">"); +ERROR HY000: Can't initialize function 'mroonga_snippet'; Unknown charset: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_unsupported_charset.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_unsupported_charset.result new file mode 100644 index 00000000000..bf967adbf46 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_unsupported_charset.result @@ -0,0 +1,4 @@ +SET NAMES UTF8; +SELECT mroonga_snippet("Unsuppported charset test", 10, 2, "big5", +1, 0, "...", "...", "charset", "<", ">"); +ERROR HY000: Can't initialize function 'mroonga_snippet'; Unknown charset: diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_japanese.result new file mode 100644 index 00000000000..05a63a3d597 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_japanese.result @@ -0,0 +1,95 @@ +drop table if exists t1, t2, t3; +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8; +insert into t1 values(1, "あああああ","29日の富士山の天気について"); +insert into t1 values(2, "いいいいい","29日の富士山の天気は分かりません"); +insert into t1 values(3, "ううううう","29日の富士山の天気について"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') +1 あああああ ...29日...
+...富士山...
+ +2 いいいいい ...29日...
+...富士山...
+ +3 ううううう ...29日の...
+...天気に...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') +1 あああああ ...29日...
+...富士山...
+ +2 いいいいい ...29日...
+...富士山...
+ +3 ううううう ...富士山...
+...天気に...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') +1 あああああ ...29日...
+...富士山...
+ +2 いいいいい ...29日...
+...富士山...
+ +3 ううううう ...29日の...
+...天気に...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') +1 あああああ ...29日...
+...富士山...
+ +2 いいいいい ...29日...
+...富士山...
+ +3 ううううう ...富士山...
+...天気に...
+ +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') +1 あああああ ...(w1)[29日]... +...(w3)[富士山]... + +2 いいいいい ...(w1)[29日]... +...(w3)[富士山]... + +3 ううううう ...(w1)[29日]の... +...(w2)[天気]に... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') +1 あああああ ...(w1)[29日]... +...(w3)[富士山]... + +2 いいいいい ...(w1)[29日]... +...(w3)[富士山]... + +3 ううううう ...(w3)[富士山]... +...(w2)[天気]に... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') +1 あああああ ...(w1)[29日]... +...(w3)[富士山]... + +2 いいいいい ...(w1)[29日]... +...(w3)[富士山]... + +3 ううううう ...(w1)[29日]の... +...(w2)[天気]に... + +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') +1 あああああ ...(w1)[29日]... +...(w3)[富士山]... + +2 いいいいい ...(w1)[29日]... +...(w3)[富士山]... + +3 ううううう ...(w3)[富士山]... +...(w2)[天気]に... + +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result new file mode 100644 index 00000000000..2e9314db109 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS shops; +CREATE TABLE shops ( +location GEOMETRY NOT NULL +); +INSERT INTO shops VALUES (NULL), (NULL); +Warnings: +Warning 1048 Column 'location' cannot be null +Warning 1048 Column 'location' cannot be null +SELECT AsText(location) FROM shops; +AsText(location) +POINT(0 0) +POINT(0 0) +DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result new file mode 100644 index 00000000000..e88402a10b4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result @@ -0,0 +1,170 @@ +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) +); +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', +GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) +VALUES ('taiyaki-kataoka', +GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) +VALUES ('soba-taiyaki-ku', +GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) +VALUES ('kuruma', +GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) +VALUES ('hirose-ya', +GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) +VALUES ('sazare', +GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) +VALUES ('omede-taiyaki', +GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) +VALUES ('onaga-ya', +GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) +VALUES ('shiro-ya', +GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) +VALUES ('fuji-ya', +GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) +VALUES ('miyoshi', +GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) +VALUES ('juju-ya', +GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) +VALUES ('tatsumi-ya', +GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) +VALUES ('tetsuji', +GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) +VALUES ('gazuma-ya', +GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) +VALUES ('honma-mon', +GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) +VALUES ('naniwa-ya', +GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) +VALUES ('kuro-dai', +GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) +VALUES ('daruma', +GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) +VALUES ('yanagi-ya', +GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) +VALUES ('sharaku', +GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) +VALUES ('takane', +GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) +VALUES ('chiyoda', +GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) +VALUES ('da-ka-po', +GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) +VALUES ('matsushima-ya', +GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) +VALUES ('kazuya', +GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) +VALUES ('furuya-kogane-an', +GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) +VALUES ('hachi-no-ie', +GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) +VALUES ('azuki-chan', +GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) +VALUES ('kuriko-an', +GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) +VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', +GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) +VALUES ('naze-ya', +GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) +VALUES ('sanoki-ya', +GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) +VALUES ('shigeta', +GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) +VALUES ('nishimi-ya', +GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) +VALUES ('hiiragi', +GeomFromText('POINT(139.711517 35.647701)')); +SELECT id, name, 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, AsText(location) AS location_text FROM shops +WHERE MBRContains(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) +DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_datetime.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_datetime.result new file mode 100644 index 00000000000..78ed69f0ef8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_datetime.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +created_at datetime, +title varchar(256), +KEY created_at_key(created_at) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES ("1000-01-01 00:00:00", "The start"); +INSERT INTO diaries VALUES ("2012-10-25 16:18:29", "Today is shiny day."); +INSERT INTO diaries VALUES ("9999-12-31 23:59:59", "The end"); +SELECT * +FROM diaries FORCE INDEX(created_at_key) +WHERE created_at = "2012-10-25 16:18:29"; +created_at title +2012-10-25 16:18:29 Today is shiny day. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_time.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_time.result new file mode 100644 index 00000000000..a55a184d17a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_time.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS timer; +CREATE TABLE timer ( +id int PRIMARY KEY, +elapsed time, +KEY elapsed_key(elapsed) +); +INSERT INTO timer VALUES (1, "00:00:00"); +INSERT INTO timer VALUES (2, "15:11:12"); +INSERT INTO timer VALUES (3, "838:59:59"); +INSERT INTO timer VALUES (4, "-838:59:59"); +SELECT * +FROM timer FORCE INDEX(elapsed_key) +WHERE elapsed = "-838:59:59"; +id elapsed +4 -838:59:59 +DROP TABLE timer; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_timestamp.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_timestamp.result new file mode 100644 index 00000000000..57eb6ae2cee --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_timestamp.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +created_at timestamp, +title varchar(256), +KEY created_at_key(created_at) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES ("1970-01-01 12:00:00", "The start"); +INSERT INTO diaries VALUES ("2012-10-05 16:18:29", "Today is shiny day."); +INSERT INTO diaries VALUES ("2038-01-18 15:14:07", "The end"); +SELECT * +FROM diaries FORCE INDEX(created_at_key) +WHERE created_at = "2012-10-05 16:18:29"; +created_at title +2012-10-05 16:18:29 Today is shiny day. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_normal_column_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_normal_column_insert.result new file mode 100644 index 00000000000..043d1e3c1bc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_btree_normal_column_insert.result @@ -0,0 +1,25 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, index using btree (c2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `c2` (`c2`) USING BTREE +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +flush tables; +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_normal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_normal.result new file mode 100644 index 00000000000..5f92c086ea3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_normal.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, a int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id a +1 100 +2 100 +3 100 +4 100 +select * from t1 where _id = 2; +_id a +2 100 +select * from t1 where _id = 20; +_id a +drop table t1; 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 new file mode 100644 index 00000000000..508ee135ef2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result @@ -0,0 +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); +ERROR 23000: Column '_id' cannot be null +insert into t1 values(1,100); +Warnings: +Warning 1265 Data truncated for column '_id' at row 1 +insert into t1 values(1,100); +Warnings: +Warning 1265 Data truncated for column '_id' at row 1 +insert into t1 values(1,100); +Warnings: +Warning 1265 Data truncated for column '_id' at row 1 +insert into t1 values(1,100); +Warnings: +Warning 1265 Data truncated for column '_id' at row 1 +select * from t1; +_id a +1 100 +2 100 +3 100 +4 100 +select * from t1 where _id = 2; +_id a +2 100 +select * from t1 where _id = 20; +_id a +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_unique.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_unique.result new file mode 100644 index 00000000000..1a30a1ecbf4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_unique.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, a int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id a +1 100 +2 100 +3 100 +4 100 +select * from t1 where _id = 2; +_id a +2 100 +select * from t1 where _id = 20; +_id a +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_normal_column_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_normal_column_insert.result new file mode 100644 index 00000000000..6e642ce1272 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_normal_column_insert.result @@ -0,0 +1,25 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, index using hash (c2)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `c2` (`c2`) USING HASH +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +flush tables; +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result new file mode 100644 index 00000000000..c680a3733f3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result @@ -0,0 +1,32 @@ +drop table if exists listing; +set names utf8; +create table scores ( +id int primary key auto_increment not null, +name char(30) not null, +score int not null, +index property (name, score) +) default charset utf8; +show create table scores; +Table Create Table +scores CREATE TABLE `scores` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `property` (`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; +id name score +1 Taro Yamada 29 +2 Taro Yamada -12 +3 Jiro Yamada 27 +4 Taro Yamada 10 +delete from scores where name = "Taro Yamada" and score = 10; +select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29); +id name score +2 Taro Yamada -12 +drop table scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_smallint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_smallint.result new file mode 100644 index 00000000000..a627f432068 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_smallint.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY AUTO_INCREMENT, +c1 SMALLINT, +c2 SMALLINT, +KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `c1` smallint(6) DEFAULT NULL, + `c2` smallint(6) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx1` (`c1`,`c2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO t1 (c1, c2) VALUES +(1999, 12), +(2000, 11), +(2001, 10), +(2002, 9), +(2003, 8), +(2004, 7), +(2005, 6), +(2006, 5), +(2007, 4), +(2008, 3), +(2009, 2), +(2010, 1); +SELECT * FROM t1 WHERE c1 > 2005; +id c1 c2 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 >= 2005; +id c1 c2 +7 2005 6 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 = 2005; +id c1 c2 +7 2005 6 +SELECT * FROM t1 WHERE c1 <= 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +7 2005 6 +SELECT * FROM t1 WHERE c1 < 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_bigint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_bigint.result new file mode 100644 index 00000000000..368f88a64e1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_bigint.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY AUTO_INCREMENT, +c1 BIGINT UNSIGNED, +c2 BIGINT UNSIGNED, +KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `c1` bigint(20) unsigned DEFAULT NULL, + `c2` bigint(20) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx1` (`c1`,`c2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO t1 (c1, c2) VALUES +(1999, 12), +(2000, 11), +(2001, 10), +(2002, 9), +(2003, 8), +(2004, 7), +(2005, 6), +(2006, 5), +(2007, 4), +(2008, 3), +(2009, 2), +(2010, 1); +SELECT * FROM t1 WHERE c1 > 2005; +id c1 c2 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 >= 2005; +id c1 c2 +7 2005 6 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 = 2005; +id c1 c2 +7 2005 6 +SELECT * FROM t1 WHERE c1 <= 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +7 2005 6 +SELECT * FROM t1 WHERE c1 < 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_int.result new file mode 100644 index 00000000000..6d5516f7eea --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_int.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY AUTO_INCREMENT, +c1 INT UNSIGNED, +c2 INT UNSIGNED, +KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `c1` int(10) unsigned DEFAULT NULL, + `c2` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx1` (`c1`,`c2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO t1 (c1, c2) VALUES +(1999, 12), +(2000, 11), +(2001, 10), +(2002, 9), +(2003, 8), +(2004, 7), +(2005, 6), +(2006, 5), +(2007, 4), +(2008, 3), +(2009, 2), +(2010, 1); +SELECT * FROM t1 WHERE c1 > 2005; +id c1 c2 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 >= 2005; +id c1 c2 +7 2005 6 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 = 2005; +id c1 c2 +7 2005 6 +SELECT * FROM t1 WHERE c1 <= 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +7 2005 6 +SELECT * FROM t1 WHERE c1 < 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_smallint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_smallint.result new file mode 100644 index 00000000000..b0edfb9eea1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_smallint.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY AUTO_INCREMENT, +c1 SMALLINT UNSIGNED, +c2 SMALLINT UNSIGNED, +KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `c1` smallint(5) unsigned DEFAULT NULL, + `c2` smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx1` (`c1`,`c2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO t1 (c1, c2) VALUES +(1999, 12), +(2000, 11), +(2001, 10), +(2002, 9), +(2003, 8), +(2004, 7), +(2005, 6), +(2006, 5), +(2007, 4), +(2008, 3), +(2009, 2), +(2010, 1); +SELECT * FROM t1 WHERE c1 > 2005; +id c1 c2 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 >= 2005; +id c1 c2 +7 2005 6 +8 2006 5 +9 2007 4 +10 2008 3 +11 2009 2 +12 2010 1 +SELECT * FROM t1 WHERE c1 = 2005; +id c1 c2 +7 2005 6 +SELECT * FROM t1 WHERE c1 <= 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +7 2005 6 +SELECT * FROM t1 WHERE c1 < 2005; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 9 +5 2003 8 +6 2004 7 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_varchar.result new file mode 100644 index 00000000000..587e3c5fd4d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_varchar.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY AUTO_INCREMENT, +c1 VARCHAR(10), +c2 VARCHAR(10), +KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `c1` varchar(10) DEFAULT NULL, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx1` (`c1`,`c2`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO t1 (c1, c2) VALUES +('1999', '12'), +('2000', '11'), +('2001', '10'), +('2002', '09'), +('2003', '08'), +('2004', '07'), +('2005', '06'), +('2006', '05'), +('2007', '04'), +('2008', '03'), +('2009', '02'), +('2010', '01'); +SELECT * FROM t1 WHERE c1 > '2005'; +id c1 c2 +8 2006 05 +9 2007 04 +10 2008 03 +11 2009 02 +12 2010 01 +SELECT * FROM t1 WHERE c1 >= '2005'; +id c1 c2 +7 2005 06 +8 2006 05 +9 2007 04 +10 2008 03 +11 2009 02 +12 2010 01 +SELECT * FROM t1 WHERE c1 = '2005'; +id c1 c2 +7 2005 06 +SELECT * FROM t1 WHERE c1 <= '2005'; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 09 +5 2003 08 +6 2004 07 +7 2005 06 +SELECT * FROM t1 WHERE c1 < '2005'; +id c1 c2 +1 1999 12 +2 2000 11 +3 2001 10 +4 2002 09 +5 2003 08 +6 2004 07 +DROP TABLE t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result new file mode 100644 index 00000000000..ac673bac52c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result @@ -0,0 +1,29 @@ +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; +name score +Jiro Yamada 27 +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +delete from scores where name = "Taro Yamada" and score = 10; +select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29); +name score +Taro Yamada -12 +drop table scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_select_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_select_int.result new file mode 100644 index 00000000000..20b45861e4e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_select_int.result @@ -0,0 +1,37 @@ +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; +name score +Jiro Yamada 27 +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +select * from scores where name = "Taro Yamada"; +name score +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +select * from scores where name = "Taro Yamada" and score = 29; +name score +Taro Yamada 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; 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 new file mode 100644 index 00000000000..86b06bc94dd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result @@ -0,0 +1,32 @@ +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; +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; +Warnings: +Warning 1265 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_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result new file mode 100644 index 00000000000..02222965755 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result @@ -0,0 +1,39 @@ +drop table if exists listing; +set names utf8; +create table listing ( +id int primary key auto_increment not null, +last_name char(30) not null, +first_name char(30) not null, +index name (last_name, first_name) +) default charset utf8; +show create table listing; +Table Create Table +listing CREATE TABLE `listing` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `last_name` char(30) NOT NULL, + `first_name` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `name` (`last_name`,`first_name`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +insert into listing (last_name, first_name) values("Taro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Suzuki"); +insert into listing (last_name, first_name) values("Jiro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Tanaka"); +select * from listing +where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); +id last_name first_name +2 Taro Suzuki +4 Taro Tanaka +drop index name on listing; +select * from listing +where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); +id last_name first_name +2 Taro Suzuki +4 Taro Tanaka +create index new_name_index on listing (last_name, first_name); +select * from listing +where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); +id last_name first_name +2 Taro Suzuki +4 Taro Tanaka +drop table listing; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_replace.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_replace.result new file mode 100644 index 00000000000..df67c8a397e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_replace.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS listing; +CREATE TABLE scores ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +name CHAR(30) NOT NULL, +score INT NOT NULL, +INDEX property (NAME, SCORE) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE scores; +Table Create Table +scores CREATE TABLE `scores` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `property` (`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; +id name score +1 Taro Yamada 29 +2 Taro Yamada -12 +3 Jiro Yamada 27 +4 Taro Yamada 10 +REPLACE scores (id, name, score) VALUES (3, "Taro Yamada", 28); +SELECT * FROM scores; +id name score +1 Taro Yamada 29 +2 Taro Yamada -12 +3 Taro Yamada 28 +4 Taro Yamada 10 +SELECT * FROM scores WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +3 Taro Yamada 28 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_double.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_double.result new file mode 100644 index 00000000000..c75733f49fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_double.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS temperatures; +CREATE TABLE temperatures ( +id INT PRIMARY KEY AUTO_INCREMENT, +title VARCHAR(20), +temperature DOUBLE, +KEY temperature_index(temperature), +KEY multi_index(temperature, title) +); +INSERT INTO temperatures VALUES (NULL, "Hot!", 28.2); +INSERT INTO temperatures VALUES (NULL, "Snow!", -2.8); +INSERT INTO temperatures VALUES (NULL, "Rainy!", 12.7); +SELECT temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +temperature +12.7 +28.2 +SELECT temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; +temperature +-2.8 +12.7 +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +title temperature +Rainy! 12.7 +Hot! 28.2 +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; +title temperature +Snow! -2.8 +Rainy! 12.7 +DROP TABLE temperatures; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_float.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_float.result new file mode 100644 index 00000000000..452cae2d651 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_float.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS temperatures; +CREATE TABLE temperatures ( +id INT PRIMARY KEY AUTO_INCREMENT, +title VARCHAR(20), +temperature FLOAT, +KEY temperature_index(temperature), +KEY multi_index(temperature, title) +); +INSERT INTO temperatures VALUES (NULL, "Hot!", 28.2); +INSERT INTO temperatures VALUES (NULL, "Snow!", -2.8); +INSERT INTO temperatures VALUES (NULL, "Rainy!", 12.7); +SELECT temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +temperature +12.7 +28.2 +SELECT temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; +temperature +-2.8 +12.7 +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +title temperature +Rainy! 12.7 +Hot! 28.2 +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; +title temperature +Snow! -2.8 +Rainy! 12.7 +DROP TABLE temperatures; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_int.result new file mode 100644 index 00000000000..ecf7706bd8e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_int.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS listing; +CREATE TABLE scores ( +id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, +name CHAR(30) NOT NULL, +score INT NOT NULL, +INDEX property (score, name) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE scores; +Table Create Table +scores CREATE TABLE `scores` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `property` (`score`,`name`) +) 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; +id name score +1 Taro Yamada 29 +2 Taro Yamada -12 +3 Jiro Yamada 27 +4 Taro Yamada 10 +SELECT * FROM scores WHERE score = 29; +id name score +1 Taro Yamada 29 +SELECT * FROM scores WHERE score = 29 AND name = "Taro Yamada"; +id name score +1 Taro Yamada 29 +SELECT * FROM scores WHERE (score >= -12 AND score < 29) AND name = "Taro Yamada"; +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result new file mode 100644 index 00000000000..ad73669e40b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result @@ -0,0 +1,40 @@ +drop table if exists listing; +set names utf8; +create table listing ( +id int primary key auto_increment not null, +last_name char(30) not null, +first_name char(30) not null, +index name (last_name, first_name) +) default charset utf8; +show create table listing; +Table Create Table +listing CREATE TABLE `listing` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `last_name` char(30) NOT NULL, + `first_name` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `name` (`last_name`,`first_name`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +insert into listing (last_name, first_name) values("Taro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Suzuki"); +insert into listing (last_name, first_name) values("Jiro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Tanaka"); +select * from listing; +id last_name first_name +1 Taro Yamada +2 Taro Suzuki +3 Jiro Yamada +4 Taro Tanaka +select * from listing where last_name = "Taro"; +id last_name first_name +2 Taro Suzuki +4 Taro Tanaka +1 Taro Yamada +select * from listing where last_name = "Taro" and first_name = "Suzuki"; +id last_name first_name +2 Taro Suzuki +select * from listing where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); +id last_name first_name +2 Taro Suzuki +4 Taro Tanaka +drop table listing; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result new file mode 100644 index 00000000000..53fbccda2b4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result @@ -0,0 +1,39 @@ +drop table if exists scores; +set names utf8; +create table scores ( +given_name varchar(30) not null, +family_name varchar(30) not null, +score int not null, +primary key property (given_name, family_name, score) +) default charset utf8; +show create table scores; +Table Create Table +scores CREATE TABLE `scores` ( + `given_name` varchar(30) NOT NULL, + `family_name` varchar(30) NOT NULL, + `score` int(11) NOT NULL, + PRIMARY KEY (`given_name`,`family_name`,`score`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +insert into scores values("Taro", "Yamada", 29); +insert into scores values("Taro", "Yamada", -12); +insert into scores values("Jiro", "Yamada", 27); +insert into scores values("Taro", "Yamada", 10); +select * from scores; +given_name family_name score +Jiro Yamada 27 +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +select * from scores where given_name = "Taro" and family_name = "Yamada"; +given_name family_name score +Taro Yamada -12 +Taro Yamada 10 +Taro Yamada 29 +select * from scores where given_name = "Taro" and family_name = "Yamada" and score = 29; +given_name family_name score +Taro Yamada 29 +select * from scores where given_name = "Taro" and family_name = "Yamada" and (score >= -12 and score < 29); +given_name family_name score +Taro Yamada -12 +Taro Yamada 10 +drop table scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_32bit_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_32bit_equal.result new file mode 100644 index 00000000000..2174efc1b4f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_32bit_equal.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +end DATE, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "1000-01-01", "2012-10-05"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +INSERT INTO ranges VALUES (2, "1000-01-01", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +SELECT * FROM ranges FORCE INDEX(range_key) +WHERE start = "1000-01-01" AND end = "9999-12-31"; +id start end +DROP TABLE ranges; 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 new file mode 100644 index 00000000000..869ced05d25 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +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 (3, "2012-10-25", "9999-12-31"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +SELECT * FROM ranges FORCE INDEX(range_key) +WHERE start = "1000-01-01" AND end = "9999-12-31"; +id start end +2 1000-01-01 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 new file mode 100644 index 00000000000..8e480d4844a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +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 (3, "2012-10-25", "9999-12-31"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); +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 +2012-10-25 9999-12-31 +9999-12-31 1000-01-01 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_asc.result new file mode 100644 index 00000000000..0a64a822fb5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_asc.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +end DATE, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start, end; +id start end +2 1970-01-01 2012-10-05 +4 1970-01-01 1970-01-01 +1 2012-10-25 1970-01-01 +3 1970-01-01 1970-01-01 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_desc.result new file mode 100644 index 00000000000..24439fdf5fa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_desc.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +end DATE, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2012-10-25", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (2, "1000-01-01", "2012-10-05"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-01"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +INSERT INTO ranges VALUES (4, "1000-01-01", "9999-12-31"); +Warnings: +Warning 1265 Data truncated for column 'start' at row 1 +Warning 1265 Data truncated for column 'end' at row 1 +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start DESC, end DESC; +id start end +3 1970-01-01 1970-01-01 +1 2012-10-25 1970-01-01 +4 1970-01-01 1970-01-01 +2 1970-01-01 2012-10-05 +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 new file mode 100644 index 00000000000..92e7f51ff6e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +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"); +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 +1 2012-10-25 9999-12-31 +3 9999-12-31 1000-01-01 +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 new file mode 100644 index 00000000000..ddd694c3863 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +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"); +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start DESC, end DESC; +id start end +3 9999-12-31 1000-01-01 +1 2012-10-25 9999-12-31 +4 1000-01-01 9999-12-31 +2 1000-01-01 2012-10-05 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result new file mode 100644 index 00000000000..bd1bdc33325 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id INT PRIMARY KEY, +start DATE, +end DATE, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2010-01-01", "2012-10-05"); +SELECT * FROM ranges; +id start end +1 2010-01-01 2012-10-05 +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01", "2012-10-05"); +SELECT * FROM ranges; +id start end +1 2010-01-01 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 new file mode 100644 index 00000000000..1aa710882cb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +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 (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"); +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 +2012-10-25 16:18:29 9999-12-31 23:59:59 +9999-12-31 23:59:59 1000-01-01 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 new file mode 100644 index 00000000000..d18f1858932 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start datetime, +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"); +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 +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 +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 new file mode 100644 index 00000000000..c159aeab4ce --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start datetime, +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"); +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 +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 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result new file mode 100644 index 00000000000..50d5da49955 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start datetime, +end datetime, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; +id start end +1 2010-01-01 00:00:00 2012-10-05 23:59:59 +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; +id start end +1 2010-01-01 00:00:00 2012-10-05 23:59:59 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_decimal.result new file mode 100644 index 00000000000..015afdb5cf6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_decimal.result @@ -0,0 +1,36 @@ +drop table if exists t1; +create table t1 (c1 int primary key, c2 decimal(65,30), c3 decimal(65,30), unique key uk1(c2,c3)); +insert into t1 values(1,123.456,0.000000000000000000000000000001); +insert into t1 values(2,-123.456,123.456); +insert into t1 values(3,98765432109876543210987654321098765.432109876543210987654321098765,-123.456); +insert into t1 values(4,-98765432109876543210987654321098765.432109876543210987654321098765,98765432109876543210987654321098765.432109876543210987654321098765); +insert into t1 values(5,0.000000000000000000000000000001,-98765432109876543210987654321098765.432109876543210987654321098765); +select c1, c2, c3 from t1 force index(uk1) where c2 = -98765432109876543210987654321098765.432109876543210987654321098765 and c3 = 98765432109876543210987654321098765.432109876543210987654321098765; +c1 c2 c3 +4 -98765432109876543210987654321098765.432109876543210987654321098765 98765432109876543210987654321098765.432109876543210987654321098765 +select c1, c2, c3 from t1 force index(uk1) order by c2, c3; +c1 c2 c3 +4 -98765432109876543210987654321098765.432109876543210987654321098765 98765432109876543210987654321098765.432109876543210987654321098765 +2 -123.456000000000000000000000000000 123.456000000000000000000000000000 +5 0.000000000000000000000000000001 -98765432109876543210987654321098765.432109876543210987654321098765 +1 123.456000000000000000000000000000 0.000000000000000000000000000001 +3 98765432109876543210987654321098765.432109876543210987654321098765 -123.456000000000000000000000000000 +select c1, c2, c3 from t1 force index(uk1) order by c2 desc, c3 desc; +c1 c2 c3 +3 98765432109876543210987654321098765.432109876543210987654321098765 -123.456000000000000000000000000000 +1 123.456000000000000000000000000000 0.000000000000000000000000000001 +5 0.000000000000000000000000000001 -98765432109876543210987654321098765.432109876543210987654321098765 +2 -123.456000000000000000000000000000 123.456000000000000000000000000000 +4 -98765432109876543210987654321098765.432109876543210987654321098765 98765432109876543210987654321098765.432109876543210987654321098765 +select c2, c3 from t1 force index(uk1) order by c2, c3; +c2 c3 +-98765432109876543210987654321098765.432109876543210987654321098765 98765432109876543210987654321098765.432109876543210987654321098765 +-123.456000000000000000000000000000 123.456000000000000000000000000000 +0.000000000000000000000000000001 -98765432109876543210987654321098765.432109876543210987654321098765 +123.456000000000000000000000000000 0.000000000000000000000000000001 +98765432109876543210987654321098765.432109876543210987654321098765 -123.456000000000000000000000000000 +insert into t1 values(6,123.456,0.000000000000000000000000000001); +ERROR 23000: Duplicate entry '123.456000000000000000000000000000-0.000000000000000000000000000' for key 'uk1' +delete from t1 where c1 = 1; +insert into t1 values(1,123.456,0.000000000000000000000000000001); +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_index_read.result new file mode 100644 index 00000000000..4e0dec32a28 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_index_read.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start time, +end time, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (2, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (3, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (4, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); +SELECT start, end +FROM ranges FORCE INDEX(range_key) +ORDER BY start, end; +start end +-838:59:59 838:59:59 +00:00:00 15:11:11 +00:00:00 838:59:59 +15:11:12 838:59:59 +838:59:59 00:00:00 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_asc.result new file mode 100644 index 00000000000..3c6520a69c9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_asc.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start time, +end time, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (2, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (3, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (4, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start, end; +id start end +5 -838:59:59 838:59:59 +2 00:00:00 15:11:11 +4 00:00:00 838:59:59 +1 15:11:12 838:59:59 +3 838:59:59 00:00:00 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_desc.result new file mode 100644 index 00000000000..c1be80309b8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_desc.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start time, +end time, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (2, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (3, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (4, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start DESC, end DESC; +id start end +3 838:59:59 00:00:00 +1 15:11:12 838:59:59 +4 00:00:00 838:59:59 +2 00:00:00 15:11:11 +5 -838:59:59 838:59:59 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_reinsert.result new file mode 100644 index 00000000000..0613de3e2f3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_reinsert.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start time, +end time, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "13:21:48", "15:11:12"); +SELECT * FROM ranges; +id start end +1 13:21:48 15:11:12 +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "13:21:48", "15:11:12"); +SELECT * FROM ranges; +id start end +1 13:21:48 15:11:12 +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 new file mode 100644 index 00000000000..d833fb44024 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start timestamp, +end timestamp, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (4, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); +SELECT start, end +FROM ranges FORCE INDEX(range_key) +ORDER BY start, end; +start end +1970-01-01 12:00:00 2012-10-05 16:18:29 +1970-01-01 12:00:00 2038-01-18 15:14:07 +2012-10-25 16:18:29 2038-01-18 15:14:07 +2038-01-18 15:14:07 1970-01-01 12:00:00 +DROP TABLE ranges; 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 new file mode 100644 index 00000000000..1e4ee102c9e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start timestamp, +end timestamp, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); +INSERT INTO ranges VALUES (4, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start, end; +id start end +2 1970-01-01 12:00:00 2012-10-05 16:18:29 +4 1970-01-01 12:00:00 2038-01-18 15:14:07 +1 2012-10-25 16:18:29 2038-01-18 15:14:07 +3 2038-01-18 15:14:07 1970-01-01 12:00:00 +DROP TABLE ranges; 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 new file mode 100644 index 00000000000..23a5522320a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start timestamp, +end timestamp, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); +INSERT INTO ranges VALUES (4, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); +SELECT * FROM ranges FORCE INDEX(range_key) +ORDER BY start DESC, end DESC; +id start end +3 2038-01-18 15:14:07 1970-01-01 12:00:00 +1 2012-10-25 16:18:29 2038-01-18 15:14:07 +4 1970-01-01 12:00:00 2038-01-18 15:14:07 +2 1970-01-01 12: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_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result new file mode 100644 index 00000000000..3f3277f5e64 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ranges; +CREATE TABLE ranges ( +id int PRIMARY KEY, +start timestamp, +end timestamp, +UNIQUE KEY range_key(start, end) +); +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; +id start end +1 2010-01-01 00:00:00 2012-10-05 23:59:59 +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; +id start end +1 2010-01-01 00:00:00 2012-10-05 23:59:59 +DROP TABLE ranges; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_varchar.result new file mode 100644 index 0000000000000000000000000000000000000000..5c9cd95947246a6505ec5fd5c4812de7ce7b78d5 GIT binary patch literal 1027 zcmbVLO;5ux4CT813g6mFLu%R$A*S8njI=WnN)uO$*0m!|Vf**kNe8Xigy7J8zSz&N z&)T*JaI&lsOa*u}o$J7fRirFRhr^WhBV(c8iA3ddRir6stYlw1;D;T$b?>TsP;FgvM&7)ZrddU%>CigP+7cy-T=&=| zVjjyo;Q#eS(ZJ(V}GcPV(Vk$sI!8-Z#hHE j?(ppslQrT= -12 and score < 29); +id name score +2 Taro Yamada -12 +4 Taro Yamada 10 +3 Taro Yamada 27 +drop table scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_exact_length.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_exact_length.result new file mode 100644 index 00000000000..95d7c78bbb6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_exact_length.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id char(10) CHARACTER SET latin1 PRIMARY KEY +); +INSERT INTO ids VALUES('abcdefghij'); +INSERT INTO ids VALUES('klmnopqrst'); +INSERT INTO ids VALUES('uvwxyz0123'); +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; +id +abcdefghij +klmnopqrst +uvwxyz0123 +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = 'abcdefghij'; +id +abcdefghij +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_null_character.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_null_character.result new file mode 100644 index 0000000000000000000000000000000000000000..f7a802060d53cebf566894561d3502c0cbcae2c3 GIT binary patch literal 387 zcma)&F;BxV6ofPTSDZ2>OkrY(7+mK?wQ%F=+0aIcgq)-mkx&QV{|hH6umRJP?elkc zuVTB0mm5RSHR!0FcbLZaQYa?r>G~FLkcnx;@Dkp#yBumOSt?HqM;@=?W4hczS!3ou z>+!jtF4(i)NpA5#t;kEE8%OM+8*gV9JW2CNE=#*2^uu^Mr@v@I-xYsrhOsMFjw3_L z;|4X`-QreTR38A< M`~|FjR=zCy6GS|01poj5 literal 0 HcmV?d00001 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_short.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_short.result new file mode 100644 index 00000000000..fb08c6601bb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_short.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id char(6) CHARACTER SET latin1 PRIMARY KEY +); +INSERT INTO ids VALUES("abcdef"); +INSERT INTO ids VALUES( "cdef"); +INSERT INTO ids VALUES( "ef"); +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; +id +abcdef +cdef +ef +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = "cdef"; +id +cdef +DROP TABLE ids; 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 new file mode 100644 index 00000000000..a460c7d99d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +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"); +INSERT INTO diaries (day, title) VALUES ("2012-01-31", "duplicated day"); +ERROR 23000: Duplicate entry '2012-01-31' for key 'PRIMARY' +SELECT * FROM diaries; +day title +2012-01-29 clear day +2012-01-30 rainy day +2012-01-31 cloudy day +SELECT * FROM diaries +WHERE day BETWEEN "2012-01-29" AND "2012-01-30"; +day title +2012-01-29 clear day +2012-01-30 rainy day +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..ffbbfe3f460 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS diaries; +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) +VALUES ("2012-01-30 01:23:45.333", "rainy day"); +INSERT INTO diaries (day, title) +VALUES ("2012-01-31 08:32:10.5555", "cloudy day"); +SELECT * FROM diaries; +day title +2012-01-29 21:51:01.111111 clear day +2012-01-30 01:23:45.333000 rainy day +2012-01-31 08:32:10.555500 cloudy day +SELECT * FROM diaries +WHERE day BETWEEN "2012-01-29 00:00:00.123456" AND +"2012-01-31 00:00:00.999999"; +day title +2012-01-29 21:51:01.111111 clear day +2012-01-30 01:23:45.333000 rainy day +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..76c529f7fbb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS diaries; +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) +VALUES ("2012-01-30 01:23:45", "rainy day"); +INSERT INTO diaries (day, title) +VALUES ("2012-01-31 08:32:10", "cloudy day"); +SELECT * FROM diaries; +day title +2012-01-29 21:51:01 clear day +2012-01-30 01:23:45 rainy day +2012-01-31 08:32:10 cloudy day +SELECT * FROM diaries +WHERE day BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; +day title +2012-01-29 21:51:01 clear day +2012-01-30 01:23:45 rainy day +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..9b1e8e7d7e8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS releases; +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!"); +SELECT * FROM releases; +version message +10.000 10th release! +10.001 minor fix. +999.999 the last release! +SELECT * FROM releases WHERE version BETWEEN "9.000" AND "10.001"; +version message +10.000 10th release! +10.001 minor fix. +DROP TABLE releases; 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 new file mode 100644 index 00000000000..0624ab2f2b2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS releases; +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!"); +SELECT * FROM releases; +version message +1 the first release!!! +10 10th release! +999 the last release! +SELECT * FROM releases WHERE version BETWEEN "1" AND "10"; +version message +1 the first release!!! +10 10th release! +DROP TABLE releases; 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 new file mode 100644 index 00000000000..639114875e9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS running_records; +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) +VALUES ("12:23:34.123456", "bad condition"); +INSERT INTO running_records (time, title) +VALUES ("-838:59:59.000000", "record failure"); +SELECT * FROM running_records; +time title +-838:59:59.000000 record failure +01:00:00.000001 normal condition +12:23:34.123456 bad condition +SELECT * FROM running_records +WHERE time BETWEEN "00:59:59.999999" AND "12:23:34.123456"; +time title +01:00:00.000001 normal condition +12:23:34.123456 bad condition +DROP TABLE running_records; 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 new file mode 100644 index 00000000000..6a89cdc33dd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS running_records; +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) +VALUES ("12:23:34", "bad condition"); +INSERT INTO running_records (time, title) +VALUES ("-838:59:59", "record failure"); +SELECT * FROM running_records; +time title +-838:59:59 record failure +01:00:00 normal condition +12:23:34 bad condition +SELECT * FROM running_records +WHERE time BETWEEN "00:59:59" AND "12:23:34"; +time title +01:00:00 normal condition +12:23:34 bad condition +DROP TABLE running_records; 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 new file mode 100644 index 00000000000..7040cc22b2e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS diaries; +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) +VALUES ("2012-01-30 01:23:45.333", "rainy day"); +INSERT INTO diaries (time, title) +VALUES ("2012-01-31 08:32:10.5555", "cloudy day"); +SELECT * FROM diaries; +time title +2012-01-29 21:51:01.111111 clear day +2012-01-30 01:23:45.333000 rainy day +2012-01-31 08:32:10.555500 cloudy day +SELECT * FROM diaries +WHERE time BETWEEN "2012-01-29 00:00:00.123456" AND +"2012-01-31 00:00:00.999999"; +time title +2012-01-29 21:51:01.111111 clear day +2012-01-30 01:23:45.333000 rainy day +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..38017f6f8cc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +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"); +SELECT * FROM diaries; +time title +2012-01-29 21:51:01 clear day +2012-01-30 01:23:45 rainy day +2012-01-31 08:32:10 cloudy day +SELECT * FROM diaries +WHERE time BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; +time title +2012-01-29 21:51:01 clear day +2012-01-30 01:23:45 rainy day +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_varchar_null_character.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_varchar_null_character.result new file mode 100644 index 0000000000000000000000000000000000000000..9079d9c406466482505ecc183ddce6059408bc37 GIT binary patch literal 390 zcma)&F;BxV6ofPTSDZ2>OkrY(7+mK?wMgUY+0aIcgq#>eB-EiGem_o9U<0Nn+vo4@ zUd3h)CpQg2*Px@e&SDC0rBF=L(d8}PAQMx-hd+-m{+!+9P+Q4TIbv9Hc=hko=^Dy3 z&HQaWJ`U3fd)7P29qy 1 ORDER BY ids.id ASC LIMIT 3; +id +2 +3 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_desc.result new file mode 100644 index 00000000000..80dcb25ffe6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_desc.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id > 3 ORDER BY ids.id DESC LIMIT 3; +id +5 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_asc.result new file mode 100644 index 00000000000..4c1ff997d79 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id >= 2 ORDER BY ids.id ASC LIMIT 3; +id +2 +3 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_desc.result new file mode 100644 index 00000000000..4998725aef5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_greater_than_or_equal_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id >= 3 ORDER BY ids.id DESC LIMIT 3; +id +5 +4 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_asc.result new file mode 100644 index 00000000000..8b142f30610 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id ASC LIMIT 3; +id +1 +2 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_desc.result new file mode 100644 index 00000000000..eaf5b87e62c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id DESC LIMIT 3; +id +3 +2 +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_asc.result new file mode 100644 index 00000000000..e1e96c9ca8b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id ASC LIMIT 3; +id +1 +2 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_desc.result new file mode 100644 index 00000000000..e8124ca14c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_less_than_or_equal_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id DESC LIMIT 3; +id +4 +3 +2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint.result new file mode 100644 index 00000000000..77b321015c9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id BIGINT, +value BIGINT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); +SELECT * FROM ids; +id value +-16 1 +-8 2 +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +16 -1 +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; +id value +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint_unsigned.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint_unsigned.result new file mode 100644 index 00000000000..b0004a3c87a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint_unsigned.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id BIGINT UNSIGNED, +value BIGINT UNSIGNED, +KEY (id, value) +); +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); +SELECT * FROM ids; +id value +1 1 +2 2 +4 3 +8 4 +16 5 +32 6 +64 7 +128 8 +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; +id value +4 3 +8 4 +16 5 +32 6 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_double.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_double.result new file mode 100644 index 00000000000..862a314c9c2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_double.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id DOUBLE, +value DOUBLE, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1.1, 16.16); +INSERT INTO ids VALUES ( -2.2, 8.8); +INSERT INTO ids VALUES ( -4.4, 4.4); +INSERT INTO ids VALUES ( -8.8, 2.2); +INSERT INTO ids VALUES (-16.6, 1.1); +INSERT INTO ids VALUES ( 16.6, -1.1); +INSERT INTO ids VALUES ( 8.8, -2.2); +INSERT INTO ids VALUES ( 4.4, -4.4); +INSERT INTO ids VALUES ( 2.2, -8.8); +INSERT INTO ids VALUES ( 1.1, -16.16); +SELECT * FROM ids; +id value +-16.6 1.1 +-8.8 2.2 +-4.4 4.4 +-2.2 8.8 +-1.1 16.16 +1.1 -16.16 +2.2 -8.8 +4.4 -4.4 +8.8 -2.2 +16.6 -1.1 +SELECT * FROM ids WHERE id BETWEEN -4.5 AND 8.9; +id value +-4.4 4.4 +-2.2 8.8 +-1.1 16.16 +1.1 -16.16 +2.2 -8.8 +4.4 -4.4 +8.8 -2.2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_float.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_float.result new file mode 100644 index 00000000000..04d44130ed4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_float.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id FLOAT, +value FLOAT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1.1, 16.16); +INSERT INTO ids VALUES ( -2.2, 8.8); +INSERT INTO ids VALUES ( -4.4, 4.4); +INSERT INTO ids VALUES ( -8.8, 2.2); +INSERT INTO ids VALUES (-16.6, 1.1); +INSERT INTO ids VALUES ( 16.6, -1.1); +INSERT INTO ids VALUES ( 8.8, -2.2); +INSERT INTO ids VALUES ( 4.4, -4.4); +INSERT INTO ids VALUES ( 2.2, -8.8); +INSERT INTO ids VALUES ( 1.1, -16.16); +SELECT * FROM ids; +id value +-16.6 1.1 +-8.8 2.2 +-4.4 4.4 +-2.2 8.8 +-1.1 16.16 +1.1 -16.16 +2.2 -8.8 +4.4 -4.4 +8.8 -2.2 +16.6 -1.1 +SELECT * FROM ids WHERE id BETWEEN -4.5 AND 8.9; +id value +-4.4 4.4 +-2.2 8.8 +-1.1 16.16 +1.1 -16.16 +2.2 -8.8 +4.4 -4.4 +8.8 -2.2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int.result new file mode 100644 index 00000000000..8d3f6f7ff9e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT, +value INT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); +SELECT * FROM ids; +id value +-16 1 +-8 2 +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +16 -1 +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; +id value +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int_unsigned.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int_unsigned.result new file mode 100644 index 00000000000..d09f97e0d06 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int_unsigned.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT UNSIGNED, +value INT UNSIGNED, +KEY (id, value) +); +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); +SELECT * FROM ids; +id value +1 1 +2 2 +4 3 +8 4 +16 5 +32 6 +64 7 +128 8 +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; +id value +4 3 +8 4 +16 5 +32 6 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint.result new file mode 100644 index 00000000000..5242f10ff02 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id MEDIUMINT, +value MEDIUMINT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); +SELECT * FROM ids; +id value +-16 1 +-8 2 +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +16 -1 +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; +id value +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint_unsigned.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint_unsigned.result new file mode 100644 index 00000000000..41d9c0ebeeb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint_unsigned.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id MEDIUMINT UNSIGNED, +value MEDIUMINT UNSIGNED, +KEY (id, value) +); +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); +SELECT * FROM ids; +id value +1 1 +2 2 +4 3 +8 4 +16 5 +32 6 +64 7 +128 8 +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; +id value +4 3 +8 4 +16 5 +32 6 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint.result new file mode 100644 index 00000000000..e34b7b7ddab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id SMALLINT, +value SMALLINT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); +SELECT * FROM ids; +id value +-16 1 +-8 2 +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +16 -1 +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; +id value +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint_unsigned.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint_unsigned.result new file mode 100644 index 00000000000..9014f9afaec --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint_unsigned.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id SMALLINT UNSIGNED, +value SMALLINT UNSIGNED, +KEY (id, value) +); +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); +SELECT * FROM ids; +id value +1 1 +2 2 +4 3 +8 4 +16 5 +32 6 +64 7 +128 8 +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; +id value +4 3 +8 4 +16 5 +32 6 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint.result new file mode 100644 index 00000000000..63b27fdd4ff --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id TINYINT, +value TINYINT, +KEY (id, value) +); +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); +SELECT * FROM ids; +id value +-16 1 +-8 2 +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +16 -1 +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; +id value +-4 4 +-2 8 +-1 16 +1 -16 +2 -8 +4 -4 +8 -2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint_unsigned.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint_unsigned.result new file mode 100644 index 00000000000..412b9b7c0c8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint_unsigned.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id TINYINT UNSIGNED, +value TINYINT UNSIGNED, +KEY (id, value) +); +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); +SELECT * FROM ids; +id value +1 1 +2 2 +4 3 +8 4 +16 5 +32 6 +64 7 +128 8 +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; +id value +4 3 +8 4 +16 5 +32 6 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar.result new file mode 100644 index 00000000000..c08522d0dab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id VARCHAR(5), +value VARCHAR(10), +KEY (id, value) +) DEFAULT CHARSET=utf8 COLLATE utf8_bin; +INSERT INTO ids VALUES ("abc", "Abc"); +INSERT INTO ids VALUES ("acd", "aBc"); +INSERT INTO ids VALUES ("ade", "abC"); +INSERT INTO ids VALUES ("aef", "abc"); +INSERT INTO ids VALUES ("ABC", "aBC"); +INSERT INTO ids VALUES ("ACD", "AbC"); +INSERT INTO ids VALUES ("ADE", "ABc"); +INSERT INTO ids VALUES ("AEF", "ABC"); +SELECT * FROM ids; +id value +ABC aBC +ACD AbC +ADE ABc +AEF ABC +abc Abc +acd aBc +ade abC +aef abc +SELECT * FROM ids WHERE id BETWEEN "ab" AND "ad"; +id value +abc Abc +acd aBc +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar_collation.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar_collation.result new file mode 100644 index 00000000000..9882f2b1598 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar_collation.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id VARCHAR(5), +value VARCHAR(10), +KEY (id, value) +) DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci; +INSERT INTO ids VALUES ("abc", "Abc"); +INSERT INTO ids VALUES ("acd", "aBc"); +INSERT INTO ids VALUES ("ade", "abC"); +INSERT INTO ids VALUES ("aef", "abc"); +INSERT INTO ids VALUES ("ABC", "aBC"); +INSERT INTO ids VALUES ("ACD", "AbC"); +INSERT INTO ids VALUES ("ADE", "ABc"); +INSERT INTO ids VALUES ("AEF", "ABC"); +SELECT * FROM ids; +id value +abc Abc +acd aBc +ade abC +aef abc +ABC aBC +ACD AbC +ADE ABc +AEF ABC +SELECT * FROM ids WHERE id BETWEEN "ab" AND "ad"; +id value +abc Abc +ABC aBC +acd aBc +ACD AbC +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_int.result new file mode 100644 index 00000000000..67f1f4f8268 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_int.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT, +KEY (id) +); +INSERT INTO ids VALUES (1); +INSERT INTO ids SELECT id + 1 FROM ids; +INSERT INTO ids SELECT id + 2 FROM ids; +INSERT INTO ids SELECT id + 4 FROM ids; +INSERT INTO ids SELECT id + 8 FROM ids; +INSERT INTO ids SELECT id + 16 FROM ids; +SELECT * FROM ids; +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +SELECT * FROM ids WHERE id BETWEEN 10 AND 16; +id +10 +11 +12 +13 +14 +15 +16 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_varchar.result new file mode 100644 index 00000000000..2cdde6c4086 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_varchar.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id VARCHAR(10), +KEY (id) +); +INSERT INTO ids VALUES ("1"); +INSERT INTO ids SELECT id + "1" FROM ids; +INSERT INTO ids SELECT id + "2" FROM ids; +INSERT INTO ids SELECT id + "4" FROM ids; +INSERT INTO ids SELECT id + "8" FROM ids; +INSERT INTO ids SELECT id + "16" FROM ids; +SELECT * FROM ids; +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +SELECT * FROM ids WHERE id BETWEEN "10" AND "16"; +id +10 +11 +12 +13 +14 +15 +16 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_int.result new file mode 100644 index 00000000000..23f63d2ffca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_int.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT, +PRIMARY KEY (id) +); +INSERT INTO ids VALUES (1); +INSERT INTO ids SELECT id + 1 FROM ids; +INSERT INTO ids SELECT id + 2 FROM ids; +INSERT INTO ids SELECT id + 4 FROM ids; +INSERT INTO ids SELECT id + 8 FROM ids; +INSERT INTO ids SELECT id + 16 FROM ids; +SELECT * FROM ids; +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +SELECT * FROM ids WHERE id BETWEEN 10 AND 16; +id +10 +11 +12 +13 +14 +15 +16 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_varchar.result new file mode 100644 index 00000000000..7fa17bd79d9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_varchar.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id VARCHAR(10), +PRIMARY KEY (id) +); +INSERT INTO ids VALUES ("1"); +INSERT INTO ids SELECT id + "1" FROM ids; +INSERT INTO ids SELECT id + "2" FROM ids; +INSERT INTO ids SELECT id + "4" FROM ids; +INSERT INTO ids SELECT id + "8" FROM ids; +INSERT INTO ids SELECT id + "16" FROM ids; +SELECT * FROM ids; +id +1 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +2 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +3 +30 +31 +32 +4 +5 +6 +7 +8 +9 +SELECT * FROM ids WHERE id BETWEEN "10" AND "16"; +id +10 +11 +12 +13 +14 +15 +16 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_by_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_by_primary_key.result new file mode 100644 index 00000000000..4e10cf72415 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_by_primary_key.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS users; +CREATE TABLE users ( +id int PRIMARY KEY, +name varchar(100) NOT NULL, +UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; +INSERT INTO users VALUES (1, "Alice"); +DELETE FROM users WHERE id = 1; +INSERT INTO users VALUES (1, "Alice"); +SELECT * FROM users; +id name +1 Alice +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_insert_after_error.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_insert_after_error.result new file mode 100644 index 00000000000..7b2c0b86214 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_insert_after_error.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS users; +CREATE TABLE users ( +id int PRIMARY KEY, +name varchar(100) NOT NULL, +UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; +INSERT INTO users VALUES (1, "Alice"); +INSERT INTO users VALUES (1, "Bob"); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +INSERT INTO users VALUES (2, "Bob"); +SELECT * FROM users; +id name +1 Alice +2 Bob +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_varchar.result new file mode 100644 index 00000000000..155cdf15959 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_varchar.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS users; +CREATE TABLE users ( +name varchar(100) NOT NULL, +UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; +INSERT INTO users VALUES ("Alice"); +INSERT INTO users VALUES ("Bob"); +SELECT * FROM users; +name +Alice +Bob +SELECT * FROM users WHERE name = "aLiCe"; +name +Alice +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_update_multiple_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_update_multiple_column.result new file mode 100644 index 00000000000..9165ca26fea --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_update_multiple_column.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS scores; +SET NAMES utf8; +CREATE TABLE scores ( +deleted BOOLEAN, +value INT, +INDEX (deleted, value) +); +INSERT INTO scores VALUES (FALSE, 1); +INSERT INTO scores VALUES (FALSE, 1); +INSERT INTO scores VALUES (FALSE, 2); +SELECT count(*) FROM scores WHERE deleted = FALSE; +count(*) +3 +UPDATE scores SET deleted = TRUE WHERE value = 1; +SELECT count(*) FROM scores WHERE deleted = FALSE; +count(*) +1 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_update_single_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_update_single_column.result new file mode 100644 index 00000000000..b283af17f94 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_update_single_column.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS scores; +SET NAMES utf8; +CREATE TABLE scores ( +value INT, +INDEX (value) +); +INSERT INTO scores VALUES (21); +INSERT INTO scores VALUES (21); +INSERT INTO scores VALUES (22); +SELECT count(*) FROM scores WHERE value >= 20; +count(*) +3 +UPDATE scores SET value = 11 WHERE value = 21; +SELECT count(*) FROM scores WHERE value >= 20; +count(*) +1 +DROP TABLE scores; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result new file mode 100644 index 00000000000..46c6f6ab258 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result @@ -0,0 +1,4 @@ +select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE +from information_schema.plugins where plugin_name = "Mroonga"; +PLUGIN_NAME PLUGIN_VERSION PLUGIN_TYPE +Mroonga 4.5 STORAGE ENGINE diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in new file mode 100644 index 00000000000..f1020453183 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in @@ -0,0 +1,4 @@ +select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE +from information_schema.plugins where plugin_name = "Mroonga"; +PLUGIN_NAME PLUGIN_VERSION PLUGIN_TYPE +Mroonga @MRN_PLUGIN_VERSION@ STORAGE ENGINE diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_none.result new file mode 100644 index 00000000000..c23dab5e4a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_none.result @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY +); +SELECT AUTO_INCREMENT +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME = "ids"; +AUTO_INCREMENT +NULL +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_use.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_use.result new file mode 100644 index 00000000000..96d1b0ad32e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_use.result @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT AUTO_INCREMENT PRIMARY KEY +); +SELECT AUTO_INCREMENT +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME = "ids"; +AUTO_INCREMENT +1 +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 new file mode 100644 index 00000000000..d58afb1f6d4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +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, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT COUNT(*) +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME = "diaries" AND DATA_LENGTH > 0; +COUNT(*) +1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..00466f19bb5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result @@ -0,0 +1,90 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 tinyint); +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 smallint); +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 mediumint); +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 int); +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 bigint); +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 float); +insert into t1 values(0.5); +select * from t1; +c1 +0.5 +drop table t1; +create table t1 (c1 double); +insert into t1 values(0.5); +select * from t1; +c1 +0.5 +drop table t1; +create table t1 (c1 date); +insert into t1 values("2010/03/26"); +select * from t1; +c1 +2010-03-26 +drop table t1; +create table t1 (c1 time); +insert into t1 values("11:22:33"); +select * from t1; +c1 +11:22:33 +drop table t1; +create table t1 (c1 year); +insert into t1 values("2010"); +select * from t1; +c1 +2010 +drop table t1; +create table t1 (c1 datetime); +insert into t1 values("2010/03/26 11:22:33"); +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; +c1 c2 +1 100 +insert into t1 values(1,200); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select * from t1; +c1 c2 +1 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.result new file mode 100644 index 00000000000..0d2c9dd7987 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS numbers; +CREATE TABLE numbers ( +id INT, +count INT, +UNIQUE (id) +); +INSERT INTO numbers (id, count) VALUES (1, 1) ON DUPLICATE KEY UPDATE count = 2; +INSERT INTO numbers (id, count) VALUES (1, 3) ON DUPLICATE KEY UPDATE count = 4; +SELECT * FROM numbers; +id count +1 4 +INSERT INTO numbers (id, count) VALUES (2, 1) ON DUPLICATE KEY UPDATE count = 2; +INSERT INTO numbers (id, count) VALUES (2, 3) ON DUPLICATE KEY UPDATE count = 4; +SELECT * FROM numbers; +id count +1 4 +2 4 +DROP TABLE numbers; 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 new file mode 100644 index 00000000000..12d4b173eaa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +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)"; +INSERT INTO diaries (day, title) +VALUES ("2012-02-14", "rainy day") +ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)"; +INSERT INTO diaries (day, title) +VALUES ("2012-02-15", "cloudy day") +ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)"; +SELECT * FROM diaries; +day title +2012-02-14 rainy day (duplicated) +2012-02-15 cloudy day +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..288e9e3a2c8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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 day") +ON DUPLICATE KEY UPDATE title = "clear day (duplicated)"; +INSERT INTO diaries (day, title) +VALUES ("2012-02-14", "rainy day") +ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)"; +INSERT INTO diaries (day, title) +VALUES ("2012-02-15", "cloudy day") +ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)"; +SELECT * FROM diaries; +id day title +1 2012-02-14 rainy day (duplicated) +3 2012-02-15 cloudy day +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result b/storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result new file mode 100644 index 00000000000..1cc1d92451d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS terms; +SET NAMES utf8; +CREATE TABLE terms ( +content varchar(64) NOT NULL COLLATE 'utf8_unicode_ci', +INDEX (content) +) DEFAULT CHARSET=utf8; +INSERT INTO terms VALUES ('track'); +INSERT INTO terms VALUES ('trackback'); +SELECT * FROM terms WHERE content LIKE 'TRACK%'; +content +track +trackback +DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/lock_tables_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/lock_tables_read.result new file mode 100644 index 00000000000..4e1db465c63 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/lock_tables_read.result @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS counts; +CREATE TABLE counts ( +id INT PRIMARY KEY AUTO_INCREMENT +); +LOCK TABLES counts READ; +UNLOCK TABLES; +DROP TABLE counts; 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 new file mode 100644 index 00000000000..da15588ccd5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SET mroonga_enable_optimization=FALSE; +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +month = 11 +ORDER BY day LIMIT 1,2; +id year month day title content +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +4 2011 11 12 帰り道 今日は天気がよくてよかった。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +SET mroonga_enable_optimization=TRUE; +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..0794b104a62 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY day; +id year month day title content +7 2011 12 2 初雪 今日の天気は雪! +1 2011 11 9 Hello 今日からはじめました。 +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +4 2011 11 12 帰り道 今日は天気がよくてよかった。 +5 2011 11 13 はれ 天気がよいのは今日までみたい。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bd34b040ad7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date BETWEEN "2011-11-11 12:23:31" AND "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; +id date content +3 2011-11-11 12:23:32 I will do something today! +4 2011-11-11 12:23:33 I don't want to anything today... +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..f495a3b5956 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date BETWEEN "2011-11-11 12:23:31" AND "2011-11-11 12:23:43" + ORDER BY id LIMIT 1,2; +id date content +3 2011-11-11 12:23:32 I will do something today! +4 2011-11-11 12:23:33 I don't want to anything today... +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..b5be750690d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:34", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date = "2011-11-11 12:23:34" + ORDER BY id LIMIT 1,2; +id date content +3 2011-11-11 12:23:34 I will do something today! +4 2011-11-11 12:23:34 I don't want to anything today... +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..6f20f3b8b35 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date > "2011-11-11 12:23:31" + ORDER BY id LIMIT 1,2; +id date content +4 2011-11-11 12:23:33 I don't want to anything today... +5 2011-11-11 12:23:34 I'm sleepy today. +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..5df3c12ccd8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date >= "2011-11-11 12:23:31" + ORDER BY id LIMIT 1,2; +id date content +3 2011-11-11 12:23:32 I will do something today! +4 2011-11-11 12:23:33 I don't want to anything today... +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..c12e69bf686 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date < "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; +id date content +2 2011-11-11 12:23:31 Today's lucky item is flower! +3 2011-11-11 12:23:32 I will do something today! +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..6d00bac66eb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +date DATETIME, +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!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +date <= "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; +id date content +2 2011-11-11 12:23:31 Today's lucky item is flower! +3 2011-11-11 12:23:32 I will do something today! +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..529f0d521ee --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; +id year month day title content +5 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +6 2011 12 2 初雪 今日の天気は雪! +1 2011 11 9 Hello 今日からはじめました。 +2 2011 11 10 天気 明日の富士山の天気について +4 2011 11 11 帰り道 今日は天気がよくてよかった。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between.result new file mode 100644 index 00000000000..ed86c0e1e37 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED, +content TEXT, +FULLTEXT INDEX(content), +KEY(id) +) DEFAULT CHARSET UTF8; +INSERT INTO memos VALUES(1, "Today is fine."); +INSERT INTO memos VALUES(2, "Today's lucky item is flower!"); +INSERT INTO memos VALUES(3, "I will do something today!"); +INSERT INTO memos VALUES(4, "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +id BETWEEN 2 AND 4 +ORDER BY id LIMIT 1,2; +id content +3 I will do something today! +4 I don't want to anything today... +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_int_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between_over.result new file mode 100644 index 00000000000..a18e2a15863 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between_over.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED, +content TEXT, +FULLTEXT INDEX(content), +KEY(id) +) DEFAULT CHARSET UTF8; +INSERT INTO memos VALUES(1, "Today is fine."); +INSERT INTO memos VALUES(2, "Today's lucky item is flower!"); +INSERT INTO memos VALUES(3, "I will do something today!"); +INSERT INTO memos VALUES(4, "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +id BETWEEN 2 AND 6 +ORDER BY id LIMIT 1,2; +id content +3 I will do something today! +4 I don't want to anything today... +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_int_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result new file mode 100644 index 00000000000..2320b0ffbc4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +month = 11 +ORDER BY day LIMIT 1,2; +id year month day title content +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +4 2011 11 12 帰り道 今日は天気がよくてよかった。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..c367aef808a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +day > 10 +ORDER BY day LIMIT 1,2; +id year month day title content +4 2011 11 12 帰り道 今日は天気がよくてよかった。 +5 2011 11 13 はれ 天気がよいのは今日までみたい。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..b00a4e2a2c3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +day >= 10 +ORDER BY day LIMIT 1,2; +id year month day title content +4 2011 11 12 帰り道 今日は天気がよくてよかった。 +5 2011 11 13 はれ 天気がよいのは今日までみたい。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..5bf6bca4985 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +day < 12 +ORDER BY day LIMIT 1,2; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..5d6a19a936e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +day <= 12 +ORDER BY day LIMIT 1,2; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..6ee2991e51a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; +id year month day title content +5 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +6 2011 12 2 初雪 今日の天気は雪! +1 2011 11 9 Hello 今日からはじめました。 +2 2011 11 10 天気 明日の富士山の天気について +4 2011 11 11 帰り道 今日は天気がよくてよかった。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_where_clause.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_where_clause.result new file mode 100644 index 00000000000..9730069c849 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_where_clause.result @@ -0,0 +1,19 @@ +drop table if exists t1; +flush status; +create table t1 (c1 int primary key, c2 int, c3 text, _id int, key idx1(c2), fulltext index ft(c3)) default charset utf8; +insert into t1 values(1,10,"aa ii uu ee oo",null); +insert into t1 values(2,20,"ka ki ku ke ko",null); +insert into t1 values(3,30,"ii si ii se ii",null); +insert into t1 values(4,40,"ta ti tu te to",null); +insert into t1 values(5,50,"aa ii uu ii oo",null); +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +select *, match(c3) against("ii") from t1 order by c1 desc limit 2; +c1 c2 c3 _id match(c3) against("ii") +5 50 aa ii uu ii oo 5 349526 +4 40 ta ti tu te to 4 0 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +drop table t1; 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 new file mode 100644 index 00000000000..e91e8af5391 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY day ASC LIMIT 1; +id year month day title content +7 2011 12 2 初雪 今日の天気は雪! +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..da01145e45a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY day DESC LIMIT 1; +id year month day title content +5 2011 11 13 はれ 天気がよいのは今日までみたい。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bb541c014bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result @@ -0,0 +1,46 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +_id INT, +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(NULL, 4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(NULL, 5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(NULL, 6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(NULL, 7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY _id +LIMIT 1; +_id id year month day title content +1 1 2011 11 9 Hello 今日からはじめました。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..fb9393687dc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +LIMIT 1; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..75ad884a268 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT *, MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +ORDER BY MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +LIMIT 1; +id year month day title content MATCH(content) AGAINST("今日" IN BOOLEAN MODE) +1 2011 11 9 Hello 今日からはじめました。 1 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..bb4ac9c3b33 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time BETWEEN "1:23:31" AND "1:23:33" + ORDER BY id LIMIT 1,2; +id writing_time content +3 01:23:32 I will do something today! +4 01:23:33 I don't want to anything today... +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_time_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result new file mode 100644 index 00000000000..1b4d38e0107 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time BETWEEN "1:23:31" AND "1:23:43" + ORDER BY id LIMIT 1,2; +id writing_time content +3 01:23:32 I will do something today! +4 01:23:33 I don't want to anything today... +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_time_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result new file mode 100644 index 00000000000..4fff9f9185f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:34", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time = "1:23:34" + ORDER BY id LIMIT 1,2; +id writing_time content +3 01:23:34 I will do something today! +4 01:23:34 I don't want to anything today... +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_time_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result new file mode 100644 index 00000000000..61119b2b74e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time > "1:23:31" + ORDER BY id LIMIT 1,2; +id writing_time content +4 01:23:33 I don't want to anything today... +5 01:23:34 I'm sleepy today. +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_time_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result new file mode 100644 index 00000000000..9bf8b91ea07 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time >= "1:23:31" + ORDER BY id LIMIT 1,2; +id writing_time content +3 01:23:32 I will do something today! +4 01:23:33 I don't want to anything today... +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_time_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result new file mode 100644 index 00000000000..e4d41f5867e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time < "1:23:33" + ORDER BY id LIMIT 1,2; +id writing_time content +2 01:23:31 Today's lucky item is flower! +3 01:23:32 I will do something today! +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_time_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result new file mode 100644 index 00000000000..31a497ef8bb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE memos ( +id INT UNSIGNED NOT NULL, +writing_time TIME, +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!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); +SELECT * FROM memos +WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND +writing_time <= "1:23:33" + ORDER BY id LIMIT 1,2; +id writing_time content +2 01:23:31 Today's lucky item is flower! +3 01:23:32 I will do something today! +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_varchar_equal_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result new file mode 100644 index 00000000000..46c80ddcce7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result @@ -0,0 +1,46 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX(content), +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +title = "hello" + ORDER BY day LIMIT 1; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..38263c1083f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +content TEXT, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); +SELECT * FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND +title = "hello" + ORDER BY day LIMIT 1; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between.result new file mode 100644 index 00000000000..5a1b1bda2ce --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year BETWEEN "11" AND "2013" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC LIMIT 1,2; +id release_title release_year +3 Mroonga 2.0 has been released 2012 +2 Rename Groonga storage engine to Mroonga 2011 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between_over.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between_over.result new file mode 100644 index 00000000000..b0ad41fbbba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between_over.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year BETWEEN "11" AND "2015" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC LIMIT 1,2; +id release_title release_year +4 Mroonga 3.0 has been released 2013 +3 Mroonga 2.0 has been released 2012 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_equal.result new file mode 100644 index 00000000000..08db6b384e8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_equal.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine (code name Mroonga) 1.0 has been released", "11"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 1.11 has been released", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year = "11" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC LIMIT 1,2; +id release_title release_year +2 Rename Groonga storage engine to Mroonga 2011 +1 Groonga storage engine (code name Mroonga) 1.0 has been released 2011 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than.result new file mode 100644 index 00000000000..a33cd484865 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year > "11" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id ASC LIMIT 2; +id release_title release_year +3 Mroonga 2.0 has been released 2012 +4 Mroonga 3.0 has been released 2013 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than_or_equal.result new file mode 100644 index 00000000000..7d2471b3aa0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than_or_equal.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year >= "11" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id ASC LIMIT 2; +id release_title release_year +2 Rename Groonga storage engine to Mroonga 2011 +3 Mroonga 2.0 has been released 2012 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than.result new file mode 100644 index 00000000000..cac3d6f4356 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year < "13" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC LIMIT 1,2; +id release_title release_year +2 Rename Groonga storage engine to Mroonga 2011 +1 Groonga storage engine (code name Mroonga) 0.1 has been released 2010 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than_or_equal.result new file mode 100644 index 00000000000..df57f51e5d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than_or_equal.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS mroonga_releases; +FLUSH STATUS; +CREATE TABLE mroonga_releases ( +id INT PRIMARY KEY AUTO_INCREMENT, +release_title TEXT, +release_year YEAR, +KEY (release_year), +FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) +VALUES ("Mroonga 4.0 will be released", "2014"); +SELECT * FROM mroonga_releases +WHERE release_year <= "13" AND +MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC LIMIT 1,2; +id release_title release_year +3 Mroonga 2.0 has been released 2012 +2 Rename Groonga storage engine to Mroonga 2011 +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE mroonga_releases; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..b66801094bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_TODO_SPLIT_ME.result @@ -0,0 +1,106 @@ +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_skip_count_after_insert_multithread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_multithread.result new file mode 100644 index 00000000000..c09ec340ccb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_multithread.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX ft(title) +); +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_single_thread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_single_thread.result new file mode 100644 index 00000000000..c09ec340ccb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_after_insert_single_thread.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX ft(title) +); +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_disabled.result new file mode 100644 index 00000000000..9971d21e386 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_disabled.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, "はれ", "天気がよいのは今日までみたい。"); +SET mroonga_enable_optimization=FALSE; +SELECT COUNT(*) FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE); +COUNT(*) +4 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SET mroonga_enable_optimization=TRUE; +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_index_view.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_index_view.result new file mode 100644 index 00000000000..407347a4fa2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_skip_count_index_view.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries, users; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +user_id INT NOT NULL, +title VARCHAR(45) NOT NULL, +KEY (user_id), +FULLTEXT INDEX title_index (title) +) DEFAULT CHARSET=UTF8; +CREATE TABLE users ( +id INT PRIMARY KEY AUTO_INCREMENT, +name VARCHAR(45) NOT NULL, +INDEX (name) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8; +INSERT INTO users (id, name) VALUES (1, "Alice"), (2, "Bob"); +INSERT INTO diaries (user_id, title) VALUES (1, "survey"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (1)"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (2)"); +CREATE VIEW articles AS +SELECT diaries.user_id AS user_id, +diaries.title AS title, +users.name AS name +FROM diaries, users +WHERE diaries.user_id = users.id; +SELECT COUNT(*) FROM articles WHERE name = 'Bob'; +COUNT(*) +2 +DROP VIEW articles; +DROP TABLE diaries, users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result new file mode 100644 index 00000000000..94bd5167dbc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS geo_replace; +CREATE TABLE geo_replace ( +id INT NOT NULL, +geo GEOMETRY NOT NULL, +PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO geo_replace VALUES(1, POINT(100,100)); +SELECT id, ASTEXT(geo) FROM geo_replace; +id ASTEXT(geo) +1 POINT(100 100) +REPLACE INTO geo_replace VALUES(1, POINT(100,200)); +SELECT id, ASTEXT(geo) FROM geo_replace; +id ASTEXT(geo) +1 POINT(100 200) +INSERT INTO geo_replace VALUES(1, POINT(200,200)) ON DUPLICATE KEY UPDATE geo = POINT(200,200); +SELECT id, ASTEXT(geo) FROM geo_replace; +id ASTEXT(geo) +1 POINT(200 200) +UPDATE geo_replace SET geo = POINT(200,300); +SELECT id, ASTEXT(geo) FROM geo_replace; +id ASTEXT(geo) +1 POINT(200 300) +DROP TABLE geo_replace; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result new file mode 100644 index 00000000000..9cbe11c5574 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS videos_master, videos_groonga; +CREATE TABLE `videos_master` ( +`id` bigint(1) unsigned NOT NULL, +`video_id` varchar(64) NOT NULL, +`description` text, +`tags_unpack` text, +PRIMARY KEY (`video_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `videos_groonga` ( +`id` bigint(1) unsigned NOT NULL, +`video_id` varchar(64) NOT NULL, +`description` text, +`tags_unpack` text, +PRIMARY KEY (`video_id`), +FULLTEXT INDEX (`description`), +FULLTEXT INDEX (`tags_unpack`) +) DEFAULT CHARSET=utf8; +INSERT INTO videos_master VALUES (1, "video-1", "My Familly", "familly human"); +INSERT INTO videos_master VALUES (2, "video-2", "My Cat", "family cat"); +REPLACE INTO videos_groonga +SELECT v.id, v.video_id, v.description, NULL +FROM videos_master AS v +WHERE v.video_id = (video_id); +SELECT *, MATCH(description) AGAINST("cat") FROM videos_groonga +WHERE MATCH(description) AGAINST("cat"); +id video_id description tags_unpack MATCH(description) AGAINST("cat") +2 video-2 My Cat 1048577 +INSERT INTO videos_master VALUES (3, "video-3", "My Dog", "family dog"); +REPLACE INTO videos_groonga +SELECT v.id, v.video_id, v.description, NULL +FROM videos_master AS v +WHERE v.video_id = (video_id); +SELECT *, MATCH(description) AGAINST("my") FROM videos_groonga +WHERE MATCH(description) AGAINST("my"); +id video_id description tags_unpack MATCH(description) AGAINST("my") +1 video-1 My Familly 209716 +2 video-2 My Cat 209716 +3 video-3 My Dog 209716 +DROP TABLE videos_master, videos_groonga; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result new file mode 100644 index 00000000000..f2cf9667ac7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result @@ -0,0 +1,33 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +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, "今日も天気がよくてきれいに見える。"); +select * from diaries; +id content +1 今日からはじめました。 +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +select * from diaries where match(content) against("天気"); +id content +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +replace into diaries values(2, "明日の天気は雨みたい。"); +select * from diaries where match(content) against("天気"); +id content +2 明日の天気は雨みたい。 +3 今日も天気がよくてきれいに見える。 +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result new file mode 100644 index 00000000000..090ea9b84d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result @@ -0,0 +1,33 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +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, "今日も天気がよくてきれいに見える。"); +select * from diaries; +id content +1 今日からはじめました。 +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +select * from diaries where match(content) against("天気"); +id content +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +replace into diaries values(2, "明日の天気は雨みたい。"); +select * from diaries where match(content) against("天気"); +id content +2 明日の天気は雨みたい。 +3 今日も天気がよくてきれいに見える。 +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_vector.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_vector.result new file mode 100644 index 00000000000..3e987631dba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_vector.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS vector_replace; +DROP TABLE IF EXISTS vector_replace_vec; +CREATE TABLE vector_replace_vec ( +vec CHAR(10) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE vector_replace ( +id INT NOT NULL, +vec TEXT COMMENT 'flags "COLUMN_VECTOR", type "vector_replace_vec"', +PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO vector_replace VALUES(1, 'first second third'); +SELECT id, vec FROM vector_replace; +id vec +1 FIRST SECOND THIRD +REPLACE INTO vector_replace VALUES(1, 'fourth fifth'); +SELECT id, vec FROM vector_replace; +id vec +1 FOURTH FIFTH +INSERT INTO vector_replace VALUES(1, 'sixth seventh') ON DUPLICATE KEY UPDATE vec = 'sixth seventh'; +SELECT id, vec FROM vector_replace; +id vec +1 SIXTH SEVENTH +UPDATE vector_replace SET vec = 'eighth nineth tenth'; +SELECT id, vec FROM vector_replace; +id vec +1 EIGHTH NINETH TENTH +DROP TABLE vector_replace; +DROP TABLE vector_replace_vec; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_all.result new file mode 100644 index 00000000000..18318bdbc4e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_all.result @@ -0,0 +1,198 @@ +drop table if exists t1, t2, t3; +create table t1(c1 int, c2 int, c3 int); +insert into t1 values (1, 10, 100); +insert into t1 values (2, 30, 500); +insert into t1 values (5, 20, 200); +insert into t1 values (3, 60, 300); +insert into t1 values (4, 50, 600); +insert into t1 values (6, 40, 400); +select * from t1; +c1 c2 c3 +1 10 100 +2 30 500 +5 20 200 +3 60 300 +4 50 600 +6 40 400 +select c1 from t1; +c1 +1 +2 +5 +3 +4 +6 +select c2 from t1; +c2 +10 +30 +20 +60 +50 +40 +select c3 from t1; +c3 +100 +500 +200 +300 +600 +400 +select * from t1 where c1 <= 3; +c1 c2 c3 +1 10 100 +2 30 500 +3 60 300 +select * from t1 where c2 > 40; +c1 c2 c3 +3 60 300 +4 50 600 +select * from t1 where c3 = 300; +c1 c2 c3 +3 60 300 +select * from t1 order by c1; +c1 c2 c3 +1 10 100 +2 30 500 +3 60 300 +4 50 600 +5 20 200 +6 40 400 +select * from t1 order by c2 desc; +c1 c2 c3 +3 60 300 +4 50 600 +6 40 400 +2 30 500 +5 20 200 +1 10 100 +select * from t1 order by c3, c1; +c1 c2 c3 +1 10 100 +5 20 200 +3 60 300 +6 40 400 +2 30 500 +4 50 600 +drop table t1; +create table t1 (c1 int, c2 varchar(100)); +insert into t1 values(1, "hoge"); +insert into t1 values(4, "hogefuga"); +insert into t1 values(2, "fuga"); +insert into t1 values(5, "moge"); +insert into t1 values(3, "mo"); +select * from t1; +c1 c2 +1 hoge +4 hogefuga +2 fuga +5 moge +3 mo +select * from t1 order by c1; +c1 c2 +1 hoge +2 fuga +3 mo +4 hogefuga +5 moge +select * from t1 order by c1 desc; +c1 c2 +5 moge +4 hogefuga +3 mo +2 fuga +1 hoge +select * from t1 order by c2; +c1 c2 +2 fuga +1 hoge +4 hogefuga +3 mo +5 moge +drop table t1; +create table t1 (c1 int, c2 text); +insert into t1 values(1, "hoge"); +insert into t1 values(4, "hogefuga"); +insert into t1 values(2, "fuga"); +insert into t1 values(5, "moge"); +insert into t1 values(3, "mo"); +select * from t1; +c1 c2 +1 hoge +4 hogefuga +2 fuga +5 moge +3 mo +drop table t1; +create table t1 (c1 int, c2 int, c3 text); +insert into t1 values(1, 20, "hoge"); +insert into t1 values(4, 60, "hogefuga"); +insert into t1 values(2, 50, "fuga"); +insert into t1 values(5, 30, "moge"); +insert into t1 values(3, 40, "mo"); +select * from t1 order by c1 asc; +c1 c2 c3 +1 20 hoge +2 50 fuga +3 40 mo +4 60 hogefuga +5 30 moge +select * from t1 order by c1 desc; +c1 c2 c3 +5 30 moge +4 60 hogefuga +3 40 mo +2 50 fuga +1 20 hoge +select * from t1 order by c2 asc; +c1 c2 c3 +1 20 hoge +5 30 moge +3 40 mo +2 50 fuga +4 60 hogefuga +select * from t1 order by c2 desc; +c1 c2 c3 +4 60 hogefuga +2 50 fuga +3 40 mo +5 30 moge +1 20 hoge +select * from t1 order by c3 asc; +c1 c2 c3 +2 50 fuga +1 20 hoge +4 60 hogefuga +3 40 mo +5 30 moge +select * from t1 order by c3 desc; +c1 c2 c3 +5 30 moge +3 40 mo +4 60 hogefuga +1 20 hoge +2 50 fuga +drop table t1; +create table t1 (_id int, c1 int); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +select * from t1; +_id c1 +1 100 +2 100 +3 100 +4 100 +5 100 +select * from t1 where _id < 3; +_id c1 +1 100 +2 100 +select * from t1 where _id >= 3; +_id c1 +3 100 +4 100 +5 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_equal.result new file mode 100644 index 00000000000..e0e3e21c620 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_equal.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS tags; +CREATE TABLE tags ( +name VARCHAR(16) NOT NULL, +KEY index_name (name) +); +INSERT INTO tags VALUES ('mroonga'); +INSERT INTO tags VALUES ('mysql'); +INSERT INTO tags VALUES (''); +SELECT * FROM tags WHERE name = ""; +name + +DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_not_equal.result new file mode 100644 index 00000000000..3732cb28184 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_not_equal.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS tags; +CREATE TABLE tags ( +name VARCHAR(16) NOT NULL, +KEY index_name (name) +); +INSERT INTO tags VALUES ('mroonga'); +INSERT INTO tags VALUES ('mysql'); +INSERT INTO tags VALUES (''); +SELECT * FROM tags WHERE name != ""; +name +mroonga +mysql +DROP TABLE tags; 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 new file mode 100644 index 00000000000..400156cec7b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +name varchar(40), +age int, +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 +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 new file mode 100644 index 00000000000..04f63d0e779 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +name varchar(40), +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 +DROP TABLE users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result new file mode 100644 index 00000000000..99f69f49aba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result @@ -0,0 +1,27 @@ +drop table if exists t1, t2, t3; +create table t1(c1 int primary key, c2 int, c3 int); +insert into t1 values (1, 10, 100); +insert into t1 values (2, 30, 500); +insert into t1 values (5, 20, 200); +insert into t1 values (3, 60, 300); +insert into t1 values (4, 50, 600); +insert into t1 values (6, 40, 400); +select * from t1 where c1=1; +c1 c2 c3 +1 10 100 +select * from t1 where c1=2; +c1 c2 c3 +2 30 500 +select * from t1 where c1=3; +c1 c2 c3 +3 60 300 +select * from t1 where c1=4; +c1 c2 c3 +4 50 600 +select * from t1 where c1=5; +c1 c2 c3 +5 20 200 +select * from t1 where c1=6; +c1 c2 c3 +6 40 400 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_secondary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_secondary_key.result new file mode 100644 index 00000000000..1c24089ef71 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_secondary_key.result @@ -0,0 +1,55 @@ +drop table if exists t1, t2, t3; +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"); +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 +select * from t1 force index(idx1) where c2 = 30; +c1 c2 c3 +3 30 sa si su se so +select * from t1 force index(idx1) where c2 = 20; +c1 c2 c3 +2 20 ka ki ku ke ko +insert into t1 values(6,30,"aa bb cc dd ee"); +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 +6 30 aa bb cc dd ee +select * from t1 force index(idx1) where c2 = 30; +c1 c2 c3 +3 30 sa si su se so +6 30 aa bb cc dd ee +drop table t1; +create table t1 (c1 varchar(5) primary key, c2 varchar(5), c3 text, key idx1(c2), fulltext index ft(c3))engine=mroonga; +insert into t1 values('ab','ijk',"aa ii uu ee oo"); +insert into t1 values('bc','ghi',"ka ki ku ke ko"); +insert into t1 values('cd','efg',"sa si su se so"); +insert into t1 values('de','cde',"ta ti tu te to"); +insert into t1 values('ef','abc',"aa ii uu ee oo"); +select * from t1 force index(idx1) where c2 < 'e' order by c1 asc; +c1 c2 c3 +de cde ta ti tu te to +ef abc aa ii uu ee oo +select * from t1 force index(idx1) where c2 > 'e' order by c1 asc; +c1 c2 c3 +ab ijk aa ii uu ee oo +bc ghi ka ki ku ke ko +cd efg sa si su se so +select * from t1 force index(idx1) where c2 between 'c' and 'h' order by c1 asc; +c1 c2 c3 +bc ghi ka ki ku ke ko +cd efg sa si su se so +de cde ta ti tu te to +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/show_create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/show_create_table_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..ef87703e716 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/show_create_table_TODO_SPLIT_ME.result @@ -0,0 +1,25 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c1 int, c2 int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL, + `c2` int(11) DEFAULT NULL +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c1 int primary key, c2 varchar(100)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` varchar(100) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +drop table t1; 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 new file mode 100644 index 00000000000..4f24d0d74b0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS diaries, users; +CREATE TABLE users ( +id INT PRIMARY KEY AUTO_INCREMENT, +name TEXT +) DEFAULT CHARSET UTF8; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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"); +SELECT * FROM users; +id name +1 alice +2 bob +3 carlos +INSERT INTO diaries (user_id, title) VALUES (1, "Hello!"); +INSERT INTO diaries (user_id, title) VALUES (2, "my name is bob"); +INSERT INTO diaries (user_id, title) VALUES (3, "my name is carlos"); +SELECT * FROM diaries; +id user_id title +1 1 Hello! +2 2 my name is bob +3 3 my name is carlos +SELECT * FROM users +WHERE id IN (SELECT user_id FROM diaries +WHERE MATCH(title) AGAINST("name")) +ORDER BY id DESC; +id name +3 carlos +2 bob +DROP TABLE diaries, users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result new file mode 100644 index 00000000000..f6c036bbf9f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result @@ -0,0 +1,21 @@ +DROP TEMPORARY TABLE IF EXISTS diaries; +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"); +SELECT * FROM diaries; +id title +1 clear day +2 rainy day +3 cloudy day +DROP TEMPORARY TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result new file mode 100644 index 00000000000..0e33976eb17 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +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, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT * FROM diaries; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +2 2011 11 10 天気 明日の富士山の天気について +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +2 2011 11 10 天気 明日の富士山の天気について +TRUNCATE TABLE diaries; +SELECT * FROM diaries; +id year month day title content +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +id year month day title content +INSERT INTO diaries VALUES(1, 2011, 11, 11, "帰り道", "つかれたー"); +INSERT INTO diaries VALUES(2, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(3, 2011, 12, 2, "初雪", "今年はじめての雪!"); +SELECT * FROM diaries; +id year month day title content +1 2011 11 11 帰り道 つかれたー +2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +3 2011 12 2 初雪 今年はじめての雪! +SELECT * FROM diaries WHERE MATCH(content) AGAINST("悪い" IN BOOLEAN MODE); +id year month day title content +2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result new file mode 100644 index 00000000000..bf81d5e0a8d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result @@ -0,0 +1,22 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 text, fulltext index (c2)); +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); +select * from t1; +c1 c2 +10 aa ii uu ee +20 ka ki ku ke +30 sa si su se +update t1 set c2="ta ti tu te" where c1=20; +select * from t1; +c1 c2 +10 aa ii uu ee +20 ta ti tu te +30 sa si su se +select * from t1 where match(c2) against("ti"); +c1 c2 +20 ta ti tu te +select * from t1 where match(c2) against("ki"); +c1 c2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_id_hash_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_id_hash_index.result new file mode 100644 index 00000000000..35d8843afbe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_id_hash_index.result @@ -0,0 +1,20 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, c1 int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id c1 +1 100 +2 100 +3 100 +4 100 +update t1 set c1 = 200 where _id = 2; +select * from t1; +_id c1 +1 100 +2 200 +3 100 +4 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_id_unique_hash_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_id_unique_hash_index.result new file mode 100644 index 00000000000..dba9c964270 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_id_unique_hash_index.result @@ -0,0 +1,20 @@ +drop table if exists t1, t2, t3; +create table t1 (_id int, c1 int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +_id c1 +1 100 +2 100 +3 100 +4 100 +update t1 set c1 = 200 where _id = 2; +select * from t1; +_id c1 +1 100 +2 200 +3 100 +4 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_int.result new file mode 100644 index 00000000000..e022fa237bb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_int.result @@ -0,0 +1,42 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int, c2 int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL, + `c2` int(11) DEFAULT NULL +) ENGINE=Mroonga DEFAULT CHARSET=latin1 +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +update t1 set c2=c2+100 where c1=1; +select * from t1; +c1 c2 +1 200 +2 101 +3 102 +update t1 set c2=c2+100 where c1=2; +select * from t1; +c1 c2 +1 200 +2 201 +3 102 +update t1 set c2=c2+100 where c1=3; +select * from t1; +c1 c2 +1 200 +2 201 +3 202 +flush tables; +update t1 set c1=5, c2=50; +select * from t1; +c1 c2 +5 50 +5 50 +5 50 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_last_insert_grn_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_last_insert_grn_id.result new file mode 100644 index 00000000000..af5926313c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_last_insert_grn_id.result @@ -0,0 +1,29 @@ +drop table if exists memos; +create table memos ( +_id int, +content varchar(255), +unique key (_id) using hash +); +insert into memos values (null, "今夜はさんま。"); +insert into memos values (null, "明日はgroongaをアップデート。"); +insert into memos values (null, "帰りにおだんご。"); +insert into memos values (null, "金曜日は肉の日。"); +select * from memos; +_id content +1 今夜はさんま。 +2 明日はgroongaをアップデート。 +3 帰りにおだんご。 +4 金曜日は肉の日。 +insert into memos values (null, "冷蔵庫に牛乳が残り1本。"); +select last_insert_grn_id(); +last_insert_grn_id() +5 +update memos set content = "冷蔵庫に牛乳はまだたくさんある。" where _id = last_insert_grn_id(); +select * from memos; +_id content +1 今夜はさんま。 +2 明日はgroongaをアップデート。 +3 帰りにおだんご。 +4 金曜日は肉の日。 +5 冷蔵庫に牛乳はまだたくさんある。 +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 new file mode 100644 index 00000000000..11e6ee21949 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result @@ -0,0 +1,28 @@ +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; +c1 _id +1 1 +2 2 +3 3 +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; +c1 _id +1 1 +2 2 +3 3 +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; +c1 _id +1 1 +2 2 +3 3 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result new file mode 100644 index 00000000000..4536dded9d7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result @@ -0,0 +1,17 @@ +SET GLOBAL mroonga_database_path_prefix = "test/mroonga.data/"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_database_path_prefix'; +Variable_name Value +mroonga_database_path_prefix test/mroonga.data/ +CREATE DATABASE clean_test; +USE clean_test; +CREATE TABLE counts ( +id INT PRIMARY KEY AUTO_INCREMENT +); +INSERT INTO counts VALUES (NULL); +SELECT * FROM counts; +id +1 +DROP TABLE counts; +DROP DATABASE clean_test; +USE test; +SET GLOBAL mroonga_database_path_prefix = NULL; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_new_value.result new file mode 100644 index 00000000000..959383ee6d9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_new_value.result @@ -0,0 +1,6 @@ +SET @mroonga_default_parser_backup = @@mroonga_default_parser; +SET GLOBAL mroonga_default_parser = "TokenBigramSplitAlpha"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_parser'; +Variable_name Value +mroonga_default_parser TokenBigramSplitAlpha +SET GLOBAL mroonga_default_parser = @mroonga_default_parser_backup; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_same_value.result new file mode 100644 index 00000000000..7f441b4b86d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_same_value.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_default_parser = "TokenBigram"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_parser'; +Variable_name Value +mroonga_default_parser 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 new file mode 100644 index 00000000000..6e690f45e61 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result @@ -0,0 +1,28 @@ +drop table if exists diaries; +create table diaries ( +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 +1 will start groonga! +set mroonga_dry_write=true; +delete from diaries where id = 1; +select * from diaries; +id body +1 will start groonga! +set mroonga_dry_write=false; +delete from diaries where id = 1; +select * from diaries; +id body +drop table diaries; 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 new file mode 100644 index 00000000000..8de55efaccc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result @@ -0,0 +1,30 @@ +drop table if exists diaries; +create table diaries ( +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 +1 will start groonga! +set mroonga_dry_write=true; +insert into diaries (body) values ("starting groonga..."); +select * from diaries; +id body +1 will start groonga! +set mroonga_dry_write=false; +insert into diaries (body) values ("started groonga."); +select * from diaries; +id body +1 will start groonga! +2 started groonga. +drop table diaries; 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 new file mode 100644 index 00000000000..dd3ee5b333c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result @@ -0,0 +1,26 @@ +drop table if exists diaries; +create table diaries ( +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; +select * from diaries; +id body +1 will start groonga! +set mroonga_dry_write=false; +update diaries set body = "starting groonga..." where id = 1; +select * from diaries; +id body +1 starting groonga... +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_disable.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_disable.result new file mode 100644 index 00000000000..789316d83ca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_disable.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_lock_timeout = -1; +SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; +Variable_name Value +mroonga_lock_timeout -1 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_invalid.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_invalid.result new file mode 100644 index 00000000000..029b1ab17f7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_invalid.result @@ -0,0 +1,6 @@ +SET GLOBAL mroonga_lock_timeout = -2; +Warnings: +Warning 1292 Truncated incorrect mroonga_lock_timeout value: '-2' +SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; +Variable_name Value +mroonga_lock_timeout -1 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_no_retry.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_no_retry.result new file mode 100644 index 00000000000..f47a2e6625b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_no_retry.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_lock_timeout = 0; +SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; +Variable_name Value +mroonga_lock_timeout 0 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_valid.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_valid.result new file mode 100644 index 00000000000..6ec1004f752 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_valid.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_lock_timeout = 1000; +SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout"; +Variable_name Value +mroonga_lock_timeout 1000 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_new_value.result new file mode 100644 index 00000000000..db4694797b2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_new_value.result @@ -0,0 +1,6 @@ +SET @mroonga_log_file_backup = @@mroonga_log_file; +SET GLOBAL mroonga_log_file = "new-mroonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; +Variable_name Value +mroonga_log_file new-mroonga.log +SET GLOBAL mroonga_log_file = @mroonga_log_file_backup; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_nonexistent_path.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_nonexistent_path.result new file mode 100644 index 00000000000..1dbec1f850e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_nonexistent_path.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_log_file = "nonexistent/mroonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; +Variable_name Value +mroonga_log_file groonga.log diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_same_value.result new file mode 100644 index 00000000000..5824f09053e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_same_value.result @@ -0,0 +1,4 @@ +SET GLOBAL mroonga_log_file = "groonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; +Variable_name Value +mroonga_log_file groonga.log diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_level_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_level_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..cb646eceaf3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_log_level_TODO_SPLIT_ME.result @@ -0,0 +1,49 @@ +set @mroonga_log_level_backup=@@mroonga_log_level; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level NOTICE +set global mroonga_log_level=NONE; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level NONE +set global mroonga_log_level=EMERG; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level EMERG +set global mroonga_log_level=ALERT; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level ALERT +set global mroonga_log_level=CRIT; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level CRIT +set global mroonga_log_level=ERROR; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level ERROR +set global mroonga_log_level=WARNING; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level WARNING +set global mroonga_log_level=NOTICE; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level NOTICE +set global mroonga_log_level=INFO; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level INFO +set global mroonga_log_level=DEBUG; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level DEBUG +set global mroonga_log_level=DUMP; +show global variables like 'mroonga_log_level'; +Variable_name Value +mroonga_log_level DUMP +set global mroonga_log_level=dummy; +ERROR 42000: Variable 'mroonga_log_level' can't be set to the value of 'dummy' +set session mroonga_log_level=NOTICE; +ERROR HY000: Variable 'mroonga_log_level' is a GLOBAL variable and should be set with SET GLOBAL +set global mroonga_log_level=@mroonga_log_level_backup; 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 new file mode 100644 index 00000000000..04b22c22ea6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +SET GLOBAL mroonga_match_escalation_threshold = -1; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +tags TEXT, +FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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); +id title tags +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); +id title tags +SET mroonga_match_escalation_threshold = 0; +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +id title tags +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 new file mode 100644 index 00000000000..25a1aba61e2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +tags TEXT, +FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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); +id title tags +1 Hello groonga! groonga install +2 Hello mroonga! mroonga install +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +id title tags +1 Hello groonga! groonga install +SET mroonga_match_escalation_threshold = -1; +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); +id title tags +1 Hello groonga! groonga install +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_vector_column_delimiter.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_vector_column_delimiter.result new file mode 100644 index 00000000000..f3c8f1e8628 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_vector_column_delimiter.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS document; +DROP TABLE IF EXISTS category; +CREATE TABLE category ( +category CHAR(10) PRIMARY KEY +) DEFAULT CHARSET=utf8 +COMMENT='default_tokenizer "TokenDelimit"'; +CREATE TABLE document ( +id INT NOT NULL, +title TEXT, +categories TEXT COMMENT 'flags "COLUMN_VECTOR", type "category"', +PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; +SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; +Variable_name Value +mroonga_vector_column_delimiter +INSERT INTO document VALUES(1, "Mroonga is the fastest search engine", "it database fulltext"); +SELECT id, title, categories FROM document; +id title categories +1 Mroonga is the fastest search engine IT DATABASE FULLTEXT +SET GLOBAL mroonga_vector_column_delimiter = ';'; +SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; +Variable_name Value +mroonga_vector_column_delimiter ; +SELECT id, title, categories FROM document; +id title categories +1 Mroonga is the fastest search engine IT;DATABASE;FULLTEXT +DROP TABLE document; +DROP TABLE category; +SET GLOBAL mroonga_vector_column_delimiter = ' '; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result new file mode 100644 index 00000000000..4c22040ab5a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result @@ -0,0 +1,3 @@ +show variables like 'mroonga_version'; +Variable_name Value +mroonga_version 4.05 diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in new file mode 100644 index 00000000000..26ff300a759 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in @@ -0,0 +1,3 @@ +show variables like 'mroonga_version'; +Variable_name Value +mroonga_version @MRN_VERSION@ diff --git a/storage/mroonga/mysql-test/mroonga/storage/suite.opt b/storage/mroonga/mysql-test/mroonga/storage/suite.opt new file mode 100644 index 00000000000..d5a1e5190a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/suite.opt @@ -0,0 +1 @@ +--loose-plugin-load-add=$HA_MROONGA_SO --loose-plugin-mroonga=ON diff --git a/storage/mroonga/mysql-test/mroonga/storage/suite.pm b/storage/mroonga/mysql-test/mroonga/storage/suite.pm new file mode 100644 index 00000000000..528ccc5d693 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/suite.pm @@ -0,0 +1,23 @@ +package My::Suite::Mroonga; + +@ISA = qw(My::Suite); + +return "No Mroonga engine" unless $ENV{HA_MROONGA_SO} or + $::mysqld_variables{'mroonga'} eq "ON"; + +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'; + +if (-d $groonga_normalizer_mysql_dir) +{ + $ENV{GRN_PLUGINS_DIR}=$groonga_normalizer_mysql_dir; +} +elsif (-d $groonga_normalizer_mysql_install_dir) +{ + $ENV{GRN_PLUGINS_DIR}=$groonga_normalizer_mysql_install_dir; +} + +bless { }; + 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 new file mode 100644 index 00000000000..e70dcb92e12 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test @@ -0,0 +1,38 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +ALTER TABLE diaries ADD title TEXT AFTER id; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..dac06ff6719 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test @@ -0,0 +1,38 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +ALTER TABLE diaries ADD title TEXT FIRST; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..ebf8ac5d581 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test @@ -0,0 +1,50 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; + +ALTER TABLE diaries + ADD COLUMN body TEXT FIRST, + ADD COLUMN published BOOLEAN AFTER id, + ADD COLUMN created_at DATETIME; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; + +INSERT INTO diaries (title, body, published, created_at) + VALUES ("groonga (1)", "starting groonga...", TRUE, "2014-2-9 02:09:00"); +INSERT INTO diaries (title, body, published, created_at) + VALUES ("groonga (2)", "started groonga.", FALSE, "2014-2-9 12:19:00"); +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/storage/t/alter_table_add_column_plain.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test new file mode 100644 index 00000000000..01f13799c02 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test @@ -0,0 +1,45 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; + +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; + +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/storage/t/alter_table_add_column_with_flags.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test new file mode 100644 index 00000000000..c93ae13a19e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +CREATE TABLE tags ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY +) DEFAULT CHARSET=utf8; + +ALTER TABLE tags ADD COLUMN name VARCHAR(64) COMMENT 'flags "COLUMN_VECTOR"'; + +SELECT mroonga_command("dump"); + +DROP TABLE tags; + +--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_with_type.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test new file mode 100644 index 00000000000..2f39d52777a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test @@ -0,0 +1,43 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +CREATE TABLE tags ( + id INT UNSIGNED PRIMARY KEY +) DEFAULT CHARSET=utf8; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY +) DEFAULT CHARSET=utf8; + +ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'type "tags"'; + +SELECT mroonga_command("dump"); + +DROP TABLE bugs; +DROP TABLE tags; + +--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_key_multiple_column_with_data.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test new file mode 100644 index 00000000000..ba06e55e1ba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE scores ( + id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL, + name CHAR(30) NOT NULL, + score INT NOT NULL +) 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 + WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); + +ALTER TABLE scores ADD KEY property (name, score); +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/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 new file mode 100644 index 00000000000..7b9fc783244 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test @@ -0,0 +1,39 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64) +) DEFAULT CHARSET=utf8; + +ALTER TABLE bugs + CHANGE COLUMN + tag + tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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_change_column_have_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test new file mode 100644 index 00000000000..3a86d23facf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(32), + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +ALTER TABLE bugs CHANGE COLUMN title title VARCHAR(64); + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..16e98a9769e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test @@ -0,0 +1,39 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +ALTER TABLE diaries CHANGE body description TEXT AFTER id; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..86c94afd281 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test @@ -0,0 +1,39 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +ALTER TABLE diaries CHANGE body description TEXT FIRST; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..a9bbe403da1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test @@ -0,0 +1,43 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) 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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (subject, description) + VALUES ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..12ba5606b25 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test @@ -0,0 +1,39 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +ALTER TABLE diaries CHANGE body description TEXT; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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.test new file mode 100644 index 00000000000..867c6722d36 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine.test @@ -0,0 +1,54 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT, + FULLTEXT INDEX title_index (title), + FULLTEXT INDEX body_index (body) +) ENGINE MyISAM 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..."); +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +ALTER TABLE diaries ENGINE = mroonga; +SHOW CREATE TABLE diaries; + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..06cdb13ba16 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + WHERE MATCH (title) AGAINST ("富士山"); + +CREATE FULLTEXT INDEX title_index on diaries (title); + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries DISABLE KEYS; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d6e32e0f004 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES ujis; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=ujis; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "ŷ"); +INSERT INTO diaries VALUES (3, "ٻλ"); + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("ٻλ"); + +ALTER TABLE diaries DISABLE KEYS; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("ٻλ"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..fb89d678b75 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries DISABLE KEYS; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2112828684a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + created_at datetime, + KEY title_and_created_at_index (title, created_at) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f599767ab8f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + created_at datetime, + KEY created_at_index (created_at) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4bc5fb1f643 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test @@ -0,0 +1,47 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ab990a549b1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE users ( + first_name VARCHAR(32) NOT NULL, + last_name VARCHAR(32) NOT NULL, + KEY (first_name, last_name) +); + +INSERT INTO users VALUES("Taro", "Yamada"); +INSERT INTO users VALUES("Hanako", "Tanaka"); +INSERT INTO users VALUES("Joe", "Honda"); + +SELECT * FROM users; + +ALTER TABLE users DISABLE KEYS; +TRUNCATE users; + +SELECT * FROM users; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..b172ff303c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test @@ -0,0 +1,41 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + c1 int NOT NULL, + c2 text NOT NULL, + c3 int NOT NULL, + c4 int NOT NULL, + PRIMARY KEY(c1), + KEY idx1(c3,c4), + FULLTEXT KEY ft1(c2) +); +INSERT INTO t1 VALUES(1, 'test1', 1, 1); +INSERT INTO t1 VALUES(2, 'test2', 2, 2); +INSERT INTO t1 VALUES(3, 'test3', 1, 3); +ALTER TABLE t1 DISABLE KEYS; +DELETE FROM t1 WHERE c1 = 2; +UPDATE t1 SET c4 = 4 WHERE c1 = 1; +INSERT INTO t1 VALUES(4, 'test4', 2, 4); +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..549a5540450 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test @@ -0,0 +1,45 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); +SELECT * FROM diaries; + +ALTER TABLE diaries + DROP COLUMN title, + DROP COLUMN body; +SHOW CREATE TABLE diaries; +SELECT * FROM diaries; + +INSERT INTO diaries () VALUES (); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..1e7248125cf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +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)"); +INSERT INTO diaries (title) values ("groonga (2)"); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..992606b4f62 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE scores ( + id BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL, + name CHAR(30) NOT NULL, + score INT NOT NULL, + KEY property (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 + WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29); + +ALTER TABLE scores DROP KEY property; +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/alter_table_enable_keys_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test new file mode 100644 index 00000000000..136acfcebf2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e14400808e5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES ujis; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=ujis; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "ŷ"); +INSERT INTO diaries VALUES (3, "ٻλ"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("ٻλ"); + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("ٻλ"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..136acfcebf2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + FULLTEXT KEY title_index (title) +) DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..35e6366ed62 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test @@ -0,0 +1,53 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + created_at datetime, + KEY title_and_created_at_index (title, created_at) +) DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ec45b48f61e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255), + created_at datetime, + KEY created_at_index (created_at) +) DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..b1ebb668391 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id int PRIMARY KEY, + title varchar(255) +) DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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_engine_decimal.test new file mode 100644 index 00000000000..fc07085df5b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_engine_decimal.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.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, + temperature DECIMAL(6, 3) +) ENGINE InnoDB DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, temperature) VALUES ("clear day", 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); +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/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 new file mode 100644 index 00000000000..fb52105411d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test @@ -0,0 +1,39 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +CREATE TABLE memos ( + content varchar(32) +) DEFAULT CHARSET="utf8"; + +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; + +SELECT * FROM memos WHERE MATCH(content) AGAINST("groonga"); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3bcd1259236 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +CREATE TABLE memos ( + id INT PRIMARY KEY AUTO_INCREMENT, + content TEXT +) DEFAULT CHARSET="utf8"; + +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; + +SELECT * FROM memos WHERE MATCH(content) AGAINST("groonga"); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..efd0d9928d2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test @@ -0,0 +1,47 @@ +# Copyright(C) 2014 HAYASHI Kentaro +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS tags; +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags VARCHAR(40) COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO tags (name) VALUES ("Groonga"); +INSERT INTO bugs (id, tags) VALUES (1, "Groonga Mroonga"); + +SELECT * FROM bugs; + +ALTER TABLE bugs ADD FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'; + +SELECT * FROM bugs + WHERE MATCH(tags) AGAINST("Groonga"); + +DROP TABLE bugs; +DROP TABLE tags; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ebc30945062 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test @@ -0,0 +1,48 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS tags; +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags VARCHAR(40) COMMENT 'type "tags"', + FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO tags (name) VALUES ("Groonga"); +INSERT INTO bugs (id, tags) VALUES (1, "Groonga Mroonga"); + +ALTER TABLE bugs DROP INDEX bugs_tags_index; +ALTER TABLE bugs + ADD FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'; + +SELECT * FROM bugs + WHERE MATCH(tags) AGAINST("Groonga"); + +DROP TABLE bugs; +DROP TABLE tags; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..710161397d5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test @@ -0,0 +1,42 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) 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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..a810b7457a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test @@ -0,0 +1,42 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) 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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..7dc75e180c1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test @@ -0,0 +1,42 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); +SELECT * FROM diaries; + +ALTER TABLE diaries MODIFY title VARCHAR(100); +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..0c391219426 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test @@ -0,0 +1,51 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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!"); + +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH (body) AGAINST ("+groonga" IN BOOLEAN MODE); + +ALTER TABLE diaries + DROP INDEX body, + ADD FULLTEXT INDEX (body); + +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 new file mode 100644 index 00000000000..20fa7f35463 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test @@ -0,0 +1,49 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries, memos; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT, + 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!"); +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("groonga") AND + MATCH(body) AGAINST("starting"); + +ALTER TABLE diaries RENAME memos; +SELECT * FROM memos; +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/storage/t/alter_table_spatial.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test new file mode 100644 index 00000000000..8a41792bdae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test @@ -0,0 +1,150 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_geometry.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 +); + +INSERT INTO shops (name, location) + VALUES ('nezu-no-taiyaki', + GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) + VALUES ('taiyaki-kataoka', + GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) + VALUES ('soba-taiyaki-ku', + GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) + VALUES ('kuruma', + GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) + VALUES ('hirose-ya', + GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) + VALUES ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) + VALUES ('omede-taiyaki', + GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) + VALUES ('onaga-ya', + GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) + VALUES ('shiro-ya', + GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) + VALUES ('fuji-ya', + GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) + VALUES ('miyoshi', + GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) + VALUES ('juju-ya', + GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) + VALUES ('tatsumi-ya', + GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) + VALUES ('tetsuji', + GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) + VALUES ('gazuma-ya', + GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) + VALUES ('honma-mon', + GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) + VALUES ('naniwa-ya', + GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) + VALUES ('kuro-dai', + GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) + VALUES ('daruma', + GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) + VALUES ('yanagi-ya', + GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) + VALUES ('sharaku', + GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) + VALUES ('takane', + GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) + VALUES ('chiyoda', + GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) + VALUES ('da-ka-po', + GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) + VALUES ('matsushima-ya', + GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) + VALUES ('kazuya', + GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) + VALUES ('furuya-kogane-an', + GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) + VALUES ('hachi-no-ie', + GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) + VALUES ('azuki-chan', + GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) + VALUES ('kuriko-an', + GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) + VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', + GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) + VALUES ('naze-ya', + GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) + VALUES ('sanoki-ya', + GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) + VALUES ('shigeta', + GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) + VALUES ('nishimi-ya', + GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) + VALUES ('hiiragi', + GeomFromText('POINT(139.711517 35.647701)')); + +ALTER TABLE shops ADD SPATIAL KEY location_index (location); + +SELECT id, name, AsText(location) AS location_text FROM shops + WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) + ORDER BY id; + +SHOW CREATE TABLE shops; + +DROP TABLE shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..8ce709b1187 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test @@ -0,0 +1,53 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (c1 int auto_increment, primary key(c1)); +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +insert into t1 values(10); +select c1 from t1 order by c1 desc limit 1; +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +insert into t1 values(6); +select c1 from t1 order by c1 desc limit 1; +insert into t1 values(null); +select c1 from t1 order by c1 desc limit 1; +drop table t1; + +create table t1 (c1 int, c2 int auto_increment, primary key(c1), key idx1(c2)); +insert into t1 values(1, null); +select * from t1 order by c2 desc limit 1; +insert into t1 values(2, null); +select * from t1 order by c2 desc limit 1; +insert into t1 values(3, 10); +select * from t1 order by c2 desc limit 1; +insert into t1 values(4, null); +select * from t1 order by c2 desc limit 1; +insert into t1 values(5, 6); +select * from t1 order by c2 desc limit 1; +insert into t1 values(6, null); +select * from t1 order by c2 desc limit 1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..59727f4abaa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test @@ -0,0 +1,49 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (c1 int auto_increment, primary key(c1)) auto_increment=34129; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +show create table t1; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +insert into t1 values(10); +select c1 from t1 order by c1 desc; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +insert into t1 values(6); +select c1 from t1 order by c1 desc; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +truncate table t1; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +delete from t1; +insert into t1 values(null); +select c1 from t1 order by c1 desc; +rename table t1 to t2; +insert into t2 values(null); +select c1 from t2 order by c1 desc; +show create table t2; +drop table t2; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..83f9f745019 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test @@ -0,0 +1,33 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +create table diaries ( + id int primary key auto_increment, + body text +); +insert into diaries (body) values ("started groonga (long text)"); +select * from diaries; +insert into diaries (body) values ("sleeping... (short text)"); +select * from diaries; +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..57d57347205 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test @@ -0,0 +1,53 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_log_bin.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +show variables like 'log_bin'; + +set binlog_format="STATEMENT"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +set binlog_format="ROW"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +set binlog_format="MIXED"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +--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 new file mode 100644 index 00000000000..8b4c7d6eaf7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + content varchar(256) COLLATE utf8_general_ci, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES ("Je suis un garçon."); + +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("garcon"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..6cebc9ebce9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + content varchar(256) COLLATE utf8_unicode_ci, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES ("Je suis un garçon."); + +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("garcon"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..dacb1cba74f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + content varchar(256) COLLATE utf8_unicode_ci, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。"); + +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("かたかな"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..620d2a9fd56 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test @@ -0,0 +1,34 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED, + INDEX (id) COMMENT 'ID search is required.' +) DEFAULT CHARSET=utf8; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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_comment_normal_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test new file mode 100644 index 00000000000..695ac9cba61 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test @@ -0,0 +1,34 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.' +) DEFAULT CHARSET=utf8; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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_date_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test new file mode 100644 index 00000000000..fc2e58fdcd9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + created_at DATE, + KEY (created_at) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29"); +INSERT INTO diaries (title, created_at) VALUES ("rainy day", "2012-01-30"); +INSERT INTO diaries (title, created_at) VALUES ("cloudy day", "2012-01-31"); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE created_at BETWEEN "2012-01-29" AND "2012-01-30"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..8dae21494db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + created_at DATE +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) VALUES ("clear day", "2012-01-29"); +INSERT INTO diaries (title, created_at) VALUES ("rainy day", "2012-01-30"); +INSERT INTO diaries (title, created_at) VALUES ("cloudy day", "2012-01-31"); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE created_at BETWEEN "2012-01-29" AND "2012-01-30"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b6225075959 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--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 DATE +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE timestamps; + +INSERT INTO timestamps (create_dt) VALUES ("2012-00-01"); +INSERT INTO timestamps (create_dt) VALUES ("2012-01-00"); + +SELECT * FROM timestamps; + +SELECT * FROM timestamps WHERE create_dt = "2012-01-01"; + +DROP TABLE timestamps; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..9c3344cbe98 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.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; +SHOW CREATE TABLE diaries; + +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) + VALUES ('2038-01-20 03:14:08', '2038-01-20 03:14:08'); + +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_32bit_before_unix_epoch.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test new file mode 100644 index 00000000000..61eecbb2ac8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); + +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_32bit_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test new file mode 100644 index 00000000000..7bbfcbe7a3a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); + +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_32bit_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test new file mode 100644 index 00000000000..2cc99562231 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.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; +SHOW CREATE TABLE diaries; + +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_64bit_2038.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test new file mode 100644 index 00000000000..75c757f147a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.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; +SHOW CREATE TABLE diaries; + +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) + VALUES ('2038-01-19 03:14:08', '2038-01-19 03:14:08'); + +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_64bit_before_unix_epoch.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test new file mode 100644 index 00000000000..b2b30462ca9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test @@ -0,0 +1,40 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); + +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_64bit_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test new file mode 100644 index 00000000000..661d145087c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('9999-12-31 23:59:59', '9999-12-31 23:59:59'); + +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_64bit_version_55_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test new file mode 100644 index 00000000000..14a4483a96e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_55_out_of_range.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_version_55.inc +--source ../../include/mroonga/have_mysql.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; +SHOW CREATE TABLE diaries; + +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_64bit_version_56_or_later_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_or_later_out_of_range.test new file mode 100644 index 00000000000..6b90c39a853 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_56_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_version_56_or_later.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; +SHOW CREATE TABLE diaries; + +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 new file mode 100644 index 00000000000..ac10203a576 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test @@ -0,0 +1,47 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fractional_seconds.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(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"); +INSERT INTO diaries (title, created_at) + VALUES ("rainy day", "2012-01-30 01:23:45.333"); +INSERT INTO diaries (title, created_at) + VALUES ("cloudy day", "2012-01-31 08:32:10.5555"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE created_at BETWEEN "2012-01-29 00:00:00.123456" AND + "2012-01-31 00:00:00.999999"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..11a2b783038 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fractional_seconds.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(6) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ("clear day", "2012-01-29 21:51:01.111111"); +INSERT INTO diaries (title, created_at) + VALUES ("rainy day", "2012-01-30 01:23:45.333"); +INSERT INTO diaries (title, created_at) + VALUES ("cloudy day", "2012-01-31 08:32:10.5555"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE created_at BETWEEN "2012-01-29 00:00:00.123456" AND + "2012-01-31 00:00:00.999999"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..07b54bebc9d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_freebsd.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; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('1000-01-01 00:00:00', '1000-01-01 00:00:00'); + +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_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test new file mode 100644 index 00000000000..e1db5043319 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + created_at DATETIME +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, created_at) + VALUES ('NULL', NULL); + +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_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test new file mode 100644 index 00000000000..992249b0fae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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"); +INSERT INTO diaries (title, created_at) + VALUES ("rainy day", "2012-01-30 01:23:45"); +INSERT INTO diaries (title, created_at) + VALUES ("cloudy day", "2012-01-31 08:32:10"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE created_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..bc0b7b2e982 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + 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"); +INSERT INTO diaries (title, created_at) + VALUES ("rainy day", "2012-01-30 01:23:45"); +INSERT INTO diaries (title, created_at) + VALUES ("cloudy day", "2012-01-31 08:32:10"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE created_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..5c39086d452 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--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; +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"); + +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 new file mode 100644 index 00000000000..92636b4d773 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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); +INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE temperature BETWEEN "14.213" AND "17.821"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b314342fdea --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + 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); +INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17.821); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE temperature BETWEEN "14.213" AND "17.821"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ffcf737fde9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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); +INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE temperature BETWEEN "14" AND "17"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..d7df5c3c323 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + 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); +INSERT INTO diaries (title, temperature) VALUES ("cloudy day", 17); + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE temperature BETWEEN "14" AND "17"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..0d96498ee04 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + size ENUM("small", "medium", "large"), + INDEX (size) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart for child", "small"); +INSERT INTO items VALUES ("leadies' coat", "medium"); +INSERT INTO items VALUES ("parka", "large"); +INSERT INTO items VALUES ("hat", "medium"); + +SELECT * FROM items; + +SELECT * FROM items WHERE size = "medium"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3f8b728105c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test @@ -0,0 +1,298 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + size ENUM("size1", + "size2", + "size3", + "size4", + "size5", + "size6", + "size7", + "size8", + "size9", + "size10", + "size11", + "size12", + "size13", + "size14", + "size15", + "size16", + "size17", + "size18", + "size19", + "size20", + "size21", + "size22", + "size23", + "size24", + "size25", + "size26", + "size27", + "size28", + "size29", + "size30", + "size31", + "size32", + "size33", + "size34", + "size35", + "size36", + "size37", + "size38", + "size39", + "size40", + "size41", + "size42", + "size43", + "size44", + "size45", + "size46", + "size47", + "size48", + "size49", + "size50", + "size51", + "size52", + "size53", + "size54", + "size55", + "size56", + "size57", + "size58", + "size59", + "size60", + "size61", + "size62", + "size63", + "size64", + "size65", + "size66", + "size67", + "size68", + "size69", + "size70", + "size71", + "size72", + "size73", + "size74", + "size75", + "size76", + "size77", + "size78", + "size79", + "size80", + "size81", + "size82", + "size83", + "size84", + "size85", + "size86", + "size87", + "size88", + "size89", + "size90", + "size91", + "size92", + "size93", + "size94", + "size95", + "size96", + "size97", + "size98", + "size99", + "size100", + "size101", + "size102", + "size103", + "size104", + "size105", + "size106", + "size107", + "size108", + "size109", + "size110", + "size111", + "size112", + "size113", + "size114", + "size115", + "size116", + "size117", + "size118", + "size119", + "size120", + "size121", + "size122", + "size123", + "size124", + "size125", + "size126", + "size127", + "size128", + "size129", + "size130", + "size131", + "size132", + "size133", + "size134", + "size135", + "size136", + "size137", + "size138", + "size139", + "size140", + "size141", + "size142", + "size143", + "size144", + "size145", + "size146", + "size147", + "size148", + "size149", + "size150", + "size151", + "size152", + "size153", + "size154", + "size155", + "size156", + "size157", + "size158", + "size159", + "size160", + "size161", + "size162", + "size163", + "size164", + "size165", + "size166", + "size167", + "size168", + "size169", + "size170", + "size171", + "size172", + "size173", + "size174", + "size175", + "size176", + "size177", + "size178", + "size179", + "size180", + "size181", + "size182", + "size183", + "size184", + "size185", + "size186", + "size187", + "size188", + "size189", + "size190", + "size191", + "size192", + "size193", + "size194", + "size195", + "size196", + "size197", + "size198", + "size199", + "size200", + "size201", + "size202", + "size203", + "size204", + "size205", + "size206", + "size207", + "size208", + "size209", + "size210", + "size211", + "size212", + "size213", + "size214", + "size215", + "size216", + "size217", + "size218", + "size219", + "size220", + "size221", + "size222", + "size223", + "size224", + "size225", + "size226", + "size227", + "size228", + "size229", + "size230", + "size231", + "size232", + "size233", + "size234", + "size235", + "size236", + "size237", + "size238", + "size239", + "size240", + "size241", + "size242", + "size243", + "size244", + "size245", + "size246", + "size247", + "size248", + "size249", + "size250", + "size251", + "size252", + "size253", + "size254", + "size255", + "size256"), + INDEX (size) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart for child", "size1"); +INSERT INTO items VALUES ("leadies' coat", "size1"); +INSERT INTO items VALUES ("parka", "size256"); +INSERT INTO items VALUES ("hat", "size256"); + +SELECT * FROM items; + +SELECT * FROM items WHERE size = "size1"; + +SELECT * FROM items WHERE size = "size256"; + +DROP TABLE items; + +--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 new file mode 100644 index 00000000000..6efb3920695 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test @@ -0,0 +1,34 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS contents; +--enable_warnings + +CREATE TABLE contents ( + _id INT, + content TEXT NOT NULL, + FULLTEXT INDEX(content) +) DEFAULT CHARSET=utf8; +INSERT INTO contents (content) VALUES ('first'); +INSERT INTO contents (content) VALUES ('second'); +SELECT _id, content FROM contents; + +DROP TABLE contents; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9b2e59615f3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test @@ -0,0 +1,34 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS contents; +--enable_warnings + +--error ER_CANT_CREATE_TABLE +CREATE TABLE contents ( + _i INT, + content TEXT NOT NULL, + FULLTEXT INDEX(content) +) DEFAULT CHARSET=utf8; + +--disable_warnings +DROP TABLE IF EXISTS contents; +--enable_warnings + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..805c744236f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test @@ -0,0 +1,54 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE IF EXISTS mroonga; +--enable_warnings + +CREATE DATABASE mroonga; +USE mroonga; + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"', + FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); + +SELECT mroonga_command("dump"); + +SELECT *, MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE) AS score + FROM bugs + WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE); + +DROP TABLE bugs; +DROP TABLE tags; + +DROP DATABASE mroonga; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..91f204133dd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test @@ -0,0 +1,55 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP DATABASE IF EXISTS mroonga; +--enable_warnings + +CREATE DATABASE mroonga; +USE mroonga; + +CREATE TABLE priorities ( + id INT PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + priority INT COMMENT 'type "priorities"', + INDEX bugs_priority_index (priority) COMMENT 'table "priorities"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, priority) VALUES (1, 10); +INSERT INTO bugs (id, priority) VALUES (2, 3); +INSERT INTO bugs (id, priority) VALUES (3, -2); + +SELECT mroonga_command("dump"); + +SELECT * + FROM bugs + WHERE priority = 3; + +DROP TABLE bugs; +DROP TABLE priorities; + +DROP DATABASE mroonga; + +--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_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test new file mode 100644 index 00000000000..6e89c70c051 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS tags, bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag TEXT COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, tag) VALUES (1, "Linux"); +INSERT INTO bugs (id, tag) VALUES (2, "MySQL"); +INSERT INTO bugs (id, tag) VALUES (3, "groonga"); + +SELECT * FROM bugs; +SELECT * FROM tags; + +DROP TABLE bugs; +DROP TABLE tags; + +--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 new file mode 100644 index 00000000000..059b8bc4bfa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test @@ -0,0 +1,48 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS tags, bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag TEXT COMMENT 'It references to tags.name, type "tags"' +) DEFAULT CHARSET=utf8; + +SHOW FULL COLUMNS FROM bugs LIKE 'tag'; + +INSERT INTO bugs (id, tag) VALUES (1, "Linux"); +INSERT INTO bugs (id, tag) VALUES (2, "MySQL"); +INSERT INTO bugs (id, tag) VALUES (3, "groonga"); + +SELECT * FROM bugs; +SELECT * FROM tags; + +DROP TABLE bugs; +DROP TABLE tags; + +--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_vector_order_by_with_function.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test new file mode 100644 index 00000000000..0d3be3d663d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS tags, bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL Groonga"); +INSERT INTO bugs (id, tags) VALUES (2, "MySQL Mroonga"); +INSERT INTO bugs (id, tags) VALUES (3, "Ruby Rroonga"); + +SELECT * FROM tags ORDER BY SUBSTRING(name, 1, 1) ASC; + +DROP TABLE bugs; +DROP TABLE tags; + +--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_vector_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test new file mode 100644 index 00000000000..bb66e35f2d1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS tags, bugs; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); + +SELECT * FROM bugs; +SELECT * FROM tags; + +DROP TABLE bugs; +DROP TABLE tags; + +--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_int_with_index_zero_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test new file mode 100644 index 00000000000..aa33af05df3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price INT KEY +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("hamburger", 200); +INSERT INTO items VALUES ("smile", 0); +INSERT INTO items VALUES ("coke", 100); + +SELECT * FROM items; + +SELECT * FROM items WHERE price = 0; + +SELECT * FROM items WHERE price <= 100; + +DROP TABLE items; + +--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 new file mode 100644 index 00000000000..9d7d40433d0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + colors SET("black", + "dim gray", + "dark gray", + "gray", + "light gray", + "gainsboro", + "white smoke", + "white", + + "red", + "orange red", + "dark orange", + "orange", + "gold", + "yellow", + "chartreuse", + "lawn green"), + INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart", "black,gray"); +INSERT INTO items VALUES ("hat", "white,dark gray"); +INSERT INTO items VALUES ("parka", "chartreuse,orange"); + +SELECT * FROM items; + +SELECT * FROM items WHERE colors = "dark gray,white"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c555c4ced6a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test @@ -0,0 +1,65 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + colors SET("black", + "dim gray", + "dark gray", + "gray", + "light gray", + "gainsboro", + "white smoke", + "white", + + "red", + "orange red", + "dark orange", + "orange", + "gold", + "yellow", + "chartreuse", + "lawn green", + + "green", + "spring green", + "medium spring green", + "cyan", + "deep sky blue", + "blue", + "medium blue", + "dark violet"), + INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart", "black,white"); +INSERT INTO items VALUES ("hat", "white,lawn green"); +INSERT INTO items VALUES ("parka", "gray,medium blue"); + +SELECT * FROM items; + +SELECT * FROM items WHERE colors = "white,lawn green"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0f772522eb6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test @@ -0,0 +1,74 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + colors SET("black", + "dim gray", + "dark gray", + "gray", + "light gray", + "gainsboro", + "white smoke", + "white", + + "red", + "orange red", + "dark orange", + "orange", + "gold", + "yellow", + "chartreuse", + "lawn green", + + "green", + "spring green", + "medium spring green", + "cyan", + "deep sky blue", + "blue", + "medium blue", + "dark violet", + + "dark magenta", + "magenta", + "dark red", + "brown", + "firebrick", + "indian red", + "light coral", + "salmon"), + INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart", "black,white"); +INSERT INTO items VALUES ("hat", "white,dark violet"); +INSERT INTO items VALUES ("parka", "green,brown,red"); + +SELECT * FROM items; + +SELECT * FROM items WHERE colors = "white,dark violet"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6552c5da805 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test @@ -0,0 +1,110 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + colors SET("black", + "dim gray", + "dark gray", + "gray", + "light gray", + "gainsboro", + "white smoke", + "white", + + "red", + "orange red", + "dark orange", + "orange", + "gold", + "yellow", + "chartreuse", + "lawn green", + + "green", + "spring green", + "medium spring green", + "cyan", + "deep sky blue", + "blue", + "medium blue", + "dark violet", + + "dark magenta", + "magenta", + "dark red", + "brown", + "firebrick", + "indian red", + "light coral", + "salmon", + + "light salmon", + "tomato", + "coral", + "dark salmon", + "rosy brown", + "sienna", + "saddle brown", + "chocolate", + + "peru", + "sandy brown", + "burlywood", + "tan", + "navajo white", + "wheat", + "dark goldenrod", + "goldenrod", + + "light goldenrod", + "pale goldenrod", + "cornsilk", + "dark khaki", + "khaki", + "lemon chiffon", + "dark olive green", + "olive drab", + + "yellow green", + "green yellow", + "light green", + "forest green", + "dark green", + "lime green", + "pale green", + "dark sea green"), + INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart", "black,white,lawn green,dark violet"); +INSERT INTO items VALUES ("hat", "white,dark violet,yellow green"); +INSERT INTO items VALUES ("parka", "green,brown,red,lime green"); + +SELECT * FROM items; + +SELECT * FROM items WHERE colors = "white,dark violet,yellow green"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bd92f23deb0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test @@ -0,0 +1,47 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + colors SET("black", + "dim gray", + "dark gray", + "gray", + "light gray", + "gainsboro", + "white smoke", + "white"), + INDEX (colors) +) DEFAULT CHARSET=utf8; +SHOW CREATE TABLE items; + +INSERT INTO items VALUES ("t-shart", "black,gray"); +INSERT INTO items VALUES ("hat", "dim gray,dark gray"); +INSERT INTO items VALUES ("parka", "white smoke,light gray"); + +SELECT * FROM items; + +SELECT * FROM items WHERE colors = "dim gray,dark gray"; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c8bd7df0a15 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price BIGINT KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("house", 9223372036854775807); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -9223372036854775808); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("super car", 2147483648); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 2147483648; + +SELECT * FROM items WHERE price > 2147483647; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..572f46ebbb5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price INT KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("car", 2147483647); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -2147483647); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 16777216); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 16777216; + +SELECT * FROM items WHERE price > 16777215; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f43395cb0aa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price MEDIUMINT KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("car", 8388607); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -8388608); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 32768); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 127; + +SELECT * FROM items WHERE price >= 32768; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4ddd446dc46 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price SMALLINT KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", -32768); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("tablet PC", 20000); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 127; + +SELECT * FROM items WHERE price >= 128; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e2bca9328a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price TINYINT KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("hamburger", 120); +INSERT INTO items VALUES ("discount", -10); +INSERT INTO items VALUES ("coke", 100); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 100; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2a920d7e387 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test @@ -0,0 +1,50 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_fractional_seconds.inc + +--disable_warnings +DROP TABLE IF EXISTS running_records; +--enable_warnings + +CREATE TABLE running_records ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + average TIME(6), + 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"); +INSERT INTO running_records (title, average, max) + VALUES ("bad condition", "12:23:34.123456", "838:59:58.999999"); +INSERT INTO running_records (title, average, max) + VALUES ("record failure", "-838:59:59.000000", "-838:59:59.000000"); + +SELECT * FROM running_records; + +SELECT * FROM running_records + WHERE average BETWEEN "00:59:59.999999" AND "100:10:10.101010"; + +SELECT * FROM running_records + WHERE average BETWEEN "-838:59:59.000000" AND "01:00:00.000001"; + +DROP TABLE running_records; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f5961825259 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS running_records; +--enable_warnings + +CREATE TABLE running_records ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + average TIME, + 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"); +INSERT INTO running_records (title, average, max) + VALUES ("bad condition", "12:23:34", "838:59:59"); +INSERT INTO running_records (title, average, max) + VALUES ("record failure", "-838:59:59", "-838:59:59"); + +SELECT * FROM running_records; + +SELECT * FROM running_records + WHERE average BETWEEN "00:59:59" AND "100:10:10"; + +SELECT * FROM running_records + WHERE average BETWEEN "-838:59:59" AND "01:00:00"; + +DROP TABLE running_records; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..6f5e0116eb7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_mariadb_55.inc +--source ../../include/mroonga/have_fractional_seconds.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 TIMESTAMP(6), + 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", + "2012-01-29 21:51:01.111111", + "2012-01-29 21:51:02.222222"); +INSERT INTO diaries (title, created_at, updated_at) + VALUES ("rainy day", + "2012-01-30 01:23:45.333", + "2012-01-30 01:23:46.444"); +INSERT INTO diaries (title, created_at, updated_at) + VALUES ("cloudy day", + "2012-01-31 08:32:10.5555", + "2012-01-31 08:32:11.6666"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE updated_at BETWEEN "2012-01-29 00:00:00.123456" AND + "2012-01-31 00:00:00.999999"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ae78befc466 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + created_at TIMESTAMP, + updated_at TIMESTAMP, + 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"); +INSERT INTO diaries (title, created_at, updated_at) + VALUES ("rainy day", "2012-01-30 01:23:45", "2012-01-30 01:23:46"); +INSERT INTO diaries (title, created_at, updated_at) + VALUES ("cloudy day", "2012-01-31 08:32:10", "2012-01-31 08:32:11"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE updated_at BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c658c873e02 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test @@ -0,0 +1,35 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists books; +--enable_warnings + +create table books(title varchar(255), published tinyint); +insert into books values ("MySQL", 1); +insert into books values ("groonga", 1); +insert into books values ("mroonga", 0); + +select count(*) from books where published = 0; +select count(*) from books where published = 1; +select count(*) from books where published != 2; +select count(*) from books where published != 1; + +drop table books; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..1936842707c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price BIGINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("house", 18446744073709551615); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("super car", 9223372036854775808); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 9223372036854775808; + +SELECT * FROM items WHERE price > 9223372036854775807; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8ac9715ad76 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id BIGINT UNSIGNED +) DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES (317173755057152000); +INSERT INTO ids VALUES (317173755057152002); + +SELECT * FROM ids; + +SELECT * FROM ids WHERE id = 317173755057152000; + +SELECT * FROM ids WHERE id = 317173755057152002; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a97024b48d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price INT UNSIGNED KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("car", 4294967295); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 2147483648); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 2147483648; + +SELECT * FROM items WHERE price > 2147483647; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bec5917b410 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price MEDIUMINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("car", 16777215); +INSERT INTO items VALUES ("note PC", 32767); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("bike", 8388607); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 8388608; + +SELECT * FROM items WHERE price >= 8388607; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8e389b98881 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price SMALLINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("note PC", 65535); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); +INSERT INTO items VALUES ("tablet PC", 32767); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 32768; + +SELECT * FROM items WHERE price >= 32767; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..880bc2d7cd8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS items; +--enable_warnings + +CREATE TABLE items ( + name VARCHAR(255), + price TINYINT UNSIGNED KEY +) DEFAULT CHARSET=utf8; + +INSERT INTO items VALUES ("hamburger", 255); +INSERT INTO items VALUES ("discount", 0); +INSERT INTO items VALUES ("coke", 100); + +SELECT * FROM items; + +SELECT * FROM items WHERE price <= 100; + +DROP TABLE items; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a61dccc6439 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test @@ -0,0 +1,47 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS aniversary_memos; +--enable_warnings + +CREATE TABLE aniversary_memos ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Invitations are sent.", "2012"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Tommorow is the anniversary party day!", "2012"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Wow! Today is the anniversary party day!", "13"); + +SELECT * FROM aniversary_memos; + +SELECT * FROM aniversary_memos + WHERE party_year BETWEEN "12" AND "2013"; + +DROP TABLE aniversary_memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ce1e1c21921 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS aniversary_memos; +--enable_warnings + +CREATE TABLE aniversary_memos ( + id INT PRIMARY KEY AUTO_INCREMENT, + 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"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Invitations are sent.", "2012"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Tommorow is the anniversary party day!", "2012"); +INSERT INTO aniversary_memos (title, party_year) + VALUES ("Wow! Today is the anniversary party day!", "13"); + +SELECT * FROM aniversary_memos; + +SELECT * FROM aniversary_memos + WHERE party_year BETWEEN "12" AND "2013"; + +DROP TABLE aniversary_memos; + +--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 new file mode 100644 index 00000000000..b731acda9c9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test @@ -0,0 +1,60 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP DATABASE IF EXISTS `master/production`; +DROP DATABASE IF EXISTS `master/development`; +--enable_warnings + +CREATE DATABASE `master/production`; +USE `master/production`; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT +) DEFAULT CHARSET=UTF8; + +INSERT INTO diaries (title) VALUES ("clear day (production)"); +INSERT INTO diaries (title) VALUES ("rainy day (production)"); +INSERT INTO diaries (title) VALUES ("cloudy day (production)"); + +SELECT * FROM diaries; + + +CREATE DATABASE `master/development`; +USE `master/development`; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT +) DEFAULT CHARSET=UTF8; + +INSERT INTO diaries (title) VALUES ("clear day (development)"); +INSERT INTO diaries (title) VALUES ("rainy day (development)"); +INSERT INTO diaries (title) VALUES ("cloudy day (development)"); + +SELECT * FROM diaries; + + +USE test; + +DROP DATABASE `master/production`; +DROP DATABASE `master/development`; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e448a66956f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test @@ -0,0 +1,147 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +# simple test +create table t1 (c1 int); +create table t2 (c1 int); +create table t3 (c1 int); +drop table t1,t2,t3; +create table t1 (c1 int, c2 int, c3 int); +create table t2 (c1 int primary key, c2 int, c3 int); +drop table t1,t2; + +# data type support +create table t1 (c1 bit); +desc t1; +drop table t1; +create table t1 (c1 tinyint); +desc t1; +drop table t1; +create table t1 (c1 smallint); +desc t1; +drop table t1; +create table t1 (c1 mediumint); +desc t1; +drop table t1; +create table t1 (c1 int); +desc t1; +drop table t1; +create table t1 (c1 bigint); +desc t1; +drop table t1; +create table t1 (c1 double); +desc t1; +drop table t1; +create table t1 (c1 float); +desc t1; +drop table t1; +create table t1 (c1 decimal); +desc t1; +drop table t1; +create table t1 (c1 date); +desc t1; +drop table t1; +create table t1 (c1 time); +desc t1; +drop table t1; +create table t1 (c1 timestamp); +desc t1; +drop table t1; +create table t1 (c1 datetime); +desc t1; +drop table t1; +create table t1 (c1 year); +desc t1; +drop table t1; +create table t1 (c1 char(10)); +desc t1; +drop table t1; +create table t1 (c1 varchar(10)); +desc t1; +drop table t1; +create table t1 (c1 binary(10)); +desc t1; +drop table t1; +create table t1 (c1 varbinary(10)); +desc t1; +drop table t1; +create table t1 (c1 tinyblob); +desc t1; +drop table t1; +create table t1 (c1 blob); +desc t1; +drop table t1; +create table t1 (c1 mediumblob); +desc t1; +drop table t1; +create table t1 (c1 longblob); +desc t1; +drop table t1; +create table t1 (c1 tinytext); +desc t1; +drop table t1; +create table t1 (c1 text); +desc t1; +drop table t1; +create table t1 (c1 mediumtext); +desc t1; +drop table t1; +create table t1 (c1 longtext); +desc t1; +drop table t1; +create table t1 (c1 enum("yes","no")); +desc t1; +drop table t1; +create table t1 (c1 set("A","B","AB","O")); +desc t1; +drop table t1; + +# virtual columns +create table t1 (c1 int, `_id` int) engine = mroonga; +desc t1; +drop table t1; + +# error +--error ER_CANT_CREATE_TABLE +create table t1 (c1 int, `_score` float) engine = mroonga; + +# checking for virtual columns +--error ER_CANT_CREATE_TABLE +create table t1 (c1 int, `_id` text) engine = mroonga; +--error ER_CANT_CREATE_TABLE +create table t1 (c1 int, `_id` int, index(`_id`)) engine = mroonga; + +# index for _id +--error ER_CANT_CREATE_TABLE +create table t1 (_id int, c1 int, primary key (_id)); +create table t1 (_id int, c1 int, primary key (_id) using hash); +drop table t1; +--error ER_CANT_CREATE_TABLE +create table t1 (_id int, c1 int, unique key (_id)); +create table t1 (_id int, c1 int, unique key (_id) using hash); +drop table t1; +--error ER_CANT_CREATE_TABLE +create table t1 (_id int, c1 int, key (_id)); +create table t1 (_id int, c1 int, key (_id) using hash); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..272485d3453 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test @@ -0,0 +1,34 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED +) DEFAULT CHARSET=utf8 + COMMENT='Free style normal comment'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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_default_tokenizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test new file mode 100644 index 00000000000..ee1afdfe4f6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test @@ -0,0 +1,36 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS tags; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +SELECT mroonga_command("dump"); + +DROP TABLE tags; + +--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_normalizer_fulltext_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_fulltext_index.test new file mode 100644 index 00000000000..02e2cb9e81a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_fulltext_index.test @@ -0,0 +1,42 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE diaries ( + day DATE PRIMARY KEY, + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +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_normalizer_no_utf8_charset_with_utf8_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.test new file mode 100644 index 00000000000..f28fb5b8695 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_no_utf8_charset_with_utf8_normalizer.test @@ -0,0 +1,40 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES latin1; + +CREATE TABLE diaries ( + day DATE PRIMARY KEY, + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerMySQLGeneralCI"' +) DEFAULT CHARSET=latin1; + +--error ER_ERROR_ON_WRITE +INSERT INTO diaries VALUES ("2013-04-23", "I drunk a black cookie."); + +SELECT * FROM diaries; + +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_reference_type.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test new file mode 100644 index 00000000000..eb1095e75a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test @@ -0,0 +1,42 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64) COMMENT 'type "tags"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump"); + +DROP TABLE bugs; +DROP TABLE tags; + +--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_vector.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test new file mode 100644 index 00000000000..440619c33c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags TEXT COMMENT 'flags "COLUMN_VECTOR"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump"); + +DROP TABLE bugs; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a43f5c6511b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test @@ -0,0 +1,36 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 text, fulltext index (c2)); +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); + +select * from t1; +select * from t1 where match(c2) against("ki"); +delete from t1 where c1=20; +select * from t1; +select * from t1 where match(c2) against("ki"); + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..224929fe308 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE ids ( + id INT, + KEY (id) +) DEFAULT CHARSET UTF8; + +INSERT INTO ids VALUES(1); +INSERT INTO ids VALUES(2); +INSERT INTO ids VALUES(3); + +SELECT * FROM ids ORDER BY id; + +DELETE FROM ids WHERE id = 1; +SELECT * FROM ids ORDER BY id; + +DELETE FROM ids WHERE id = 2; +SELECT * FROM ids ORDER BY id; + +DELETE FROM ids WHERE id = 3; +SELECT * FROM ids ORDER BY id; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a23ca3bae5c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, c1 int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +delete from t1 where _id = 2; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..559b3a15be6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, c1 int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +delete from t1 where _id = 2; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2f94a8242d3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test @@ -0,0 +1,44 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int, c2 int); +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +insert into t1 values (4, 102); +select * from t1; + +delete from t1 where c1=3; +select * from t1; + +flush tables; + +delete from t1 where c1=2; +select * from t1; + +delete from t1; +select * from t1; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e174710934b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS numbers; +--enable_warnings + +CREATE TABLE numbers ( + data BIGINT UNSIGNED +); + +INSERT INTO numbers VALUES(18446744073709551615); + +SELECT * FROM numbers ORDER BY data; + +DELETE FROM numbers WHERE data = 18446744073709551615; +SELECT * FROM numbers ORDER BY data; + +DROP TABLE numbers; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..74f840944f9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test @@ -0,0 +1,40 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop database if exists groonga; +--enable_warnings + +create database groonga; +drop database groonga; + +create database groonga; +use groonga; +create table t1 (c1 int primary key, c2 varchar(255)) default charset utf8; +create table t2 (c1 int primary key, c2 varchar(255)) default charset utf8; +drop database groonga; + +create database groonga; +use groonga; +create table t1 (c1 int primary key, c2 varchar(255)) default charset utf8; +create table t2 (c1 int primary key, c2 varchar(255)) default charset utf8; +drop table t1, t2; +drop database groonga; + +--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 new file mode 100644 index 00000000000..a057f328453 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test @@ -0,0 +1,29 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists alphabet, `with-hyphen`; +--enable_warnings + +create table alphabet (c1 int primary key, c2 int, c3 int); +drop table alphabet; + +create table `with-hyphen` (c1 int primary key, c2 int, c3 int); +drop table `with-hyphen`; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..964217ae713 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test @@ -0,0 +1,21 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +flush logs; + +--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 new file mode 100644 index 00000000000..0ab06083b7d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test @@ -0,0 +1,118 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_56.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($mariadb) +{ + skip This test is for MySQL version 5.6.x; +} + +--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; +--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 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; + +select content, comment from articles; + +drop table articles2; +drop table articles; +drop table comments2; +drop table comments; + +--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 new file mode 100644 index 00000000000..75f1c3c38ed --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test @@ -0,0 +1,41 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT * + FROM diaries + WHERE MATCH(title) AGAINST("" 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_escape.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test new file mode 100644 index 00000000000..1a27422aa81 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +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("\\(groonga\\)*" IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..952749338ac --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + title VARCHAR(255), + content TEXT, + 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, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT * FROM diaries WHERE MATCH(content) AGAINST("-明日 +天気" 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_default_operator_minus_no_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test new file mode 100644 index 00000000000..89adbd4b5f7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- fine is be" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..76a72a5b865 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- is OR be fine" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e2edfe780b3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Yesterday was good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- good +day be" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4d0f15b203a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test @@ -0,0 +1,41 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today good" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ed93b543869 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test @@ -0,0 +1,41 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today -good tomorrow" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3a078c7eccb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test @@ -0,0 +1,41 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); +INSERT INTO memos VALUES ("Tomorrow will be fine."); +INSERT INTO memos VALUES ("Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today +good tomorrow" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..fb2ec74a5e0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today good" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..30cf3e87491 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today -good is" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..7268cc1921c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011-2013 Kouhei Sutou +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES ("Today is good day."); +INSERT INTO memos VALUES ("Tomorrow will be good day."); +INSERT INTO memos VALUES ("Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today OR tomorrow day" IN BOOLEAN MODE); + +DROP TABLE memos; + +--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 new file mode 100644 index 00000000000..bec7944a82b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id 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("*W1:10,2:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1:10,2:2 +天気" 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_weight_no_weight.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test new file mode 100644 index 00000000000..fa10ae7b73b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id 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("*W1,2:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1,2:2 +天気" 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_weight_omit_section.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test new file mode 100644 index 00000000000..d7f1bde6ca4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id 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("*W1:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1:2 +天気" 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_weight_ten_or_more_sections.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test new file mode 100644 index 00000000000..6df0c13f111 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test @@ -0,0 +1,63 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + title VARCHAR(255), + tag1 VARCHAR(10), + tag2 VARCHAR(10), + tag3 VARCHAR(10), + tag4 VARCHAR(10), + tag5 VARCHAR(10), + tag6 VARCHAR(10), + tag7 VARCHAR(10), + tag8 VARCHAR(10), + tag9 VARCHAR(10), + tag10 VARCHAR(10), + FULLTEXT INDEX (tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos + VALUES("Groonga", + "tag 1", + "tag 2", + "tag 3", + "tag 4", + "tag 5", + "tag 6", + "tag 7", + "tag 8", + "tag 9", + "tag 10"); + +SELECT title, + MATCH(tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) + AGAINST("*W1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20 +tag" + in BOOLEAN MODE) AS score + FROM memos + WHERE MATCH(tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10) + AGAINST("*W1:2,2:4,3:6,4:8,5:10,6:12,7:14,8:16,9:18,10:20 +tag" + in BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9161ff6ff0d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + title VARCHAR(255), + category VARCHAR(10), + content TEXT, + FULLTEXT INDEX (title, category, content) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES(1, "Hello", "日記", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気予報", "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "天気", "今日も天気がよくてきれいに見える。"); + +SELECT *, MATCH(title, category, content) + AGAINST("*W1:2,2:10,3:1 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, category, content) + AGAINST("*W1:2,2:10,3:1 +天気" 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_syntax_error_error.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test new file mode 100644 index 00000000000..f8d5e3fe6be --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = ERROR; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +INSERT INTO memos VALUES(1, "(groonga) Installed!"); +INSERT INTO memos VALUES(2, "(mroonga) Installed!"); +INSERT INTO memos VALUES(3, "(groonga) Upgraded!"); + +-- error ER_PARSE_ERROR +SELECT * FROM memos + WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..1c0795bca58 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = ERROR_AND_LOG; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +INSERT INTO memos VALUES(1, "(groonga) Installed!"); +INSERT INTO memos VALUES(2, "(mroonga) Installed!"); +INSERT INTO memos VALUES(3, "(groonga) Upgraded!"); + +-- error ER_PARSE_ERROR +SELECT * FROM memos + WHERE MATCH(content) AGAINST("(groonga" IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..fef386cc42d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = "IGNORE"; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +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("(groonga" IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..ac51f81a43a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET GLOBAL mroonga_default_parser = TokenDelimit; +SET mroonga_action_on_fulltext_query_error = IGNORE_AND_LOG; + +SET NAMES UTF8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=UTF8; + +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("(groonga" IN BOOLEAN MODE); + +DROP TABLE memos; + +SET GLOBAL mroonga_default_parser = 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 new file mode 100644 index 00000000000..42ef563105d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test @@ -0,0 +1,36 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, c3 text, 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"); +select * from t1; +select * from t1 where match(c3) against("su"); +select * from t1 where match(c3) against("ii"); +select * from t1 where match(c3) against("+su" in boolean mode); +select * from t1 where match(c3) against("+ii" in boolean mode); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..7396a66ecc0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test @@ -0,0 +1,34 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_cp932.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932; +insert into t1 values(1, "̕xmR̓VCɂ‚",""); +insert into t1 values(2, "","̕xmR̓VC͕܂"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("xmR"); +select * from t1 where match(c3) against("xmR"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2d8b094c43d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test @@ -0,0 +1,34 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_eucjpms.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms; +insert into t1 values(1, "ٻλŷˤĤ",""); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("ٻλ"); +select * from t1 where match(c3) against("ٻλ"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4b6ca756a29 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("富士山"); +select * from t1 where match(c3) against("富士山"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d870affba4f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8mb4; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + 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; + +INSERT INTO diaries VALUES(1, "Alphabet", "ABCDE"); +INSERT INTO diaries VALUES(2, "Mathmatics", "𝐀𝐁𝐂𝐃𝐄 | U+1D400-U+1D405"); +INSERT INTO diaries VALUES(3, "ひらがな", "あいうえお"); + +SELECT * + FROM diaries + WHERE MATCH (content) AGAINST("ABCDE" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..59a274f942c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test @@ -0,0 +1,41 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT * + FROM diaries + WHERE MATCH(title) AGAINST(""); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4d899201fb3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test @@ -0,0 +1,49 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT SQL_CALC_FOUND_ROWS * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; + +SELECT FOUND_ROWS(); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..19f82f644a6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test @@ -0,0 +1,47 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS bugs, tags; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(64) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COLLATE=utf8_bin + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tags VARCHAR(40) COMMENT 'type "tags", flags "COLUMN_VECTOR"', + FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' +) DEFAULT CHARSET=utf8; + +INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL"); +INSERT INTO bugs (id, tags) VALUES (2, "MySQL groonga"); +INSERT INTO bugs (id, tags) VALUES (3, "mroonga"); + +SELECT * + FROM bugs + WHERE MATCH (tags) AGAINST ("MySQL" IN BOOLEAN MODE); + +DROP TABLE bugs, tags; + +--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_index_recreate.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test new file mode 100644 index 00000000000..a8d4780fee3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + title varchar(255), + 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, "富士山", "今日もきれい。"); +select * from diaries where match(title) against("富士山"); +drop index title on diaries; +--error ER_FT_MATCHING_KEY_NOT_FOUND +select * from diaries where match(title) against("富士山"); +select * from diaries; +create fulltext index new_title_index on diaries (title); +select * from diaries where match(title) against("富士山"); +select * from diaries; +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..641bbc3c4bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test @@ -0,0 +1,45 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +select * from t2; +select * from t1 where c1=3; +select * from t2 where c1=3; +select * from t1 where c1>3 order by c1 desc; +select * from t2 where c1>3 order by c1 asc; +select * from t1 where c2>"s" order by c2 desc; +select * from t2 where c2>"s" order by c1 asc; +select * from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +select * from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +select c1,c2,match(c2) against("ii") from t2 where match(c2) against("ii"); +drop table t1,t2; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0b52448bc45 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists 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"); +select * from t1; +flush tables; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..9c083f57a80 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + title varchar(255), + content text, + fulltext index (title, content), + 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, "富士山", "今日もきれい。"); +delete from diaries where id = 2; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ce2c2714e31 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + title varchar(255), + content text, + fulltext index (title, content), + 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, "富士山", "今日もきれい。"); +select * from diaries; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ffee108932a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test @@ -0,0 +1,50 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + title varchar(255), + content text, + fulltext index (title, content), + 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, "富士山", "今日もきれい。"); +select * from diaries where match(title, content) against("富士山"); + +drop index title on diaries; +--error ER_FT_MATCHING_KEY_NOT_FOUND +select * from diaries where match(title, content) against("富士山"); + +create fulltext index new_title_content_index on diaries (title, content); +select * from diaries where match(title, content) against("富士山"); + +select * from diaries; + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..e9e6aa2bb6e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + title varchar(255), + content text, + fulltext index (title, content), + 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, "富士山", "今日もきれい。"); +update diaries set title = "チョモランマ" where id = 3; +update diaries set content = "チョモランマと富士山" where id = 1; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..19fd4f8d3ba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test @@ -0,0 +1,47 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +create table diaries ( + id int primary key auto_increment, + title text, + body text, + 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..."); +insert into diaries (title, body) values ("groonga (2)", "started groonga."); + +select * from diaries + where match(title) against("survey") and + match(body) against("groonga"); + +select *, match(title) against("survey"), match(body) against("groonga") + from diaries + where match(title) against("survey") and + match(body) against("groonga"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..7ef05efa3a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries VALUES("Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES("天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES("富士山", "今日も天気がよくてきれいに見える。"); + +SELECT * FROM diaries WHERE MATCH(content) AGAINST("*D+ 今日 天気" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..7b4e62ba0a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test @@ -0,0 +1,46 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +# for "not match against" +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)); +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +select * from t1 where match(c3) against("uu"); +select * from t1 where not match(c3) against("uu"); +select * from t1 where match(c3) against("dummy"); +select * from t1 where not match(c3) against("dummy"); +select * from t1 where c1 = 4 and not match(c3) against("uu"); +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +select * from t1 where c1 > 4 and not match(c3) against("uu"); +select * from t1 where c2 = 10 and not match(c3) against("uu"); +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +select * from t1 where c2 < 15 and not match(c3) against("uu"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2b0f3bbb15c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT * + FROM diaries + WHERE MATCH(title) AGAINST("Ruby" IN BOOLEAN MODE) OR + MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_against.test new file mode 100644 index 00000000000..f2859f99dba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_against.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga mroonga" IN BOOLEAN MODE) + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_match.test new file mode 100644 index 00000000000..dc97db87487 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_different_match.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + body TEXT, + FULLTEXT KEY (title), + FULLTEXT KEY (body) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga", "I read groonga's tutorial."); +INSERT INTO diaries VALUES("Start mroonga", "I read mroonga's tutorial."); +INSERT INTO diaries VALUES("Start groonga and Ruby", "I installed rroonga."); + +SELECT * FROM diaries; + +SELECT *, MATCH(body) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) + ORDER BY MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_no_where.test new file mode 100644 index 00000000000..50dd652e2d0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_no_where.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_same_match_against.test new file mode 100644 index 00000000000..0873849a1e7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_same_match_against.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_comment.test new file mode 100644 index 00000000000..24cc173485a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_comment.test @@ -0,0 +1,38 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fulltext_index_comment.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, + body text, + 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..."); +insert into diaries (body) values ("started groonga."); +select * from diaries; +select * from diaries where match(body) against("start"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_default.test new file mode 100644 index 00000000000..1e08cc46221 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_default.test @@ -0,0 +1,41 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set @mroonga_default_parser_backup=@@mroonga_default_parser; +set global mroonga_default_parser=TokenBigramSplitSymbolAlphaDigit; +create table diaries ( + id int primary key auto_increment, + 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."); +insert into diaries (body) values ("finished groonga."); +select * from diaries; +select * from diaries where match(body) against("start"); +drop table diaries; +set global mroonga_default_parser=@mroonga_default_parser_backup; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_off.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_off.test new file mode 100644 index 00000000000..0dcf494c684 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_parser_off.test @@ -0,0 +1,48 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fulltext_index_comment.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS variables; +--enable_warnings + +CREATE TABLE variables ( + id INT PRIMARY KEY AUTO_INCREMENT, + 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"); +INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine"); +INSERT INTO variables (name) VALUES ("mroonga_dry_write"); +INSERT INTO variables (name) VALUES ("mroonga_enable_optimization"); +INSERT INTO variables (name) VALUES ("mroonga_libgroonga_version"); +INSERT INTO variables (name) VALUES ("mroonga_log_file"); +INSERT INTO variables (name) VALUES ("mroonga_log_level"); +INSERT INTO variables (name) VALUES ("mroonga_match_escalation_threshold"); +INSERT INTO variables (name) VALUES ("mroonga_version"); + +SELECT * FROM variables; +SELECT * FROM variables + WHERE MATCH (name) AGAINST ("mroonga_default*" IN BOOLEAN MODE); + +DROP TABLE variables; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..745720d1fe6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test @@ -0,0 +1,69 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users, posts, comments; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE users ( + id int NOT NULL, + name varchar(50) NOT NULL, + PRIMARY KEY (id), + KEY (name) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE posts ( + id int NOT NULL, + content mediumtext, + user_id int NOT NULL, + PRIMARY KEY (id), + FULLTEXT KEY (content) +) DEFAULT CHARSET=utf8; + +CREATE TABLE comments ( + id int NOT NULL, + user_id int NOT NULL, + post_id int NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES (1, "Alice"), + (2, "Bob"), + (3, "Calros"); +INSERT INTO posts VALUES (1, "Hello!", 1), + (2, "World!", 2), + (3, "Great!", 3); +INSERT INTO comments VALUES (1, 1, 1), + (2, 2, 1), + (3, 3, 3); + +SELECT * + FROM comments + INNER JOIN posts + ON posts.id = comments.post_id AND + MATCH (posts.content) AGAINST ("Hello!" IN BOOLEAN MODE) + INNER JOIN users + ON users.id = comments.user_id AND + users.name = "Alice"; + +DROP TABLE users, posts, comments; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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_100_no_such_key.test new file mode 100644 index 00000000000..aab09c18b79 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_100_no_such_key.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_100.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, + body TEXT, + 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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +-- error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * FROM diaries FORCE INDEX(primary) + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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_55_no_such_key.test new file mode 100644 index 00000000000..d447b1f85dc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_55_no_such_key.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_55.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, + body TEXT, + 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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries FORCE INDEX(primary) + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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_56_no_such_key.test new file mode 100644 index 00000000000..1187b189244 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_56_no_such_key.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_56.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, + body TEXT, + 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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +-- error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * FROM diaries FORCE INDEX(primary) + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..f1a1777d92b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test @@ -0,0 +1,41 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT mroonga_command('select diaries --match_columns "title" --query "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_escape_error_query_is_missing.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test new file mode 100644 index 00000000000..a37e601e92d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test @@ -0,0 +1,27 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +-- error ER_CANT_INITIALIZE_UDF +SELECT mroonga_escape() 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_error_query_is_not_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test new file mode 100644 index 00000000000..683efb7e25c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test @@ -0,0 +1,27 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +-- error ER_CANT_INITIALIZE_UDF +SELECT mroonga_escape(29) 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_error_target_characters_is_not_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test new file mode 100644 index 00000000000..5e04ae2a615 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test @@ -0,0 +1,27 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +-- error ER_CANT_INITIALIZE_UDF +SELECT mroonga_escape('+-><~*()\"\\:', 29) 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_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test new file mode 100644 index 00000000000..6d328fa8434 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_all.test @@ -0,0 +1,26 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +SELECT mroonga_escape('+-><~*()\"\\:') 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_custom.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test new file mode 100644 index 00000000000..2ad633b43f0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_custom.test @@ -0,0 +1,26 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +SELECT mroonga_escape('+-><~*()\"\\:', '()<>~') 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_success_nested.test new file mode 100644 index 00000000000..82f7410d909 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_success_nested.test @@ -0,0 +1,40 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT mroonga_escape(mroonga_escape('*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_last_insert_grn_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test new file mode 100644 index 00000000000..ef6b0077976 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test @@ -0,0 +1,48 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, c1 int); +select last_insert_grn_id(); +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); +insert into t1 values(null,100); +insert into t1 values(null,100); +select last_insert_grn_id(); + +--error ER_CANT_INITIALIZE_UDF +select last_insert_grn_id(1); + +drop table t1; + +--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_id_reference.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test new file mode 100644 index 00000000000..a515757ab55 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test @@ -0,0 +1,35 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id int AUTO_INCREMENT PRIMARY KEY +); + +SELECT last_insert_id(); + +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +SELECT * FROM ids; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2eb75ac3b60 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id int AUTO_INCREMENT PRIMARY KEY +); + +SELECT last_insert_id(); +SELECT last_insert_id(10); +SELECT last_insert_id(); + +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +SELECT * FROM ids; + +DROP TABLE ids; + +--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 new file mode 100644 index 00000000000..f273a38c13a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012-2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)); +insert into t1 values(1,10,"aa bb cc dd ee >< ff gg hh ii jj kk ll mm nn"); +insert into t1 values(2,20,"nn mm ll kk jj >< ii hh gg ff ee dd cc bb aa"); +insert into t1 values(3,30,"cc dd ee ff gg >< hh ii jj kk ll mm nn oo pp"); +insert into t1 values(4,40,"ee ff gg hh ii >< jj kk ll mm nn oo pp qq rr"); +insert into t1 values(5,50,"AA BB CC DD EE >< FF GG HH II JJ KK LL MM NN"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...
\n', 'bb', '', '', 'ff', '', '', 'dd', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 0, '...', '...\n', 'bb', '(w1)[', ']', 'ff', '(w2)[', ']', 'dd', '(w3)[', ']') from t1; +drop table t1; + +--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_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test new file mode 100644 index 00000000000..eb67245e7c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012-2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_cp932.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932; +insert into t1 values(1, "","QX̕xmR̓VCɂ‚"); +insert into t1 values(2, "","QX̕xmR̓VC͕܂"); +insert into t1 values(3, "","29̕xmR̓VCɂ‚"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...
\n', 'QX', '', '', 'VC', '', '', 'xmR', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 0, '...', '...\n', 'QX', '(w1)[', ']', 'VC', '(w2)[', ']', 'xmR', '(w3)[', ']') from t1; +drop table t1; + +--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_eucjpms.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test new file mode 100644 index 00000000000..8864d6adffc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012-2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_eucjpms.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms; +insert into t1 values(1, "","ٻλŷˤĤ"); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "","29ٻλŷˤĤ"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...
\n', '', '', '', 'ŷ', '', '', 'ٻλ', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 0, '...', '...\n', '', '(w1)[', ']', 'ŷ', '(w2)[', ']', 'ٻλ', '(w3)[', ']') from t1; +drop table t1; + +--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 new file mode 100644 index 00000000000..bf6b4df5871 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test @@ -0,0 +1,28 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--error ER_CANT_INITIALIZE_UDF +SELECT mroonga_snippet("Invalid charset test", 10, 2, "nonexistent_charset", + 1, 0, "...", "...", "charset", "<", ">"); + +--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_unsupported_charset.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test new file mode 100644 index 00000000000..451737c900c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test @@ -0,0 +1,28 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +SET NAMES UTF8; + +--error ER_CANT_INITIALIZE_UDF +SELECT mroonga_snippet("Unsuppported charset test", 10, 2, "big5", + 1, 0, "...", "...", "charset", "<", ">"); + +--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_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test new file mode 100644 index 00000000000..354d5f5a2d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8; +insert into t1 values(1, "あああああ","29日の富士山の天気について"); +insert into t1 values(2, "いいいいい","29日の富士山の天気は分かりません"); +insert into t1 values(3, "ううううう","29日の富士山の天気について"); +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...
\n', '29日', '', '', '天気', '', '', '富士山', '', '') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 0, '...', '...\n', '29日', '(w1)[', ']', '天気', '(w2)[', ']', '富士山', '(w3)[', ']') from t1; +drop table t1; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..39462257f9d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test @@ -0,0 +1,34 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_geometry.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS shops; +--enable_warnings + +CREATE TABLE shops ( + location GEOMETRY NOT NULL +); + +INSERT INTO shops VALUES (NULL), (NULL); + +SELECT AsText(location) FROM shops; + +DROP TABLE shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test new file mode 100644 index 00000000000..c8ec649f181 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test @@ -0,0 +1,148 @@ +# Copyright(C) 2011-2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_geometry.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) +); +SHOW CREATE TABLE shops; + +INSERT INTO shops (name, location) + VALUES ('nezu-no-taiyaki', + GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) + VALUES ('taiyaki-kataoka', + GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) + VALUES ('soba-taiyaki-ku', + GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) + VALUES ('kuruma', + GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) + VALUES ('hirose-ya', + GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) + VALUES ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) + VALUES ('omede-taiyaki', + GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) + VALUES ('onaga-ya', + GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) + VALUES ('shiro-ya', + GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) + VALUES ('fuji-ya', + GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) + VALUES ('miyoshi', + GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) + VALUES ('juju-ya', + GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) + VALUES ('tatsumi-ya', + GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) + VALUES ('tetsuji', + GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) + VALUES ('gazuma-ya', + GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) + VALUES ('honma-mon', + GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) + VALUES ('naniwa-ya', + GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) + VALUES ('kuro-dai', + GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) + VALUES ('daruma', + GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) + VALUES ('yanagi-ya', + GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) + VALUES ('sharaku', + GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) + VALUES ('takane', + GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) + VALUES ('chiyoda', + GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) + VALUES ('da-ka-po', + GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) + VALUES ('matsushima-ya', + GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) + VALUES ('kazuya', + GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) + VALUES ('furuya-kogane-an', + GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) + VALUES ('hachi-no-ie', + GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) + VALUES ('azuki-chan', + GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) + VALUES ('kuriko-an', + GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) + VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', + GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) + VALUES ('naze-ya', + GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) + VALUES ('sanoki-ya', + GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) + VALUES ('shigeta', + GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) + VALUES ('nishimi-ya', + GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) + VALUES ('hiiragi', + GeomFromText('POINT(139.711517 35.647701)')); + +SELECT id, name, AsText(location) AS location_text FROM shops; +SELECT id, name, AsText(location) AS location_text FROM shops + WHERE MBRContains(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 new file mode 100644 index 00000000000..2fd1fa7471c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + created_at datetime, + title varchar(256), + KEY created_at_key(created_at) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES ("1000-01-01 00:00:00", "The start"); +INSERT INTO diaries VALUES ("2012-10-25 16:18:29", "Today is shiny day."); +INSERT INTO diaries VALUES ("9999-12-31 23:59:59", "The end"); + +SELECT * + FROM diaries FORCE INDEX(created_at_key) + WHERE created_at = "2012-10-25 16:18:29"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..51737fcf375 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS timer; +--enable_warnings + +CREATE TABLE timer ( + id int PRIMARY KEY, + elapsed time, + KEY elapsed_key(elapsed) +); + +INSERT INTO timer VALUES (1, "00:00:00"); +INSERT INTO timer VALUES (2, "15:11:12"); +INSERT INTO timer VALUES (3, "838:59:59"); +INSERT INTO timer VALUES (4, "-838:59:59"); + +SELECT * + FROM timer FORCE INDEX(elapsed_key) + WHERE elapsed = "-838:59:59"; + +DROP TABLE timer; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f8848ce196d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE diaries ( + created_at timestamp, + title varchar(256), + KEY created_at_key(created_at) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES ("1970-01-01 12:00:00", "The start"); +INSERT INTO diaries VALUES ("2012-10-05 16:18:29", "Today is shiny day."); +INSERT INTO diaries VALUES ("2038-01-18 15:14:07", "The end"); + +SELECT * + FROM diaries FORCE INDEX(created_at_key) + WHERE created_at = "2012-10-05 16:18:29"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0215807b9db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, index using btree (c2)); +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +flush tables; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..29a937054a2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, a int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 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_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test new file mode 100644 index 00000000000..60ca970aa45 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test @@ -0,0 +1,35 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--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); +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 new file mode 100644 index 00000000000..28922bc3644 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, a int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 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_normal_column_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test new file mode 100644 index 00000000000..5138c6c9698 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, index using hash (c2)); +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +flush tables; +select * from t1; +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 new file mode 100644 index 00000000000..f39ead56541 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--enable_warnings + +set names utf8; +create table scores ( + id int primary key auto_increment not null, + name char(30) not null, + score int not null, + index property (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; +delete from scores where name = "Taro Yamada" and score = 10; +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_nullable_smallint.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test new file mode 100644 index 00000000000..055f2b20f22 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + c1 SMALLINT, + c2 SMALLINT, + KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; + +INSERT INTO t1 (c1, c2) VALUES + (1999, 12), + (2000, 11), + (2001, 10), + (2002, 9), + (2003, 8), + (2004, 7), + (2005, 6), + (2006, 5), + (2007, 4), + (2008, 3), + (2009, 2), + (2010, 1); + +SELECT * FROM t1 WHERE c1 > 2005; +SELECT * FROM t1 WHERE c1 >= 2005; +SELECT * FROM t1 WHERE c1 = 2005; +SELECT * FROM t1 WHERE c1 <= 2005; +SELECT * FROM t1 WHERE c1 < 2005; + +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9c9f3dfc283 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + c1 BIGINT UNSIGNED, + c2 BIGINT UNSIGNED, + KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; + +INSERT INTO t1 (c1, c2) VALUES + (1999, 12), + (2000, 11), + (2001, 10), + (2002, 9), + (2003, 8), + (2004, 7), + (2005, 6), + (2006, 5), + (2007, 4), + (2008, 3), + (2009, 2), + (2010, 1); + +SELECT * FROM t1 WHERE c1 > 2005; +SELECT * FROM t1 WHERE c1 >= 2005; +SELECT * FROM t1 WHERE c1 = 2005; +SELECT * FROM t1 WHERE c1 <= 2005; +SELECT * FROM t1 WHERE c1 < 2005; + +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c78aec6d6e0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + c1 INT UNSIGNED, + c2 INT UNSIGNED, + KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; + +INSERT INTO t1 (c1, c2) VALUES + (1999, 12), + (2000, 11), + (2001, 10), + (2002, 9), + (2003, 8), + (2004, 7), + (2005, 6), + (2006, 5), + (2007, 4), + (2008, 3), + (2009, 2), + (2010, 1); + +SELECT * FROM t1 WHERE c1 > 2005; +SELECT * FROM t1 WHERE c1 >= 2005; +SELECT * FROM t1 WHERE c1 = 2005; +SELECT * FROM t1 WHERE c1 <= 2005; +SELECT * FROM t1 WHERE c1 < 2005; + +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0b9b7dd3a3c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + c1 SMALLINT UNSIGNED, + c2 SMALLINT UNSIGNED, + KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; + +INSERT INTO t1 (c1, c2) VALUES + (1999, 12), + (2000, 11), + (2001, 10), + (2002, 9), + (2003, 8), + (2004, 7), + (2005, 6), + (2006, 5), + (2007, 4), + (2008, 3), + (2009, 2), + (2010, 1); + +SELECT * FROM t1 WHERE c1 > 2005; +SELECT * FROM t1 WHERE c1 >= 2005; +SELECT * FROM t1 WHERE c1 = 2005; +SELECT * FROM t1 WHERE c1 <= 2005; +SELECT * FROM t1 WHERE c1 < 2005; + +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2307c490fda --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + id INT PRIMARY KEY AUTO_INCREMENT, + c1 VARCHAR(10), + c2 VARCHAR(10), + KEY idx1(c1, c2) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE t1; + +INSERT INTO t1 (c1, c2) VALUES + ('1999', '12'), + ('2000', '11'), + ('2001', '10'), + ('2002', '09'), + ('2003', '08'), + ('2004', '07'), + ('2005', '06'), + ('2006', '05'), + ('2007', '04'), + ('2008', '03'), + ('2009', '02'), + ('2010', '01'); + +SELECT * FROM t1 WHERE c1 > '2005'; +SELECT * FROM t1 WHERE c1 >= '2005'; +SELECT * FROM t1 WHERE c1 = '2005'; +SELECT * FROM t1 WHERE c1 <= '2005'; +SELECT * FROM t1 WHERE c1 < '2005'; + +DROP TABLE t1; + +--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 new file mode 100644 index 00000000000..75e77b597e0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--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; +delete from scores where name = "Taro Yamada" and score = 10; +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_select_int.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test new file mode 100644 index 00000000000..0b3a7362c0e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--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; +select * from scores where name = "Taro Yamada"; +select * from scores where name = "Taro Yamada" and score = 29; +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 new file mode 100644 index 00000000000..26c76dd5207 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--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; + +--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 new file mode 100644 index 00000000000..90a1fdf6c49 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test @@ -0,0 +1,50 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--enable_warnings + +set names utf8; +create table listing ( + id int primary key auto_increment not null, + last_name char(30) not null, + first_name char(30) not null, + index name (last_name, first_name) +) default charset utf8; +show create table listing; + +insert into listing (last_name, first_name) values("Taro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Suzuki"); +insert into listing (last_name, first_name) values("Jiro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Tanaka"); + +select * from listing + where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); + +drop index name on listing; +select * from listing + where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); + +create index new_name_index on listing (last_name, first_name); +select * from listing + where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); + +drop table listing; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..b5e592938a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + name CHAR(30) NOT NULL, + score INT NOT NULL, + INDEX property (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; +REPLACE scores (id, name, score) VALUES (3, "Taro Yamada", 28); +SELECT * FROM scores; +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_select_double.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test new file mode 100644 index 00000000000..4f9c60d14b2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS temperatures; +--enable_warnings + +CREATE TABLE temperatures ( + id INT PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(20), + temperature DOUBLE, + KEY temperature_index(temperature), + KEY multi_index(temperature, title) +); + +INSERT INTO temperatures VALUES (NULL, "Hot!", 28.2); +INSERT INTO temperatures VALUES (NULL, "Snow!", -2.8); +INSERT INTO temperatures VALUES (NULL, "Rainy!", 12.7); + +SELECT temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +SELECT temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; + +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; + +DROP TABLE temperatures; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..941fddbc5a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS temperatures; +--enable_warnings + +CREATE TABLE temperatures ( + id INT PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(20), + temperature FLOAT, + KEY temperature_index(temperature), + KEY multi_index(temperature, title) +); + +INSERT INTO temperatures VALUES (NULL, "Hot!", 28.2); +INSERT INTO temperatures VALUES (NULL, "Snow!", -2.8); +INSERT INTO temperatures VALUES (NULL, "Rainy!", 12.7); + +SELECT temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +SELECT temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; + +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN 10 AND 30; +SELECT title, temperature FROM temperatures WHERE temperature BETWEEN -10 AND 20; + +DROP TABLE temperatures; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..478be9a90db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test @@ -0,0 +1,46 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + name CHAR(30) NOT NULL, + score INT NOT NULL, + INDEX property (score, name) +) 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; + +SELECT * FROM scores WHERE score = 29; + +SELECT * FROM scores WHERE score = 29 AND name = "Taro Yamada"; + +SELECT * FROM scores WHERE (score >= -12 AND score < 29) AND name = "Taro Yamada"; + +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 new file mode 100644 index 00000000000..6e0278f3910 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test @@ -0,0 +1,41 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--enable_warnings + +set names utf8; +create table listing ( + id int primary key auto_increment not null, + last_name char(30) not null, + first_name char(30) not null, + index name (last_name, first_name) +) default charset utf8; +show create table listing; +insert into listing (last_name, first_name) values("Taro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Suzuki"); +insert into listing (last_name, first_name) values("Jiro", "Yamada"); +insert into listing (last_name, first_name) values("Taro", "Tanaka"); +select * from listing; +select * from listing where last_name = "Taro"; +select * from listing where last_name = "Taro" and first_name = "Suzuki"; +select * from listing where last_name = "Taro" and (first_name >= "S" and first_name <= "Y"); +drop table listing; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9822ec18f4a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists scores; +--enable_warnings + +set names utf8; +create table scores ( + given_name varchar(30) not null, + family_name varchar(30) not null, + score int not null, + primary key property (given_name, family_name, score) +) default charset utf8; +show create table scores; + +insert into scores values("Taro", "Yamada", 29); +insert into scores values("Taro", "Yamada", -12); +insert into scores values("Jiro", "Yamada", 27); +insert into scores values("Taro", "Yamada", 10); + +select * from scores; +select * from scores where given_name = "Taro" and family_name = "Yamada"; +select * from scores where given_name = "Taro" and family_name = "Yamada" and score = 29; +select * from scores where given_name = "Taro" and family_name = "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_unique_date_32bit_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test new file mode 100644 index 00000000000..b206333d28d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + 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 (3, "2012-10-25", "9999-12-31"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); + +SELECT * FROM ranges FORCE INDEX(range_key) + WHERE start = "1000-01-01" AND end = "9999-12-31"; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c425b882482 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + 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 (3, "2012-10-25", "9999-12-31"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); + +SELECT * FROM ranges FORCE INDEX(range_key) + WHERE start = "1000-01-01" AND end = "9999-12-31"; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ea095f1c085 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + 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 (3, "2012-10-25", "9999-12-31"); +INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-01"); + +SELECT start, end + FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b877ed2f01a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start DATE, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c3185bb0fdc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start DATE, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..7fa17dbc2b3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start DATE, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ef3d9eee548 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start DATE, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..58ec29f07e9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start DATE, + end DATE, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "2010-01-01", "2012-10-05"); +SELECT * FROM ranges; + +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01", "2012-10-05"); +SELECT * FROM ranges; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..efa0c0288bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + 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 (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"); + +SELECT start, end + FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..55d910cc820 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start datetime, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..5868ade2228 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_freebsd.inc +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start datetime, + 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"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ab9ed122862 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start datetime, + end datetime, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; + +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..85645967fbd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (c1 int primary key, c2 decimal(65,30), c3 decimal(65,30), unique key uk1(c2,c3)); +insert into t1 values(1,123.456,0.000000000000000000000000000001); +insert into t1 values(2,-123.456,123.456); +insert into t1 values(3,98765432109876543210987654321098765.432109876543210987654321098765,-123.456); +insert into t1 values(4,-98765432109876543210987654321098765.432109876543210987654321098765,98765432109876543210987654321098765.432109876543210987654321098765); +insert into t1 values(5,0.000000000000000000000000000001,-98765432109876543210987654321098765.432109876543210987654321098765); +select c1, c2, c3 from t1 force index(uk1) where c2 = -98765432109876543210987654321098765.432109876543210987654321098765 and c3 = 98765432109876543210987654321098765.432109876543210987654321098765; +select c1, c2, c3 from t1 force index(uk1) order by c2, c3; +select c1, c2, c3 from t1 force index(uk1) order by c2 desc, c3 desc; +select c2, c3 from t1 force index(uk1) order by c2, c3; +--error ER_DUP_ENTRY +insert into t1 values(6,123.456,0.000000000000000000000000000001); +delete from t1 where c1 = 1; +insert into t1 values(1,123.456,0.000000000000000000000000000001); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f9b2d2b6f5c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start time, + end time, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (2, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (3, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (4, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); + +SELECT start, end + FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..94e2fa39946 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start time, + end time, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (2, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (3, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (4, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..d9d31cf3386 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start time, + end time, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "15:11:12", "838:59:59"); +INSERT INTO ranges VALUES (2, "00:00:00", "15:11:11"); +INSERT INTO ranges VALUES (3, "838:59:59", "00:00:00"); +INSERT INTO ranges VALUES (4, "00:00:00", "838:59:59"); +INSERT INTO ranges VALUES (5, "-838:59:59", "838:59:59"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..e0a18ae792b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start time, + end time, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "13:21:48", "15:11:12"); +SELECT * FROM ranges; + +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "13:21:48", "15:11:12"); +SELECT * FROM ranges; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c660f6aef6e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start timestamp, + end timestamp, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (4, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); + +SELECT start, end + FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..5ec630b56df --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start timestamp, + end timestamp, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); +INSERT INTO ranges VALUES (4, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..9ca7440da88 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start timestamp, + end timestamp, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07"); +INSERT INTO ranges VALUES (2, "1970-01-01 12:00:00", "2012-10-05 16:18:29"); +INSERT INTO ranges VALUES (3, "2038-01-18 15:14:07", "1970-01-01 12:00:00"); +INSERT INTO ranges VALUES (4, "1970-01-01 12:00:00", "2038-01-18 15:14:07"); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..559cf958804 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id int PRIMARY KEY, + start timestamp, + end timestamp, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; + +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59"); +SELECT * FROM ranges; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..900de61feac --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (c1 int primary key, c2 varchar(10), c3 varchar(10), unique key uk1(c2,c3)) default charset=utf8 collate utf8_bin; +insert into t1 values(1,'abcde','abc '); +insert into t1 values(2,'abc\0','abcde'); +insert into t1 values(3,'abc','abc\0'); +insert into t1 values(4,'abc ','abc'); +insert into t1 values(5,'abc ','abc '); +select c1, c2, c3 from t1 force index(uk1) where c2 = 'abc ' and c3 = 'abc'; +select c1, c2, c3 from t1 force index(uk1) order by c2, c3; +select c1, c2, c3 from t1 force index(uk1) order by c2 desc, c3 desc; +select c2, c3 from t1 force index(uk1) order by c2, c3; +--error ER_DUP_ENTRY +insert into t1 values(6,'abcde','abc '); +delete from t1 where c1 = 1; +insert into t1 values(1,'abcde','abc '); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3daf3fa4153 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 1901, 2012); +INSERT INTO ranges VALUES (2, 1901, 2155); +INSERT INTO ranges VALUES (3, 2012, 2155); +INSERT INTO ranges VALUES (4, 2155, 1901); + +SELECT * FROM ranges FORCE INDEX(range_key) + WHERE start = 1901 AND end = 2155; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..57ab0534147 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 1901, 2012); +INSERT INTO ranges VALUES (2, 1901, 2155); +INSERT INTO ranges VALUES (3, 2012, 2155); +INSERT INTO ranges VALUES (4, 2155, 1901); + +SELECT * FROM ranges FORCE INDEX(range_key) + WHERE start = 1901 AND end = 2155; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..efa92728a63 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 1901, 2012); +INSERT INTO ranges VALUES (2, 1901, 2155); +INSERT INTO ranges VALUES (3, 2012, 2155); +INSERT INTO ranges VALUES (4, 2155, 1901); + +SELECT start, end + FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..774c06772a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 2012, 2155); +INSERT INTO ranges VALUES (2, 1901, 2012); +INSERT INTO ranges VALUES (3, 2155, 1901); +INSERT INTO ranges VALUES (4, 1901, 2155); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..bd0d20fe973 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_32bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 2012, 2155); +INSERT INTO ranges VALUES (2, 1901, 2012); +INSERT INTO ranges VALUES (3, 2155, 1901); +INSERT INTO ranges VALUES (4, 1901, 2155); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..225188e05c6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 2012, 2155); +INSERT INTO ranges VALUES (2, 1901, 2012); +INSERT INTO ranges VALUES (3, 2155, 1901); +INSERT INTO ranges VALUES (4, 1901, 2155); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start, end; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..dcf905e9286 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_64bit.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 2012, 2155); +INSERT INTO ranges VALUES (2, 1901, 2012); +INSERT INTO ranges VALUES (3, 2155, 1901); +INSERT INTO ranges VALUES (4, 1901, 2155); + +SELECT * FROM ranges FORCE INDEX(range_key) + ORDER BY start DESC, end DESC; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..250ef00b5b6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ranges; +--enable_warnings + +CREATE TABLE ranges ( + id INT PRIMARY KEY, + start YEAR, + end YEAR, + UNIQUE KEY range_key(start, end) +); + +INSERT INTO ranges VALUES (1, 2010, 2012); +SELECT * FROM ranges; + +DELETE FROM ranges WHERE id = 1; +INSERT INTO ranges VALUES (1, 2010, 2012); +SELECT * FROM ranges; + +DROP TABLE ranges; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e1efd0c992c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +CREATE TABLE scores ( + id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, + name CHAR(30) NOT NULL, + score INT NOT NULL, + KEY property (score, name) +) 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", 29); +INSERT INTO scores (name, score) VALUES("Taro Yamada", 10); + +SELECT * FROM scores WHERE score = 29; + +UPDATE scores SET name = "Saburo YAMADA" WHERE id = 3; +SELECT * FROM scores WHERE 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_update_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test new file mode 100644 index 00000000000..bcbbe82914b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists listing; +--enable_warnings + +set names utf8; +create table scores ( + id int primary key auto_increment not null, + name char(30) not null, + score int not null, + index property (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; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ba52b4b4138 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id char(10) CHARACTER SET latin1 PRIMARY KEY +); + +INSERT INTO ids VALUES('abcdefghij'); +INSERT INTO ids VALUES('klmnopqrst'); +INSERT INTO ids VALUES('uvwxyz0123'); + +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; + +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = 'abcdefghij'; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bded856812c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id char(7) CHARACTER SET latin1 COLLATE latin1_bin PRIMARY KEY +); + +INSERT INTO ids VALUES("\0abcdef"); +INSERT INTO ids VALUES("ab\0cdef"); +INSERT INTO ids VALUES("abcd\0ef"); + +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; + +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = "ab\0cdef"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ae8c40b82c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id char(6) CHARACTER SET latin1 PRIMARY KEY +); + +INSERT INTO ids VALUES("abcdef"); +INSERT INTO ids VALUES( "cdef"); +INSERT INTO ids VALUES( "ef"); + +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; + +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = "cdef"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e57a8491d99 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (day, title) VALUES ("2012-01-31", "cloudy day"); +--error ER_DUP_ENTRY +INSERT INTO diaries (day, title) VALUES ("2012-01-31", "duplicated day"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE day BETWEEN "2012-01-29" AND "2012-01-30"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..7f140bf24c6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fractional_seconds.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (day, title) + VALUES ("2012-01-30 01:23:45.333", "rainy day"); +INSERT INTO diaries (day, title) + VALUES ("2012-01-31 08:32:10.5555", "cloudy day"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE day BETWEEN "2012-01-29 00:00:00.123456" AND + "2012-01-31 00:00:00.999999"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..1986e4db3db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (day, title) + VALUES ("2012-01-30 01:23:45", "rainy day"); +INSERT INTO diaries (day, title) + VALUES ("2012-01-31 08:32:10", "cloudy day"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE day BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..d296285b391 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS releases; +--enable_warnings + +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."); +INSERT INTO releases (version, message) VALUES (999.999, "the last release!"); + +SELECT * FROM releases; + +SELECT * FROM releases WHERE version BETWEEN "9.000" AND "10.001"; + +DROP TABLE releases; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..956b9800650 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS releases; +--enable_warnings + +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!"); +INSERT INTO releases (version, message) VALUES (999, "the last release!"); + +SELECT * FROM releases; + +SELECT * FROM releases WHERE version BETWEEN "1" AND "10"; + +DROP TABLE releases; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..90e668e1e38 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_fractional_seconds.inc + +--disable_warnings +DROP TABLE IF EXISTS running_records; +--enable_warnings + +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"); +INSERT INTO running_records (time, title) + VALUES ("12:23:34.123456", "bad condition"); +INSERT INTO running_records (time, title) + VALUES ("-838:59:59.000000", "record failure"); + +SELECT * FROM running_records; + +SELECT * FROM running_records + WHERE time BETWEEN "00:59:59.999999" AND "12:23:34.123456"; + +DROP TABLE running_records; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f000f7390f6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS running_records; +--enable_warnings + +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"); +INSERT INTO running_records (time, title) + VALUES ("12:23:34", "bad condition"); +INSERT INTO running_records (time, title) + VALUES ("-838:59:59", "record failure"); + +SELECT * FROM running_records; + +SELECT * FROM running_records + WHERE time BETWEEN "00:59:59" AND "12:23:34"; + +DROP TABLE running_records; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..aba635ad637 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_mariadb_55.inc +--source ../../include/mroonga/have_fractional_seconds.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (time, title) + VALUES ("2012-01-30 01:23:45.333", "rainy day"); +INSERT INTO diaries (time, title) + VALUES ("2012-01-31 08:32:10.5555", "cloudy day"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE time BETWEEN "2012-01-29 00:00:00.123456" AND + "2012-01-31 00:00:00.999999"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ae61434c795 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (time, title) VALUES ("2012-01-31 08:32:10", "cloudy day"); + +SELECT * FROM diaries; + +SELECT * FROM diaries + WHERE time BETWEEN "2012-01-29 00:00:00" AND "2012-01-31 00:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..20ae939be8b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test @@ -0,0 +1,37 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id varchar(7) CHARACTER SET latin1 COLLATE latin1_bin PRIMARY KEY +); + +INSERT INTO ids VALUES("\0abcdef"); +INSERT INTO ids VALUES("ab\0cdef"); +INSERT INTO ids VALUES("abcd\0ef"); + +SELECT * FROM ids FORCE INDEX(PRIMARY) ORDER BY id; + +SELECT * FROM ids FORCE INDEX(PRIMARY) WHERE id = "ab\0cdef"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..25f02d38e94 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS aniversary_memos; +--enable_warnings + +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!"); +INSERT INTO aniversary_memos (party_year, title) + VALUES ("2012", "Invitations are sent."); +INSERT INTO aniversary_memos (party_year, title) + VALUES ("13", "Wow! Today is the anniversary party day!"); + +SELECT * FROM aniversary_memos; + +SELECT * FROM aniversary_memos + WHERE party_year BETWEEN "12" AND "2013"; + +DROP TABLE aniversary_memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_asc.test new file mode 100644 index 00000000000..a622dfbf70d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id > 1 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_desc.test new file mode 100644 index 00000000000..63dc820ccfd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id > 3 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_asc.test new file mode 100644 index 00000000000..a51e6c5da47 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id >= 2 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_desc.test new file mode 100644 index 00000000000..ea5c150bf0f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_greater_than_or_equal_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id >= 3 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_asc.test new file mode 100644 index 00000000000..12761c0f4d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_desc.test new file mode 100644 index 00000000000..a4f4a781ead --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_asc.test new file mode 100644 index 00000000000..2fba0d13f5f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_desc.test new file mode 100644 index 00000000000..e4661fc7047 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_less_than_or_equal_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..53111b576d7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id BIGINT, + value BIGINT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..5e93137afeb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id BIGINT UNSIGNED, + value BIGINT UNSIGNED, + KEY (id, value) +); + +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0ca7d948318 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id DOUBLE, + value DOUBLE, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1.1, 16.16); +INSERT INTO ids VALUES ( -2.2, 8.8); +INSERT INTO ids VALUES ( -4.4, 4.4); +INSERT INTO ids VALUES ( -8.8, 2.2); +INSERT INTO ids VALUES (-16.6, 1.1); +INSERT INTO ids VALUES ( 16.6, -1.1); +INSERT INTO ids VALUES ( 8.8, -2.2); +INSERT INTO ids VALUES ( 4.4, -4.4); +INSERT INTO ids VALUES ( 2.2, -8.8); +INSERT INTO ids VALUES ( 1.1, -16.16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4.5 AND 8.9; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ade89f6bc56 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id FLOAT, + value FLOAT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1.1, 16.16); +INSERT INTO ids VALUES ( -2.2, 8.8); +INSERT INTO ids VALUES ( -4.4, 4.4); +INSERT INTO ids VALUES ( -8.8, 2.2); +INSERT INTO ids VALUES (-16.6, 1.1); +INSERT INTO ids VALUES ( 16.6, -1.1); +INSERT INTO ids VALUES ( 8.8, -2.2); +INSERT INTO ids VALUES ( 4.4, -4.4); +INSERT INTO ids VALUES ( 2.2, -8.8); +INSERT INTO ids VALUES ( 1.1, -16.16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4.5 AND 8.9; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9ed4979fd8f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test @@ -0,0 +1,46 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT, + value INT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f68c2f6906c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT UNSIGNED, + value INT UNSIGNED, + KEY (id, value) +); + +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..254345b6ec6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id MEDIUMINT, + value MEDIUMINT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8975c5120cb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id MEDIUMINT UNSIGNED, + value MEDIUMINT UNSIGNED, + KEY (id, value) +); + +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4ed8c4b366e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id SMALLINT, + value SMALLINT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ef5da3e79c9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id SMALLINT UNSIGNED, + value SMALLINT UNSIGNED, + KEY (id, value) +); + +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..5c738fa567b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id TINYINT, + value TINYINT, + KEY (id, value) +); + +INSERT INTO ids VALUES ( -1, 16); +INSERT INTO ids VALUES ( -2, 8); +INSERT INTO ids VALUES ( -4, 4); +INSERT INTO ids VALUES ( -8, 2); +INSERT INTO ids VALUES (-16, 1); +INSERT INTO ids VALUES ( 16, -1); +INSERT INTO ids VALUES ( 8, -2); +INSERT INTO ids VALUES ( 4, -4); +INSERT INTO ids VALUES ( 2, -8); +INSERT INTO ids VALUES ( 1, -16); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN -4 AND 8; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..7f17f0031db --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id TINYINT UNSIGNED, + value TINYINT UNSIGNED, + KEY (id, value) +); + +INSERT INTO ids VALUES ( 1, 1); +INSERT INTO ids VALUES ( 2, 2); +INSERT INTO ids VALUES ( 4, 3); +INSERT INTO ids VALUES ( 8, 4); +INSERT INTO ids VALUES (16, 5); +INSERT INTO ids VALUES (32, 6); +INSERT INTO ids VALUES (64, 7); +INSERT INTO ids VALUES (128, 8); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 4 AND 32; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ccd53a95237 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id VARCHAR(5), + value VARCHAR(10), + KEY (id, value) +) DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +INSERT INTO ids VALUES ("abc", "Abc"); +INSERT INTO ids VALUES ("acd", "aBc"); +INSERT INTO ids VALUES ("ade", "abC"); +INSERT INTO ids VALUES ("aef", "abc"); +INSERT INTO ids VALUES ("ABC", "aBC"); +INSERT INTO ids VALUES ("ACD", "AbC"); +INSERT INTO ids VALUES ("ADE", "ABc"); +INSERT INTO ids VALUES ("AEF", "ABC"); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN "ab" AND "ad"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..1d799e76696 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id VARCHAR(5), + value VARCHAR(10), + KEY (id, value) +) DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci; + +INSERT INTO ids VALUES ("abc", "Abc"); +INSERT INTO ids VALUES ("acd", "aBc"); +INSERT INTO ids VALUES ("ade", "abC"); +INSERT INTO ids VALUES ("aef", "abc"); +INSERT INTO ids VALUES ("ABC", "aBC"); +INSERT INTO ids VALUES ("ACD", "AbC"); +INSERT INTO ids VALUES ("ADE", "ABc"); +INSERT INTO ids VALUES ("AEF", "ABC"); + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN "ab" AND "ad"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a7ff9f3a600 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT, + KEY (id) +); + +INSERT INTO ids VALUES (1); +INSERT INTO ids SELECT id + 1 FROM ids; +INSERT INTO ids SELECT id + 2 FROM ids; +INSERT INTO ids SELECT id + 4 FROM ids; +INSERT INTO ids SELECT id + 8 FROM ids; +INSERT INTO ids SELECT id + 16 FROM ids; + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 10 AND 16; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4d094df41cd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id VARCHAR(10), + KEY (id) +); + +INSERT INTO ids VALUES ("1"); +INSERT INTO ids SELECT id + "1" FROM ids; +INSERT INTO ids SELECT id + "2" FROM ids; +INSERT INTO ids SELECT id + "4" FROM ids; +INSERT INTO ids SELECT id + "8" FROM ids; +INSERT INTO ids SELECT id + "16" FROM ids; + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN "10" AND "16"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..68f132367f2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT, + PRIMARY KEY (id) +); + +INSERT INTO ids VALUES (1); +INSERT INTO ids SELECT id + 1 FROM ids; +INSERT INTO ids SELECT id + 2 FROM ids; +INSERT INTO ids SELECT id + 4 FROM ids; +INSERT INTO ids SELECT id + 8 FROM ids; +INSERT INTO ids SELECT id + 16 FROM ids; + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN 10 AND 16; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..aa9ba644062 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id VARCHAR(10), + PRIMARY KEY (id) +); + +INSERT INTO ids VALUES ("1"); +INSERT INTO ids SELECT id + "1" FROM ids; +INSERT INTO ids SELECT id + "2" FROM ids; +INSERT INTO ids SELECT id + "4" FROM ids; +INSERT INTO ids SELECT id + "8" FROM ids; +INSERT INTO ids SELECT id + "16" FROM ids; + +SELECT * FROM ids; +SELECT * FROM ids WHERE id BETWEEN "10" AND "16"; + +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 new file mode 100644 index 00000000000..2c1ec45c045 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test @@ -0,0 +1,37 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +CREATE TABLE users ( + id int PRIMARY KEY, + name varchar(100) NOT NULL, + UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES (1, "Alice"); +DELETE FROM users WHERE id = 1; +INSERT INTO users VALUES (1, "Alice"); + +SELECT * FROM users; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6c47c877771 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test @@ -0,0 +1,38 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +CREATE TABLE users ( + id int PRIMARY KEY, + name varchar(100) NOT NULL, + UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES (1, "Alice"); +-- error ER_DUP_ENTRY +INSERT INTO users VALUES (1, "Bob"); +INSERT INTO users VALUES (2, "Bob"); + +SELECT * FROM users; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..21446b302f2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test @@ -0,0 +1,36 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +CREATE TABLE users ( + name varchar(100) NOT NULL, + UNIQUE KEY name (name) +) DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES ("Alice"); +INSERT INTO users VALUES ("Bob"); +SELECT * FROM users; + +SELECT * FROM users WHERE name = "aLiCe"; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bbf368551af --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test @@ -0,0 +1,40 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE scores ( + deleted BOOLEAN, + value INT, + INDEX (deleted, value) +); + +INSERT INTO scores VALUES (FALSE, 1); +INSERT INTO scores VALUES (FALSE, 1); +INSERT INTO scores VALUES (FALSE, 2); + +SELECT count(*) FROM scores WHERE deleted = FALSE; +UPDATE scores SET deleted = TRUE WHERE value = 1; +SELECT count(*) FROM scores WHERE deleted = FALSE; + +DROP TABLE scores; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a0dc2f8a952 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test @@ -0,0 +1,39 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS scores; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE scores ( + value INT, + INDEX (value) +); + +INSERT INTO scores VALUES (21); +INSERT INTO scores VALUES (21); +INSERT INTO scores VALUES (22); + +SELECT count(*) FROM scores WHERE value >= 20; +UPDATE scores SET value = 11 WHERE value = 21; +SELECT count(*) FROM scores WHERE value >= 20; + +DROP TABLE scores; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d22c6560c2c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test @@ -0,0 +1,22 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE + from information_schema.plugins where plugin_name = "Mroonga"; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2956e072302 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test @@ -0,0 +1,34 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY +); + +SELECT AUTO_INCREMENT + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_NAME = "ids"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..79e12fe67a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test @@ -0,0 +1,34 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT AUTO_INCREMENT PRIMARY KEY +); + +SELECT AUTO_INCREMENT + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_NAME = "ids"; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..82dd4fdf1c6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT PRIMARY KEY, + title VARCHAR(255), + content TEXT, + 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, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_NAME = "diaries" AND DATA_LENGTH > 0; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..3fa85344dfa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test @@ -0,0 +1,105 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +# data types +create table t1 (c1 tinyint); +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 smallint); +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 mediumint); +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 int); +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 bigint); +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 float); +insert into t1 values(0.5); +select * from t1; +drop table t1; + +create table t1 (c1 double); +insert into t1 values(0.5); +select * from t1; +drop table t1; + +create table t1 (c1 date); +insert into t1 values("2010/03/26"); +select * from t1; +drop table t1; + +create table t1 (c1 time); +insert into t1 values("11:22:33"); +select * from t1; +drop table t1; + +create table t1 (c1 year); +insert into t1 values("2010"); +select * from t1; +drop table t1; + +create table t1 (c1 datetime); +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); +select * from t1; +--error ER_DUP_ENTRY +insert into t1 values(1,200); +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c3530dc34c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test @@ -0,0 +1,41 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS numbers; +--enable_warnings + +CREATE TABLE numbers ( + id INT, + count INT, + UNIQUE (id) +); + +INSERT INTO numbers (id, count) VALUES (1, 1) ON DUPLICATE KEY UPDATE count = 2; +INSERT INTO numbers (id, count) VALUES (1, 3) ON DUPLICATE KEY UPDATE count = 4; + +SELECT * FROM numbers; + +INSERT INTO numbers (id, count) VALUES (2, 1) ON DUPLICATE KEY UPDATE count = 2; +INSERT INTO numbers (id, count) VALUES (2, 3) ON DUPLICATE KEY UPDATE count = 4; + +SELECT * FROM numbers; + +DROP TABLE numbers; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..794605d742b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test @@ -0,0 +1,43 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +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") + ON DUPLICATE KEY UPDATE title = "clear day (duplicated)"; +INSERT INTO diaries (day, title) + VALUES ("2012-02-14", "rainy day") + ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)"; +INSERT INTO diaries (day, title) + VALUES ("2012-02-15", "cloudy day") + ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)"; + +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..782b7bee9ca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + day DATE, + title TEXT, + UNIQUE KEY day (day) +) DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (day, title) + VALUES ("2012-02-14", "clear day") + ON DUPLICATE KEY UPDATE title = "clear day (duplicated)"; +INSERT INTO diaries (day, title) + VALUES ("2012-02-14", "rainy day") + ON DUPLICATE KEY UPDATE title = "rainy day (duplicated)"; +INSERT INTO diaries (day, title) + VALUES ("2012-02-15", "cloudy day") + ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)"; + +SELECT * FROM diaries; + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..18801541b72 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test @@ -0,0 +1,37 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS terms; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE terms ( + content varchar(64) NOT NULL COLLATE 'utf8_unicode_ci', + INDEX (content) +) DEFAULT CHARSET=utf8; + +INSERT INTO terms VALUES ('track'); +INSERT INTO terms VALUES ('trackback'); + +SELECT * FROM terms WHERE content LIKE 'TRACK%'; + +DROP TABLE terms; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..b7093f82aa5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test @@ -0,0 +1,32 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS counts; +--enable_warnings + +CREATE TABLE counts ( + id INT PRIMARY KEY AUTO_INCREMENT +); + +LOCK TABLES counts READ; +UNLOCK TABLES; + +DROP TABLE counts; + +--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 new file mode 100644 index 00000000000..8c818041a6c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test @@ -0,0 +1,60 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SET mroonga_enable_optimization=FALSE; + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + month = 11 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +SET mroonga_enable_optimization=TRUE; + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..d75a6460218 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test @@ -0,0 +1,55 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY day; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..61e16a9444d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date BETWEEN "2011-11-11 12:23:31" AND "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..4b75648009b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date BETWEEN "2011-11-11 12:23:31" AND "2011-11-11 12:23:43" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f3b4be95b3a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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."); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:34", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:34", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date = "2011-11-11 12:23:34" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ce5724b8b0b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date > "2011-11-11 12:23:31" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..4c55ba2a895 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date >= "2011-11-11 12:23:31" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..36f0e0ab6f2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date < "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..3fc1505fcc2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + date DATETIME, + content TEXT, + 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!"); +INSERT INTO diaries VALUES(3, "2011-11-11 12:23:32", "I will do something today!"); +INSERT INTO diaries VALUES(4, "2011-11-11 12:23:33", "I don't want to anything today..."); +INSERT INTO diaries VALUES(5, "2011-11-11 12:23:34", "I'm sleepy today."); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + date <= "2011-11-11 12:23:33" + ORDER BY id LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..0733a48ba97 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test @@ -0,0 +1,51 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f96043b4e37 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test @@ -0,0 +1,48 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + content TEXT, + FULLTEXT INDEX(content), + KEY(id) +) DEFAULT CHARSET UTF8; + +INSERT INTO memos VALUES(1, "Today is fine."); +INSERT INTO memos VALUES(2, "Today's lucky item is flower!"); +INSERT INTO memos VALUES(3, "I will do something today!"); +INSERT INTO memos VALUES(4, "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + id BETWEEN 2 AND 4 + ORDER BY id LIMIT 1,2; + +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_int_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test new file mode 100644 index 00000000000..39caa96424c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test @@ -0,0 +1,48 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + content TEXT, + FULLTEXT INDEX(content), + KEY(id) +) DEFAULT CHARSET UTF8; + +INSERT INTO memos VALUES(1, "Today is fine."); +INSERT INTO memos VALUES(2, "Today's lucky item is flower!"); +INSERT INTO memos VALUES(3, "I will do something today!"); +INSERT INTO memos VALUES(4, "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + id BETWEEN 2 AND 6 + ORDER BY id LIMIT 1,2; + +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_int_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test new file mode 100644 index 00000000000..579b7b33899 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + month = 11 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c7354438224 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + day > 10 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..259e2e5178d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + day >= 10 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..02c2123afef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + day < 12 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..0511de74442 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + day <= 12 + ORDER BY day LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b757b39e9ce --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 11, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(6, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE) ORDER BY day LIMIT 0,5; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b4d7aa348f0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test @@ -0,0 +1,39 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +flush status; +create table t1 (c1 int primary key, c2 int, c3 text, _id int, key idx1(c2), fulltext index ft(c3)) default charset utf8; +insert into t1 values(1,10,"aa ii uu ee oo",null); +insert into t1 values(2,20,"ka ki ku ke ko",null); +insert into t1 values(3,30,"ii si ii se ii",null); +insert into t1 values(4,40,"ta ti tu te to",null); +insert into t1 values(5,50,"aa ii uu ii oo",null); + +show status like 'mroonga_fast_order_limit'; + +select *, match(c3) against("ii") from t1 order by c1 desc limit 2; + +show status like 'mroonga_fast_order_limit'; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..74da8581596 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY day ASC LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..2e5d0741c51 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY day DESC LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..d7becd3820a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test @@ -0,0 +1,57 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + _id INT, + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(NULL, 3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(NULL, 4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(NULL, 5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(NULL, 6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(NULL, 7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY _id + LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..827faa70fa9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..04a2309e98e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test @@ -0,0 +1,57 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT *, MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + ORDER BY MATCH(content) AGAINST("今日" IN BOOLEAN MODE) + LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..8c8fafc076c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!"); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time BETWEEN "1:23:31" AND "1:23:33" + ORDER BY id LIMIT 1,2; + +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_time_between_over.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test new file mode 100644 index 00000000000..9f9848b7e7e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!"); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time BETWEEN "1:23:31" AND "1:23:43" + ORDER BY id LIMIT 1,2; + +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_time_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test new file mode 100644 index 00000000000..04efd54eb48 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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."); +INSERT INTO memos VALUES(3, "1:23:34", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:34", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time = "1:23:34" + ORDER BY id LIMIT 1,2; + +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_time_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test new file mode 100644 index 00000000000..b2ec8b78198 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!" ); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time > "1:23:31" + ORDER BY id LIMIT 1,2; + +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_time_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test new file mode 100644 index 00000000000..0b9964eb542 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!" ); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time >= "1:23:31" + ORDER BY id LIMIT 1,2; + +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_time_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test new file mode 100644 index 00000000000..ce772a2ee6d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!"); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time < "1:23:33" + ORDER BY id LIMIT 1,2; + +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_time_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test new file mode 100644 index 00000000000..797bd935eaa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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, + writing_time TIME, + content TEXT, + 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!"); +INSERT INTO memos VALUES(3, "1:23:32", "I will do something today!"); +INSERT INTO memos VALUES(4, "1:23:33", "I don't want to anything today..."); +INSERT INTO memos VALUES(5, "1:23:34", "I'm sleepy today."); + +SELECT * FROM memos + WHERE MATCH(content) AGAINST("today" IN BOOLEAN MODE) AND + writing_time <= "1:23:33" + ORDER BY id LIMIT 1,2; + +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_varchar_equal_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test new file mode 100644 index 00000000000..e34209b841e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test @@ -0,0 +1,57 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + KEY(title), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + title = "hello" + ORDER BY day LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..380f323d64a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test @@ -0,0 +1,56 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content), + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, 2011, 11, 12, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, 2011, 11, 13, "はれ", "天気がよいのは今日までみたい。"); +INSERT INTO diaries VALUES(6, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(7, 2011, 12, 2, "初雪", "今日の天気は雪!"); + +SELECT * FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE) AND + title = "hello" + ORDER BY day LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..988a116731c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year BETWEEN "11" AND "2013" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d4c1d020fcc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year BETWEEN "11" AND "2015" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..b1daa3a0000 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test @@ -0,0 +1,55 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine (code name Mroonga) 1.0 has been released", "11"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 1.11 has been released", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year = "11" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bf4a18793b5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year > "11" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id ASC LIMIT 2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8863d613f06 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year >= "11" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id ASC LIMIT 2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..2fe423ac053 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year < "13" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..52f26e37123 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test @@ -0,0 +1,53 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS mroonga_releases; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE mroonga_releases ( + id INT PRIMARY KEY AUTO_INCREMENT, + release_title TEXT, + release_year YEAR, + KEY (release_year), + FULLTEXT KEY (release_title) +) DEFAULT CHARSET UTF8; + +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Groonga storage engine (code name Mroonga) 0.1 has been released", "10"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Rename Groonga storage engine to Mroonga", "2011"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 2.0 has been released", "2012"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 3.0 has been released", "13"); +INSERT INTO mroonga_releases (release_title, release_year) + VALUES ("Mroonga 4.0 will be released", "2014"); + +SELECT * FROM mroonga_releases + WHERE release_year <= "13" AND + MATCH(release_title) AGAINST("Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC LIMIT 1,2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE mroonga_releases; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_TODO_SPLIT_ME.test new file mode 100644 index 00000000000..669868c6c7f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_TODO_SPLIT_ME.test @@ -0,0 +1,61 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_skip_count_after_insert_multithread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_multithread.test new file mode 100644 index 00000000000..bca2311ffbc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_multithread.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX ft(title) +); + +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); + +CONNECT (thread2, localhost, root, ,); +CONNECTION thread2; +INSERT INTO diaries VALUES("Happy birthday!"); +DISCONNECT thread2; +CONNECTION default; + +SHOW STATUS LIKE 'mroonga_count_skip'; +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_single_thread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_single_thread.test new file mode 100644 index 00000000000..fa960be850f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_after_insert_single_thread.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX ft(title) +); + +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); + +SHOW STATUS LIKE 'mroonga_count_skip'; +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_disabled.test new file mode 100644 index 00000000000..e94702e8159 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_disabled.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + title VARCHAR(255), + content TEXT, + 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, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, "はれ", "天気がよいのは今日までみたい。"); + +SET mroonga_enable_optimization=FALSE; + +SELECT COUNT(*) FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE); + +SHOW STATUS LIKE 'mroonga_count_skip'; + +SET mroonga_enable_optimization=TRUE; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_index_view.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_index_view.test new file mode 100644 index 00000000000..11457b1e05a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_skip_count_index_view.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries, users; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + user_id INT NOT NULL, + title VARCHAR(45) NOT NULL, + KEY (user_id), + FULLTEXT INDEX title_index (title) +) DEFAULT CHARSET=UTF8; + +CREATE TABLE users ( + id INT PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(45) NOT NULL, + INDEX (name) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8; + +INSERT INTO users (id, name) VALUES (1, "Alice"), (2, "Bob"); +INSERT INTO diaries (user_id, title) VALUES (1, "survey"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (1)"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (2)"); + +CREATE VIEW articles AS + SELECT diaries.user_id AS user_id, + diaries.title AS title, + users.name AS name + FROM diaries, users + WHERE diaries.user_id = users.id; + + +SELECT COUNT(*) FROM articles WHERE name = 'Bob'; + +DROP VIEW articles; +DROP TABLE diaries, users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test new file mode 100644 index 00000000000..5f160af239f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test @@ -0,0 +1,39 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS geo_replace; +--enable_warnings + +CREATE TABLE geo_replace ( + id INT NOT NULL, + geo GEOMETRY NOT NULL, + PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO geo_replace VALUES(1, POINT(100,100)); +SELECT id, ASTEXT(geo) FROM geo_replace; +REPLACE INTO geo_replace VALUES(1, POINT(100,200)); +SELECT id, ASTEXT(geo) FROM geo_replace; +INSERT INTO geo_replace VALUES(1, POINT(200,200)) ON DUPLICATE KEY UPDATE geo = POINT(200,200); +SELECT id, ASTEXT(geo) FROM geo_replace; +UPDATE geo_replace SET geo = POINT(200,300); +SELECT id, ASTEXT(geo) FROM geo_replace; + +DROP TABLE geo_replace; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..192a4976cbd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test @@ -0,0 +1,64 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Based on #910. + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS videos_master, videos_groonga; +--enable_warnings + +CREATE TABLE `videos_master` ( + `id` bigint(1) unsigned NOT NULL, + `video_id` varchar(64) NOT NULL, + `description` text, + `tags_unpack` text, + PRIMARY KEY (`video_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `videos_groonga` ( + `id` bigint(1) unsigned NOT NULL, + `video_id` varchar(64) NOT NULL, + `description` text, + `tags_unpack` text, + PRIMARY KEY (`video_id`), + FULLTEXT INDEX (`description`), + FULLTEXT INDEX (`tags_unpack`) +) DEFAULT CHARSET=utf8; + + +INSERT INTO videos_master VALUES (1, "video-1", "My Familly", "familly human"); +INSERT INTO videos_master VALUES (2, "video-2", "My Cat", "family cat"); +REPLACE INTO videos_groonga + SELECT v.id, v.video_id, v.description, NULL + FROM videos_master AS v + WHERE v.video_id = (video_id); +SELECT *, MATCH(description) AGAINST("cat") FROM videos_groonga + WHERE MATCH(description) AGAINST("cat"); + +INSERT INTO videos_master VALUES (3, "video-3", "My Dog", "family dog"); +REPLACE INTO videos_groonga + SELECT v.id, v.video_id, v.description, NULL + FROM videos_master AS v + WHERE v.video_id = (video_id); +SELECT *, MATCH(description) AGAINST("my") FROM videos_groonga + WHERE MATCH(description) AGAINST("my"); + +DROP TABLE videos_master, videos_groonga; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test new file mode 100644 index 00000000000..6411896312c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + content text, + fulltext index (content) +) default charset utf8; +show create table diaries; + +insert into diaries values(1, "今日からはじめました。"); +insert into diaries values(2, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); + +select * from diaries; + +select * from diaries where match(content) against("天気"); + +replace into diaries values(2, "明日の天気は雨みたい。"); +select * from diaries where match(content) against("天気"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test new file mode 100644 index 00000000000..0d9b82fb7d4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +set names utf8; +create table diaries ( + id int primary key, + content varchar(256), + fulltext index (content) +) default charset utf8; +show create table diaries; + +insert into diaries values(1, "今日からはじめました。"); +insert into diaries values(2, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); + +select * from diaries; + +select * from diaries where match(content) against("天気"); + +replace into diaries values(2, "明日の天気は雨みたい。"); +select * from diaries where match(content) against("天気"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test new file mode 100644 index 00000000000..a2efa7912b5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS vector_replace; +DROP TABLE IF EXISTS vector_replace_vec; +--enable_warnings + +CREATE TABLE vector_replace_vec ( + vec CHAR(10) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE vector_replace ( + id INT NOT NULL, + vec TEXT COMMENT 'flags "COLUMN_VECTOR", type "vector_replace_vec"', + PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; +INSERT INTO vector_replace VALUES(1, 'first second third'); +SELECT id, vec FROM vector_replace; +REPLACE INTO vector_replace VALUES(1, 'fourth fifth'); +SELECT id, vec FROM vector_replace; +INSERT INTO vector_replace VALUES(1, 'sixth seventh') ON DUPLICATE KEY UPDATE vec = 'sixth seventh'; +SELECT id, vec FROM vector_replace; +UPDATE vector_replace SET vec = 'eighth nineth tenth'; +SELECT id, vec FROM vector_replace; + +DROP TABLE vector_replace; +DROP TABLE vector_replace_vec; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8de78ca99af --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_all.test @@ -0,0 +1,100 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1(c1 int, c2 int, c3 int); +insert into t1 values (1, 10, 100); +insert into t1 values (2, 30, 500); +insert into t1 values (5, 20, 200); +insert into t1 values (3, 60, 300); +insert into t1 values (4, 50, 600); +insert into t1 values (6, 40, 400); + +select * from t1; +select c1 from t1; +select c2 from t1; +select c3 from t1; + +select * from t1 where c1 <= 3; +select * from t1 where c2 > 40; +select * from t1 where c3 = 300; + + +select * from t1 order by c1; +select * from t1 order by c2 desc; +select * from t1 order by c3, c1; + +drop table t1; + + +create table t1 (c1 int, c2 varchar(100)); +insert into t1 values(1, "hoge"); +insert into t1 values(4, "hogefuga"); +insert into t1 values(2, "fuga"); +insert into t1 values(5, "moge"); +insert into t1 values(3, "mo"); + +select * from t1; +select * from t1 order by c1; +select * from t1 order by c1 desc; +select * from t1 order by c2; + +drop table t1; + +create table t1 (c1 int, c2 text); +insert into t1 values(1, "hoge"); +insert into t1 values(4, "hogefuga"); +insert into t1 values(2, "fuga"); +insert into t1 values(5, "moge"); +insert into t1 values(3, "mo"); + +select * from t1; + +drop table t1; + +# ORDER BY with position +create table t1 (c1 int, c2 int, c3 text); +insert into t1 values(1, 20, "hoge"); +insert into t1 values(4, 60, "hogefuga"); +insert into t1 values(2, 50, "fuga"); +insert into t1 values(5, 30, "moge"); +insert into t1 values(3, 40, "mo"); +select * from t1 order by c1 asc; +select * from t1 order by c1 desc; +select * from t1 order by c2 asc; +select * from t1 order by c2 desc; +select * from t1 order by c3 asc; +select * from t1 order by c3 desc; +drop table t1; + +# _id +create table t1 (_id int, c1 int); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +insert into t1 values (null,100); +select * from t1; +select * from t1 where _id < 3; +select * from t1 where _id >= 3; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c4ce4c0193d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test @@ -0,0 +1,36 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS tags; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(16) NOT NULL, + KEY index_name (name) +); + +INSERT INTO tags VALUES ('mroonga'); +INSERT INTO tags VALUES ('mysql'); +INSERT INTO tags VALUES (''); + +SELECT * FROM tags WHERE name = ""; + +DROP TABLE tags; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..8537616e89e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test @@ -0,0 +1,36 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS tags; +--enable_warnings + +CREATE TABLE tags ( + name VARCHAR(16) NOT NULL, + KEY index_name (name) +); + +INSERT INTO tags VALUES ('mroonga'); +INSERT INTO tags VALUES ('mysql'); +INSERT INTO tags VALUES (''); + +SELECT * FROM tags WHERE name != ""; + +DROP TABLE tags; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..569fbcfd600 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE users ( + name varchar(40), + age int, + 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; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ae852bfcfed --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE users ( + name varchar(40), + 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; + +SELECT *, COUNT(*) FROM users GROUP BY age; + +DROP TABLE users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test b/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test new file mode 100644 index 00000000000..9ebd707392d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test @@ -0,0 +1,40 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1(c1 int primary key, c2 int, c3 int); +insert into t1 values (1, 10, 100); +insert into t1 values (2, 30, 500); +insert into t1 values (5, 20, 200); +insert into t1 values (3, 60, 300); +insert into t1 values (4, 50, 600); +insert into t1 values (6, 40, 400); + +select * from t1 where c1=1; +select * from t1 where c1=2; +select * from t1 where c1=3; +select * from t1 where c1=4; +select * from t1 where c1=5; +select * from t1 where c1=6; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a6159bea02b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test @@ -0,0 +1,51 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +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"); + +select * from t1; +select * from t1 force index(idx1) where c2 = 30; +select * from t1 force index(idx1) where c2 = 20; + +insert into t1 values(6,30,"aa bb cc dd ee"); +select * from t1; +select * from t1 force index(idx1) where c2 = 30; + +drop table t1; + +create table t1 (c1 varchar(5) primary key, c2 varchar(5), c3 text, key idx1(c2), fulltext index ft(c3))engine=mroonga; +insert into t1 values('ab','ijk',"aa ii uu ee oo"); +insert into t1 values('bc','ghi',"ka ki ku ke ko"); +insert into t1 values('cd','efg',"sa si su se so"); +insert into t1 values('de','cde',"ta ti tu te to"); +insert into t1 values('ef','abc',"aa ii uu ee oo"); +select * from t1 force index(idx1) where c2 < 'e' order by c1 asc; +select * from t1 force index(idx1) where c2 > 'e' order by c1 asc; +select * from t1 force index(idx1) where c2 between 'c' and 'h' order by c1 asc; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..240e8c11dcf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test @@ -0,0 +1,35 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int); +show create table t1; +drop table t1; + +create table t1 (c1 int, c2 int); +show create table t1; +drop table t1; + +create table t1 (c1 int primary key, c2 varchar(100)); +show create table t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..34839669f25 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries, users; +--enable_warnings + +CREATE TABLE users ( + id INT PRIMARY KEY AUTO_INCREMENT, + name TEXT +) DEFAULT CHARSET UTF8; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + user_id INT UNSIGNED NOT NULL, + title TEXT, + FULLTEXT INDEX (title) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO users (name) VALUES ("alice"); +INSERT INTO users (name) VALUES ("bob"); +INSERT INTO users (name) VALUES ("carlos"); + +SELECT * FROM users; + +INSERT INTO diaries (user_id, title) VALUES (1, "Hello!"); +INSERT INTO diaries (user_id, title) VALUES (2, "my name is bob"); +INSERT INTO diaries (user_id, title) VALUES (3, "my name is carlos"); + +SELECT * FROM diaries; + +SELECT * FROM users + WHERE id IN (SELECT user_id FROM diaries + WHERE MATCH(title) AGAINST("name")) + ORDER BY id DESC; + +DROP TABLE diaries, users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test new file mode 100644 index 00000000000..56ebb430afc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_osx.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TEMPORARY TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (title) VALUES ("cloudy day"); + +SELECT * FROM diaries; + +DROP TEMPORARY TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test b/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test new file mode 100644 index 00000000000..5833f77722a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test @@ -0,0 +1,56 @@ +# Copyright(C) 2011-2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +TRUNCATE TABLE diaries; +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); + +INSERT INTO diaries VALUES(1, 2011, 11, 11, "帰り道", "つかれたー"); +INSERT INTO diaries VALUES(2, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(3, 2011, 12, 2, "初雪", "今年はじめての雪!"); + +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("悪い" IN BOOLEAN MODE); + + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..a6cc1ba7fb2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test @@ -0,0 +1,36 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 text, fulltext index (c2)); +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); + +select * from t1; +update t1 set c2="ta ti tu te" where c1=20; +select * from t1; +select * from t1 where match(c2) against("ti"); +select * from t1 where match(c2) against("ki"); + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e362984f896 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, c1 int, key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +update t1 set c1 = 200 where _id = 2; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d8257e41fb5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test @@ -0,0 +1,33 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (_id int, c1 int, unique key (_id) using hash); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +insert into t1 values(null, 100); +select * from t1; +update t1 set c1 = 200 where _id = 2; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..043ae25aee5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_int.test @@ -0,0 +1,44 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int, c2 int); +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; + +update t1 set c2=c2+100 where c1=1; +select * from t1; +update t1 set c2=c2+100 where c1=2; +select * from t1; +update t1 set c2=c2+100 where c1=3; +select * from t1; + +flush tables; + +update t1 set c1=5, c2=50; +select * from t1; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3ad713cbbde --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test @@ -0,0 +1,48 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_warnings +drop table if exists memos; +--enable_warnings + +create table memos ( + _id int, + content varchar(255), + unique key (_id) using hash +); + +insert into memos values (null, "今夜はさんま。"); +insert into memos values (null, "明日はgroongaをアップデート。"); +insert into memos values (null, "帰りにおだんご。"); +insert into memos values (null, "金曜日は肉の日。"); + +select * from memos; + +insert into memos values (null, "冷蔵庫に牛乳が残り1本。"); +select last_insert_grn_id(); +update memos set content = "冷蔵庫に牛乳はまだたくさんある。" where _id = last_insert_grn_id(); + +select * from memos; + +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/update_virtual_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test new file mode 100644 index 00000000000..f5d85de4043 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test @@ -0,0 +1,43 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--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=""; +# warning WARN_DATA_TRUNCATED +update t1 set _id = 10 where c1 = 1; +select * from t1; +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 +update t1 set _id = 11 where c1 = 1; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c7b2094906b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +SET GLOBAL mroonga_database_path_prefix = "test/mroonga.data/"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_database_path_prefix'; +CREATE DATABASE clean_test; +USE clean_test; + +CREATE TABLE counts ( + id INT PRIMARY KEY AUTO_INCREMENT +); + +--file_exists $MYSQLD_DATADIR/test/mroonga.data/clean_test.mrn + +INSERT INTO counts VALUES (NULL); + +SELECT * FROM counts; + +DROP TABLE counts; +DROP DATABASE clean_test; +USE test; + +SET GLOBAL mroonga_database_path_prefix = NULL; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a61af87fb2b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET @mroonga_default_parser_backup = @@mroonga_default_parser; +SET GLOBAL mroonga_default_parser = "TokenBigramSplitAlpha"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_parser'; +SET GLOBAL mroonga_default_parser = @mroonga_default_parser_backup; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0e8562de92c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET GLOBAL mroonga_default_parser = "TokenBigram"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_parser'; + +--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 new file mode 100644 index 00000000000..b80ac2e8400 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +create table diaries ( + id int primary key auto_increment, + 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; + +set mroonga_dry_write=true; +delete from diaries where id = 1; +select * from diaries; + +set mroonga_dry_write=false; +delete from diaries where id = 1; +select * from diaries; + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..72346c80a6d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +create table diaries ( + id int primary key auto_increment, + 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; + +set mroonga_dry_write=true; +insert into diaries (body) values ("starting groonga..."); +select * from diaries; + +set mroonga_dry_write=false; +insert into diaries (body) values ("started groonga."); +select * from diaries; + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..2100f61700c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists diaries; +--enable_warnings + +create table diaries ( + id int primary key auto_increment, + body text, + fulltext index body_index (body) +) default charset utf8; +show create table diaries; + +insert into diaries (body) values ("will start groonga!"); + +set mroonga_dry_write=true; +update diaries set body = "starting groonga..." where id = 1; +select * from diaries; + +set mroonga_dry_write=false; +update diaries set body = "starting groonga..." where id = 1; +select * from diaries; + +drop table diaries; + +--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 new file mode 100644 index 00000000000..2c2776e5fd8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test @@ -0,0 +1,28 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_100_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; + +--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 new file mode 100644 index 00000000000..e2090cf9659 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test @@ -0,0 +1,28 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_100_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; + +--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 new file mode 100644 index 00000000000..9df4970cacd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test @@ -0,0 +1,27 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +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; + +--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 new file mode 100644 index 00000000000..49394d0a40a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test @@ -0,0 +1,27 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +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; + +--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 new file mode 100644 index 00000000000..77f6adb1713 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test @@ -0,0 +1,25 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET @mroonga_log_file_backup = @@mroonga_log_file; +SET GLOBAL mroonga_log_file = "new-mroonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; +SET GLOBAL mroonga_log_file = @mroonga_log_file_backup; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..254beae17a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test @@ -0,0 +1,22 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET GLOBAL mroonga_log_file = "nonexistent/mroonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..54116467502 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +SET GLOBAL mroonga_log_file = "groonga.log"; +SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file'; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f736be43e6b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test @@ -0,0 +1,61 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +set @mroonga_log_level_backup=@@mroonga_log_level; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=NONE; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=EMERG; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=ALERT; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=CRIT; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=ERROR; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=WARNING; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=NOTICE; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=INFO; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=DEBUG; +show global variables like 'mroonga_log_level'; + +set global mroonga_log_level=DUMP; +show global variables like 'mroonga_log_level'; + +--error ER_WRONG_VALUE_FOR_VAR +set global mroonga_log_level=dummy; + +--error ER_GLOBAL_VARIABLE +set session mroonga_log_level=NOTICE; + +set global mroonga_log_level=@mroonga_log_level_backup; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..55a318b786a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test @@ -0,0 +1,55 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fulltext_index_comment.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +# MySQL <= 5.5 reports wrong a warning. :< +# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. +--disable_warnings +SET GLOBAL mroonga_match_escalation_threshold = -1; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + tags TEXT, + FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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"); + + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" 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); + +SET mroonga_match_escalation_threshold = 0; +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); + + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c459e50c0d7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test @@ -0,0 +1,53 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_fulltext_index_comment.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, + tags TEXT, + FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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"); + + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); + +# MySQL <= 5.5 reports wrong a warning. :< +# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. +--disable_warnings +SET mroonga_match_escalation_threshold = -1; +--enable_warnings +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); + + +DROP TABLE diaries; + +--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 new file mode 100644 index 00000000000..8412e6a65fa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test @@ -0,0 +1,54 @@ +# Copyright(C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +--disable_warnings +DROP TABLE IF EXISTS document; +DROP TABLE IF EXISTS category; +--enable_warnings + +CREATE TABLE category ( + category CHAR(10) PRIMARY KEY +) DEFAULT CHARSET=utf8 + COMMENT='default_tokenizer "TokenDelimit"'; + +CREATE TABLE document ( + id INT NOT NULL, + title TEXT, + categories TEXT COMMENT 'flags "COLUMN_VECTOR", type "category"', + PRIMARY KEY(id) +) DEFAULT CHARSET=utf8; + +SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; + +INSERT INTO document VALUES(1, "Mroonga is the fastest search engine", "it database fulltext"); +SELECT id, title, categories FROM document; + +SET GLOBAL mroonga_vector_column_delimiter = ';'; + +SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; + +SELECT id, title, categories FROM document; + +DROP TABLE document; +DROP TABLE category; + +SET GLOBAL mroonga_vector_column_delimiter = ' '; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..ff47f2c921d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test @@ -0,0 +1,22 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +# show variables like 'groonga%'; +show variables like 'mroonga_version'; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..22dbbff96ac --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS diaries; +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 +1 survey +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; +id title body +1 survey will start groonga! +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga..."); +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +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_change_column_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result new file mode 100644 index 00000000000..af302b5a2a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; +ALTER TABLE bugs +CHANGE COLUMN +tag +tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.'; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tag` varchar(64) DEFAULT NULL COMMENT 'It must consist of only alphabet and number.', + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"' +DROP TABLE bugs; 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 new file mode 100644 index 00000000000..e5ce4692aa3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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 +INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); +INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND +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 * FROM diaries +WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND +MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +id title body +1 survey will start groonga! +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AND +MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +id title body +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..1106fcffca2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT AUTO_INCREMENT PRIMARY KEY, +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 * FROM memos; +id title content +1 Hello I start to write memos! +2 groonga I start to use groonga! +3 mroonga I use mroonga too! +SELECT * FROM memos WHERE MATCH(content) AGAINST("start" IN BOOLEAN MODE); +id title content +1 Hello I start to write memos! +2 groonga I start to use groonga! +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_create_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_create_fulltext.result new file mode 100644 index 00000000000..b185bf269f7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_create_fulltext.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +CREATE FULLTEXT INDEX title_index on diaries (title); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_fulltext.result new file mode 100644 index 00000000000..e71132be139 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_fulltext.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_multiple_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_multiple_column.result new file mode 100644 index 00000000000..1fefc1d98e6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_multiple_column.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY title_and_created_at_index (title, created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_normal.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_normal.result new file mode 100644 index 00000000000..d115cefb243 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_normal.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY created_at_index (created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_primary.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_primary.result new file mode 100644 index 00000000000..47649911bb1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_primary.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +ALTER TABLE diaries DISABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_updating.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_updating.result new file mode 100644 index 00000000000..06e1a12db55 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_updating.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +c1 int NOT NULL, +c2 text NOT NULL, +c3 int NOT NULL, +c4 int NOT NULL, +PRIMARY KEY(c1), +KEY idx1(c3,c4), +FULLTEXT KEY ft1(c2) +) COMMENT='ENGINE "MyISAM"' DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES(1, 'test1', 1, 1); +INSERT INTO t1 VALUES(2, 'test2', 2, 2); +INSERT INTO t1 VALUES(3, 'test3', 1, 3); +ALTER TABLE t1 DISABLE KEYS; +DELETE FROM t1 WHERE c1 = 2; +UPDATE t1 SET c4 = 4 WHERE c1 = 1; +INSERT INTO t1 VALUES(4, 'test4', 2, 4); +TRUNCATE t1; +DROP TABLE t1; 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 new file mode 100644 index 00000000000..07c149a8fa8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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 +INSERT INTO diaries (title) values ("groonga (1)"); +INSERT INTO diaries (title) values ("groonga (2)"); +SELECT * FROM diaries; +id title +1 survey +2 groonga (1) +3 groonga (2) +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_fulltext.result new file mode 100644 index 00000000000..b9a0f545965 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_fulltext.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +FULLTEXT KEY title_index (title) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_index) +WHERE MATCH (title) AGAINST ("富士山"); +id title +3 富士山 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_lock_tables.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_lock_tables.result new file mode 100644 index 00000000000..341cc4f7de7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_lock_tables.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS memos; +CREATE TABLE IF NOT EXISTS memos ( +id VARCHAR(45) NOT NULL PRIMARY KEY, +text TEXT NOT NULL, +FULLTEXT KEY (text) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; +LOCK TABLES memos WRITE; +ALTER TABLE memos DISABLE KEYS; +INSERT INTO memos +VALUES (00000, 'text0'), +(00001, 'text1'), +(00002, 'text2'); +ALTER TABLE memos ENABLE KEYS; +UNLOCK TABLES; +SELECT * FROM memos; +id text +0 text0 +1 text1 +2 text2 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_multiple_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_multiple_column.result new file mode 100644 index 00000000000..21f6b9089bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_multiple_column.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY title_and_created_at_index (title, created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (title_and_created_at_index) +WHERE title = "天気" AND +created_at = "2012-04-30 23:00:00"; +id title created_at +2 天気 2012-04-30 23:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_normal.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_normal.result new file mode 100644 index 00000000000..2ba4f1b6386 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_normal.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255), +created_at datetime, +KEY created_at_index (created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (created_at_index) +WHERE created_at = "2012-04-30 20:00:00"; +id title created_at +1 Hello 2012-04-30 20:00:00 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_primary.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_primary.result new file mode 100644 index 00000000000..a1ee9013b6b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_primary.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +title varchar(255) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; +ALTER TABLE diaries DISABLE KEYS; +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +ALTER TABLE diaries ENABLE KEYS; +SELECT * +FROM diaries +FORCE INDEX (PRIMARY) +WHERE id = 2; +id title +2 天気 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..cc64daac30a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result @@ -0,0 +1,52 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +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 +1 survey +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; +id title body +1 survey will start groonga! +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga..."); +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +ALTER TABLE diaries ADD FULLTEXT INDEX body_index (body); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey") AND +MATCH(body) AGAINST("groonga"); +id title body +1 survey will start groonga! +SELECT * FROM diaries +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 new file mode 100644 index 00000000000..08e526baa50 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS diaries, memos; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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 +1 survey will start groonga! +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("groonga") AND +MATCH(body) AGAINST("starting"); +id title body +ALTER TABLE diaries RENAME memos; +SELECT * FROM memos; +id title body +1 survey will start groonga! +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 new file mode 100644 index 00000000000..fc38afc72d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result @@ -0,0 +1,131 @@ +DROP TABLE IF EXISTS shops; +CREATE TABLE shops ( +id INT PRIMARY KEY AUTO_INCREMENT, +name TEXT, +location GEOMETRY NOT NULL +) COMMENT = 'ENGINE "InnoDB"'; +INSERT INTO shops (name, location) +VALUES ('nezu-no-taiyaki', +GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) +VALUES ('taiyaki-kataoka', +GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) +VALUES ('soba-taiyaki-ku', +GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) +VALUES ('kuruma', +GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) +VALUES ('hirose-ya', +GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) +VALUES ('sazare', +GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) +VALUES ('omede-taiyaki', +GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) +VALUES ('onaga-ya', +GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) +VALUES ('shiro-ya', +GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) +VALUES ('fuji-ya', +GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) +VALUES ('miyoshi', +GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) +VALUES ('juju-ya', +GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) +VALUES ('tatsumi-ya', +GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) +VALUES ('tetsuji', +GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) +VALUES ('gazuma-ya', +GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) +VALUES ('honma-mon', +GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) +VALUES ('naniwa-ya', +GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) +VALUES ('kuro-dai', +GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) +VALUES ('daruma', +GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) +VALUES ('yanagi-ya', +GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) +VALUES ('sharaku', +GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) +VALUES ('takane', +GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) +VALUES ('chiyoda', +GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) +VALUES ('da-ka-po', +GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) +VALUES ('matsushima-ya', +GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) +VALUES ('kazuya', +GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) +VALUES ('furuya-kogane-an', +GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) +VALUES ('hachi-no-ie', +GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) +VALUES ('azuki-chan', +GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) +VALUES ('kuriko-an', +GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) +VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', +GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) +VALUES ('naze-ya', +GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) +VALUES ('sanoki-ya', +GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) +VALUES ('shigeta', +GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) +VALUES ('nishimi-ya', +GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) +VALUES ('hiiragi', +GeomFromText('POINT(139.711517 35.647701)')); +ALTER TABLE shops ADD SPATIAL KEY location_index (location); +SELECT id, name, AsText(location) AS location_text FROM shops +WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +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/auto_increment_text.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/auto_increment_text.result new file mode 100644 index 00000000000..9d45d2fe63d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/auto_increment_text.result @@ -0,0 +1,15 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +body text +) comment = 'engine "innodb"'; +insert into diaries (body) values ("started groonga (long text)"); +select * from diaries; +id body +1 started groonga (long text) +insert into diaries (body) values ("sleeping... (short text)"); +select * from diaries; +id body +1 started groonga (long text) +2 sleeping... (short text) +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/binlog_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/binlog_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..f0792094a34 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/binlog_TODO_SPLIT_ME.result @@ -0,0 +1,34 @@ +drop table if exists t1; +show variables like 'log_bin'; +Variable_name Value +log_bin ON +set binlog_format="STATEMENT"; +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; +set binlog_format="ROW"; +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; +set binlog_format="MIXED"; +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +c1 c2 +1 100 +2 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_comment_index_not_for_mroonga.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_comment_index_not_for_mroonga.result new file mode 100644 index 00000000000..b1a7c8efb89 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_comment_index_not_for_mroonga.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64), +INDEX (tag) COMMENT 'Tag search is required.' +) DEFAULT CHARSET=utf8 +COMMENT='engine "InnoDB"'; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tag` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `tag` (`tag`) COMMENT 'Tag search is required.' +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"' +DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result new file mode 100644 index 00000000000..2679079664e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS bugs; +CREATE TABLE bugs ( +id INT UNSIGNED PRIMARY KEY, +tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.' +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; +SHOW CREATE TABLE bugs; +Table Create Table +bugs CREATE TABLE `bugs` ( + `id` int(10) unsigned NOT NULL, + `tag` varchar(64) DEFAULT NULL COMMENT 'It must consist of only alphabet and number.', + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"' +DROP TABLE bugs; 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 new file mode 100644 index 00000000000..6b29be5edb7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries_innodb; +DROP TABLE IF EXISTS diaries_mroonga; +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 type possible_keys key key_len ref rows Extra +1 SIMPLE diaries_innodb index NULL flag 2 NULL 3 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 +DROP TABLE diaries_innodb; +DROP TABLE diaries_mroonga; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..b3814331038 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result @@ -0,0 +1,109 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +create table t2 (c1 int primary key) COMMENT = 'engine "innodb"'; +create table t3 (c1 int primary key) COMMENT = 'engine "innodb"'; +drop table t1,t2,t3; +create table t1 (c1 int primary key, c2 int, c3 int) COMMENT = 'engine "innodb"'; +drop table t1; +create table t1 (c1 bit primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 bit(1) NO PRI NULL +drop table t1; +create table t1 (c1 tinyint primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 tinyint(4) NO PRI NULL +drop table t1; +create table t1 (c1 smallint primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 smallint(6) NO PRI NULL +drop table t1; +create table t1 (c1 mediumint primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 mediumint(9) NO PRI NULL +drop table t1; +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 int(11) NO PRI NULL +drop table t1; +create table t1 (c1 bigint primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 bigint(20) NO PRI NULL +drop table t1; +create table t1 (c1 double primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 double NO PRI NULL +drop table t1; +create table t1 (c1 float primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 float NO PRI NULL +drop table t1; +create table t1 (c1 decimal primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 decimal(10,0) NO PRI NULL +drop table t1; +create table t1 (c1 date primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 date NO PRI NULL +drop table t1; +create table t1 (c1 time primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 time NO PRI NULL +drop table t1; +create table t1 (c1 timestamp primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 timestamp NO PRI CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +drop table t1; +create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 datetime NO PRI NULL +drop table t1; +create table t1 (c1 year primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 year(4) NO PRI NULL +drop table t1; +create table t1 (c1 char(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 char(10) NO PRI NULL +drop table t1; +create table t1 (c1 varchar(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 varchar(10) NO PRI NULL +drop table t1; +create table t1 (c1 binary(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 binary(10) NO PRI NULL +drop table t1; +create table t1 (c1 varbinary(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 varbinary(10) NO PRI NULL +drop table t1; +create table t1 (c1 enum("yes","no") primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 enum('yes','no') NO PRI NULL +drop table t1; +create table t1 (c1 set("A","B","AB","O") primary key) COMMENT = 'engine "innodb"'; +desc t1; +Field Type Null Key Default Extra +c1 set('A','B','AB','O') NO PRI NULL +drop table t1; +create table t1 (c1 int) COMMENT = 'engine "innodb"'; +ERROR 42000: This table type requires a primary key 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 new file mode 100644 index 00000000000..ce1b5470231 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS bugs; +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"' +DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index.result new file mode 100644 index 00000000000..ea992f827ca --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index.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"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +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/wrapper/r/delete_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..990537622f4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_TODO_SPLIT_ME.result @@ -0,0 +1,55 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int) COMMENT 'engine = "innodb"'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine = "innodb"' +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +insert into t1 values (4, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +4 102 +delete from t1 where c1=3; +select * from t1; +c1 c2 +1 100 +2 101 +4 102 +flush tables; +delete from t1 where c1=2; +select * from t1; +c1 c2 +1 100 +4 102 +delete from t1; +select * from t1; +c1 c2 +drop table t1; +create table t1 (c1 int primary key, c2 text, fulltext index (c2)) COMMENT 'engine = "innodb"'; +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); +select * from t1; +c1 c2 +10 aa ii uu ee +20 ka ki ku ke +30 sa si su se +select * from t1 where match(c2) against("ki"); +c1 c2 +20 ka ki ku ke +delete from t1 where c1=20; +select * from t1; +c1 c2 +10 aa ii uu ee +30 sa si su se +select * from t1 where match(c2) against("ki"); +c1 c2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_all.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_all.result new file mode 100644 index 00000000000..200e978a582 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_all.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS users; +SET NAMES utf8; +CREATE TABLE users ( +id int PRIMARY KEY, +name varchar(100), +FULLTEXT INDEX (name) +) COMMENT 'engine = "InnoDB"' DEFAULT CHARSET=utf8; +INSERT INTO users VALUES (1, 'Alice'); +INSERT INTO users VALUES (2, 'Bob'); +INSERT INTO users VALUES (3, 'Chris'); +SELECT * FROM users; +id name +1 Alice +2 Bob +3 Chris +DELETE FROM users; +SELECT * FROM users; +id name +DROP TABLE users; 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 new file mode 100644 index 00000000000..08c37695f5a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +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, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT * FROM diaries WHERE MATCH(content) AGAINST("-明日 +天気" IN BOOLEAN MODE); +id title content +3 富士山 今日も天気がよくてきれいに見える。 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..b0bff284532 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT PRIMARY KEY, +title VARCHAR(255), +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日", "今日も天気がよくてきれいに見える。"); +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); +COUNT(*) +1 +SELECT * FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); +id title content +3 天気 4月4日 今日も天気がよくてきれいに見える。 +SELECT 1 FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); +1 +1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result new file mode 100644 index 00000000000..190105a3ba1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- fine is be" IN BOOLEAN MODE); +id content +6 Yesterday was fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result new file mode 100644 index 00000000000..240da5c357f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- is OR be fine" IN BOOLEAN MODE); +id content +1 Today is good day. +2 Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result new file mode 100644 index 00000000000..6dedd2183eb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D- good +day be" IN BOOLEAN MODE); +id content +1 Today is good day. +3 Yesterday was good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result new file mode 100644 index 00000000000..14d30fac260 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today good" IN BOOLEAN MODE); +id content +1 Today is good day. +3 Today is fine. +2 Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result new file mode 100644 index 00000000000..d367ba1d21f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today -good tomorrow" IN BOOLEAN MODE); +id content +2 Tomorrow will be good day. +3 Today is fine. +4 Tomorrow will be fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result new file mode 100644 index 00000000000..6bf48ab6556 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*DOR today +good tomorrow" IN BOOLEAN MODE); +id content +1 Today is good day. +2 Tomorrow will be good day. +4 Tomorrow will be fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result new file mode 100644 index 00000000000..29975d55137 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today good" IN BOOLEAN MODE); +id content +1 Today is good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result new file mode 100644 index 00000000000..2294308ae92 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today -good is" IN BOOLEAN MODE); +id content +3 Today is fine. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result new file mode 100644 index 00000000000..b61f0637bb9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY AUTO_INCREMENT, +content TEXT, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("*D+ today OR tomorrow day" IN BOOLEAN MODE); +id content +1 Today is good day. +2 Tomorrow will be good day. +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_full_spec.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_full_spec.result new file mode 100644 index 00000000000..e603cc27401 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_full_spec.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 COMMENT='ENGINE "InnoDB"'; +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT *, MATCH(title, content) +AGAINST("*W1:10,2:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1:10,2:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 12 +3 富士山 今日も天気がよくてきれいに見える。 2 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_no_weight.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_no_weight.result new file mode 100644 index 00000000000..6a5dbd5ca6b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_no_weight.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 COMMENT='ENGINE "InnoDB"'; +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT *, MATCH(title, content) +AGAINST("*W1,2:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1,2:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 3 +3 富士山 今日も天気がよくてきれいに見える。 2 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_omit_section.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_omit_section.result new file mode 100644 index 00000000000..2fe63a68f77 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_omit_section.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 COMMENT='ENGINE "InnoDB"'; +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT *, MATCH(title, content) +AGAINST("*W1:2 +天気" in BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title, content) +AGAINST("*W1:2 +天気" in BOOLEAN MODE); +id title content score +2 天気 明日の富士山の天気について 3 +3 富士山 今日も天気がよくてきれいに見える。 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_ascii.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_ascii.result new file mode 100644 index 00000000000..b58f4ad3364 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_ascii.result @@ -0,0 +1,29 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "innodb"'; +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"); +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 +select * from t1 where match(c3) against("su"); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("ii"); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +select * from t1 where match(c3) against("+su" in boolean mode); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("+ii" in boolean mode); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_cp932.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_cp932.result new file mode 100644 index 00000000000..d7b64010ebf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_cp932.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932 COMMENT = 'engine "innodb"'; +insert into t1 values(1, "̕xmR̓VCɂ‚",""); +insert into t1 values(2, "","̕xmR̓VC͕܂"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 ̕xmR̓VCɂ‚ +2 ̕xmR̓VC͕܂ +3 dummy dummy +select * from t1 where match(c2) against("xmR"); +c1 c2 c3 +1 ̕xmR̓VCɂ‚ +select * from t1 where match(c3) against("xmR"); +c1 c2 c3 +2 ̕xmR̓VC͕܂ +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_eucjpms.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_eucjpms.result new file mode 100644 index 00000000000..9aa60690513 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_eucjpms.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms COMMENT = 'engine "innodb"'; +insert into t1 values(1, "ٻλŷˤĤ",""); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 ٻλŷˤĤ +2 ٻλŷʬޤ +3 dummy dummy +select * from t1 where match(c2) against("ٻλ"); +c1 c2 c3 +1 ٻλŷˤĤ +select * from t1 where match(c3) against("ٻλ"); +c1 c2 c3 +2 ٻλŷʬޤ +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_japanese.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_japanese.result new file mode 100644 index 00000000000..6c73f4627bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_japanese.result @@ -0,0 +1,18 @@ +drop table if exists t1, t2, t3; +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8 COMMENT = 'engine "innodb"'; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 明日の富士山の天気について あああああああ +2 いいいいい 明日の富士山の天気は分かりません +3 dummy dummy +select * from t1 where match(c2) against("富士山"); +c1 c2 c3 +1 明日の富士山の天気について あああああああ +select * from t1 where match(c3) against("富士山"); +c1 c2 c3 +2 いいいいい 明日の富士山の天気は分かりません +drop table t1; 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 new file mode 100644 index 00000000000..fd07ea67964 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result @@ -0,0 +1,41 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8; +CREATE TABLE diaries ( +id int PRIMARY KEY, +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, "富士山", "今日もきれい。"); +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); +id title content +3 富士山 今日もきれい。 +DROP INDEX title ON diaries; +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +SELECT * FROM diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +CREATE FULLTEXT INDEX new_title_index ON diaries (title); +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); +id title content +3 富士山 今日もきれい。 +SELECT * FROM diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..03300e3e9ef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result @@ -0,0 +1,66 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8 COMMENT = 'engine "innodb"'; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8 COMMENT = 'engine "innodb"'; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t2; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t2 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t1 where c1>3 order by c1 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c1>3 order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c2>"s" order by c2 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c2>"s" order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select *,match(c2) against("ii") from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +c1 c2 match(c2) against("ii") +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +1 aa ii uu ee oo 174763 +select *,match(c2) against("ii") from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +5 ta ti ii ii to 349526 +3 aa ii ii ii oo 524289 +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +drop table t1,t2; 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 new file mode 100644 index 00000000000..8e1b0845e85 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result @@ -0,0 +1,25 @@ +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"); +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +flush tables; +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +drop table t1; 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 new file mode 100644 index 00000000000..3809006038c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result @@ -0,0 +1,4389 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +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"); +insert into diaries values(2, "2011-07-16"); +insert into diaries values(3, "2011-07-17"); +insert into diaries values(4, "2011-07-18"); +insert into diaries values(5, "2011-07-19"); +insert into diaries values(6, "2011-07-20"); +insert into diaries values(7, "2011-07-21"); +insert into diaries values(8, "2011-07-22"); +insert into diaries values(9, "2011-07-23"); +insert into diaries values(10, "2011-07-24"); +insert into diaries values(11, "2011-07-25"); +insert into diaries values(12, "2011-07-26"); +insert into diaries values(13, "2011-07-27"); +insert into diaries values(14, "2011-07-28"); +insert into diaries values(15, "2011-07-29"); +insert into diaries values(16, "2011-07-30"); +insert into diaries values(17, "2011-07-31"); +insert into diaries values(18, "2011-08-01"); +insert into diaries values(19, "2011-08-02"); +insert into diaries values(20, "2011-08-03"); +insert into diaries values(21, "2011-08-04"); +insert into diaries values(22, "2011-08-05"); +insert into diaries values(23, "2011-08-06"); +insert into diaries values(24, "2011-08-07"); +insert into diaries values(25, "2011-08-08"); +insert into diaries values(26, "2011-08-09"); +insert into diaries values(27, "2011-08-10"); +insert into diaries values(28, "2011-08-11"); +insert into diaries values(29, "2011-08-12"); +insert into diaries values(30, "2011-08-13"); +insert into diaries values(31, "2011-08-14"); +insert into diaries values(32, "2011-08-15"); +insert into diaries values(33, "2011-08-16"); +insert into diaries values(34, "2011-08-17"); +insert into diaries values(35, "2011-08-18"); +insert into diaries values(36, "2011-08-19"); +insert into diaries values(37, "2011-08-20"); +insert into diaries values(38, "2011-08-21"); +insert into diaries values(39, "2011-08-22"); +insert into diaries values(40, "2011-08-23"); +insert into diaries values(41, "2011-08-24"); +insert into diaries values(42, "2011-08-25"); +insert into diaries values(43, "2011-08-26"); +insert into diaries values(44, "2011-08-27"); +insert into diaries values(45, "2011-08-28"); +insert into diaries values(46, "2011-08-29"); +insert into diaries values(47, "2011-08-30"); +insert into diaries values(48, "2011-08-31"); +insert into diaries values(49, "2011-09-01"); +insert into diaries values(50, "2011-09-02"); +insert into diaries values(51, "2011-09-03"); +insert into diaries values(52, "2011-09-04"); +insert into diaries values(53, "2011-09-05"); +insert into diaries values(54, "2011-09-06"); +insert into diaries values(55, "2011-09-07"); +insert into diaries values(56, "2011-09-08"); +insert into diaries values(57, "2011-09-09"); +insert into diaries values(58, "2011-09-10"); +insert into diaries values(59, "2011-09-11"); +insert into diaries values(60, "2011-09-12"); +insert into diaries values(61, "2011-09-13"); +insert into diaries values(62, "2011-09-14"); +insert into diaries values(63, "2011-09-15"); +insert into diaries values(64, "2011-09-16"); +insert into diaries values(65, "2011-09-17"); +insert into diaries values(66, "2011-09-18"); +insert into diaries values(67, "2011-09-19"); +insert into diaries values(68, "2011-09-20"); +insert into diaries values(69, "2011-09-21"); +insert into diaries values(70, "2011-09-22"); +insert into diaries values(71, "2011-09-23"); +insert into diaries values(72, "2011-09-24"); +insert into diaries values(73, "2011-09-25"); +insert into diaries values(74, "2011-09-26"); +insert into diaries values(75, "2011-09-27"); +insert into diaries values(76, "2011-09-28"); +insert into diaries values(77, "2011-09-29"); +insert into diaries values(78, "2011-09-30"); +insert into diaries values(79, "2011-10-01"); +insert into diaries values(80, "2011-10-02"); +insert into diaries values(81, "2011-10-03"); +insert into diaries values(82, "2011-10-04"); +insert into diaries values(83, "2011-10-05"); +insert into diaries values(84, "2011-10-06"); +insert into diaries values(85, "2011-10-07"); +insert into diaries values(86, "2011-10-08"); +insert into diaries values(87, "2011-10-09"); +insert into diaries values(88, "2011-10-10"); +insert into diaries values(89, "2011-10-11"); +insert into diaries values(90, "2011-10-12"); +insert into diaries values(91, "2011-10-13"); +insert into diaries values(92, "2011-10-14"); +insert into diaries values(93, "2011-10-15"); +insert into diaries values(94, "2011-10-16"); +insert into diaries values(95, "2011-10-17"); +insert into diaries values(96, "2011-10-18"); +insert into diaries values(97, "2011-10-19"); +insert into diaries values(98, "2011-10-20"); +insert into diaries values(99, "2011-10-21"); +insert into diaries values(100, "2011-10-22"); +insert into diaries values(101, "2011-10-23"); +insert into diaries values(102, "2011-10-24"); +insert into diaries values(103, "2011-10-25"); +insert into diaries values(104, "2011-10-26"); +insert into diaries values(105, "2011-10-27"); +insert into diaries values(106, "2011-10-28"); +insert into diaries values(107, "2011-10-29"); +insert into diaries values(108, "2011-10-30"); +insert into diaries values(109, "2011-10-31"); +insert into diaries values(110, "2011-11-01"); +insert into diaries values(111, "2011-11-02"); +insert into diaries values(112, "2011-11-03"); +insert into diaries values(113, "2011-11-04"); +insert into diaries values(114, "2011-11-05"); +insert into diaries values(115, "2011-11-06"); +insert into diaries values(116, "2011-11-07"); +insert into diaries values(117, "2011-11-08"); +insert into diaries values(118, "2011-11-09"); +insert into diaries values(119, "2011-11-10"); +insert into diaries values(120, "2011-11-11"); +insert into diaries values(121, "2011-11-12"); +insert into diaries values(122, "2011-11-13"); +insert into diaries values(123, "2011-11-14"); +insert into diaries values(124, "2011-11-15"); +insert into diaries values(125, "2011-11-16"); +insert into diaries values(126, "2011-11-17"); +insert into diaries values(127, "2011-11-18"); +insert into diaries values(128, "2011-11-19"); +insert into diaries values(129, "2011-11-20"); +insert into diaries values(130, "2011-11-21"); +insert into diaries values(131, "2011-11-22"); +insert into diaries values(132, "2011-11-23"); +insert into diaries values(133, "2011-11-24"); +insert into diaries values(134, "2011-11-25"); +insert into diaries values(135, "2011-11-26"); +insert into diaries values(136, "2011-11-27"); +insert into diaries values(137, "2011-11-28"); +insert into diaries values(138, "2011-11-29"); +insert into diaries values(139, "2011-11-30"); +insert into diaries values(140, "2011-12-01"); +insert into diaries values(141, "2011-12-02"); +insert into diaries values(142, "2011-12-03"); +insert into diaries values(143, "2011-12-04"); +insert into diaries values(144, "2011-12-05"); +insert into diaries values(145, "2011-12-06"); +insert into diaries values(146, "2011-12-07"); +insert into diaries values(147, "2011-12-08"); +insert into diaries values(148, "2011-12-09"); +insert into diaries values(149, "2011-12-10"); +insert into diaries values(150, "2011-12-11"); +insert into diaries values(151, "2011-12-12"); +insert into diaries values(152, "2011-12-13"); +insert into diaries values(153, "2011-12-14"); +insert into diaries values(154, "2011-12-15"); +insert into diaries values(155, "2011-12-16"); +insert into diaries values(156, "2011-12-17"); +insert into diaries values(157, "2011-12-18"); +insert into diaries values(158, "2011-12-19"); +insert into diaries values(159, "2011-12-20"); +insert into diaries values(160, "2011-12-21"); +insert into diaries values(161, "2011-12-22"); +insert into diaries values(162, "2011-12-23"); +insert into diaries values(163, "2011-12-24"); +insert into diaries values(164, "2011-12-25"); +insert into diaries values(165, "2011-12-26"); +insert into diaries values(166, "2011-12-27"); +insert into diaries values(167, "2011-12-28"); +insert into diaries values(168, "2011-12-29"); +insert into diaries values(169, "2011-12-30"); +insert into diaries values(170, "2011-12-31"); +insert into diaries values(171, "2012-01-01"); +insert into diaries values(172, "2012-01-02"); +insert into diaries values(173, "2012-01-03"); +insert into diaries values(174, "2012-01-04"); +insert into diaries values(175, "2012-01-05"); +insert into diaries values(176, "2012-01-06"); +insert into diaries values(177, "2012-01-07"); +insert into diaries values(178, "2012-01-08"); +insert into diaries values(179, "2012-01-09"); +insert into diaries values(180, "2012-01-10"); +insert into diaries values(181, "2012-01-11"); +insert into diaries values(182, "2012-01-12"); +insert into diaries values(183, "2012-01-13"); +insert into diaries values(184, "2012-01-14"); +insert into diaries values(185, "2012-01-15"); +insert into diaries values(186, "2012-01-16"); +insert into diaries values(187, "2012-01-17"); +insert into diaries values(188, "2012-01-18"); +insert into diaries values(189, "2012-01-19"); +insert into diaries values(190, "2012-01-20"); +insert into diaries values(191, "2012-01-21"); +insert into diaries values(192, "2012-01-22"); +insert into diaries values(193, "2012-01-23"); +insert into diaries values(194, "2012-01-24"); +insert into diaries values(195, "2012-01-25"); +insert into diaries values(196, "2012-01-26"); +insert into diaries values(197, "2012-01-27"); +insert into diaries values(198, "2012-01-28"); +insert into diaries values(199, "2012-01-29"); +insert into diaries values(200, "2012-01-30"); +insert into diaries values(201, "2012-01-31"); +insert into diaries values(202, "2012-02-01"); +insert into diaries values(203, "2012-02-02"); +insert into diaries values(204, "2012-02-03"); +insert into diaries values(205, "2012-02-04"); +insert into diaries values(206, "2012-02-05"); +insert into diaries values(207, "2012-02-06"); +insert into diaries values(208, "2012-02-07"); +insert into diaries values(209, "2012-02-08"); +insert into diaries values(210, "2012-02-09"); +insert into diaries values(211, "2012-02-10"); +insert into diaries values(212, "2012-02-11"); +insert into diaries values(213, "2012-02-12"); +insert into diaries values(214, "2012-02-13"); +insert into diaries values(215, "2012-02-14"); +insert into diaries values(216, "2012-02-15"); +insert into diaries values(217, "2012-02-16"); +insert into diaries values(218, "2012-02-17"); +insert into diaries values(219, "2012-02-18"); +insert into diaries values(220, "2012-02-19"); +insert into diaries values(221, "2012-02-20"); +insert into diaries values(222, "2012-02-21"); +insert into diaries values(223, "2012-02-22"); +insert into diaries values(224, "2012-02-23"); +insert into diaries values(225, "2012-02-24"); +insert into diaries values(226, "2012-02-25"); +insert into diaries values(227, "2012-02-26"); +insert into diaries values(228, "2012-02-27"); +insert into diaries values(229, "2012-02-28"); +insert into diaries values(230, "2012-02-29"); +insert into diaries values(231, "2012-03-01"); +insert into diaries values(232, "2012-03-02"); +insert into diaries values(233, "2012-03-03"); +insert into diaries values(234, "2012-03-04"); +insert into diaries values(235, "2012-03-05"); +insert into diaries values(236, "2012-03-06"); +insert into diaries values(237, "2012-03-07"); +insert into diaries values(238, "2012-03-08"); +insert into diaries values(239, "2012-03-09"); +insert into diaries values(240, "2012-03-10"); +insert into diaries values(241, "2012-03-11"); +insert into diaries values(242, "2012-03-12"); +insert into diaries values(243, "2012-03-13"); +insert into diaries values(244, "2012-03-14"); +insert into diaries values(245, "2012-03-15"); +insert into diaries values(246, "2012-03-16"); +insert into diaries values(247, "2012-03-17"); +insert into diaries values(248, "2012-03-18"); +insert into diaries values(249, "2012-03-19"); +insert into diaries values(250, "2012-03-20"); +insert into diaries values(251, "2012-03-21"); +insert into diaries values(252, "2012-03-22"); +insert into diaries values(253, "2012-03-23"); +insert into diaries values(254, "2012-03-24"); +insert into diaries values(255, "2012-03-25"); +insert into diaries values(256, "2012-03-26"); +insert into diaries values(257, "2012-03-27"); +insert into diaries values(258, "2012-03-28"); +insert into diaries values(259, "2012-03-29"); +insert into diaries values(260, "2012-03-30"); +insert into diaries values(261, "2012-03-31"); +insert into diaries values(262, "2012-04-01"); +insert into diaries values(263, "2012-04-02"); +insert into diaries values(264, "2012-04-03"); +insert into diaries values(265, "2012-04-04"); +insert into diaries values(266, "2012-04-05"); +insert into diaries values(267, "2012-04-06"); +insert into diaries values(268, "2012-04-07"); +insert into diaries values(269, "2012-04-08"); +insert into diaries values(270, "2012-04-09"); +insert into diaries values(271, "2012-04-10"); +insert into diaries values(272, "2012-04-11"); +insert into diaries values(273, "2012-04-12"); +insert into diaries values(274, "2012-04-13"); +insert into diaries values(275, "2012-04-14"); +insert into diaries values(276, "2012-04-15"); +insert into diaries values(277, "2012-04-16"); +insert into diaries values(278, "2012-04-17"); +insert into diaries values(279, "2012-04-18"); +insert into diaries values(280, "2012-04-19"); +insert into diaries values(281, "2012-04-20"); +insert into diaries values(282, "2012-04-21"); +insert into diaries values(283, "2012-04-22"); +insert into diaries values(284, "2012-04-23"); +insert into diaries values(285, "2012-04-24"); +insert into diaries values(286, "2012-04-25"); +insert into diaries values(287, "2012-04-26"); +insert into diaries values(288, "2012-04-27"); +insert into diaries values(289, "2012-04-28"); +insert into diaries values(290, "2012-04-29"); +insert into diaries values(291, "2012-04-30"); +insert into diaries values(292, "2012-05-01"); +insert into diaries values(293, "2012-05-02"); +insert into diaries values(294, "2012-05-03"); +insert into diaries values(295, "2012-05-04"); +insert into diaries values(296, "2012-05-05"); +insert into diaries values(297, "2012-05-06"); +insert into diaries values(298, "2012-05-07"); +insert into diaries values(299, "2012-05-08"); +insert into diaries values(300, "2012-05-09"); +insert into diaries values(301, "2012-05-10"); +insert into diaries values(302, "2012-05-11"); +insert into diaries values(303, "2012-05-12"); +insert into diaries values(304, "2012-05-13"); +insert into diaries values(305, "2012-05-14"); +insert into diaries values(306, "2012-05-15"); +insert into diaries values(307, "2012-05-16"); +insert into diaries values(308, "2012-05-17"); +insert into diaries values(309, "2012-05-18"); +insert into diaries values(310, "2012-05-19"); +insert into diaries values(311, "2012-05-20"); +insert into diaries values(312, "2012-05-21"); +insert into diaries values(313, "2012-05-22"); +insert into diaries values(314, "2012-05-23"); +insert into diaries values(315, "2012-05-24"); +insert into diaries values(316, "2012-05-25"); +insert into diaries values(317, "2012-05-26"); +insert into diaries values(318, "2012-05-27"); +insert into diaries values(319, "2012-05-28"); +insert into diaries values(320, "2012-05-29"); +insert into diaries values(321, "2012-05-30"); +insert into diaries values(322, "2012-05-31"); +insert into diaries values(323, "2012-06-01"); +insert into diaries values(324, "2012-06-02"); +insert into diaries values(325, "2012-06-03"); +insert into diaries values(326, "2012-06-04"); +insert into diaries values(327, "2012-06-05"); +insert into diaries values(328, "2012-06-06"); +insert into diaries values(329, "2012-06-07"); +insert into diaries values(330, "2012-06-08"); +insert into diaries values(331, "2012-06-09"); +insert into diaries values(332, "2012-06-10"); +insert into diaries values(333, "2012-06-11"); +insert into diaries values(334, "2012-06-12"); +insert into diaries values(335, "2012-06-13"); +insert into diaries values(336, "2012-06-14"); +insert into diaries values(337, "2012-06-15"); +insert into diaries values(338, "2012-06-16"); +insert into diaries values(339, "2012-06-17"); +insert into diaries values(340, "2012-06-18"); +insert into diaries values(341, "2012-06-19"); +insert into diaries values(342, "2012-06-20"); +insert into diaries values(343, "2012-06-21"); +insert into diaries values(344, "2012-06-22"); +insert into diaries values(345, "2012-06-23"); +insert into diaries values(346, "2012-06-24"); +insert into diaries values(347, "2012-06-25"); +insert into diaries values(348, "2012-06-26"); +insert into diaries values(349, "2012-06-27"); +insert into diaries values(350, "2012-06-28"); +insert into diaries values(351, "2012-06-29"); +insert into diaries values(352, "2012-06-30"); +insert into diaries values(353, "2012-07-01"); +insert into diaries values(354, "2012-07-02"); +insert into diaries values(355, "2012-07-03"); +insert into diaries values(356, "2012-07-04"); +insert into diaries values(357, "2012-07-05"); +insert into diaries values(358, "2012-07-06"); +insert into diaries values(359, "2012-07-07"); +insert into diaries values(360, "2012-07-08"); +insert into diaries values(361, "2012-07-09"); +insert into diaries values(362, "2012-07-10"); +insert into diaries values(363, "2012-07-11"); +insert into diaries values(364, "2012-07-12"); +insert into diaries values(365, "2012-07-13"); +insert into diaries values(366, "2012-07-14"); +insert into diaries values(367, "2012-07-15"); +insert into diaries values(368, "2012-07-16"); +insert into diaries values(369, "2012-07-17"); +insert into diaries values(370, "2012-07-18"); +insert into diaries values(371, "2012-07-19"); +insert into diaries values(372, "2012-07-20"); +insert into diaries values(373, "2012-07-21"); +insert into diaries values(374, "2012-07-22"); +insert into diaries values(375, "2012-07-23"); +insert into diaries values(376, "2012-07-24"); +insert into diaries values(377, "2012-07-25"); +insert into diaries values(378, "2012-07-26"); +insert into diaries values(379, "2012-07-27"); +insert into diaries values(380, "2012-07-28"); +insert into diaries values(381, "2012-07-29"); +insert into diaries values(382, "2012-07-30"); +insert into diaries values(383, "2012-07-31"); +insert into diaries values(384, "2012-08-01"); +insert into diaries values(385, "2012-08-02"); +insert into diaries values(386, "2012-08-03"); +insert into diaries values(387, "2012-08-04"); +insert into diaries values(388, "2012-08-05"); +insert into diaries values(389, "2012-08-06"); +insert into diaries values(390, "2012-08-07"); +insert into diaries values(391, "2012-08-08"); +insert into diaries values(392, "2012-08-09"); +insert into diaries values(393, "2012-08-10"); +insert into diaries values(394, "2012-08-11"); +insert into diaries values(395, "2012-08-12"); +insert into diaries values(396, "2012-08-13"); +insert into diaries values(397, "2012-08-14"); +insert into diaries values(398, "2012-08-15"); +insert into diaries values(399, "2012-08-16"); +insert into diaries values(400, "2012-08-17"); +insert into diaries values(401, "2012-08-18"); +insert into diaries values(402, "2012-08-19"); +insert into diaries values(403, "2012-08-20"); +insert into diaries values(404, "2012-08-21"); +insert into diaries values(405, "2012-08-22"); +insert into diaries values(406, "2012-08-23"); +insert into diaries values(407, "2012-08-24"); +insert into diaries values(408, "2012-08-25"); +insert into diaries values(409, "2012-08-26"); +insert into diaries values(410, "2012-08-27"); +insert into diaries values(411, "2012-08-28"); +insert into diaries values(412, "2012-08-29"); +insert into diaries values(413, "2012-08-30"); +insert into diaries values(414, "2012-08-31"); +insert into diaries values(415, "2012-09-01"); +insert into diaries values(416, "2012-09-02"); +insert into diaries values(417, "2012-09-03"); +insert into diaries values(418, "2012-09-04"); +insert into diaries values(419, "2012-09-05"); +insert into diaries values(420, "2012-09-06"); +insert into diaries values(421, "2012-09-07"); +insert into diaries values(422, "2012-09-08"); +insert into diaries values(423, "2012-09-09"); +insert into diaries values(424, "2012-09-10"); +insert into diaries values(425, "2012-09-11"); +insert into diaries values(426, "2012-09-12"); +insert into diaries values(427, "2012-09-13"); +insert into diaries values(428, "2012-09-14"); +insert into diaries values(429, "2012-09-15"); +insert into diaries values(430, "2012-09-16"); +insert into diaries values(431, "2012-09-17"); +insert into diaries values(432, "2012-09-18"); +insert into diaries values(433, "2012-09-19"); +insert into diaries values(434, "2012-09-20"); +insert into diaries values(435, "2012-09-21"); +insert into diaries values(436, "2012-09-22"); +insert into diaries values(437, "2012-09-23"); +insert into diaries values(438, "2012-09-24"); +insert into diaries values(439, "2012-09-25"); +insert into diaries values(440, "2012-09-26"); +insert into diaries values(441, "2012-09-27"); +insert into diaries values(442, "2012-09-28"); +insert into diaries values(443, "2012-09-29"); +insert into diaries values(444, "2012-09-30"); +insert into diaries values(445, "2012-10-01"); +insert into diaries values(446, "2012-10-02"); +insert into diaries values(447, "2012-10-03"); +insert into diaries values(448, "2012-10-04"); +insert into diaries values(449, "2012-10-05"); +insert into diaries values(450, "2012-10-06"); +insert into diaries values(451, "2012-10-07"); +insert into diaries values(452, "2012-10-08"); +insert into diaries values(453, "2012-10-09"); +insert into diaries values(454, "2012-10-10"); +insert into diaries values(455, "2012-10-11"); +insert into diaries values(456, "2012-10-12"); +insert into diaries values(457, "2012-10-13"); +insert into diaries values(458, "2012-10-14"); +insert into diaries values(459, "2012-10-15"); +insert into diaries values(460, "2012-10-16"); +insert into diaries values(461, "2012-10-17"); +insert into diaries values(462, "2012-10-18"); +insert into diaries values(463, "2012-10-19"); +insert into diaries values(464, "2012-10-20"); +insert into diaries values(465, "2012-10-21"); +insert into diaries values(466, "2012-10-22"); +insert into diaries values(467, "2012-10-23"); +insert into diaries values(468, "2012-10-24"); +insert into diaries values(469, "2012-10-25"); +insert into diaries values(470, "2012-10-26"); +insert into diaries values(471, "2012-10-27"); +insert into diaries values(472, "2012-10-28"); +insert into diaries values(473, "2012-10-29"); +insert into diaries values(474, "2012-10-30"); +insert into diaries values(475, "2012-10-31"); +insert into diaries values(476, "2012-11-01"); +insert into diaries values(477, "2012-11-02"); +insert into diaries values(478, "2012-11-03"); +insert into diaries values(479, "2012-11-04"); +insert into diaries values(480, "2012-11-05"); +insert into diaries values(481, "2012-11-06"); +insert into diaries values(482, "2012-11-07"); +insert into diaries values(483, "2012-11-08"); +insert into diaries values(484, "2012-11-09"); +insert into diaries values(485, "2012-11-10"); +insert into diaries values(486, "2012-11-11"); +insert into diaries values(487, "2012-11-12"); +insert into diaries values(488, "2012-11-13"); +insert into diaries values(489, "2012-11-14"); +insert into diaries values(490, "2012-11-15"); +insert into diaries values(491, "2012-11-16"); +insert into diaries values(492, "2012-11-17"); +insert into diaries values(493, "2012-11-18"); +insert into diaries values(494, "2012-11-19"); +insert into diaries values(495, "2012-11-20"); +insert into diaries values(496, "2012-11-21"); +insert into diaries values(497, "2012-11-22"); +insert into diaries values(498, "2012-11-23"); +insert into diaries values(499, "2012-11-24"); +insert into diaries values(500, "2012-11-25"); +insert into diaries values(501, "2012-11-26"); +insert into diaries values(502, "2012-11-27"); +insert into diaries values(503, "2012-11-28"); +insert into diaries values(504, "2012-11-29"); +insert into diaries values(505, "2012-11-30"); +insert into diaries values(506, "2012-12-01"); +insert into diaries values(507, "2012-12-02"); +insert into diaries values(508, "2012-12-03"); +insert into diaries values(509, "2012-12-04"); +insert into diaries values(510, "2012-12-05"); +insert into diaries values(511, "2012-12-06"); +insert into diaries values(512, "2012-12-07"); +insert into diaries values(513, "2012-12-08"); +insert into diaries values(514, "2012-12-09"); +insert into diaries values(515, "2012-12-10"); +insert into diaries values(516, "2012-12-11"); +insert into diaries values(517, "2012-12-12"); +insert into diaries values(518, "2012-12-13"); +insert into diaries values(519, "2012-12-14"); +insert into diaries values(520, "2012-12-15"); +insert into diaries values(521, "2012-12-16"); +insert into diaries values(522, "2012-12-17"); +insert into diaries values(523, "2012-12-18"); +insert into diaries values(524, "2012-12-19"); +insert into diaries values(525, "2012-12-20"); +insert into diaries values(526, "2012-12-21"); +insert into diaries values(527, "2012-12-22"); +insert into diaries values(528, "2012-12-23"); +insert into diaries values(529, "2012-12-24"); +insert into diaries values(530, "2012-12-25"); +insert into diaries values(531, "2012-12-26"); +insert into diaries values(532, "2012-12-27"); +insert into diaries values(533, "2012-12-28"); +insert into diaries values(534, "2012-12-29"); +insert into diaries values(535, "2012-12-30"); +insert into diaries values(536, "2012-12-31"); +insert into diaries values(537, "2013-01-01"); +insert into diaries values(538, "2013-01-02"); +insert into diaries values(539, "2013-01-03"); +insert into diaries values(540, "2013-01-04"); +insert into diaries values(541, "2013-01-05"); +insert into diaries values(542, "2013-01-06"); +insert into diaries values(543, "2013-01-07"); +insert into diaries values(544, "2013-01-08"); +insert into diaries values(545, "2013-01-09"); +insert into diaries values(546, "2013-01-10"); +insert into diaries values(547, "2013-01-11"); +insert into diaries values(548, "2013-01-12"); +insert into diaries values(549, "2013-01-13"); +insert into diaries values(550, "2013-01-14"); +insert into diaries values(551, "2013-01-15"); +insert into diaries values(552, "2013-01-16"); +insert into diaries values(553, "2013-01-17"); +insert into diaries values(554, "2013-01-18"); +insert into diaries values(555, "2013-01-19"); +insert into diaries values(556, "2013-01-20"); +insert into diaries values(557, "2013-01-21"); +insert into diaries values(558, "2013-01-22"); +insert into diaries values(559, "2013-01-23"); +insert into diaries values(560, "2013-01-24"); +insert into diaries values(561, "2013-01-25"); +insert into diaries values(562, "2013-01-26"); +insert into diaries values(563, "2013-01-27"); +insert into diaries values(564, "2013-01-28"); +insert into diaries values(565, "2013-01-29"); +insert into diaries values(566, "2013-01-30"); +insert into diaries values(567, "2013-01-31"); +insert into diaries values(568, "2013-02-01"); +insert into diaries values(569, "2013-02-02"); +insert into diaries values(570, "2013-02-03"); +insert into diaries values(571, "2013-02-04"); +insert into diaries values(572, "2013-02-05"); +insert into diaries values(573, "2013-02-06"); +insert into diaries values(574, "2013-02-07"); +insert into diaries values(575, "2013-02-08"); +insert into diaries values(576, "2013-02-09"); +insert into diaries values(577, "2013-02-10"); +insert into diaries values(578, "2013-02-11"); +insert into diaries values(579, "2013-02-12"); +insert into diaries values(580, "2013-02-13"); +insert into diaries values(581, "2013-02-14"); +insert into diaries values(582, "2013-02-15"); +insert into diaries values(583, "2013-02-16"); +insert into diaries values(584, "2013-02-17"); +insert into diaries values(585, "2013-02-18"); +insert into diaries values(586, "2013-02-19"); +insert into diaries values(587, "2013-02-20"); +insert into diaries values(588, "2013-02-21"); +insert into diaries values(589, "2013-02-22"); +insert into diaries values(590, "2013-02-23"); +insert into diaries values(591, "2013-02-24"); +insert into diaries values(592, "2013-02-25"); +insert into diaries values(593, "2013-02-26"); +insert into diaries values(594, "2013-02-27"); +insert into diaries values(595, "2013-02-28"); +insert into diaries values(596, "2013-03-01"); +insert into diaries values(597, "2013-03-02"); +insert into diaries values(598, "2013-03-03"); +insert into diaries values(599, "2013-03-04"); +insert into diaries values(600, "2013-03-05"); +insert into diaries values(601, "2013-03-06"); +insert into diaries values(602, "2013-03-07"); +insert into diaries values(603, "2013-03-08"); +insert into diaries values(604, "2013-03-09"); +insert into diaries values(605, "2013-03-10"); +insert into diaries values(606, "2013-03-11"); +insert into diaries values(607, "2013-03-12"); +insert into diaries values(608, "2013-03-13"); +insert into diaries values(609, "2013-03-14"); +insert into diaries values(610, "2013-03-15"); +insert into diaries values(611, "2013-03-16"); +insert into diaries values(612, "2013-03-17"); +insert into diaries values(613, "2013-03-18"); +insert into diaries values(614, "2013-03-19"); +insert into diaries values(615, "2013-03-20"); +insert into diaries values(616, "2013-03-21"); +insert into diaries values(617, "2013-03-22"); +insert into diaries values(618, "2013-03-23"); +insert into diaries values(619, "2013-03-24"); +insert into diaries values(620, "2013-03-25"); +insert into diaries values(621, "2013-03-26"); +insert into diaries values(622, "2013-03-27"); +insert into diaries values(623, "2013-03-28"); +insert into diaries values(624, "2013-03-29"); +insert into diaries values(625, "2013-03-30"); +insert into diaries values(626, "2013-03-31"); +insert into diaries values(627, "2013-04-01"); +insert into diaries values(628, "2013-04-02"); +insert into diaries values(629, "2013-04-03"); +insert into diaries values(630, "2013-04-04"); +insert into diaries values(631, "2013-04-05"); +insert into diaries values(632, "2013-04-06"); +insert into diaries values(633, "2013-04-07"); +insert into diaries values(634, "2013-04-08"); +insert into diaries values(635, "2013-04-09"); +insert into diaries values(636, "2013-04-10"); +insert into diaries values(637, "2013-04-11"); +insert into diaries values(638, "2013-04-12"); +insert into diaries values(639, "2013-04-13"); +insert into diaries values(640, "2013-04-14"); +insert into diaries values(641, "2013-04-15"); +insert into diaries values(642, "2013-04-16"); +insert into diaries values(643, "2013-04-17"); +insert into diaries values(644, "2013-04-18"); +insert into diaries values(645, "2013-04-19"); +insert into diaries values(646, "2013-04-20"); +insert into diaries values(647, "2013-04-21"); +insert into diaries values(648, "2013-04-22"); +insert into diaries values(649, "2013-04-23"); +insert into diaries values(650, "2013-04-24"); +insert into diaries values(651, "2013-04-25"); +insert into diaries values(652, "2013-04-26"); +insert into diaries values(653, "2013-04-27"); +insert into diaries values(654, "2013-04-28"); +insert into diaries values(655, "2013-04-29"); +insert into diaries values(656, "2013-04-30"); +insert into diaries values(657, "2013-05-01"); +insert into diaries values(658, "2013-05-02"); +insert into diaries values(659, "2013-05-03"); +insert into diaries values(660, "2013-05-04"); +insert into diaries values(661, "2013-05-05"); +insert into diaries values(662, "2013-05-06"); +insert into diaries values(663, "2013-05-07"); +insert into diaries values(664, "2013-05-08"); +insert into diaries values(665, "2013-05-09"); +insert into diaries values(666, "2013-05-10"); +insert into diaries values(667, "2013-05-11"); +insert into diaries values(668, "2013-05-12"); +insert into diaries values(669, "2013-05-13"); +insert into diaries values(670, "2013-05-14"); +insert into diaries values(671, "2013-05-15"); +insert into diaries values(672, "2013-05-16"); +insert into diaries values(673, "2013-05-17"); +insert into diaries values(674, "2013-05-18"); +insert into diaries values(675, "2013-05-19"); +insert into diaries values(676, "2013-05-20"); +insert into diaries values(677, "2013-05-21"); +insert into diaries values(678, "2013-05-22"); +insert into diaries values(679, "2013-05-23"); +insert into diaries values(680, "2013-05-24"); +insert into diaries values(681, "2013-05-25"); +insert into diaries values(682, "2013-05-26"); +insert into diaries values(683, "2013-05-27"); +insert into diaries values(684, "2013-05-28"); +insert into diaries values(685, "2013-05-29"); +insert into diaries values(686, "2013-05-30"); +insert into diaries values(687, "2013-05-31"); +insert into diaries values(688, "2013-06-01"); +insert into diaries values(689, "2013-06-02"); +insert into diaries values(690, "2013-06-03"); +insert into diaries values(691, "2013-06-04"); +insert into diaries values(692, "2013-06-05"); +insert into diaries values(693, "2013-06-06"); +insert into diaries values(694, "2013-06-07"); +insert into diaries values(695, "2013-06-08"); +insert into diaries values(696, "2013-06-09"); +insert into diaries values(697, "2013-06-10"); +insert into diaries values(698, "2013-06-11"); +insert into diaries values(699, "2013-06-12"); +insert into diaries values(700, "2013-06-13"); +insert into diaries values(701, "2013-06-14"); +insert into diaries values(702, "2013-06-15"); +insert into diaries values(703, "2013-06-16"); +insert into diaries values(704, "2013-06-17"); +insert into diaries values(705, "2013-06-18"); +insert into diaries values(706, "2013-06-19"); +insert into diaries values(707, "2013-06-20"); +insert into diaries values(708, "2013-06-21"); +insert into diaries values(709, "2013-06-22"); +insert into diaries values(710, "2013-06-23"); +insert into diaries values(711, "2013-06-24"); +insert into diaries values(712, "2013-06-25"); +insert into diaries values(713, "2013-06-26"); +insert into diaries values(714, "2013-06-27"); +insert into diaries values(715, "2013-06-28"); +insert into diaries values(716, "2013-06-29"); +insert into diaries values(717, "2013-06-30"); +insert into diaries values(718, "2013-07-01"); +insert into diaries values(719, "2013-07-02"); +insert into diaries values(720, "2013-07-03"); +insert into diaries values(721, "2013-07-04"); +insert into diaries values(722, "2013-07-05"); +insert into diaries values(723, "2013-07-06"); +insert into diaries values(724, "2013-07-07"); +insert into diaries values(725, "2013-07-08"); +insert into diaries values(726, "2013-07-09"); +insert into diaries values(727, "2013-07-10"); +insert into diaries values(728, "2013-07-11"); +insert into diaries values(729, "2013-07-12"); +insert into diaries values(730, "2013-07-13"); +insert into diaries values(731, "2013-07-14"); +insert into diaries values(732, "2013-07-15"); +insert into diaries values(733, "2013-07-16"); +insert into diaries values(734, "2013-07-17"); +insert into diaries values(735, "2013-07-18"); +insert into diaries values(736, "2013-07-19"); +insert into diaries values(737, "2013-07-20"); +insert into diaries values(738, "2013-07-21"); +insert into diaries values(739, "2013-07-22"); +insert into diaries values(740, "2013-07-23"); +insert into diaries values(741, "2013-07-24"); +insert into diaries values(742, "2013-07-25"); +insert into diaries values(743, "2013-07-26"); +insert into diaries values(744, "2013-07-27"); +insert into diaries values(745, "2013-07-28"); +insert into diaries values(746, "2013-07-29"); +insert into diaries values(747, "2013-07-30"); +insert into diaries values(748, "2013-07-31"); +insert into diaries values(749, "2013-08-01"); +insert into diaries values(750, "2013-08-02"); +insert into diaries values(751, "2013-08-03"); +insert into diaries values(752, "2013-08-04"); +insert into diaries values(753, "2013-08-05"); +insert into diaries values(754, "2013-08-06"); +insert into diaries values(755, "2013-08-07"); +insert into diaries values(756, "2013-08-08"); +insert into diaries values(757, "2013-08-09"); +insert into diaries values(758, "2013-08-10"); +insert into diaries values(759, "2013-08-11"); +insert into diaries values(760, "2013-08-12"); +insert into diaries values(761, "2013-08-13"); +insert into diaries values(762, "2013-08-14"); +insert into diaries values(763, "2013-08-15"); +insert into diaries values(764, "2013-08-16"); +insert into diaries values(765, "2013-08-17"); +insert into diaries values(766, "2013-08-18"); +insert into diaries values(767, "2013-08-19"); +insert into diaries values(768, "2013-08-20"); +insert into diaries values(769, "2013-08-21"); +insert into diaries values(770, "2013-08-22"); +insert into diaries values(771, "2013-08-23"); +insert into diaries values(772, "2013-08-24"); +insert into diaries values(773, "2013-08-25"); +insert into diaries values(774, "2013-08-26"); +insert into diaries values(775, "2013-08-27"); +insert into diaries values(776, "2013-08-28"); +insert into diaries values(777, "2013-08-29"); +insert into diaries values(778, "2013-08-30"); +insert into diaries values(779, "2013-08-31"); +insert into diaries values(780, "2013-09-01"); +insert into diaries values(781, "2013-09-02"); +insert into diaries values(782, "2013-09-03"); +insert into diaries values(783, "2013-09-04"); +insert into diaries values(784, "2013-09-05"); +insert into diaries values(785, "2013-09-06"); +insert into diaries values(786, "2013-09-07"); +insert into diaries values(787, "2013-09-08"); +insert into diaries values(788, "2013-09-09"); +insert into diaries values(789, "2013-09-10"); +insert into diaries values(790, "2013-09-11"); +insert into diaries values(791, "2013-09-12"); +insert into diaries values(792, "2013-09-13"); +insert into diaries values(793, "2013-09-14"); +insert into diaries values(794, "2013-09-15"); +insert into diaries values(795, "2013-09-16"); +insert into diaries values(796, "2013-09-17"); +insert into diaries values(797, "2013-09-18"); +insert into diaries values(798, "2013-09-19"); +insert into diaries values(799, "2013-09-20"); +insert into diaries values(800, "2013-09-21"); +insert into diaries values(801, "2013-09-22"); +insert into diaries values(802, "2013-09-23"); +insert into diaries values(803, "2013-09-24"); +insert into diaries values(804, "2013-09-25"); +insert into diaries values(805, "2013-09-26"); +insert into diaries values(806, "2013-09-27"); +insert into diaries values(807, "2013-09-28"); +insert into diaries values(808, "2013-09-29"); +insert into diaries values(809, "2013-09-30"); +insert into diaries values(810, "2013-10-01"); +insert into diaries values(811, "2013-10-02"); +insert into diaries values(812, "2013-10-03"); +insert into diaries values(813, "2013-10-04"); +insert into diaries values(814, "2013-10-05"); +insert into diaries values(815, "2013-10-06"); +insert into diaries values(816, "2013-10-07"); +insert into diaries values(817, "2013-10-08"); +insert into diaries values(818, "2013-10-09"); +insert into diaries values(819, "2013-10-10"); +insert into diaries values(820, "2013-10-11"); +insert into diaries values(821, "2013-10-12"); +insert into diaries values(822, "2013-10-13"); +insert into diaries values(823, "2013-10-14"); +insert into diaries values(824, "2013-10-15"); +insert into diaries values(825, "2013-10-16"); +insert into diaries values(826, "2013-10-17"); +insert into diaries values(827, "2013-10-18"); +insert into diaries values(828, "2013-10-19"); +insert into diaries values(829, "2013-10-20"); +insert into diaries values(830, "2013-10-21"); +insert into diaries values(831, "2013-10-22"); +insert into diaries values(832, "2013-10-23"); +insert into diaries values(833, "2013-10-24"); +insert into diaries values(834, "2013-10-25"); +insert into diaries values(835, "2013-10-26"); +insert into diaries values(836, "2013-10-27"); +insert into diaries values(837, "2013-10-28"); +insert into diaries values(838, "2013-10-29"); +insert into diaries values(839, "2013-10-30"); +insert into diaries values(840, "2013-10-31"); +insert into diaries values(841, "2013-11-01"); +insert into diaries values(842, "2013-11-02"); +insert into diaries values(843, "2013-11-03"); +insert into diaries values(844, "2013-11-04"); +insert into diaries values(845, "2013-11-05"); +insert into diaries values(846, "2013-11-06"); +insert into diaries values(847, "2013-11-07"); +insert into diaries values(848, "2013-11-08"); +insert into diaries values(849, "2013-11-09"); +insert into diaries values(850, "2013-11-10"); +insert into diaries values(851, "2013-11-11"); +insert into diaries values(852, "2013-11-12"); +insert into diaries values(853, "2013-11-13"); +insert into diaries values(854, "2013-11-14"); +insert into diaries values(855, "2013-11-15"); +insert into diaries values(856, "2013-11-16"); +insert into diaries values(857, "2013-11-17"); +insert into diaries values(858, "2013-11-18"); +insert into diaries values(859, "2013-11-19"); +insert into diaries values(860, "2013-11-20"); +insert into diaries values(861, "2013-11-21"); +insert into diaries values(862, "2013-11-22"); +insert into diaries values(863, "2013-11-23"); +insert into diaries values(864, "2013-11-24"); +insert into diaries values(865, "2013-11-25"); +insert into diaries values(866, "2013-11-26"); +insert into diaries values(867, "2013-11-27"); +insert into diaries values(868, "2013-11-28"); +insert into diaries values(869, "2013-11-29"); +insert into diaries values(870, "2013-11-30"); +insert into diaries values(871, "2013-12-01"); +insert into diaries values(872, "2013-12-02"); +insert into diaries values(873, "2013-12-03"); +insert into diaries values(874, "2013-12-04"); +insert into diaries values(875, "2013-12-05"); +insert into diaries values(876, "2013-12-06"); +insert into diaries values(877, "2013-12-07"); +insert into diaries values(878, "2013-12-08"); +insert into diaries values(879, "2013-12-09"); +insert into diaries values(880, "2013-12-10"); +insert into diaries values(881, "2013-12-11"); +insert into diaries values(882, "2013-12-12"); +insert into diaries values(883, "2013-12-13"); +insert into diaries values(884, "2013-12-14"); +insert into diaries values(885, "2013-12-15"); +insert into diaries values(886, "2013-12-16"); +insert into diaries values(887, "2013-12-17"); +insert into diaries values(888, "2013-12-18"); +insert into diaries values(889, "2013-12-19"); +insert into diaries values(890, "2013-12-20"); +insert into diaries values(891, "2013-12-21"); +insert into diaries values(892, "2013-12-22"); +insert into diaries values(893, "2013-12-23"); +insert into diaries values(894, "2013-12-24"); +insert into diaries values(895, "2013-12-25"); +insert into diaries values(896, "2013-12-26"); +insert into diaries values(897, "2013-12-27"); +insert into diaries values(898, "2013-12-28"); +insert into diaries values(899, "2013-12-29"); +insert into diaries values(900, "2013-12-30"); +insert into diaries values(901, "2013-12-31"); +insert into diaries values(902, "2014-01-01"); +insert into diaries values(903, "2014-01-02"); +insert into diaries values(904, "2014-01-03"); +insert into diaries values(905, "2014-01-04"); +insert into diaries values(906, "2014-01-05"); +insert into diaries values(907, "2014-01-06"); +insert into diaries values(908, "2014-01-07"); +insert into diaries values(909, "2014-01-08"); +insert into diaries values(910, "2014-01-09"); +insert into diaries values(911, "2014-01-10"); +insert into diaries values(912, "2014-01-11"); +insert into diaries values(913, "2014-01-12"); +insert into diaries values(914, "2014-01-13"); +insert into diaries values(915, "2014-01-14"); +insert into diaries values(916, "2014-01-15"); +insert into diaries values(917, "2014-01-16"); +insert into diaries values(918, "2014-01-17"); +insert into diaries values(919, "2014-01-18"); +insert into diaries values(920, "2014-01-19"); +insert into diaries values(921, "2014-01-20"); +insert into diaries values(922, "2014-01-21"); +insert into diaries values(923, "2014-01-22"); +insert into diaries values(924, "2014-01-23"); +insert into diaries values(925, "2014-01-24"); +insert into diaries values(926, "2014-01-25"); +insert into diaries values(927, "2014-01-26"); +insert into diaries values(928, "2014-01-27"); +insert into diaries values(929, "2014-01-28"); +insert into diaries values(930, "2014-01-29"); +insert into diaries values(931, "2014-01-30"); +insert into diaries values(932, "2014-01-31"); +insert into diaries values(933, "2014-02-01"); +insert into diaries values(934, "2014-02-02"); +insert into diaries values(935, "2014-02-03"); +insert into diaries values(936, "2014-02-04"); +insert into diaries values(937, "2014-02-05"); +insert into diaries values(938, "2014-02-06"); +insert into diaries values(939, "2014-02-07"); +insert into diaries values(940, "2014-02-08"); +insert into diaries values(941, "2014-02-09"); +insert into diaries values(942, "2014-02-10"); +insert into diaries values(943, "2014-02-11"); +insert into diaries values(944, "2014-02-12"); +insert into diaries values(945, "2014-02-13"); +insert into diaries values(946, "2014-02-14"); +insert into diaries values(947, "2014-02-15"); +insert into diaries values(948, "2014-02-16"); +insert into diaries values(949, "2014-02-17"); +insert into diaries values(950, "2014-02-18"); +insert into diaries values(951, "2014-02-19"); +insert into diaries values(952, "2014-02-20"); +insert into diaries values(953, "2014-02-21"); +insert into diaries values(954, "2014-02-22"); +insert into diaries values(955, "2014-02-23"); +insert into diaries values(956, "2014-02-24"); +insert into diaries values(957, "2014-02-25"); +insert into diaries values(958, "2014-02-26"); +insert into diaries values(959, "2014-02-27"); +insert into diaries values(960, "2014-02-28"); +insert into diaries values(961, "2014-03-01"); +insert into diaries values(962, "2014-03-02"); +insert into diaries values(963, "2014-03-03"); +insert into diaries values(964, "2014-03-04"); +insert into diaries values(965, "2014-03-05"); +insert into diaries values(966, "2014-03-06"); +insert into diaries values(967, "2014-03-07"); +insert into diaries values(968, "2014-03-08"); +insert into diaries values(969, "2014-03-09"); +insert into diaries values(970, "2014-03-10"); +insert into diaries values(971, "2014-03-11"); +insert into diaries values(972, "2014-03-12"); +insert into diaries values(973, "2014-03-13"); +insert into diaries values(974, "2014-03-14"); +insert into diaries values(975, "2014-03-15"); +insert into diaries values(976, "2014-03-16"); +insert into diaries values(977, "2014-03-17"); +insert into diaries values(978, "2014-03-18"); +insert into diaries values(979, "2014-03-19"); +insert into diaries values(980, "2014-03-20"); +insert into diaries values(981, "2014-03-21"); +insert into diaries values(982, "2014-03-22"); +insert into diaries values(983, "2014-03-23"); +insert into diaries values(984, "2014-03-24"); +insert into diaries values(985, "2014-03-25"); +insert into diaries values(986, "2014-03-26"); +insert into diaries values(987, "2014-03-27"); +insert into diaries values(988, "2014-03-28"); +insert into diaries values(989, "2014-03-29"); +insert into diaries values(990, "2014-03-30"); +insert into diaries values(991, "2014-03-31"); +insert into diaries values(992, "2014-04-01"); +insert into diaries values(993, "2014-04-02"); +insert into diaries values(994, "2014-04-03"); +insert into diaries values(995, "2014-04-04"); +insert into diaries values(996, "2014-04-05"); +insert into diaries values(997, "2014-04-06"); +insert into diaries values(998, "2014-04-07"); +insert into diaries values(999, "2014-04-08"); +insert into diaries values(1000, "2014-04-09"); +insert into diaries values(1001, "2014-04-10"); +insert into diaries values(1002, "2014-04-11"); +insert into diaries values(1003, "2014-04-12"); +insert into diaries values(1004, "2014-04-13"); +insert into diaries values(1005, "2014-04-14"); +insert into diaries values(1006, "2014-04-15"); +insert into diaries values(1007, "2014-04-16"); +insert into diaries values(1008, "2014-04-17"); +insert into diaries values(1009, "2014-04-18"); +insert into diaries values(1010, "2014-04-19"); +insert into diaries values(1011, "2014-04-20"); +insert into diaries values(1012, "2014-04-21"); +insert into diaries values(1013, "2014-04-22"); +insert into diaries values(1014, "2014-04-23"); +insert into diaries values(1015, "2014-04-24"); +insert into diaries values(1016, "2014-04-25"); +insert into diaries values(1017, "2014-04-26"); +insert into diaries values(1018, "2014-04-27"); +insert into diaries values(1019, "2014-04-28"); +insert into diaries values(1020, "2014-04-29"); +insert into diaries values(1021, "2014-04-30"); +insert into diaries values(1022, "2014-05-01"); +insert into diaries values(1023, "2014-05-02"); +insert into diaries values(1024, "2014-05-03"); +insert into diaries values(1025, "2014-05-04"); +insert into diaries values(1026, "2014-05-05"); +insert into diaries values(1027, "2014-05-06"); +insert into diaries values(1028, "2014-05-07"); +insert into diaries values(1029, "2014-05-08"); +insert into diaries values(1030, "2014-05-09"); +insert into diaries values(1031, "2014-05-10"); +insert into diaries values(1032, "2014-05-11"); +insert into diaries values(1033, "2014-05-12"); +insert into diaries values(1034, "2014-05-13"); +insert into diaries values(1035, "2014-05-14"); +insert into diaries values(1036, "2014-05-15"); +insert into diaries values(1037, "2014-05-16"); +insert into diaries values(1038, "2014-05-17"); +insert into diaries values(1039, "2014-05-18"); +insert into diaries values(1040, "2014-05-19"); +insert into diaries values(1041, "2014-05-20"); +insert into diaries values(1042, "2014-05-21"); +insert into diaries values(1043, "2014-05-22"); +insert into diaries values(1044, "2014-05-23"); +insert into diaries values(1045, "2014-05-24"); +insert into diaries values(1046, "2014-05-25"); +insert into diaries values(1047, "2014-05-26"); +insert into diaries values(1048, "2014-05-27"); +insert into diaries values(1049, "2014-05-28"); +insert into diaries values(1050, "2014-05-29"); +insert into diaries values(1051, "2014-05-30"); +insert into diaries values(1052, "2014-05-31"); +insert into diaries values(1053, "2014-06-01"); +insert into diaries values(1054, "2014-06-02"); +insert into diaries values(1055, "2014-06-03"); +insert into diaries values(1056, "2014-06-04"); +insert into diaries values(1057, "2014-06-05"); +insert into diaries values(1058, "2014-06-06"); +insert into diaries values(1059, "2014-06-07"); +insert into diaries values(1060, "2014-06-08"); +insert into diaries values(1061, "2014-06-09"); +insert into diaries values(1062, "2014-06-10"); +insert into diaries values(1063, "2014-06-11"); +insert into diaries values(1064, "2014-06-12"); +insert into diaries values(1065, "2014-06-13"); +insert into diaries values(1066, "2014-06-14"); +insert into diaries values(1067, "2014-06-15"); +insert into diaries values(1068, "2014-06-16"); +insert into diaries values(1069, "2014-06-17"); +insert into diaries values(1070, "2014-06-18"); +insert into diaries values(1071, "2014-06-19"); +insert into diaries values(1072, "2014-06-20"); +insert into diaries values(1073, "2014-06-21"); +insert into diaries values(1074, "2014-06-22"); +insert into diaries values(1075, "2014-06-23"); +insert into diaries values(1076, "2014-06-24"); +insert into diaries values(1077, "2014-06-25"); +insert into diaries values(1078, "2014-06-26"); +insert into diaries values(1079, "2014-06-27"); +insert into diaries values(1080, "2014-06-28"); +insert into diaries values(1081, "2014-06-29"); +insert into diaries values(1082, "2014-06-30"); +insert into diaries values(1083, "2014-07-01"); +insert into diaries values(1084, "2014-07-02"); +insert into diaries values(1085, "2014-07-03"); +insert into diaries values(1086, "2014-07-04"); +insert into diaries values(1087, "2014-07-05"); +insert into diaries values(1088, "2014-07-06"); +insert into diaries values(1089, "2014-07-07"); +insert into diaries values(1090, "2014-07-08"); +insert into diaries values(1091, "2014-07-09"); +insert into diaries values(1092, "2014-07-10"); +insert into diaries values(1093, "2014-07-11"); +insert into diaries values(1094, "2014-07-12"); +insert into diaries values(1095, "2014-07-13"); +insert into diaries values(1096, "2014-07-14"); +insert into diaries values(1097, "2014-07-15"); +insert into diaries values(1098, "2014-07-16"); +insert into diaries values(1099, "2014-07-17"); +insert into diaries values(1100, "2014-07-18"); +insert into diaries values(1101, "2014-07-19"); +insert into diaries values(1102, "2014-07-20"); +insert into diaries values(1103, "2014-07-21"); +insert into diaries values(1104, "2014-07-22"); +insert into diaries values(1105, "2014-07-23"); +insert into diaries values(1106, "2014-07-24"); +insert into diaries values(1107, "2014-07-25"); +insert into diaries values(1108, "2014-07-26"); +insert into diaries values(1109, "2014-07-27"); +insert into diaries values(1110, "2014-07-28"); +insert into diaries values(1111, "2014-07-29"); +insert into diaries values(1112, "2014-07-30"); +insert into diaries values(1113, "2014-07-31"); +insert into diaries values(1114, "2014-08-01"); +insert into diaries values(1115, "2014-08-02"); +insert into diaries values(1116, "2014-08-03"); +insert into diaries values(1117, "2014-08-04"); +insert into diaries values(1118, "2014-08-05"); +insert into diaries values(1119, "2014-08-06"); +insert into diaries values(1120, "2014-08-07"); +insert into diaries values(1121, "2014-08-08"); +insert into diaries values(1122, "2014-08-09"); +insert into diaries values(1123, "2014-08-10"); +insert into diaries values(1124, "2014-08-11"); +insert into diaries values(1125, "2014-08-12"); +insert into diaries values(1126, "2014-08-13"); +insert into diaries values(1127, "2014-08-14"); +insert into diaries values(1128, "2014-08-15"); +insert into diaries values(1129, "2014-08-16"); +insert into diaries values(1130, "2014-08-17"); +insert into diaries values(1131, "2014-08-18"); +insert into diaries values(1132, "2014-08-19"); +insert into diaries values(1133, "2014-08-20"); +insert into diaries values(1134, "2014-08-21"); +insert into diaries values(1135, "2014-08-22"); +insert into diaries values(1136, "2014-08-23"); +insert into diaries values(1137, "2014-08-24"); +insert into diaries values(1138, "2014-08-25"); +insert into diaries values(1139, "2014-08-26"); +insert into diaries values(1140, "2014-08-27"); +insert into diaries values(1141, "2014-08-28"); +insert into diaries values(1142, "2014-08-29"); +insert into diaries values(1143, "2014-08-30"); +insert into diaries values(1144, "2014-08-31"); +insert into diaries values(1145, "2014-09-01"); +insert into diaries values(1146, "2014-09-02"); +insert into diaries values(1147, "2014-09-03"); +insert into diaries values(1148, "2014-09-04"); +insert into diaries values(1149, "2014-09-05"); +insert into diaries values(1150, "2014-09-06"); +insert into diaries values(1151, "2014-09-07"); +insert into diaries values(1152, "2014-09-08"); +insert into diaries values(1153, "2014-09-09"); +insert into diaries values(1154, "2014-09-10"); +insert into diaries values(1155, "2014-09-11"); +insert into diaries values(1156, "2014-09-12"); +insert into diaries values(1157, "2014-09-13"); +insert into diaries values(1158, "2014-09-14"); +insert into diaries values(1159, "2014-09-15"); +insert into diaries values(1160, "2014-09-16"); +insert into diaries values(1161, "2014-09-17"); +insert into diaries values(1162, "2014-09-18"); +insert into diaries values(1163, "2014-09-19"); +insert into diaries values(1164, "2014-09-20"); +insert into diaries values(1165, "2014-09-21"); +insert into diaries values(1166, "2014-09-22"); +insert into diaries values(1167, "2014-09-23"); +insert into diaries values(1168, "2014-09-24"); +insert into diaries values(1169, "2014-09-25"); +insert into diaries values(1170, "2014-09-26"); +insert into diaries values(1171, "2014-09-27"); +insert into diaries values(1172, "2014-09-28"); +insert into diaries values(1173, "2014-09-29"); +insert into diaries values(1174, "2014-09-30"); +insert into diaries values(1175, "2014-10-01"); +insert into diaries values(1176, "2014-10-02"); +insert into diaries values(1177, "2014-10-03"); +insert into diaries values(1178, "2014-10-04"); +insert into diaries values(1179, "2014-10-05"); +insert into diaries values(1180, "2014-10-06"); +insert into diaries values(1181, "2014-10-07"); +insert into diaries values(1182, "2014-10-08"); +insert into diaries values(1183, "2014-10-09"); +insert into diaries values(1184, "2014-10-10"); +insert into diaries values(1185, "2014-10-11"); +insert into diaries values(1186, "2014-10-12"); +insert into diaries values(1187, "2014-10-13"); +insert into diaries values(1188, "2014-10-14"); +insert into diaries values(1189, "2014-10-15"); +insert into diaries values(1190, "2014-10-16"); +insert into diaries values(1191, "2014-10-17"); +insert into diaries values(1192, "2014-10-18"); +insert into diaries values(1193, "2014-10-19"); +insert into diaries values(1194, "2014-10-20"); +insert into diaries values(1195, "2014-10-21"); +insert into diaries values(1196, "2014-10-22"); +insert into diaries values(1197, "2014-10-23"); +insert into diaries values(1198, "2014-10-24"); +insert into diaries values(1199, "2014-10-25"); +insert into diaries values(1200, "2014-10-26"); +insert into diaries values(1201, "2014-10-27"); +insert into diaries values(1202, "2014-10-28"); +insert into diaries values(1203, "2014-10-29"); +insert into diaries values(1204, "2014-10-30"); +insert into diaries values(1205, "2014-10-31"); +insert into diaries values(1206, "2014-11-01"); +insert into diaries values(1207, "2014-11-02"); +insert into diaries values(1208, "2014-11-03"); +insert into diaries values(1209, "2014-11-04"); +insert into diaries values(1210, "2014-11-05"); +insert into diaries values(1211, "2014-11-06"); +insert into diaries values(1212, "2014-11-07"); +insert into diaries values(1213, "2014-11-08"); +insert into diaries values(1214, "2014-11-09"); +insert into diaries values(1215, "2014-11-10"); +insert into diaries values(1216, "2014-11-11"); +insert into diaries values(1217, "2014-11-12"); +insert into diaries values(1218, "2014-11-13"); +insert into diaries values(1219, "2014-11-14"); +insert into diaries values(1220, "2014-11-15"); +insert into diaries values(1221, "2014-11-16"); +insert into diaries values(1222, "2014-11-17"); +insert into diaries values(1223, "2014-11-18"); +insert into diaries values(1224, "2014-11-19"); +insert into diaries values(1225, "2014-11-20"); +insert into diaries values(1226, "2014-11-21"); +insert into diaries values(1227, "2014-11-22"); +insert into diaries values(1228, "2014-11-23"); +insert into diaries values(1229, "2014-11-24"); +insert into diaries values(1230, "2014-11-25"); +insert into diaries values(1231, "2014-11-26"); +insert into diaries values(1232, "2014-11-27"); +insert into diaries values(1233, "2014-11-28"); +insert into diaries values(1234, "2014-11-29"); +insert into diaries values(1235, "2014-11-30"); +insert into diaries values(1236, "2014-12-01"); +insert into diaries values(1237, "2014-12-02"); +insert into diaries values(1238, "2014-12-03"); +insert into diaries values(1239, "2014-12-04"); +insert into diaries values(1240, "2014-12-05"); +insert into diaries values(1241, "2014-12-06"); +insert into diaries values(1242, "2014-12-07"); +insert into diaries values(1243, "2014-12-08"); +insert into diaries values(1244, "2014-12-09"); +insert into diaries values(1245, "2014-12-10"); +insert into diaries values(1246, "2014-12-11"); +insert into diaries values(1247, "2014-12-12"); +insert into diaries values(1248, "2014-12-13"); +insert into diaries values(1249, "2014-12-14"); +insert into diaries values(1250, "2014-12-15"); +insert into diaries values(1251, "2014-12-16"); +insert into diaries values(1252, "2014-12-17"); +insert into diaries values(1253, "2014-12-18"); +insert into diaries values(1254, "2014-12-19"); +insert into diaries values(1255, "2014-12-20"); +insert into diaries values(1256, "2014-12-21"); +insert into diaries values(1257, "2014-12-22"); +insert into diaries values(1258, "2014-12-23"); +insert into diaries values(1259, "2014-12-24"); +insert into diaries values(1260, "2014-12-25"); +insert into diaries values(1261, "2014-12-26"); +insert into diaries values(1262, "2014-12-27"); +insert into diaries values(1263, "2014-12-28"); +insert into diaries values(1264, "2014-12-29"); +insert into diaries values(1265, "2014-12-30"); +insert into diaries values(1266, "2014-12-31"); +insert into diaries values(1267, "2015-01-01"); +insert into diaries values(1268, "2015-01-02"); +insert into diaries values(1269, "2015-01-03"); +insert into diaries values(1270, "2015-01-04"); +insert into diaries values(1271, "2015-01-05"); +insert into diaries values(1272, "2015-01-06"); +insert into diaries values(1273, "2015-01-07"); +insert into diaries values(1274, "2015-01-08"); +insert into diaries values(1275, "2015-01-09"); +insert into diaries values(1276, "2015-01-10"); +insert into diaries values(1277, "2015-01-11"); +insert into diaries values(1278, "2015-01-12"); +insert into diaries values(1279, "2015-01-13"); +insert into diaries values(1280, "2015-01-14"); +insert into diaries values(1281, "2015-01-15"); +insert into diaries values(1282, "2015-01-16"); +insert into diaries values(1283, "2015-01-17"); +insert into diaries values(1284, "2015-01-18"); +insert into diaries values(1285, "2015-01-19"); +insert into diaries values(1286, "2015-01-20"); +insert into diaries values(1287, "2015-01-21"); +insert into diaries values(1288, "2015-01-22"); +insert into diaries values(1289, "2015-01-23"); +insert into diaries values(1290, "2015-01-24"); +insert into diaries values(1291, "2015-01-25"); +insert into diaries values(1292, "2015-01-26"); +insert into diaries values(1293, "2015-01-27"); +insert into diaries values(1294, "2015-01-28"); +insert into diaries values(1295, "2015-01-29"); +insert into diaries values(1296, "2015-01-30"); +insert into diaries values(1297, "2015-01-31"); +insert into diaries values(1298, "2015-02-01"); +insert into diaries values(1299, "2015-02-02"); +insert into diaries values(1300, "2015-02-03"); +insert into diaries values(1301, "2015-02-04"); +insert into diaries values(1302, "2015-02-05"); +insert into diaries values(1303, "2015-02-06"); +insert into diaries values(1304, "2015-02-07"); +insert into diaries values(1305, "2015-02-08"); +insert into diaries values(1306, "2015-02-09"); +insert into diaries values(1307, "2015-02-10"); +insert into diaries values(1308, "2015-02-11"); +insert into diaries values(1309, "2015-02-12"); +insert into diaries values(1310, "2015-02-13"); +insert into diaries values(1311, "2015-02-14"); +insert into diaries values(1312, "2015-02-15"); +insert into diaries values(1313, "2015-02-16"); +insert into diaries values(1314, "2015-02-17"); +insert into diaries values(1315, "2015-02-18"); +insert into diaries values(1316, "2015-02-19"); +insert into diaries values(1317, "2015-02-20"); +insert into diaries values(1318, "2015-02-21"); +insert into diaries values(1319, "2015-02-22"); +insert into diaries values(1320, "2015-02-23"); +insert into diaries values(1321, "2015-02-24"); +insert into diaries values(1322, "2015-02-25"); +insert into diaries values(1323, "2015-02-26"); +insert into diaries values(1324, "2015-02-27"); +insert into diaries values(1325, "2015-02-28"); +insert into diaries values(1326, "2015-03-01"); +insert into diaries values(1327, "2015-03-02"); +insert into diaries values(1328, "2015-03-03"); +insert into diaries values(1329, "2015-03-04"); +insert into diaries values(1330, "2015-03-05"); +insert into diaries values(1331, "2015-03-06"); +insert into diaries values(1332, "2015-03-07"); +insert into diaries values(1333, "2015-03-08"); +insert into diaries values(1334, "2015-03-09"); +insert into diaries values(1335, "2015-03-10"); +insert into diaries values(1336, "2015-03-11"); +insert into diaries values(1337, "2015-03-12"); +insert into diaries values(1338, "2015-03-13"); +insert into diaries values(1339, "2015-03-14"); +insert into diaries values(1340, "2015-03-15"); +insert into diaries values(1341, "2015-03-16"); +insert into diaries values(1342, "2015-03-17"); +insert into diaries values(1343, "2015-03-18"); +insert into diaries values(1344, "2015-03-19"); +insert into diaries values(1345, "2015-03-20"); +insert into diaries values(1346, "2015-03-21"); +insert into diaries values(1347, "2015-03-22"); +insert into diaries values(1348, "2015-03-23"); +insert into diaries values(1349, "2015-03-24"); +insert into diaries values(1350, "2015-03-25"); +insert into diaries values(1351, "2015-03-26"); +insert into diaries values(1352, "2015-03-27"); +insert into diaries values(1353, "2015-03-28"); +insert into diaries values(1354, "2015-03-29"); +insert into diaries values(1355, "2015-03-30"); +insert into diaries values(1356, "2015-03-31"); +insert into diaries values(1357, "2015-04-01"); +insert into diaries values(1358, "2015-04-02"); +insert into diaries values(1359, "2015-04-03"); +insert into diaries values(1360, "2015-04-04"); +insert into diaries values(1361, "2015-04-05"); +insert into diaries values(1362, "2015-04-06"); +insert into diaries values(1363, "2015-04-07"); +insert into diaries values(1364, "2015-04-08"); +insert into diaries values(1365, "2015-04-09"); +insert into diaries values(1366, "2015-04-10"); +insert into diaries values(1367, "2015-04-11"); +insert into diaries values(1368, "2015-04-12"); +insert into diaries values(1369, "2015-04-13"); +insert into diaries values(1370, "2015-04-14"); +insert into diaries values(1371, "2015-04-15"); +insert into diaries values(1372, "2015-04-16"); +insert into diaries values(1373, "2015-04-17"); +insert into diaries values(1374, "2015-04-18"); +insert into diaries values(1375, "2015-04-19"); +insert into diaries values(1376, "2015-04-20"); +insert into diaries values(1377, "2015-04-21"); +insert into diaries values(1378, "2015-04-22"); +insert into diaries values(1379, "2015-04-23"); +insert into diaries values(1380, "2015-04-24"); +insert into diaries values(1381, "2015-04-25"); +insert into diaries values(1382, "2015-04-26"); +insert into diaries values(1383, "2015-04-27"); +insert into diaries values(1384, "2015-04-28"); +insert into diaries values(1385, "2015-04-29"); +insert into diaries values(1386, "2015-04-30"); +insert into diaries values(1387, "2015-05-01"); +insert into diaries values(1388, "2015-05-02"); +insert into diaries values(1389, "2015-05-03"); +insert into diaries values(1390, "2015-05-04"); +insert into diaries values(1391, "2015-05-05"); +insert into diaries values(1392, "2015-05-06"); +insert into diaries values(1393, "2015-05-07"); +insert into diaries values(1394, "2015-05-08"); +insert into diaries values(1395, "2015-05-09"); +insert into diaries values(1396, "2015-05-10"); +insert into diaries values(1397, "2015-05-11"); +insert into diaries values(1398, "2015-05-12"); +insert into diaries values(1399, "2015-05-13"); +insert into diaries values(1400, "2015-05-14"); +insert into diaries values(1401, "2015-05-15"); +insert into diaries values(1402, "2015-05-16"); +insert into diaries values(1403, "2015-05-17"); +insert into diaries values(1404, "2015-05-18"); +insert into diaries values(1405, "2015-05-19"); +insert into diaries values(1406, "2015-05-20"); +insert into diaries values(1407, "2015-05-21"); +insert into diaries values(1408, "2015-05-22"); +insert into diaries values(1409, "2015-05-23"); +insert into diaries values(1410, "2015-05-24"); +insert into diaries values(1411, "2015-05-25"); +insert into diaries values(1412, "2015-05-26"); +insert into diaries values(1413, "2015-05-27"); +insert into diaries values(1414, "2015-05-28"); +insert into diaries values(1415, "2015-05-29"); +insert into diaries values(1416, "2015-05-30"); +insert into diaries values(1417, "2015-05-31"); +insert into diaries values(1418, "2015-06-01"); +insert into diaries values(1419, "2015-06-02"); +insert into diaries values(1420, "2015-06-03"); +insert into diaries values(1421, "2015-06-04"); +insert into diaries values(1422, "2015-06-05"); +insert into diaries values(1423, "2015-06-06"); +insert into diaries values(1424, "2015-06-07"); +insert into diaries values(1425, "2015-06-08"); +insert into diaries values(1426, "2015-06-09"); +insert into diaries values(1427, "2015-06-10"); +insert into diaries values(1428, "2015-06-11"); +insert into diaries values(1429, "2015-06-12"); +insert into diaries values(1430, "2015-06-13"); +insert into diaries values(1431, "2015-06-14"); +insert into diaries values(1432, "2015-06-15"); +insert into diaries values(1433, "2015-06-16"); +insert into diaries values(1434, "2015-06-17"); +insert into diaries values(1435, "2015-06-18"); +insert into diaries values(1436, "2015-06-19"); +insert into diaries values(1437, "2015-06-20"); +insert into diaries values(1438, "2015-06-21"); +insert into diaries values(1439, "2015-06-22"); +insert into diaries values(1440, "2015-06-23"); +insert into diaries values(1441, "2015-06-24"); +insert into diaries values(1442, "2015-06-25"); +insert into diaries values(1443, "2015-06-26"); +insert into diaries values(1444, "2015-06-27"); +insert into diaries values(1445, "2015-06-28"); +insert into diaries values(1446, "2015-06-29"); +insert into diaries values(1447, "2015-06-30"); +insert into diaries values(1448, "2015-07-01"); +insert into diaries values(1449, "2015-07-02"); +insert into diaries values(1450, "2015-07-03"); +insert into diaries values(1451, "2015-07-04"); +insert into diaries values(1452, "2015-07-05"); +insert into diaries values(1453, "2015-07-06"); +insert into diaries values(1454, "2015-07-07"); +insert into diaries values(1455, "2015-07-08"); +insert into diaries values(1456, "2015-07-09"); +insert into diaries values(1457, "2015-07-10"); +insert into diaries values(1458, "2015-07-11"); +insert into diaries values(1459, "2015-07-12"); +insert into diaries values(1460, "2015-07-13"); +insert into diaries values(1461, "2015-07-14"); +insert into diaries values(1462, "2015-07-15"); +insert into diaries values(1463, "2015-07-16"); +insert into diaries values(1464, "2015-07-17"); +insert into diaries values(1465, "2015-07-18"); +insert into diaries values(1466, "2015-07-19"); +insert into diaries values(1467, "2015-07-20"); +insert into diaries values(1468, "2015-07-21"); +insert into diaries values(1469, "2015-07-22"); +insert into diaries values(1470, "2015-07-23"); +insert into diaries values(1471, "2015-07-24"); +insert into diaries values(1472, "2015-07-25"); +insert into diaries values(1473, "2015-07-26"); +insert into diaries values(1474, "2015-07-27"); +insert into diaries values(1475, "2015-07-28"); +insert into diaries values(1476, "2015-07-29"); +insert into diaries values(1477, "2015-07-30"); +insert into diaries values(1478, "2015-07-31"); +insert into diaries values(1479, "2015-08-01"); +insert into diaries values(1480, "2015-08-02"); +insert into diaries values(1481, "2015-08-03"); +insert into diaries values(1482, "2015-08-04"); +insert into diaries values(1483, "2015-08-05"); +insert into diaries values(1484, "2015-08-06"); +insert into diaries values(1485, "2015-08-07"); +insert into diaries values(1486, "2015-08-08"); +insert into diaries values(1487, "2015-08-09"); +insert into diaries values(1488, "2015-08-10"); +insert into diaries values(1489, "2015-08-11"); +insert into diaries values(1490, "2015-08-12"); +insert into diaries values(1491, "2015-08-13"); +insert into diaries values(1492, "2015-08-14"); +insert into diaries values(1493, "2015-08-15"); +insert into diaries values(1494, "2015-08-16"); +insert into diaries values(1495, "2015-08-17"); +insert into diaries values(1496, "2015-08-18"); +insert into diaries values(1497, "2015-08-19"); +insert into diaries values(1498, "2015-08-20"); +insert into diaries values(1499, "2015-08-21"); +insert into diaries values(1500, "2015-08-22"); +insert into diaries values(1501, "2015-08-23"); +insert into diaries values(1502, "2015-08-24"); +insert into diaries values(1503, "2015-08-25"); +insert into diaries values(1504, "2015-08-26"); +insert into diaries values(1505, "2015-08-27"); +insert into diaries values(1506, "2015-08-28"); +insert into diaries values(1507, "2015-08-29"); +insert into diaries values(1508, "2015-08-30"); +insert into diaries values(1509, "2015-08-31"); +insert into diaries values(1510, "2015-09-01"); +insert into diaries values(1511, "2015-09-02"); +insert into diaries values(1512, "2015-09-03"); +insert into diaries values(1513, "2015-09-04"); +insert into diaries values(1514, "2015-09-05"); +insert into diaries values(1515, "2015-09-06"); +insert into diaries values(1516, "2015-09-07"); +insert into diaries values(1517, "2015-09-08"); +insert into diaries values(1518, "2015-09-09"); +insert into diaries values(1519, "2015-09-10"); +insert into diaries values(1520, "2015-09-11"); +insert into diaries values(1521, "2015-09-12"); +insert into diaries values(1522, "2015-09-13"); +insert into diaries values(1523, "2015-09-14"); +insert into diaries values(1524, "2015-09-15"); +insert into diaries values(1525, "2015-09-16"); +insert into diaries values(1526, "2015-09-17"); +insert into diaries values(1527, "2015-09-18"); +insert into diaries values(1528, "2015-09-19"); +insert into diaries values(1529, "2015-09-20"); +insert into diaries values(1530, "2015-09-21"); +insert into diaries values(1531, "2015-09-22"); +insert into diaries values(1532, "2015-09-23"); +insert into diaries values(1533, "2015-09-24"); +insert into diaries values(1534, "2015-09-25"); +insert into diaries values(1535, "2015-09-26"); +insert into diaries values(1536, "2015-09-27"); +insert into diaries values(1537, "2015-09-28"); +insert into diaries values(1538, "2015-09-29"); +insert into diaries values(1539, "2015-09-30"); +insert into diaries values(1540, "2015-10-01"); +insert into diaries values(1541, "2015-10-02"); +insert into diaries values(1542, "2015-10-03"); +insert into diaries values(1543, "2015-10-04"); +insert into diaries values(1544, "2015-10-05"); +insert into diaries values(1545, "2015-10-06"); +insert into diaries values(1546, "2015-10-07"); +insert into diaries values(1547, "2015-10-08"); +insert into diaries values(1548, "2015-10-09"); +insert into diaries values(1549, "2015-10-10"); +insert into diaries values(1550, "2015-10-11"); +insert into diaries values(1551, "2015-10-12"); +insert into diaries values(1552, "2015-10-13"); +insert into diaries values(1553, "2015-10-14"); +insert into diaries values(1554, "2015-10-15"); +insert into diaries values(1555, "2015-10-16"); +insert into diaries values(1556, "2015-10-17"); +insert into diaries values(1557, "2015-10-18"); +insert into diaries values(1558, "2015-10-19"); +insert into diaries values(1559, "2015-10-20"); +insert into diaries values(1560, "2015-10-21"); +insert into diaries values(1561, "2015-10-22"); +insert into diaries values(1562, "2015-10-23"); +insert into diaries values(1563, "2015-10-24"); +insert into diaries values(1564, "2015-10-25"); +insert into diaries values(1565, "2015-10-26"); +insert into diaries values(1566, "2015-10-27"); +insert into diaries values(1567, "2015-10-28"); +insert into diaries values(1568, "2015-10-29"); +insert into diaries values(1569, "2015-10-30"); +insert into diaries values(1570, "2015-10-31"); +insert into diaries values(1571, "2015-11-01"); +insert into diaries values(1572, "2015-11-02"); +insert into diaries values(1573, "2015-11-03"); +insert into diaries values(1574, "2015-11-04"); +insert into diaries values(1575, "2015-11-05"); +insert into diaries values(1576, "2015-11-06"); +insert into diaries values(1577, "2015-11-07"); +insert into diaries values(1578, "2015-11-08"); +insert into diaries values(1579, "2015-11-09"); +insert into diaries values(1580, "2015-11-10"); +insert into diaries values(1581, "2015-11-11"); +insert into diaries values(1582, "2015-11-12"); +insert into diaries values(1583, "2015-11-13"); +insert into diaries values(1584, "2015-11-14"); +insert into diaries values(1585, "2015-11-15"); +insert into diaries values(1586, "2015-11-16"); +insert into diaries values(1587, "2015-11-17"); +insert into diaries values(1588, "2015-11-18"); +insert into diaries values(1589, "2015-11-19"); +insert into diaries values(1590, "2015-11-20"); +insert into diaries values(1591, "2015-11-21"); +insert into diaries values(1592, "2015-11-22"); +insert into diaries values(1593, "2015-11-23"); +insert into diaries values(1594, "2015-11-24"); +insert into diaries values(1595, "2015-11-25"); +insert into diaries values(1596, "2015-11-26"); +insert into diaries values(1597, "2015-11-27"); +insert into diaries values(1598, "2015-11-28"); +insert into diaries values(1599, "2015-11-29"); +insert into diaries values(1600, "2015-11-30"); +insert into diaries values(1601, "2015-12-01"); +insert into diaries values(1602, "2015-12-02"); +insert into diaries values(1603, "2015-12-03"); +insert into diaries values(1604, "2015-12-04"); +insert into diaries values(1605, "2015-12-05"); +insert into diaries values(1606, "2015-12-06"); +insert into diaries values(1607, "2015-12-07"); +insert into diaries values(1608, "2015-12-08"); +insert into diaries values(1609, "2015-12-09"); +insert into diaries values(1610, "2015-12-10"); +insert into diaries values(1611, "2015-12-11"); +insert into diaries values(1612, "2015-12-12"); +insert into diaries values(1613, "2015-12-13"); +insert into diaries values(1614, "2015-12-14"); +insert into diaries values(1615, "2015-12-15"); +insert into diaries values(1616, "2015-12-16"); +insert into diaries values(1617, "2015-12-17"); +insert into diaries values(1618, "2015-12-18"); +insert into diaries values(1619, "2015-12-19"); +insert into diaries values(1620, "2015-12-20"); +insert into diaries values(1621, "2015-12-21"); +insert into diaries values(1622, "2015-12-22"); +insert into diaries values(1623, "2015-12-23"); +insert into diaries values(1624, "2015-12-24"); +insert into diaries values(1625, "2015-12-25"); +insert into diaries values(1626, "2015-12-26"); +insert into diaries values(1627, "2015-12-27"); +insert into diaries values(1628, "2015-12-28"); +insert into diaries values(1629, "2015-12-29"); +insert into diaries values(1630, "2015-12-30"); +insert into diaries values(1631, "2015-12-31"); +insert into diaries values(1632, "2016-01-01"); +insert into diaries values(1633, "2016-01-02"); +insert into diaries values(1634, "2016-01-03"); +insert into diaries values(1635, "2016-01-04"); +insert into diaries values(1636, "2016-01-05"); +insert into diaries values(1637, "2016-01-06"); +insert into diaries values(1638, "2016-01-07"); +insert into diaries values(1639, "2016-01-08"); +insert into diaries values(1640, "2016-01-09"); +insert into diaries values(1641, "2016-01-10"); +insert into diaries values(1642, "2016-01-11"); +insert into diaries values(1643, "2016-01-12"); +insert into diaries values(1644, "2016-01-13"); +insert into diaries values(1645, "2016-01-14"); +insert into diaries values(1646, "2016-01-15"); +insert into diaries values(1647, "2016-01-16"); +insert into diaries values(1648, "2016-01-17"); +insert into diaries values(1649, "2016-01-18"); +insert into diaries values(1650, "2016-01-19"); +insert into diaries values(1651, "2016-01-20"); +insert into diaries values(1652, "2016-01-21"); +insert into diaries values(1653, "2016-01-22"); +insert into diaries values(1654, "2016-01-23"); +insert into diaries values(1655, "2016-01-24"); +insert into diaries values(1656, "2016-01-25"); +insert into diaries values(1657, "2016-01-26"); +insert into diaries values(1658, "2016-01-27"); +insert into diaries values(1659, "2016-01-28"); +insert into diaries values(1660, "2016-01-29"); +insert into diaries values(1661, "2016-01-30"); +insert into diaries values(1662, "2016-01-31"); +insert into diaries values(1663, "2016-02-01"); +insert into diaries values(1664, "2016-02-02"); +insert into diaries values(1665, "2016-02-03"); +insert into diaries values(1666, "2016-02-04"); +insert into diaries values(1667, "2016-02-05"); +insert into diaries values(1668, "2016-02-06"); +insert into diaries values(1669, "2016-02-07"); +insert into diaries values(1670, "2016-02-08"); +insert into diaries values(1671, "2016-02-09"); +insert into diaries values(1672, "2016-02-10"); +insert into diaries values(1673, "2016-02-11"); +insert into diaries values(1674, "2016-02-12"); +insert into diaries values(1675, "2016-02-13"); +insert into diaries values(1676, "2016-02-14"); +insert into diaries values(1677, "2016-02-15"); +insert into diaries values(1678, "2016-02-16"); +insert into diaries values(1679, "2016-02-17"); +insert into diaries values(1680, "2016-02-18"); +insert into diaries values(1681, "2016-02-19"); +insert into diaries values(1682, "2016-02-20"); +insert into diaries values(1683, "2016-02-21"); +insert into diaries values(1684, "2016-02-22"); +insert into diaries values(1685, "2016-02-23"); +insert into diaries values(1686, "2016-02-24"); +insert into diaries values(1687, "2016-02-25"); +insert into diaries values(1688, "2016-02-26"); +insert into diaries values(1689, "2016-02-27"); +insert into diaries values(1690, "2016-02-28"); +insert into diaries values(1691, "2016-02-29"); +insert into diaries values(1692, "2016-03-01"); +insert into diaries values(1693, "2016-03-02"); +insert into diaries values(1694, "2016-03-03"); +insert into diaries values(1695, "2016-03-04"); +insert into diaries values(1696, "2016-03-05"); +insert into diaries values(1697, "2016-03-06"); +insert into diaries values(1698, "2016-03-07"); +insert into diaries values(1699, "2016-03-08"); +insert into diaries values(1700, "2016-03-09"); +insert into diaries values(1701, "2016-03-10"); +insert into diaries values(1702, "2016-03-11"); +insert into diaries values(1703, "2016-03-12"); +insert into diaries values(1704, "2016-03-13"); +insert into diaries values(1705, "2016-03-14"); +insert into diaries values(1706, "2016-03-15"); +insert into diaries values(1707, "2016-03-16"); +insert into diaries values(1708, "2016-03-17"); +insert into diaries values(1709, "2016-03-18"); +insert into diaries values(1710, "2016-03-19"); +insert into diaries values(1711, "2016-03-20"); +insert into diaries values(1712, "2016-03-21"); +insert into diaries values(1713, "2016-03-22"); +insert into diaries values(1714, "2016-03-23"); +insert into diaries values(1715, "2016-03-24"); +insert into diaries values(1716, "2016-03-25"); +insert into diaries values(1717, "2016-03-26"); +insert into diaries values(1718, "2016-03-27"); +insert into diaries values(1719, "2016-03-28"); +insert into diaries values(1720, "2016-03-29"); +insert into diaries values(1721, "2016-03-30"); +insert into diaries values(1722, "2016-03-31"); +insert into diaries values(1723, "2016-04-01"); +insert into diaries values(1724, "2016-04-02"); +insert into diaries values(1725, "2016-04-03"); +insert into diaries values(1726, "2016-04-04"); +insert into diaries values(1727, "2016-04-05"); +insert into diaries values(1728, "2016-04-06"); +insert into diaries values(1729, "2016-04-07"); +insert into diaries values(1730, "2016-04-08"); +insert into diaries values(1731, "2016-04-09"); +insert into diaries values(1732, "2016-04-10"); +insert into diaries values(1733, "2016-04-11"); +insert into diaries values(1734, "2016-04-12"); +insert into diaries values(1735, "2016-04-13"); +insert into diaries values(1736, "2016-04-14"); +insert into diaries values(1737, "2016-04-15"); +insert into diaries values(1738, "2016-04-16"); +insert into diaries values(1739, "2016-04-17"); +insert into diaries values(1740, "2016-04-18"); +insert into diaries values(1741, "2016-04-19"); +insert into diaries values(1742, "2016-04-20"); +insert into diaries values(1743, "2016-04-21"); +insert into diaries values(1744, "2016-04-22"); +insert into diaries values(1745, "2016-04-23"); +insert into diaries values(1746, "2016-04-24"); +insert into diaries values(1747, "2016-04-25"); +insert into diaries values(1748, "2016-04-26"); +insert into diaries values(1749, "2016-04-27"); +insert into diaries values(1750, "2016-04-28"); +insert into diaries values(1751, "2016-04-29"); +insert into diaries values(1752, "2016-04-30"); +insert into diaries values(1753, "2016-05-01"); +insert into diaries values(1754, "2016-05-02"); +insert into diaries values(1755, "2016-05-03"); +insert into diaries values(1756, "2016-05-04"); +insert into diaries values(1757, "2016-05-05"); +insert into diaries values(1758, "2016-05-06"); +insert into diaries values(1759, "2016-05-07"); +insert into diaries values(1760, "2016-05-08"); +insert into diaries values(1761, "2016-05-09"); +insert into diaries values(1762, "2016-05-10"); +insert into diaries values(1763, "2016-05-11"); +insert into diaries values(1764, "2016-05-12"); +insert into diaries values(1765, "2016-05-13"); +insert into diaries values(1766, "2016-05-14"); +insert into diaries values(1767, "2016-05-15"); +insert into diaries values(1768, "2016-05-16"); +insert into diaries values(1769, "2016-05-17"); +insert into diaries values(1770, "2016-05-18"); +insert into diaries values(1771, "2016-05-19"); +insert into diaries values(1772, "2016-05-20"); +insert into diaries values(1773, "2016-05-21"); +insert into diaries values(1774, "2016-05-22"); +insert into diaries values(1775, "2016-05-23"); +insert into diaries values(1776, "2016-05-24"); +insert into diaries values(1777, "2016-05-25"); +insert into diaries values(1778, "2016-05-26"); +insert into diaries values(1779, "2016-05-27"); +insert into diaries values(1780, "2016-05-28"); +insert into diaries values(1781, "2016-05-29"); +insert into diaries values(1782, "2016-05-30"); +insert into diaries values(1783, "2016-05-31"); +insert into diaries values(1784, "2016-06-01"); +insert into diaries values(1785, "2016-06-02"); +insert into diaries values(1786, "2016-06-03"); +insert into diaries values(1787, "2016-06-04"); +insert into diaries values(1788, "2016-06-05"); +insert into diaries values(1789, "2016-06-06"); +insert into diaries values(1790, "2016-06-07"); +insert into diaries values(1791, "2016-06-08"); +insert into diaries values(1792, "2016-06-09"); +insert into diaries values(1793, "2016-06-10"); +insert into diaries values(1794, "2016-06-11"); +insert into diaries values(1795, "2016-06-12"); +insert into diaries values(1796, "2016-06-13"); +insert into diaries values(1797, "2016-06-14"); +insert into diaries values(1798, "2016-06-15"); +insert into diaries values(1799, "2016-06-16"); +insert into diaries values(1800, "2016-06-17"); +insert into diaries values(1801, "2016-06-18"); +insert into diaries values(1802, "2016-06-19"); +insert into diaries values(1803, "2016-06-20"); +insert into diaries values(1804, "2016-06-21"); +insert into diaries values(1805, "2016-06-22"); +insert into diaries values(1806, "2016-06-23"); +insert into diaries values(1807, "2016-06-24"); +insert into diaries values(1808, "2016-06-25"); +insert into diaries values(1809, "2016-06-26"); +insert into diaries values(1810, "2016-06-27"); +insert into diaries values(1811, "2016-06-28"); +insert into diaries values(1812, "2016-06-29"); +insert into diaries values(1813, "2016-06-30"); +insert into diaries values(1814, "2016-07-01"); +insert into diaries values(1815, "2016-07-02"); +insert into diaries values(1816, "2016-07-03"); +insert into diaries values(1817, "2016-07-04"); +insert into diaries values(1818, "2016-07-05"); +insert into diaries values(1819, "2016-07-06"); +insert into diaries values(1820, "2016-07-07"); +insert into diaries values(1821, "2016-07-08"); +insert into diaries values(1822, "2016-07-09"); +insert into diaries values(1823, "2016-07-10"); +insert into diaries values(1824, "2016-07-11"); +insert into diaries values(1825, "2016-07-12"); +insert into diaries values(1826, "2016-07-13"); +insert into diaries values(1827, "2016-07-14"); +insert into diaries values(1828, "2016-07-15"); +insert into diaries values(1829, "2016-07-16"); +insert into diaries values(1830, "2016-07-17"); +insert into diaries values(1831, "2016-07-18"); +insert into diaries values(1832, "2016-07-19"); +insert into diaries values(1833, "2016-07-20"); +insert into diaries values(1834, "2016-07-21"); +insert into diaries values(1835, "2016-07-22"); +insert into diaries values(1836, "2016-07-23"); +insert into diaries values(1837, "2016-07-24"); +insert into diaries values(1838, "2016-07-25"); +insert into diaries values(1839, "2016-07-26"); +insert into diaries values(1840, "2016-07-27"); +insert into diaries values(1841, "2016-07-28"); +insert into diaries values(1842, "2016-07-29"); +insert into diaries values(1843, "2016-07-30"); +insert into diaries values(1844, "2016-07-31"); +insert into diaries values(1845, "2016-08-01"); +insert into diaries values(1846, "2016-08-02"); +insert into diaries values(1847, "2016-08-03"); +insert into diaries values(1848, "2016-08-04"); +insert into diaries values(1849, "2016-08-05"); +insert into diaries values(1850, "2016-08-06"); +insert into diaries values(1851, "2016-08-07"); +insert into diaries values(1852, "2016-08-08"); +insert into diaries values(1853, "2016-08-09"); +insert into diaries values(1854, "2016-08-10"); +insert into diaries values(1855, "2016-08-11"); +insert into diaries values(1856, "2016-08-12"); +insert into diaries values(1857, "2016-08-13"); +insert into diaries values(1858, "2016-08-14"); +insert into diaries values(1859, "2016-08-15"); +insert into diaries values(1860, "2016-08-16"); +insert into diaries values(1861, "2016-08-17"); +insert into diaries values(1862, "2016-08-18"); +insert into diaries values(1863, "2016-08-19"); +insert into diaries values(1864, "2016-08-20"); +insert into diaries values(1865, "2016-08-21"); +insert into diaries values(1866, "2016-08-22"); +insert into diaries values(1867, "2016-08-23"); +insert into diaries values(1868, "2016-08-24"); +insert into diaries values(1869, "2016-08-25"); +insert into diaries values(1870, "2016-08-26"); +insert into diaries values(1871, "2016-08-27"); +insert into diaries values(1872, "2016-08-28"); +insert into diaries values(1873, "2016-08-29"); +insert into diaries values(1874, "2016-08-30"); +insert into diaries values(1875, "2016-08-31"); +insert into diaries values(1876, "2016-09-01"); +insert into diaries values(1877, "2016-09-02"); +insert into diaries values(1878, "2016-09-03"); +insert into diaries values(1879, "2016-09-04"); +insert into diaries values(1880, "2016-09-05"); +insert into diaries values(1881, "2016-09-06"); +insert into diaries values(1882, "2016-09-07"); +insert into diaries values(1883, "2016-09-08"); +insert into diaries values(1884, "2016-09-09"); +insert into diaries values(1885, "2016-09-10"); +insert into diaries values(1886, "2016-09-11"); +insert into diaries values(1887, "2016-09-12"); +insert into diaries values(1888, "2016-09-13"); +insert into diaries values(1889, "2016-09-14"); +insert into diaries values(1890, "2016-09-15"); +insert into diaries values(1891, "2016-09-16"); +insert into diaries values(1892, "2016-09-17"); +insert into diaries values(1893, "2016-09-18"); +insert into diaries values(1894, "2016-09-19"); +insert into diaries values(1895, "2016-09-20"); +insert into diaries values(1896, "2016-09-21"); +insert into diaries values(1897, "2016-09-22"); +insert into diaries values(1898, "2016-09-23"); +insert into diaries values(1899, "2016-09-24"); +insert into diaries values(1900, "2016-09-25"); +insert into diaries values(1901, "2016-09-26"); +insert into diaries values(1902, "2016-09-27"); +insert into diaries values(1903, "2016-09-28"); +insert into diaries values(1904, "2016-09-29"); +insert into diaries values(1905, "2016-09-30"); +insert into diaries values(1906, "2016-10-01"); +insert into diaries values(1907, "2016-10-02"); +insert into diaries values(1908, "2016-10-03"); +insert into diaries values(1909, "2016-10-04"); +insert into diaries values(1910, "2016-10-05"); +insert into diaries values(1911, "2016-10-06"); +insert into diaries values(1912, "2016-10-07"); +insert into diaries values(1913, "2016-10-08"); +insert into diaries values(1914, "2016-10-09"); +insert into diaries values(1915, "2016-10-10"); +insert into diaries values(1916, "2016-10-11"); +insert into diaries values(1917, "2016-10-12"); +insert into diaries values(1918, "2016-10-13"); +insert into diaries values(1919, "2016-10-14"); +insert into diaries values(1920, "2016-10-15"); +insert into diaries values(1921, "2016-10-16"); +insert into diaries values(1922, "2016-10-17"); +insert into diaries values(1923, "2016-10-18"); +insert into diaries values(1924, "2016-10-19"); +insert into diaries values(1925, "2016-10-20"); +insert into diaries values(1926, "2016-10-21"); +insert into diaries values(1927, "2016-10-22"); +insert into diaries values(1928, "2016-10-23"); +insert into diaries values(1929, "2016-10-24"); +insert into diaries values(1930, "2016-10-25"); +insert into diaries values(1931, "2016-10-26"); +insert into diaries values(1932, "2016-10-27"); +insert into diaries values(1933, "2016-10-28"); +insert into diaries values(1934, "2016-10-29"); +insert into diaries values(1935, "2016-10-30"); +insert into diaries values(1936, "2016-10-31"); +insert into diaries values(1937, "2016-11-01"); +insert into diaries values(1938, "2016-11-02"); +insert into diaries values(1939, "2016-11-03"); +insert into diaries values(1940, "2016-11-04"); +insert into diaries values(1941, "2016-11-05"); +insert into diaries values(1942, "2016-11-06"); +insert into diaries values(1943, "2016-11-07"); +insert into diaries values(1944, "2016-11-08"); +insert into diaries values(1945, "2016-11-09"); +insert into diaries values(1946, "2016-11-10"); +insert into diaries values(1947, "2016-11-11"); +insert into diaries values(1948, "2016-11-12"); +insert into diaries values(1949, "2016-11-13"); +insert into diaries values(1950, "2016-11-14"); +insert into diaries values(1951, "2016-11-15"); +insert into diaries values(1952, "2016-11-16"); +insert into diaries values(1953, "2016-11-17"); +insert into diaries values(1954, "2016-11-18"); +insert into diaries values(1955, "2016-11-19"); +insert into diaries values(1956, "2016-11-20"); +insert into diaries values(1957, "2016-11-21"); +insert into diaries values(1958, "2016-11-22"); +insert into diaries values(1959, "2016-11-23"); +insert into diaries values(1960, "2016-11-24"); +insert into diaries values(1961, "2016-11-25"); +insert into diaries values(1962, "2016-11-26"); +insert into diaries values(1963, "2016-11-27"); +insert into diaries values(1964, "2016-11-28"); +insert into diaries values(1965, "2016-11-29"); +insert into diaries values(1966, "2016-11-30"); +insert into diaries values(1967, "2016-12-01"); +insert into diaries values(1968, "2016-12-02"); +insert into diaries values(1969, "2016-12-03"); +insert into diaries values(1970, "2016-12-04"); +insert into diaries values(1971, "2016-12-05"); +insert into diaries values(1972, "2016-12-06"); +insert into diaries values(1973, "2016-12-07"); +insert into diaries values(1974, "2016-12-08"); +insert into diaries values(1975, "2016-12-09"); +insert into diaries values(1976, "2016-12-10"); +insert into diaries values(1977, "2016-12-11"); +insert into diaries values(1978, "2016-12-12"); +insert into diaries values(1979, "2016-12-13"); +insert into diaries values(1980, "2016-12-14"); +insert into diaries values(1981, "2016-12-15"); +insert into diaries values(1982, "2016-12-16"); +insert into diaries values(1983, "2016-12-17"); +insert into diaries values(1984, "2016-12-18"); +insert into diaries values(1985, "2016-12-19"); +insert into diaries values(1986, "2016-12-20"); +insert into diaries values(1987, "2016-12-21"); +insert into diaries values(1988, "2016-12-22"); +insert into diaries values(1989, "2016-12-23"); +insert into diaries values(1990, "2016-12-24"); +insert into diaries values(1991, "2016-12-25"); +insert into diaries values(1992, "2016-12-26"); +insert into diaries values(1993, "2016-12-27"); +insert into diaries values(1994, "2016-12-28"); +insert into diaries values(1995, "2016-12-29"); +insert into diaries values(1996, "2016-12-30"); +insert into diaries values(1997, "2016-12-31"); +insert into diaries values(1998, "2017-01-01"); +insert into diaries values(1999, "2017-01-02"); +insert into diaries values(2000, "2017-01-03"); +insert into diaries values(2001, "2017-01-04"); +insert into diaries values(2002, "2017-01-05"); +insert into diaries values(2003, "2017-01-06"); +insert into diaries values(2004, "2017-01-07"); +insert into diaries values(2005, "2017-01-08"); +insert into diaries values(2006, "2017-01-09"); +insert into diaries values(2007, "2017-01-10"); +insert into diaries values(2008, "2017-01-11"); +insert into diaries values(2009, "2017-01-12"); +insert into diaries values(2010, "2017-01-13"); +insert into diaries values(2011, "2017-01-14"); +insert into diaries values(2012, "2017-01-15"); +insert into diaries values(2013, "2017-01-16"); +insert into diaries values(2014, "2017-01-17"); +insert into diaries values(2015, "2017-01-18"); +insert into diaries values(2016, "2017-01-19"); +insert into diaries values(2017, "2017-01-20"); +insert into diaries values(2018, "2017-01-21"); +insert into diaries values(2019, "2017-01-22"); +insert into diaries values(2020, "2017-01-23"); +insert into diaries values(2021, "2017-01-24"); +insert into diaries values(2022, "2017-01-25"); +insert into diaries values(2023, "2017-01-26"); +insert into diaries values(2024, "2017-01-27"); +insert into diaries values(2025, "2017-01-28"); +insert into diaries values(2026, "2017-01-29"); +insert into diaries values(2027, "2017-01-30"); +insert into diaries values(2028, "2017-01-31"); +insert into diaries values(2029, "2017-02-01"); +insert into diaries values(2030, "2017-02-02"); +insert into diaries values(2031, "2017-02-03"); +insert into diaries values(2032, "2017-02-04"); +insert into diaries values(2033, "2017-02-05"); +insert into diaries values(2034, "2017-02-06"); +insert into diaries values(2035, "2017-02-07"); +insert into diaries values(2036, "2017-02-08"); +insert into diaries values(2037, "2017-02-09"); +insert into diaries values(2038, "2017-02-10"); +insert into diaries values(2039, "2017-02-11"); +insert into diaries values(2040, "2017-02-12"); +insert into diaries values(2041, "2017-02-13"); +insert into diaries values(2042, "2017-02-14"); +insert into diaries values(2043, "2017-02-15"); +insert into diaries values(2044, "2017-02-16"); +insert into diaries values(2045, "2017-02-17"); +insert into diaries values(2046, "2017-02-18"); +insert into diaries values(2047, "2017-02-19"); +insert into diaries values(2048, "2017-02-20"); +insert into diaries values(2049, "2017-02-21"); +insert into diaries values(2050, "2017-02-22"); +insert into diaries values(2051, "2017-02-23"); +insert into diaries values(2052, "2017-02-24"); +insert into diaries values(2053, "2017-02-25"); +insert into diaries values(2054, "2017-02-26"); +insert into diaries values(2055, "2017-02-27"); +insert into diaries values(2056, "2017-02-28"); +insert into diaries values(2057, "2017-03-01"); +insert into diaries values(2058, "2017-03-02"); +insert into diaries values(2059, "2017-03-03"); +insert into diaries values(2060, "2017-03-04"); +insert into diaries values(2061, "2017-03-05"); +insert into diaries values(2062, "2017-03-06"); +insert into diaries values(2063, "2017-03-07"); +insert into diaries values(2064, "2017-03-08"); +insert into diaries values(2065, "2017-03-09"); +insert into diaries values(2066, "2017-03-10"); +insert into diaries values(2067, "2017-03-11"); +insert into diaries values(2068, "2017-03-12"); +insert into diaries values(2069, "2017-03-13"); +insert into diaries values(2070, "2017-03-14"); +insert into diaries values(2071, "2017-03-15"); +insert into diaries values(2072, "2017-03-16"); +insert into diaries values(2073, "2017-03-17"); +insert into diaries values(2074, "2017-03-18"); +insert into diaries values(2075, "2017-03-19"); +insert into diaries values(2076, "2017-03-20"); +insert into diaries values(2077, "2017-03-21"); +insert into diaries values(2078, "2017-03-22"); +insert into diaries values(2079, "2017-03-23"); +insert into diaries values(2080, "2017-03-24"); +insert into diaries values(2081, "2017-03-25"); +insert into diaries values(2082, "2017-03-26"); +insert into diaries values(2083, "2017-03-27"); +insert into diaries values(2084, "2017-03-28"); +insert into diaries values(2085, "2017-03-29"); +insert into diaries values(2086, "2017-03-30"); +insert into diaries values(2087, "2017-03-31"); +insert into diaries values(2088, "2017-04-01"); +insert into diaries values(2089, "2017-04-02"); +insert into diaries values(2090, "2017-04-03"); +insert into diaries values(2091, "2017-04-04"); +insert into diaries values(2092, "2017-04-05"); +insert into diaries values(2093, "2017-04-06"); +insert into diaries values(2094, "2017-04-07"); +insert into diaries values(2095, "2017-04-08"); +insert into diaries values(2096, "2017-04-09"); +insert into diaries values(2097, "2017-04-10"); +insert into diaries values(2098, "2017-04-11"); +insert into diaries values(2099, "2017-04-12"); +insert into diaries values(2100, "2017-04-13"); +insert into diaries values(2101, "2017-04-14"); +insert into diaries values(2102, "2017-04-15"); +insert into diaries values(2103, "2017-04-16"); +insert into diaries values(2104, "2017-04-17"); +insert into diaries values(2105, "2017-04-18"); +insert into diaries values(2106, "2017-04-19"); +insert into diaries values(2107, "2017-04-20"); +insert into diaries values(2108, "2017-04-21"); +insert into diaries values(2109, "2017-04-22"); +insert into diaries values(2110, "2017-04-23"); +insert into diaries values(2111, "2017-04-24"); +insert into diaries values(2112, "2017-04-25"); +insert into diaries values(2113, "2017-04-26"); +insert into diaries values(2114, "2017-04-27"); +insert into diaries values(2115, "2017-04-28"); +insert into diaries values(2116, "2017-04-29"); +insert into diaries values(2117, "2017-04-30"); +insert into diaries values(2118, "2017-05-01"); +insert into diaries values(2119, "2017-05-02"); +insert into diaries values(2120, "2017-05-03"); +insert into diaries values(2121, "2017-05-04"); +insert into diaries values(2122, "2017-05-05"); +insert into diaries values(2123, "2017-05-06"); +insert into diaries values(2124, "2017-05-07"); +insert into diaries values(2125, "2017-05-08"); +insert into diaries values(2126, "2017-05-09"); +insert into diaries values(2127, "2017-05-10"); +insert into diaries values(2128, "2017-05-11"); +insert into diaries values(2129, "2017-05-12"); +insert into diaries values(2130, "2017-05-13"); +insert into diaries values(2131, "2017-05-14"); +insert into diaries values(2132, "2017-05-15"); +insert into diaries values(2133, "2017-05-16"); +insert into diaries values(2134, "2017-05-17"); +insert into diaries values(2135, "2017-05-18"); +insert into diaries values(2136, "2017-05-19"); +insert into diaries values(2137, "2017-05-20"); +insert into diaries values(2138, "2017-05-21"); +insert into diaries values(2139, "2017-05-22"); +insert into diaries values(2140, "2017-05-23"); +insert into diaries values(2141, "2017-05-24"); +insert into diaries values(2142, "2017-05-25"); +insert into diaries values(2143, "2017-05-26"); +insert into diaries values(2144, "2017-05-27"); +insert into diaries values(2145, "2017-05-28"); +insert into diaries values(2146, "2017-05-29"); +insert into diaries values(2147, "2017-05-30"); +insert into diaries values(2148, "2017-05-31"); +insert into diaries values(2149, "2017-06-01"); +insert into diaries values(2150, "2017-06-02"); +insert into diaries values(2151, "2017-06-03"); +insert into diaries values(2152, "2017-06-04"); +insert into diaries values(2153, "2017-06-05"); +insert into diaries values(2154, "2017-06-06"); +insert into diaries values(2155, "2017-06-07"); +insert into diaries values(2156, "2017-06-08"); +insert into diaries values(2157, "2017-06-09"); +insert into diaries values(2158, "2017-06-10"); +insert into diaries values(2159, "2017-06-11"); +insert into diaries values(2160, "2017-06-12"); +insert into diaries values(2161, "2017-06-13"); +insert into diaries values(2162, "2017-06-14"); +insert into diaries values(2163, "2017-06-15"); +insert into diaries values(2164, "2017-06-16"); +insert into diaries values(2165, "2017-06-17"); +insert into diaries values(2166, "2017-06-18"); +insert into diaries values(2167, "2017-06-19"); +insert into diaries values(2168, "2017-06-20"); +insert into diaries values(2169, "2017-06-21"); +insert into diaries values(2170, "2017-06-22"); +insert into diaries values(2171, "2017-06-23"); +insert into diaries values(2172, "2017-06-24"); +insert into diaries values(2173, "2017-06-25"); +insert into diaries values(2174, "2017-06-26"); +insert into diaries values(2175, "2017-06-27"); +insert into diaries values(2176, "2017-06-28"); +insert into diaries values(2177, "2017-06-29"); +insert into diaries values(2178, "2017-06-30"); +insert into diaries values(2179, "2017-07-01"); +insert into diaries values(2180, "2017-07-02"); +insert into diaries values(2181, "2017-07-03"); +insert into diaries values(2182, "2017-07-04"); +insert into diaries values(2183, "2017-07-05"); +insert into diaries values(2184, "2017-07-06"); +insert into diaries values(2185, "2017-07-07"); +insert into diaries values(2186, "2017-07-08"); +insert into diaries values(2187, "2017-07-09"); +insert into diaries values(2188, "2017-07-10"); +insert into diaries values(2189, "2017-07-11"); +insert into diaries values(2190, "2017-07-12"); +insert into diaries values(2191, "2017-07-13"); +insert into diaries values(2192, "2017-07-14"); +insert into diaries values(2193, "2017-07-15"); +insert into diaries values(2194, "2017-07-16"); +insert into diaries values(2195, "2017-07-17"); +insert into diaries values(2196, "2017-07-18"); +insert into diaries values(2197, "2017-07-19"); +insert into diaries values(2198, "2017-07-20"); +insert into diaries values(2199, "2017-07-21"); +insert into diaries values(2200, "2017-07-22"); +insert into diaries values(2201, "2017-07-23"); +insert into diaries values(2202, "2017-07-24"); +insert into diaries values(2203, "2017-07-25"); +insert into diaries values(2204, "2017-07-26"); +insert into diaries values(2205, "2017-07-27"); +insert into diaries values(2206, "2017-07-28"); +insert into diaries values(2207, "2017-07-29"); +insert into diaries values(2208, "2017-07-30"); +insert into diaries values(2209, "2017-07-31"); +insert into diaries values(2210, "2017-08-01"); +insert into diaries values(2211, "2017-08-02"); +insert into diaries values(2212, "2017-08-03"); +insert into diaries values(2213, "2017-08-04"); +insert into diaries values(2214, "2017-08-05"); +insert into diaries values(2215, "2017-08-06"); +insert into diaries values(2216, "2017-08-07"); +insert into diaries values(2217, "2017-08-08"); +insert into diaries values(2218, "2017-08-09"); +insert into diaries values(2219, "2017-08-10"); +insert into diaries values(2220, "2017-08-11"); +insert into diaries values(2221, "2017-08-12"); +insert into diaries values(2222, "2017-08-13"); +insert into diaries values(2223, "2017-08-14"); +insert into diaries values(2224, "2017-08-15"); +insert into diaries values(2225, "2017-08-16"); +insert into diaries values(2226, "2017-08-17"); +insert into diaries values(2227, "2017-08-18"); +insert into diaries values(2228, "2017-08-19"); +insert into diaries values(2229, "2017-08-20"); +insert into diaries values(2230, "2017-08-21"); +insert into diaries values(2231, "2017-08-22"); +insert into diaries values(2232, "2017-08-23"); +insert into diaries values(2233, "2017-08-24"); +insert into diaries values(2234, "2017-08-25"); +insert into diaries values(2235, "2017-08-26"); +insert into diaries values(2236, "2017-08-27"); +insert into diaries values(2237, "2017-08-28"); +insert into diaries values(2238, "2017-08-29"); +insert into diaries values(2239, "2017-08-30"); +insert into diaries values(2240, "2017-08-31"); +insert into diaries values(2241, "2017-09-01"); +insert into diaries values(2242, "2017-09-02"); +insert into diaries values(2243, "2017-09-03"); +insert into diaries values(2244, "2017-09-04"); +insert into diaries values(2245, "2017-09-05"); +insert into diaries values(2246, "2017-09-06"); +insert into diaries values(2247, "2017-09-07"); +insert into diaries values(2248, "2017-09-08"); +insert into diaries values(2249, "2017-09-09"); +insert into diaries values(2250, "2017-09-10"); +insert into diaries values(2251, "2017-09-11"); +insert into diaries values(2252, "2017-09-12"); +insert into diaries values(2253, "2017-09-13"); +insert into diaries values(2254, "2017-09-14"); +insert into diaries values(2255, "2017-09-15"); +insert into diaries values(2256, "2017-09-16"); +insert into diaries values(2257, "2017-09-17"); +insert into diaries values(2258, "2017-09-18"); +insert into diaries values(2259, "2017-09-19"); +insert into diaries values(2260, "2017-09-20"); +insert into diaries values(2261, "2017-09-21"); +insert into diaries values(2262, "2017-09-22"); +insert into diaries values(2263, "2017-09-23"); +insert into diaries values(2264, "2017-09-24"); +insert into diaries values(2265, "2017-09-25"); +insert into diaries values(2266, "2017-09-26"); +insert into diaries values(2267, "2017-09-27"); +insert into diaries values(2268, "2017-09-28"); +insert into diaries values(2269, "2017-09-29"); +insert into diaries values(2270, "2017-09-30"); +insert into diaries values(2271, "2017-10-01"); +insert into diaries values(2272, "2017-10-02"); +insert into diaries values(2273, "2017-10-03"); +insert into diaries values(2274, "2017-10-04"); +insert into diaries values(2275, "2017-10-05"); +insert into diaries values(2276, "2017-10-06"); +insert into diaries values(2277, "2017-10-07"); +insert into diaries values(2278, "2017-10-08"); +insert into diaries values(2279, "2017-10-09"); +insert into diaries values(2280, "2017-10-10"); +insert into diaries values(2281, "2017-10-11"); +insert into diaries values(2282, "2017-10-12"); +insert into diaries values(2283, "2017-10-13"); +insert into diaries values(2284, "2017-10-14"); +insert into diaries values(2285, "2017-10-15"); +insert into diaries values(2286, "2017-10-16"); +insert into diaries values(2287, "2017-10-17"); +insert into diaries values(2288, "2017-10-18"); +insert into diaries values(2289, "2017-10-19"); +insert into diaries values(2290, "2017-10-20"); +insert into diaries values(2291, "2017-10-21"); +insert into diaries values(2292, "2017-10-22"); +insert into diaries values(2293, "2017-10-23"); +insert into diaries values(2294, "2017-10-24"); +insert into diaries values(2295, "2017-10-25"); +insert into diaries values(2296, "2017-10-26"); +insert into diaries values(2297, "2017-10-27"); +insert into diaries values(2298, "2017-10-28"); +insert into diaries values(2299, "2017-10-29"); +insert into diaries values(2300, "2017-10-30"); +insert into diaries values(2301, "2017-10-31"); +insert into diaries values(2302, "2017-11-01"); +insert into diaries values(2303, "2017-11-02"); +insert into diaries values(2304, "2017-11-03"); +insert into diaries values(2305, "2017-11-04"); +insert into diaries values(2306, "2017-11-05"); +insert into diaries values(2307, "2017-11-06"); +insert into diaries values(2308, "2017-11-07"); +insert into diaries values(2309, "2017-11-08"); +insert into diaries values(2310, "2017-11-09"); +insert into diaries values(2311, "2017-11-10"); +insert into diaries values(2312, "2017-11-11"); +insert into diaries values(2313, "2017-11-12"); +insert into diaries values(2314, "2017-11-13"); +insert into diaries values(2315, "2017-11-14"); +insert into diaries values(2316, "2017-11-15"); +insert into diaries values(2317, "2017-11-16"); +insert into diaries values(2318, "2017-11-17"); +insert into diaries values(2319, "2017-11-18"); +insert into diaries values(2320, "2017-11-19"); +insert into diaries values(2321, "2017-11-20"); +insert into diaries values(2322, "2017-11-21"); +insert into diaries values(2323, "2017-11-22"); +insert into diaries values(2324, "2017-11-23"); +insert into diaries values(2325, "2017-11-24"); +insert into diaries values(2326, "2017-11-25"); +insert into diaries values(2327, "2017-11-26"); +insert into diaries values(2328, "2017-11-27"); +insert into diaries values(2329, "2017-11-28"); +insert into diaries values(2330, "2017-11-29"); +insert into diaries values(2331, "2017-11-30"); +insert into diaries values(2332, "2017-12-01"); +insert into diaries values(2333, "2017-12-02"); +insert into diaries values(2334, "2017-12-03"); +insert into diaries values(2335, "2017-12-04"); +insert into diaries values(2336, "2017-12-05"); +insert into diaries values(2337, "2017-12-06"); +insert into diaries values(2338, "2017-12-07"); +insert into diaries values(2339, "2017-12-08"); +insert into diaries values(2340, "2017-12-09"); +insert into diaries values(2341, "2017-12-10"); +insert into diaries values(2342, "2017-12-11"); +insert into diaries values(2343, "2017-12-12"); +insert into diaries values(2344, "2017-12-13"); +insert into diaries values(2345, "2017-12-14"); +insert into diaries values(2346, "2017-12-15"); +insert into diaries values(2347, "2017-12-16"); +insert into diaries values(2348, "2017-12-17"); +insert into diaries values(2349, "2017-12-18"); +insert into diaries values(2350, "2017-12-19"); +insert into diaries values(2351, "2017-12-20"); +insert into diaries values(2352, "2017-12-21"); +insert into diaries values(2353, "2017-12-22"); +insert into diaries values(2354, "2017-12-23"); +insert into diaries values(2355, "2017-12-24"); +insert into diaries values(2356, "2017-12-25"); +insert into diaries values(2357, "2017-12-26"); +insert into diaries values(2358, "2017-12-27"); +insert into diaries values(2359, "2017-12-28"); +insert into diaries values(2360, "2017-12-29"); +insert into diaries values(2361, "2017-12-30"); +insert into diaries values(2362, "2017-12-31"); +insert into diaries values(2363, "2018-01-01"); +insert into diaries values(2364, "2018-01-02"); +insert into diaries values(2365, "2018-01-03"); +insert into diaries values(2366, "2018-01-04"); +insert into diaries values(2367, "2018-01-05"); +insert into diaries values(2368, "2018-01-06"); +insert into diaries values(2369, "2018-01-07"); +insert into diaries values(2370, "2018-01-08"); +insert into diaries values(2371, "2018-01-09"); +insert into diaries values(2372, "2018-01-10"); +insert into diaries values(2373, "2018-01-11"); +insert into diaries values(2374, "2018-01-12"); +insert into diaries values(2375, "2018-01-13"); +insert into diaries values(2376, "2018-01-14"); +insert into diaries values(2377, "2018-01-15"); +insert into diaries values(2378, "2018-01-16"); +insert into diaries values(2379, "2018-01-17"); +insert into diaries values(2380, "2018-01-18"); +insert into diaries values(2381, "2018-01-19"); +insert into diaries values(2382, "2018-01-20"); +insert into diaries values(2383, "2018-01-21"); +insert into diaries values(2384, "2018-01-22"); +insert into diaries values(2385, "2018-01-23"); +insert into diaries values(2386, "2018-01-24"); +insert into diaries values(2387, "2018-01-25"); +insert into diaries values(2388, "2018-01-26"); +insert into diaries values(2389, "2018-01-27"); +insert into diaries values(2390, "2018-01-28"); +insert into diaries values(2391, "2018-01-29"); +insert into diaries values(2392, "2018-01-30"); +insert into diaries values(2393, "2018-01-31"); +insert into diaries values(2394, "2018-02-01"); +insert into diaries values(2395, "2018-02-02"); +insert into diaries values(2396, "2018-02-03"); +insert into diaries values(2397, "2018-02-04"); +insert into diaries values(2398, "2018-02-05"); +insert into diaries values(2399, "2018-02-06"); +insert into diaries values(2400, "2018-02-07"); +insert into diaries values(2401, "2018-02-08"); +insert into diaries values(2402, "2018-02-09"); +insert into diaries values(2403, "2018-02-10"); +insert into diaries values(2404, "2018-02-11"); +insert into diaries values(2405, "2018-02-12"); +insert into diaries values(2406, "2018-02-13"); +insert into diaries values(2407, "2018-02-14"); +insert into diaries values(2408, "2018-02-15"); +insert into diaries values(2409, "2018-02-16"); +insert into diaries values(2410, "2018-02-17"); +insert into diaries values(2411, "2018-02-18"); +insert into diaries values(2412, "2018-02-19"); +insert into diaries values(2413, "2018-02-20"); +insert into diaries values(2414, "2018-02-21"); +insert into diaries values(2415, "2018-02-22"); +insert into diaries values(2416, "2018-02-23"); +insert into diaries values(2417, "2018-02-24"); +insert into diaries values(2418, "2018-02-25"); +insert into diaries values(2419, "2018-02-26"); +insert into diaries values(2420, "2018-02-27"); +insert into diaries values(2421, "2018-02-28"); +insert into diaries values(2422, "2018-03-01"); +insert into diaries values(2423, "2018-03-02"); +insert into diaries values(2424, "2018-03-03"); +insert into diaries values(2425, "2018-03-04"); +insert into diaries values(2426, "2018-03-05"); +insert into diaries values(2427, "2018-03-06"); +insert into diaries values(2428, "2018-03-07"); +insert into diaries values(2429, "2018-03-08"); +insert into diaries values(2430, "2018-03-09"); +insert into diaries values(2431, "2018-03-10"); +insert into diaries values(2432, "2018-03-11"); +insert into diaries values(2433, "2018-03-12"); +insert into diaries values(2434, "2018-03-13"); +insert into diaries values(2435, "2018-03-14"); +insert into diaries values(2436, "2018-03-15"); +insert into diaries values(2437, "2018-03-16"); +insert into diaries values(2438, "2018-03-17"); +insert into diaries values(2439, "2018-03-18"); +insert into diaries values(2440, "2018-03-19"); +insert into diaries values(2441, "2018-03-20"); +insert into diaries values(2442, "2018-03-21"); +insert into diaries values(2443, "2018-03-22"); +insert into diaries values(2444, "2018-03-23"); +insert into diaries values(2445, "2018-03-24"); +insert into diaries values(2446, "2018-03-25"); +insert into diaries values(2447, "2018-03-26"); +insert into diaries values(2448, "2018-03-27"); +insert into diaries values(2449, "2018-03-28"); +insert into diaries values(2450, "2018-03-29"); +insert into diaries values(2451, "2018-03-30"); +insert into diaries values(2452, "2018-03-31"); +insert into diaries values(2453, "2018-04-01"); +insert into diaries values(2454, "2018-04-02"); +insert into diaries values(2455, "2018-04-03"); +insert into diaries values(2456, "2018-04-04"); +insert into diaries values(2457, "2018-04-05"); +insert into diaries values(2458, "2018-04-06"); +insert into diaries values(2459, "2018-04-07"); +insert into diaries values(2460, "2018-04-08"); +insert into diaries values(2461, "2018-04-09"); +insert into diaries values(2462, "2018-04-10"); +insert into diaries values(2463, "2018-04-11"); +insert into diaries values(2464, "2018-04-12"); +insert into diaries values(2465, "2018-04-13"); +insert into diaries values(2466, "2018-04-14"); +insert into diaries values(2467, "2018-04-15"); +insert into diaries values(2468, "2018-04-16"); +insert into diaries values(2469, "2018-04-17"); +insert into diaries values(2470, "2018-04-18"); +insert into diaries values(2471, "2018-04-19"); +insert into diaries values(2472, "2018-04-20"); +insert into diaries values(2473, "2018-04-21"); +insert into diaries values(2474, "2018-04-22"); +insert into diaries values(2475, "2018-04-23"); +insert into diaries values(2476, "2018-04-24"); +insert into diaries values(2477, "2018-04-25"); +insert into diaries values(2478, "2018-04-26"); +insert into diaries values(2479, "2018-04-27"); +insert into diaries values(2480, "2018-04-28"); +insert into diaries values(2481, "2018-04-29"); +insert into diaries values(2482, "2018-04-30"); +insert into diaries values(2483, "2018-05-01"); +insert into diaries values(2484, "2018-05-02"); +insert into diaries values(2485, "2018-05-03"); +insert into diaries values(2486, "2018-05-04"); +insert into diaries values(2487, "2018-05-05"); +insert into diaries values(2488, "2018-05-06"); +insert into diaries values(2489, "2018-05-07"); +insert into diaries values(2490, "2018-05-08"); +insert into diaries values(2491, "2018-05-09"); +insert into diaries values(2492, "2018-05-10"); +insert into diaries values(2493, "2018-05-11"); +insert into diaries values(2494, "2018-05-12"); +insert into diaries values(2495, "2018-05-13"); +insert into diaries values(2496, "2018-05-14"); +insert into diaries values(2497, "2018-05-15"); +insert into diaries values(2498, "2018-05-16"); +insert into diaries values(2499, "2018-05-17"); +insert into diaries values(2500, "2018-05-18"); +insert into diaries values(2501, "2018-05-19"); +insert into diaries values(2502, "2018-05-20"); +insert into diaries values(2503, "2018-05-21"); +insert into diaries values(2504, "2018-05-22"); +insert into diaries values(2505, "2018-05-23"); +insert into diaries values(2506, "2018-05-24"); +insert into diaries values(2507, "2018-05-25"); +insert into diaries values(2508, "2018-05-26"); +insert into diaries values(2509, "2018-05-27"); +insert into diaries values(2510, "2018-05-28"); +insert into diaries values(2511, "2018-05-29"); +insert into diaries values(2512, "2018-05-30"); +insert into diaries values(2513, "2018-05-31"); +insert into diaries values(2514, "2018-06-01"); +insert into diaries values(2515, "2018-06-02"); +insert into diaries values(2516, "2018-06-03"); +insert into diaries values(2517, "2018-06-04"); +insert into diaries values(2518, "2018-06-05"); +insert into diaries values(2519, "2018-06-06"); +insert into diaries values(2520, "2018-06-07"); +insert into diaries values(2521, "2018-06-08"); +insert into diaries values(2522, "2018-06-09"); +insert into diaries values(2523, "2018-06-10"); +insert into diaries values(2524, "2018-06-11"); +insert into diaries values(2525, "2018-06-12"); +insert into diaries values(2526, "2018-06-13"); +insert into diaries values(2527, "2018-06-14"); +insert into diaries values(2528, "2018-06-15"); +insert into diaries values(2529, "2018-06-16"); +insert into diaries values(2530, "2018-06-17"); +insert into diaries values(2531, "2018-06-18"); +insert into diaries values(2532, "2018-06-19"); +insert into diaries values(2533, "2018-06-20"); +insert into diaries values(2534, "2018-06-21"); +insert into diaries values(2535, "2018-06-22"); +insert into diaries values(2536, "2018-06-23"); +insert into diaries values(2537, "2018-06-24"); +insert into diaries values(2538, "2018-06-25"); +insert into diaries values(2539, "2018-06-26"); +insert into diaries values(2540, "2018-06-27"); +insert into diaries values(2541, "2018-06-28"); +insert into diaries values(2542, "2018-06-29"); +insert into diaries values(2543, "2018-06-30"); +insert into diaries values(2544, "2018-07-01"); +insert into diaries values(2545, "2018-07-02"); +insert into diaries values(2546, "2018-07-03"); +insert into diaries values(2547, "2018-07-04"); +insert into diaries values(2548, "2018-07-05"); +insert into diaries values(2549, "2018-07-06"); +insert into diaries values(2550, "2018-07-07"); +insert into diaries values(2551, "2018-07-08"); +insert into diaries values(2552, "2018-07-09"); +insert into diaries values(2553, "2018-07-10"); +insert into diaries values(2554, "2018-07-11"); +insert into diaries values(2555, "2018-07-12"); +insert into diaries values(2556, "2018-07-13"); +insert into diaries values(2557, "2018-07-14"); +insert into diaries values(2558, "2018-07-15"); +insert into diaries values(2559, "2018-07-16"); +insert into diaries values(2560, "2018-07-17"); +insert into diaries values(2561, "2018-07-18"); +insert into diaries values(2562, "2018-07-19"); +insert into diaries values(2563, "2018-07-20"); +insert into diaries values(2564, "2018-07-21"); +insert into diaries values(2565, "2018-07-22"); +insert into diaries values(2566, "2018-07-23"); +insert into diaries values(2567, "2018-07-24"); +insert into diaries values(2568, "2018-07-25"); +insert into diaries values(2569, "2018-07-26"); +insert into diaries values(2570, "2018-07-27"); +insert into diaries values(2571, "2018-07-28"); +insert into diaries values(2572, "2018-07-29"); +insert into diaries values(2573, "2018-07-30"); +insert into diaries values(2574, "2018-07-31"); +insert into diaries values(2575, "2018-08-01"); +insert into diaries values(2576, "2018-08-02"); +insert into diaries values(2577, "2018-08-03"); +insert into diaries values(2578, "2018-08-04"); +insert into diaries values(2579, "2018-08-05"); +insert into diaries values(2580, "2018-08-06"); +insert into diaries values(2581, "2018-08-07"); +insert into diaries values(2582, "2018-08-08"); +insert into diaries values(2583, "2018-08-09"); +insert into diaries values(2584, "2018-08-10"); +insert into diaries values(2585, "2018-08-11"); +insert into diaries values(2586, "2018-08-12"); +insert into diaries values(2587, "2018-08-13"); +insert into diaries values(2588, "2018-08-14"); +insert into diaries values(2589, "2018-08-15"); +insert into diaries values(2590, "2018-08-16"); +insert into diaries values(2591, "2018-08-17"); +insert into diaries values(2592, "2018-08-18"); +insert into diaries values(2593, "2018-08-19"); +insert into diaries values(2594, "2018-08-20"); +insert into diaries values(2595, "2018-08-21"); +insert into diaries values(2596, "2018-08-22"); +insert into diaries values(2597, "2018-08-23"); +insert into diaries values(2598, "2018-08-24"); +insert into diaries values(2599, "2018-08-25"); +insert into diaries values(2600, "2018-08-26"); +insert into diaries values(2601, "2018-08-27"); +insert into diaries values(2602, "2018-08-28"); +insert into diaries values(2603, "2018-08-29"); +insert into diaries values(2604, "2018-08-30"); +insert into diaries values(2605, "2018-08-31"); +insert into diaries values(2606, "2018-09-01"); +insert into diaries values(2607, "2018-09-02"); +insert into diaries values(2608, "2018-09-03"); +insert into diaries values(2609, "2018-09-04"); +insert into diaries values(2610, "2018-09-05"); +insert into diaries values(2611, "2018-09-06"); +insert into diaries values(2612, "2018-09-07"); +insert into diaries values(2613, "2018-09-08"); +insert into diaries values(2614, "2018-09-09"); +insert into diaries values(2615, "2018-09-10"); +insert into diaries values(2616, "2018-09-11"); +insert into diaries values(2617, "2018-09-12"); +insert into diaries values(2618, "2018-09-13"); +insert into diaries values(2619, "2018-09-14"); +insert into diaries values(2620, "2018-09-15"); +insert into diaries values(2621, "2018-09-16"); +insert into diaries values(2622, "2018-09-17"); +insert into diaries values(2623, "2018-09-18"); +insert into diaries values(2624, "2018-09-19"); +insert into diaries values(2625, "2018-09-20"); +insert into diaries values(2626, "2018-09-21"); +insert into diaries values(2627, "2018-09-22"); +insert into diaries values(2628, "2018-09-23"); +insert into diaries values(2629, "2018-09-24"); +insert into diaries values(2630, "2018-09-25"); +insert into diaries values(2631, "2018-09-26"); +insert into diaries values(2632, "2018-09-27"); +insert into diaries values(2633, "2018-09-28"); +insert into diaries values(2634, "2018-09-29"); +insert into diaries values(2635, "2018-09-30"); +insert into diaries values(2636, "2018-10-01"); +insert into diaries values(2637, "2018-10-02"); +insert into diaries values(2638, "2018-10-03"); +insert into diaries values(2639, "2018-10-04"); +insert into diaries values(2640, "2018-10-05"); +insert into diaries values(2641, "2018-10-06"); +insert into diaries values(2642, "2018-10-07"); +insert into diaries values(2643, "2018-10-08"); +insert into diaries values(2644, "2018-10-09"); +insert into diaries values(2645, "2018-10-10"); +insert into diaries values(2646, "2018-10-11"); +insert into diaries values(2647, "2018-10-12"); +insert into diaries values(2648, "2018-10-13"); +insert into diaries values(2649, "2018-10-14"); +insert into diaries values(2650, "2018-10-15"); +insert into diaries values(2651, "2018-10-16"); +insert into diaries values(2652, "2018-10-17"); +insert into diaries values(2653, "2018-10-18"); +insert into diaries values(2654, "2018-10-19"); +insert into diaries values(2655, "2018-10-20"); +insert into diaries values(2656, "2018-10-21"); +insert into diaries values(2657, "2018-10-22"); +insert into diaries values(2658, "2018-10-23"); +insert into diaries values(2659, "2018-10-24"); +insert into diaries values(2660, "2018-10-25"); +insert into diaries values(2661, "2018-10-26"); +insert into diaries values(2662, "2018-10-27"); +insert into diaries values(2663, "2018-10-28"); +insert into diaries values(2664, "2018-10-29"); +insert into diaries values(2665, "2018-10-30"); +insert into diaries values(2666, "2018-10-31"); +insert into diaries values(2667, "2018-11-01"); +insert into diaries values(2668, "2018-11-02"); +insert into diaries values(2669, "2018-11-03"); +insert into diaries values(2670, "2018-11-04"); +insert into diaries values(2671, "2018-11-05"); +insert into diaries values(2672, "2018-11-06"); +insert into diaries values(2673, "2018-11-07"); +insert into diaries values(2674, "2018-11-08"); +insert into diaries values(2675, "2018-11-09"); +insert into diaries values(2676, "2018-11-10"); +insert into diaries values(2677, "2018-11-11"); +insert into diaries values(2678, "2018-11-12"); +insert into diaries values(2679, "2018-11-13"); +insert into diaries values(2680, "2018-11-14"); +insert into diaries values(2681, "2018-11-15"); +insert into diaries values(2682, "2018-11-16"); +insert into diaries values(2683, "2018-11-17"); +insert into diaries values(2684, "2018-11-18"); +insert into diaries values(2685, "2018-11-19"); +insert into diaries values(2686, "2018-11-20"); +insert into diaries values(2687, "2018-11-21"); +insert into diaries values(2688, "2018-11-22"); +insert into diaries values(2689, "2018-11-23"); +insert into diaries values(2690, "2018-11-24"); +insert into diaries values(2691, "2018-11-25"); +insert into diaries values(2692, "2018-11-26"); +insert into diaries values(2693, "2018-11-27"); +insert into diaries values(2694, "2018-11-28"); +insert into diaries values(2695, "2018-11-29"); +insert into diaries values(2696, "2018-11-30"); +insert into diaries values(2697, "2018-12-01"); +insert into diaries values(2698, "2018-12-02"); +insert into diaries values(2699, "2018-12-03"); +insert into diaries values(2700, "2018-12-04"); +insert into diaries values(2701, "2018-12-05"); +insert into diaries values(2702, "2018-12-06"); +insert into diaries values(2703, "2018-12-07"); +insert into diaries values(2704, "2018-12-08"); +insert into diaries values(2705, "2018-12-09"); +insert into diaries values(2706, "2018-12-10"); +insert into diaries values(2707, "2018-12-11"); +insert into diaries values(2708, "2018-12-12"); +insert into diaries values(2709, "2018-12-13"); +insert into diaries values(2710, "2018-12-14"); +insert into diaries values(2711, "2018-12-15"); +insert into diaries values(2712, "2018-12-16"); +insert into diaries values(2713, "2018-12-17"); +insert into diaries values(2714, "2018-12-18"); +insert into diaries values(2715, "2018-12-19"); +insert into diaries values(2716, "2018-12-20"); +insert into diaries values(2717, "2018-12-21"); +insert into diaries values(2718, "2018-12-22"); +insert into diaries values(2719, "2018-12-23"); +insert into diaries values(2720, "2018-12-24"); +insert into diaries values(2721, "2018-12-25"); +insert into diaries values(2722, "2018-12-26"); +insert into diaries values(2723, "2018-12-27"); +insert into diaries values(2724, "2018-12-28"); +insert into diaries values(2725, "2018-12-29"); +insert into diaries values(2726, "2018-12-30"); +insert into diaries values(2727, "2018-12-31"); +insert into diaries values(2728, "2019-01-01"); +insert into diaries values(2729, "2019-01-02"); +insert into diaries values(2730, "2019-01-03"); +insert into diaries values(2731, "2019-01-04"); +insert into diaries values(2732, "2019-01-05"); +insert into diaries values(2733, "2019-01-06"); +insert into diaries values(2734, "2019-01-07"); +insert into diaries values(2735, "2019-01-08"); +insert into diaries values(2736, "2019-01-09"); +insert into diaries values(2737, "2019-01-10"); +insert into diaries values(2738, "2019-01-11"); +insert into diaries values(2739, "2019-01-12"); +insert into diaries values(2740, "2019-01-13"); +insert into diaries values(2741, "2019-01-14"); +insert into diaries values(2742, "2019-01-15"); +insert into diaries values(2743, "2019-01-16"); +insert into diaries values(2744, "2019-01-17"); +insert into diaries values(2745, "2019-01-18"); +insert into diaries values(2746, "2019-01-19"); +insert into diaries values(2747, "2019-01-20"); +insert into diaries values(2748, "2019-01-21"); +insert into diaries values(2749, "2019-01-22"); +insert into diaries values(2750, "2019-01-23"); +insert into diaries values(2751, "2019-01-24"); +insert into diaries values(2752, "2019-01-25"); +insert into diaries values(2753, "2019-01-26"); +insert into diaries values(2754, "2019-01-27"); +insert into diaries values(2755, "2019-01-28"); +insert into diaries values(2756, "2019-01-29"); +insert into diaries values(2757, "2019-01-30"); +insert into diaries values(2758, "2019-01-31"); +insert into diaries values(2759, "2019-02-01"); +insert into diaries values(2760, "2019-02-02"); +insert into diaries values(2761, "2019-02-03"); +insert into diaries values(2762, "2019-02-04"); +insert into diaries values(2763, "2019-02-05"); +insert into diaries values(2764, "2019-02-06"); +insert into diaries values(2765, "2019-02-07"); +insert into diaries values(2766, "2019-02-08"); +insert into diaries values(2767, "2019-02-09"); +insert into diaries values(2768, "2019-02-10"); +insert into diaries values(2769, "2019-02-11"); +insert into diaries values(2770, "2019-02-12"); +insert into diaries values(2771, "2019-02-13"); +insert into diaries values(2772, "2019-02-14"); +insert into diaries values(2773, "2019-02-15"); +insert into diaries values(2774, "2019-02-16"); +insert into diaries values(2775, "2019-02-17"); +insert into diaries values(2776, "2019-02-18"); +insert into diaries values(2777, "2019-02-19"); +insert into diaries values(2778, "2019-02-20"); +insert into diaries values(2779, "2019-02-21"); +insert into diaries values(2780, "2019-02-22"); +insert into diaries values(2781, "2019-02-23"); +insert into diaries values(2782, "2019-02-24"); +insert into diaries values(2783, "2019-02-25"); +insert into diaries values(2784, "2019-02-26"); +insert into diaries values(2785, "2019-02-27"); +insert into diaries values(2786, "2019-02-28"); +insert into diaries values(2787, "2019-03-01"); +insert into diaries values(2788, "2019-03-02"); +insert into diaries values(2789, "2019-03-03"); +insert into diaries values(2790, "2019-03-04"); +insert into diaries values(2791, "2019-03-05"); +insert into diaries values(2792, "2019-03-06"); +insert into diaries values(2793, "2019-03-07"); +insert into diaries values(2794, "2019-03-08"); +insert into diaries values(2795, "2019-03-09"); +insert into diaries values(2796, "2019-03-10"); +insert into diaries values(2797, "2019-03-11"); +insert into diaries values(2798, "2019-03-12"); +insert into diaries values(2799, "2019-03-13"); +insert into diaries values(2800, "2019-03-14"); +insert into diaries values(2801, "2019-03-15"); +insert into diaries values(2802, "2019-03-16"); +insert into diaries values(2803, "2019-03-17"); +insert into diaries values(2804, "2019-03-18"); +insert into diaries values(2805, "2019-03-19"); +insert into diaries values(2806, "2019-03-20"); +insert into diaries values(2807, "2019-03-21"); +insert into diaries values(2808, "2019-03-22"); +insert into diaries values(2809, "2019-03-23"); +insert into diaries values(2810, "2019-03-24"); +insert into diaries values(2811, "2019-03-25"); +insert into diaries values(2812, "2019-03-26"); +insert into diaries values(2813, "2019-03-27"); +insert into diaries values(2814, "2019-03-28"); +insert into diaries values(2815, "2019-03-29"); +insert into diaries values(2816, "2019-03-30"); +insert into diaries values(2817, "2019-03-31"); +insert into diaries values(2818, "2019-04-01"); +insert into diaries values(2819, "2019-04-02"); +insert into diaries values(2820, "2019-04-03"); +insert into diaries values(2821, "2019-04-04"); +insert into diaries values(2822, "2019-04-05"); +insert into diaries values(2823, "2019-04-06"); +insert into diaries values(2824, "2019-04-07"); +insert into diaries values(2825, "2019-04-08"); +insert into diaries values(2826, "2019-04-09"); +insert into diaries values(2827, "2019-04-10"); +insert into diaries values(2828, "2019-04-11"); +insert into diaries values(2829, "2019-04-12"); +insert into diaries values(2830, "2019-04-13"); +insert into diaries values(2831, "2019-04-14"); +insert into diaries values(2832, "2019-04-15"); +insert into diaries values(2833, "2019-04-16"); +insert into diaries values(2834, "2019-04-17"); +insert into diaries values(2835, "2019-04-18"); +insert into diaries values(2836, "2019-04-19"); +insert into diaries values(2837, "2019-04-20"); +insert into diaries values(2838, "2019-04-21"); +insert into diaries values(2839, "2019-04-22"); +insert into diaries values(2840, "2019-04-23"); +insert into diaries values(2841, "2019-04-24"); +insert into diaries values(2842, "2019-04-25"); +insert into diaries values(2843, "2019-04-26"); +insert into diaries values(2844, "2019-04-27"); +insert into diaries values(2845, "2019-04-28"); +insert into diaries values(2846, "2019-04-29"); +insert into diaries values(2847, "2019-04-30"); +insert into diaries values(2848, "2019-05-01"); +insert into diaries values(2849, "2019-05-02"); +insert into diaries values(2850, "2019-05-03"); +insert into diaries values(2851, "2019-05-04"); +insert into diaries values(2852, "2019-05-05"); +insert into diaries values(2853, "2019-05-06"); +insert into diaries values(2854, "2019-05-07"); +insert into diaries values(2855, "2019-05-08"); +insert into diaries values(2856, "2019-05-09"); +insert into diaries values(2857, "2019-05-10"); +insert into diaries values(2858, "2019-05-11"); +insert into diaries values(2859, "2019-05-12"); +insert into diaries values(2860, "2019-05-13"); +insert into diaries values(2861, "2019-05-14"); +insert into diaries values(2862, "2019-05-15"); +insert into diaries values(2863, "2019-05-16"); +insert into diaries values(2864, "2019-05-17"); +insert into diaries values(2865, "2019-05-18"); +insert into diaries values(2866, "2019-05-19"); +insert into diaries values(2867, "2019-05-20"); +insert into diaries values(2868, "2019-05-21"); +insert into diaries values(2869, "2019-05-22"); +insert into diaries values(2870, "2019-05-23"); +insert into diaries values(2871, "2019-05-24"); +insert into diaries values(2872, "2019-05-25"); +insert into diaries values(2873, "2019-05-26"); +insert into diaries values(2874, "2019-05-27"); +insert into diaries values(2875, "2019-05-28"); +insert into diaries values(2876, "2019-05-29"); +insert into diaries values(2877, "2019-05-30"); +insert into diaries values(2878, "2019-05-31"); +insert into diaries values(2879, "2019-06-01"); +insert into diaries values(2880, "2019-06-02"); +insert into diaries values(2881, "2019-06-03"); +insert into diaries values(2882, "2019-06-04"); +insert into diaries values(2883, "2019-06-05"); +insert into diaries values(2884, "2019-06-06"); +insert into diaries values(2885, "2019-06-07"); +insert into diaries values(2886, "2019-06-08"); +insert into diaries values(2887, "2019-06-09"); +insert into diaries values(2888, "2019-06-10"); +insert into diaries values(2889, "2019-06-11"); +insert into diaries values(2890, "2019-06-12"); +insert into diaries values(2891, "2019-06-13"); +insert into diaries values(2892, "2019-06-14"); +insert into diaries values(2893, "2019-06-15"); +insert into diaries values(2894, "2019-06-16"); +insert into diaries values(2895, "2019-06-17"); +insert into diaries values(2896, "2019-06-18"); +insert into diaries values(2897, "2019-06-19"); +insert into diaries values(2898, "2019-06-20"); +insert into diaries values(2899, "2019-06-21"); +insert into diaries values(2900, "2019-06-22"); +insert into diaries values(2901, "2019-06-23"); +insert into diaries values(2902, "2019-06-24"); +insert into diaries values(2903, "2019-06-25"); +insert into diaries values(2904, "2019-06-26"); +insert into diaries values(2905, "2019-06-27"); +insert into diaries values(2906, "2019-06-28"); +insert into diaries values(2907, "2019-06-29"); +insert into diaries values(2908, "2019-06-30"); +insert into diaries values(2909, "2019-07-01"); +insert into diaries values(2910, "2019-07-02"); +insert into diaries values(2911, "2019-07-03"); +insert into diaries values(2912, "2019-07-04"); +insert into diaries values(2913, "2019-07-05"); +insert into diaries values(2914, "2019-07-06"); +insert into diaries values(2915, "2019-07-07"); +insert into diaries values(2916, "2019-07-08"); +insert into diaries values(2917, "2019-07-09"); +insert into diaries values(2918, "2019-07-10"); +insert into diaries values(2919, "2019-07-11"); +insert into diaries values(2920, "2019-07-12"); +insert into diaries values(2921, "2019-07-13"); +insert into diaries values(2922, "2019-07-14"); +insert into diaries values(2923, "2019-07-15"); +insert into diaries values(2924, "2019-07-16"); +insert into diaries values(2925, "2019-07-17"); +insert into diaries values(2926, "2019-07-18"); +insert into diaries values(2927, "2019-07-19"); +insert into diaries values(2928, "2019-07-20"); +insert into diaries values(2929, "2019-07-21"); +insert into diaries values(2930, "2019-07-22"); +insert into diaries values(2931, "2019-07-23"); +insert into diaries values(2932, "2019-07-24"); +insert into diaries values(2933, "2019-07-25"); +insert into diaries values(2934, "2019-07-26"); +insert into diaries values(2935, "2019-07-27"); +insert into diaries values(2936, "2019-07-28"); +insert into diaries values(2937, "2019-07-29"); +insert into diaries values(2938, "2019-07-30"); +insert into diaries values(2939, "2019-07-31"); +insert into diaries values(2940, "2019-08-01"); +insert into diaries values(2941, "2019-08-02"); +insert into diaries values(2942, "2019-08-03"); +insert into diaries values(2943, "2019-08-04"); +insert into diaries values(2944, "2019-08-05"); +insert into diaries values(2945, "2019-08-06"); +insert into diaries values(2946, "2019-08-07"); +insert into diaries values(2947, "2019-08-08"); +insert into diaries values(2948, "2019-08-09"); +insert into diaries values(2949, "2019-08-10"); +insert into diaries values(2950, "2019-08-11"); +insert into diaries values(2951, "2019-08-12"); +insert into diaries values(2952, "2019-08-13"); +insert into diaries values(2953, "2019-08-14"); +insert into diaries values(2954, "2019-08-15"); +insert into diaries values(2955, "2019-08-16"); +insert into diaries values(2956, "2019-08-17"); +insert into diaries values(2957, "2019-08-18"); +insert into diaries values(2958, "2019-08-19"); +insert into diaries values(2959, "2019-08-20"); +insert into diaries values(2960, "2019-08-21"); +insert into diaries values(2961, "2019-08-22"); +insert into diaries values(2962, "2019-08-23"); +insert into diaries values(2963, "2019-08-24"); +insert into diaries values(2964, "2019-08-25"); +insert into diaries values(2965, "2019-08-26"); +insert into diaries values(2966, "2019-08-27"); +insert into diaries values(2967, "2019-08-28"); +insert into diaries values(2968, "2019-08-29"); +insert into diaries values(2969, "2019-08-30"); +insert into diaries values(2970, "2019-08-31"); +insert into diaries values(2971, "2019-09-01"); +insert into diaries values(2972, "2019-09-02"); +insert into diaries values(2973, "2019-09-03"); +insert into diaries values(2974, "2019-09-04"); +insert into diaries values(2975, "2019-09-05"); +insert into diaries values(2976, "2019-09-06"); +insert into diaries values(2977, "2019-09-07"); +insert into diaries values(2978, "2019-09-08"); +insert into diaries values(2979, "2019-09-09"); +insert into diaries values(2980, "2019-09-10"); +insert into diaries values(2981, "2019-09-11"); +insert into diaries values(2982, "2019-09-12"); +insert into diaries values(2983, "2019-09-13"); +insert into diaries values(2984, "2019-09-14"); +insert into diaries values(2985, "2019-09-15"); +insert into diaries values(2986, "2019-09-16"); +insert into diaries values(2987, "2019-09-17"); +insert into diaries values(2988, "2019-09-18"); +insert into diaries values(2989, "2019-09-19"); +insert into diaries values(2990, "2019-09-20"); +insert into diaries values(2991, "2019-09-21"); +insert into diaries values(2992, "2019-09-22"); +insert into diaries values(2993, "2019-09-23"); +insert into diaries values(2994, "2019-09-24"); +insert into diaries values(2995, "2019-09-25"); +insert into diaries values(2996, "2019-09-26"); +insert into diaries values(2997, "2019-09-27"); +insert into diaries values(2998, "2019-09-28"); +insert into diaries values(2999, "2019-09-29"); +insert into diaries values(3000, "2019-09-30"); +insert into diaries values(3001, "2019-10-01"); +insert into diaries values(3002, "2019-10-02"); +insert into diaries values(3003, "2019-10-03"); +insert into diaries values(3004, "2019-10-04"); +insert into diaries values(3005, "2019-10-05"); +insert into diaries values(3006, "2019-10-06"); +insert into diaries values(3007, "2019-10-07"); +insert into diaries values(3008, "2019-10-08"); +insert into diaries values(3009, "2019-10-09"); +insert into diaries values(3010, "2019-10-10"); +insert into diaries values(3011, "2019-10-11"); +insert into diaries values(3012, "2019-10-12"); +insert into diaries values(3013, "2019-10-13"); +insert into diaries values(3014, "2019-10-14"); +insert into diaries values(3015, "2019-10-15"); +insert into diaries values(3016, "2019-10-16"); +insert into diaries values(3017, "2019-10-17"); +insert into diaries values(3018, "2019-10-18"); +insert into diaries values(3019, "2019-10-19"); +insert into diaries values(3020, "2019-10-20"); +insert into diaries values(3021, "2019-10-21"); +insert into diaries values(3022, "2019-10-22"); +insert into diaries values(3023, "2019-10-23"); +insert into diaries values(3024, "2019-10-24"); +insert into diaries values(3025, "2019-10-25"); +insert into diaries values(3026, "2019-10-26"); +insert into diaries values(3027, "2019-10-27"); +insert into diaries values(3028, "2019-10-28"); +insert into diaries values(3029, "2019-10-29"); +insert into diaries values(3030, "2019-10-30"); +insert into diaries values(3031, "2019-10-31"); +insert into diaries values(3032, "2019-11-01"); +insert into diaries values(3033, "2019-11-02"); +insert into diaries values(3034, "2019-11-03"); +insert into diaries values(3035, "2019-11-04"); +insert into diaries values(3036, "2019-11-05"); +insert into diaries values(3037, "2019-11-06"); +insert into diaries values(3038, "2019-11-07"); +insert into diaries values(3039, "2019-11-08"); +insert into diaries values(3040, "2019-11-09"); +insert into diaries values(3041, "2019-11-10"); +insert into diaries values(3042, "2019-11-11"); +insert into diaries values(3043, "2019-11-12"); +insert into diaries values(3044, "2019-11-13"); +insert into diaries values(3045, "2019-11-14"); +insert into diaries values(3046, "2019-11-15"); +insert into diaries values(3047, "2019-11-16"); +insert into diaries values(3048, "2019-11-17"); +insert into diaries values(3049, "2019-11-18"); +insert into diaries values(3050, "2019-11-19"); +insert into diaries values(3051, "2019-11-20"); +insert into diaries values(3052, "2019-11-21"); +insert into diaries values(3053, "2019-11-22"); +insert into diaries values(3054, "2019-11-23"); +insert into diaries values(3055, "2019-11-24"); +insert into diaries values(3056, "2019-11-25"); +insert into diaries values(3057, "2019-11-26"); +insert into diaries values(3058, "2019-11-27"); +insert into diaries values(3059, "2019-11-28"); +insert into diaries values(3060, "2019-11-29"); +insert into diaries values(3061, "2019-11-30"); +insert into diaries values(3062, "2019-12-01"); +insert into diaries values(3063, "2019-12-02"); +insert into diaries values(3064, "2019-12-03"); +insert into diaries values(3065, "2019-12-04"); +insert into diaries values(3066, "2019-12-05"); +insert into diaries values(3067, "2019-12-06"); +insert into diaries values(3068, "2019-12-07"); +insert into diaries values(3069, "2019-12-08"); +insert into diaries values(3070, "2019-12-09"); +insert into diaries values(3071, "2019-12-10"); +insert into diaries values(3072, "2019-12-11"); +insert into diaries values(3073, "2019-12-12"); +insert into diaries values(3074, "2019-12-13"); +insert into diaries values(3075, "2019-12-14"); +insert into diaries values(3076, "2019-12-15"); +insert into diaries values(3077, "2019-12-16"); +insert into diaries values(3078, "2019-12-17"); +insert into diaries values(3079, "2019-12-18"); +insert into diaries values(3080, "2019-12-19"); +insert into diaries values(3081, "2019-12-20"); +insert into diaries values(3082, "2019-12-21"); +insert into diaries values(3083, "2019-12-22"); +insert into diaries values(3084, "2019-12-23"); +insert into diaries values(3085, "2019-12-24"); +insert into diaries values(3086, "2019-12-25"); +insert into diaries values(3087, "2019-12-26"); +insert into diaries values(3088, "2019-12-27"); +insert into diaries values(3089, "2019-12-28"); +insert into diaries values(3090, "2019-12-29"); +insert into diaries values(3091, "2019-12-30"); +insert into diaries values(3092, "2019-12-31"); +insert into diaries values(3093, "2020-01-01"); +insert into diaries values(3094, "2020-01-02"); +insert into diaries values(3095, "2020-01-03"); +insert into diaries values(3096, "2020-01-04"); +insert into diaries values(3097, "2020-01-05"); +insert into diaries values(3098, "2020-01-06"); +insert into diaries values(3099, "2020-01-07"); +insert into diaries values(3100, "2020-01-08"); +insert into diaries values(3101, "2020-01-09"); +insert into diaries values(3102, "2020-01-10"); +insert into diaries values(3103, "2020-01-11"); +insert into diaries values(3104, "2020-01-12"); +insert into diaries values(3105, "2020-01-13"); +insert into diaries values(3106, "2020-01-14"); +insert into diaries values(3107, "2020-01-15"); +insert into diaries values(3108, "2020-01-16"); +insert into diaries values(3109, "2020-01-17"); +insert into diaries values(3110, "2020-01-18"); +insert into diaries values(3111, "2020-01-19"); +insert into diaries values(3112, "2020-01-20"); +insert into diaries values(3113, "2020-01-21"); +insert into diaries values(3114, "2020-01-22"); +insert into diaries values(3115, "2020-01-23"); +insert into diaries values(3116, "2020-01-24"); +insert into diaries values(3117, "2020-01-25"); +insert into diaries values(3118, "2020-01-26"); +insert into diaries values(3119, "2020-01-27"); +insert into diaries values(3120, "2020-01-28"); +insert into diaries values(3121, "2020-01-29"); +insert into diaries values(3122, "2020-01-30"); +insert into diaries values(3123, "2020-01-31"); +insert into diaries values(3124, "2020-02-01"); +insert into diaries values(3125, "2020-02-02"); +insert into diaries values(3126, "2020-02-03"); +insert into diaries values(3127, "2020-02-04"); +insert into diaries values(3128, "2020-02-05"); +insert into diaries values(3129, "2020-02-06"); +insert into diaries values(3130, "2020-02-07"); +insert into diaries values(3131, "2020-02-08"); +insert into diaries values(3132, "2020-02-09"); +insert into diaries values(3133, "2020-02-10"); +insert into diaries values(3134, "2020-02-11"); +insert into diaries values(3135, "2020-02-12"); +insert into diaries values(3136, "2020-02-13"); +insert into diaries values(3137, "2020-02-14"); +insert into diaries values(3138, "2020-02-15"); +insert into diaries values(3139, "2020-02-16"); +insert into diaries values(3140, "2020-02-17"); +insert into diaries values(3141, "2020-02-18"); +insert into diaries values(3142, "2020-02-19"); +insert into diaries values(3143, "2020-02-20"); +insert into diaries values(3144, "2020-02-21"); +insert into diaries values(3145, "2020-02-22"); +insert into diaries values(3146, "2020-02-23"); +insert into diaries values(3147, "2020-02-24"); +insert into diaries values(3148, "2020-02-25"); +insert into diaries values(3149, "2020-02-26"); +insert into diaries values(3150, "2020-02-27"); +insert into diaries values(3151, "2020-02-28"); +insert into diaries values(3152, "2020-02-29"); +insert into diaries values(3153, "2020-03-01"); +insert into diaries values(3154, "2020-03-02"); +insert into diaries values(3155, "2020-03-03"); +insert into diaries values(3156, "2020-03-04"); +insert into diaries values(3157, "2020-03-05"); +insert into diaries values(3158, "2020-03-06"); +insert into diaries values(3159, "2020-03-07"); +insert into diaries values(3160, "2020-03-08"); +insert into diaries values(3161, "2020-03-09"); +insert into diaries values(3162, "2020-03-10"); +insert into diaries values(3163, "2020-03-11"); +insert into diaries values(3164, "2020-03-12"); +insert into diaries values(3165, "2020-03-13"); +insert into diaries values(3166, "2020-03-14"); +insert into diaries values(3167, "2020-03-15"); +insert into diaries values(3168, "2020-03-16"); +insert into diaries values(3169, "2020-03-17"); +insert into diaries values(3170, "2020-03-18"); +insert into diaries values(3171, "2020-03-19"); +insert into diaries values(3172, "2020-03-20"); +insert into diaries values(3173, "2020-03-21"); +insert into diaries values(3174, "2020-03-22"); +insert into diaries values(3175, "2020-03-23"); +insert into diaries values(3176, "2020-03-24"); +insert into diaries values(3177, "2020-03-25"); +insert into diaries values(3178, "2020-03-26"); +insert into diaries values(3179, "2020-03-27"); +insert into diaries values(3180, "2020-03-28"); +insert into diaries values(3181, "2020-03-29"); +insert into diaries values(3182, "2020-03-30"); +insert into diaries values(3183, "2020-03-31"); +insert into diaries values(3184, "2020-04-01"); +insert into diaries values(3185, "2020-04-02"); +insert into diaries values(3186, "2020-04-03"); +insert into diaries values(3187, "2020-04-04"); +insert into diaries values(3188, "2020-04-05"); +insert into diaries values(3189, "2020-04-06"); +insert into diaries values(3190, "2020-04-07"); +insert into diaries values(3191, "2020-04-08"); +insert into diaries values(3192, "2020-04-09"); +insert into diaries values(3193, "2020-04-10"); +insert into diaries values(3194, "2020-04-11"); +insert into diaries values(3195, "2020-04-12"); +insert into diaries values(3196, "2020-04-13"); +insert into diaries values(3197, "2020-04-14"); +insert into diaries values(3198, "2020-04-15"); +insert into diaries values(3199, "2020-04-16"); +insert into diaries values(3200, "2020-04-17"); +insert into diaries values(3201, "2020-04-18"); +insert into diaries values(3202, "2020-04-19"); +insert into diaries values(3203, "2020-04-20"); +insert into diaries values(3204, "2020-04-21"); +insert into diaries values(3205, "2020-04-22"); +insert into diaries values(3206, "2020-04-23"); +insert into diaries values(3207, "2020-04-24"); +insert into diaries values(3208, "2020-04-25"); +insert into diaries values(3209, "2020-04-26"); +insert into diaries values(3210, "2020-04-27"); +insert into diaries values(3211, "2020-04-28"); +insert into diaries values(3212, "2020-04-29"); +insert into diaries values(3213, "2020-04-30"); +insert into diaries values(3214, "2020-05-01"); +insert into diaries values(3215, "2020-05-02"); +insert into diaries values(3216, "2020-05-03"); +insert into diaries values(3217, "2020-05-04"); +insert into diaries values(3218, "2020-05-05"); +insert into diaries values(3219, "2020-05-06"); +insert into diaries values(3220, "2020-05-07"); +insert into diaries values(3221, "2020-05-08"); +insert into diaries values(3222, "2020-05-09"); +insert into diaries values(3223, "2020-05-10"); +insert into diaries values(3224, "2020-05-11"); +insert into diaries values(3225, "2020-05-12"); +insert into diaries values(3226, "2020-05-13"); +insert into diaries values(3227, "2020-05-14"); +insert into diaries values(3228, "2020-05-15"); +insert into diaries values(3229, "2020-05-16"); +insert into diaries values(3230, "2020-05-17"); +insert into diaries values(3231, "2020-05-18"); +insert into diaries values(3232, "2020-05-19"); +insert into diaries values(3233, "2020-05-20"); +insert into diaries values(3234, "2020-05-21"); +insert into diaries values(3235, "2020-05-22"); +insert into diaries values(3236, "2020-05-23"); +insert into diaries values(3237, "2020-05-24"); +insert into diaries values(3238, "2020-05-25"); +insert into diaries values(3239, "2020-05-26"); +insert into diaries values(3240, "2020-05-27"); +insert into diaries values(3241, "2020-05-28"); +insert into diaries values(3242, "2020-05-29"); +insert into diaries values(3243, "2020-05-30"); +insert into diaries values(3244, "2020-05-31"); +insert into diaries values(3245, "2020-06-01"); +insert into diaries values(3246, "2020-06-02"); +insert into diaries values(3247, "2020-06-03"); +insert into diaries values(3248, "2020-06-04"); +insert into diaries values(3249, "2020-06-05"); +insert into diaries values(3250, "2020-06-06"); +insert into diaries values(3251, "2020-06-07"); +insert into diaries values(3252, "2020-06-08"); +insert into diaries values(3253, "2020-06-09"); +insert into diaries values(3254, "2020-06-10"); +insert into diaries values(3255, "2020-06-11"); +insert into diaries values(3256, "2020-06-12"); +insert into diaries values(3257, "2020-06-13"); +insert into diaries values(3258, "2020-06-14"); +insert into diaries values(3259, "2020-06-15"); +insert into diaries values(3260, "2020-06-16"); +insert into diaries values(3261, "2020-06-17"); +insert into diaries values(3262, "2020-06-18"); +insert into diaries values(3263, "2020-06-19"); +insert into diaries values(3264, "2020-06-20"); +insert into diaries values(3265, "2020-06-21"); +insert into diaries values(3266, "2020-06-22"); +insert into diaries values(3267, "2020-06-23"); +insert into diaries values(3268, "2020-06-24"); +insert into diaries values(3269, "2020-06-25"); +insert into diaries values(3270, "2020-06-26"); +insert into diaries values(3271, "2020-06-27"); +insert into diaries values(3272, "2020-06-28"); +insert into diaries values(3273, "2020-06-29"); +insert into diaries values(3274, "2020-06-30"); +insert into diaries values(3275, "2020-07-01"); +insert into diaries values(3276, "2020-07-02"); +insert into diaries values(3277, "2020-07-03"); +insert into diaries values(3278, "2020-07-04"); +insert into diaries values(3279, "2020-07-05"); +insert into diaries values(3280, "2020-07-06"); +insert into diaries values(3281, "2020-07-07"); +insert into diaries values(3282, "2020-07-08"); +insert into diaries values(3283, "2020-07-09"); +insert into diaries values(3284, "2020-07-10"); +insert into diaries values(3285, "2020-07-11"); +insert into diaries values(3286, "2020-07-12"); +insert into diaries values(3287, "2020-07-13"); +insert into diaries values(3288, "2020-07-14"); +insert into diaries values(3289, "2020-07-15"); +insert into diaries values(3290, "2020-07-16"); +insert into diaries values(3291, "2020-07-17"); +insert into diaries values(3292, "2020-07-18"); +insert into diaries values(3293, "2020-07-19"); +insert into diaries values(3294, "2020-07-20"); +insert into diaries values(3295, "2020-07-21"); +insert into diaries values(3296, "2020-07-22"); +insert into diaries values(3297, "2020-07-23"); +insert into diaries values(3298, "2020-07-24"); +insert into diaries values(3299, "2020-07-25"); +insert into diaries values(3300, "2020-07-26"); +insert into diaries values(3301, "2020-07-27"); +insert into diaries values(3302, "2020-07-28"); +insert into diaries values(3303, "2020-07-29"); +insert into diaries values(3304, "2020-07-30"); +insert into diaries values(3305, "2020-07-31"); +insert into diaries values(3306, "2020-08-01"); +insert into diaries values(3307, "2020-08-02"); +insert into diaries values(3308, "2020-08-03"); +insert into diaries values(3309, "2020-08-04"); +insert into diaries values(3310, "2020-08-05"); +insert into diaries values(3311, "2020-08-06"); +insert into diaries values(3312, "2020-08-07"); +insert into diaries values(3313, "2020-08-08"); +insert into diaries values(3314, "2020-08-09"); +insert into diaries values(3315, "2020-08-10"); +insert into diaries values(3316, "2020-08-11"); +insert into diaries values(3317, "2020-08-12"); +insert into diaries values(3318, "2020-08-13"); +insert into diaries values(3319, "2020-08-14"); +insert into diaries values(3320, "2020-08-15"); +insert into diaries values(3321, "2020-08-16"); +insert into diaries values(3322, "2020-08-17"); +insert into diaries values(3323, "2020-08-18"); +insert into diaries values(3324, "2020-08-19"); +insert into diaries values(3325, "2020-08-20"); +insert into diaries values(3326, "2020-08-21"); +insert into diaries values(3327, "2020-08-22"); +insert into diaries values(3328, "2020-08-23"); +insert into diaries values(3329, "2020-08-24"); +insert into diaries values(3330, "2020-08-25"); +insert into diaries values(3331, "2020-08-26"); +insert into diaries values(3332, "2020-08-27"); +insert into diaries values(3333, "2020-08-28"); +insert into diaries values(3334, "2020-08-29"); +insert into diaries values(3335, "2020-08-30"); +insert into diaries values(3336, "2020-08-31"); +insert into diaries values(3337, "2020-09-01"); +insert into diaries values(3338, "2020-09-02"); +insert into diaries values(3339, "2020-09-03"); +insert into diaries values(3340, "2020-09-04"); +insert into diaries values(3341, "2020-09-05"); +insert into diaries values(3342, "2020-09-06"); +insert into diaries values(3343, "2020-09-07"); +insert into diaries values(3344, "2020-09-08"); +insert into diaries values(3345, "2020-09-09"); +insert into diaries values(3346, "2020-09-10"); +insert into diaries values(3347, "2020-09-11"); +insert into diaries values(3348, "2020-09-12"); +insert into diaries values(3349, "2020-09-13"); +insert into diaries values(3350, "2020-09-14"); +insert into diaries values(3351, "2020-09-15"); +insert into diaries values(3352, "2020-09-16"); +insert into diaries values(3353, "2020-09-17"); +insert into diaries values(3354, "2020-09-18"); +insert into diaries values(3355, "2020-09-19"); +insert into diaries values(3356, "2020-09-20"); +insert into diaries values(3357, "2020-09-21"); +insert into diaries values(3358, "2020-09-22"); +insert into diaries values(3359, "2020-09-23"); +insert into diaries values(3360, "2020-09-24"); +insert into diaries values(3361, "2020-09-25"); +insert into diaries values(3362, "2020-09-26"); +insert into diaries values(3363, "2020-09-27"); +insert into diaries values(3364, "2020-09-28"); +insert into diaries values(3365, "2020-09-29"); +insert into diaries values(3366, "2020-09-30"); +insert into diaries values(3367, "2020-10-01"); +insert into diaries values(3368, "2020-10-02"); +insert into diaries values(3369, "2020-10-03"); +insert into diaries values(3370, "2020-10-04"); +insert into diaries values(3371, "2020-10-05"); +insert into diaries values(3372, "2020-10-06"); +insert into diaries values(3373, "2020-10-07"); +insert into diaries values(3374, "2020-10-08"); +insert into diaries values(3375, "2020-10-09"); +insert into diaries values(3376, "2020-10-10"); +insert into diaries values(3377, "2020-10-11"); +insert into diaries values(3378, "2020-10-12"); +insert into diaries values(3379, "2020-10-13"); +insert into diaries values(3380, "2020-10-14"); +insert into diaries values(3381, "2020-10-15"); +insert into diaries values(3382, "2020-10-16"); +insert into diaries values(3383, "2020-10-17"); +insert into diaries values(3384, "2020-10-18"); +insert into diaries values(3385, "2020-10-19"); +insert into diaries values(3386, "2020-10-20"); +insert into diaries values(3387, "2020-10-21"); +insert into diaries values(3388, "2020-10-22"); +insert into diaries values(3389, "2020-10-23"); +insert into diaries values(3390, "2020-10-24"); +insert into diaries values(3391, "2020-10-25"); +insert into diaries values(3392, "2020-10-26"); +insert into diaries values(3393, "2020-10-27"); +insert into diaries values(3394, "2020-10-28"); +insert into diaries values(3395, "2020-10-29"); +insert into diaries values(3396, "2020-10-30"); +insert into diaries values(3397, "2020-10-31"); +insert into diaries values(3398, "2020-11-01"); +insert into diaries values(3399, "2020-11-02"); +insert into diaries values(3400, "2020-11-03"); +insert into diaries values(3401, "2020-11-04"); +insert into diaries values(3402, "2020-11-05"); +insert into diaries values(3403, "2020-11-06"); +insert into diaries values(3404, "2020-11-07"); +insert into diaries values(3405, "2020-11-08"); +insert into diaries values(3406, "2020-11-09"); +insert into diaries values(3407, "2020-11-10"); +insert into diaries values(3408, "2020-11-11"); +insert into diaries values(3409, "2020-11-12"); +insert into diaries values(3410, "2020-11-13"); +insert into diaries values(3411, "2020-11-14"); +insert into diaries values(3412, "2020-11-15"); +insert into diaries values(3413, "2020-11-16"); +insert into diaries values(3414, "2020-11-17"); +insert into diaries values(3415, "2020-11-18"); +insert into diaries values(3416, "2020-11-19"); +insert into diaries values(3417, "2020-11-20"); +insert into diaries values(3418, "2020-11-21"); +insert into diaries values(3419, "2020-11-22"); +insert into diaries values(3420, "2020-11-23"); +insert into diaries values(3421, "2020-11-24"); +insert into diaries values(3422, "2020-11-25"); +insert into diaries values(3423, "2020-11-26"); +insert into diaries values(3424, "2020-11-27"); +insert into diaries values(3425, "2020-11-28"); +insert into diaries values(3426, "2020-11-29"); +insert into diaries values(3427, "2020-11-30"); +insert into diaries values(3428, "2020-12-01"); +insert into diaries values(3429, "2020-12-02"); +insert into diaries values(3430, "2020-12-03"); +insert into diaries values(3431, "2020-12-04"); +insert into diaries values(3432, "2020-12-05"); +insert into diaries values(3433, "2020-12-06"); +insert into diaries values(3434, "2020-12-07"); +insert into diaries values(3435, "2020-12-08"); +insert into diaries values(3436, "2020-12-09"); +insert into diaries values(3437, "2020-12-10"); +insert into diaries values(3438, "2020-12-11"); +insert into diaries values(3439, "2020-12-12"); +insert into diaries values(3440, "2020-12-13"); +insert into diaries values(3441, "2020-12-14"); +insert into diaries values(3442, "2020-12-15"); +insert into diaries values(3443, "2020-12-16"); +insert into diaries values(3444, "2020-12-17"); +insert into diaries values(3445, "2020-12-18"); +insert into diaries values(3446, "2020-12-19"); +insert into diaries values(3447, "2020-12-20"); +insert into diaries values(3448, "2020-12-21"); +insert into diaries values(3449, "2020-12-22"); +insert into diaries values(3450, "2020-12-23"); +insert into diaries values(3451, "2020-12-24"); +insert into diaries values(3452, "2020-12-25"); +insert into diaries values(3453, "2020-12-26"); +insert into diaries values(3454, "2020-12-27"); +insert into diaries values(3455, "2020-12-28"); +insert into diaries values(3456, "2020-12-29"); +insert into diaries values(3457, "2020-12-30"); +insert into diaries values(3458, "2020-12-31"); +insert into diaries values(3459, "2021-01-01"); +insert into diaries values(3460, "2021-01-02"); +insert into diaries values(3461, "2021-01-03"); +insert into diaries values(3462, "2021-01-04"); +insert into diaries values(3463, "2021-01-05"); +insert into diaries values(3464, "2021-01-06"); +insert into diaries values(3465, "2021-01-07"); +insert into diaries values(3466, "2021-01-08"); +insert into diaries values(3467, "2021-01-09"); +insert into diaries values(3468, "2021-01-10"); +insert into diaries values(3469, "2021-01-11"); +insert into diaries values(3470, "2021-01-12"); +insert into diaries values(3471, "2021-01-13"); +insert into diaries values(3472, "2021-01-14"); +insert into diaries values(3473, "2021-01-15"); +insert into diaries values(3474, "2021-01-16"); +insert into diaries values(3475, "2021-01-17"); +insert into diaries values(3476, "2021-01-18"); +insert into diaries values(3477, "2021-01-19"); +insert into diaries values(3478, "2021-01-20"); +insert into diaries values(3479, "2021-01-21"); +insert into diaries values(3480, "2021-01-22"); +insert into diaries values(3481, "2021-01-23"); +insert into diaries values(3482, "2021-01-24"); +insert into diaries values(3483, "2021-01-25"); +insert into diaries values(3484, "2021-01-26"); +insert into diaries values(3485, "2021-01-27"); +insert into diaries values(3486, "2021-01-28"); +insert into diaries values(3487, "2021-01-29"); +insert into diaries values(3488, "2021-01-30"); +insert into diaries values(3489, "2021-01-31"); +insert into diaries values(3490, "2021-02-01"); +insert into diaries values(3491, "2021-02-02"); +insert into diaries values(3492, "2021-02-03"); +insert into diaries values(3493, "2021-02-04"); +insert into diaries values(3494, "2021-02-05"); +insert into diaries values(3495, "2021-02-06"); +insert into diaries values(3496, "2021-02-07"); +insert into diaries values(3497, "2021-02-08"); +insert into diaries values(3498, "2021-02-09"); +insert into diaries values(3499, "2021-02-10"); +insert into diaries values(3500, "2021-02-11"); +insert into diaries values(3501, "2021-02-12"); +insert into diaries values(3502, "2021-02-13"); +insert into diaries values(3503, "2021-02-14"); +insert into diaries values(3504, "2021-02-15"); +insert into diaries values(3505, "2021-02-16"); +insert into diaries values(3506, "2021-02-17"); +insert into diaries values(3507, "2021-02-18"); +insert into diaries values(3508, "2021-02-19"); +insert into diaries values(3509, "2021-02-20"); +insert into diaries values(3510, "2021-02-21"); +insert into diaries values(3511, "2021-02-22"); +insert into diaries values(3512, "2021-02-23"); +insert into diaries values(3513, "2021-02-24"); +insert into diaries values(3514, "2021-02-25"); +insert into diaries values(3515, "2021-02-26"); +insert into diaries values(3516, "2021-02-27"); +insert into diaries values(3517, "2021-02-28"); +insert into diaries values(3518, "2021-03-01"); +insert into diaries values(3519, "2021-03-02"); +insert into diaries values(3520, "2021-03-03"); +insert into diaries values(3521, "2021-03-04"); +insert into diaries values(3522, "2021-03-05"); +insert into diaries values(3523, "2021-03-06"); +insert into diaries values(3524, "2021-03-07"); +insert into diaries values(3525, "2021-03-08"); +insert into diaries values(3526, "2021-03-09"); +insert into diaries values(3527, "2021-03-10"); +insert into diaries values(3528, "2021-03-11"); +insert into diaries values(3529, "2021-03-12"); +insert into diaries values(3530, "2021-03-13"); +insert into diaries values(3531, "2021-03-14"); +insert into diaries values(3532, "2021-03-15"); +insert into diaries values(3533, "2021-03-16"); +insert into diaries values(3534, "2021-03-17"); +insert into diaries values(3535, "2021-03-18"); +insert into diaries values(3536, "2021-03-19"); +insert into diaries values(3537, "2021-03-20"); +insert into diaries values(3538, "2021-03-21"); +insert into diaries values(3539, "2021-03-22"); +insert into diaries values(3540, "2021-03-23"); +insert into diaries values(3541, "2021-03-24"); +insert into diaries values(3542, "2021-03-25"); +insert into diaries values(3543, "2021-03-26"); +insert into diaries values(3544, "2021-03-27"); +insert into diaries values(3545, "2021-03-28"); +insert into diaries values(3546, "2021-03-29"); +insert into diaries values(3547, "2021-03-30"); +insert into diaries values(3548, "2021-03-31"); +insert into diaries values(3549, "2021-04-01"); +insert into diaries values(3550, "2021-04-02"); +insert into diaries values(3551, "2021-04-03"); +insert into diaries values(3552, "2021-04-04"); +insert into diaries values(3553, "2021-04-05"); +insert into diaries values(3554, "2021-04-06"); +insert into diaries values(3555, "2021-04-07"); +insert into diaries values(3556, "2021-04-08"); +insert into diaries values(3557, "2021-04-09"); +insert into diaries values(3558, "2021-04-10"); +insert into diaries values(3559, "2021-04-11"); +insert into diaries values(3560, "2021-04-12"); +insert into diaries values(3561, "2021-04-13"); +insert into diaries values(3562, "2021-04-14"); +insert into diaries values(3563, "2021-04-15"); +insert into diaries values(3564, "2021-04-16"); +insert into diaries values(3565, "2021-04-17"); +insert into diaries values(3566, "2021-04-18"); +insert into diaries values(3567, "2021-04-19"); +insert into diaries values(3568, "2021-04-20"); +insert into diaries values(3569, "2021-04-21"); +insert into diaries values(3570, "2021-04-22"); +insert into diaries values(3571, "2021-04-23"); +insert into diaries values(3572, "2021-04-24"); +insert into diaries values(3573, "2021-04-25"); +insert into diaries values(3574, "2021-04-26"); +insert into diaries values(3575, "2021-04-27"); +insert into diaries values(3576, "2021-04-28"); +insert into diaries values(3577, "2021-04-29"); +insert into diaries values(3578, "2021-04-30"); +insert into diaries values(3579, "2021-05-01"); +insert into diaries values(3580, "2021-05-02"); +insert into diaries values(3581, "2021-05-03"); +insert into diaries values(3582, "2021-05-04"); +insert into diaries values(3583, "2021-05-05"); +insert into diaries values(3584, "2021-05-06"); +insert into diaries values(3585, "2021-05-07"); +insert into diaries values(3586, "2021-05-08"); +insert into diaries values(3587, "2021-05-09"); +insert into diaries values(3588, "2021-05-10"); +insert into diaries values(3589, "2021-05-11"); +insert into diaries values(3590, "2021-05-12"); +insert into diaries values(3591, "2021-05-13"); +insert into diaries values(3592, "2021-05-14"); +insert into diaries values(3593, "2021-05-15"); +insert into diaries values(3594, "2021-05-16"); +insert into diaries values(3595, "2021-05-17"); +insert into diaries values(3596, "2021-05-18"); +insert into diaries values(3597, "2021-05-19"); +insert into diaries values(3598, "2021-05-20"); +insert into diaries values(3599, "2021-05-21"); +insert into diaries values(3600, "2021-05-22"); +insert into diaries values(3601, "2021-05-23"); +insert into diaries values(3602, "2021-05-24"); +insert into diaries values(3603, "2021-05-25"); +insert into diaries values(3604, "2021-05-26"); +insert into diaries values(3605, "2021-05-27"); +insert into diaries values(3606, "2021-05-28"); +insert into diaries values(3607, "2021-05-29"); +insert into diaries values(3608, "2021-05-30"); +insert into diaries values(3609, "2021-05-31"); +insert into diaries values(3610, "2021-06-01"); +insert into diaries values(3611, "2021-06-02"); +insert into diaries values(3612, "2021-06-03"); +insert into diaries values(3613, "2021-06-04"); +insert into diaries values(3614, "2021-06-05"); +insert into diaries values(3615, "2021-06-06"); +insert into diaries values(3616, "2021-06-07"); +insert into diaries values(3617, "2021-06-08"); +insert into diaries values(3618, "2021-06-09"); +insert into diaries values(3619, "2021-06-10"); +insert into diaries values(3620, "2021-06-11"); +insert into diaries values(3621, "2021-06-12"); +insert into diaries values(3622, "2021-06-13"); +insert into diaries values(3623, "2021-06-14"); +insert into diaries values(3624, "2021-06-15"); +insert into diaries values(3625, "2021-06-16"); +insert into diaries values(3626, "2021-06-17"); +insert into diaries values(3627, "2021-06-18"); +insert into diaries values(3628, "2021-06-19"); +insert into diaries values(3629, "2021-06-20"); +insert into diaries values(3630, "2021-06-21"); +insert into diaries values(3631, "2021-06-22"); +insert into diaries values(3632, "2021-06-23"); +insert into diaries values(3633, "2021-06-24"); +insert into diaries values(3634, "2021-06-25"); +insert into diaries values(3635, "2021-06-26"); +insert into diaries values(3636, "2021-06-27"); +insert into diaries values(3637, "2021-06-28"); +insert into diaries values(3638, "2021-06-29"); +insert into diaries values(3639, "2021-06-30"); +insert into diaries values(3640, "2021-07-01"); +insert into diaries values(3641, "2021-07-02"); +insert into diaries values(3642, "2021-07-03"); +insert into diaries values(3643, "2021-07-04"); +insert into diaries values(3644, "2021-07-05"); +insert into diaries values(3645, "2021-07-06"); +insert into diaries values(3646, "2021-07-07"); +insert into diaries values(3647, "2021-07-08"); +insert into diaries values(3648, "2021-07-09"); +insert into diaries values(3649, "2021-07-10"); +insert into diaries values(3650, "2021-07-11"); +insert into diaries values(3651, "2021-07-12"); +insert into diaries values(3652, "2021-07-13"); +insert into diaries values(3653, "2021-07-14"); +insert into diaries values(3654, "2021-07-15"); +insert into diaries values(3655, "2021-07-16"); +insert into diaries values(3656, "2021-07-17"); +insert into diaries values(3657, "2021-07-18"); +insert into diaries values(3658, "2021-07-19"); +insert into diaries values(3659, "2021-07-20"); +insert into diaries values(3660, "2021-07-21"); +insert into diaries values(3661, "2021-07-22"); +insert into diaries values(3662, "2021-07-23"); +insert into diaries values(3663, "2021-07-24"); +insert into diaries values(3664, "2021-07-25"); +insert into diaries values(3665, "2021-07-26"); +insert into diaries values(3666, "2021-07-27"); +insert into diaries values(3667, "2021-07-28"); +insert into diaries values(3668, "2021-07-29"); +insert into diaries values(3669, "2021-07-30"); +insert into diaries values(3670, "2021-07-31"); +insert into diaries values(3671, "2021-08-01"); +insert into diaries values(3672, "2021-08-02"); +insert into diaries values(3673, "2021-08-03"); +insert into diaries values(3674, "2021-08-04"); +insert into diaries values(3675, "2021-08-05"); +insert into diaries values(3676, "2021-08-06"); +insert into diaries values(3677, "2021-08-07"); +insert into diaries values(3678, "2021-08-08"); +insert into diaries values(3679, "2021-08-09"); +insert into diaries values(3680, "2021-08-10"); +insert into diaries values(3681, "2021-08-11"); +insert into diaries values(3682, "2021-08-12"); +insert into diaries values(3683, "2021-08-13"); +insert into diaries values(3684, "2021-08-14"); +insert into diaries values(3685, "2021-08-15"); +insert into diaries values(3686, "2021-08-16"); +insert into diaries values(3687, "2021-08-17"); +insert into diaries values(3688, "2021-08-18"); +insert into diaries values(3689, "2021-08-19"); +insert into diaries values(3690, "2021-08-20"); +insert into diaries values(3691, "2021-08-21"); +insert into diaries values(3692, "2021-08-22"); +insert into diaries values(3693, "2021-08-23"); +insert into diaries values(3694, "2021-08-24"); +insert into diaries values(3695, "2021-08-25"); +insert into diaries values(3696, "2021-08-26"); +insert into diaries values(3697, "2021-08-27"); +insert into diaries values(3698, "2021-08-28"); +insert into diaries values(3699, "2021-08-29"); +insert into diaries values(3700, "2021-08-30"); +insert into diaries values(3701, "2021-08-31"); +insert into diaries values(3702, "2021-09-01"); +insert into diaries values(3703, "2021-09-02"); +insert into diaries values(3704, "2021-09-03"); +insert into diaries values(3705, "2021-09-04"); +insert into diaries values(3706, "2021-09-05"); +insert into diaries values(3707, "2021-09-06"); +insert into diaries values(3708, "2021-09-07"); +insert into diaries values(3709, "2021-09-08"); +insert into diaries values(3710, "2021-09-09"); +insert into diaries values(3711, "2021-09-10"); +insert into diaries values(3712, "2021-09-11"); +insert into diaries values(3713, "2021-09-12"); +insert into diaries values(3714, "2021-09-13"); +insert into diaries values(3715, "2021-09-14"); +insert into diaries values(3716, "2021-09-15"); +insert into diaries values(3717, "2021-09-16"); +insert into diaries values(3718, "2021-09-17"); +insert into diaries values(3719, "2021-09-18"); +insert into diaries values(3720, "2021-09-19"); +insert into diaries values(3721, "2021-09-20"); +insert into diaries values(3722, "2021-09-21"); +insert into diaries values(3723, "2021-09-22"); +insert into diaries values(3724, "2021-09-23"); +insert into diaries values(3725, "2021-09-24"); +insert into diaries values(3726, "2021-09-25"); +insert into diaries values(3727, "2021-09-26"); +insert into diaries values(3728, "2021-09-27"); +insert into diaries values(3729, "2021-09-28"); +insert into diaries values(3730, "2021-09-29"); +insert into diaries values(3731, "2021-09-30"); +insert into diaries values(3732, "2021-10-01"); +insert into diaries values(3733, "2021-10-02"); +insert into diaries values(3734, "2021-10-03"); +insert into diaries values(3735, "2021-10-04"); +insert into diaries values(3736, "2021-10-05"); +insert into diaries values(3737, "2021-10-06"); +insert into diaries values(3738, "2021-10-07"); +insert into diaries values(3739, "2021-10-08"); +insert into diaries values(3740, "2021-10-09"); +insert into diaries values(3741, "2021-10-10"); +insert into diaries values(3742, "2021-10-11"); +insert into diaries values(3743, "2021-10-12"); +insert into diaries values(3744, "2021-10-13"); +insert into diaries values(3745, "2021-10-14"); +insert into diaries values(3746, "2021-10-15"); +insert into diaries values(3747, "2021-10-16"); +insert into diaries values(3748, "2021-10-17"); +insert into diaries values(3749, "2021-10-18"); +insert into diaries values(3750, "2021-10-19"); +insert into diaries values(3751, "2021-10-20"); +insert into diaries values(3752, "2021-10-21"); +insert into diaries values(3753, "2021-10-22"); +insert into diaries values(3754, "2021-10-23"); +insert into diaries values(3755, "2021-10-24"); +insert into diaries values(3756, "2021-10-25"); +insert into diaries values(3757, "2021-10-26"); +insert into diaries values(3758, "2021-10-27"); +insert into diaries values(3759, "2021-10-28"); +insert into diaries values(3760, "2021-10-29"); +insert into diaries values(3761, "2021-10-30"); +insert into diaries values(3762, "2021-10-31"); +insert into diaries values(3763, "2021-11-01"); +insert into diaries values(3764, "2021-11-02"); +insert into diaries values(3765, "2021-11-03"); +insert into diaries values(3766, "2021-11-04"); +insert into diaries values(3767, "2021-11-05"); +insert into diaries values(3768, "2021-11-06"); +insert into diaries values(3769, "2021-11-07"); +insert into diaries values(3770, "2021-11-08"); +insert into diaries values(3771, "2021-11-09"); +insert into diaries values(3772, "2021-11-10"); +insert into diaries values(3773, "2021-11-11"); +insert into diaries values(3774, "2021-11-12"); +insert into diaries values(3775, "2021-11-13"); +insert into diaries values(3776, "2021-11-14"); +insert into diaries values(3777, "2021-11-15"); +insert into diaries values(3778, "2021-11-16"); +insert into diaries values(3779, "2021-11-17"); +insert into diaries values(3780, "2021-11-18"); +insert into diaries values(3781, "2021-11-19"); +insert into diaries values(3782, "2021-11-20"); +insert into diaries values(3783, "2021-11-21"); +insert into diaries values(3784, "2021-11-22"); +insert into diaries values(3785, "2021-11-23"); +insert into diaries values(3786, "2021-11-24"); +insert into diaries values(3787, "2021-11-25"); +insert into diaries values(3788, "2021-11-26"); +insert into diaries values(3789, "2021-11-27"); +insert into diaries values(3790, "2021-11-28"); +insert into diaries values(3791, "2021-11-29"); +insert into diaries values(3792, "2021-11-30"); +insert into diaries values(3793, "2021-12-01"); +insert into diaries values(3794, "2021-12-02"); +insert into diaries values(3795, "2021-12-03"); +insert into diaries values(3796, "2021-12-04"); +insert into diaries values(3797, "2021-12-05"); +insert into diaries values(3798, "2021-12-06"); +insert into diaries values(3799, "2021-12-07"); +insert into diaries values(3800, "2021-12-08"); +insert into diaries values(3801, "2021-12-09"); +insert into diaries values(3802, "2021-12-10"); +insert into diaries values(3803, "2021-12-11"); +insert into diaries values(3804, "2021-12-12"); +insert into diaries values(3805, "2021-12-13"); +insert into diaries values(3806, "2021-12-14"); +insert into diaries values(3807, "2021-12-15"); +insert into diaries values(3808, "2021-12-16"); +insert into diaries values(3809, "2021-12-17"); +insert into diaries values(3810, "2021-12-18"); +insert into diaries values(3811, "2021-12-19"); +insert into diaries values(3812, "2021-12-20"); +insert into diaries values(3813, "2021-12-21"); +insert into diaries values(3814, "2021-12-22"); +insert into diaries values(3815, "2021-12-23"); +insert into diaries values(3816, "2021-12-24"); +insert into diaries values(3817, "2021-12-25"); +insert into diaries values(3818, "2021-12-26"); +insert into diaries values(3819, "2021-12-27"); +insert into diaries values(3820, "2021-12-28"); +insert into diaries values(3821, "2021-12-29"); +insert into diaries values(3822, "2021-12-30"); +insert into diaries values(3823, "2021-12-31"); +insert into diaries values(3824, "2022-01-01"); +insert into diaries values(3825, "2022-01-02"); +insert into diaries values(3826, "2022-01-03"); +insert into diaries values(3827, "2022-01-04"); +insert into diaries values(3828, "2022-01-05"); +insert into diaries values(3829, "2022-01-06"); +insert into diaries values(3830, "2022-01-07"); +insert into diaries values(3831, "2022-01-08"); +insert into diaries values(3832, "2022-01-09"); +insert into diaries values(3833, "2022-01-10"); +insert into diaries values(3834, "2022-01-11"); +insert into diaries values(3835, "2022-01-12"); +insert into diaries values(3836, "2022-01-13"); +insert into diaries values(3837, "2022-01-14"); +insert into diaries values(3838, "2022-01-15"); +insert into diaries values(3839, "2022-01-16"); +insert into diaries values(3840, "2022-01-17"); +insert into diaries values(3841, "2022-01-18"); +insert into diaries values(3842, "2022-01-19"); +insert into diaries values(3843, "2022-01-20"); +insert into diaries values(3844, "2022-01-21"); +insert into diaries values(3845, "2022-01-22"); +insert into diaries values(3846, "2022-01-23"); +insert into diaries values(3847, "2022-01-24"); +insert into diaries values(3848, "2022-01-25"); +insert into diaries values(3849, "2022-01-26"); +insert into diaries values(3850, "2022-01-27"); +insert into diaries values(3851, "2022-01-28"); +insert into diaries values(3852, "2022-01-29"); +insert into diaries values(3853, "2022-01-30"); +insert into diaries values(3854, "2022-01-31"); +insert into diaries values(3855, "2022-02-01"); +insert into diaries values(3856, "2022-02-02"); +insert into diaries values(3857, "2022-02-03"); +insert into diaries values(3858, "2022-02-04"); +insert into diaries values(3859, "2022-02-05"); +insert into diaries values(3860, "2022-02-06"); +insert into diaries values(3861, "2022-02-07"); +insert into diaries values(3862, "2022-02-08"); +insert into diaries values(3863, "2022-02-09"); +insert into diaries values(3864, "2022-02-10"); +insert into diaries values(3865, "2022-02-11"); +insert into diaries values(3866, "2022-02-12"); +insert into diaries values(3867, "2022-02-13"); +insert into diaries values(3868, "2022-02-14"); +insert into diaries values(3869, "2022-02-15"); +insert into diaries values(3870, "2022-02-16"); +insert into diaries values(3871, "2022-02-17"); +insert into diaries values(3872, "2022-02-18"); +insert into diaries values(3873, "2022-02-19"); +insert into diaries values(3874, "2022-02-20"); +insert into diaries values(3875, "2022-02-21"); +insert into diaries values(3876, "2022-02-22"); +insert into diaries values(3877, "2022-02-23"); +insert into diaries values(3878, "2022-02-24"); +insert into diaries values(3879, "2022-02-25"); +insert into diaries values(3880, "2022-02-26"); +insert into diaries values(3881, "2022-02-27"); +insert into diaries values(3882, "2022-02-28"); +insert into diaries values(3883, "2022-03-01"); +insert into diaries values(3884, "2022-03-02"); +insert into diaries values(3885, "2022-03-03"); +insert into diaries values(3886, "2022-03-04"); +insert into diaries values(3887, "2022-03-05"); +insert into diaries values(3888, "2022-03-06"); +insert into diaries values(3889, "2022-03-07"); +insert into diaries values(3890, "2022-03-08"); +insert into diaries values(3891, "2022-03-09"); +insert into diaries values(3892, "2022-03-10"); +insert into diaries values(3893, "2022-03-11"); +insert into diaries values(3894, "2022-03-12"); +insert into diaries values(3895, "2022-03-13"); +insert into diaries values(3896, "2022-03-14"); +insert into diaries values(3897, "2022-03-15"); +insert into diaries values(3898, "2022-03-16"); +insert into diaries values(3899, "2022-03-17"); +insert into diaries values(3900, "2022-03-18"); +insert into diaries values(3901, "2022-03-19"); +insert into diaries values(3902, "2022-03-20"); +insert into diaries values(3903, "2022-03-21"); +insert into diaries values(3904, "2022-03-22"); +insert into diaries values(3905, "2022-03-23"); +insert into diaries values(3906, "2022-03-24"); +insert into diaries values(3907, "2022-03-25"); +insert into diaries values(3908, "2022-03-26"); +insert into diaries values(3909, "2022-03-27"); +insert into diaries values(3910, "2022-03-28"); +insert into diaries values(3911, "2022-03-29"); +insert into diaries values(3912, "2022-03-30"); +insert into diaries values(3913, "2022-03-31"); +insert into diaries values(3914, "2022-04-01"); +insert into diaries values(3915, "2022-04-02"); +insert into diaries values(3916, "2022-04-03"); +insert into diaries values(3917, "2022-04-04"); +insert into diaries values(3918, "2022-04-05"); +insert into diaries values(3919, "2022-04-06"); +insert into diaries values(3920, "2022-04-07"); +insert into diaries values(3921, "2022-04-08"); +insert into diaries values(3922, "2022-04-09"); +insert into diaries values(3923, "2022-04-10"); +insert into diaries values(3924, "2022-04-11"); +insert into diaries values(3925, "2022-04-12"); +insert into diaries values(3926, "2022-04-13"); +insert into diaries values(3927, "2022-04-14"); +insert into diaries values(3928, "2022-04-15"); +insert into diaries values(3929, "2022-04-16"); +insert into diaries values(3930, "2022-04-17"); +insert into diaries values(3931, "2022-04-18"); +insert into diaries values(3932, "2022-04-19"); +insert into diaries values(3933, "2022-04-20"); +insert into diaries values(3934, "2022-04-21"); +insert into diaries values(3935, "2022-04-22"); +insert into diaries values(3936, "2022-04-23"); +insert into diaries values(3937, "2022-04-24"); +insert into diaries values(3938, "2022-04-25"); +insert into diaries values(3939, "2022-04-26"); +insert into diaries values(3940, "2022-04-27"); +insert into diaries values(3941, "2022-04-28"); +insert into diaries values(3942, "2022-04-29"); +insert into diaries values(3943, "2022-04-30"); +insert into diaries values(3944, "2022-05-01"); +insert into diaries values(3945, "2022-05-02"); +insert into diaries values(3946, "2022-05-03"); +insert into diaries values(3947, "2022-05-04"); +insert into diaries values(3948, "2022-05-05"); +insert into diaries values(3949, "2022-05-06"); +insert into diaries values(3950, "2022-05-07"); +insert into diaries values(3951, "2022-05-08"); +insert into diaries values(3952, "2022-05-09"); +insert into diaries values(3953, "2022-05-10"); +insert into diaries values(3954, "2022-05-11"); +insert into diaries values(3955, "2022-05-12"); +insert into diaries values(3956, "2022-05-13"); +insert into diaries values(3957, "2022-05-14"); +insert into diaries values(3958, "2022-05-15"); +insert into diaries values(3959, "2022-05-16"); +insert into diaries values(3960, "2022-05-17"); +insert into diaries values(3961, "2022-05-18"); +insert into diaries values(3962, "2022-05-19"); +insert into diaries values(3963, "2022-05-20"); +insert into diaries values(3964, "2022-05-21"); +insert into diaries values(3965, "2022-05-22"); +insert into diaries values(3966, "2022-05-23"); +insert into diaries values(3967, "2022-05-24"); +insert into diaries values(3968, "2022-05-25"); +insert into diaries values(3969, "2022-05-26"); +insert into diaries values(3970, "2022-05-27"); +insert into diaries values(3971, "2022-05-28"); +insert into diaries values(3972, "2022-05-29"); +insert into diaries values(3973, "2022-05-30"); +insert into diaries values(3974, "2022-05-31"); +insert into diaries values(3975, "2022-06-01"); +insert into diaries values(3976, "2022-06-02"); +insert into diaries values(3977, "2022-06-03"); +insert into diaries values(3978, "2022-06-04"); +insert into diaries values(3979, "2022-06-05"); +insert into diaries values(3980, "2022-06-06"); +insert into diaries values(3981, "2022-06-07"); +insert into diaries values(3982, "2022-06-08"); +insert into diaries values(3983, "2022-06-09"); +insert into diaries values(3984, "2022-06-10"); +insert into diaries values(3985, "2022-06-11"); +insert into diaries values(3986, "2022-06-12"); +insert into diaries values(3987, "2022-06-13"); +insert into diaries values(3988, "2022-06-14"); +insert into diaries values(3989, "2022-06-15"); +insert into diaries values(3990, "2022-06-16"); +insert into diaries values(3991, "2022-06-17"); +insert into diaries values(3992, "2022-06-18"); +insert into diaries values(3993, "2022-06-19"); +insert into diaries values(3994, "2022-06-20"); +insert into diaries values(3995, "2022-06-21"); +insert into diaries values(3996, "2022-06-22"); +insert into diaries values(3997, "2022-06-23"); +insert into diaries values(3998, "2022-06-24"); +insert into diaries values(3999, "2022-06-25"); +insert into diaries values(4000, "2022-06-26"); +insert into diaries values(4001, "2022-06-27"); +insert into diaries values(4002, "2022-06-28"); +insert into diaries values(4003, "2022-06-29"); +insert into diaries values(4004, "2022-06-30"); +insert into diaries values(4005, "2022-07-01"); +insert into diaries values(4006, "2022-07-02"); +insert into diaries values(4007, "2022-07-03"); +insert into diaries values(4008, "2022-07-04"); +insert into diaries values(4009, "2022-07-05"); +insert into diaries values(4010, "2022-07-06"); +insert into diaries values(4011, "2022-07-07"); +insert into diaries values(4012, "2022-07-08"); +insert into diaries values(4013, "2022-07-09"); +insert into diaries values(4014, "2022-07-10"); +insert into diaries values(4015, "2022-07-11"); +insert into diaries values(4016, "2022-07-12"); +insert into diaries values(4017, "2022-07-13"); +insert into diaries values(4018, "2022-07-14"); +insert into diaries values(4019, "2022-07-15"); +insert into diaries values(4020, "2022-07-16"); +insert into diaries values(4021, "2022-07-17"); +insert into diaries values(4022, "2022-07-18"); +insert into diaries values(4023, "2022-07-19"); +insert into diaries values(4024, "2022-07-20"); +insert into diaries values(4025, "2022-07-21"); +insert into diaries values(4026, "2022-07-22"); +insert into diaries values(4027, "2022-07-23"); +insert into diaries values(4028, "2022-07-24"); +insert into diaries values(4029, "2022-07-25"); +insert into diaries values(4030, "2022-07-26"); +insert into diaries values(4031, "2022-07-27"); +insert into diaries values(4032, "2022-07-28"); +insert into diaries values(4033, "2022-07-29"); +insert into diaries values(4034, "2022-07-30"); +insert into diaries values(4035, "2022-07-31"); +insert into diaries values(4036, "2022-08-01"); +insert into diaries values(4037, "2022-08-02"); +insert into diaries values(4038, "2022-08-03"); +insert into diaries values(4039, "2022-08-04"); +insert into diaries values(4040, "2022-08-05"); +insert into diaries values(4041, "2022-08-06"); +insert into diaries values(4042, "2022-08-07"); +insert into diaries values(4043, "2022-08-08"); +insert into diaries values(4044, "2022-08-09"); +insert into diaries values(4045, "2022-08-10"); +insert into diaries values(4046, "2022-08-11"); +insert into diaries values(4047, "2022-08-12"); +insert into diaries values(4048, "2022-08-13"); +insert into diaries values(4049, "2022-08-14"); +insert into diaries values(4050, "2022-08-15"); +insert into diaries values(4051, "2022-08-16"); +insert into diaries values(4052, "2022-08-17"); +insert into diaries values(4053, "2022-08-18"); +insert into diaries values(4054, "2022-08-19"); +insert into diaries values(4055, "2022-08-20"); +insert into diaries values(4056, "2022-08-21"); +insert into diaries values(4057, "2022-08-22"); +insert into diaries values(4058, "2022-08-23"); +insert into diaries values(4059, "2022-08-24"); +insert into diaries values(4060, "2022-08-25"); +insert into diaries values(4061, "2022-08-26"); +insert into diaries values(4062, "2022-08-27"); +insert into diaries values(4063, "2022-08-28"); +insert into diaries values(4064, "2022-08-29"); +insert into diaries values(4065, "2022-08-30"); +insert into diaries values(4066, "2022-08-31"); +insert into diaries values(4067, "2022-09-01"); +insert into diaries values(4068, "2022-09-02"); +insert into diaries values(4069, "2022-09-03"); +insert into diaries values(4070, "2022-09-04"); +insert into diaries values(4071, "2022-09-05"); +insert into diaries values(4072, "2022-09-06"); +insert into diaries values(4073, "2022-09-07"); +insert into diaries values(4074, "2022-09-08"); +insert into diaries values(4075, "2022-09-09"); +insert into diaries values(4076, "2022-09-10"); +insert into diaries values(4077, "2022-09-11"); +insert into diaries values(4078, "2022-09-12"); +insert into diaries values(4079, "2022-09-13"); +insert into diaries values(4080, "2022-09-14"); +insert into diaries values(4081, "2022-09-15"); +insert into diaries values(4082, "2022-09-16"); +insert into diaries values(4083, "2022-09-17"); +insert into diaries values(4084, "2022-09-18"); +insert into diaries values(4085, "2022-09-19"); +insert into diaries values(4086, "2022-09-20"); +insert into diaries values(4087, "2022-09-21"); +insert into diaries values(4088, "2022-09-22"); +insert into diaries values(4089, "2022-09-23"); +insert into diaries values(4090, "2022-09-24"); +insert into diaries values(4091, "2022-09-25"); +insert into diaries values(4092, "2022-09-26"); +insert into diaries values(4093, "2022-09-27"); +insert into diaries values(4094, "2022-09-28"); +insert into diaries values(4095, "2022-09-29"); +commit; +set autocommit=1; +select * from diaries where match(title) against("2022-09-0"); +id title +3824 2022-01-01 +3825 2022-01-02 +3826 2022-01-03 +3827 2022-01-04 +3828 2022-01-05 +3829 2022-01-06 +3830 2022-01-07 +3831 2022-01-08 +3832 2022-01-09 +3833 2022-01-10 +3834 2022-01-11 +3835 2022-01-12 +3836 2022-01-13 +3837 2022-01-14 +3838 2022-01-15 +3839 2022-01-16 +3840 2022-01-17 +3841 2022-01-18 +3842 2022-01-19 +3843 2022-01-20 +3844 2022-01-21 +3845 2022-01-22 +3846 2022-01-23 +3847 2022-01-24 +3848 2022-01-25 +3849 2022-01-26 +3850 2022-01-27 +3851 2022-01-28 +3852 2022-01-29 +3853 2022-01-30 +3854 2022-01-31 +3855 2022-02-01 +3856 2022-02-02 +3857 2022-02-03 +3858 2022-02-04 +3859 2022-02-05 +3860 2022-02-06 +3861 2022-02-07 +3862 2022-02-08 +3863 2022-02-09 +3864 2022-02-10 +3865 2022-02-11 +3866 2022-02-12 +3867 2022-02-13 +3868 2022-02-14 +3869 2022-02-15 +3870 2022-02-16 +3871 2022-02-17 +3872 2022-02-18 +3873 2022-02-19 +3874 2022-02-20 +3875 2022-02-21 +3876 2022-02-22 +3877 2022-02-23 +3878 2022-02-24 +3879 2022-02-25 +3880 2022-02-26 +3881 2022-02-27 +3882 2022-02-28 +3883 2022-03-01 +3884 2022-03-02 +3885 2022-03-03 +3886 2022-03-04 +3887 2022-03-05 +3888 2022-03-06 +3889 2022-03-07 +3890 2022-03-08 +3891 2022-03-09 +3892 2022-03-10 +3893 2022-03-11 +3894 2022-03-12 +3895 2022-03-13 +3896 2022-03-14 +3897 2022-03-15 +3898 2022-03-16 +3899 2022-03-17 +3900 2022-03-18 +3901 2022-03-19 +3902 2022-03-20 +3903 2022-03-21 +3904 2022-03-22 +3905 2022-03-23 +3906 2022-03-24 +3907 2022-03-25 +3908 2022-03-26 +3909 2022-03-27 +3910 2022-03-28 +3911 2022-03-29 +3912 2022-03-30 +3913 2022-03-31 +3914 2022-04-01 +3915 2022-04-02 +3916 2022-04-03 +3917 2022-04-04 +3918 2022-04-05 +3919 2022-04-06 +3920 2022-04-07 +3921 2022-04-08 +3922 2022-04-09 +3923 2022-04-10 +3924 2022-04-11 +3925 2022-04-12 +3926 2022-04-13 +3927 2022-04-14 +3928 2022-04-15 +3929 2022-04-16 +3930 2022-04-17 +3931 2022-04-18 +3932 2022-04-19 +3933 2022-04-20 +3934 2022-04-21 +3935 2022-04-22 +3936 2022-04-23 +3937 2022-04-24 +3938 2022-04-25 +3939 2022-04-26 +3940 2022-04-27 +3941 2022-04-28 +3942 2022-04-29 +3943 2022-04-30 +3944 2022-05-01 +3945 2022-05-02 +3946 2022-05-03 +3947 2022-05-04 +3948 2022-05-05 +3949 2022-05-06 +3950 2022-05-07 +3951 2022-05-08 +3952 2022-05-09 +3953 2022-05-10 +3954 2022-05-11 +3955 2022-05-12 +3956 2022-05-13 +3957 2022-05-14 +3958 2022-05-15 +3959 2022-05-16 +3960 2022-05-17 +3961 2022-05-18 +3962 2022-05-19 +3963 2022-05-20 +3964 2022-05-21 +3965 2022-05-22 +3966 2022-05-23 +3967 2022-05-24 +3968 2022-05-25 +3969 2022-05-26 +3970 2022-05-27 +3971 2022-05-28 +3972 2022-05-29 +3973 2022-05-30 +3974 2022-05-31 +3975 2022-06-01 +3976 2022-06-02 +3977 2022-06-03 +3978 2022-06-04 +3979 2022-06-05 +3980 2022-06-06 +3981 2022-06-07 +3982 2022-06-08 +3983 2022-06-09 +3984 2022-06-10 +3985 2022-06-11 +3986 2022-06-12 +3987 2022-06-13 +3988 2022-06-14 +3989 2022-06-15 +3990 2022-06-16 +3991 2022-06-17 +3992 2022-06-18 +3993 2022-06-19 +3994 2022-06-20 +3995 2022-06-21 +3996 2022-06-22 +3997 2022-06-23 +3998 2022-06-24 +3999 2022-06-25 +4000 2022-06-26 +4001 2022-06-27 +4002 2022-06-28 +4003 2022-06-29 +4004 2022-06-30 +4005 2022-07-01 +4006 2022-07-02 +4007 2022-07-03 +4008 2022-07-04 +4009 2022-07-05 +4010 2022-07-06 +4011 2022-07-07 +4012 2022-07-08 +4013 2022-07-09 +4014 2022-07-10 +4015 2022-07-11 +4016 2022-07-12 +4017 2022-07-13 +4018 2022-07-14 +4019 2022-07-15 +4020 2022-07-16 +4021 2022-07-17 +4022 2022-07-18 +4023 2022-07-19 +4024 2022-07-20 +4025 2022-07-21 +4026 2022-07-22 +4027 2022-07-23 +4028 2022-07-24 +4029 2022-07-25 +4030 2022-07-26 +4031 2022-07-27 +4032 2022-07-28 +4033 2022-07-29 +4034 2022-07-30 +4035 2022-07-31 +4036 2022-08-01 +4037 2022-08-02 +4038 2022-08-03 +4039 2022-08-04 +4040 2022-08-05 +4041 2022-08-06 +4042 2022-08-07 +4043 2022-08-08 +4044 2022-08-09 +4045 2022-08-10 +4046 2022-08-11 +4047 2022-08-12 +4048 2022-08-13 +4049 2022-08-14 +4050 2022-08-15 +4051 2022-08-16 +4052 2022-08-17 +4053 2022-08-18 +4054 2022-08-19 +4055 2022-08-20 +4056 2022-08-21 +4057 2022-08-22 +4058 2022-08-23 +4059 2022-08-24 +4060 2022-08-25 +4061 2022-08-26 +4062 2022-08-27 +4063 2022-08-28 +4064 2022-08-29 +4065 2022-08-30 +4066 2022-08-31 +4067 2022-09-01 +4068 2022-09-02 +4069 2022-09-03 +4070 2022-09-04 +4071 2022-09-05 +4072 2022-09-06 +4073 2022-09-07 +4074 2022-09-08 +4075 2022-09-09 +4076 2022-09-10 +4077 2022-09-11 +4078 2022-09-12 +4079 2022-09-13 +4080 2022-09-14 +4081 2022-09-15 +4082 2022-09-16 +4083 2022-09-17 +4084 2022-09-18 +4085 2022-09-19 +4086 2022-09-20 +4087 2022-09-21 +4088 2022-09-22 +4089 2022-09-23 +4090 2022-09-24 +4091 2022-09-25 +4092 2022-09-26 +4093 2022-09-27 +4094 2022-09-28 +4095 2022-09-29 +drop table diaries; 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 new file mode 100644 index 00000000000..64acf4aaeae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result @@ -0,0 +1,34 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +delete from diaries where id = 2; +select * from diaries where match(title, content) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(content) against("富士山"); +id title content +drop table diaries; 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 new file mode 100644 index 00000000000..c1661d7fcbf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result @@ -0,0 +1,40 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries where match(title) against("富士山"); +id title content +3 富士山 今日もきれい。 +select * from diaries where match(content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +drop table diaries; 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 new file mode 100644 index 00000000000..604aca172a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result @@ -0,0 +1,42 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +drop index title on diaries; +select * from diaries where match(title, content) against("富士山"); +ERROR HY000: Can't find FULLTEXT index matching the column list +create fulltext index new_title_content_index on diaries (title, content); +select * from diaries where match(title, content) against("富士山"); +id title content +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +select * from diaries; +id title content +1 Hello はじめました。 +2 天気 明日の富士山の天気について +3 富士山 今日もきれい。 +drop table diaries; 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 new file mode 100644 index 00000000000..6f489bf37cc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result @@ -0,0 +1,37 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +id int primary key, +title varchar(255), +content text, +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, "富士山", "今日もきれい。"); +update diaries set title = "チョモランマ" where id = 3; +update diaries set content = "チョモランマと富士山" where id = 1; +select * from diaries where match(title, content) against("富士山"); +id title content +1 Hello チョモランマと富士山 +2 天気 明日の富士山の天気について +select * from diaries where match(title) against("富士山"); +id title content +select * from diaries where match(content) against("富士山"); +id title content +1 Hello チョモランマと富士山 +2 天気 明日の富士山の天気について +drop table diaries; 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 new file mode 100644 index 00000000000..d9448ee82ba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result @@ -0,0 +1,33 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +title text, +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."); +select * from diaries +where match(title) against("survey") and +match(body) against("groonga"); +id title body +1 survey will start groonga! +select *, match(title) against("survey"), match(body) against("groonga") +from diaries +where match(title) against("survey") and +match(body) against("groonga"); +id title body match(title) against("survey") match(body) against("groonga") +1 survey will start groonga! 1048577 149797 +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result new file mode 100644 index 00000000000..de1b8d41906 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result @@ -0,0 +1,202 @@ +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"); +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +flush tables; +select * from t1; +c1 c2 +1 hoge hoge +2 fuga fuga +3 moge moge +drop table t1; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "myisam"'; +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"); +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 +select * from t1 where match(c3) against("su"); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("ii"); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +select * from t1 where match(c3) against("+su" in boolean mode); +c1 c2 c3 +3 30 sa si su se so +select * from t1 where match(c3) against("+ii" in boolean mode); +c1 c2 c3 +1 10 aa ii uu ee oo +5 50 aa ii uu ee oo +drop table t1; +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8 COMMENT = 'engine "myisam"'; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +c1 c2 c3 +1 明日の富士山の天気について あああああああ +2 いいいいい 明日の富士山の天気は分かりません +3 dummy dummy +select * from t1 where match(c2) against("富士山"); +c1 c2 c3 +1 明日の富士山の天気について あああああああ +select * from t1 where match(c3) against("富士山"); +c1 c2 c3 +2 いいいいい 明日の富士山の天気は分かりません +drop table t1; +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8 COMMENT = 'engine "myisam"'; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8 COMMENT = 'engine "myisam"'; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t2; +c1 c2 +1 aa ii uu ee oo +2 ka ki ku ke ko +3 aa ii ii ii oo +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t2 where c1=3; +c1 c2 +3 aa ii ii ii oo +select * from t1 where c1>3 order by c1 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c1>3 order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select * from t1 where c2>"s" order by c2 desc; +c1 c2 +5 ta ti ii ii to +4 sa si su se so +select * from t2 where c2>"s" order by c1 asc; +c1 c2 +4 sa si su se so +5 ta ti ii ii to +select *,match(c2) against("ii") from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +c1 c2 match(c2) against("ii") +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +1 aa ii uu ee oo 174763 +select *,match(c2) against("ii") from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +5 ta ti ii ii to 349526 +3 aa ii ii ii oo 524289 +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +c1 c2 match(c2) against("ii") +1 aa ii uu ee oo 174763 +3 aa ii ii ii oo 524289 +5 ta ti ii ii to 349526 +drop table t1,t2; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "myisam"'; +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select *,match(c3) against("uu") from t1 where match(c3) against("uu"); +c1 c2 c3 match(c3) against("uu") +1 10 aa ii uu ee oo 131073 +3 10 aa ii uu ee oo 131073 +5 20 aa ii uu ee oo 131073 +7 20 aa ii uu ee oo 131073 +select * from t1 where not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select *,match(c3) against("dummy") from t1 where match(c3) against("dummy"); +c1 c2 c3 match(c3) against("dummy") +select * from t1 where not match(c3) against("dummy"); +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select * from t1 where c1 = 4 and not match(c3) against("uu"); +c1 c2 c3 +4 10 ka ki ku ke ko +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c1 > 4 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 = 10 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 < 15 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_not_match_against.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_not_match_against.result new file mode 100644 index 00000000000..bbe23df3e0f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_not_match_against.result @@ -0,0 +1,68 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "innodb"'; +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select *,match(c3) against("uu") from t1 where match(c3) against("uu"); +c1 c2 c3 match(c3) against("uu") +1 10 aa ii uu ee oo 131073 +3 10 aa ii uu ee oo 131073 +5 20 aa ii uu ee oo 131073 +7 20 aa ii uu ee oo 131073 +select * from t1 where not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select *,match(c3) against("dummy") from t1 where match(c3) against("dummy"); +c1 c2 c3 match(c3) against("dummy") +select * from t1 where not match(c3) against("dummy"); +c1 c2 c3 +1 10 aa ii uu ee oo +2 10 ka ki ku ke ko +3 10 aa ii uu ee oo +4 10 ka ki ku ke ko +5 20 aa ii uu ee oo +6 20 ka ki ku ke ko +7 20 aa ii uu ee oo +8 20 ka ki ku ke ko +select * from t1 where c1 = 4 and not match(c3) against("uu"); +c1 c2 c3 +4 10 ka ki ku ke ko +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c1 > 4 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 = 10 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +c1 c2 c3 +6 20 ka ki ku ke ko +8 20 ka ki ku ke ko +select * from t1 where c2 < 15 and not match(c3) against("uu"); +c1 c2 c3 +2 10 ka ki ku ke ko +4 10 ka ki ku ke ko +drop table t1; 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 new file mode 100644 index 00000000000..279ad8bf985 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE ft( +a INT, +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 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"' +INSERT INTO ft VALUES(1,'aaaaa','abcde'); +INSERT INTO ft VALUES(2,'bbbbb','bcdef'); +INSERT INTO ft VALUES(3,'ccccc','cdefg'); +INSERT INTO ft VALUES(4,'ddddd','defgh'); +INSERT INTO ft VALUES(5,'eeeee','efghi'); +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c +2 bbbbb bcdef +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c +2 bbbbb bcdef +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c +2 bbbbb bcdef +SELECT a, b, c FROM ft WHERE MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) +2 bbbbb bcdef 1 0 +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +a b c MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) +2 bbbbb bcdef 1 0 +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), a; +a b c MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) +1 aaaaa abcde 0 0 +3 ccccc cdefg 0 0 +4 ddddd defgh 0 0 +5 eeeee efghi 0 0 +2 bbbbb bcdef 1 0 +DROP TABLE ft; 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 new file mode 100644 index 00000000000..3da64b2de1f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); +SELECT * FROM diaries +WHERE MATCH(body) AGAINST("groonga") +ORDER BY id; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +USE test; +SELECT * FROM diaries +WHERE MATCH(body) AGAINST("groonga") +ORDER BY id; +id title body +COMMIT; +SELECT * FROM diaries +WHERE MATCH(body) AGAINST("groonga") +ORDER BY id; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries +WHERE MATCH(body) AGAINST("groonga") +ORDER BY id; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_parser_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_parser_comment.result new file mode 100644 index 00000000000..d7b20a3714f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_parser_comment.result @@ -0,0 +1,29 @@ +drop table if exists diaries; +create table diaries ( +id int primary key auto_increment, +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"' +insert into diaries (body) values ("will start groonga!"); +insert into diaries (body) values ("starting groonga..."); +insert into diaries (body) values ("started groonga."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +select * from diaries where match(body) against("start"); +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_grn_id.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_grn_id.result new file mode 100644 index 00000000000..9edbd3c9b3b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_grn_id.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ids; +DROP FUNCTION IF EXISTS last_insert_grn_id; +CREATE TABLE ids ( +id int AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; +SELECT last_insert_grn_id(); +last_insert_grn_id() +0 +INSERT INTO ids VALUES(); +SELECT last_insert_grn_id(); +last_insert_grn_id() +0 +SELECT * FROM ids; +id +1 +DROP TABLE ids; +DROP FUNCTION last_insert_grn_id; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_reference.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_reference.result new file mode 100644 index 00000000000..d31d5454169 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_reference.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; +SELECT last_insert_id(); +last_insert_id() +0 +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +last_insert_id() +1 +SELECT * FROM ids; +id +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_set.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_set.result new file mode 100644 index 00000000000..39791b93ba2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_set.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id int AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; +SELECT last_insert_id(); +last_insert_id() +0 +SELECT last_insert_id(10); +last_insert_id(10) +10 +SELECT last_insert_id(); +last_insert_id() +10 +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +last_insert_id() +1 +SELECT * FROM ids; +id +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result new file mode 100644 index 00000000000..29163384e6a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_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) +) 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', +GeomFromText('POINT(139.762573 35.720253)')); +insert into shops (name, location) +values ('taiyaki-kataoka', +GeomFromText('POINT(139.715591 35.712521)')); +insert into shops (name, location) +values ('soba-taiyaki-ku', +GeomFromText('POINT(139.659088 35.683712)')); +insert into shops (name, location) +values ('kuruma', +GeomFromText('POINT(139.706207 35.721516)')); +insert into shops (name, location) +values ('hirose-ya', +GeomFromText('POINT(139.685608 35.714844)')); +insert into shops (name, location) +values ('sazare', +GeomFromText('POINT(139.685043 35.714653)')); +insert into shops (name, location) +values ('omede-taiyaki', +GeomFromText('POINT(139.817154 35.700516)')); +insert into shops (name, location) +values ('onaga-ya', +GeomFromText('POINT(139.81105 35.698254)')); +insert into shops (name, location) +values ('shiro-ya', +GeomFromText('POINT(139.638611 35.705517)')); +insert into shops (name, location) +values ('fuji-ya', +GeomFromText('POINT(139.637115 35.703938)')); +insert into shops (name, location) +values ('miyoshi', +GeomFromText('POINT(139.537323 35.644539)')); +insert into shops (name, location) +values ('juju-ya', +GeomFromText('POINT(139.695755 35.628922)')); +insert into shops (name, location) +values ('tatsumi-ya', +GeomFromText('POINT(139.638657 35.665501)')); +insert into shops (name, location) +values ('tetsuji', +GeomFromText('POINT(139.76857 35.680912)')); +insert into shops (name, location) +values ('gazuma-ya', +GeomFromText('POINT(139.647598 35.700817)')); +insert into shops (name, location) +values ('honma-mon', +GeomFromText('POINT(139.652573 35.722736)')); +insert into shops (name, location) +values ('naniwa-ya', +GeomFromText('POINT(139.796234 35.730061)')); +insert into shops (name, location) +values ('kuro-dai', +GeomFromText('POINT(139.704834 35.650345)')); +insert into shops (name, location) +values ('daruma', +GeomFromText('POINT(139.770599 35.681461)')); +insert into shops (name, location) +values ('yanagi-ya', +GeomFromText('POINT(139.783981 35.685341)')); +insert into shops (name, location) +values ('sharaku', +GeomFromText('POINT(139.794846 35.716969)')); +insert into shops (name, location) +values ('takane', +GeomFromText('POINT(139.560913 35.698601)')); +insert into shops (name, location) +values ('chiyoda', +GeomFromText('POINT(139.652817 35.642601)')); +insert into shops (name, location) +values ('da-ka-po', +GeomFromText('POINT(139.727356 35.627346)')); +insert into shops (name, location) +values ('matsushima-ya', +GeomFromText('POINT(139.737381 35.640556)')); +insert into shops (name, location) +values ('kazuya', +GeomFromText('POINT(139.760895 35.673508)')); +insert into shops (name, location) +values ('furuya-kogane-an', +GeomFromText('POINT(139.676071 35.680603)')); +insert into shops (name, location) +values ('hachi-no-ie', +GeomFromText('POINT(139.668106 35.608021)')); +insert into shops (name, location) +values ('azuki-chan', +GeomFromText('POINT(139.673203 35.64151)')); +insert into shops (name, location) +values ('kuriko-an', +GeomFromText('POINT(139.796829 35.712013)')); +insert into shops (name, location) +values ('yume-no-aru-machi-no-taiyaki-ya-san', +GeomFromText('POINT(139.712524 35.616199)')); +insert into shops (name, location) +values ('naze-ya', +GeomFromText('POINT(139.665833 35.609039)')); +insert into shops (name, location) +values ('sanoki-ya', +GeomFromText('POINT(139.770721 35.66592)')); +insert into shops (name, location) +values ('shigeta', +GeomFromText('POINT(139.780273 35.672626)')); +insert into shops (name, location) +values ('nishimi-ya', +GeomFromText('POINT(139.774628 35.671825)')); +insert into shops (name, location) +values ('hiiragi', +GeomFromText('POINT(139.711517 35.647701)')); +select id, name, AsText(location) as location_text from shops; +id name location_text +1 nezu-no-taiyaki POINT(139.762573 35.720253) +2 taiyaki-kataoka POINT(139.715591 35.712521) +3 soba-taiyaki-ku POINT(139.659088 35.683712) +4 kuruma POINT(139.706207 35.721516) +5 hirose-ya POINT(139.685608 35.714844) +6 sazare POINT(139.685043 35.714653) +7 omede-taiyaki POINT(139.817154 35.700516) +8 onaga-ya POINT(139.81105 35.698254) +9 shiro-ya POINT(139.638611 35.705517) +10 fuji-ya POINT(139.637115 35.703938) +11 miyoshi POINT(139.537323 35.644539) +12 juju-ya POINT(139.695755 35.628922) +13 tatsumi-ya POINT(139.638657 35.665501) +14 tetsuji POINT(139.76857 35.680912) +15 gazuma-ya POINT(139.647598 35.700817) +16 honma-mon POINT(139.652573 35.722736) +17 naniwa-ya POINT(139.796234 35.730061) +18 kuro-dai POINT(139.704834 35.650345) +19 daruma POINT(139.770599 35.681461) +20 yanagi-ya POINT(139.783981 35.685341) +21 sharaku POINT(139.794846 35.716969) +22 takane POINT(139.560913 35.698601) +23 chiyoda POINT(139.652817 35.642601) +24 da-ka-po POINT(139.727356 35.627346) +25 matsushima-ya POINT(139.737381 35.640556) +26 kazuya POINT(139.760895 35.673508) +27 furuya-kogane-an POINT(139.676071 35.680603) +28 hachi-no-ie POINT(139.668106 35.608021) +29 azuki-chan POINT(139.673203 35.64151) +30 kuriko-an POINT(139.796829 35.712013) +31 yume-no-aru-machi-no-taiyaki-ya-san POINT(139.712524 35.616199) +32 naze-ya POINT(139.665833 35.609039) +33 sanoki-ya POINT(139.770721 35.66592) +34 shigeta POINT(139.780273 35.672626) +35 nishimi-ya POINT(139.774628 35.671825) +36 hiiragi POINT(139.711517 35.647701) +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +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) +drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result new file mode 100644 index 00000000000..53aa00ecbab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result @@ -0,0 +1,31 @@ +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) +) 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', +GeomFromText('POINT(139.685043 35.714653)')); +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +id name location_text +1 sazare POINT(139.685043 35.714653) +delete from shops +where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +id name location_text +select id, name, AsText(location) as location_text from shops; +id name location_text +drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result new file mode 100644 index 00000000000..e982e0b95ce --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result @@ -0,0 +1,36 @@ +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) +) 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', +GeomFromText('POINT(139.685043 35.714653)')); +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +id name location_text +1 sazare POINT(139.685043 35.714653) +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); +id name location_text +update shops set location = GeomFromText('POINT(139.66116 35.57566)') +where name = 'sazare'; +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +id name location_text +select id, name, AsText(location) as location_text from shops +where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); +id name location_text +1 sazare POINT(139.66116 35.57566) +drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/index_force_index_not_used.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/index_force_index_not_used.result new file mode 100644 index 00000000000..3fbc85ff051 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/index_force_index_not_used.result @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET UTF8 COMMENT = 'engine "InnoDB"'; +SELECT COUNT(*) FROM ids FORCE INDEX(PRIMARY); +COUNT(*) +0 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..93c05bff080 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_TODO_SPLIT_ME.result @@ -0,0 +1,78 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 tinyint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 smallint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 mediumint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 bigint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +c1 +1 +drop table t1; +create table t1 (c1 float primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(0.5); +select * from t1; +c1 +0.5 +drop table t1; +create table t1 (c1 double primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(0.5); +select * from t1; +c1 +0.5 +drop table t1; +create table t1 (c1 date primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010/03/26"); +select * from t1; +c1 +2010-03-26 +drop table t1; +create table t1 (c1 time primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("11:22:33"); +select * from t1; +c1 +11:22:33 +drop table t1; +create table t1 (c1 year primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010"); +select * from t1; +c1 +2010 +drop table t1; +create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010/03/26 11:22:33"); +select * from t1; +c1 +2010-03-26 11:22:33 +drop table t1; +create table t1 (c1 int primary key, c2 int) COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +select * from t1; +c1 c2 +1 100 +insert into t1 values(1,200); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select * from t1; +c1 c2 +1 100 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result new file mode 100644 index 00000000000..be61419477f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result @@ -0,0 +1,30 @@ +drop table if exists diaries; +set names utf8; +create table diaries ( +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, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); +UNLOCK TABLES; +select * from diaries; +id content +1 今日からはじめました。 +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +select * from diaries where match(content) against("天気"); +id content +2 明日の富士山の天気について +3 今日も天気がよくてきれいに見える。 +drop table diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result new file mode 100644 index 00000000000..f0ceb937a01 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result @@ -0,0 +1,36 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +date TIMESTAMP NOT NULL, +title VARCHAR(100) NOT NULL, +content TEXT NOT NULL, +PRIMARY KEY (date, title) +) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `title` varchar(100) NOT NULL, + `content` text NOT NULL, + PRIMARY KEY (`date`,`title`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "MyISAM"' +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "cloudy day", "Today is cloudy day..."); +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "shopping", "I buy a new shirt."); +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-05", "rainy day", "Today is rainy day..."); +SELECT * FROM diaries; +date title content +2012-03-04 00:00:00 cloudy day Today is cloudy day... +2012-03-04 00:00:00 shopping I buy a new shirt. +2012-03-05 00:00:00 rainy day Today is rainy day... +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "shopping", "I buy new shoes.") +ON DUPLICATE KEY UPDATE date = "2012-03-03", +content = "I buy a new hat."; +SELECT * FROM diaries; +date title content +2012-03-04 00:00:00 cloudy day Today is cloudy day... +2012-03-03 00:00:00 shopping I buy a new hat. +2012-03-05 00:00:00 rainy day Today is rainy day... +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result new file mode 100644 index 00000000000..97428b768a6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +date TIMESTAMP NOT NULL, +title VARCHAR(100) NOT NULL, +content TEXT NOT NULL, +UNIQUE INDEX (date, title) +) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `title` varchar(100) NOT NULL, + `content` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `date` (`date`,`title`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "MyISAM"' +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "cloudy day", "Today is cloudy day..."); +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "shopping", "I buy a new shirt."); +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-05", "rainy day", "Today is rainy day..."); +SELECT * FROM diaries; +id date title content +1 2012-03-04 00:00:00 cloudy day Today is cloudy day... +2 2012-03-04 00:00:00 shopping I buy a new shirt. +3 2012-03-05 00:00:00 rainy day Today is rainy day... +INSERT INTO diaries (date, title, content) +VALUES ("2012-03-04", "shopping", "I buy new shoes.") +ON DUPLICATE KEY UPDATE date = "2012-03-03", +content = "I buy a new hat."; +SELECT * FROM diaries; +id date title content +1 2012-03-04 00:00:00 cloudy day Today is cloudy day... +2 2012-03-03 00:00:00 shopping I buy a new hat. +3 2012-03-05 00:00:00 rainy day Today is rainy day... +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_disk_sweep.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_disk_sweep.result new file mode 100644 index 00000000000..aa7a32dbd3a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_disk_sweep.result @@ -0,0 +1,18 @@ +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 type possible_keys key key_len ref rows Extra +1 SIMPLE integers range value value 5 NULL 2 Using where; Using MRR +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/optimization_order_limit_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..5f43aee6997 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result @@ -0,0 +1,67 @@ +drop table if exists t1; +flush status; +create table t1 ( +c1 int primary key, +c2 int, +c3 text, +key idx1(c2), +fulltext index ft(c3) +) comment = 'engine "innodb"'; +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,"ii si ii se ii"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ii oo"); +select *, match(c3) against("ii") from t1 +where match(c3) against("ii") order by c1 desc limit 1; +c1 c2 c3 match(c3) against("ii") +5 50 aa ii uu ii oo 349526 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +select *, match(c3) against("ii") from t1 +where match(c3) against("ii") order by c1 limit 1; +c1 c2 c3 match(c3) against("ii") +1 10 aa ii uu ee oo 174763 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +select c3, match(c3) against("ii") from t1 +where match(c3) against("ii") order by match(c3) against("ii") desc; +c3 match(c3) against("ii") +ii si ii se ii 524289 +aa ii uu ii oo 349526 +aa ii uu ee oo 174763 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +select c3, match(c3) against("ii") from t1 +where match(c3) against("ii") order by match(c3) against("ii") desc limit 1, 1; +c3 match(c3) against("ii") +aa ii uu ii oo 349526 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +select c3, match(c3) against("ii") from t1 +where match(c3) against("ii") order by match(c3) against("ii"); +c3 match(c3) against("ii") +aa ii uu ee oo 174763 +aa ii uu ii oo 349526 +ii si ii se ii 524289 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +select c3, match(c3) against("ii") from t1 +where match(c3) against("ii") order by match(c3) against("ii") limit 1; +c3 match(c3) against("ii") +aa ii uu ee oo 174763 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 2 +select count(*) from t1 where match(c3) against("ii") limit 1; +count(*) +3 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_where_clause.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_where_clause.result new file mode 100644 index 00000000000..b31d2ee5360 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_where_clause.result @@ -0,0 +1,24 @@ +drop table if exists t1; +flush status; +create table t1 ( +c1 int primary key, +c2 int, +c3 text, +key idx1(c2), +fulltext index ft(c3) +) comment = 'engine "innodb"'; +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,"ii si ii se ii"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ii oo"); +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +select *, match(c3) against("ii") from t1 order by c1 desc limit 1; +c1 c2 c3 match(c3) against("ii") +5 50 aa ii uu ii oo 349526 +show status like 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +drop table t1; 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 new file mode 100644 index 00000000000..87a4fea1c3d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result @@ -0,0 +1,42 @@ +DROP DATABASE IF EXISTS repair_test; +CREATE DATABASE repair_test; +USE repair_test; +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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."); +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); +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' (No such file or directory) +REPAIR TABLE diaries; +Table Op Msg_type Msg_text +repair_test.diaries repair status OK +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); +id title body +2 groonga (1) starting groonga... +DROP TABLE diaries; +DROP DATABASE repair_test; +USE test; 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 new file mode 100644 index 00000000000..140b5a92b75 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result @@ -0,0 +1,42 @@ +DROP DATABASE IF EXISTS repair_test; +CREATE DATABASE repair_test; +USE repair_test; +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +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."); +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); +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.0000104' (No such file or directory) +REPAIR TABLE diaries; +Table Op Msg_type Msg_text +repair_test.diaries repair status OK +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); +id title body +2 groonga (1) starting groonga... +DROP TABLE diaries; +DROP DATABASE repair_test; +USE test; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result new file mode 100644 index 00000000000..b01e85aa483 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result @@ -0,0 +1,21 @@ +DROP TEMPORARY TABLE IF EXISTS diaries; +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"); +SELECT * FROM diaries; +id title +1 clear day +2 rainy day +3 cloudy day +DROP TEMPORARY TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result new file mode 100644 index 00000000000..54afac7a1a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result @@ -0,0 +1,28 @@ +SET @tmp_query_cache_size = @@query_cache_size; +SET GLOBAL query_cache_size = 1048576; +DROP TABLE IF EXISTS simple_table; +CREATE TABLE simple_table ( +id INT PRIMARY KEY +) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE simple_table; +Table Create Table +simple_table CREATE TABLE `simple_table` ( + `id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' +INSERT INTO simple_table (id) VALUES (1),(2); +USE test; +START TRANSACTION; +INSERT INTO simple_table (id) VALUES (3); +SELECT * FROM simple_table; +id +1 +2 +COMMIT; +SELECT * FROM simple_table; +id +1 +2 +3 +DROP TABLE simple_table; +SET GLOBAL query_cache_size = @tmp_query_cache_size; 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 new file mode 100644 index 00000000000..11cc1874257 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey") AND +MATCH(body) AGAINST("groonga"); +id title body +1 survey will start groonga! +START TRANSACTION; +DELETE FROM diaries WHERE id = 1; +ROLLBACK; +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey") AND +MATCH(body) AGAINST("groonga"); +id title body +DELETE FROM diaries WHERE id = 1; +Warnings: +Warning 1026 failed to get record ID for deleting from groonga: key=<> +SELECT * FROM diaries; +id title body +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey") AND +MATCH(body) AGAINST("groonga"); +id title body +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..7dde8518db0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +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."); +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey"); +id title body +1 survey will start groonga! +START TRANSACTION; +DELETE FROM diaries WHERE id = 1; +ROLLBACK; +SELECT * FROM diaries; +id title body +1 survey will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey"); +id title body +UPDATE diaries SET title = "survey day!" WHERE id = 1; +SELECT * FROM diaries; +id title body +1 survey day! will start groonga! +2 groonga (1) starting groonga... +3 groonga (2) started groonga. +SELECT * FROM diaries +WHERE MATCH(title) AGAINST("survey"); +id title body +1 survey day! will start groonga! +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result new file mode 100644 index 00000000000..35b273d348f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +year INT UNSIGNED, +month INT UNSIGNED, +day INT UNSIGNED, +title VARCHAR(255), +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, "富士山", "今日も天気がよくてきれいに見える。"); +SELECT * FROM diaries; +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +2 2011 11 10 天気 明日の富士山の天気について +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +id year month day title content +1 2011 11 9 Hello 今日からはじめました。 +3 2011 11 11 富士山 今日も天気がよくてきれいに見える。 +2 2011 11 10 天気 明日の富士山の天気について +TRUNCATE TABLE diaries; +SELECT * FROM diaries; +id year month day title content +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +id year month day title content +INSERT INTO diaries VALUES(1, 2011, 11, 11, "帰り道", "つかれたー"); +INSERT INTO diaries VALUES(2, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(3, 2011, 12, 2, "初雪", "今年はじめての雪!"); +SELECT * FROM diaries; +id year month day title content +1 2011 11 11 帰り道 つかれたー +2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +3 2011 12 2 初雪 今年はじめての雪! +SELECT * FROM diaries WHERE MATCH(content) AGAINST("悪い" IN BOOLEAN MODE); +id year month day title content +2 2011 12 1 久しぶり 天気が悪いからずっと留守番。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/update_fulltext.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/update_fulltext.result new file mode 100644 index 00000000000..655d2424ba7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/update_fulltext.result @@ -0,0 +1,33 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 text, fulltext index (c2)) COMMENT = 'engine "innodb"'; +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); +select * from t1; +c1 c2 +10 aa ii uu ee +20 ka ki ku ke +30 sa si su se +update t1 set c2="ta ti tu te" where c1=20; +select * from t1; +c1 c2 +10 aa ii uu ee +20 ta ti tu te +30 sa si su se +select * from t1 where match(c2) against("ti"); +c1 c2 +20 ta ti tu te +select * from t1 where match(c2) against("ki"); +c1 c2 +update t1 set c1=40 where c1=20; +select * from t1; +c1 c2 +10 aa ii uu ee +30 sa si su se +40 ta ti tu te +select * from t1 where match(c2) against("ti"); +c1 c2 +40 ta ti tu te +select * from t1 where match(c2) against("ki"); +c1 c2 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/update_int.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/update_int.result new file mode 100644 index 00000000000..5506f6b10b0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/update_int.result @@ -0,0 +1,36 @@ +drop table if exists t1, t2, t3; +create table t1 (c1 int primary key, c2 int) COMMENT = 'engine "innodb"'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; +c1 c2 +1 100 +2 101 +3 102 +update t1 set c2=c2+100 where c1=1; +select * from t1; +c1 c2 +1 200 +2 101 +3 102 +update t1 set c2=c2+100 where c1=2; +select * from t1; +c1 c2 +1 200 +2 201 +3 102 +update t1 set c2=c2+100 where c1=3; +select * from t1; +c1 c2 +1 200 +2 201 +3 202 +drop table t1; 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 new file mode 100644 index 00000000000..e451b2b99fe --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result @@ -0,0 +1,53 @@ +drop table if exists diaries; +create table diaries ( +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."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +set mroonga_dry_write=true; +delete from diaries where id = 2; +select * from diaries; +id body +1 will start groonga! +3 started groonga. +select * from diaries where match (body) against ("starting"); +id body +select * from diaries where match (body) against ("started"); +id body +3 started groonga. +set mroonga_dry_write=false; +delete from diaries where id = 3; +select * from diaries; +id body +1 will start groonga! +select * from diaries where match (body) against ("starting"); +id body +select * from diaries where match (body) against ("started"); +id body +insert into diaries (id, body) values (2, "sleeping..."); +select * from diaries; +id body +1 will start groonga! +2 sleeping... +select * from diaries where match (body) against ("starting"); +id body +2 sleeping... +select * from diaries where match (body) against ("started"); +id body +drop table diaries; 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 new file mode 100644 index 00000000000..f11398f3710 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result @@ -0,0 +1,42 @@ +drop table if exists diaries; +create table diaries ( +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 +1 will start groonga! +select * from diaries where match (body) against ("groonga"); +id body +1 will start groonga! +set mroonga_dry_write=true; +insert into diaries (body) values ("starting groonga..."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +select * from diaries where match (body) against ("groonga"); +id body +1 will start groonga! +set mroonga_dry_write=false; +insert into diaries (body) values ("started groonga."); +select * from diaries; +id body +1 will start groonga! +2 starting groonga... +3 started groonga. +select * from diaries where match (body) against ("groonga"); +id body +1 will start groonga! +3 started groonga. +drop table diaries; 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 new file mode 100644 index 00000000000..47a844c8e68 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result @@ -0,0 +1,39 @@ +drop table if exists diaries; +create table diaries ( +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; +select * from diaries; +id body +1 starting groonga... +select * from diaries where match (body) against ("will"); +id body +1 starting groonga... +select * from diaries where match (body) against ("starting"); +id body +set mroonga_dry_write=false; +update diaries set body = "started groonga." where id = 1; +select * from diaries; +id body +1 started groonga. +select * from diaries where match (body) against ("will"); +id body +1 started groonga. +select * from diaries where match (body) against ("starting"); +id body +select * from diaries where match (body) against ("started"); +id body +1 started groonga. +drop table diaries; 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 new file mode 100644 index 00000000000..0cf3d49c3c3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +SET GLOBAL mroonga_match_escalation_threshold = -1; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +tags TEXT, +FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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); +id title tags +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); +id title tags +SET mroonga_match_escalation_threshold = 0; +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +id title tags +1 Hello groonga! groonga install +DROP TABLE diaries; 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 new file mode 100644 index 00000000000..3d94ebc93ad --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS diaries; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +tags TEXT, +FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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); +id title tags +1 Hello groonga! groonga install +2 Hello mroonga! mroonga install +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +id title tags +1 Hello groonga! groonga install +SET mroonga_match_escalation_threshold = -1; +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); +id title tags +1 Hello groonga! groonga install +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/version_55_performance_schema.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/version_55_performance_schema.result new file mode 100644 index 00000000000..f6e3bbdca82 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/version_55_performance_schema.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS diaries; +SHOW VARIABLES LIKE 'performance_schema'; +Variable_name Value +performance_schema ON +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +content VARCHAR(255), +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 AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `content` (`content`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); +SHOW TABLES FROM performance_schema; +Tables_in_performance_schema +cond_instances +events_waits_current +events_waits_history +events_waits_history_long +events_waits_summary_by_instance +events_waits_summary_by_thread_by_event_name +events_waits_summary_global_by_event_name +file_instances +file_summary_by_event_name +file_summary_by_instance +mutex_instances +performance_timers +rwlock_instances +setup_consumers +setup_instruments +setup_timers +threads +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/version_56_or_later_performance_schema.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/version_56_or_later_performance_schema.result new file mode 100644 index 00000000000..548dc32707f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/version_56_or_later_performance_schema.result @@ -0,0 +1,73 @@ +DROP TABLE IF EXISTS diaries; +SHOW VARIABLES LIKE 'performance_schema'; +Variable_name Value +performance_schema ON +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +content VARCHAR(255), +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 AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `content` (`content`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); +SHOW TABLES FROM performance_schema; +Tables_in_performance_schema +accounts +cond_instances +events_stages_current +events_stages_history +events_stages_history_long +events_stages_summary_by_account_by_event_name +events_stages_summary_by_host_by_event_name +events_stages_summary_by_thread_by_event_name +events_stages_summary_by_user_by_event_name +events_stages_summary_global_by_event_name +events_statements_current +events_statements_history +events_statements_history_long +events_statements_summary_by_account_by_event_name +events_statements_summary_by_digest +events_statements_summary_by_host_by_event_name +events_statements_summary_by_thread_by_event_name +events_statements_summary_by_user_by_event_name +events_statements_summary_global_by_event_name +events_waits_current +events_waits_history +events_waits_history_long +events_waits_summary_by_account_by_event_name +events_waits_summary_by_host_by_event_name +events_waits_summary_by_instance +events_waits_summary_by_thread_by_event_name +events_waits_summary_by_user_by_event_name +events_waits_summary_global_by_event_name +file_instances +file_summary_by_event_name +file_summary_by_instance +host_cache +hosts +mutex_instances +objects_summary_global_by_type +performance_timers +rwlock_instances +session_account_connect_attrs +session_connect_attrs +setup_actors +setup_consumers +setup_instruments +setup_objects +setup_timers +socket_instances +socket_summary_by_event_name +socket_summary_by_instance +table_io_waits_summary_by_index_usage +table_io_waits_summary_by_table +table_lock_waits_summary_by_table +threads +users +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/suite.opt b/storage/mroonga/mysql-test/mroonga/wrapper/suite.opt new file mode 100644 index 00000000000..d5a1e5190a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/suite.opt @@ -0,0 +1 @@ +--loose-plugin-load-add=$HA_MROONGA_SO --loose-plugin-mroonga=ON diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm b/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm new file mode 100644 index 00000000000..528ccc5d693 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/suite.pm @@ -0,0 +1,23 @@ +package My::Suite::Mroonga; + +@ISA = qw(My::Suite); + +return "No Mroonga engine" unless $ENV{HA_MROONGA_SO} or + $::mysqld_variables{'mroonga'} eq "ON"; + +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'; + +if (-d $groonga_normalizer_mysql_dir) +{ + $ENV{GRN_PLUGINS_DIR}=$groonga_normalizer_mysql_dir; +} +elsif (-d $groonga_normalizer_mysql_install_dir) +{ + $ENV{GRN_PLUGINS_DIR}=$groonga_normalizer_mysql_install_dir; +} + +bless { }; + 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 new file mode 100644 index 00000000000..f25fdf95dab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test @@ -0,0 +1,46 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.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 +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; + +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; + +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_change_column_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test new file mode 100644 index 00000000000..bbc5ca49818 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test @@ -0,0 +1,40 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; + +ALTER TABLE bugs + CHANGE COLUMN + tag + tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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_engine.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test new file mode 100644 index 00000000000..38a13bf8a5e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test @@ -0,0 +1,55 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.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, + body TEXT, + FULLTEXT INDEX title_index (title), + FULLTEXT INDEX body_index (body) +) ENGINE MyISAM 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..."); +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +ALTER TABLE diaries ENGINE = mroonga COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AND + MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..2c85cc68266 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(64), + 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 * FROM memos; +SELECT * FROM memos WHERE MATCH(content) AGAINST("start" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..00b6ecf565e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + WHERE MATCH (title) AGAINST ("富士山"); + +CREATE FULLTEXT INDEX title_index on diaries (title); + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries DISABLE KEYS; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f81b4e82b06 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test @@ -0,0 +1,50 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + FULLTEXT KEY title_index (title) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries DISABLE KEYS; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..760a4bc99bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test @@ -0,0 +1,52 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + created_at datetime, + KEY title_and_created_at_index (title, created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..89a62e78baa --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test @@ -0,0 +1,50 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + created_at datetime, + KEY created_at_index (created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..63f0b8ad404 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test @@ -0,0 +1,48 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +ALTER TABLE diaries DISABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..9d0f1f3dc1a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test @@ -0,0 +1,42 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + c1 int NOT NULL, + c2 text NOT NULL, + c3 int NOT NULL, + c4 int NOT NULL, + PRIMARY KEY(c1), + KEY idx1(c3,c4), + FULLTEXT KEY ft1(c2) +) COMMENT='ENGINE "MyISAM"' DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES(1, 'test1', 1, 1); +INSERT INTO t1 VALUES(2, 'test2', 2, 2); +INSERT INTO t1 VALUES(3, 'test3', 1, 3); +ALTER TABLE t1 DISABLE KEYS; +DELETE FROM t1 WHERE c1 = 2; +UPDATE t1 SET c4 = 4 WHERE c1 = 1; +INSERT INTO t1 VALUES(4, 'test4', 2, 4); +TRUNCATE t1; +DROP TABLE t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..41a09b8721b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test @@ -0,0 +1,45 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.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, + 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)"); +INSERT INTO diaries (title) values ("groonga (2)"); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..293bc8b7963 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test @@ -0,0 +1,52 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + FULLTEXT KEY title_index (title) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_index) + WHERE MATCH (title) AGAINST ("富士山"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0756c27f9f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +CREATE TABLE IF NOT EXISTS memos ( + id VARCHAR(45) NOT NULL PRIMARY KEY, + text TEXT NOT NULL, + FULLTEXT KEY (text) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; + +LOCK TABLES memos WRITE; +ALTER TABLE memos DISABLE KEYS; + +INSERT INTO memos + VALUES (00000, 'text0'), + (00001, 'text1'), + (00002, 'text2'); + +ALTER TABLE memos ENABLE KEYS; +UNLOCK TABLES; + +SELECT * FROM memos; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f8b93e19000 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test @@ -0,0 +1,54 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + created_at datetime, + KEY title_and_created_at_index (title, created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (title_and_created_at_index) + WHERE title = "天気" AND + created_at = "2012-04-30 23:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3dd0f332fe6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test @@ -0,0 +1,52 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + created_at datetime, + KEY created_at_index (created_at) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00"); +INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00"); +INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00"); + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (created_at_index) + WHERE created_at = "2012-04-30 20:00:00"; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..bfa11c9eb8c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test @@ -0,0 +1,50 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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) +) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8; + +ALTER TABLE diaries DISABLE KEYS; + +INSERT INTO diaries VALUES (1, "Hello"); +INSERT INTO diaries VALUES (2, "天気"); +INSERT INTO diaries VALUES (3, "富士山"); + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +ALTER TABLE diaries ENABLE KEYS; + +SELECT * + FROM diaries + FORCE INDEX (PRIMARY) + WHERE id = 2; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..f4bd0b391b6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test @@ -0,0 +1,57 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.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, + FULLTEXT INDEX title_index (title) +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title) VALUES ("survey"); +SELECT * FROM diaries; + +ALTER TABLE diaries ADD COLUMN body TEXT; +UPDATE diaries SET body = "will start groonga!"; +SELECT * FROM diaries; + +INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga..."); +INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); +SELECT * FROM diaries; + +ALTER TABLE diaries ADD FULLTEXT INDEX body_index (body); + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey") AND + MATCH(body) AGAINST("groonga"); + +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 new file mode 100644 index 00000000000..595a850ae03 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test @@ -0,0 +1,50 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries, memos; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT, + 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; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("groonga") AND + MATCH(body) AGAINST("starting"); + +ALTER TABLE diaries RENAME memos; +SELECT * FROM memos; +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 new file mode 100644 index 00000000000..37ea8aaf149 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test @@ -0,0 +1,150 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source include/have_geometry.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 +) COMMENT = 'ENGINE "InnoDB"'; + +INSERT INTO shops (name, location) + VALUES ('nezu-no-taiyaki', + GeomFromText('POINT(139.762573 35.720253)')); +INSERT INTO shops (name, location) + VALUES ('taiyaki-kataoka', + GeomFromText('POINT(139.715591 35.712521)')); +INSERT INTO shops (name, location) + VALUES ('soba-taiyaki-ku', + GeomFromText('POINT(139.659088 35.683712)')); +INSERT INTO shops (name, location) + VALUES ('kuruma', + GeomFromText('POINT(139.706207 35.721516)')); +INSERT INTO shops (name, location) + VALUES ('hirose-ya', + GeomFromText('POINT(139.685608 35.714844)')); +INSERT INTO shops (name, location) + VALUES ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +INSERT INTO shops (name, location) + VALUES ('omede-taiyaki', + GeomFromText('POINT(139.817154 35.700516)')); +INSERT INTO shops (name, location) + VALUES ('onaga-ya', + GeomFromText('POINT(139.81105 35.698254)')); +INSERT INTO shops (name, location) + VALUES ('shiro-ya', + GeomFromText('POINT(139.638611 35.705517)')); +INSERT INTO shops (name, location) + VALUES ('fuji-ya', + GeomFromText('POINT(139.637115 35.703938)')); +INSERT INTO shops (name, location) + VALUES ('miyoshi', + GeomFromText('POINT(139.537323 35.644539)')); +INSERT INTO shops (name, location) + VALUES ('juju-ya', + GeomFromText('POINT(139.695755 35.628922)')); +INSERT INTO shops (name, location) + VALUES ('tatsumi-ya', + GeomFromText('POINT(139.638657 35.665501)')); +INSERT INTO shops (name, location) + VALUES ('tetsuji', + GeomFromText('POINT(139.76857 35.680912)')); +INSERT INTO shops (name, location) + VALUES ('gazuma-ya', + GeomFromText('POINT(139.647598 35.700817)')); +INSERT INTO shops (name, location) + VALUES ('honma-mon', + GeomFromText('POINT(139.652573 35.722736)')); +INSERT INTO shops (name, location) + VALUES ('naniwa-ya', + GeomFromText('POINT(139.796234 35.730061)')); +INSERT INTO shops (name, location) + VALUES ('kuro-dai', + GeomFromText('POINT(139.704834 35.650345)')); +INSERT INTO shops (name, location) + VALUES ('daruma', + GeomFromText('POINT(139.770599 35.681461)')); +INSERT INTO shops (name, location) + VALUES ('yanagi-ya', + GeomFromText('POINT(139.783981 35.685341)')); +INSERT INTO shops (name, location) + VALUES ('sharaku', + GeomFromText('POINT(139.794846 35.716969)')); +INSERT INTO shops (name, location) + VALUES ('takane', + GeomFromText('POINT(139.560913 35.698601)')); +INSERT INTO shops (name, location) + VALUES ('chiyoda', + GeomFromText('POINT(139.652817 35.642601)')); +INSERT INTO shops (name, location) + VALUES ('da-ka-po', + GeomFromText('POINT(139.727356 35.627346)')); +INSERT INTO shops (name, location) + VALUES ('matsushima-ya', + GeomFromText('POINT(139.737381 35.640556)')); +INSERT INTO shops (name, location) + VALUES ('kazuya', + GeomFromText('POINT(139.760895 35.673508)')); +INSERT INTO shops (name, location) + VALUES ('furuya-kogane-an', + GeomFromText('POINT(139.676071 35.680603)')); +INSERT INTO shops (name, location) + VALUES ('hachi-no-ie', + GeomFromText('POINT(139.668106 35.608021)')); +INSERT INTO shops (name, location) + VALUES ('azuki-chan', + GeomFromText('POINT(139.673203 35.64151)')); +INSERT INTO shops (name, location) + VALUES ('kuriko-an', + GeomFromText('POINT(139.796829 35.712013)')); +INSERT INTO shops (name, location) + VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', + GeomFromText('POINT(139.712524 35.616199)')); +INSERT INTO shops (name, location) + VALUES ('naze-ya', + GeomFromText('POINT(139.665833 35.609039)')); +INSERT INTO shops (name, location) + VALUES ('sanoki-ya', + GeomFromText('POINT(139.770721 35.66592)')); +INSERT INTO shops (name, location) + VALUES ('shigeta', + GeomFromText('POINT(139.780273 35.672626)')); +INSERT INTO shops (name, location) + VALUES ('nishimi-ya', + GeomFromText('POINT(139.774628 35.671825)')); +INSERT INTO shops (name, location) + VALUES ('hiiragi', + GeomFromText('POINT(139.711517 35.647701)')); + +ALTER TABLE shops ADD SPATIAL KEY location_index (location); + +SELECT id, name, AsText(location) AS location_text FROM shops + WHERE MBRContains(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 new file mode 100644 index 00000000000..e702cb5d591 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test @@ -0,0 +1,34 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + body text +) comment = 'engine "innodb"'; +insert into diaries (body) values ("started groonga (long text)"); +select * from diaries; +insert into diaries (body) values ("sleeping... (short text)"); +select * from diaries; +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..230ab87b391 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test @@ -0,0 +1,55 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +show variables like 'log_bin'; + +set binlog_format="STATEMENT"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +set binlog_format="ROW"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +set binlog_format="MIXED"; + +create table t1 (c1 int primary key, c2 int) engine = mroonga COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +insert into t1 values(2,100); +commit; +select * from t1; +drop table t1; + +--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 new file mode 100644 index 00000000000..3bc3c069705 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test @@ -0,0 +1,37 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64), + INDEX (tag) COMMENT 'Tag search is required.' +) DEFAULT CHARSET=utf8 + COMMENT='engine "InnoDB"'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--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 new file mode 100644 index 00000000000..73065ffd7bb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY, + tag VARCHAR(64) COMMENT 'It must consist of only alphabet and number.' +) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--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 new file mode 100644 index 00000000000..f8b77becdde --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test @@ -0,0 +1,54 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_fulltext_index_comment.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries_innodb; +DROP TABLE IF EXISTS diaries_mroonga; +--enable_warnings + +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/create_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test new file mode 100644 index 00000000000..6df44e79665 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test @@ -0,0 +1,99 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +# simple test +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +create table t2 (c1 int primary key) COMMENT = 'engine "innodb"'; +create table t3 (c1 int primary key) COMMENT = 'engine "innodb"'; +drop table t1,t2,t3; +create table t1 (c1 int primary key, c2 int, c3 int) COMMENT = 'engine "innodb"'; +drop table t1; + +# data type support +create table t1 (c1 bit primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 tinyint primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 smallint primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 mediumint primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 bigint primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 double primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 float primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 decimal primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 date primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +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"'; +desc t1; +drop table t1; +create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 year primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 char(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 varchar(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 binary(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 varbinary(10) primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 enum("yes","no") primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; +create table t1 (c1 set("A","B","AB","O") primary key) COMMENT = 'engine "innodb"'; +desc t1; +drop table t1; + +# error test +--error ER_REQUIRES_PRIMARY_KEY +create table t1 (c1 int) COMMENT = 'engine "innodb"'; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f9a7dc3168b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test @@ -0,0 +1,35 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 bugs; +--enable_warnings + +CREATE TABLE bugs ( + id INT UNSIGNED PRIMARY KEY +) DEFAULT CHARSET=utf8 + COMMENT='Free style normal comment, engine "InnoDB"'; + +SHOW CREATE TABLE bugs; + +DROP TABLE bugs; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index.test new file mode 100644 index 00000000000..c4265ffd22e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index.test @@ -0,0 +1,43 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 diaries; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE diaries ( + day DATE PRIMARY KEY, + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +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/wrapper/t/delete_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test new file mode 100644 index 00000000000..1e82a2dff60 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test @@ -0,0 +1,59 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int) COMMENT 'engine = "innodb"'; +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +insert into t1 values (4, 102); +select * from t1; + +delete from t1 where c1=3; +select * from t1; + +flush tables; + +delete from t1 where c1=2; +select * from t1; + +delete from t1; +select * from t1; + +drop table t1; + +create table t1 (c1 int primary key, c2 text, fulltext index (c2)) COMMENT 'engine = "innodb"'; +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); + +select * from t1; +select * from t1 where match(c2) against("ki"); +delete from t1 where c1=20; +select * from t1; +select * from t1 where match(c2) against("ki"); + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..c77a9cdeac3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test @@ -0,0 +1,44 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS users; +--enable_warnings + +SET NAMES utf8; + +CREATE TABLE users ( + id int PRIMARY KEY, + name varchar(100), + FULLTEXT INDEX (name) +) COMMENT 'engine = "InnoDB"' DEFAULT CHARSET=utf8; + +INSERT INTO users VALUES (1, 'Alice'); +INSERT INTO users VALUES (2, 'Bob'); +INSERT INTO users VALUES (3, 'Chris'); + +SELECT * FROM users; + +DELETE FROM users; + +SELECT * FROM users; + +DROP TABLE users; + +--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 new file mode 100644 index 00000000000..fb55d609855 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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 (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, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT * FROM diaries WHERE MATCH(content) AGAINST("-明日 +天気" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..483cca04c8a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test @@ -0,0 +1,44 @@ +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + 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日", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "天気 4月4日", "今日も天気がよくてきれいに見える。"); + +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); +SELECT * FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); +SELECT 1 FROM diaries WHERE MATCH(title) AGAINST("+天気" IN BOOLEAN MODE) AND MATCH(content) AGAINST("+今日" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..2e96b8ed4f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- fine is be" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6eb46419c4d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- is OR be fine" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..301365610c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Yesterday was good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D- good +day be" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6a89d7556ab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today good" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..790d2f1c9a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today -good tomorrow" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..a45c414580d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test @@ -0,0 +1,42 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be fine."); +INSERT INTO memos VALUES (NULL, "Yesterday was fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*DOR today +good tomorrow" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..d013578a8f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today good" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..91b0a7f7891 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today -good is" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..29c1c0d9d98 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test @@ -0,0 +1,40 @@ +# Copyright(C) 2011-2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 PRIMARY KEY AUTO_INCREMENT, + content TEXT, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8 COMMENT='engine "InnODB"'; + +INSERT INTO memos VALUES (NULL, "Today is good day."); +INSERT INTO memos VALUES (NULL, "Tomorrow will be good day."); +INSERT INTO memos VALUES (NULL, "Today is fine."); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("*D+ today OR tomorrow day" IN BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..027b05d5320 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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 COMMENT='ENGINE "InnoDB"'; + +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT *, MATCH(title, content) + AGAINST("*W1:10,2:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1:10,2:2 +天気" in BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..41b814de80f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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 COMMENT='ENGINE "InnoDB"'; + +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT *, MATCH(title, content) + AGAINST("*W1,2:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1,2:2 +天気" in BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..1db4134d0a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test @@ -0,0 +1,44 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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 COMMENT='ENGINE "InnoDB"'; + +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT *, MATCH(title, content) + AGAINST("*W1:2 +天気" in BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title, content) + AGAINST("*W1:2 +天気" in BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..33e23e801ff --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test @@ -0,0 +1,38 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "innodb"'; +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"); +select * from t1; +select * from t1 where match(c3) against("su"); +select * from t1 where match(c3) against("ii"); +select * from t1 where match(c3) against("+su" in boolean mode); +select * from t1 where match(c3) against("+ii" in boolean mode); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..75853611f69 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test @@ -0,0 +1,35 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_cp932.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names cp932; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset cp932 COMMENT = 'engine "innodb"'; +insert into t1 values(1, "̕xmR̓VCɂ‚",""); +insert into t1 values(2, "","̕xmR̓VC͕܂"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("xmR"); +select * from t1 where match(c3) against("xmR"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..3f1cba869f8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test @@ -0,0 +1,35 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_eucjpms.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names eucjpms; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset eucjpms COMMENT = 'engine "innodb"'; +insert into t1 values(1, "ٻλŷˤĤ",""); +insert into t1 values(2, "","ٻλŷʬޤ"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("ٻλ"); +select * from t1 where match(c3) against("ٻλ"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..27524ac2ed0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test @@ -0,0 +1,35 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8 COMMENT = 'engine "innodb"'; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("富士山"); +select * from t1 where match(c3) against("富士山"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..0115ed0699c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test @@ -0,0 +1,51 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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) +) 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, "富士山", "今日もきれい。"); + +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); + +DROP INDEX title ON diaries; + +--error ER_FT_MATCHING_KEY_NOT_FOUND +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); +SELECT * FROM diaries; + +CREATE FULLTEXT INDEX new_title_index ON diaries (title); +SELECT * FROM diaries WHERE MATCH (title) AGAINST ("富士山"); +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..6037ab61da0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test @@ -0,0 +1,47 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8 COMMENT = 'engine "innodb"'; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8 COMMENT = 'engine "innodb"'; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +select * from t2; +select * from t1 where c1=3; +select * from t2 where c1=3; +select * from t1 where c1>3 order by c1 desc; +select * from t2 where c1>3 order by c1 asc; +select * from t1 where c2>"s" order by c2 desc; +select * from t2 where c2>"s" order by c1 asc; +select *,match(c2) against("ii") from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +select *,match(c2) against("ii") from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +drop table t1,t2; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..43237cdc96a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test @@ -0,0 +1,35 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +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"); +select * from t1; +flush tables; +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..c12441f3c5a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test @@ -0,0 +1,4136 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + fulltext index (title) +) default charset utf8 COMMENT = 'engine "innodb"'; +show create table diaries; + +set autocommit=0; +insert into diaries values(0, "2011-07-14"); +insert into diaries values(1, "2011-07-15"); +insert into diaries values(2, "2011-07-16"); +insert into diaries values(3, "2011-07-17"); +insert into diaries values(4, "2011-07-18"); +insert into diaries values(5, "2011-07-19"); +insert into diaries values(6, "2011-07-20"); +insert into diaries values(7, "2011-07-21"); +insert into diaries values(8, "2011-07-22"); +insert into diaries values(9, "2011-07-23"); +insert into diaries values(10, "2011-07-24"); +insert into diaries values(11, "2011-07-25"); +insert into diaries values(12, "2011-07-26"); +insert into diaries values(13, "2011-07-27"); +insert into diaries values(14, "2011-07-28"); +insert into diaries values(15, "2011-07-29"); +insert into diaries values(16, "2011-07-30"); +insert into diaries values(17, "2011-07-31"); +insert into diaries values(18, "2011-08-01"); +insert into diaries values(19, "2011-08-02"); +insert into diaries values(20, "2011-08-03"); +insert into diaries values(21, "2011-08-04"); +insert into diaries values(22, "2011-08-05"); +insert into diaries values(23, "2011-08-06"); +insert into diaries values(24, "2011-08-07"); +insert into diaries values(25, "2011-08-08"); +insert into diaries values(26, "2011-08-09"); +insert into diaries values(27, "2011-08-10"); +insert into diaries values(28, "2011-08-11"); +insert into diaries values(29, "2011-08-12"); +insert into diaries values(30, "2011-08-13"); +insert into diaries values(31, "2011-08-14"); +insert into diaries values(32, "2011-08-15"); +insert into diaries values(33, "2011-08-16"); +insert into diaries values(34, "2011-08-17"); +insert into diaries values(35, "2011-08-18"); +insert into diaries values(36, "2011-08-19"); +insert into diaries values(37, "2011-08-20"); +insert into diaries values(38, "2011-08-21"); +insert into diaries values(39, "2011-08-22"); +insert into diaries values(40, "2011-08-23"); +insert into diaries values(41, "2011-08-24"); +insert into diaries values(42, "2011-08-25"); +insert into diaries values(43, "2011-08-26"); +insert into diaries values(44, "2011-08-27"); +insert into diaries values(45, "2011-08-28"); +insert into diaries values(46, "2011-08-29"); +insert into diaries values(47, "2011-08-30"); +insert into diaries values(48, "2011-08-31"); +insert into diaries values(49, "2011-09-01"); +insert into diaries values(50, "2011-09-02"); +insert into diaries values(51, "2011-09-03"); +insert into diaries values(52, "2011-09-04"); +insert into diaries values(53, "2011-09-05"); +insert into diaries values(54, "2011-09-06"); +insert into diaries values(55, "2011-09-07"); +insert into diaries values(56, "2011-09-08"); +insert into diaries values(57, "2011-09-09"); +insert into diaries values(58, "2011-09-10"); +insert into diaries values(59, "2011-09-11"); +insert into diaries values(60, "2011-09-12"); +insert into diaries values(61, "2011-09-13"); +insert into diaries values(62, "2011-09-14"); +insert into diaries values(63, "2011-09-15"); +insert into diaries values(64, "2011-09-16"); +insert into diaries values(65, "2011-09-17"); +insert into diaries values(66, "2011-09-18"); +insert into diaries values(67, "2011-09-19"); +insert into diaries values(68, "2011-09-20"); +insert into diaries values(69, "2011-09-21"); +insert into diaries values(70, "2011-09-22"); +insert into diaries values(71, "2011-09-23"); +insert into diaries values(72, "2011-09-24"); +insert into diaries values(73, "2011-09-25"); +insert into diaries values(74, "2011-09-26"); +insert into diaries values(75, "2011-09-27"); +insert into diaries values(76, "2011-09-28"); +insert into diaries values(77, "2011-09-29"); +insert into diaries values(78, "2011-09-30"); +insert into diaries values(79, "2011-10-01"); +insert into diaries values(80, "2011-10-02"); +insert into diaries values(81, "2011-10-03"); +insert into diaries values(82, "2011-10-04"); +insert into diaries values(83, "2011-10-05"); +insert into diaries values(84, "2011-10-06"); +insert into diaries values(85, "2011-10-07"); +insert into diaries values(86, "2011-10-08"); +insert into diaries values(87, "2011-10-09"); +insert into diaries values(88, "2011-10-10"); +insert into diaries values(89, "2011-10-11"); +insert into diaries values(90, "2011-10-12"); +insert into diaries values(91, "2011-10-13"); +insert into diaries values(92, "2011-10-14"); +insert into diaries values(93, "2011-10-15"); +insert into diaries values(94, "2011-10-16"); +insert into diaries values(95, "2011-10-17"); +insert into diaries values(96, "2011-10-18"); +insert into diaries values(97, "2011-10-19"); +insert into diaries values(98, "2011-10-20"); +insert into diaries values(99, "2011-10-21"); +insert into diaries values(100, "2011-10-22"); +insert into diaries values(101, "2011-10-23"); +insert into diaries values(102, "2011-10-24"); +insert into diaries values(103, "2011-10-25"); +insert into diaries values(104, "2011-10-26"); +insert into diaries values(105, "2011-10-27"); +insert into diaries values(106, "2011-10-28"); +insert into diaries values(107, "2011-10-29"); +insert into diaries values(108, "2011-10-30"); +insert into diaries values(109, "2011-10-31"); +insert into diaries values(110, "2011-11-01"); +insert into diaries values(111, "2011-11-02"); +insert into diaries values(112, "2011-11-03"); +insert into diaries values(113, "2011-11-04"); +insert into diaries values(114, "2011-11-05"); +insert into diaries values(115, "2011-11-06"); +insert into diaries values(116, "2011-11-07"); +insert into diaries values(117, "2011-11-08"); +insert into diaries values(118, "2011-11-09"); +insert into diaries values(119, "2011-11-10"); +insert into diaries values(120, "2011-11-11"); +insert into diaries values(121, "2011-11-12"); +insert into diaries values(122, "2011-11-13"); +insert into diaries values(123, "2011-11-14"); +insert into diaries values(124, "2011-11-15"); +insert into diaries values(125, "2011-11-16"); +insert into diaries values(126, "2011-11-17"); +insert into diaries values(127, "2011-11-18"); +insert into diaries values(128, "2011-11-19"); +insert into diaries values(129, "2011-11-20"); +insert into diaries values(130, "2011-11-21"); +insert into diaries values(131, "2011-11-22"); +insert into diaries values(132, "2011-11-23"); +insert into diaries values(133, "2011-11-24"); +insert into diaries values(134, "2011-11-25"); +insert into diaries values(135, "2011-11-26"); +insert into diaries values(136, "2011-11-27"); +insert into diaries values(137, "2011-11-28"); +insert into diaries values(138, "2011-11-29"); +insert into diaries values(139, "2011-11-30"); +insert into diaries values(140, "2011-12-01"); +insert into diaries values(141, "2011-12-02"); +insert into diaries values(142, "2011-12-03"); +insert into diaries values(143, "2011-12-04"); +insert into diaries values(144, "2011-12-05"); +insert into diaries values(145, "2011-12-06"); +insert into diaries values(146, "2011-12-07"); +insert into diaries values(147, "2011-12-08"); +insert into diaries values(148, "2011-12-09"); +insert into diaries values(149, "2011-12-10"); +insert into diaries values(150, "2011-12-11"); +insert into diaries values(151, "2011-12-12"); +insert into diaries values(152, "2011-12-13"); +insert into diaries values(153, "2011-12-14"); +insert into diaries values(154, "2011-12-15"); +insert into diaries values(155, "2011-12-16"); +insert into diaries values(156, "2011-12-17"); +insert into diaries values(157, "2011-12-18"); +insert into diaries values(158, "2011-12-19"); +insert into diaries values(159, "2011-12-20"); +insert into diaries values(160, "2011-12-21"); +insert into diaries values(161, "2011-12-22"); +insert into diaries values(162, "2011-12-23"); +insert into diaries values(163, "2011-12-24"); +insert into diaries values(164, "2011-12-25"); +insert into diaries values(165, "2011-12-26"); +insert into diaries values(166, "2011-12-27"); +insert into diaries values(167, "2011-12-28"); +insert into diaries values(168, "2011-12-29"); +insert into diaries values(169, "2011-12-30"); +insert into diaries values(170, "2011-12-31"); +insert into diaries values(171, "2012-01-01"); +insert into diaries values(172, "2012-01-02"); +insert into diaries values(173, "2012-01-03"); +insert into diaries values(174, "2012-01-04"); +insert into diaries values(175, "2012-01-05"); +insert into diaries values(176, "2012-01-06"); +insert into diaries values(177, "2012-01-07"); +insert into diaries values(178, "2012-01-08"); +insert into diaries values(179, "2012-01-09"); +insert into diaries values(180, "2012-01-10"); +insert into diaries values(181, "2012-01-11"); +insert into diaries values(182, "2012-01-12"); +insert into diaries values(183, "2012-01-13"); +insert into diaries values(184, "2012-01-14"); +insert into diaries values(185, "2012-01-15"); +insert into diaries values(186, "2012-01-16"); +insert into diaries values(187, "2012-01-17"); +insert into diaries values(188, "2012-01-18"); +insert into diaries values(189, "2012-01-19"); +insert into diaries values(190, "2012-01-20"); +insert into diaries values(191, "2012-01-21"); +insert into diaries values(192, "2012-01-22"); +insert into diaries values(193, "2012-01-23"); +insert into diaries values(194, "2012-01-24"); +insert into diaries values(195, "2012-01-25"); +insert into diaries values(196, "2012-01-26"); +insert into diaries values(197, "2012-01-27"); +insert into diaries values(198, "2012-01-28"); +insert into diaries values(199, "2012-01-29"); +insert into diaries values(200, "2012-01-30"); +insert into diaries values(201, "2012-01-31"); +insert into diaries values(202, "2012-02-01"); +insert into diaries values(203, "2012-02-02"); +insert into diaries values(204, "2012-02-03"); +insert into diaries values(205, "2012-02-04"); +insert into diaries values(206, "2012-02-05"); +insert into diaries values(207, "2012-02-06"); +insert into diaries values(208, "2012-02-07"); +insert into diaries values(209, "2012-02-08"); +insert into diaries values(210, "2012-02-09"); +insert into diaries values(211, "2012-02-10"); +insert into diaries values(212, "2012-02-11"); +insert into diaries values(213, "2012-02-12"); +insert into diaries values(214, "2012-02-13"); +insert into diaries values(215, "2012-02-14"); +insert into diaries values(216, "2012-02-15"); +insert into diaries values(217, "2012-02-16"); +insert into diaries values(218, "2012-02-17"); +insert into diaries values(219, "2012-02-18"); +insert into diaries values(220, "2012-02-19"); +insert into diaries values(221, "2012-02-20"); +insert into diaries values(222, "2012-02-21"); +insert into diaries values(223, "2012-02-22"); +insert into diaries values(224, "2012-02-23"); +insert into diaries values(225, "2012-02-24"); +insert into diaries values(226, "2012-02-25"); +insert into diaries values(227, "2012-02-26"); +insert into diaries values(228, "2012-02-27"); +insert into diaries values(229, "2012-02-28"); +insert into diaries values(230, "2012-02-29"); +insert into diaries values(231, "2012-03-01"); +insert into diaries values(232, "2012-03-02"); +insert into diaries values(233, "2012-03-03"); +insert into diaries values(234, "2012-03-04"); +insert into diaries values(235, "2012-03-05"); +insert into diaries values(236, "2012-03-06"); +insert into diaries values(237, "2012-03-07"); +insert into diaries values(238, "2012-03-08"); +insert into diaries values(239, "2012-03-09"); +insert into diaries values(240, "2012-03-10"); +insert into diaries values(241, "2012-03-11"); +insert into diaries values(242, "2012-03-12"); +insert into diaries values(243, "2012-03-13"); +insert into diaries values(244, "2012-03-14"); +insert into diaries values(245, "2012-03-15"); +insert into diaries values(246, "2012-03-16"); +insert into diaries values(247, "2012-03-17"); +insert into diaries values(248, "2012-03-18"); +insert into diaries values(249, "2012-03-19"); +insert into diaries values(250, "2012-03-20"); +insert into diaries values(251, "2012-03-21"); +insert into diaries values(252, "2012-03-22"); +insert into diaries values(253, "2012-03-23"); +insert into diaries values(254, "2012-03-24"); +insert into diaries values(255, "2012-03-25"); +insert into diaries values(256, "2012-03-26"); +insert into diaries values(257, "2012-03-27"); +insert into diaries values(258, "2012-03-28"); +insert into diaries values(259, "2012-03-29"); +insert into diaries values(260, "2012-03-30"); +insert into diaries values(261, "2012-03-31"); +insert into diaries values(262, "2012-04-01"); +insert into diaries values(263, "2012-04-02"); +insert into diaries values(264, "2012-04-03"); +insert into diaries values(265, "2012-04-04"); +insert into diaries values(266, "2012-04-05"); +insert into diaries values(267, "2012-04-06"); +insert into diaries values(268, "2012-04-07"); +insert into diaries values(269, "2012-04-08"); +insert into diaries values(270, "2012-04-09"); +insert into diaries values(271, "2012-04-10"); +insert into diaries values(272, "2012-04-11"); +insert into diaries values(273, "2012-04-12"); +insert into diaries values(274, "2012-04-13"); +insert into diaries values(275, "2012-04-14"); +insert into diaries values(276, "2012-04-15"); +insert into diaries values(277, "2012-04-16"); +insert into diaries values(278, "2012-04-17"); +insert into diaries values(279, "2012-04-18"); +insert into diaries values(280, "2012-04-19"); +insert into diaries values(281, "2012-04-20"); +insert into diaries values(282, "2012-04-21"); +insert into diaries values(283, "2012-04-22"); +insert into diaries values(284, "2012-04-23"); +insert into diaries values(285, "2012-04-24"); +insert into diaries values(286, "2012-04-25"); +insert into diaries values(287, "2012-04-26"); +insert into diaries values(288, "2012-04-27"); +insert into diaries values(289, "2012-04-28"); +insert into diaries values(290, "2012-04-29"); +insert into diaries values(291, "2012-04-30"); +insert into diaries values(292, "2012-05-01"); +insert into diaries values(293, "2012-05-02"); +insert into diaries values(294, "2012-05-03"); +insert into diaries values(295, "2012-05-04"); +insert into diaries values(296, "2012-05-05"); +insert into diaries values(297, "2012-05-06"); +insert into diaries values(298, "2012-05-07"); +insert into diaries values(299, "2012-05-08"); +insert into diaries values(300, "2012-05-09"); +insert into diaries values(301, "2012-05-10"); +insert into diaries values(302, "2012-05-11"); +insert into diaries values(303, "2012-05-12"); +insert into diaries values(304, "2012-05-13"); +insert into diaries values(305, "2012-05-14"); +insert into diaries values(306, "2012-05-15"); +insert into diaries values(307, "2012-05-16"); +insert into diaries values(308, "2012-05-17"); +insert into diaries values(309, "2012-05-18"); +insert into diaries values(310, "2012-05-19"); +insert into diaries values(311, "2012-05-20"); +insert into diaries values(312, "2012-05-21"); +insert into diaries values(313, "2012-05-22"); +insert into diaries values(314, "2012-05-23"); +insert into diaries values(315, "2012-05-24"); +insert into diaries values(316, "2012-05-25"); +insert into diaries values(317, "2012-05-26"); +insert into diaries values(318, "2012-05-27"); +insert into diaries values(319, "2012-05-28"); +insert into diaries values(320, "2012-05-29"); +insert into diaries values(321, "2012-05-30"); +insert into diaries values(322, "2012-05-31"); +insert into diaries values(323, "2012-06-01"); +insert into diaries values(324, "2012-06-02"); +insert into diaries values(325, "2012-06-03"); +insert into diaries values(326, "2012-06-04"); +insert into diaries values(327, "2012-06-05"); +insert into diaries values(328, "2012-06-06"); +insert into diaries values(329, "2012-06-07"); +insert into diaries values(330, "2012-06-08"); +insert into diaries values(331, "2012-06-09"); +insert into diaries values(332, "2012-06-10"); +insert into diaries values(333, "2012-06-11"); +insert into diaries values(334, "2012-06-12"); +insert into diaries values(335, "2012-06-13"); +insert into diaries values(336, "2012-06-14"); +insert into diaries values(337, "2012-06-15"); +insert into diaries values(338, "2012-06-16"); +insert into diaries values(339, "2012-06-17"); +insert into diaries values(340, "2012-06-18"); +insert into diaries values(341, "2012-06-19"); +insert into diaries values(342, "2012-06-20"); +insert into diaries values(343, "2012-06-21"); +insert into diaries values(344, "2012-06-22"); +insert into diaries values(345, "2012-06-23"); +insert into diaries values(346, "2012-06-24"); +insert into diaries values(347, "2012-06-25"); +insert into diaries values(348, "2012-06-26"); +insert into diaries values(349, "2012-06-27"); +insert into diaries values(350, "2012-06-28"); +insert into diaries values(351, "2012-06-29"); +insert into diaries values(352, "2012-06-30"); +insert into diaries values(353, "2012-07-01"); +insert into diaries values(354, "2012-07-02"); +insert into diaries values(355, "2012-07-03"); +insert into diaries values(356, "2012-07-04"); +insert into diaries values(357, "2012-07-05"); +insert into diaries values(358, "2012-07-06"); +insert into diaries values(359, "2012-07-07"); +insert into diaries values(360, "2012-07-08"); +insert into diaries values(361, "2012-07-09"); +insert into diaries values(362, "2012-07-10"); +insert into diaries values(363, "2012-07-11"); +insert into diaries values(364, "2012-07-12"); +insert into diaries values(365, "2012-07-13"); +insert into diaries values(366, "2012-07-14"); +insert into diaries values(367, "2012-07-15"); +insert into diaries values(368, "2012-07-16"); +insert into diaries values(369, "2012-07-17"); +insert into diaries values(370, "2012-07-18"); +insert into diaries values(371, "2012-07-19"); +insert into diaries values(372, "2012-07-20"); +insert into diaries values(373, "2012-07-21"); +insert into diaries values(374, "2012-07-22"); +insert into diaries values(375, "2012-07-23"); +insert into diaries values(376, "2012-07-24"); +insert into diaries values(377, "2012-07-25"); +insert into diaries values(378, "2012-07-26"); +insert into diaries values(379, "2012-07-27"); +insert into diaries values(380, "2012-07-28"); +insert into diaries values(381, "2012-07-29"); +insert into diaries values(382, "2012-07-30"); +insert into diaries values(383, "2012-07-31"); +insert into diaries values(384, "2012-08-01"); +insert into diaries values(385, "2012-08-02"); +insert into diaries values(386, "2012-08-03"); +insert into diaries values(387, "2012-08-04"); +insert into diaries values(388, "2012-08-05"); +insert into diaries values(389, "2012-08-06"); +insert into diaries values(390, "2012-08-07"); +insert into diaries values(391, "2012-08-08"); +insert into diaries values(392, "2012-08-09"); +insert into diaries values(393, "2012-08-10"); +insert into diaries values(394, "2012-08-11"); +insert into diaries values(395, "2012-08-12"); +insert into diaries values(396, "2012-08-13"); +insert into diaries values(397, "2012-08-14"); +insert into diaries values(398, "2012-08-15"); +insert into diaries values(399, "2012-08-16"); +insert into diaries values(400, "2012-08-17"); +insert into diaries values(401, "2012-08-18"); +insert into diaries values(402, "2012-08-19"); +insert into diaries values(403, "2012-08-20"); +insert into diaries values(404, "2012-08-21"); +insert into diaries values(405, "2012-08-22"); +insert into diaries values(406, "2012-08-23"); +insert into diaries values(407, "2012-08-24"); +insert into diaries values(408, "2012-08-25"); +insert into diaries values(409, "2012-08-26"); +insert into diaries values(410, "2012-08-27"); +insert into diaries values(411, "2012-08-28"); +insert into diaries values(412, "2012-08-29"); +insert into diaries values(413, "2012-08-30"); +insert into diaries values(414, "2012-08-31"); +insert into diaries values(415, "2012-09-01"); +insert into diaries values(416, "2012-09-02"); +insert into diaries values(417, "2012-09-03"); +insert into diaries values(418, "2012-09-04"); +insert into diaries values(419, "2012-09-05"); +insert into diaries values(420, "2012-09-06"); +insert into diaries values(421, "2012-09-07"); +insert into diaries values(422, "2012-09-08"); +insert into diaries values(423, "2012-09-09"); +insert into diaries values(424, "2012-09-10"); +insert into diaries values(425, "2012-09-11"); +insert into diaries values(426, "2012-09-12"); +insert into diaries values(427, "2012-09-13"); +insert into diaries values(428, "2012-09-14"); +insert into diaries values(429, "2012-09-15"); +insert into diaries values(430, "2012-09-16"); +insert into diaries values(431, "2012-09-17"); +insert into diaries values(432, "2012-09-18"); +insert into diaries values(433, "2012-09-19"); +insert into diaries values(434, "2012-09-20"); +insert into diaries values(435, "2012-09-21"); +insert into diaries values(436, "2012-09-22"); +insert into diaries values(437, "2012-09-23"); +insert into diaries values(438, "2012-09-24"); +insert into diaries values(439, "2012-09-25"); +insert into diaries values(440, "2012-09-26"); +insert into diaries values(441, "2012-09-27"); +insert into diaries values(442, "2012-09-28"); +insert into diaries values(443, "2012-09-29"); +insert into diaries values(444, "2012-09-30"); +insert into diaries values(445, "2012-10-01"); +insert into diaries values(446, "2012-10-02"); +insert into diaries values(447, "2012-10-03"); +insert into diaries values(448, "2012-10-04"); +insert into diaries values(449, "2012-10-05"); +insert into diaries values(450, "2012-10-06"); +insert into diaries values(451, "2012-10-07"); +insert into diaries values(452, "2012-10-08"); +insert into diaries values(453, "2012-10-09"); +insert into diaries values(454, "2012-10-10"); +insert into diaries values(455, "2012-10-11"); +insert into diaries values(456, "2012-10-12"); +insert into diaries values(457, "2012-10-13"); +insert into diaries values(458, "2012-10-14"); +insert into diaries values(459, "2012-10-15"); +insert into diaries values(460, "2012-10-16"); +insert into diaries values(461, "2012-10-17"); +insert into diaries values(462, "2012-10-18"); +insert into diaries values(463, "2012-10-19"); +insert into diaries values(464, "2012-10-20"); +insert into diaries values(465, "2012-10-21"); +insert into diaries values(466, "2012-10-22"); +insert into diaries values(467, "2012-10-23"); +insert into diaries values(468, "2012-10-24"); +insert into diaries values(469, "2012-10-25"); +insert into diaries values(470, "2012-10-26"); +insert into diaries values(471, "2012-10-27"); +insert into diaries values(472, "2012-10-28"); +insert into diaries values(473, "2012-10-29"); +insert into diaries values(474, "2012-10-30"); +insert into diaries values(475, "2012-10-31"); +insert into diaries values(476, "2012-11-01"); +insert into diaries values(477, "2012-11-02"); +insert into diaries values(478, "2012-11-03"); +insert into diaries values(479, "2012-11-04"); +insert into diaries values(480, "2012-11-05"); +insert into diaries values(481, "2012-11-06"); +insert into diaries values(482, "2012-11-07"); +insert into diaries values(483, "2012-11-08"); +insert into diaries values(484, "2012-11-09"); +insert into diaries values(485, "2012-11-10"); +insert into diaries values(486, "2012-11-11"); +insert into diaries values(487, "2012-11-12"); +insert into diaries values(488, "2012-11-13"); +insert into diaries values(489, "2012-11-14"); +insert into diaries values(490, "2012-11-15"); +insert into diaries values(491, "2012-11-16"); +insert into diaries values(492, "2012-11-17"); +insert into diaries values(493, "2012-11-18"); +insert into diaries values(494, "2012-11-19"); +insert into diaries values(495, "2012-11-20"); +insert into diaries values(496, "2012-11-21"); +insert into diaries values(497, "2012-11-22"); +insert into diaries values(498, "2012-11-23"); +insert into diaries values(499, "2012-11-24"); +insert into diaries values(500, "2012-11-25"); +insert into diaries values(501, "2012-11-26"); +insert into diaries values(502, "2012-11-27"); +insert into diaries values(503, "2012-11-28"); +insert into diaries values(504, "2012-11-29"); +insert into diaries values(505, "2012-11-30"); +insert into diaries values(506, "2012-12-01"); +insert into diaries values(507, "2012-12-02"); +insert into diaries values(508, "2012-12-03"); +insert into diaries values(509, "2012-12-04"); +insert into diaries values(510, "2012-12-05"); +insert into diaries values(511, "2012-12-06"); +insert into diaries values(512, "2012-12-07"); +insert into diaries values(513, "2012-12-08"); +insert into diaries values(514, "2012-12-09"); +insert into diaries values(515, "2012-12-10"); +insert into diaries values(516, "2012-12-11"); +insert into diaries values(517, "2012-12-12"); +insert into diaries values(518, "2012-12-13"); +insert into diaries values(519, "2012-12-14"); +insert into diaries values(520, "2012-12-15"); +insert into diaries values(521, "2012-12-16"); +insert into diaries values(522, "2012-12-17"); +insert into diaries values(523, "2012-12-18"); +insert into diaries values(524, "2012-12-19"); +insert into diaries values(525, "2012-12-20"); +insert into diaries values(526, "2012-12-21"); +insert into diaries values(527, "2012-12-22"); +insert into diaries values(528, "2012-12-23"); +insert into diaries values(529, "2012-12-24"); +insert into diaries values(530, "2012-12-25"); +insert into diaries values(531, "2012-12-26"); +insert into diaries values(532, "2012-12-27"); +insert into diaries values(533, "2012-12-28"); +insert into diaries values(534, "2012-12-29"); +insert into diaries values(535, "2012-12-30"); +insert into diaries values(536, "2012-12-31"); +insert into diaries values(537, "2013-01-01"); +insert into diaries values(538, "2013-01-02"); +insert into diaries values(539, "2013-01-03"); +insert into diaries values(540, "2013-01-04"); +insert into diaries values(541, "2013-01-05"); +insert into diaries values(542, "2013-01-06"); +insert into diaries values(543, "2013-01-07"); +insert into diaries values(544, "2013-01-08"); +insert into diaries values(545, "2013-01-09"); +insert into diaries values(546, "2013-01-10"); +insert into diaries values(547, "2013-01-11"); +insert into diaries values(548, "2013-01-12"); +insert into diaries values(549, "2013-01-13"); +insert into diaries values(550, "2013-01-14"); +insert into diaries values(551, "2013-01-15"); +insert into diaries values(552, "2013-01-16"); +insert into diaries values(553, "2013-01-17"); +insert into diaries values(554, "2013-01-18"); +insert into diaries values(555, "2013-01-19"); +insert into diaries values(556, "2013-01-20"); +insert into diaries values(557, "2013-01-21"); +insert into diaries values(558, "2013-01-22"); +insert into diaries values(559, "2013-01-23"); +insert into diaries values(560, "2013-01-24"); +insert into diaries values(561, "2013-01-25"); +insert into diaries values(562, "2013-01-26"); +insert into diaries values(563, "2013-01-27"); +insert into diaries values(564, "2013-01-28"); +insert into diaries values(565, "2013-01-29"); +insert into diaries values(566, "2013-01-30"); +insert into diaries values(567, "2013-01-31"); +insert into diaries values(568, "2013-02-01"); +insert into diaries values(569, "2013-02-02"); +insert into diaries values(570, "2013-02-03"); +insert into diaries values(571, "2013-02-04"); +insert into diaries values(572, "2013-02-05"); +insert into diaries values(573, "2013-02-06"); +insert into diaries values(574, "2013-02-07"); +insert into diaries values(575, "2013-02-08"); +insert into diaries values(576, "2013-02-09"); +insert into diaries values(577, "2013-02-10"); +insert into diaries values(578, "2013-02-11"); +insert into diaries values(579, "2013-02-12"); +insert into diaries values(580, "2013-02-13"); +insert into diaries values(581, "2013-02-14"); +insert into diaries values(582, "2013-02-15"); +insert into diaries values(583, "2013-02-16"); +insert into diaries values(584, "2013-02-17"); +insert into diaries values(585, "2013-02-18"); +insert into diaries values(586, "2013-02-19"); +insert into diaries values(587, "2013-02-20"); +insert into diaries values(588, "2013-02-21"); +insert into diaries values(589, "2013-02-22"); +insert into diaries values(590, "2013-02-23"); +insert into diaries values(591, "2013-02-24"); +insert into diaries values(592, "2013-02-25"); +insert into diaries values(593, "2013-02-26"); +insert into diaries values(594, "2013-02-27"); +insert into diaries values(595, "2013-02-28"); +insert into diaries values(596, "2013-03-01"); +insert into diaries values(597, "2013-03-02"); +insert into diaries values(598, "2013-03-03"); +insert into diaries values(599, "2013-03-04"); +insert into diaries values(600, "2013-03-05"); +insert into diaries values(601, "2013-03-06"); +insert into diaries values(602, "2013-03-07"); +insert into diaries values(603, "2013-03-08"); +insert into diaries values(604, "2013-03-09"); +insert into diaries values(605, "2013-03-10"); +insert into diaries values(606, "2013-03-11"); +insert into diaries values(607, "2013-03-12"); +insert into diaries values(608, "2013-03-13"); +insert into diaries values(609, "2013-03-14"); +insert into diaries values(610, "2013-03-15"); +insert into diaries values(611, "2013-03-16"); +insert into diaries values(612, "2013-03-17"); +insert into diaries values(613, "2013-03-18"); +insert into diaries values(614, "2013-03-19"); +insert into diaries values(615, "2013-03-20"); +insert into diaries values(616, "2013-03-21"); +insert into diaries values(617, "2013-03-22"); +insert into diaries values(618, "2013-03-23"); +insert into diaries values(619, "2013-03-24"); +insert into diaries values(620, "2013-03-25"); +insert into diaries values(621, "2013-03-26"); +insert into diaries values(622, "2013-03-27"); +insert into diaries values(623, "2013-03-28"); +insert into diaries values(624, "2013-03-29"); +insert into diaries values(625, "2013-03-30"); +insert into diaries values(626, "2013-03-31"); +insert into diaries values(627, "2013-04-01"); +insert into diaries values(628, "2013-04-02"); +insert into diaries values(629, "2013-04-03"); +insert into diaries values(630, "2013-04-04"); +insert into diaries values(631, "2013-04-05"); +insert into diaries values(632, "2013-04-06"); +insert into diaries values(633, "2013-04-07"); +insert into diaries values(634, "2013-04-08"); +insert into diaries values(635, "2013-04-09"); +insert into diaries values(636, "2013-04-10"); +insert into diaries values(637, "2013-04-11"); +insert into diaries values(638, "2013-04-12"); +insert into diaries values(639, "2013-04-13"); +insert into diaries values(640, "2013-04-14"); +insert into diaries values(641, "2013-04-15"); +insert into diaries values(642, "2013-04-16"); +insert into diaries values(643, "2013-04-17"); +insert into diaries values(644, "2013-04-18"); +insert into diaries values(645, "2013-04-19"); +insert into diaries values(646, "2013-04-20"); +insert into diaries values(647, "2013-04-21"); +insert into diaries values(648, "2013-04-22"); +insert into diaries values(649, "2013-04-23"); +insert into diaries values(650, "2013-04-24"); +insert into diaries values(651, "2013-04-25"); +insert into diaries values(652, "2013-04-26"); +insert into diaries values(653, "2013-04-27"); +insert into diaries values(654, "2013-04-28"); +insert into diaries values(655, "2013-04-29"); +insert into diaries values(656, "2013-04-30"); +insert into diaries values(657, "2013-05-01"); +insert into diaries values(658, "2013-05-02"); +insert into diaries values(659, "2013-05-03"); +insert into diaries values(660, "2013-05-04"); +insert into diaries values(661, "2013-05-05"); +insert into diaries values(662, "2013-05-06"); +insert into diaries values(663, "2013-05-07"); +insert into diaries values(664, "2013-05-08"); +insert into diaries values(665, "2013-05-09"); +insert into diaries values(666, "2013-05-10"); +insert into diaries values(667, "2013-05-11"); +insert into diaries values(668, "2013-05-12"); +insert into diaries values(669, "2013-05-13"); +insert into diaries values(670, "2013-05-14"); +insert into diaries values(671, "2013-05-15"); +insert into diaries values(672, "2013-05-16"); +insert into diaries values(673, "2013-05-17"); +insert into diaries values(674, "2013-05-18"); +insert into diaries values(675, "2013-05-19"); +insert into diaries values(676, "2013-05-20"); +insert into diaries values(677, "2013-05-21"); +insert into diaries values(678, "2013-05-22"); +insert into diaries values(679, "2013-05-23"); +insert into diaries values(680, "2013-05-24"); +insert into diaries values(681, "2013-05-25"); +insert into diaries values(682, "2013-05-26"); +insert into diaries values(683, "2013-05-27"); +insert into diaries values(684, "2013-05-28"); +insert into diaries values(685, "2013-05-29"); +insert into diaries values(686, "2013-05-30"); +insert into diaries values(687, "2013-05-31"); +insert into diaries values(688, "2013-06-01"); +insert into diaries values(689, "2013-06-02"); +insert into diaries values(690, "2013-06-03"); +insert into diaries values(691, "2013-06-04"); +insert into diaries values(692, "2013-06-05"); +insert into diaries values(693, "2013-06-06"); +insert into diaries values(694, "2013-06-07"); +insert into diaries values(695, "2013-06-08"); +insert into diaries values(696, "2013-06-09"); +insert into diaries values(697, "2013-06-10"); +insert into diaries values(698, "2013-06-11"); +insert into diaries values(699, "2013-06-12"); +insert into diaries values(700, "2013-06-13"); +insert into diaries values(701, "2013-06-14"); +insert into diaries values(702, "2013-06-15"); +insert into diaries values(703, "2013-06-16"); +insert into diaries values(704, "2013-06-17"); +insert into diaries values(705, "2013-06-18"); +insert into diaries values(706, "2013-06-19"); +insert into diaries values(707, "2013-06-20"); +insert into diaries values(708, "2013-06-21"); +insert into diaries values(709, "2013-06-22"); +insert into diaries values(710, "2013-06-23"); +insert into diaries values(711, "2013-06-24"); +insert into diaries values(712, "2013-06-25"); +insert into diaries values(713, "2013-06-26"); +insert into diaries values(714, "2013-06-27"); +insert into diaries values(715, "2013-06-28"); +insert into diaries values(716, "2013-06-29"); +insert into diaries values(717, "2013-06-30"); +insert into diaries values(718, "2013-07-01"); +insert into diaries values(719, "2013-07-02"); +insert into diaries values(720, "2013-07-03"); +insert into diaries values(721, "2013-07-04"); +insert into diaries values(722, "2013-07-05"); +insert into diaries values(723, "2013-07-06"); +insert into diaries values(724, "2013-07-07"); +insert into diaries values(725, "2013-07-08"); +insert into diaries values(726, "2013-07-09"); +insert into diaries values(727, "2013-07-10"); +insert into diaries values(728, "2013-07-11"); +insert into diaries values(729, "2013-07-12"); +insert into diaries values(730, "2013-07-13"); +insert into diaries values(731, "2013-07-14"); +insert into diaries values(732, "2013-07-15"); +insert into diaries values(733, "2013-07-16"); +insert into diaries values(734, "2013-07-17"); +insert into diaries values(735, "2013-07-18"); +insert into diaries values(736, "2013-07-19"); +insert into diaries values(737, "2013-07-20"); +insert into diaries values(738, "2013-07-21"); +insert into diaries values(739, "2013-07-22"); +insert into diaries values(740, "2013-07-23"); +insert into diaries values(741, "2013-07-24"); +insert into diaries values(742, "2013-07-25"); +insert into diaries values(743, "2013-07-26"); +insert into diaries values(744, "2013-07-27"); +insert into diaries values(745, "2013-07-28"); +insert into diaries values(746, "2013-07-29"); +insert into diaries values(747, "2013-07-30"); +insert into diaries values(748, "2013-07-31"); +insert into diaries values(749, "2013-08-01"); +insert into diaries values(750, "2013-08-02"); +insert into diaries values(751, "2013-08-03"); +insert into diaries values(752, "2013-08-04"); +insert into diaries values(753, "2013-08-05"); +insert into diaries values(754, "2013-08-06"); +insert into diaries values(755, "2013-08-07"); +insert into diaries values(756, "2013-08-08"); +insert into diaries values(757, "2013-08-09"); +insert into diaries values(758, "2013-08-10"); +insert into diaries values(759, "2013-08-11"); +insert into diaries values(760, "2013-08-12"); +insert into diaries values(761, "2013-08-13"); +insert into diaries values(762, "2013-08-14"); +insert into diaries values(763, "2013-08-15"); +insert into diaries values(764, "2013-08-16"); +insert into diaries values(765, "2013-08-17"); +insert into diaries values(766, "2013-08-18"); +insert into diaries values(767, "2013-08-19"); +insert into diaries values(768, "2013-08-20"); +insert into diaries values(769, "2013-08-21"); +insert into diaries values(770, "2013-08-22"); +insert into diaries values(771, "2013-08-23"); +insert into diaries values(772, "2013-08-24"); +insert into diaries values(773, "2013-08-25"); +insert into diaries values(774, "2013-08-26"); +insert into diaries values(775, "2013-08-27"); +insert into diaries values(776, "2013-08-28"); +insert into diaries values(777, "2013-08-29"); +insert into diaries values(778, "2013-08-30"); +insert into diaries values(779, "2013-08-31"); +insert into diaries values(780, "2013-09-01"); +insert into diaries values(781, "2013-09-02"); +insert into diaries values(782, "2013-09-03"); +insert into diaries values(783, "2013-09-04"); +insert into diaries values(784, "2013-09-05"); +insert into diaries values(785, "2013-09-06"); +insert into diaries values(786, "2013-09-07"); +insert into diaries values(787, "2013-09-08"); +insert into diaries values(788, "2013-09-09"); +insert into diaries values(789, "2013-09-10"); +insert into diaries values(790, "2013-09-11"); +insert into diaries values(791, "2013-09-12"); +insert into diaries values(792, "2013-09-13"); +insert into diaries values(793, "2013-09-14"); +insert into diaries values(794, "2013-09-15"); +insert into diaries values(795, "2013-09-16"); +insert into diaries values(796, "2013-09-17"); +insert into diaries values(797, "2013-09-18"); +insert into diaries values(798, "2013-09-19"); +insert into diaries values(799, "2013-09-20"); +insert into diaries values(800, "2013-09-21"); +insert into diaries values(801, "2013-09-22"); +insert into diaries values(802, "2013-09-23"); +insert into diaries values(803, "2013-09-24"); +insert into diaries values(804, "2013-09-25"); +insert into diaries values(805, "2013-09-26"); +insert into diaries values(806, "2013-09-27"); +insert into diaries values(807, "2013-09-28"); +insert into diaries values(808, "2013-09-29"); +insert into diaries values(809, "2013-09-30"); +insert into diaries values(810, "2013-10-01"); +insert into diaries values(811, "2013-10-02"); +insert into diaries values(812, "2013-10-03"); +insert into diaries values(813, "2013-10-04"); +insert into diaries values(814, "2013-10-05"); +insert into diaries values(815, "2013-10-06"); +insert into diaries values(816, "2013-10-07"); +insert into diaries values(817, "2013-10-08"); +insert into diaries values(818, "2013-10-09"); +insert into diaries values(819, "2013-10-10"); +insert into diaries values(820, "2013-10-11"); +insert into diaries values(821, "2013-10-12"); +insert into diaries values(822, "2013-10-13"); +insert into diaries values(823, "2013-10-14"); +insert into diaries values(824, "2013-10-15"); +insert into diaries values(825, "2013-10-16"); +insert into diaries values(826, "2013-10-17"); +insert into diaries values(827, "2013-10-18"); +insert into diaries values(828, "2013-10-19"); +insert into diaries values(829, "2013-10-20"); +insert into diaries values(830, "2013-10-21"); +insert into diaries values(831, "2013-10-22"); +insert into diaries values(832, "2013-10-23"); +insert into diaries values(833, "2013-10-24"); +insert into diaries values(834, "2013-10-25"); +insert into diaries values(835, "2013-10-26"); +insert into diaries values(836, "2013-10-27"); +insert into diaries values(837, "2013-10-28"); +insert into diaries values(838, "2013-10-29"); +insert into diaries values(839, "2013-10-30"); +insert into diaries values(840, "2013-10-31"); +insert into diaries values(841, "2013-11-01"); +insert into diaries values(842, "2013-11-02"); +insert into diaries values(843, "2013-11-03"); +insert into diaries values(844, "2013-11-04"); +insert into diaries values(845, "2013-11-05"); +insert into diaries values(846, "2013-11-06"); +insert into diaries values(847, "2013-11-07"); +insert into diaries values(848, "2013-11-08"); +insert into diaries values(849, "2013-11-09"); +insert into diaries values(850, "2013-11-10"); +insert into diaries values(851, "2013-11-11"); +insert into diaries values(852, "2013-11-12"); +insert into diaries values(853, "2013-11-13"); +insert into diaries values(854, "2013-11-14"); +insert into diaries values(855, "2013-11-15"); +insert into diaries values(856, "2013-11-16"); +insert into diaries values(857, "2013-11-17"); +insert into diaries values(858, "2013-11-18"); +insert into diaries values(859, "2013-11-19"); +insert into diaries values(860, "2013-11-20"); +insert into diaries values(861, "2013-11-21"); +insert into diaries values(862, "2013-11-22"); +insert into diaries values(863, "2013-11-23"); +insert into diaries values(864, "2013-11-24"); +insert into diaries values(865, "2013-11-25"); +insert into diaries values(866, "2013-11-26"); +insert into diaries values(867, "2013-11-27"); +insert into diaries values(868, "2013-11-28"); +insert into diaries values(869, "2013-11-29"); +insert into diaries values(870, "2013-11-30"); +insert into diaries values(871, "2013-12-01"); +insert into diaries values(872, "2013-12-02"); +insert into diaries values(873, "2013-12-03"); +insert into diaries values(874, "2013-12-04"); +insert into diaries values(875, "2013-12-05"); +insert into diaries values(876, "2013-12-06"); +insert into diaries values(877, "2013-12-07"); +insert into diaries values(878, "2013-12-08"); +insert into diaries values(879, "2013-12-09"); +insert into diaries values(880, "2013-12-10"); +insert into diaries values(881, "2013-12-11"); +insert into diaries values(882, "2013-12-12"); +insert into diaries values(883, "2013-12-13"); +insert into diaries values(884, "2013-12-14"); +insert into diaries values(885, "2013-12-15"); +insert into diaries values(886, "2013-12-16"); +insert into diaries values(887, "2013-12-17"); +insert into diaries values(888, "2013-12-18"); +insert into diaries values(889, "2013-12-19"); +insert into diaries values(890, "2013-12-20"); +insert into diaries values(891, "2013-12-21"); +insert into diaries values(892, "2013-12-22"); +insert into diaries values(893, "2013-12-23"); +insert into diaries values(894, "2013-12-24"); +insert into diaries values(895, "2013-12-25"); +insert into diaries values(896, "2013-12-26"); +insert into diaries values(897, "2013-12-27"); +insert into diaries values(898, "2013-12-28"); +insert into diaries values(899, "2013-12-29"); +insert into diaries values(900, "2013-12-30"); +insert into diaries values(901, "2013-12-31"); +insert into diaries values(902, "2014-01-01"); +insert into diaries values(903, "2014-01-02"); +insert into diaries values(904, "2014-01-03"); +insert into diaries values(905, "2014-01-04"); +insert into diaries values(906, "2014-01-05"); +insert into diaries values(907, "2014-01-06"); +insert into diaries values(908, "2014-01-07"); +insert into diaries values(909, "2014-01-08"); +insert into diaries values(910, "2014-01-09"); +insert into diaries values(911, "2014-01-10"); +insert into diaries values(912, "2014-01-11"); +insert into diaries values(913, "2014-01-12"); +insert into diaries values(914, "2014-01-13"); +insert into diaries values(915, "2014-01-14"); +insert into diaries values(916, "2014-01-15"); +insert into diaries values(917, "2014-01-16"); +insert into diaries values(918, "2014-01-17"); +insert into diaries values(919, "2014-01-18"); +insert into diaries values(920, "2014-01-19"); +insert into diaries values(921, "2014-01-20"); +insert into diaries values(922, "2014-01-21"); +insert into diaries values(923, "2014-01-22"); +insert into diaries values(924, "2014-01-23"); +insert into diaries values(925, "2014-01-24"); +insert into diaries values(926, "2014-01-25"); +insert into diaries values(927, "2014-01-26"); +insert into diaries values(928, "2014-01-27"); +insert into diaries values(929, "2014-01-28"); +insert into diaries values(930, "2014-01-29"); +insert into diaries values(931, "2014-01-30"); +insert into diaries values(932, "2014-01-31"); +insert into diaries values(933, "2014-02-01"); +insert into diaries values(934, "2014-02-02"); +insert into diaries values(935, "2014-02-03"); +insert into diaries values(936, "2014-02-04"); +insert into diaries values(937, "2014-02-05"); +insert into diaries values(938, "2014-02-06"); +insert into diaries values(939, "2014-02-07"); +insert into diaries values(940, "2014-02-08"); +insert into diaries values(941, "2014-02-09"); +insert into diaries values(942, "2014-02-10"); +insert into diaries values(943, "2014-02-11"); +insert into diaries values(944, "2014-02-12"); +insert into diaries values(945, "2014-02-13"); +insert into diaries values(946, "2014-02-14"); +insert into diaries values(947, "2014-02-15"); +insert into diaries values(948, "2014-02-16"); +insert into diaries values(949, "2014-02-17"); +insert into diaries values(950, "2014-02-18"); +insert into diaries values(951, "2014-02-19"); +insert into diaries values(952, "2014-02-20"); +insert into diaries values(953, "2014-02-21"); +insert into diaries values(954, "2014-02-22"); +insert into diaries values(955, "2014-02-23"); +insert into diaries values(956, "2014-02-24"); +insert into diaries values(957, "2014-02-25"); +insert into diaries values(958, "2014-02-26"); +insert into diaries values(959, "2014-02-27"); +insert into diaries values(960, "2014-02-28"); +insert into diaries values(961, "2014-03-01"); +insert into diaries values(962, "2014-03-02"); +insert into diaries values(963, "2014-03-03"); +insert into diaries values(964, "2014-03-04"); +insert into diaries values(965, "2014-03-05"); +insert into diaries values(966, "2014-03-06"); +insert into diaries values(967, "2014-03-07"); +insert into diaries values(968, "2014-03-08"); +insert into diaries values(969, "2014-03-09"); +insert into diaries values(970, "2014-03-10"); +insert into diaries values(971, "2014-03-11"); +insert into diaries values(972, "2014-03-12"); +insert into diaries values(973, "2014-03-13"); +insert into diaries values(974, "2014-03-14"); +insert into diaries values(975, "2014-03-15"); +insert into diaries values(976, "2014-03-16"); +insert into diaries values(977, "2014-03-17"); +insert into diaries values(978, "2014-03-18"); +insert into diaries values(979, "2014-03-19"); +insert into diaries values(980, "2014-03-20"); +insert into diaries values(981, "2014-03-21"); +insert into diaries values(982, "2014-03-22"); +insert into diaries values(983, "2014-03-23"); +insert into diaries values(984, "2014-03-24"); +insert into diaries values(985, "2014-03-25"); +insert into diaries values(986, "2014-03-26"); +insert into diaries values(987, "2014-03-27"); +insert into diaries values(988, "2014-03-28"); +insert into diaries values(989, "2014-03-29"); +insert into diaries values(990, "2014-03-30"); +insert into diaries values(991, "2014-03-31"); +insert into diaries values(992, "2014-04-01"); +insert into diaries values(993, "2014-04-02"); +insert into diaries values(994, "2014-04-03"); +insert into diaries values(995, "2014-04-04"); +insert into diaries values(996, "2014-04-05"); +insert into diaries values(997, "2014-04-06"); +insert into diaries values(998, "2014-04-07"); +insert into diaries values(999, "2014-04-08"); +insert into diaries values(1000, "2014-04-09"); +insert into diaries values(1001, "2014-04-10"); +insert into diaries values(1002, "2014-04-11"); +insert into diaries values(1003, "2014-04-12"); +insert into diaries values(1004, "2014-04-13"); +insert into diaries values(1005, "2014-04-14"); +insert into diaries values(1006, "2014-04-15"); +insert into diaries values(1007, "2014-04-16"); +insert into diaries values(1008, "2014-04-17"); +insert into diaries values(1009, "2014-04-18"); +insert into diaries values(1010, "2014-04-19"); +insert into diaries values(1011, "2014-04-20"); +insert into diaries values(1012, "2014-04-21"); +insert into diaries values(1013, "2014-04-22"); +insert into diaries values(1014, "2014-04-23"); +insert into diaries values(1015, "2014-04-24"); +insert into diaries values(1016, "2014-04-25"); +insert into diaries values(1017, "2014-04-26"); +insert into diaries values(1018, "2014-04-27"); +insert into diaries values(1019, "2014-04-28"); +insert into diaries values(1020, "2014-04-29"); +insert into diaries values(1021, "2014-04-30"); +insert into diaries values(1022, "2014-05-01"); +insert into diaries values(1023, "2014-05-02"); +insert into diaries values(1024, "2014-05-03"); +insert into diaries values(1025, "2014-05-04"); +insert into diaries values(1026, "2014-05-05"); +insert into diaries values(1027, "2014-05-06"); +insert into diaries values(1028, "2014-05-07"); +insert into diaries values(1029, "2014-05-08"); +insert into diaries values(1030, "2014-05-09"); +insert into diaries values(1031, "2014-05-10"); +insert into diaries values(1032, "2014-05-11"); +insert into diaries values(1033, "2014-05-12"); +insert into diaries values(1034, "2014-05-13"); +insert into diaries values(1035, "2014-05-14"); +insert into diaries values(1036, "2014-05-15"); +insert into diaries values(1037, "2014-05-16"); +insert into diaries values(1038, "2014-05-17"); +insert into diaries values(1039, "2014-05-18"); +insert into diaries values(1040, "2014-05-19"); +insert into diaries values(1041, "2014-05-20"); +insert into diaries values(1042, "2014-05-21"); +insert into diaries values(1043, "2014-05-22"); +insert into diaries values(1044, "2014-05-23"); +insert into diaries values(1045, "2014-05-24"); +insert into diaries values(1046, "2014-05-25"); +insert into diaries values(1047, "2014-05-26"); +insert into diaries values(1048, "2014-05-27"); +insert into diaries values(1049, "2014-05-28"); +insert into diaries values(1050, "2014-05-29"); +insert into diaries values(1051, "2014-05-30"); +insert into diaries values(1052, "2014-05-31"); +insert into diaries values(1053, "2014-06-01"); +insert into diaries values(1054, "2014-06-02"); +insert into diaries values(1055, "2014-06-03"); +insert into diaries values(1056, "2014-06-04"); +insert into diaries values(1057, "2014-06-05"); +insert into diaries values(1058, "2014-06-06"); +insert into diaries values(1059, "2014-06-07"); +insert into diaries values(1060, "2014-06-08"); +insert into diaries values(1061, "2014-06-09"); +insert into diaries values(1062, "2014-06-10"); +insert into diaries values(1063, "2014-06-11"); +insert into diaries values(1064, "2014-06-12"); +insert into diaries values(1065, "2014-06-13"); +insert into diaries values(1066, "2014-06-14"); +insert into diaries values(1067, "2014-06-15"); +insert into diaries values(1068, "2014-06-16"); +insert into diaries values(1069, "2014-06-17"); +insert into diaries values(1070, "2014-06-18"); +insert into diaries values(1071, "2014-06-19"); +insert into diaries values(1072, "2014-06-20"); +insert into diaries values(1073, "2014-06-21"); +insert into diaries values(1074, "2014-06-22"); +insert into diaries values(1075, "2014-06-23"); +insert into diaries values(1076, "2014-06-24"); +insert into diaries values(1077, "2014-06-25"); +insert into diaries values(1078, "2014-06-26"); +insert into diaries values(1079, "2014-06-27"); +insert into diaries values(1080, "2014-06-28"); +insert into diaries values(1081, "2014-06-29"); +insert into diaries values(1082, "2014-06-30"); +insert into diaries values(1083, "2014-07-01"); +insert into diaries values(1084, "2014-07-02"); +insert into diaries values(1085, "2014-07-03"); +insert into diaries values(1086, "2014-07-04"); +insert into diaries values(1087, "2014-07-05"); +insert into diaries values(1088, "2014-07-06"); +insert into diaries values(1089, "2014-07-07"); +insert into diaries values(1090, "2014-07-08"); +insert into diaries values(1091, "2014-07-09"); +insert into diaries values(1092, "2014-07-10"); +insert into diaries values(1093, "2014-07-11"); +insert into diaries values(1094, "2014-07-12"); +insert into diaries values(1095, "2014-07-13"); +insert into diaries values(1096, "2014-07-14"); +insert into diaries values(1097, "2014-07-15"); +insert into diaries values(1098, "2014-07-16"); +insert into diaries values(1099, "2014-07-17"); +insert into diaries values(1100, "2014-07-18"); +insert into diaries values(1101, "2014-07-19"); +insert into diaries values(1102, "2014-07-20"); +insert into diaries values(1103, "2014-07-21"); +insert into diaries values(1104, "2014-07-22"); +insert into diaries values(1105, "2014-07-23"); +insert into diaries values(1106, "2014-07-24"); +insert into diaries values(1107, "2014-07-25"); +insert into diaries values(1108, "2014-07-26"); +insert into diaries values(1109, "2014-07-27"); +insert into diaries values(1110, "2014-07-28"); +insert into diaries values(1111, "2014-07-29"); +insert into diaries values(1112, "2014-07-30"); +insert into diaries values(1113, "2014-07-31"); +insert into diaries values(1114, "2014-08-01"); +insert into diaries values(1115, "2014-08-02"); +insert into diaries values(1116, "2014-08-03"); +insert into diaries values(1117, "2014-08-04"); +insert into diaries values(1118, "2014-08-05"); +insert into diaries values(1119, "2014-08-06"); +insert into diaries values(1120, "2014-08-07"); +insert into diaries values(1121, "2014-08-08"); +insert into diaries values(1122, "2014-08-09"); +insert into diaries values(1123, "2014-08-10"); +insert into diaries values(1124, "2014-08-11"); +insert into diaries values(1125, "2014-08-12"); +insert into diaries values(1126, "2014-08-13"); +insert into diaries values(1127, "2014-08-14"); +insert into diaries values(1128, "2014-08-15"); +insert into diaries values(1129, "2014-08-16"); +insert into diaries values(1130, "2014-08-17"); +insert into diaries values(1131, "2014-08-18"); +insert into diaries values(1132, "2014-08-19"); +insert into diaries values(1133, "2014-08-20"); +insert into diaries values(1134, "2014-08-21"); +insert into diaries values(1135, "2014-08-22"); +insert into diaries values(1136, "2014-08-23"); +insert into diaries values(1137, "2014-08-24"); +insert into diaries values(1138, "2014-08-25"); +insert into diaries values(1139, "2014-08-26"); +insert into diaries values(1140, "2014-08-27"); +insert into diaries values(1141, "2014-08-28"); +insert into diaries values(1142, "2014-08-29"); +insert into diaries values(1143, "2014-08-30"); +insert into diaries values(1144, "2014-08-31"); +insert into diaries values(1145, "2014-09-01"); +insert into diaries values(1146, "2014-09-02"); +insert into diaries values(1147, "2014-09-03"); +insert into diaries values(1148, "2014-09-04"); +insert into diaries values(1149, "2014-09-05"); +insert into diaries values(1150, "2014-09-06"); +insert into diaries values(1151, "2014-09-07"); +insert into diaries values(1152, "2014-09-08"); +insert into diaries values(1153, "2014-09-09"); +insert into diaries values(1154, "2014-09-10"); +insert into diaries values(1155, "2014-09-11"); +insert into diaries values(1156, "2014-09-12"); +insert into diaries values(1157, "2014-09-13"); +insert into diaries values(1158, "2014-09-14"); +insert into diaries values(1159, "2014-09-15"); +insert into diaries values(1160, "2014-09-16"); +insert into diaries values(1161, "2014-09-17"); +insert into diaries values(1162, "2014-09-18"); +insert into diaries values(1163, "2014-09-19"); +insert into diaries values(1164, "2014-09-20"); +insert into diaries values(1165, "2014-09-21"); +insert into diaries values(1166, "2014-09-22"); +insert into diaries values(1167, "2014-09-23"); +insert into diaries values(1168, "2014-09-24"); +insert into diaries values(1169, "2014-09-25"); +insert into diaries values(1170, "2014-09-26"); +insert into diaries values(1171, "2014-09-27"); +insert into diaries values(1172, "2014-09-28"); +insert into diaries values(1173, "2014-09-29"); +insert into diaries values(1174, "2014-09-30"); +insert into diaries values(1175, "2014-10-01"); +insert into diaries values(1176, "2014-10-02"); +insert into diaries values(1177, "2014-10-03"); +insert into diaries values(1178, "2014-10-04"); +insert into diaries values(1179, "2014-10-05"); +insert into diaries values(1180, "2014-10-06"); +insert into diaries values(1181, "2014-10-07"); +insert into diaries values(1182, "2014-10-08"); +insert into diaries values(1183, "2014-10-09"); +insert into diaries values(1184, "2014-10-10"); +insert into diaries values(1185, "2014-10-11"); +insert into diaries values(1186, "2014-10-12"); +insert into diaries values(1187, "2014-10-13"); +insert into diaries values(1188, "2014-10-14"); +insert into diaries values(1189, "2014-10-15"); +insert into diaries values(1190, "2014-10-16"); +insert into diaries values(1191, "2014-10-17"); +insert into diaries values(1192, "2014-10-18"); +insert into diaries values(1193, "2014-10-19"); +insert into diaries values(1194, "2014-10-20"); +insert into diaries values(1195, "2014-10-21"); +insert into diaries values(1196, "2014-10-22"); +insert into diaries values(1197, "2014-10-23"); +insert into diaries values(1198, "2014-10-24"); +insert into diaries values(1199, "2014-10-25"); +insert into diaries values(1200, "2014-10-26"); +insert into diaries values(1201, "2014-10-27"); +insert into diaries values(1202, "2014-10-28"); +insert into diaries values(1203, "2014-10-29"); +insert into diaries values(1204, "2014-10-30"); +insert into diaries values(1205, "2014-10-31"); +insert into diaries values(1206, "2014-11-01"); +insert into diaries values(1207, "2014-11-02"); +insert into diaries values(1208, "2014-11-03"); +insert into diaries values(1209, "2014-11-04"); +insert into diaries values(1210, "2014-11-05"); +insert into diaries values(1211, "2014-11-06"); +insert into diaries values(1212, "2014-11-07"); +insert into diaries values(1213, "2014-11-08"); +insert into diaries values(1214, "2014-11-09"); +insert into diaries values(1215, "2014-11-10"); +insert into diaries values(1216, "2014-11-11"); +insert into diaries values(1217, "2014-11-12"); +insert into diaries values(1218, "2014-11-13"); +insert into diaries values(1219, "2014-11-14"); +insert into diaries values(1220, "2014-11-15"); +insert into diaries values(1221, "2014-11-16"); +insert into diaries values(1222, "2014-11-17"); +insert into diaries values(1223, "2014-11-18"); +insert into diaries values(1224, "2014-11-19"); +insert into diaries values(1225, "2014-11-20"); +insert into diaries values(1226, "2014-11-21"); +insert into diaries values(1227, "2014-11-22"); +insert into diaries values(1228, "2014-11-23"); +insert into diaries values(1229, "2014-11-24"); +insert into diaries values(1230, "2014-11-25"); +insert into diaries values(1231, "2014-11-26"); +insert into diaries values(1232, "2014-11-27"); +insert into diaries values(1233, "2014-11-28"); +insert into diaries values(1234, "2014-11-29"); +insert into diaries values(1235, "2014-11-30"); +insert into diaries values(1236, "2014-12-01"); +insert into diaries values(1237, "2014-12-02"); +insert into diaries values(1238, "2014-12-03"); +insert into diaries values(1239, "2014-12-04"); +insert into diaries values(1240, "2014-12-05"); +insert into diaries values(1241, "2014-12-06"); +insert into diaries values(1242, "2014-12-07"); +insert into diaries values(1243, "2014-12-08"); +insert into diaries values(1244, "2014-12-09"); +insert into diaries values(1245, "2014-12-10"); +insert into diaries values(1246, "2014-12-11"); +insert into diaries values(1247, "2014-12-12"); +insert into diaries values(1248, "2014-12-13"); +insert into diaries values(1249, "2014-12-14"); +insert into diaries values(1250, "2014-12-15"); +insert into diaries values(1251, "2014-12-16"); +insert into diaries values(1252, "2014-12-17"); +insert into diaries values(1253, "2014-12-18"); +insert into diaries values(1254, "2014-12-19"); +insert into diaries values(1255, "2014-12-20"); +insert into diaries values(1256, "2014-12-21"); +insert into diaries values(1257, "2014-12-22"); +insert into diaries values(1258, "2014-12-23"); +insert into diaries values(1259, "2014-12-24"); +insert into diaries values(1260, "2014-12-25"); +insert into diaries values(1261, "2014-12-26"); +insert into diaries values(1262, "2014-12-27"); +insert into diaries values(1263, "2014-12-28"); +insert into diaries values(1264, "2014-12-29"); +insert into diaries values(1265, "2014-12-30"); +insert into diaries values(1266, "2014-12-31"); +insert into diaries values(1267, "2015-01-01"); +insert into diaries values(1268, "2015-01-02"); +insert into diaries values(1269, "2015-01-03"); +insert into diaries values(1270, "2015-01-04"); +insert into diaries values(1271, "2015-01-05"); +insert into diaries values(1272, "2015-01-06"); +insert into diaries values(1273, "2015-01-07"); +insert into diaries values(1274, "2015-01-08"); +insert into diaries values(1275, "2015-01-09"); +insert into diaries values(1276, "2015-01-10"); +insert into diaries values(1277, "2015-01-11"); +insert into diaries values(1278, "2015-01-12"); +insert into diaries values(1279, "2015-01-13"); +insert into diaries values(1280, "2015-01-14"); +insert into diaries values(1281, "2015-01-15"); +insert into diaries values(1282, "2015-01-16"); +insert into diaries values(1283, "2015-01-17"); +insert into diaries values(1284, "2015-01-18"); +insert into diaries values(1285, "2015-01-19"); +insert into diaries values(1286, "2015-01-20"); +insert into diaries values(1287, "2015-01-21"); +insert into diaries values(1288, "2015-01-22"); +insert into diaries values(1289, "2015-01-23"); +insert into diaries values(1290, "2015-01-24"); +insert into diaries values(1291, "2015-01-25"); +insert into diaries values(1292, "2015-01-26"); +insert into diaries values(1293, "2015-01-27"); +insert into diaries values(1294, "2015-01-28"); +insert into diaries values(1295, "2015-01-29"); +insert into diaries values(1296, "2015-01-30"); +insert into diaries values(1297, "2015-01-31"); +insert into diaries values(1298, "2015-02-01"); +insert into diaries values(1299, "2015-02-02"); +insert into diaries values(1300, "2015-02-03"); +insert into diaries values(1301, "2015-02-04"); +insert into diaries values(1302, "2015-02-05"); +insert into diaries values(1303, "2015-02-06"); +insert into diaries values(1304, "2015-02-07"); +insert into diaries values(1305, "2015-02-08"); +insert into diaries values(1306, "2015-02-09"); +insert into diaries values(1307, "2015-02-10"); +insert into diaries values(1308, "2015-02-11"); +insert into diaries values(1309, "2015-02-12"); +insert into diaries values(1310, "2015-02-13"); +insert into diaries values(1311, "2015-02-14"); +insert into diaries values(1312, "2015-02-15"); +insert into diaries values(1313, "2015-02-16"); +insert into diaries values(1314, "2015-02-17"); +insert into diaries values(1315, "2015-02-18"); +insert into diaries values(1316, "2015-02-19"); +insert into diaries values(1317, "2015-02-20"); +insert into diaries values(1318, "2015-02-21"); +insert into diaries values(1319, "2015-02-22"); +insert into diaries values(1320, "2015-02-23"); +insert into diaries values(1321, "2015-02-24"); +insert into diaries values(1322, "2015-02-25"); +insert into diaries values(1323, "2015-02-26"); +insert into diaries values(1324, "2015-02-27"); +insert into diaries values(1325, "2015-02-28"); +insert into diaries values(1326, "2015-03-01"); +insert into diaries values(1327, "2015-03-02"); +insert into diaries values(1328, "2015-03-03"); +insert into diaries values(1329, "2015-03-04"); +insert into diaries values(1330, "2015-03-05"); +insert into diaries values(1331, "2015-03-06"); +insert into diaries values(1332, "2015-03-07"); +insert into diaries values(1333, "2015-03-08"); +insert into diaries values(1334, "2015-03-09"); +insert into diaries values(1335, "2015-03-10"); +insert into diaries values(1336, "2015-03-11"); +insert into diaries values(1337, "2015-03-12"); +insert into diaries values(1338, "2015-03-13"); +insert into diaries values(1339, "2015-03-14"); +insert into diaries values(1340, "2015-03-15"); +insert into diaries values(1341, "2015-03-16"); +insert into diaries values(1342, "2015-03-17"); +insert into diaries values(1343, "2015-03-18"); +insert into diaries values(1344, "2015-03-19"); +insert into diaries values(1345, "2015-03-20"); +insert into diaries values(1346, "2015-03-21"); +insert into diaries values(1347, "2015-03-22"); +insert into diaries values(1348, "2015-03-23"); +insert into diaries values(1349, "2015-03-24"); +insert into diaries values(1350, "2015-03-25"); +insert into diaries values(1351, "2015-03-26"); +insert into diaries values(1352, "2015-03-27"); +insert into diaries values(1353, "2015-03-28"); +insert into diaries values(1354, "2015-03-29"); +insert into diaries values(1355, "2015-03-30"); +insert into diaries values(1356, "2015-03-31"); +insert into diaries values(1357, "2015-04-01"); +insert into diaries values(1358, "2015-04-02"); +insert into diaries values(1359, "2015-04-03"); +insert into diaries values(1360, "2015-04-04"); +insert into diaries values(1361, "2015-04-05"); +insert into diaries values(1362, "2015-04-06"); +insert into diaries values(1363, "2015-04-07"); +insert into diaries values(1364, "2015-04-08"); +insert into diaries values(1365, "2015-04-09"); +insert into diaries values(1366, "2015-04-10"); +insert into diaries values(1367, "2015-04-11"); +insert into diaries values(1368, "2015-04-12"); +insert into diaries values(1369, "2015-04-13"); +insert into diaries values(1370, "2015-04-14"); +insert into diaries values(1371, "2015-04-15"); +insert into diaries values(1372, "2015-04-16"); +insert into diaries values(1373, "2015-04-17"); +insert into diaries values(1374, "2015-04-18"); +insert into diaries values(1375, "2015-04-19"); +insert into diaries values(1376, "2015-04-20"); +insert into diaries values(1377, "2015-04-21"); +insert into diaries values(1378, "2015-04-22"); +insert into diaries values(1379, "2015-04-23"); +insert into diaries values(1380, "2015-04-24"); +insert into diaries values(1381, "2015-04-25"); +insert into diaries values(1382, "2015-04-26"); +insert into diaries values(1383, "2015-04-27"); +insert into diaries values(1384, "2015-04-28"); +insert into diaries values(1385, "2015-04-29"); +insert into diaries values(1386, "2015-04-30"); +insert into diaries values(1387, "2015-05-01"); +insert into diaries values(1388, "2015-05-02"); +insert into diaries values(1389, "2015-05-03"); +insert into diaries values(1390, "2015-05-04"); +insert into diaries values(1391, "2015-05-05"); +insert into diaries values(1392, "2015-05-06"); +insert into diaries values(1393, "2015-05-07"); +insert into diaries values(1394, "2015-05-08"); +insert into diaries values(1395, "2015-05-09"); +insert into diaries values(1396, "2015-05-10"); +insert into diaries values(1397, "2015-05-11"); +insert into diaries values(1398, "2015-05-12"); +insert into diaries values(1399, "2015-05-13"); +insert into diaries values(1400, "2015-05-14"); +insert into diaries values(1401, "2015-05-15"); +insert into diaries values(1402, "2015-05-16"); +insert into diaries values(1403, "2015-05-17"); +insert into diaries values(1404, "2015-05-18"); +insert into diaries values(1405, "2015-05-19"); +insert into diaries values(1406, "2015-05-20"); +insert into diaries values(1407, "2015-05-21"); +insert into diaries values(1408, "2015-05-22"); +insert into diaries values(1409, "2015-05-23"); +insert into diaries values(1410, "2015-05-24"); +insert into diaries values(1411, "2015-05-25"); +insert into diaries values(1412, "2015-05-26"); +insert into diaries values(1413, "2015-05-27"); +insert into diaries values(1414, "2015-05-28"); +insert into diaries values(1415, "2015-05-29"); +insert into diaries values(1416, "2015-05-30"); +insert into diaries values(1417, "2015-05-31"); +insert into diaries values(1418, "2015-06-01"); +insert into diaries values(1419, "2015-06-02"); +insert into diaries values(1420, "2015-06-03"); +insert into diaries values(1421, "2015-06-04"); +insert into diaries values(1422, "2015-06-05"); +insert into diaries values(1423, "2015-06-06"); +insert into diaries values(1424, "2015-06-07"); +insert into diaries values(1425, "2015-06-08"); +insert into diaries values(1426, "2015-06-09"); +insert into diaries values(1427, "2015-06-10"); +insert into diaries values(1428, "2015-06-11"); +insert into diaries values(1429, "2015-06-12"); +insert into diaries values(1430, "2015-06-13"); +insert into diaries values(1431, "2015-06-14"); +insert into diaries values(1432, "2015-06-15"); +insert into diaries values(1433, "2015-06-16"); +insert into diaries values(1434, "2015-06-17"); +insert into diaries values(1435, "2015-06-18"); +insert into diaries values(1436, "2015-06-19"); +insert into diaries values(1437, "2015-06-20"); +insert into diaries values(1438, "2015-06-21"); +insert into diaries values(1439, "2015-06-22"); +insert into diaries values(1440, "2015-06-23"); +insert into diaries values(1441, "2015-06-24"); +insert into diaries values(1442, "2015-06-25"); +insert into diaries values(1443, "2015-06-26"); +insert into diaries values(1444, "2015-06-27"); +insert into diaries values(1445, "2015-06-28"); +insert into diaries values(1446, "2015-06-29"); +insert into diaries values(1447, "2015-06-30"); +insert into diaries values(1448, "2015-07-01"); +insert into diaries values(1449, "2015-07-02"); +insert into diaries values(1450, "2015-07-03"); +insert into diaries values(1451, "2015-07-04"); +insert into diaries values(1452, "2015-07-05"); +insert into diaries values(1453, "2015-07-06"); +insert into diaries values(1454, "2015-07-07"); +insert into diaries values(1455, "2015-07-08"); +insert into diaries values(1456, "2015-07-09"); +insert into diaries values(1457, "2015-07-10"); +insert into diaries values(1458, "2015-07-11"); +insert into diaries values(1459, "2015-07-12"); +insert into diaries values(1460, "2015-07-13"); +insert into diaries values(1461, "2015-07-14"); +insert into diaries values(1462, "2015-07-15"); +insert into diaries values(1463, "2015-07-16"); +insert into diaries values(1464, "2015-07-17"); +insert into diaries values(1465, "2015-07-18"); +insert into diaries values(1466, "2015-07-19"); +insert into diaries values(1467, "2015-07-20"); +insert into diaries values(1468, "2015-07-21"); +insert into diaries values(1469, "2015-07-22"); +insert into diaries values(1470, "2015-07-23"); +insert into diaries values(1471, "2015-07-24"); +insert into diaries values(1472, "2015-07-25"); +insert into diaries values(1473, "2015-07-26"); +insert into diaries values(1474, "2015-07-27"); +insert into diaries values(1475, "2015-07-28"); +insert into diaries values(1476, "2015-07-29"); +insert into diaries values(1477, "2015-07-30"); +insert into diaries values(1478, "2015-07-31"); +insert into diaries values(1479, "2015-08-01"); +insert into diaries values(1480, "2015-08-02"); +insert into diaries values(1481, "2015-08-03"); +insert into diaries values(1482, "2015-08-04"); +insert into diaries values(1483, "2015-08-05"); +insert into diaries values(1484, "2015-08-06"); +insert into diaries values(1485, "2015-08-07"); +insert into diaries values(1486, "2015-08-08"); +insert into diaries values(1487, "2015-08-09"); +insert into diaries values(1488, "2015-08-10"); +insert into diaries values(1489, "2015-08-11"); +insert into diaries values(1490, "2015-08-12"); +insert into diaries values(1491, "2015-08-13"); +insert into diaries values(1492, "2015-08-14"); +insert into diaries values(1493, "2015-08-15"); +insert into diaries values(1494, "2015-08-16"); +insert into diaries values(1495, "2015-08-17"); +insert into diaries values(1496, "2015-08-18"); +insert into diaries values(1497, "2015-08-19"); +insert into diaries values(1498, "2015-08-20"); +insert into diaries values(1499, "2015-08-21"); +insert into diaries values(1500, "2015-08-22"); +insert into diaries values(1501, "2015-08-23"); +insert into diaries values(1502, "2015-08-24"); +insert into diaries values(1503, "2015-08-25"); +insert into diaries values(1504, "2015-08-26"); +insert into diaries values(1505, "2015-08-27"); +insert into diaries values(1506, "2015-08-28"); +insert into diaries values(1507, "2015-08-29"); +insert into diaries values(1508, "2015-08-30"); +insert into diaries values(1509, "2015-08-31"); +insert into diaries values(1510, "2015-09-01"); +insert into diaries values(1511, "2015-09-02"); +insert into diaries values(1512, "2015-09-03"); +insert into diaries values(1513, "2015-09-04"); +insert into diaries values(1514, "2015-09-05"); +insert into diaries values(1515, "2015-09-06"); +insert into diaries values(1516, "2015-09-07"); +insert into diaries values(1517, "2015-09-08"); +insert into diaries values(1518, "2015-09-09"); +insert into diaries values(1519, "2015-09-10"); +insert into diaries values(1520, "2015-09-11"); +insert into diaries values(1521, "2015-09-12"); +insert into diaries values(1522, "2015-09-13"); +insert into diaries values(1523, "2015-09-14"); +insert into diaries values(1524, "2015-09-15"); +insert into diaries values(1525, "2015-09-16"); +insert into diaries values(1526, "2015-09-17"); +insert into diaries values(1527, "2015-09-18"); +insert into diaries values(1528, "2015-09-19"); +insert into diaries values(1529, "2015-09-20"); +insert into diaries values(1530, "2015-09-21"); +insert into diaries values(1531, "2015-09-22"); +insert into diaries values(1532, "2015-09-23"); +insert into diaries values(1533, "2015-09-24"); +insert into diaries values(1534, "2015-09-25"); +insert into diaries values(1535, "2015-09-26"); +insert into diaries values(1536, "2015-09-27"); +insert into diaries values(1537, "2015-09-28"); +insert into diaries values(1538, "2015-09-29"); +insert into diaries values(1539, "2015-09-30"); +insert into diaries values(1540, "2015-10-01"); +insert into diaries values(1541, "2015-10-02"); +insert into diaries values(1542, "2015-10-03"); +insert into diaries values(1543, "2015-10-04"); +insert into diaries values(1544, "2015-10-05"); +insert into diaries values(1545, "2015-10-06"); +insert into diaries values(1546, "2015-10-07"); +insert into diaries values(1547, "2015-10-08"); +insert into diaries values(1548, "2015-10-09"); +insert into diaries values(1549, "2015-10-10"); +insert into diaries values(1550, "2015-10-11"); +insert into diaries values(1551, "2015-10-12"); +insert into diaries values(1552, "2015-10-13"); +insert into diaries values(1553, "2015-10-14"); +insert into diaries values(1554, "2015-10-15"); +insert into diaries values(1555, "2015-10-16"); +insert into diaries values(1556, "2015-10-17"); +insert into diaries values(1557, "2015-10-18"); +insert into diaries values(1558, "2015-10-19"); +insert into diaries values(1559, "2015-10-20"); +insert into diaries values(1560, "2015-10-21"); +insert into diaries values(1561, "2015-10-22"); +insert into diaries values(1562, "2015-10-23"); +insert into diaries values(1563, "2015-10-24"); +insert into diaries values(1564, "2015-10-25"); +insert into diaries values(1565, "2015-10-26"); +insert into diaries values(1566, "2015-10-27"); +insert into diaries values(1567, "2015-10-28"); +insert into diaries values(1568, "2015-10-29"); +insert into diaries values(1569, "2015-10-30"); +insert into diaries values(1570, "2015-10-31"); +insert into diaries values(1571, "2015-11-01"); +insert into diaries values(1572, "2015-11-02"); +insert into diaries values(1573, "2015-11-03"); +insert into diaries values(1574, "2015-11-04"); +insert into diaries values(1575, "2015-11-05"); +insert into diaries values(1576, "2015-11-06"); +insert into diaries values(1577, "2015-11-07"); +insert into diaries values(1578, "2015-11-08"); +insert into diaries values(1579, "2015-11-09"); +insert into diaries values(1580, "2015-11-10"); +insert into diaries values(1581, "2015-11-11"); +insert into diaries values(1582, "2015-11-12"); +insert into diaries values(1583, "2015-11-13"); +insert into diaries values(1584, "2015-11-14"); +insert into diaries values(1585, "2015-11-15"); +insert into diaries values(1586, "2015-11-16"); +insert into diaries values(1587, "2015-11-17"); +insert into diaries values(1588, "2015-11-18"); +insert into diaries values(1589, "2015-11-19"); +insert into diaries values(1590, "2015-11-20"); +insert into diaries values(1591, "2015-11-21"); +insert into diaries values(1592, "2015-11-22"); +insert into diaries values(1593, "2015-11-23"); +insert into diaries values(1594, "2015-11-24"); +insert into diaries values(1595, "2015-11-25"); +insert into diaries values(1596, "2015-11-26"); +insert into diaries values(1597, "2015-11-27"); +insert into diaries values(1598, "2015-11-28"); +insert into diaries values(1599, "2015-11-29"); +insert into diaries values(1600, "2015-11-30"); +insert into diaries values(1601, "2015-12-01"); +insert into diaries values(1602, "2015-12-02"); +insert into diaries values(1603, "2015-12-03"); +insert into diaries values(1604, "2015-12-04"); +insert into diaries values(1605, "2015-12-05"); +insert into diaries values(1606, "2015-12-06"); +insert into diaries values(1607, "2015-12-07"); +insert into diaries values(1608, "2015-12-08"); +insert into diaries values(1609, "2015-12-09"); +insert into diaries values(1610, "2015-12-10"); +insert into diaries values(1611, "2015-12-11"); +insert into diaries values(1612, "2015-12-12"); +insert into diaries values(1613, "2015-12-13"); +insert into diaries values(1614, "2015-12-14"); +insert into diaries values(1615, "2015-12-15"); +insert into diaries values(1616, "2015-12-16"); +insert into diaries values(1617, "2015-12-17"); +insert into diaries values(1618, "2015-12-18"); +insert into diaries values(1619, "2015-12-19"); +insert into diaries values(1620, "2015-12-20"); +insert into diaries values(1621, "2015-12-21"); +insert into diaries values(1622, "2015-12-22"); +insert into diaries values(1623, "2015-12-23"); +insert into diaries values(1624, "2015-12-24"); +insert into diaries values(1625, "2015-12-25"); +insert into diaries values(1626, "2015-12-26"); +insert into diaries values(1627, "2015-12-27"); +insert into diaries values(1628, "2015-12-28"); +insert into diaries values(1629, "2015-12-29"); +insert into diaries values(1630, "2015-12-30"); +insert into diaries values(1631, "2015-12-31"); +insert into diaries values(1632, "2016-01-01"); +insert into diaries values(1633, "2016-01-02"); +insert into diaries values(1634, "2016-01-03"); +insert into diaries values(1635, "2016-01-04"); +insert into diaries values(1636, "2016-01-05"); +insert into diaries values(1637, "2016-01-06"); +insert into diaries values(1638, "2016-01-07"); +insert into diaries values(1639, "2016-01-08"); +insert into diaries values(1640, "2016-01-09"); +insert into diaries values(1641, "2016-01-10"); +insert into diaries values(1642, "2016-01-11"); +insert into diaries values(1643, "2016-01-12"); +insert into diaries values(1644, "2016-01-13"); +insert into diaries values(1645, "2016-01-14"); +insert into diaries values(1646, "2016-01-15"); +insert into diaries values(1647, "2016-01-16"); +insert into diaries values(1648, "2016-01-17"); +insert into diaries values(1649, "2016-01-18"); +insert into diaries values(1650, "2016-01-19"); +insert into diaries values(1651, "2016-01-20"); +insert into diaries values(1652, "2016-01-21"); +insert into diaries values(1653, "2016-01-22"); +insert into diaries values(1654, "2016-01-23"); +insert into diaries values(1655, "2016-01-24"); +insert into diaries values(1656, "2016-01-25"); +insert into diaries values(1657, "2016-01-26"); +insert into diaries values(1658, "2016-01-27"); +insert into diaries values(1659, "2016-01-28"); +insert into diaries values(1660, "2016-01-29"); +insert into diaries values(1661, "2016-01-30"); +insert into diaries values(1662, "2016-01-31"); +insert into diaries values(1663, "2016-02-01"); +insert into diaries values(1664, "2016-02-02"); +insert into diaries values(1665, "2016-02-03"); +insert into diaries values(1666, "2016-02-04"); +insert into diaries values(1667, "2016-02-05"); +insert into diaries values(1668, "2016-02-06"); +insert into diaries values(1669, "2016-02-07"); +insert into diaries values(1670, "2016-02-08"); +insert into diaries values(1671, "2016-02-09"); +insert into diaries values(1672, "2016-02-10"); +insert into diaries values(1673, "2016-02-11"); +insert into diaries values(1674, "2016-02-12"); +insert into diaries values(1675, "2016-02-13"); +insert into diaries values(1676, "2016-02-14"); +insert into diaries values(1677, "2016-02-15"); +insert into diaries values(1678, "2016-02-16"); +insert into diaries values(1679, "2016-02-17"); +insert into diaries values(1680, "2016-02-18"); +insert into diaries values(1681, "2016-02-19"); +insert into diaries values(1682, "2016-02-20"); +insert into diaries values(1683, "2016-02-21"); +insert into diaries values(1684, "2016-02-22"); +insert into diaries values(1685, "2016-02-23"); +insert into diaries values(1686, "2016-02-24"); +insert into diaries values(1687, "2016-02-25"); +insert into diaries values(1688, "2016-02-26"); +insert into diaries values(1689, "2016-02-27"); +insert into diaries values(1690, "2016-02-28"); +insert into diaries values(1691, "2016-02-29"); +insert into diaries values(1692, "2016-03-01"); +insert into diaries values(1693, "2016-03-02"); +insert into diaries values(1694, "2016-03-03"); +insert into diaries values(1695, "2016-03-04"); +insert into diaries values(1696, "2016-03-05"); +insert into diaries values(1697, "2016-03-06"); +insert into diaries values(1698, "2016-03-07"); +insert into diaries values(1699, "2016-03-08"); +insert into diaries values(1700, "2016-03-09"); +insert into diaries values(1701, "2016-03-10"); +insert into diaries values(1702, "2016-03-11"); +insert into diaries values(1703, "2016-03-12"); +insert into diaries values(1704, "2016-03-13"); +insert into diaries values(1705, "2016-03-14"); +insert into diaries values(1706, "2016-03-15"); +insert into diaries values(1707, "2016-03-16"); +insert into diaries values(1708, "2016-03-17"); +insert into diaries values(1709, "2016-03-18"); +insert into diaries values(1710, "2016-03-19"); +insert into diaries values(1711, "2016-03-20"); +insert into diaries values(1712, "2016-03-21"); +insert into diaries values(1713, "2016-03-22"); +insert into diaries values(1714, "2016-03-23"); +insert into diaries values(1715, "2016-03-24"); +insert into diaries values(1716, "2016-03-25"); +insert into diaries values(1717, "2016-03-26"); +insert into diaries values(1718, "2016-03-27"); +insert into diaries values(1719, "2016-03-28"); +insert into diaries values(1720, "2016-03-29"); +insert into diaries values(1721, "2016-03-30"); +insert into diaries values(1722, "2016-03-31"); +insert into diaries values(1723, "2016-04-01"); +insert into diaries values(1724, "2016-04-02"); +insert into diaries values(1725, "2016-04-03"); +insert into diaries values(1726, "2016-04-04"); +insert into diaries values(1727, "2016-04-05"); +insert into diaries values(1728, "2016-04-06"); +insert into diaries values(1729, "2016-04-07"); +insert into diaries values(1730, "2016-04-08"); +insert into diaries values(1731, "2016-04-09"); +insert into diaries values(1732, "2016-04-10"); +insert into diaries values(1733, "2016-04-11"); +insert into diaries values(1734, "2016-04-12"); +insert into diaries values(1735, "2016-04-13"); +insert into diaries values(1736, "2016-04-14"); +insert into diaries values(1737, "2016-04-15"); +insert into diaries values(1738, "2016-04-16"); +insert into diaries values(1739, "2016-04-17"); +insert into diaries values(1740, "2016-04-18"); +insert into diaries values(1741, "2016-04-19"); +insert into diaries values(1742, "2016-04-20"); +insert into diaries values(1743, "2016-04-21"); +insert into diaries values(1744, "2016-04-22"); +insert into diaries values(1745, "2016-04-23"); +insert into diaries values(1746, "2016-04-24"); +insert into diaries values(1747, "2016-04-25"); +insert into diaries values(1748, "2016-04-26"); +insert into diaries values(1749, "2016-04-27"); +insert into diaries values(1750, "2016-04-28"); +insert into diaries values(1751, "2016-04-29"); +insert into diaries values(1752, "2016-04-30"); +insert into diaries values(1753, "2016-05-01"); +insert into diaries values(1754, "2016-05-02"); +insert into diaries values(1755, "2016-05-03"); +insert into diaries values(1756, "2016-05-04"); +insert into diaries values(1757, "2016-05-05"); +insert into diaries values(1758, "2016-05-06"); +insert into diaries values(1759, "2016-05-07"); +insert into diaries values(1760, "2016-05-08"); +insert into diaries values(1761, "2016-05-09"); +insert into diaries values(1762, "2016-05-10"); +insert into diaries values(1763, "2016-05-11"); +insert into diaries values(1764, "2016-05-12"); +insert into diaries values(1765, "2016-05-13"); +insert into diaries values(1766, "2016-05-14"); +insert into diaries values(1767, "2016-05-15"); +insert into diaries values(1768, "2016-05-16"); +insert into diaries values(1769, "2016-05-17"); +insert into diaries values(1770, "2016-05-18"); +insert into diaries values(1771, "2016-05-19"); +insert into diaries values(1772, "2016-05-20"); +insert into diaries values(1773, "2016-05-21"); +insert into diaries values(1774, "2016-05-22"); +insert into diaries values(1775, "2016-05-23"); +insert into diaries values(1776, "2016-05-24"); +insert into diaries values(1777, "2016-05-25"); +insert into diaries values(1778, "2016-05-26"); +insert into diaries values(1779, "2016-05-27"); +insert into diaries values(1780, "2016-05-28"); +insert into diaries values(1781, "2016-05-29"); +insert into diaries values(1782, "2016-05-30"); +insert into diaries values(1783, "2016-05-31"); +insert into diaries values(1784, "2016-06-01"); +insert into diaries values(1785, "2016-06-02"); +insert into diaries values(1786, "2016-06-03"); +insert into diaries values(1787, "2016-06-04"); +insert into diaries values(1788, "2016-06-05"); +insert into diaries values(1789, "2016-06-06"); +insert into diaries values(1790, "2016-06-07"); +insert into diaries values(1791, "2016-06-08"); +insert into diaries values(1792, "2016-06-09"); +insert into diaries values(1793, "2016-06-10"); +insert into diaries values(1794, "2016-06-11"); +insert into diaries values(1795, "2016-06-12"); +insert into diaries values(1796, "2016-06-13"); +insert into diaries values(1797, "2016-06-14"); +insert into diaries values(1798, "2016-06-15"); +insert into diaries values(1799, "2016-06-16"); +insert into diaries values(1800, "2016-06-17"); +insert into diaries values(1801, "2016-06-18"); +insert into diaries values(1802, "2016-06-19"); +insert into diaries values(1803, "2016-06-20"); +insert into diaries values(1804, "2016-06-21"); +insert into diaries values(1805, "2016-06-22"); +insert into diaries values(1806, "2016-06-23"); +insert into diaries values(1807, "2016-06-24"); +insert into diaries values(1808, "2016-06-25"); +insert into diaries values(1809, "2016-06-26"); +insert into diaries values(1810, "2016-06-27"); +insert into diaries values(1811, "2016-06-28"); +insert into diaries values(1812, "2016-06-29"); +insert into diaries values(1813, "2016-06-30"); +insert into diaries values(1814, "2016-07-01"); +insert into diaries values(1815, "2016-07-02"); +insert into diaries values(1816, "2016-07-03"); +insert into diaries values(1817, "2016-07-04"); +insert into diaries values(1818, "2016-07-05"); +insert into diaries values(1819, "2016-07-06"); +insert into diaries values(1820, "2016-07-07"); +insert into diaries values(1821, "2016-07-08"); +insert into diaries values(1822, "2016-07-09"); +insert into diaries values(1823, "2016-07-10"); +insert into diaries values(1824, "2016-07-11"); +insert into diaries values(1825, "2016-07-12"); +insert into diaries values(1826, "2016-07-13"); +insert into diaries values(1827, "2016-07-14"); +insert into diaries values(1828, "2016-07-15"); +insert into diaries values(1829, "2016-07-16"); +insert into diaries values(1830, "2016-07-17"); +insert into diaries values(1831, "2016-07-18"); +insert into diaries values(1832, "2016-07-19"); +insert into diaries values(1833, "2016-07-20"); +insert into diaries values(1834, "2016-07-21"); +insert into diaries values(1835, "2016-07-22"); +insert into diaries values(1836, "2016-07-23"); +insert into diaries values(1837, "2016-07-24"); +insert into diaries values(1838, "2016-07-25"); +insert into diaries values(1839, "2016-07-26"); +insert into diaries values(1840, "2016-07-27"); +insert into diaries values(1841, "2016-07-28"); +insert into diaries values(1842, "2016-07-29"); +insert into diaries values(1843, "2016-07-30"); +insert into diaries values(1844, "2016-07-31"); +insert into diaries values(1845, "2016-08-01"); +insert into diaries values(1846, "2016-08-02"); +insert into diaries values(1847, "2016-08-03"); +insert into diaries values(1848, "2016-08-04"); +insert into diaries values(1849, "2016-08-05"); +insert into diaries values(1850, "2016-08-06"); +insert into diaries values(1851, "2016-08-07"); +insert into diaries values(1852, "2016-08-08"); +insert into diaries values(1853, "2016-08-09"); +insert into diaries values(1854, "2016-08-10"); +insert into diaries values(1855, "2016-08-11"); +insert into diaries values(1856, "2016-08-12"); +insert into diaries values(1857, "2016-08-13"); +insert into diaries values(1858, "2016-08-14"); +insert into diaries values(1859, "2016-08-15"); +insert into diaries values(1860, "2016-08-16"); +insert into diaries values(1861, "2016-08-17"); +insert into diaries values(1862, "2016-08-18"); +insert into diaries values(1863, "2016-08-19"); +insert into diaries values(1864, "2016-08-20"); +insert into diaries values(1865, "2016-08-21"); +insert into diaries values(1866, "2016-08-22"); +insert into diaries values(1867, "2016-08-23"); +insert into diaries values(1868, "2016-08-24"); +insert into diaries values(1869, "2016-08-25"); +insert into diaries values(1870, "2016-08-26"); +insert into diaries values(1871, "2016-08-27"); +insert into diaries values(1872, "2016-08-28"); +insert into diaries values(1873, "2016-08-29"); +insert into diaries values(1874, "2016-08-30"); +insert into diaries values(1875, "2016-08-31"); +insert into diaries values(1876, "2016-09-01"); +insert into diaries values(1877, "2016-09-02"); +insert into diaries values(1878, "2016-09-03"); +insert into diaries values(1879, "2016-09-04"); +insert into diaries values(1880, "2016-09-05"); +insert into diaries values(1881, "2016-09-06"); +insert into diaries values(1882, "2016-09-07"); +insert into diaries values(1883, "2016-09-08"); +insert into diaries values(1884, "2016-09-09"); +insert into diaries values(1885, "2016-09-10"); +insert into diaries values(1886, "2016-09-11"); +insert into diaries values(1887, "2016-09-12"); +insert into diaries values(1888, "2016-09-13"); +insert into diaries values(1889, "2016-09-14"); +insert into diaries values(1890, "2016-09-15"); +insert into diaries values(1891, "2016-09-16"); +insert into diaries values(1892, "2016-09-17"); +insert into diaries values(1893, "2016-09-18"); +insert into diaries values(1894, "2016-09-19"); +insert into diaries values(1895, "2016-09-20"); +insert into diaries values(1896, "2016-09-21"); +insert into diaries values(1897, "2016-09-22"); +insert into diaries values(1898, "2016-09-23"); +insert into diaries values(1899, "2016-09-24"); +insert into diaries values(1900, "2016-09-25"); +insert into diaries values(1901, "2016-09-26"); +insert into diaries values(1902, "2016-09-27"); +insert into diaries values(1903, "2016-09-28"); +insert into diaries values(1904, "2016-09-29"); +insert into diaries values(1905, "2016-09-30"); +insert into diaries values(1906, "2016-10-01"); +insert into diaries values(1907, "2016-10-02"); +insert into diaries values(1908, "2016-10-03"); +insert into diaries values(1909, "2016-10-04"); +insert into diaries values(1910, "2016-10-05"); +insert into diaries values(1911, "2016-10-06"); +insert into diaries values(1912, "2016-10-07"); +insert into diaries values(1913, "2016-10-08"); +insert into diaries values(1914, "2016-10-09"); +insert into diaries values(1915, "2016-10-10"); +insert into diaries values(1916, "2016-10-11"); +insert into diaries values(1917, "2016-10-12"); +insert into diaries values(1918, "2016-10-13"); +insert into diaries values(1919, "2016-10-14"); +insert into diaries values(1920, "2016-10-15"); +insert into diaries values(1921, "2016-10-16"); +insert into diaries values(1922, "2016-10-17"); +insert into diaries values(1923, "2016-10-18"); +insert into diaries values(1924, "2016-10-19"); +insert into diaries values(1925, "2016-10-20"); +insert into diaries values(1926, "2016-10-21"); +insert into diaries values(1927, "2016-10-22"); +insert into diaries values(1928, "2016-10-23"); +insert into diaries values(1929, "2016-10-24"); +insert into diaries values(1930, "2016-10-25"); +insert into diaries values(1931, "2016-10-26"); +insert into diaries values(1932, "2016-10-27"); +insert into diaries values(1933, "2016-10-28"); +insert into diaries values(1934, "2016-10-29"); +insert into diaries values(1935, "2016-10-30"); +insert into diaries values(1936, "2016-10-31"); +insert into diaries values(1937, "2016-11-01"); +insert into diaries values(1938, "2016-11-02"); +insert into diaries values(1939, "2016-11-03"); +insert into diaries values(1940, "2016-11-04"); +insert into diaries values(1941, "2016-11-05"); +insert into diaries values(1942, "2016-11-06"); +insert into diaries values(1943, "2016-11-07"); +insert into diaries values(1944, "2016-11-08"); +insert into diaries values(1945, "2016-11-09"); +insert into diaries values(1946, "2016-11-10"); +insert into diaries values(1947, "2016-11-11"); +insert into diaries values(1948, "2016-11-12"); +insert into diaries values(1949, "2016-11-13"); +insert into diaries values(1950, "2016-11-14"); +insert into diaries values(1951, "2016-11-15"); +insert into diaries values(1952, "2016-11-16"); +insert into diaries values(1953, "2016-11-17"); +insert into diaries values(1954, "2016-11-18"); +insert into diaries values(1955, "2016-11-19"); +insert into diaries values(1956, "2016-11-20"); +insert into diaries values(1957, "2016-11-21"); +insert into diaries values(1958, "2016-11-22"); +insert into diaries values(1959, "2016-11-23"); +insert into diaries values(1960, "2016-11-24"); +insert into diaries values(1961, "2016-11-25"); +insert into diaries values(1962, "2016-11-26"); +insert into diaries values(1963, "2016-11-27"); +insert into diaries values(1964, "2016-11-28"); +insert into diaries values(1965, "2016-11-29"); +insert into diaries values(1966, "2016-11-30"); +insert into diaries values(1967, "2016-12-01"); +insert into diaries values(1968, "2016-12-02"); +insert into diaries values(1969, "2016-12-03"); +insert into diaries values(1970, "2016-12-04"); +insert into diaries values(1971, "2016-12-05"); +insert into diaries values(1972, "2016-12-06"); +insert into diaries values(1973, "2016-12-07"); +insert into diaries values(1974, "2016-12-08"); +insert into diaries values(1975, "2016-12-09"); +insert into diaries values(1976, "2016-12-10"); +insert into diaries values(1977, "2016-12-11"); +insert into diaries values(1978, "2016-12-12"); +insert into diaries values(1979, "2016-12-13"); +insert into diaries values(1980, "2016-12-14"); +insert into diaries values(1981, "2016-12-15"); +insert into diaries values(1982, "2016-12-16"); +insert into diaries values(1983, "2016-12-17"); +insert into diaries values(1984, "2016-12-18"); +insert into diaries values(1985, "2016-12-19"); +insert into diaries values(1986, "2016-12-20"); +insert into diaries values(1987, "2016-12-21"); +insert into diaries values(1988, "2016-12-22"); +insert into diaries values(1989, "2016-12-23"); +insert into diaries values(1990, "2016-12-24"); +insert into diaries values(1991, "2016-12-25"); +insert into diaries values(1992, "2016-12-26"); +insert into diaries values(1993, "2016-12-27"); +insert into diaries values(1994, "2016-12-28"); +insert into diaries values(1995, "2016-12-29"); +insert into diaries values(1996, "2016-12-30"); +insert into diaries values(1997, "2016-12-31"); +insert into diaries values(1998, "2017-01-01"); +insert into diaries values(1999, "2017-01-02"); +insert into diaries values(2000, "2017-01-03"); +insert into diaries values(2001, "2017-01-04"); +insert into diaries values(2002, "2017-01-05"); +insert into diaries values(2003, "2017-01-06"); +insert into diaries values(2004, "2017-01-07"); +insert into diaries values(2005, "2017-01-08"); +insert into diaries values(2006, "2017-01-09"); +insert into diaries values(2007, "2017-01-10"); +insert into diaries values(2008, "2017-01-11"); +insert into diaries values(2009, "2017-01-12"); +insert into diaries values(2010, "2017-01-13"); +insert into diaries values(2011, "2017-01-14"); +insert into diaries values(2012, "2017-01-15"); +insert into diaries values(2013, "2017-01-16"); +insert into diaries values(2014, "2017-01-17"); +insert into diaries values(2015, "2017-01-18"); +insert into diaries values(2016, "2017-01-19"); +insert into diaries values(2017, "2017-01-20"); +insert into diaries values(2018, "2017-01-21"); +insert into diaries values(2019, "2017-01-22"); +insert into diaries values(2020, "2017-01-23"); +insert into diaries values(2021, "2017-01-24"); +insert into diaries values(2022, "2017-01-25"); +insert into diaries values(2023, "2017-01-26"); +insert into diaries values(2024, "2017-01-27"); +insert into diaries values(2025, "2017-01-28"); +insert into diaries values(2026, "2017-01-29"); +insert into diaries values(2027, "2017-01-30"); +insert into diaries values(2028, "2017-01-31"); +insert into diaries values(2029, "2017-02-01"); +insert into diaries values(2030, "2017-02-02"); +insert into diaries values(2031, "2017-02-03"); +insert into diaries values(2032, "2017-02-04"); +insert into diaries values(2033, "2017-02-05"); +insert into diaries values(2034, "2017-02-06"); +insert into diaries values(2035, "2017-02-07"); +insert into diaries values(2036, "2017-02-08"); +insert into diaries values(2037, "2017-02-09"); +insert into diaries values(2038, "2017-02-10"); +insert into diaries values(2039, "2017-02-11"); +insert into diaries values(2040, "2017-02-12"); +insert into diaries values(2041, "2017-02-13"); +insert into diaries values(2042, "2017-02-14"); +insert into diaries values(2043, "2017-02-15"); +insert into diaries values(2044, "2017-02-16"); +insert into diaries values(2045, "2017-02-17"); +insert into diaries values(2046, "2017-02-18"); +insert into diaries values(2047, "2017-02-19"); +insert into diaries values(2048, "2017-02-20"); +insert into diaries values(2049, "2017-02-21"); +insert into diaries values(2050, "2017-02-22"); +insert into diaries values(2051, "2017-02-23"); +insert into diaries values(2052, "2017-02-24"); +insert into diaries values(2053, "2017-02-25"); +insert into diaries values(2054, "2017-02-26"); +insert into diaries values(2055, "2017-02-27"); +insert into diaries values(2056, "2017-02-28"); +insert into diaries values(2057, "2017-03-01"); +insert into diaries values(2058, "2017-03-02"); +insert into diaries values(2059, "2017-03-03"); +insert into diaries values(2060, "2017-03-04"); +insert into diaries values(2061, "2017-03-05"); +insert into diaries values(2062, "2017-03-06"); +insert into diaries values(2063, "2017-03-07"); +insert into diaries values(2064, "2017-03-08"); +insert into diaries values(2065, "2017-03-09"); +insert into diaries values(2066, "2017-03-10"); +insert into diaries values(2067, "2017-03-11"); +insert into diaries values(2068, "2017-03-12"); +insert into diaries values(2069, "2017-03-13"); +insert into diaries values(2070, "2017-03-14"); +insert into diaries values(2071, "2017-03-15"); +insert into diaries values(2072, "2017-03-16"); +insert into diaries values(2073, "2017-03-17"); +insert into diaries values(2074, "2017-03-18"); +insert into diaries values(2075, "2017-03-19"); +insert into diaries values(2076, "2017-03-20"); +insert into diaries values(2077, "2017-03-21"); +insert into diaries values(2078, "2017-03-22"); +insert into diaries values(2079, "2017-03-23"); +insert into diaries values(2080, "2017-03-24"); +insert into diaries values(2081, "2017-03-25"); +insert into diaries values(2082, "2017-03-26"); +insert into diaries values(2083, "2017-03-27"); +insert into diaries values(2084, "2017-03-28"); +insert into diaries values(2085, "2017-03-29"); +insert into diaries values(2086, "2017-03-30"); +insert into diaries values(2087, "2017-03-31"); +insert into diaries values(2088, "2017-04-01"); +insert into diaries values(2089, "2017-04-02"); +insert into diaries values(2090, "2017-04-03"); +insert into diaries values(2091, "2017-04-04"); +insert into diaries values(2092, "2017-04-05"); +insert into diaries values(2093, "2017-04-06"); +insert into diaries values(2094, "2017-04-07"); +insert into diaries values(2095, "2017-04-08"); +insert into diaries values(2096, "2017-04-09"); +insert into diaries values(2097, "2017-04-10"); +insert into diaries values(2098, "2017-04-11"); +insert into diaries values(2099, "2017-04-12"); +insert into diaries values(2100, "2017-04-13"); +insert into diaries values(2101, "2017-04-14"); +insert into diaries values(2102, "2017-04-15"); +insert into diaries values(2103, "2017-04-16"); +insert into diaries values(2104, "2017-04-17"); +insert into diaries values(2105, "2017-04-18"); +insert into diaries values(2106, "2017-04-19"); +insert into diaries values(2107, "2017-04-20"); +insert into diaries values(2108, "2017-04-21"); +insert into diaries values(2109, "2017-04-22"); +insert into diaries values(2110, "2017-04-23"); +insert into diaries values(2111, "2017-04-24"); +insert into diaries values(2112, "2017-04-25"); +insert into diaries values(2113, "2017-04-26"); +insert into diaries values(2114, "2017-04-27"); +insert into diaries values(2115, "2017-04-28"); +insert into diaries values(2116, "2017-04-29"); +insert into diaries values(2117, "2017-04-30"); +insert into diaries values(2118, "2017-05-01"); +insert into diaries values(2119, "2017-05-02"); +insert into diaries values(2120, "2017-05-03"); +insert into diaries values(2121, "2017-05-04"); +insert into diaries values(2122, "2017-05-05"); +insert into diaries values(2123, "2017-05-06"); +insert into diaries values(2124, "2017-05-07"); +insert into diaries values(2125, "2017-05-08"); +insert into diaries values(2126, "2017-05-09"); +insert into diaries values(2127, "2017-05-10"); +insert into diaries values(2128, "2017-05-11"); +insert into diaries values(2129, "2017-05-12"); +insert into diaries values(2130, "2017-05-13"); +insert into diaries values(2131, "2017-05-14"); +insert into diaries values(2132, "2017-05-15"); +insert into diaries values(2133, "2017-05-16"); +insert into diaries values(2134, "2017-05-17"); +insert into diaries values(2135, "2017-05-18"); +insert into diaries values(2136, "2017-05-19"); +insert into diaries values(2137, "2017-05-20"); +insert into diaries values(2138, "2017-05-21"); +insert into diaries values(2139, "2017-05-22"); +insert into diaries values(2140, "2017-05-23"); +insert into diaries values(2141, "2017-05-24"); +insert into diaries values(2142, "2017-05-25"); +insert into diaries values(2143, "2017-05-26"); +insert into diaries values(2144, "2017-05-27"); +insert into diaries values(2145, "2017-05-28"); +insert into diaries values(2146, "2017-05-29"); +insert into diaries values(2147, "2017-05-30"); +insert into diaries values(2148, "2017-05-31"); +insert into diaries values(2149, "2017-06-01"); +insert into diaries values(2150, "2017-06-02"); +insert into diaries values(2151, "2017-06-03"); +insert into diaries values(2152, "2017-06-04"); +insert into diaries values(2153, "2017-06-05"); +insert into diaries values(2154, "2017-06-06"); +insert into diaries values(2155, "2017-06-07"); +insert into diaries values(2156, "2017-06-08"); +insert into diaries values(2157, "2017-06-09"); +insert into diaries values(2158, "2017-06-10"); +insert into diaries values(2159, "2017-06-11"); +insert into diaries values(2160, "2017-06-12"); +insert into diaries values(2161, "2017-06-13"); +insert into diaries values(2162, "2017-06-14"); +insert into diaries values(2163, "2017-06-15"); +insert into diaries values(2164, "2017-06-16"); +insert into diaries values(2165, "2017-06-17"); +insert into diaries values(2166, "2017-06-18"); +insert into diaries values(2167, "2017-06-19"); +insert into diaries values(2168, "2017-06-20"); +insert into diaries values(2169, "2017-06-21"); +insert into diaries values(2170, "2017-06-22"); +insert into diaries values(2171, "2017-06-23"); +insert into diaries values(2172, "2017-06-24"); +insert into diaries values(2173, "2017-06-25"); +insert into diaries values(2174, "2017-06-26"); +insert into diaries values(2175, "2017-06-27"); +insert into diaries values(2176, "2017-06-28"); +insert into diaries values(2177, "2017-06-29"); +insert into diaries values(2178, "2017-06-30"); +insert into diaries values(2179, "2017-07-01"); +insert into diaries values(2180, "2017-07-02"); +insert into diaries values(2181, "2017-07-03"); +insert into diaries values(2182, "2017-07-04"); +insert into diaries values(2183, "2017-07-05"); +insert into diaries values(2184, "2017-07-06"); +insert into diaries values(2185, "2017-07-07"); +insert into diaries values(2186, "2017-07-08"); +insert into diaries values(2187, "2017-07-09"); +insert into diaries values(2188, "2017-07-10"); +insert into diaries values(2189, "2017-07-11"); +insert into diaries values(2190, "2017-07-12"); +insert into diaries values(2191, "2017-07-13"); +insert into diaries values(2192, "2017-07-14"); +insert into diaries values(2193, "2017-07-15"); +insert into diaries values(2194, "2017-07-16"); +insert into diaries values(2195, "2017-07-17"); +insert into diaries values(2196, "2017-07-18"); +insert into diaries values(2197, "2017-07-19"); +insert into diaries values(2198, "2017-07-20"); +insert into diaries values(2199, "2017-07-21"); +insert into diaries values(2200, "2017-07-22"); +insert into diaries values(2201, "2017-07-23"); +insert into diaries values(2202, "2017-07-24"); +insert into diaries values(2203, "2017-07-25"); +insert into diaries values(2204, "2017-07-26"); +insert into diaries values(2205, "2017-07-27"); +insert into diaries values(2206, "2017-07-28"); +insert into diaries values(2207, "2017-07-29"); +insert into diaries values(2208, "2017-07-30"); +insert into diaries values(2209, "2017-07-31"); +insert into diaries values(2210, "2017-08-01"); +insert into diaries values(2211, "2017-08-02"); +insert into diaries values(2212, "2017-08-03"); +insert into diaries values(2213, "2017-08-04"); +insert into diaries values(2214, "2017-08-05"); +insert into diaries values(2215, "2017-08-06"); +insert into diaries values(2216, "2017-08-07"); +insert into diaries values(2217, "2017-08-08"); +insert into diaries values(2218, "2017-08-09"); +insert into diaries values(2219, "2017-08-10"); +insert into diaries values(2220, "2017-08-11"); +insert into diaries values(2221, "2017-08-12"); +insert into diaries values(2222, "2017-08-13"); +insert into diaries values(2223, "2017-08-14"); +insert into diaries values(2224, "2017-08-15"); +insert into diaries values(2225, "2017-08-16"); +insert into diaries values(2226, "2017-08-17"); +insert into diaries values(2227, "2017-08-18"); +insert into diaries values(2228, "2017-08-19"); +insert into diaries values(2229, "2017-08-20"); +insert into diaries values(2230, "2017-08-21"); +insert into diaries values(2231, "2017-08-22"); +insert into diaries values(2232, "2017-08-23"); +insert into diaries values(2233, "2017-08-24"); +insert into diaries values(2234, "2017-08-25"); +insert into diaries values(2235, "2017-08-26"); +insert into diaries values(2236, "2017-08-27"); +insert into diaries values(2237, "2017-08-28"); +insert into diaries values(2238, "2017-08-29"); +insert into diaries values(2239, "2017-08-30"); +insert into diaries values(2240, "2017-08-31"); +insert into diaries values(2241, "2017-09-01"); +insert into diaries values(2242, "2017-09-02"); +insert into diaries values(2243, "2017-09-03"); +insert into diaries values(2244, "2017-09-04"); +insert into diaries values(2245, "2017-09-05"); +insert into diaries values(2246, "2017-09-06"); +insert into diaries values(2247, "2017-09-07"); +insert into diaries values(2248, "2017-09-08"); +insert into diaries values(2249, "2017-09-09"); +insert into diaries values(2250, "2017-09-10"); +insert into diaries values(2251, "2017-09-11"); +insert into diaries values(2252, "2017-09-12"); +insert into diaries values(2253, "2017-09-13"); +insert into diaries values(2254, "2017-09-14"); +insert into diaries values(2255, "2017-09-15"); +insert into diaries values(2256, "2017-09-16"); +insert into diaries values(2257, "2017-09-17"); +insert into diaries values(2258, "2017-09-18"); +insert into diaries values(2259, "2017-09-19"); +insert into diaries values(2260, "2017-09-20"); +insert into diaries values(2261, "2017-09-21"); +insert into diaries values(2262, "2017-09-22"); +insert into diaries values(2263, "2017-09-23"); +insert into diaries values(2264, "2017-09-24"); +insert into diaries values(2265, "2017-09-25"); +insert into diaries values(2266, "2017-09-26"); +insert into diaries values(2267, "2017-09-27"); +insert into diaries values(2268, "2017-09-28"); +insert into diaries values(2269, "2017-09-29"); +insert into diaries values(2270, "2017-09-30"); +insert into diaries values(2271, "2017-10-01"); +insert into diaries values(2272, "2017-10-02"); +insert into diaries values(2273, "2017-10-03"); +insert into diaries values(2274, "2017-10-04"); +insert into diaries values(2275, "2017-10-05"); +insert into diaries values(2276, "2017-10-06"); +insert into diaries values(2277, "2017-10-07"); +insert into diaries values(2278, "2017-10-08"); +insert into diaries values(2279, "2017-10-09"); +insert into diaries values(2280, "2017-10-10"); +insert into diaries values(2281, "2017-10-11"); +insert into diaries values(2282, "2017-10-12"); +insert into diaries values(2283, "2017-10-13"); +insert into diaries values(2284, "2017-10-14"); +insert into diaries values(2285, "2017-10-15"); +insert into diaries values(2286, "2017-10-16"); +insert into diaries values(2287, "2017-10-17"); +insert into diaries values(2288, "2017-10-18"); +insert into diaries values(2289, "2017-10-19"); +insert into diaries values(2290, "2017-10-20"); +insert into diaries values(2291, "2017-10-21"); +insert into diaries values(2292, "2017-10-22"); +insert into diaries values(2293, "2017-10-23"); +insert into diaries values(2294, "2017-10-24"); +insert into diaries values(2295, "2017-10-25"); +insert into diaries values(2296, "2017-10-26"); +insert into diaries values(2297, "2017-10-27"); +insert into diaries values(2298, "2017-10-28"); +insert into diaries values(2299, "2017-10-29"); +insert into diaries values(2300, "2017-10-30"); +insert into diaries values(2301, "2017-10-31"); +insert into diaries values(2302, "2017-11-01"); +insert into diaries values(2303, "2017-11-02"); +insert into diaries values(2304, "2017-11-03"); +insert into diaries values(2305, "2017-11-04"); +insert into diaries values(2306, "2017-11-05"); +insert into diaries values(2307, "2017-11-06"); +insert into diaries values(2308, "2017-11-07"); +insert into diaries values(2309, "2017-11-08"); +insert into diaries values(2310, "2017-11-09"); +insert into diaries values(2311, "2017-11-10"); +insert into diaries values(2312, "2017-11-11"); +insert into diaries values(2313, "2017-11-12"); +insert into diaries values(2314, "2017-11-13"); +insert into diaries values(2315, "2017-11-14"); +insert into diaries values(2316, "2017-11-15"); +insert into diaries values(2317, "2017-11-16"); +insert into diaries values(2318, "2017-11-17"); +insert into diaries values(2319, "2017-11-18"); +insert into diaries values(2320, "2017-11-19"); +insert into diaries values(2321, "2017-11-20"); +insert into diaries values(2322, "2017-11-21"); +insert into diaries values(2323, "2017-11-22"); +insert into diaries values(2324, "2017-11-23"); +insert into diaries values(2325, "2017-11-24"); +insert into diaries values(2326, "2017-11-25"); +insert into diaries values(2327, "2017-11-26"); +insert into diaries values(2328, "2017-11-27"); +insert into diaries values(2329, "2017-11-28"); +insert into diaries values(2330, "2017-11-29"); +insert into diaries values(2331, "2017-11-30"); +insert into diaries values(2332, "2017-12-01"); +insert into diaries values(2333, "2017-12-02"); +insert into diaries values(2334, "2017-12-03"); +insert into diaries values(2335, "2017-12-04"); +insert into diaries values(2336, "2017-12-05"); +insert into diaries values(2337, "2017-12-06"); +insert into diaries values(2338, "2017-12-07"); +insert into diaries values(2339, "2017-12-08"); +insert into diaries values(2340, "2017-12-09"); +insert into diaries values(2341, "2017-12-10"); +insert into diaries values(2342, "2017-12-11"); +insert into diaries values(2343, "2017-12-12"); +insert into diaries values(2344, "2017-12-13"); +insert into diaries values(2345, "2017-12-14"); +insert into diaries values(2346, "2017-12-15"); +insert into diaries values(2347, "2017-12-16"); +insert into diaries values(2348, "2017-12-17"); +insert into diaries values(2349, "2017-12-18"); +insert into diaries values(2350, "2017-12-19"); +insert into diaries values(2351, "2017-12-20"); +insert into diaries values(2352, "2017-12-21"); +insert into diaries values(2353, "2017-12-22"); +insert into diaries values(2354, "2017-12-23"); +insert into diaries values(2355, "2017-12-24"); +insert into diaries values(2356, "2017-12-25"); +insert into diaries values(2357, "2017-12-26"); +insert into diaries values(2358, "2017-12-27"); +insert into diaries values(2359, "2017-12-28"); +insert into diaries values(2360, "2017-12-29"); +insert into diaries values(2361, "2017-12-30"); +insert into diaries values(2362, "2017-12-31"); +insert into diaries values(2363, "2018-01-01"); +insert into diaries values(2364, "2018-01-02"); +insert into diaries values(2365, "2018-01-03"); +insert into diaries values(2366, "2018-01-04"); +insert into diaries values(2367, "2018-01-05"); +insert into diaries values(2368, "2018-01-06"); +insert into diaries values(2369, "2018-01-07"); +insert into diaries values(2370, "2018-01-08"); +insert into diaries values(2371, "2018-01-09"); +insert into diaries values(2372, "2018-01-10"); +insert into diaries values(2373, "2018-01-11"); +insert into diaries values(2374, "2018-01-12"); +insert into diaries values(2375, "2018-01-13"); +insert into diaries values(2376, "2018-01-14"); +insert into diaries values(2377, "2018-01-15"); +insert into diaries values(2378, "2018-01-16"); +insert into diaries values(2379, "2018-01-17"); +insert into diaries values(2380, "2018-01-18"); +insert into diaries values(2381, "2018-01-19"); +insert into diaries values(2382, "2018-01-20"); +insert into diaries values(2383, "2018-01-21"); +insert into diaries values(2384, "2018-01-22"); +insert into diaries values(2385, "2018-01-23"); +insert into diaries values(2386, "2018-01-24"); +insert into diaries values(2387, "2018-01-25"); +insert into diaries values(2388, "2018-01-26"); +insert into diaries values(2389, "2018-01-27"); +insert into diaries values(2390, "2018-01-28"); +insert into diaries values(2391, "2018-01-29"); +insert into diaries values(2392, "2018-01-30"); +insert into diaries values(2393, "2018-01-31"); +insert into diaries values(2394, "2018-02-01"); +insert into diaries values(2395, "2018-02-02"); +insert into diaries values(2396, "2018-02-03"); +insert into diaries values(2397, "2018-02-04"); +insert into diaries values(2398, "2018-02-05"); +insert into diaries values(2399, "2018-02-06"); +insert into diaries values(2400, "2018-02-07"); +insert into diaries values(2401, "2018-02-08"); +insert into diaries values(2402, "2018-02-09"); +insert into diaries values(2403, "2018-02-10"); +insert into diaries values(2404, "2018-02-11"); +insert into diaries values(2405, "2018-02-12"); +insert into diaries values(2406, "2018-02-13"); +insert into diaries values(2407, "2018-02-14"); +insert into diaries values(2408, "2018-02-15"); +insert into diaries values(2409, "2018-02-16"); +insert into diaries values(2410, "2018-02-17"); +insert into diaries values(2411, "2018-02-18"); +insert into diaries values(2412, "2018-02-19"); +insert into diaries values(2413, "2018-02-20"); +insert into diaries values(2414, "2018-02-21"); +insert into diaries values(2415, "2018-02-22"); +insert into diaries values(2416, "2018-02-23"); +insert into diaries values(2417, "2018-02-24"); +insert into diaries values(2418, "2018-02-25"); +insert into diaries values(2419, "2018-02-26"); +insert into diaries values(2420, "2018-02-27"); +insert into diaries values(2421, "2018-02-28"); +insert into diaries values(2422, "2018-03-01"); +insert into diaries values(2423, "2018-03-02"); +insert into diaries values(2424, "2018-03-03"); +insert into diaries values(2425, "2018-03-04"); +insert into diaries values(2426, "2018-03-05"); +insert into diaries values(2427, "2018-03-06"); +insert into diaries values(2428, "2018-03-07"); +insert into diaries values(2429, "2018-03-08"); +insert into diaries values(2430, "2018-03-09"); +insert into diaries values(2431, "2018-03-10"); +insert into diaries values(2432, "2018-03-11"); +insert into diaries values(2433, "2018-03-12"); +insert into diaries values(2434, "2018-03-13"); +insert into diaries values(2435, "2018-03-14"); +insert into diaries values(2436, "2018-03-15"); +insert into diaries values(2437, "2018-03-16"); +insert into diaries values(2438, "2018-03-17"); +insert into diaries values(2439, "2018-03-18"); +insert into diaries values(2440, "2018-03-19"); +insert into diaries values(2441, "2018-03-20"); +insert into diaries values(2442, "2018-03-21"); +insert into diaries values(2443, "2018-03-22"); +insert into diaries values(2444, "2018-03-23"); +insert into diaries values(2445, "2018-03-24"); +insert into diaries values(2446, "2018-03-25"); +insert into diaries values(2447, "2018-03-26"); +insert into diaries values(2448, "2018-03-27"); +insert into diaries values(2449, "2018-03-28"); +insert into diaries values(2450, "2018-03-29"); +insert into diaries values(2451, "2018-03-30"); +insert into diaries values(2452, "2018-03-31"); +insert into diaries values(2453, "2018-04-01"); +insert into diaries values(2454, "2018-04-02"); +insert into diaries values(2455, "2018-04-03"); +insert into diaries values(2456, "2018-04-04"); +insert into diaries values(2457, "2018-04-05"); +insert into diaries values(2458, "2018-04-06"); +insert into diaries values(2459, "2018-04-07"); +insert into diaries values(2460, "2018-04-08"); +insert into diaries values(2461, "2018-04-09"); +insert into diaries values(2462, "2018-04-10"); +insert into diaries values(2463, "2018-04-11"); +insert into diaries values(2464, "2018-04-12"); +insert into diaries values(2465, "2018-04-13"); +insert into diaries values(2466, "2018-04-14"); +insert into diaries values(2467, "2018-04-15"); +insert into diaries values(2468, "2018-04-16"); +insert into diaries values(2469, "2018-04-17"); +insert into diaries values(2470, "2018-04-18"); +insert into diaries values(2471, "2018-04-19"); +insert into diaries values(2472, "2018-04-20"); +insert into diaries values(2473, "2018-04-21"); +insert into diaries values(2474, "2018-04-22"); +insert into diaries values(2475, "2018-04-23"); +insert into diaries values(2476, "2018-04-24"); +insert into diaries values(2477, "2018-04-25"); +insert into diaries values(2478, "2018-04-26"); +insert into diaries values(2479, "2018-04-27"); +insert into diaries values(2480, "2018-04-28"); +insert into diaries values(2481, "2018-04-29"); +insert into diaries values(2482, "2018-04-30"); +insert into diaries values(2483, "2018-05-01"); +insert into diaries values(2484, "2018-05-02"); +insert into diaries values(2485, "2018-05-03"); +insert into diaries values(2486, "2018-05-04"); +insert into diaries values(2487, "2018-05-05"); +insert into diaries values(2488, "2018-05-06"); +insert into diaries values(2489, "2018-05-07"); +insert into diaries values(2490, "2018-05-08"); +insert into diaries values(2491, "2018-05-09"); +insert into diaries values(2492, "2018-05-10"); +insert into diaries values(2493, "2018-05-11"); +insert into diaries values(2494, "2018-05-12"); +insert into diaries values(2495, "2018-05-13"); +insert into diaries values(2496, "2018-05-14"); +insert into diaries values(2497, "2018-05-15"); +insert into diaries values(2498, "2018-05-16"); +insert into diaries values(2499, "2018-05-17"); +insert into diaries values(2500, "2018-05-18"); +insert into diaries values(2501, "2018-05-19"); +insert into diaries values(2502, "2018-05-20"); +insert into diaries values(2503, "2018-05-21"); +insert into diaries values(2504, "2018-05-22"); +insert into diaries values(2505, "2018-05-23"); +insert into diaries values(2506, "2018-05-24"); +insert into diaries values(2507, "2018-05-25"); +insert into diaries values(2508, "2018-05-26"); +insert into diaries values(2509, "2018-05-27"); +insert into diaries values(2510, "2018-05-28"); +insert into diaries values(2511, "2018-05-29"); +insert into diaries values(2512, "2018-05-30"); +insert into diaries values(2513, "2018-05-31"); +insert into diaries values(2514, "2018-06-01"); +insert into diaries values(2515, "2018-06-02"); +insert into diaries values(2516, "2018-06-03"); +insert into diaries values(2517, "2018-06-04"); +insert into diaries values(2518, "2018-06-05"); +insert into diaries values(2519, "2018-06-06"); +insert into diaries values(2520, "2018-06-07"); +insert into diaries values(2521, "2018-06-08"); +insert into diaries values(2522, "2018-06-09"); +insert into diaries values(2523, "2018-06-10"); +insert into diaries values(2524, "2018-06-11"); +insert into diaries values(2525, "2018-06-12"); +insert into diaries values(2526, "2018-06-13"); +insert into diaries values(2527, "2018-06-14"); +insert into diaries values(2528, "2018-06-15"); +insert into diaries values(2529, "2018-06-16"); +insert into diaries values(2530, "2018-06-17"); +insert into diaries values(2531, "2018-06-18"); +insert into diaries values(2532, "2018-06-19"); +insert into diaries values(2533, "2018-06-20"); +insert into diaries values(2534, "2018-06-21"); +insert into diaries values(2535, "2018-06-22"); +insert into diaries values(2536, "2018-06-23"); +insert into diaries values(2537, "2018-06-24"); +insert into diaries values(2538, "2018-06-25"); +insert into diaries values(2539, "2018-06-26"); +insert into diaries values(2540, "2018-06-27"); +insert into diaries values(2541, "2018-06-28"); +insert into diaries values(2542, "2018-06-29"); +insert into diaries values(2543, "2018-06-30"); +insert into diaries values(2544, "2018-07-01"); +insert into diaries values(2545, "2018-07-02"); +insert into diaries values(2546, "2018-07-03"); +insert into diaries values(2547, "2018-07-04"); +insert into diaries values(2548, "2018-07-05"); +insert into diaries values(2549, "2018-07-06"); +insert into diaries values(2550, "2018-07-07"); +insert into diaries values(2551, "2018-07-08"); +insert into diaries values(2552, "2018-07-09"); +insert into diaries values(2553, "2018-07-10"); +insert into diaries values(2554, "2018-07-11"); +insert into diaries values(2555, "2018-07-12"); +insert into diaries values(2556, "2018-07-13"); +insert into diaries values(2557, "2018-07-14"); +insert into diaries values(2558, "2018-07-15"); +insert into diaries values(2559, "2018-07-16"); +insert into diaries values(2560, "2018-07-17"); +insert into diaries values(2561, "2018-07-18"); +insert into diaries values(2562, "2018-07-19"); +insert into diaries values(2563, "2018-07-20"); +insert into diaries values(2564, "2018-07-21"); +insert into diaries values(2565, "2018-07-22"); +insert into diaries values(2566, "2018-07-23"); +insert into diaries values(2567, "2018-07-24"); +insert into diaries values(2568, "2018-07-25"); +insert into diaries values(2569, "2018-07-26"); +insert into diaries values(2570, "2018-07-27"); +insert into diaries values(2571, "2018-07-28"); +insert into diaries values(2572, "2018-07-29"); +insert into diaries values(2573, "2018-07-30"); +insert into diaries values(2574, "2018-07-31"); +insert into diaries values(2575, "2018-08-01"); +insert into diaries values(2576, "2018-08-02"); +insert into diaries values(2577, "2018-08-03"); +insert into diaries values(2578, "2018-08-04"); +insert into diaries values(2579, "2018-08-05"); +insert into diaries values(2580, "2018-08-06"); +insert into diaries values(2581, "2018-08-07"); +insert into diaries values(2582, "2018-08-08"); +insert into diaries values(2583, "2018-08-09"); +insert into diaries values(2584, "2018-08-10"); +insert into diaries values(2585, "2018-08-11"); +insert into diaries values(2586, "2018-08-12"); +insert into diaries values(2587, "2018-08-13"); +insert into diaries values(2588, "2018-08-14"); +insert into diaries values(2589, "2018-08-15"); +insert into diaries values(2590, "2018-08-16"); +insert into diaries values(2591, "2018-08-17"); +insert into diaries values(2592, "2018-08-18"); +insert into diaries values(2593, "2018-08-19"); +insert into diaries values(2594, "2018-08-20"); +insert into diaries values(2595, "2018-08-21"); +insert into diaries values(2596, "2018-08-22"); +insert into diaries values(2597, "2018-08-23"); +insert into diaries values(2598, "2018-08-24"); +insert into diaries values(2599, "2018-08-25"); +insert into diaries values(2600, "2018-08-26"); +insert into diaries values(2601, "2018-08-27"); +insert into diaries values(2602, "2018-08-28"); +insert into diaries values(2603, "2018-08-29"); +insert into diaries values(2604, "2018-08-30"); +insert into diaries values(2605, "2018-08-31"); +insert into diaries values(2606, "2018-09-01"); +insert into diaries values(2607, "2018-09-02"); +insert into diaries values(2608, "2018-09-03"); +insert into diaries values(2609, "2018-09-04"); +insert into diaries values(2610, "2018-09-05"); +insert into diaries values(2611, "2018-09-06"); +insert into diaries values(2612, "2018-09-07"); +insert into diaries values(2613, "2018-09-08"); +insert into diaries values(2614, "2018-09-09"); +insert into diaries values(2615, "2018-09-10"); +insert into diaries values(2616, "2018-09-11"); +insert into diaries values(2617, "2018-09-12"); +insert into diaries values(2618, "2018-09-13"); +insert into diaries values(2619, "2018-09-14"); +insert into diaries values(2620, "2018-09-15"); +insert into diaries values(2621, "2018-09-16"); +insert into diaries values(2622, "2018-09-17"); +insert into diaries values(2623, "2018-09-18"); +insert into diaries values(2624, "2018-09-19"); +insert into diaries values(2625, "2018-09-20"); +insert into diaries values(2626, "2018-09-21"); +insert into diaries values(2627, "2018-09-22"); +insert into diaries values(2628, "2018-09-23"); +insert into diaries values(2629, "2018-09-24"); +insert into diaries values(2630, "2018-09-25"); +insert into diaries values(2631, "2018-09-26"); +insert into diaries values(2632, "2018-09-27"); +insert into diaries values(2633, "2018-09-28"); +insert into diaries values(2634, "2018-09-29"); +insert into diaries values(2635, "2018-09-30"); +insert into diaries values(2636, "2018-10-01"); +insert into diaries values(2637, "2018-10-02"); +insert into diaries values(2638, "2018-10-03"); +insert into diaries values(2639, "2018-10-04"); +insert into diaries values(2640, "2018-10-05"); +insert into diaries values(2641, "2018-10-06"); +insert into diaries values(2642, "2018-10-07"); +insert into diaries values(2643, "2018-10-08"); +insert into diaries values(2644, "2018-10-09"); +insert into diaries values(2645, "2018-10-10"); +insert into diaries values(2646, "2018-10-11"); +insert into diaries values(2647, "2018-10-12"); +insert into diaries values(2648, "2018-10-13"); +insert into diaries values(2649, "2018-10-14"); +insert into diaries values(2650, "2018-10-15"); +insert into diaries values(2651, "2018-10-16"); +insert into diaries values(2652, "2018-10-17"); +insert into diaries values(2653, "2018-10-18"); +insert into diaries values(2654, "2018-10-19"); +insert into diaries values(2655, "2018-10-20"); +insert into diaries values(2656, "2018-10-21"); +insert into diaries values(2657, "2018-10-22"); +insert into diaries values(2658, "2018-10-23"); +insert into diaries values(2659, "2018-10-24"); +insert into diaries values(2660, "2018-10-25"); +insert into diaries values(2661, "2018-10-26"); +insert into diaries values(2662, "2018-10-27"); +insert into diaries values(2663, "2018-10-28"); +insert into diaries values(2664, "2018-10-29"); +insert into diaries values(2665, "2018-10-30"); +insert into diaries values(2666, "2018-10-31"); +insert into diaries values(2667, "2018-11-01"); +insert into diaries values(2668, "2018-11-02"); +insert into diaries values(2669, "2018-11-03"); +insert into diaries values(2670, "2018-11-04"); +insert into diaries values(2671, "2018-11-05"); +insert into diaries values(2672, "2018-11-06"); +insert into diaries values(2673, "2018-11-07"); +insert into diaries values(2674, "2018-11-08"); +insert into diaries values(2675, "2018-11-09"); +insert into diaries values(2676, "2018-11-10"); +insert into diaries values(2677, "2018-11-11"); +insert into diaries values(2678, "2018-11-12"); +insert into diaries values(2679, "2018-11-13"); +insert into diaries values(2680, "2018-11-14"); +insert into diaries values(2681, "2018-11-15"); +insert into diaries values(2682, "2018-11-16"); +insert into diaries values(2683, "2018-11-17"); +insert into diaries values(2684, "2018-11-18"); +insert into diaries values(2685, "2018-11-19"); +insert into diaries values(2686, "2018-11-20"); +insert into diaries values(2687, "2018-11-21"); +insert into diaries values(2688, "2018-11-22"); +insert into diaries values(2689, "2018-11-23"); +insert into diaries values(2690, "2018-11-24"); +insert into diaries values(2691, "2018-11-25"); +insert into diaries values(2692, "2018-11-26"); +insert into diaries values(2693, "2018-11-27"); +insert into diaries values(2694, "2018-11-28"); +insert into diaries values(2695, "2018-11-29"); +insert into diaries values(2696, "2018-11-30"); +insert into diaries values(2697, "2018-12-01"); +insert into diaries values(2698, "2018-12-02"); +insert into diaries values(2699, "2018-12-03"); +insert into diaries values(2700, "2018-12-04"); +insert into diaries values(2701, "2018-12-05"); +insert into diaries values(2702, "2018-12-06"); +insert into diaries values(2703, "2018-12-07"); +insert into diaries values(2704, "2018-12-08"); +insert into diaries values(2705, "2018-12-09"); +insert into diaries values(2706, "2018-12-10"); +insert into diaries values(2707, "2018-12-11"); +insert into diaries values(2708, "2018-12-12"); +insert into diaries values(2709, "2018-12-13"); +insert into diaries values(2710, "2018-12-14"); +insert into diaries values(2711, "2018-12-15"); +insert into diaries values(2712, "2018-12-16"); +insert into diaries values(2713, "2018-12-17"); +insert into diaries values(2714, "2018-12-18"); +insert into diaries values(2715, "2018-12-19"); +insert into diaries values(2716, "2018-12-20"); +insert into diaries values(2717, "2018-12-21"); +insert into diaries values(2718, "2018-12-22"); +insert into diaries values(2719, "2018-12-23"); +insert into diaries values(2720, "2018-12-24"); +insert into diaries values(2721, "2018-12-25"); +insert into diaries values(2722, "2018-12-26"); +insert into diaries values(2723, "2018-12-27"); +insert into diaries values(2724, "2018-12-28"); +insert into diaries values(2725, "2018-12-29"); +insert into diaries values(2726, "2018-12-30"); +insert into diaries values(2727, "2018-12-31"); +insert into diaries values(2728, "2019-01-01"); +insert into diaries values(2729, "2019-01-02"); +insert into diaries values(2730, "2019-01-03"); +insert into diaries values(2731, "2019-01-04"); +insert into diaries values(2732, "2019-01-05"); +insert into diaries values(2733, "2019-01-06"); +insert into diaries values(2734, "2019-01-07"); +insert into diaries values(2735, "2019-01-08"); +insert into diaries values(2736, "2019-01-09"); +insert into diaries values(2737, "2019-01-10"); +insert into diaries values(2738, "2019-01-11"); +insert into diaries values(2739, "2019-01-12"); +insert into diaries values(2740, "2019-01-13"); +insert into diaries values(2741, "2019-01-14"); +insert into diaries values(2742, "2019-01-15"); +insert into diaries values(2743, "2019-01-16"); +insert into diaries values(2744, "2019-01-17"); +insert into diaries values(2745, "2019-01-18"); +insert into diaries values(2746, "2019-01-19"); +insert into diaries values(2747, "2019-01-20"); +insert into diaries values(2748, "2019-01-21"); +insert into diaries values(2749, "2019-01-22"); +insert into diaries values(2750, "2019-01-23"); +insert into diaries values(2751, "2019-01-24"); +insert into diaries values(2752, "2019-01-25"); +insert into diaries values(2753, "2019-01-26"); +insert into diaries values(2754, "2019-01-27"); +insert into diaries values(2755, "2019-01-28"); +insert into diaries values(2756, "2019-01-29"); +insert into diaries values(2757, "2019-01-30"); +insert into diaries values(2758, "2019-01-31"); +insert into diaries values(2759, "2019-02-01"); +insert into diaries values(2760, "2019-02-02"); +insert into diaries values(2761, "2019-02-03"); +insert into diaries values(2762, "2019-02-04"); +insert into diaries values(2763, "2019-02-05"); +insert into diaries values(2764, "2019-02-06"); +insert into diaries values(2765, "2019-02-07"); +insert into diaries values(2766, "2019-02-08"); +insert into diaries values(2767, "2019-02-09"); +insert into diaries values(2768, "2019-02-10"); +insert into diaries values(2769, "2019-02-11"); +insert into diaries values(2770, "2019-02-12"); +insert into diaries values(2771, "2019-02-13"); +insert into diaries values(2772, "2019-02-14"); +insert into diaries values(2773, "2019-02-15"); +insert into diaries values(2774, "2019-02-16"); +insert into diaries values(2775, "2019-02-17"); +insert into diaries values(2776, "2019-02-18"); +insert into diaries values(2777, "2019-02-19"); +insert into diaries values(2778, "2019-02-20"); +insert into diaries values(2779, "2019-02-21"); +insert into diaries values(2780, "2019-02-22"); +insert into diaries values(2781, "2019-02-23"); +insert into diaries values(2782, "2019-02-24"); +insert into diaries values(2783, "2019-02-25"); +insert into diaries values(2784, "2019-02-26"); +insert into diaries values(2785, "2019-02-27"); +insert into diaries values(2786, "2019-02-28"); +insert into diaries values(2787, "2019-03-01"); +insert into diaries values(2788, "2019-03-02"); +insert into diaries values(2789, "2019-03-03"); +insert into diaries values(2790, "2019-03-04"); +insert into diaries values(2791, "2019-03-05"); +insert into diaries values(2792, "2019-03-06"); +insert into diaries values(2793, "2019-03-07"); +insert into diaries values(2794, "2019-03-08"); +insert into diaries values(2795, "2019-03-09"); +insert into diaries values(2796, "2019-03-10"); +insert into diaries values(2797, "2019-03-11"); +insert into diaries values(2798, "2019-03-12"); +insert into diaries values(2799, "2019-03-13"); +insert into diaries values(2800, "2019-03-14"); +insert into diaries values(2801, "2019-03-15"); +insert into diaries values(2802, "2019-03-16"); +insert into diaries values(2803, "2019-03-17"); +insert into diaries values(2804, "2019-03-18"); +insert into diaries values(2805, "2019-03-19"); +insert into diaries values(2806, "2019-03-20"); +insert into diaries values(2807, "2019-03-21"); +insert into diaries values(2808, "2019-03-22"); +insert into diaries values(2809, "2019-03-23"); +insert into diaries values(2810, "2019-03-24"); +insert into diaries values(2811, "2019-03-25"); +insert into diaries values(2812, "2019-03-26"); +insert into diaries values(2813, "2019-03-27"); +insert into diaries values(2814, "2019-03-28"); +insert into diaries values(2815, "2019-03-29"); +insert into diaries values(2816, "2019-03-30"); +insert into diaries values(2817, "2019-03-31"); +insert into diaries values(2818, "2019-04-01"); +insert into diaries values(2819, "2019-04-02"); +insert into diaries values(2820, "2019-04-03"); +insert into diaries values(2821, "2019-04-04"); +insert into diaries values(2822, "2019-04-05"); +insert into diaries values(2823, "2019-04-06"); +insert into diaries values(2824, "2019-04-07"); +insert into diaries values(2825, "2019-04-08"); +insert into diaries values(2826, "2019-04-09"); +insert into diaries values(2827, "2019-04-10"); +insert into diaries values(2828, "2019-04-11"); +insert into diaries values(2829, "2019-04-12"); +insert into diaries values(2830, "2019-04-13"); +insert into diaries values(2831, "2019-04-14"); +insert into diaries values(2832, "2019-04-15"); +insert into diaries values(2833, "2019-04-16"); +insert into diaries values(2834, "2019-04-17"); +insert into diaries values(2835, "2019-04-18"); +insert into diaries values(2836, "2019-04-19"); +insert into diaries values(2837, "2019-04-20"); +insert into diaries values(2838, "2019-04-21"); +insert into diaries values(2839, "2019-04-22"); +insert into diaries values(2840, "2019-04-23"); +insert into diaries values(2841, "2019-04-24"); +insert into diaries values(2842, "2019-04-25"); +insert into diaries values(2843, "2019-04-26"); +insert into diaries values(2844, "2019-04-27"); +insert into diaries values(2845, "2019-04-28"); +insert into diaries values(2846, "2019-04-29"); +insert into diaries values(2847, "2019-04-30"); +insert into diaries values(2848, "2019-05-01"); +insert into diaries values(2849, "2019-05-02"); +insert into diaries values(2850, "2019-05-03"); +insert into diaries values(2851, "2019-05-04"); +insert into diaries values(2852, "2019-05-05"); +insert into diaries values(2853, "2019-05-06"); +insert into diaries values(2854, "2019-05-07"); +insert into diaries values(2855, "2019-05-08"); +insert into diaries values(2856, "2019-05-09"); +insert into diaries values(2857, "2019-05-10"); +insert into diaries values(2858, "2019-05-11"); +insert into diaries values(2859, "2019-05-12"); +insert into diaries values(2860, "2019-05-13"); +insert into diaries values(2861, "2019-05-14"); +insert into diaries values(2862, "2019-05-15"); +insert into diaries values(2863, "2019-05-16"); +insert into diaries values(2864, "2019-05-17"); +insert into diaries values(2865, "2019-05-18"); +insert into diaries values(2866, "2019-05-19"); +insert into diaries values(2867, "2019-05-20"); +insert into diaries values(2868, "2019-05-21"); +insert into diaries values(2869, "2019-05-22"); +insert into diaries values(2870, "2019-05-23"); +insert into diaries values(2871, "2019-05-24"); +insert into diaries values(2872, "2019-05-25"); +insert into diaries values(2873, "2019-05-26"); +insert into diaries values(2874, "2019-05-27"); +insert into diaries values(2875, "2019-05-28"); +insert into diaries values(2876, "2019-05-29"); +insert into diaries values(2877, "2019-05-30"); +insert into diaries values(2878, "2019-05-31"); +insert into diaries values(2879, "2019-06-01"); +insert into diaries values(2880, "2019-06-02"); +insert into diaries values(2881, "2019-06-03"); +insert into diaries values(2882, "2019-06-04"); +insert into diaries values(2883, "2019-06-05"); +insert into diaries values(2884, "2019-06-06"); +insert into diaries values(2885, "2019-06-07"); +insert into diaries values(2886, "2019-06-08"); +insert into diaries values(2887, "2019-06-09"); +insert into diaries values(2888, "2019-06-10"); +insert into diaries values(2889, "2019-06-11"); +insert into diaries values(2890, "2019-06-12"); +insert into diaries values(2891, "2019-06-13"); +insert into diaries values(2892, "2019-06-14"); +insert into diaries values(2893, "2019-06-15"); +insert into diaries values(2894, "2019-06-16"); +insert into diaries values(2895, "2019-06-17"); +insert into diaries values(2896, "2019-06-18"); +insert into diaries values(2897, "2019-06-19"); +insert into diaries values(2898, "2019-06-20"); +insert into diaries values(2899, "2019-06-21"); +insert into diaries values(2900, "2019-06-22"); +insert into diaries values(2901, "2019-06-23"); +insert into diaries values(2902, "2019-06-24"); +insert into diaries values(2903, "2019-06-25"); +insert into diaries values(2904, "2019-06-26"); +insert into diaries values(2905, "2019-06-27"); +insert into diaries values(2906, "2019-06-28"); +insert into diaries values(2907, "2019-06-29"); +insert into diaries values(2908, "2019-06-30"); +insert into diaries values(2909, "2019-07-01"); +insert into diaries values(2910, "2019-07-02"); +insert into diaries values(2911, "2019-07-03"); +insert into diaries values(2912, "2019-07-04"); +insert into diaries values(2913, "2019-07-05"); +insert into diaries values(2914, "2019-07-06"); +insert into diaries values(2915, "2019-07-07"); +insert into diaries values(2916, "2019-07-08"); +insert into diaries values(2917, "2019-07-09"); +insert into diaries values(2918, "2019-07-10"); +insert into diaries values(2919, "2019-07-11"); +insert into diaries values(2920, "2019-07-12"); +insert into diaries values(2921, "2019-07-13"); +insert into diaries values(2922, "2019-07-14"); +insert into diaries values(2923, "2019-07-15"); +insert into diaries values(2924, "2019-07-16"); +insert into diaries values(2925, "2019-07-17"); +insert into diaries values(2926, "2019-07-18"); +insert into diaries values(2927, "2019-07-19"); +insert into diaries values(2928, "2019-07-20"); +insert into diaries values(2929, "2019-07-21"); +insert into diaries values(2930, "2019-07-22"); +insert into diaries values(2931, "2019-07-23"); +insert into diaries values(2932, "2019-07-24"); +insert into diaries values(2933, "2019-07-25"); +insert into diaries values(2934, "2019-07-26"); +insert into diaries values(2935, "2019-07-27"); +insert into diaries values(2936, "2019-07-28"); +insert into diaries values(2937, "2019-07-29"); +insert into diaries values(2938, "2019-07-30"); +insert into diaries values(2939, "2019-07-31"); +insert into diaries values(2940, "2019-08-01"); +insert into diaries values(2941, "2019-08-02"); +insert into diaries values(2942, "2019-08-03"); +insert into diaries values(2943, "2019-08-04"); +insert into diaries values(2944, "2019-08-05"); +insert into diaries values(2945, "2019-08-06"); +insert into diaries values(2946, "2019-08-07"); +insert into diaries values(2947, "2019-08-08"); +insert into diaries values(2948, "2019-08-09"); +insert into diaries values(2949, "2019-08-10"); +insert into diaries values(2950, "2019-08-11"); +insert into diaries values(2951, "2019-08-12"); +insert into diaries values(2952, "2019-08-13"); +insert into diaries values(2953, "2019-08-14"); +insert into diaries values(2954, "2019-08-15"); +insert into diaries values(2955, "2019-08-16"); +insert into diaries values(2956, "2019-08-17"); +insert into diaries values(2957, "2019-08-18"); +insert into diaries values(2958, "2019-08-19"); +insert into diaries values(2959, "2019-08-20"); +insert into diaries values(2960, "2019-08-21"); +insert into diaries values(2961, "2019-08-22"); +insert into diaries values(2962, "2019-08-23"); +insert into diaries values(2963, "2019-08-24"); +insert into diaries values(2964, "2019-08-25"); +insert into diaries values(2965, "2019-08-26"); +insert into diaries values(2966, "2019-08-27"); +insert into diaries values(2967, "2019-08-28"); +insert into diaries values(2968, "2019-08-29"); +insert into diaries values(2969, "2019-08-30"); +insert into diaries values(2970, "2019-08-31"); +insert into diaries values(2971, "2019-09-01"); +insert into diaries values(2972, "2019-09-02"); +insert into diaries values(2973, "2019-09-03"); +insert into diaries values(2974, "2019-09-04"); +insert into diaries values(2975, "2019-09-05"); +insert into diaries values(2976, "2019-09-06"); +insert into diaries values(2977, "2019-09-07"); +insert into diaries values(2978, "2019-09-08"); +insert into diaries values(2979, "2019-09-09"); +insert into diaries values(2980, "2019-09-10"); +insert into diaries values(2981, "2019-09-11"); +insert into diaries values(2982, "2019-09-12"); +insert into diaries values(2983, "2019-09-13"); +insert into diaries values(2984, "2019-09-14"); +insert into diaries values(2985, "2019-09-15"); +insert into diaries values(2986, "2019-09-16"); +insert into diaries values(2987, "2019-09-17"); +insert into diaries values(2988, "2019-09-18"); +insert into diaries values(2989, "2019-09-19"); +insert into diaries values(2990, "2019-09-20"); +insert into diaries values(2991, "2019-09-21"); +insert into diaries values(2992, "2019-09-22"); +insert into diaries values(2993, "2019-09-23"); +insert into diaries values(2994, "2019-09-24"); +insert into diaries values(2995, "2019-09-25"); +insert into diaries values(2996, "2019-09-26"); +insert into diaries values(2997, "2019-09-27"); +insert into diaries values(2998, "2019-09-28"); +insert into diaries values(2999, "2019-09-29"); +insert into diaries values(3000, "2019-09-30"); +insert into diaries values(3001, "2019-10-01"); +insert into diaries values(3002, "2019-10-02"); +insert into diaries values(3003, "2019-10-03"); +insert into diaries values(3004, "2019-10-04"); +insert into diaries values(3005, "2019-10-05"); +insert into diaries values(3006, "2019-10-06"); +insert into diaries values(3007, "2019-10-07"); +insert into diaries values(3008, "2019-10-08"); +insert into diaries values(3009, "2019-10-09"); +insert into diaries values(3010, "2019-10-10"); +insert into diaries values(3011, "2019-10-11"); +insert into diaries values(3012, "2019-10-12"); +insert into diaries values(3013, "2019-10-13"); +insert into diaries values(3014, "2019-10-14"); +insert into diaries values(3015, "2019-10-15"); +insert into diaries values(3016, "2019-10-16"); +insert into diaries values(3017, "2019-10-17"); +insert into diaries values(3018, "2019-10-18"); +insert into diaries values(3019, "2019-10-19"); +insert into diaries values(3020, "2019-10-20"); +insert into diaries values(3021, "2019-10-21"); +insert into diaries values(3022, "2019-10-22"); +insert into diaries values(3023, "2019-10-23"); +insert into diaries values(3024, "2019-10-24"); +insert into diaries values(3025, "2019-10-25"); +insert into diaries values(3026, "2019-10-26"); +insert into diaries values(3027, "2019-10-27"); +insert into diaries values(3028, "2019-10-28"); +insert into diaries values(3029, "2019-10-29"); +insert into diaries values(3030, "2019-10-30"); +insert into diaries values(3031, "2019-10-31"); +insert into diaries values(3032, "2019-11-01"); +insert into diaries values(3033, "2019-11-02"); +insert into diaries values(3034, "2019-11-03"); +insert into diaries values(3035, "2019-11-04"); +insert into diaries values(3036, "2019-11-05"); +insert into diaries values(3037, "2019-11-06"); +insert into diaries values(3038, "2019-11-07"); +insert into diaries values(3039, "2019-11-08"); +insert into diaries values(3040, "2019-11-09"); +insert into diaries values(3041, "2019-11-10"); +insert into diaries values(3042, "2019-11-11"); +insert into diaries values(3043, "2019-11-12"); +insert into diaries values(3044, "2019-11-13"); +insert into diaries values(3045, "2019-11-14"); +insert into diaries values(3046, "2019-11-15"); +insert into diaries values(3047, "2019-11-16"); +insert into diaries values(3048, "2019-11-17"); +insert into diaries values(3049, "2019-11-18"); +insert into diaries values(3050, "2019-11-19"); +insert into diaries values(3051, "2019-11-20"); +insert into diaries values(3052, "2019-11-21"); +insert into diaries values(3053, "2019-11-22"); +insert into diaries values(3054, "2019-11-23"); +insert into diaries values(3055, "2019-11-24"); +insert into diaries values(3056, "2019-11-25"); +insert into diaries values(3057, "2019-11-26"); +insert into diaries values(3058, "2019-11-27"); +insert into diaries values(3059, "2019-11-28"); +insert into diaries values(3060, "2019-11-29"); +insert into diaries values(3061, "2019-11-30"); +insert into diaries values(3062, "2019-12-01"); +insert into diaries values(3063, "2019-12-02"); +insert into diaries values(3064, "2019-12-03"); +insert into diaries values(3065, "2019-12-04"); +insert into diaries values(3066, "2019-12-05"); +insert into diaries values(3067, "2019-12-06"); +insert into diaries values(3068, "2019-12-07"); +insert into diaries values(3069, "2019-12-08"); +insert into diaries values(3070, "2019-12-09"); +insert into diaries values(3071, "2019-12-10"); +insert into diaries values(3072, "2019-12-11"); +insert into diaries values(3073, "2019-12-12"); +insert into diaries values(3074, "2019-12-13"); +insert into diaries values(3075, "2019-12-14"); +insert into diaries values(3076, "2019-12-15"); +insert into diaries values(3077, "2019-12-16"); +insert into diaries values(3078, "2019-12-17"); +insert into diaries values(3079, "2019-12-18"); +insert into diaries values(3080, "2019-12-19"); +insert into diaries values(3081, "2019-12-20"); +insert into diaries values(3082, "2019-12-21"); +insert into diaries values(3083, "2019-12-22"); +insert into diaries values(3084, "2019-12-23"); +insert into diaries values(3085, "2019-12-24"); +insert into diaries values(3086, "2019-12-25"); +insert into diaries values(3087, "2019-12-26"); +insert into diaries values(3088, "2019-12-27"); +insert into diaries values(3089, "2019-12-28"); +insert into diaries values(3090, "2019-12-29"); +insert into diaries values(3091, "2019-12-30"); +insert into diaries values(3092, "2019-12-31"); +insert into diaries values(3093, "2020-01-01"); +insert into diaries values(3094, "2020-01-02"); +insert into diaries values(3095, "2020-01-03"); +insert into diaries values(3096, "2020-01-04"); +insert into diaries values(3097, "2020-01-05"); +insert into diaries values(3098, "2020-01-06"); +insert into diaries values(3099, "2020-01-07"); +insert into diaries values(3100, "2020-01-08"); +insert into diaries values(3101, "2020-01-09"); +insert into diaries values(3102, "2020-01-10"); +insert into diaries values(3103, "2020-01-11"); +insert into diaries values(3104, "2020-01-12"); +insert into diaries values(3105, "2020-01-13"); +insert into diaries values(3106, "2020-01-14"); +insert into diaries values(3107, "2020-01-15"); +insert into diaries values(3108, "2020-01-16"); +insert into diaries values(3109, "2020-01-17"); +insert into diaries values(3110, "2020-01-18"); +insert into diaries values(3111, "2020-01-19"); +insert into diaries values(3112, "2020-01-20"); +insert into diaries values(3113, "2020-01-21"); +insert into diaries values(3114, "2020-01-22"); +insert into diaries values(3115, "2020-01-23"); +insert into diaries values(3116, "2020-01-24"); +insert into diaries values(3117, "2020-01-25"); +insert into diaries values(3118, "2020-01-26"); +insert into diaries values(3119, "2020-01-27"); +insert into diaries values(3120, "2020-01-28"); +insert into diaries values(3121, "2020-01-29"); +insert into diaries values(3122, "2020-01-30"); +insert into diaries values(3123, "2020-01-31"); +insert into diaries values(3124, "2020-02-01"); +insert into diaries values(3125, "2020-02-02"); +insert into diaries values(3126, "2020-02-03"); +insert into diaries values(3127, "2020-02-04"); +insert into diaries values(3128, "2020-02-05"); +insert into diaries values(3129, "2020-02-06"); +insert into diaries values(3130, "2020-02-07"); +insert into diaries values(3131, "2020-02-08"); +insert into diaries values(3132, "2020-02-09"); +insert into diaries values(3133, "2020-02-10"); +insert into diaries values(3134, "2020-02-11"); +insert into diaries values(3135, "2020-02-12"); +insert into diaries values(3136, "2020-02-13"); +insert into diaries values(3137, "2020-02-14"); +insert into diaries values(3138, "2020-02-15"); +insert into diaries values(3139, "2020-02-16"); +insert into diaries values(3140, "2020-02-17"); +insert into diaries values(3141, "2020-02-18"); +insert into diaries values(3142, "2020-02-19"); +insert into diaries values(3143, "2020-02-20"); +insert into diaries values(3144, "2020-02-21"); +insert into diaries values(3145, "2020-02-22"); +insert into diaries values(3146, "2020-02-23"); +insert into diaries values(3147, "2020-02-24"); +insert into diaries values(3148, "2020-02-25"); +insert into diaries values(3149, "2020-02-26"); +insert into diaries values(3150, "2020-02-27"); +insert into diaries values(3151, "2020-02-28"); +insert into diaries values(3152, "2020-02-29"); +insert into diaries values(3153, "2020-03-01"); +insert into diaries values(3154, "2020-03-02"); +insert into diaries values(3155, "2020-03-03"); +insert into diaries values(3156, "2020-03-04"); +insert into diaries values(3157, "2020-03-05"); +insert into diaries values(3158, "2020-03-06"); +insert into diaries values(3159, "2020-03-07"); +insert into diaries values(3160, "2020-03-08"); +insert into diaries values(3161, "2020-03-09"); +insert into diaries values(3162, "2020-03-10"); +insert into diaries values(3163, "2020-03-11"); +insert into diaries values(3164, "2020-03-12"); +insert into diaries values(3165, "2020-03-13"); +insert into diaries values(3166, "2020-03-14"); +insert into diaries values(3167, "2020-03-15"); +insert into diaries values(3168, "2020-03-16"); +insert into diaries values(3169, "2020-03-17"); +insert into diaries values(3170, "2020-03-18"); +insert into diaries values(3171, "2020-03-19"); +insert into diaries values(3172, "2020-03-20"); +insert into diaries values(3173, "2020-03-21"); +insert into diaries values(3174, "2020-03-22"); +insert into diaries values(3175, "2020-03-23"); +insert into diaries values(3176, "2020-03-24"); +insert into diaries values(3177, "2020-03-25"); +insert into diaries values(3178, "2020-03-26"); +insert into diaries values(3179, "2020-03-27"); +insert into diaries values(3180, "2020-03-28"); +insert into diaries values(3181, "2020-03-29"); +insert into diaries values(3182, "2020-03-30"); +insert into diaries values(3183, "2020-03-31"); +insert into diaries values(3184, "2020-04-01"); +insert into diaries values(3185, "2020-04-02"); +insert into diaries values(3186, "2020-04-03"); +insert into diaries values(3187, "2020-04-04"); +insert into diaries values(3188, "2020-04-05"); +insert into diaries values(3189, "2020-04-06"); +insert into diaries values(3190, "2020-04-07"); +insert into diaries values(3191, "2020-04-08"); +insert into diaries values(3192, "2020-04-09"); +insert into diaries values(3193, "2020-04-10"); +insert into diaries values(3194, "2020-04-11"); +insert into diaries values(3195, "2020-04-12"); +insert into diaries values(3196, "2020-04-13"); +insert into diaries values(3197, "2020-04-14"); +insert into diaries values(3198, "2020-04-15"); +insert into diaries values(3199, "2020-04-16"); +insert into diaries values(3200, "2020-04-17"); +insert into diaries values(3201, "2020-04-18"); +insert into diaries values(3202, "2020-04-19"); +insert into diaries values(3203, "2020-04-20"); +insert into diaries values(3204, "2020-04-21"); +insert into diaries values(3205, "2020-04-22"); +insert into diaries values(3206, "2020-04-23"); +insert into diaries values(3207, "2020-04-24"); +insert into diaries values(3208, "2020-04-25"); +insert into diaries values(3209, "2020-04-26"); +insert into diaries values(3210, "2020-04-27"); +insert into diaries values(3211, "2020-04-28"); +insert into diaries values(3212, "2020-04-29"); +insert into diaries values(3213, "2020-04-30"); +insert into diaries values(3214, "2020-05-01"); +insert into diaries values(3215, "2020-05-02"); +insert into diaries values(3216, "2020-05-03"); +insert into diaries values(3217, "2020-05-04"); +insert into diaries values(3218, "2020-05-05"); +insert into diaries values(3219, "2020-05-06"); +insert into diaries values(3220, "2020-05-07"); +insert into diaries values(3221, "2020-05-08"); +insert into diaries values(3222, "2020-05-09"); +insert into diaries values(3223, "2020-05-10"); +insert into diaries values(3224, "2020-05-11"); +insert into diaries values(3225, "2020-05-12"); +insert into diaries values(3226, "2020-05-13"); +insert into diaries values(3227, "2020-05-14"); +insert into diaries values(3228, "2020-05-15"); +insert into diaries values(3229, "2020-05-16"); +insert into diaries values(3230, "2020-05-17"); +insert into diaries values(3231, "2020-05-18"); +insert into diaries values(3232, "2020-05-19"); +insert into diaries values(3233, "2020-05-20"); +insert into diaries values(3234, "2020-05-21"); +insert into diaries values(3235, "2020-05-22"); +insert into diaries values(3236, "2020-05-23"); +insert into diaries values(3237, "2020-05-24"); +insert into diaries values(3238, "2020-05-25"); +insert into diaries values(3239, "2020-05-26"); +insert into diaries values(3240, "2020-05-27"); +insert into diaries values(3241, "2020-05-28"); +insert into diaries values(3242, "2020-05-29"); +insert into diaries values(3243, "2020-05-30"); +insert into diaries values(3244, "2020-05-31"); +insert into diaries values(3245, "2020-06-01"); +insert into diaries values(3246, "2020-06-02"); +insert into diaries values(3247, "2020-06-03"); +insert into diaries values(3248, "2020-06-04"); +insert into diaries values(3249, "2020-06-05"); +insert into diaries values(3250, "2020-06-06"); +insert into diaries values(3251, "2020-06-07"); +insert into diaries values(3252, "2020-06-08"); +insert into diaries values(3253, "2020-06-09"); +insert into diaries values(3254, "2020-06-10"); +insert into diaries values(3255, "2020-06-11"); +insert into diaries values(3256, "2020-06-12"); +insert into diaries values(3257, "2020-06-13"); +insert into diaries values(3258, "2020-06-14"); +insert into diaries values(3259, "2020-06-15"); +insert into diaries values(3260, "2020-06-16"); +insert into diaries values(3261, "2020-06-17"); +insert into diaries values(3262, "2020-06-18"); +insert into diaries values(3263, "2020-06-19"); +insert into diaries values(3264, "2020-06-20"); +insert into diaries values(3265, "2020-06-21"); +insert into diaries values(3266, "2020-06-22"); +insert into diaries values(3267, "2020-06-23"); +insert into diaries values(3268, "2020-06-24"); +insert into diaries values(3269, "2020-06-25"); +insert into diaries values(3270, "2020-06-26"); +insert into diaries values(3271, "2020-06-27"); +insert into diaries values(3272, "2020-06-28"); +insert into diaries values(3273, "2020-06-29"); +insert into diaries values(3274, "2020-06-30"); +insert into diaries values(3275, "2020-07-01"); +insert into diaries values(3276, "2020-07-02"); +insert into diaries values(3277, "2020-07-03"); +insert into diaries values(3278, "2020-07-04"); +insert into diaries values(3279, "2020-07-05"); +insert into diaries values(3280, "2020-07-06"); +insert into diaries values(3281, "2020-07-07"); +insert into diaries values(3282, "2020-07-08"); +insert into diaries values(3283, "2020-07-09"); +insert into diaries values(3284, "2020-07-10"); +insert into diaries values(3285, "2020-07-11"); +insert into diaries values(3286, "2020-07-12"); +insert into diaries values(3287, "2020-07-13"); +insert into diaries values(3288, "2020-07-14"); +insert into diaries values(3289, "2020-07-15"); +insert into diaries values(3290, "2020-07-16"); +insert into diaries values(3291, "2020-07-17"); +insert into diaries values(3292, "2020-07-18"); +insert into diaries values(3293, "2020-07-19"); +insert into diaries values(3294, "2020-07-20"); +insert into diaries values(3295, "2020-07-21"); +insert into diaries values(3296, "2020-07-22"); +insert into diaries values(3297, "2020-07-23"); +insert into diaries values(3298, "2020-07-24"); +insert into diaries values(3299, "2020-07-25"); +insert into diaries values(3300, "2020-07-26"); +insert into diaries values(3301, "2020-07-27"); +insert into diaries values(3302, "2020-07-28"); +insert into diaries values(3303, "2020-07-29"); +insert into diaries values(3304, "2020-07-30"); +insert into diaries values(3305, "2020-07-31"); +insert into diaries values(3306, "2020-08-01"); +insert into diaries values(3307, "2020-08-02"); +insert into diaries values(3308, "2020-08-03"); +insert into diaries values(3309, "2020-08-04"); +insert into diaries values(3310, "2020-08-05"); +insert into diaries values(3311, "2020-08-06"); +insert into diaries values(3312, "2020-08-07"); +insert into diaries values(3313, "2020-08-08"); +insert into diaries values(3314, "2020-08-09"); +insert into diaries values(3315, "2020-08-10"); +insert into diaries values(3316, "2020-08-11"); +insert into diaries values(3317, "2020-08-12"); +insert into diaries values(3318, "2020-08-13"); +insert into diaries values(3319, "2020-08-14"); +insert into diaries values(3320, "2020-08-15"); +insert into diaries values(3321, "2020-08-16"); +insert into diaries values(3322, "2020-08-17"); +insert into diaries values(3323, "2020-08-18"); +insert into diaries values(3324, "2020-08-19"); +insert into diaries values(3325, "2020-08-20"); +insert into diaries values(3326, "2020-08-21"); +insert into diaries values(3327, "2020-08-22"); +insert into diaries values(3328, "2020-08-23"); +insert into diaries values(3329, "2020-08-24"); +insert into diaries values(3330, "2020-08-25"); +insert into diaries values(3331, "2020-08-26"); +insert into diaries values(3332, "2020-08-27"); +insert into diaries values(3333, "2020-08-28"); +insert into diaries values(3334, "2020-08-29"); +insert into diaries values(3335, "2020-08-30"); +insert into diaries values(3336, "2020-08-31"); +insert into diaries values(3337, "2020-09-01"); +insert into diaries values(3338, "2020-09-02"); +insert into diaries values(3339, "2020-09-03"); +insert into diaries values(3340, "2020-09-04"); +insert into diaries values(3341, "2020-09-05"); +insert into diaries values(3342, "2020-09-06"); +insert into diaries values(3343, "2020-09-07"); +insert into diaries values(3344, "2020-09-08"); +insert into diaries values(3345, "2020-09-09"); +insert into diaries values(3346, "2020-09-10"); +insert into diaries values(3347, "2020-09-11"); +insert into diaries values(3348, "2020-09-12"); +insert into diaries values(3349, "2020-09-13"); +insert into diaries values(3350, "2020-09-14"); +insert into diaries values(3351, "2020-09-15"); +insert into diaries values(3352, "2020-09-16"); +insert into diaries values(3353, "2020-09-17"); +insert into diaries values(3354, "2020-09-18"); +insert into diaries values(3355, "2020-09-19"); +insert into diaries values(3356, "2020-09-20"); +insert into diaries values(3357, "2020-09-21"); +insert into diaries values(3358, "2020-09-22"); +insert into diaries values(3359, "2020-09-23"); +insert into diaries values(3360, "2020-09-24"); +insert into diaries values(3361, "2020-09-25"); +insert into diaries values(3362, "2020-09-26"); +insert into diaries values(3363, "2020-09-27"); +insert into diaries values(3364, "2020-09-28"); +insert into diaries values(3365, "2020-09-29"); +insert into diaries values(3366, "2020-09-30"); +insert into diaries values(3367, "2020-10-01"); +insert into diaries values(3368, "2020-10-02"); +insert into diaries values(3369, "2020-10-03"); +insert into diaries values(3370, "2020-10-04"); +insert into diaries values(3371, "2020-10-05"); +insert into diaries values(3372, "2020-10-06"); +insert into diaries values(3373, "2020-10-07"); +insert into diaries values(3374, "2020-10-08"); +insert into diaries values(3375, "2020-10-09"); +insert into diaries values(3376, "2020-10-10"); +insert into diaries values(3377, "2020-10-11"); +insert into diaries values(3378, "2020-10-12"); +insert into diaries values(3379, "2020-10-13"); +insert into diaries values(3380, "2020-10-14"); +insert into diaries values(3381, "2020-10-15"); +insert into diaries values(3382, "2020-10-16"); +insert into diaries values(3383, "2020-10-17"); +insert into diaries values(3384, "2020-10-18"); +insert into diaries values(3385, "2020-10-19"); +insert into diaries values(3386, "2020-10-20"); +insert into diaries values(3387, "2020-10-21"); +insert into diaries values(3388, "2020-10-22"); +insert into diaries values(3389, "2020-10-23"); +insert into diaries values(3390, "2020-10-24"); +insert into diaries values(3391, "2020-10-25"); +insert into diaries values(3392, "2020-10-26"); +insert into diaries values(3393, "2020-10-27"); +insert into diaries values(3394, "2020-10-28"); +insert into diaries values(3395, "2020-10-29"); +insert into diaries values(3396, "2020-10-30"); +insert into diaries values(3397, "2020-10-31"); +insert into diaries values(3398, "2020-11-01"); +insert into diaries values(3399, "2020-11-02"); +insert into diaries values(3400, "2020-11-03"); +insert into diaries values(3401, "2020-11-04"); +insert into diaries values(3402, "2020-11-05"); +insert into diaries values(3403, "2020-11-06"); +insert into diaries values(3404, "2020-11-07"); +insert into diaries values(3405, "2020-11-08"); +insert into diaries values(3406, "2020-11-09"); +insert into diaries values(3407, "2020-11-10"); +insert into diaries values(3408, "2020-11-11"); +insert into diaries values(3409, "2020-11-12"); +insert into diaries values(3410, "2020-11-13"); +insert into diaries values(3411, "2020-11-14"); +insert into diaries values(3412, "2020-11-15"); +insert into diaries values(3413, "2020-11-16"); +insert into diaries values(3414, "2020-11-17"); +insert into diaries values(3415, "2020-11-18"); +insert into diaries values(3416, "2020-11-19"); +insert into diaries values(3417, "2020-11-20"); +insert into diaries values(3418, "2020-11-21"); +insert into diaries values(3419, "2020-11-22"); +insert into diaries values(3420, "2020-11-23"); +insert into diaries values(3421, "2020-11-24"); +insert into diaries values(3422, "2020-11-25"); +insert into diaries values(3423, "2020-11-26"); +insert into diaries values(3424, "2020-11-27"); +insert into diaries values(3425, "2020-11-28"); +insert into diaries values(3426, "2020-11-29"); +insert into diaries values(3427, "2020-11-30"); +insert into diaries values(3428, "2020-12-01"); +insert into diaries values(3429, "2020-12-02"); +insert into diaries values(3430, "2020-12-03"); +insert into diaries values(3431, "2020-12-04"); +insert into diaries values(3432, "2020-12-05"); +insert into diaries values(3433, "2020-12-06"); +insert into diaries values(3434, "2020-12-07"); +insert into diaries values(3435, "2020-12-08"); +insert into diaries values(3436, "2020-12-09"); +insert into diaries values(3437, "2020-12-10"); +insert into diaries values(3438, "2020-12-11"); +insert into diaries values(3439, "2020-12-12"); +insert into diaries values(3440, "2020-12-13"); +insert into diaries values(3441, "2020-12-14"); +insert into diaries values(3442, "2020-12-15"); +insert into diaries values(3443, "2020-12-16"); +insert into diaries values(3444, "2020-12-17"); +insert into diaries values(3445, "2020-12-18"); +insert into diaries values(3446, "2020-12-19"); +insert into diaries values(3447, "2020-12-20"); +insert into diaries values(3448, "2020-12-21"); +insert into diaries values(3449, "2020-12-22"); +insert into diaries values(3450, "2020-12-23"); +insert into diaries values(3451, "2020-12-24"); +insert into diaries values(3452, "2020-12-25"); +insert into diaries values(3453, "2020-12-26"); +insert into diaries values(3454, "2020-12-27"); +insert into diaries values(3455, "2020-12-28"); +insert into diaries values(3456, "2020-12-29"); +insert into diaries values(3457, "2020-12-30"); +insert into diaries values(3458, "2020-12-31"); +insert into diaries values(3459, "2021-01-01"); +insert into diaries values(3460, "2021-01-02"); +insert into diaries values(3461, "2021-01-03"); +insert into diaries values(3462, "2021-01-04"); +insert into diaries values(3463, "2021-01-05"); +insert into diaries values(3464, "2021-01-06"); +insert into diaries values(3465, "2021-01-07"); +insert into diaries values(3466, "2021-01-08"); +insert into diaries values(3467, "2021-01-09"); +insert into diaries values(3468, "2021-01-10"); +insert into diaries values(3469, "2021-01-11"); +insert into diaries values(3470, "2021-01-12"); +insert into diaries values(3471, "2021-01-13"); +insert into diaries values(3472, "2021-01-14"); +insert into diaries values(3473, "2021-01-15"); +insert into diaries values(3474, "2021-01-16"); +insert into diaries values(3475, "2021-01-17"); +insert into diaries values(3476, "2021-01-18"); +insert into diaries values(3477, "2021-01-19"); +insert into diaries values(3478, "2021-01-20"); +insert into diaries values(3479, "2021-01-21"); +insert into diaries values(3480, "2021-01-22"); +insert into diaries values(3481, "2021-01-23"); +insert into diaries values(3482, "2021-01-24"); +insert into diaries values(3483, "2021-01-25"); +insert into diaries values(3484, "2021-01-26"); +insert into diaries values(3485, "2021-01-27"); +insert into diaries values(3486, "2021-01-28"); +insert into diaries values(3487, "2021-01-29"); +insert into diaries values(3488, "2021-01-30"); +insert into diaries values(3489, "2021-01-31"); +insert into diaries values(3490, "2021-02-01"); +insert into diaries values(3491, "2021-02-02"); +insert into diaries values(3492, "2021-02-03"); +insert into diaries values(3493, "2021-02-04"); +insert into diaries values(3494, "2021-02-05"); +insert into diaries values(3495, "2021-02-06"); +insert into diaries values(3496, "2021-02-07"); +insert into diaries values(3497, "2021-02-08"); +insert into diaries values(3498, "2021-02-09"); +insert into diaries values(3499, "2021-02-10"); +insert into diaries values(3500, "2021-02-11"); +insert into diaries values(3501, "2021-02-12"); +insert into diaries values(3502, "2021-02-13"); +insert into diaries values(3503, "2021-02-14"); +insert into diaries values(3504, "2021-02-15"); +insert into diaries values(3505, "2021-02-16"); +insert into diaries values(3506, "2021-02-17"); +insert into diaries values(3507, "2021-02-18"); +insert into diaries values(3508, "2021-02-19"); +insert into diaries values(3509, "2021-02-20"); +insert into diaries values(3510, "2021-02-21"); +insert into diaries values(3511, "2021-02-22"); +insert into diaries values(3512, "2021-02-23"); +insert into diaries values(3513, "2021-02-24"); +insert into diaries values(3514, "2021-02-25"); +insert into diaries values(3515, "2021-02-26"); +insert into diaries values(3516, "2021-02-27"); +insert into diaries values(3517, "2021-02-28"); +insert into diaries values(3518, "2021-03-01"); +insert into diaries values(3519, "2021-03-02"); +insert into diaries values(3520, "2021-03-03"); +insert into diaries values(3521, "2021-03-04"); +insert into diaries values(3522, "2021-03-05"); +insert into diaries values(3523, "2021-03-06"); +insert into diaries values(3524, "2021-03-07"); +insert into diaries values(3525, "2021-03-08"); +insert into diaries values(3526, "2021-03-09"); +insert into diaries values(3527, "2021-03-10"); +insert into diaries values(3528, "2021-03-11"); +insert into diaries values(3529, "2021-03-12"); +insert into diaries values(3530, "2021-03-13"); +insert into diaries values(3531, "2021-03-14"); +insert into diaries values(3532, "2021-03-15"); +insert into diaries values(3533, "2021-03-16"); +insert into diaries values(3534, "2021-03-17"); +insert into diaries values(3535, "2021-03-18"); +insert into diaries values(3536, "2021-03-19"); +insert into diaries values(3537, "2021-03-20"); +insert into diaries values(3538, "2021-03-21"); +insert into diaries values(3539, "2021-03-22"); +insert into diaries values(3540, "2021-03-23"); +insert into diaries values(3541, "2021-03-24"); +insert into diaries values(3542, "2021-03-25"); +insert into diaries values(3543, "2021-03-26"); +insert into diaries values(3544, "2021-03-27"); +insert into diaries values(3545, "2021-03-28"); +insert into diaries values(3546, "2021-03-29"); +insert into diaries values(3547, "2021-03-30"); +insert into diaries values(3548, "2021-03-31"); +insert into diaries values(3549, "2021-04-01"); +insert into diaries values(3550, "2021-04-02"); +insert into diaries values(3551, "2021-04-03"); +insert into diaries values(3552, "2021-04-04"); +insert into diaries values(3553, "2021-04-05"); +insert into diaries values(3554, "2021-04-06"); +insert into diaries values(3555, "2021-04-07"); +insert into diaries values(3556, "2021-04-08"); +insert into diaries values(3557, "2021-04-09"); +insert into diaries values(3558, "2021-04-10"); +insert into diaries values(3559, "2021-04-11"); +insert into diaries values(3560, "2021-04-12"); +insert into diaries values(3561, "2021-04-13"); +insert into diaries values(3562, "2021-04-14"); +insert into diaries values(3563, "2021-04-15"); +insert into diaries values(3564, "2021-04-16"); +insert into diaries values(3565, "2021-04-17"); +insert into diaries values(3566, "2021-04-18"); +insert into diaries values(3567, "2021-04-19"); +insert into diaries values(3568, "2021-04-20"); +insert into diaries values(3569, "2021-04-21"); +insert into diaries values(3570, "2021-04-22"); +insert into diaries values(3571, "2021-04-23"); +insert into diaries values(3572, "2021-04-24"); +insert into diaries values(3573, "2021-04-25"); +insert into diaries values(3574, "2021-04-26"); +insert into diaries values(3575, "2021-04-27"); +insert into diaries values(3576, "2021-04-28"); +insert into diaries values(3577, "2021-04-29"); +insert into diaries values(3578, "2021-04-30"); +insert into diaries values(3579, "2021-05-01"); +insert into diaries values(3580, "2021-05-02"); +insert into diaries values(3581, "2021-05-03"); +insert into diaries values(3582, "2021-05-04"); +insert into diaries values(3583, "2021-05-05"); +insert into diaries values(3584, "2021-05-06"); +insert into diaries values(3585, "2021-05-07"); +insert into diaries values(3586, "2021-05-08"); +insert into diaries values(3587, "2021-05-09"); +insert into diaries values(3588, "2021-05-10"); +insert into diaries values(3589, "2021-05-11"); +insert into diaries values(3590, "2021-05-12"); +insert into diaries values(3591, "2021-05-13"); +insert into diaries values(3592, "2021-05-14"); +insert into diaries values(3593, "2021-05-15"); +insert into diaries values(3594, "2021-05-16"); +insert into diaries values(3595, "2021-05-17"); +insert into diaries values(3596, "2021-05-18"); +insert into diaries values(3597, "2021-05-19"); +insert into diaries values(3598, "2021-05-20"); +insert into diaries values(3599, "2021-05-21"); +insert into diaries values(3600, "2021-05-22"); +insert into diaries values(3601, "2021-05-23"); +insert into diaries values(3602, "2021-05-24"); +insert into diaries values(3603, "2021-05-25"); +insert into diaries values(3604, "2021-05-26"); +insert into diaries values(3605, "2021-05-27"); +insert into diaries values(3606, "2021-05-28"); +insert into diaries values(3607, "2021-05-29"); +insert into diaries values(3608, "2021-05-30"); +insert into diaries values(3609, "2021-05-31"); +insert into diaries values(3610, "2021-06-01"); +insert into diaries values(3611, "2021-06-02"); +insert into diaries values(3612, "2021-06-03"); +insert into diaries values(3613, "2021-06-04"); +insert into diaries values(3614, "2021-06-05"); +insert into diaries values(3615, "2021-06-06"); +insert into diaries values(3616, "2021-06-07"); +insert into diaries values(3617, "2021-06-08"); +insert into diaries values(3618, "2021-06-09"); +insert into diaries values(3619, "2021-06-10"); +insert into diaries values(3620, "2021-06-11"); +insert into diaries values(3621, "2021-06-12"); +insert into diaries values(3622, "2021-06-13"); +insert into diaries values(3623, "2021-06-14"); +insert into diaries values(3624, "2021-06-15"); +insert into diaries values(3625, "2021-06-16"); +insert into diaries values(3626, "2021-06-17"); +insert into diaries values(3627, "2021-06-18"); +insert into diaries values(3628, "2021-06-19"); +insert into diaries values(3629, "2021-06-20"); +insert into diaries values(3630, "2021-06-21"); +insert into diaries values(3631, "2021-06-22"); +insert into diaries values(3632, "2021-06-23"); +insert into diaries values(3633, "2021-06-24"); +insert into diaries values(3634, "2021-06-25"); +insert into diaries values(3635, "2021-06-26"); +insert into diaries values(3636, "2021-06-27"); +insert into diaries values(3637, "2021-06-28"); +insert into diaries values(3638, "2021-06-29"); +insert into diaries values(3639, "2021-06-30"); +insert into diaries values(3640, "2021-07-01"); +insert into diaries values(3641, "2021-07-02"); +insert into diaries values(3642, "2021-07-03"); +insert into diaries values(3643, "2021-07-04"); +insert into diaries values(3644, "2021-07-05"); +insert into diaries values(3645, "2021-07-06"); +insert into diaries values(3646, "2021-07-07"); +insert into diaries values(3647, "2021-07-08"); +insert into diaries values(3648, "2021-07-09"); +insert into diaries values(3649, "2021-07-10"); +insert into diaries values(3650, "2021-07-11"); +insert into diaries values(3651, "2021-07-12"); +insert into diaries values(3652, "2021-07-13"); +insert into diaries values(3653, "2021-07-14"); +insert into diaries values(3654, "2021-07-15"); +insert into diaries values(3655, "2021-07-16"); +insert into diaries values(3656, "2021-07-17"); +insert into diaries values(3657, "2021-07-18"); +insert into diaries values(3658, "2021-07-19"); +insert into diaries values(3659, "2021-07-20"); +insert into diaries values(3660, "2021-07-21"); +insert into diaries values(3661, "2021-07-22"); +insert into diaries values(3662, "2021-07-23"); +insert into diaries values(3663, "2021-07-24"); +insert into diaries values(3664, "2021-07-25"); +insert into diaries values(3665, "2021-07-26"); +insert into diaries values(3666, "2021-07-27"); +insert into diaries values(3667, "2021-07-28"); +insert into diaries values(3668, "2021-07-29"); +insert into diaries values(3669, "2021-07-30"); +insert into diaries values(3670, "2021-07-31"); +insert into diaries values(3671, "2021-08-01"); +insert into diaries values(3672, "2021-08-02"); +insert into diaries values(3673, "2021-08-03"); +insert into diaries values(3674, "2021-08-04"); +insert into diaries values(3675, "2021-08-05"); +insert into diaries values(3676, "2021-08-06"); +insert into diaries values(3677, "2021-08-07"); +insert into diaries values(3678, "2021-08-08"); +insert into diaries values(3679, "2021-08-09"); +insert into diaries values(3680, "2021-08-10"); +insert into diaries values(3681, "2021-08-11"); +insert into diaries values(3682, "2021-08-12"); +insert into diaries values(3683, "2021-08-13"); +insert into diaries values(3684, "2021-08-14"); +insert into diaries values(3685, "2021-08-15"); +insert into diaries values(3686, "2021-08-16"); +insert into diaries values(3687, "2021-08-17"); +insert into diaries values(3688, "2021-08-18"); +insert into diaries values(3689, "2021-08-19"); +insert into diaries values(3690, "2021-08-20"); +insert into diaries values(3691, "2021-08-21"); +insert into diaries values(3692, "2021-08-22"); +insert into diaries values(3693, "2021-08-23"); +insert into diaries values(3694, "2021-08-24"); +insert into diaries values(3695, "2021-08-25"); +insert into diaries values(3696, "2021-08-26"); +insert into diaries values(3697, "2021-08-27"); +insert into diaries values(3698, "2021-08-28"); +insert into diaries values(3699, "2021-08-29"); +insert into diaries values(3700, "2021-08-30"); +insert into diaries values(3701, "2021-08-31"); +insert into diaries values(3702, "2021-09-01"); +insert into diaries values(3703, "2021-09-02"); +insert into diaries values(3704, "2021-09-03"); +insert into diaries values(3705, "2021-09-04"); +insert into diaries values(3706, "2021-09-05"); +insert into diaries values(3707, "2021-09-06"); +insert into diaries values(3708, "2021-09-07"); +insert into diaries values(3709, "2021-09-08"); +insert into diaries values(3710, "2021-09-09"); +insert into diaries values(3711, "2021-09-10"); +insert into diaries values(3712, "2021-09-11"); +insert into diaries values(3713, "2021-09-12"); +insert into diaries values(3714, "2021-09-13"); +insert into diaries values(3715, "2021-09-14"); +insert into diaries values(3716, "2021-09-15"); +insert into diaries values(3717, "2021-09-16"); +insert into diaries values(3718, "2021-09-17"); +insert into diaries values(3719, "2021-09-18"); +insert into diaries values(3720, "2021-09-19"); +insert into diaries values(3721, "2021-09-20"); +insert into diaries values(3722, "2021-09-21"); +insert into diaries values(3723, "2021-09-22"); +insert into diaries values(3724, "2021-09-23"); +insert into diaries values(3725, "2021-09-24"); +insert into diaries values(3726, "2021-09-25"); +insert into diaries values(3727, "2021-09-26"); +insert into diaries values(3728, "2021-09-27"); +insert into diaries values(3729, "2021-09-28"); +insert into diaries values(3730, "2021-09-29"); +insert into diaries values(3731, "2021-09-30"); +insert into diaries values(3732, "2021-10-01"); +insert into diaries values(3733, "2021-10-02"); +insert into diaries values(3734, "2021-10-03"); +insert into diaries values(3735, "2021-10-04"); +insert into diaries values(3736, "2021-10-05"); +insert into diaries values(3737, "2021-10-06"); +insert into diaries values(3738, "2021-10-07"); +insert into diaries values(3739, "2021-10-08"); +insert into diaries values(3740, "2021-10-09"); +insert into diaries values(3741, "2021-10-10"); +insert into diaries values(3742, "2021-10-11"); +insert into diaries values(3743, "2021-10-12"); +insert into diaries values(3744, "2021-10-13"); +insert into diaries values(3745, "2021-10-14"); +insert into diaries values(3746, "2021-10-15"); +insert into diaries values(3747, "2021-10-16"); +insert into diaries values(3748, "2021-10-17"); +insert into diaries values(3749, "2021-10-18"); +insert into diaries values(3750, "2021-10-19"); +insert into diaries values(3751, "2021-10-20"); +insert into diaries values(3752, "2021-10-21"); +insert into diaries values(3753, "2021-10-22"); +insert into diaries values(3754, "2021-10-23"); +insert into diaries values(3755, "2021-10-24"); +insert into diaries values(3756, "2021-10-25"); +insert into diaries values(3757, "2021-10-26"); +insert into diaries values(3758, "2021-10-27"); +insert into diaries values(3759, "2021-10-28"); +insert into diaries values(3760, "2021-10-29"); +insert into diaries values(3761, "2021-10-30"); +insert into diaries values(3762, "2021-10-31"); +insert into diaries values(3763, "2021-11-01"); +insert into diaries values(3764, "2021-11-02"); +insert into diaries values(3765, "2021-11-03"); +insert into diaries values(3766, "2021-11-04"); +insert into diaries values(3767, "2021-11-05"); +insert into diaries values(3768, "2021-11-06"); +insert into diaries values(3769, "2021-11-07"); +insert into diaries values(3770, "2021-11-08"); +insert into diaries values(3771, "2021-11-09"); +insert into diaries values(3772, "2021-11-10"); +insert into diaries values(3773, "2021-11-11"); +insert into diaries values(3774, "2021-11-12"); +insert into diaries values(3775, "2021-11-13"); +insert into diaries values(3776, "2021-11-14"); +insert into diaries values(3777, "2021-11-15"); +insert into diaries values(3778, "2021-11-16"); +insert into diaries values(3779, "2021-11-17"); +insert into diaries values(3780, "2021-11-18"); +insert into diaries values(3781, "2021-11-19"); +insert into diaries values(3782, "2021-11-20"); +insert into diaries values(3783, "2021-11-21"); +insert into diaries values(3784, "2021-11-22"); +insert into diaries values(3785, "2021-11-23"); +insert into diaries values(3786, "2021-11-24"); +insert into diaries values(3787, "2021-11-25"); +insert into diaries values(3788, "2021-11-26"); +insert into diaries values(3789, "2021-11-27"); +insert into diaries values(3790, "2021-11-28"); +insert into diaries values(3791, "2021-11-29"); +insert into diaries values(3792, "2021-11-30"); +insert into diaries values(3793, "2021-12-01"); +insert into diaries values(3794, "2021-12-02"); +insert into diaries values(3795, "2021-12-03"); +insert into diaries values(3796, "2021-12-04"); +insert into diaries values(3797, "2021-12-05"); +insert into diaries values(3798, "2021-12-06"); +insert into diaries values(3799, "2021-12-07"); +insert into diaries values(3800, "2021-12-08"); +insert into diaries values(3801, "2021-12-09"); +insert into diaries values(3802, "2021-12-10"); +insert into diaries values(3803, "2021-12-11"); +insert into diaries values(3804, "2021-12-12"); +insert into diaries values(3805, "2021-12-13"); +insert into diaries values(3806, "2021-12-14"); +insert into diaries values(3807, "2021-12-15"); +insert into diaries values(3808, "2021-12-16"); +insert into diaries values(3809, "2021-12-17"); +insert into diaries values(3810, "2021-12-18"); +insert into diaries values(3811, "2021-12-19"); +insert into diaries values(3812, "2021-12-20"); +insert into diaries values(3813, "2021-12-21"); +insert into diaries values(3814, "2021-12-22"); +insert into diaries values(3815, "2021-12-23"); +insert into diaries values(3816, "2021-12-24"); +insert into diaries values(3817, "2021-12-25"); +insert into diaries values(3818, "2021-12-26"); +insert into diaries values(3819, "2021-12-27"); +insert into diaries values(3820, "2021-12-28"); +insert into diaries values(3821, "2021-12-29"); +insert into diaries values(3822, "2021-12-30"); +insert into diaries values(3823, "2021-12-31"); +insert into diaries values(3824, "2022-01-01"); +insert into diaries values(3825, "2022-01-02"); +insert into diaries values(3826, "2022-01-03"); +insert into diaries values(3827, "2022-01-04"); +insert into diaries values(3828, "2022-01-05"); +insert into diaries values(3829, "2022-01-06"); +insert into diaries values(3830, "2022-01-07"); +insert into diaries values(3831, "2022-01-08"); +insert into diaries values(3832, "2022-01-09"); +insert into diaries values(3833, "2022-01-10"); +insert into diaries values(3834, "2022-01-11"); +insert into diaries values(3835, "2022-01-12"); +insert into diaries values(3836, "2022-01-13"); +insert into diaries values(3837, "2022-01-14"); +insert into diaries values(3838, "2022-01-15"); +insert into diaries values(3839, "2022-01-16"); +insert into diaries values(3840, "2022-01-17"); +insert into diaries values(3841, "2022-01-18"); +insert into diaries values(3842, "2022-01-19"); +insert into diaries values(3843, "2022-01-20"); +insert into diaries values(3844, "2022-01-21"); +insert into diaries values(3845, "2022-01-22"); +insert into diaries values(3846, "2022-01-23"); +insert into diaries values(3847, "2022-01-24"); +insert into diaries values(3848, "2022-01-25"); +insert into diaries values(3849, "2022-01-26"); +insert into diaries values(3850, "2022-01-27"); +insert into diaries values(3851, "2022-01-28"); +insert into diaries values(3852, "2022-01-29"); +insert into diaries values(3853, "2022-01-30"); +insert into diaries values(3854, "2022-01-31"); +insert into diaries values(3855, "2022-02-01"); +insert into diaries values(3856, "2022-02-02"); +insert into diaries values(3857, "2022-02-03"); +insert into diaries values(3858, "2022-02-04"); +insert into diaries values(3859, "2022-02-05"); +insert into diaries values(3860, "2022-02-06"); +insert into diaries values(3861, "2022-02-07"); +insert into diaries values(3862, "2022-02-08"); +insert into diaries values(3863, "2022-02-09"); +insert into diaries values(3864, "2022-02-10"); +insert into diaries values(3865, "2022-02-11"); +insert into diaries values(3866, "2022-02-12"); +insert into diaries values(3867, "2022-02-13"); +insert into diaries values(3868, "2022-02-14"); +insert into diaries values(3869, "2022-02-15"); +insert into diaries values(3870, "2022-02-16"); +insert into diaries values(3871, "2022-02-17"); +insert into diaries values(3872, "2022-02-18"); +insert into diaries values(3873, "2022-02-19"); +insert into diaries values(3874, "2022-02-20"); +insert into diaries values(3875, "2022-02-21"); +insert into diaries values(3876, "2022-02-22"); +insert into diaries values(3877, "2022-02-23"); +insert into diaries values(3878, "2022-02-24"); +insert into diaries values(3879, "2022-02-25"); +insert into diaries values(3880, "2022-02-26"); +insert into diaries values(3881, "2022-02-27"); +insert into diaries values(3882, "2022-02-28"); +insert into diaries values(3883, "2022-03-01"); +insert into diaries values(3884, "2022-03-02"); +insert into diaries values(3885, "2022-03-03"); +insert into diaries values(3886, "2022-03-04"); +insert into diaries values(3887, "2022-03-05"); +insert into diaries values(3888, "2022-03-06"); +insert into diaries values(3889, "2022-03-07"); +insert into diaries values(3890, "2022-03-08"); +insert into diaries values(3891, "2022-03-09"); +insert into diaries values(3892, "2022-03-10"); +insert into diaries values(3893, "2022-03-11"); +insert into diaries values(3894, "2022-03-12"); +insert into diaries values(3895, "2022-03-13"); +insert into diaries values(3896, "2022-03-14"); +insert into diaries values(3897, "2022-03-15"); +insert into diaries values(3898, "2022-03-16"); +insert into diaries values(3899, "2022-03-17"); +insert into diaries values(3900, "2022-03-18"); +insert into diaries values(3901, "2022-03-19"); +insert into diaries values(3902, "2022-03-20"); +insert into diaries values(3903, "2022-03-21"); +insert into diaries values(3904, "2022-03-22"); +insert into diaries values(3905, "2022-03-23"); +insert into diaries values(3906, "2022-03-24"); +insert into diaries values(3907, "2022-03-25"); +insert into diaries values(3908, "2022-03-26"); +insert into diaries values(3909, "2022-03-27"); +insert into diaries values(3910, "2022-03-28"); +insert into diaries values(3911, "2022-03-29"); +insert into diaries values(3912, "2022-03-30"); +insert into diaries values(3913, "2022-03-31"); +insert into diaries values(3914, "2022-04-01"); +insert into diaries values(3915, "2022-04-02"); +insert into diaries values(3916, "2022-04-03"); +insert into diaries values(3917, "2022-04-04"); +insert into diaries values(3918, "2022-04-05"); +insert into diaries values(3919, "2022-04-06"); +insert into diaries values(3920, "2022-04-07"); +insert into diaries values(3921, "2022-04-08"); +insert into diaries values(3922, "2022-04-09"); +insert into diaries values(3923, "2022-04-10"); +insert into diaries values(3924, "2022-04-11"); +insert into diaries values(3925, "2022-04-12"); +insert into diaries values(3926, "2022-04-13"); +insert into diaries values(3927, "2022-04-14"); +insert into diaries values(3928, "2022-04-15"); +insert into diaries values(3929, "2022-04-16"); +insert into diaries values(3930, "2022-04-17"); +insert into diaries values(3931, "2022-04-18"); +insert into diaries values(3932, "2022-04-19"); +insert into diaries values(3933, "2022-04-20"); +insert into diaries values(3934, "2022-04-21"); +insert into diaries values(3935, "2022-04-22"); +insert into diaries values(3936, "2022-04-23"); +insert into diaries values(3937, "2022-04-24"); +insert into diaries values(3938, "2022-04-25"); +insert into diaries values(3939, "2022-04-26"); +insert into diaries values(3940, "2022-04-27"); +insert into diaries values(3941, "2022-04-28"); +insert into diaries values(3942, "2022-04-29"); +insert into diaries values(3943, "2022-04-30"); +insert into diaries values(3944, "2022-05-01"); +insert into diaries values(3945, "2022-05-02"); +insert into diaries values(3946, "2022-05-03"); +insert into diaries values(3947, "2022-05-04"); +insert into diaries values(3948, "2022-05-05"); +insert into diaries values(3949, "2022-05-06"); +insert into diaries values(3950, "2022-05-07"); +insert into diaries values(3951, "2022-05-08"); +insert into diaries values(3952, "2022-05-09"); +insert into diaries values(3953, "2022-05-10"); +insert into diaries values(3954, "2022-05-11"); +insert into diaries values(3955, "2022-05-12"); +insert into diaries values(3956, "2022-05-13"); +insert into diaries values(3957, "2022-05-14"); +insert into diaries values(3958, "2022-05-15"); +insert into diaries values(3959, "2022-05-16"); +insert into diaries values(3960, "2022-05-17"); +insert into diaries values(3961, "2022-05-18"); +insert into diaries values(3962, "2022-05-19"); +insert into diaries values(3963, "2022-05-20"); +insert into diaries values(3964, "2022-05-21"); +insert into diaries values(3965, "2022-05-22"); +insert into diaries values(3966, "2022-05-23"); +insert into diaries values(3967, "2022-05-24"); +insert into diaries values(3968, "2022-05-25"); +insert into diaries values(3969, "2022-05-26"); +insert into diaries values(3970, "2022-05-27"); +insert into diaries values(3971, "2022-05-28"); +insert into diaries values(3972, "2022-05-29"); +insert into diaries values(3973, "2022-05-30"); +insert into diaries values(3974, "2022-05-31"); +insert into diaries values(3975, "2022-06-01"); +insert into diaries values(3976, "2022-06-02"); +insert into diaries values(3977, "2022-06-03"); +insert into diaries values(3978, "2022-06-04"); +insert into diaries values(3979, "2022-06-05"); +insert into diaries values(3980, "2022-06-06"); +insert into diaries values(3981, "2022-06-07"); +insert into diaries values(3982, "2022-06-08"); +insert into diaries values(3983, "2022-06-09"); +insert into diaries values(3984, "2022-06-10"); +insert into diaries values(3985, "2022-06-11"); +insert into diaries values(3986, "2022-06-12"); +insert into diaries values(3987, "2022-06-13"); +insert into diaries values(3988, "2022-06-14"); +insert into diaries values(3989, "2022-06-15"); +insert into diaries values(3990, "2022-06-16"); +insert into diaries values(3991, "2022-06-17"); +insert into diaries values(3992, "2022-06-18"); +insert into diaries values(3993, "2022-06-19"); +insert into diaries values(3994, "2022-06-20"); +insert into diaries values(3995, "2022-06-21"); +insert into diaries values(3996, "2022-06-22"); +insert into diaries values(3997, "2022-06-23"); +insert into diaries values(3998, "2022-06-24"); +insert into diaries values(3999, "2022-06-25"); +insert into diaries values(4000, "2022-06-26"); +insert into diaries values(4001, "2022-06-27"); +insert into diaries values(4002, "2022-06-28"); +insert into diaries values(4003, "2022-06-29"); +insert into diaries values(4004, "2022-06-30"); +insert into diaries values(4005, "2022-07-01"); +insert into diaries values(4006, "2022-07-02"); +insert into diaries values(4007, "2022-07-03"); +insert into diaries values(4008, "2022-07-04"); +insert into diaries values(4009, "2022-07-05"); +insert into diaries values(4010, "2022-07-06"); +insert into diaries values(4011, "2022-07-07"); +insert into diaries values(4012, "2022-07-08"); +insert into diaries values(4013, "2022-07-09"); +insert into diaries values(4014, "2022-07-10"); +insert into diaries values(4015, "2022-07-11"); +insert into diaries values(4016, "2022-07-12"); +insert into diaries values(4017, "2022-07-13"); +insert into diaries values(4018, "2022-07-14"); +insert into diaries values(4019, "2022-07-15"); +insert into diaries values(4020, "2022-07-16"); +insert into diaries values(4021, "2022-07-17"); +insert into diaries values(4022, "2022-07-18"); +insert into diaries values(4023, "2022-07-19"); +insert into diaries values(4024, "2022-07-20"); +insert into diaries values(4025, "2022-07-21"); +insert into diaries values(4026, "2022-07-22"); +insert into diaries values(4027, "2022-07-23"); +insert into diaries values(4028, "2022-07-24"); +insert into diaries values(4029, "2022-07-25"); +insert into diaries values(4030, "2022-07-26"); +insert into diaries values(4031, "2022-07-27"); +insert into diaries values(4032, "2022-07-28"); +insert into diaries values(4033, "2022-07-29"); +insert into diaries values(4034, "2022-07-30"); +insert into diaries values(4035, "2022-07-31"); +insert into diaries values(4036, "2022-08-01"); +insert into diaries values(4037, "2022-08-02"); +insert into diaries values(4038, "2022-08-03"); +insert into diaries values(4039, "2022-08-04"); +insert into diaries values(4040, "2022-08-05"); +insert into diaries values(4041, "2022-08-06"); +insert into diaries values(4042, "2022-08-07"); +insert into diaries values(4043, "2022-08-08"); +insert into diaries values(4044, "2022-08-09"); +insert into diaries values(4045, "2022-08-10"); +insert into diaries values(4046, "2022-08-11"); +insert into diaries values(4047, "2022-08-12"); +insert into diaries values(4048, "2022-08-13"); +insert into diaries values(4049, "2022-08-14"); +insert into diaries values(4050, "2022-08-15"); +insert into diaries values(4051, "2022-08-16"); +insert into diaries values(4052, "2022-08-17"); +insert into diaries values(4053, "2022-08-18"); +insert into diaries values(4054, "2022-08-19"); +insert into diaries values(4055, "2022-08-20"); +insert into diaries values(4056, "2022-08-21"); +insert into diaries values(4057, "2022-08-22"); +insert into diaries values(4058, "2022-08-23"); +insert into diaries values(4059, "2022-08-24"); +insert into diaries values(4060, "2022-08-25"); +insert into diaries values(4061, "2022-08-26"); +insert into diaries values(4062, "2022-08-27"); +insert into diaries values(4063, "2022-08-28"); +insert into diaries values(4064, "2022-08-29"); +insert into diaries values(4065, "2022-08-30"); +insert into diaries values(4066, "2022-08-31"); +insert into diaries values(4067, "2022-09-01"); +insert into diaries values(4068, "2022-09-02"); +insert into diaries values(4069, "2022-09-03"); +insert into diaries values(4070, "2022-09-04"); +insert into diaries values(4071, "2022-09-05"); +insert into diaries values(4072, "2022-09-06"); +insert into diaries values(4073, "2022-09-07"); +insert into diaries values(4074, "2022-09-08"); +insert into diaries values(4075, "2022-09-09"); +insert into diaries values(4076, "2022-09-10"); +insert into diaries values(4077, "2022-09-11"); +insert into diaries values(4078, "2022-09-12"); +insert into diaries values(4079, "2022-09-13"); +insert into diaries values(4080, "2022-09-14"); +insert into diaries values(4081, "2022-09-15"); +insert into diaries values(4082, "2022-09-16"); +insert into diaries values(4083, "2022-09-17"); +insert into diaries values(4084, "2022-09-18"); +insert into diaries values(4085, "2022-09-19"); +insert into diaries values(4086, "2022-09-20"); +insert into diaries values(4087, "2022-09-21"); +insert into diaries values(4088, "2022-09-22"); +insert into diaries values(4089, "2022-09-23"); +insert into diaries values(4090, "2022-09-24"); +insert into diaries values(4091, "2022-09-25"); +insert into diaries values(4092, "2022-09-26"); +insert into diaries values(4093, "2022-09-27"); +insert into diaries values(4094, "2022-09-28"); +insert into diaries values(4095, "2022-09-29"); +commit; +set autocommit=1; + +select * from diaries where match(title) against("2022-09-0"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..61aa07d8da2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + 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, "富士山", "今日もきれい。"); +delete from diaries where id = 2; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..8ddfa82e84a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test @@ -0,0 +1,43 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + 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, "富士山", "今日もきれい。"); +select * from diaries; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..1e2413689d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test @@ -0,0 +1,51 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + 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, "富士山", "今日もきれい。"); +select * from diaries where match(title, content) against("富士山"); + +drop index title on diaries; +--error ER_FT_MATCHING_KEY_NOT_FOUND +select * from diaries where match(title, content) against("富士山"); + +create fulltext index new_title_content_index on diaries (title, content); +select * from diaries where match(title, content) against("富士山"); + +select * from diaries; + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..44690e699a0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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), + 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, "富士山", "今日もきれい。"); +update diaries set title = "チョモランマ" where id = 3; +update diaries set content = "チョモランマと富士山" where id = 1; +select * from diaries where match(title, content) against("富士山"); +select * from diaries where match(title) against("富士山"); +select * from diaries where match(content) against("富士山"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..97a8a1f07a5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test @@ -0,0 +1,48 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + body text, + 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..."); +insert into diaries (title, body) values ("groonga (2)", "started groonga."); + +select * from diaries + where match(title) against("survey") and + match(body) against("groonga"); + +select *, match(title) against("survey"), match(body) against("groonga") + from diaries + where match(title) against("survey") and + match(body) against("groonga"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test new file mode 100644 index 00000000000..eda8a5f15ef --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test @@ -0,0 +1,102 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +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"); +select * from t1; +flush tables; +select * from t1; +drop table t1; + +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "myisam"'; +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"); +select * from t1; +select * from t1 where match(c3) against("su"); +select * from t1 where match(c3) against("ii"); +select * from t1 where match(c3) against("+su" in boolean mode); +select * from t1 where match(c3) against("+ii" in boolean mode); +drop table t1; + +set names utf8; +create table t1 (c1 int primary key, c2 varchar(255), c3 text, fulltext index(c2), fulltext index(c3)) default charset utf8 COMMENT = 'engine "myisam"'; +insert into t1 values(1, "明日の富士山の天気について","あああああああ"); +insert into t1 values(2, "いいいいい","明日の富士山の天気は分かりません"); +insert into t1 values(3, "dummy", "dummy"); +select * from t1; +select * from t1 where match(c2) against("富士山"); +select * from t1 where match(c3) against("富士山"); +drop table t1; + +create table t1 (c1 int primary key, c2 varchar(100), fulltext index(c2)) default charset utf8 COMMENT = 'engine "myisam"'; +create table t2 (c1 int primary key, c2 text, fulltext index(c2)) default charset utf8 COMMENT = 'engine "myisam"'; +insert into t1 values (1, "aa ii uu ee oo"); +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; +select * from t1; +select * from t2; +select * from t1 where c1=3; +select * from t2 where c1=3; +select * from t1 where c1>3 order by c1 desc; +select * from t2 where c1>3 order by c1 asc; +select * from t1 where c2>"s" order by c2 desc; +select * from t2 where c2>"s" order by c1 asc; +select *,match(c2) against("ii") from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; +select *,match(c2) against("ii") from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); +drop table t1,t2; + +# for "not match against" +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "myisam"'; +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +select *,match(c3) against("uu") from t1 where match(c3) against("uu"); +select * from t1 where not match(c3) against("uu"); +select *,match(c3) against("dummy") from t1 where match(c3) against("dummy"); +select * from t1 where not match(c3) against("dummy"); +select * from t1 where c1 = 4 and not match(c3) against("uu"); +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +select * from t1 where c1 > 4 and not match(c3) against("uu"); +select * from t1 where c2 = 10 and not match(c3) against("uu"); +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +select * from t1 where c2 < 15 and not match(c3) against("uu"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..6ce01598136 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test @@ -0,0 +1,47 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int, c3 text, fulltext index ft(c3)) COMMENT = 'engine "innodb"'; +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,10,"ka ki ku ke ko"); +insert into t1 values(3,10,"aa ii uu ee oo"); +insert into t1 values(4,10,"ka ki ku ke ko"); +insert into t1 values(5,20,"aa ii uu ee oo"); +insert into t1 values(6,20,"ka ki ku ke ko"); +insert into t1 values(7,20,"aa ii uu ee oo"); +insert into t1 values(8,20,"ka ki ku ke ko"); +select * from t1; +select *,match(c3) against("uu") from t1 where match(c3) against("uu"); +select * from t1 where not match(c3) against("uu"); +select *,match(c3) against("dummy") from t1 where match(c3) against("dummy"); +select * from t1 where not match(c3) against("dummy"); +select * from t1 where c1 = 4 and not match(c3) against("uu"); +select * from t1 where c1 <= 4 and not match(c3) against("uu"); +select * from t1 where c1 > 4 and not match(c3) against("uu"); +select * from t1 where c2 = 10 and not match(c3) against("uu"); +select * from t1 where c2 >= 15 and not match(c3) against("uu"); +select * from t1 where c2 < 15 and not match(c3) against("uu"); +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..5361b151661 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE ft( + a INT, + 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'); +INSERT INTO ft VALUES(3,'ccccc','cdefg'); +INSERT INTO ft VALUES(4,'ddddd','defgh'); +INSERT INTO ft VALUES(5,'eeeee','efghi'); + +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c FROM ft WHERE MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE) ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft WHERE MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE); +SELECT a, b, c, MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE) FROM ft ORDER BY MATCH(c) AGAINST('bbbbb' IN BOOLEAN MODE), MATCH(b) AGAINST('bbbbb' IN BOOLEAN MODE), a; + +DROP TABLE ft; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..91e2f73da1d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test @@ -0,0 +1,64 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + body TEXT, + 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!"); +INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries + WHERE MATCH(body) AGAINST("groonga") + ORDER BY id; + +CONNECT(search_connection, localhost, root); +USE test; +SELECT * FROM diaries + WHERE MATCH(body) AGAINST("groonga") + ORDER BY id; + +CONNECTION default; +COMMIT; + +CONNECTION search_connection; +SELECT * FROM diaries + WHERE MATCH(body) AGAINST("groonga") + ORDER BY id; +DISCONNECT search_connection; + +CONNECTION default; +SELECT * FROM diaries + WHERE MATCH(body) AGAINST("groonga") + ORDER BY id; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_parser_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_parser_comment.test new file mode 100644 index 00000000000..fe80aae0804 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_parser_comment.test @@ -0,0 +1,39 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_fulltext_index_comment.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, + body text, + 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."); +select * from diaries; +select * from diaries where match(body) against("start"); +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_grn_id.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_grn_id.test new file mode 100644 index 00000000000..c4961756a26 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_grn_id.test @@ -0,0 +1,52 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +DROP FUNCTION IF EXISTS last_insert_grn_id; +--enable_warnings + +--disable_query_log +if ($VERSION_COMPILE_OS_WIN) +{ + CREATE FUNCTION last_insert_grn_id RETURNS integer SONAME 'ha_mroonga.dll'; +} +if (!$VERSION_COMPILE_OS_WIN) +{ + CREATE FUNCTION last_insert_grn_id RETURNS integer SONAME 'ha_mroonga.so'; +} +--enable_query_log + +CREATE TABLE ids ( + id int AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; + +SELECT last_insert_grn_id(); + +INSERT INTO ids VALUES(); +SELECT last_insert_grn_id(); +SELECT * FROM ids; + +DROP TABLE ids; + +DROP FUNCTION last_insert_grn_id; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..1b7c3a7f265 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test @@ -0,0 +1,36 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; + +SELECT last_insert_id(); + +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +SELECT * FROM ids; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6dc87f740f9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test @@ -0,0 +1,38 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 AUTO_INCREMENT PRIMARY KEY +) COMMENT='ENGINE "InnoDB"'; + +SELECT last_insert_id(); +SELECT last_insert_id(10); +SELECT last_insert_id(); + +INSERT INTO ids VALUES(); +SELECT last_insert_id(); +SELECT * FROM ids; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4676fc61331 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test @@ -0,0 +1,145 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_geometry.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) +) comment = 'engine "innodb"'; +show create table shops; +insert into shops (name, location) + values ('nezu-no-taiyaki', + GeomFromText('POINT(139.762573 35.720253)')); +insert into shops (name, location) + values ('taiyaki-kataoka', + GeomFromText('POINT(139.715591 35.712521)')); +insert into shops (name, location) + values ('soba-taiyaki-ku', + GeomFromText('POINT(139.659088 35.683712)')); +insert into shops (name, location) + values ('kuruma', + GeomFromText('POINT(139.706207 35.721516)')); +insert into shops (name, location) + values ('hirose-ya', + GeomFromText('POINT(139.685608 35.714844)')); +insert into shops (name, location) + values ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +insert into shops (name, location) + values ('omede-taiyaki', + GeomFromText('POINT(139.817154 35.700516)')); +insert into shops (name, location) + values ('onaga-ya', + GeomFromText('POINT(139.81105 35.698254)')); +insert into shops (name, location) + values ('shiro-ya', + GeomFromText('POINT(139.638611 35.705517)')); +insert into shops (name, location) + values ('fuji-ya', + GeomFromText('POINT(139.637115 35.703938)')); +insert into shops (name, location) + values ('miyoshi', + GeomFromText('POINT(139.537323 35.644539)')); +insert into shops (name, location) + values ('juju-ya', + GeomFromText('POINT(139.695755 35.628922)')); +insert into shops (name, location) + values ('tatsumi-ya', + GeomFromText('POINT(139.638657 35.665501)')); +insert into shops (name, location) + values ('tetsuji', + GeomFromText('POINT(139.76857 35.680912)')); +insert into shops (name, location) + values ('gazuma-ya', + GeomFromText('POINT(139.647598 35.700817)')); +insert into shops (name, location) + values ('honma-mon', + GeomFromText('POINT(139.652573 35.722736)')); +insert into shops (name, location) + values ('naniwa-ya', + GeomFromText('POINT(139.796234 35.730061)')); +insert into shops (name, location) + values ('kuro-dai', + GeomFromText('POINT(139.704834 35.650345)')); +insert into shops (name, location) + values ('daruma', + GeomFromText('POINT(139.770599 35.681461)')); +insert into shops (name, location) + values ('yanagi-ya', + GeomFromText('POINT(139.783981 35.685341)')); +insert into shops (name, location) + values ('sharaku', + GeomFromText('POINT(139.794846 35.716969)')); +insert into shops (name, location) + values ('takane', + GeomFromText('POINT(139.560913 35.698601)')); +insert into shops (name, location) + values ('chiyoda', + GeomFromText('POINT(139.652817 35.642601)')); +insert into shops (name, location) + values ('da-ka-po', + GeomFromText('POINT(139.727356 35.627346)')); +insert into shops (name, location) + values ('matsushima-ya', + GeomFromText('POINT(139.737381 35.640556)')); +insert into shops (name, location) + values ('kazuya', + GeomFromText('POINT(139.760895 35.673508)')); +insert into shops (name, location) + values ('furuya-kogane-an', + GeomFromText('POINT(139.676071 35.680603)')); +insert into shops (name, location) + values ('hachi-no-ie', + GeomFromText('POINT(139.668106 35.608021)')); +insert into shops (name, location) + values ('azuki-chan', + GeomFromText('POINT(139.673203 35.64151)')); +insert into shops (name, location) + values ('kuriko-an', + GeomFromText('POINT(139.796829 35.712013)')); +insert into shops (name, location) + values ('yume-no-aru-machi-no-taiyaki-ya-san', + GeomFromText('POINT(139.712524 35.616199)')); +insert into shops (name, location) + values ('naze-ya', + GeomFromText('POINT(139.665833 35.609039)')); +insert into shops (name, location) + values ('sanoki-ya', + GeomFromText('POINT(139.770721 35.66592)')); +insert into shops (name, location) + values ('shigeta', + GeomFromText('POINT(139.780273 35.672626)')); +insert into shops (name, location) + values ('nishimi-ya', + GeomFromText('POINT(139.774628 35.671825)')); +insert into shops (name, location) + values ('hiiragi', + GeomFromText('POINT(139.711517 35.647701)')); +select id, name, AsText(location) as location_text from shops; +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +drop table shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test new file mode 100644 index 00000000000..25814635b22 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test @@ -0,0 +1,48 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_geometry.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) +) comment = 'engine "innodb"'; +show create table shops; + +insert into shops (name, location) + values ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); + +delete from shops + where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); + +select id, name, AsText(location) as location_text from shops; + +drop table shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test new file mode 100644 index 00000000000..c6bb8a1d4e6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test @@ -0,0 +1,50 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/have_geometry.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) +) comment = 'engine "innodb"'; +show create table shops; + +insert into shops (name, location) + values ('sazare', + GeomFromText('POINT(139.685043 35.714653)')); +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); + +update shops set location = GeomFromText('POINT(139.66116 35.57566)') + where name = 'sazare'; +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, AsText(location) as location_text from shops + where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); + +drop table shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..037f8b02fbf --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test @@ -0,0 +1,32 @@ +# Copyright(C) 2013 Kentoku SHIBA +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 AUTO_INCREMENT +) DEFAULT CHARSET UTF8 COMMENT = 'engine "InnoDB"'; +SELECT COUNT(*) FROM ids FORCE INDEX(PRIMARY); + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..e619b0af930 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test @@ -0,0 +1,91 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +# data types +create table t1 (c1 tinyint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 smallint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 mediumint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 int primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 bigint primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(1); +select * from t1; +drop table t1; + +create table t1 (c1 float primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(0.5); +select * from t1; +drop table t1; + +create table t1 (c1 double primary key) COMMENT = 'engine "innodb"'; +insert into t1 values(0.5); +select * from t1; +drop table t1; + +create table t1 (c1 date primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010/03/26"); +select * from t1; +drop table t1; + +create table t1 (c1 time primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("11:22:33"); +select * from t1; +drop table t1; + +create table t1 (c1 year primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010"); +select * from t1; +drop table t1; + +create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"'; +insert into t1 values("2010/03/26 11:22:33"); +select * from t1; +drop table t1; + + +# duplicated key error +create table t1 (c1 int primary key, c2 int) COMMENT = 'engine "innodb"'; +insert into t1 values(1,100); +select * from t1; +--error ER_DUP_ENTRY +insert into t1 values(1,200); +select * from t1; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..4087abf9bc3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test @@ -0,0 +1,44 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--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, + content text, + fulltext index (content) +) default charset utf8 comment = 'engine "innodb"'; +show create table diaries; + +LOCK TABLE diaries WRITE; +insert into diaries values(1, "今日からはじめました。"); +insert into diaries values(2, "明日の富士山の天気について"); +insert into diaries values(3, "今日も天気がよくてきれいに見える。"); +UNLOCK TABLES; + +select * from diaries; + +select * from diaries where match(content) against("天気"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..cc3bc477409 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + date TIMESTAMP NOT NULL, + title VARCHAR(100) NOT NULL, + content TEXT NOT NULL, + PRIMARY KEY (date, title) +) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "cloudy day", "Today is cloudy day..."); +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "shopping", "I buy a new shirt."); +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-05", "rainy day", "Today is rainy day..."); + +SELECT * FROM diaries; + +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "shopping", "I buy new shoes.") + ON DUPLICATE KEY UPDATE date = "2012-03-03", + content = "I buy a new hat."; + +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..cdcdcc796f3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test @@ -0,0 +1,49 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + date TIMESTAMP NOT NULL, + title VARCHAR(100) NOT NULL, + content TEXT NOT NULL, + UNIQUE INDEX (date, title) +) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "MyISAM"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "cloudy day", "Today is cloudy day..."); +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "shopping", "I buy a new shirt."); +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-05", "rainy day", "Today is rainy day..."); + +SELECT * FROM diaries; + +INSERT INTO diaries (date, title, content) + VALUES ("2012-03-04", "shopping", "I buy new shoes.") + ON DUPLICATE KEY UPDATE date = "2012-03-03", + content = "I buy a new hat."; +SELECT * FROM diaries; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f5b429e523b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test @@ -0,0 +1,45 @@ +# Copyright(C) 2013 Kenji Maruyama +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mysql.inc +--source ../../include/mroonga/have_version_56_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 new file mode 100644 index 00000000000..39772e5d78d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test @@ -0,0 +1,68 @@ +# Copyright(C) 2010 Kentoku SHIBA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +flush status; +create table t1 ( + c1 int primary key, + c2 int, + c3 text, + key idx1(c2), + fulltext index ft(c3) +) comment = 'engine "innodb"'; +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,"ii si ii se ii"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ii oo"); + +select *, match(c3) against("ii") from t1 + where match(c3) against("ii") order by c1 desc limit 1; +show status like 'mroonga_fast_order_limit'; + +select *, match(c3) against("ii") from t1 + where match(c3) against("ii") order by c1 limit 1; +show status like 'mroonga_fast_order_limit'; + +select c3, match(c3) against("ii") from t1 + where match(c3) against("ii") order by match(c3) against("ii") desc; +show status like 'mroonga_fast_order_limit'; + +select c3, match(c3) against("ii") from t1 + where match(c3) against("ii") order by match(c3) against("ii") desc limit 1, 1; +show status like 'mroonga_fast_order_limit'; + +select c3, match(c3) against("ii") from t1 + where match(c3) against("ii") order by match(c3) against("ii"); +show status like 'mroonga_fast_order_limit'; + +select c3, match(c3) against("ii") from t1 + where match(c3) against("ii") order by match(c3) against("ii") limit 1; +show status like 'mroonga_fast_order_limit'; + +select count(*) from t1 where match(c3) against("ii") limit 1; +show status like 'mroonga_fast_order_limit'; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..da37f5d6372 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +flush status; +create table t1 ( + c1 int primary key, + c2 int, + c3 text, + key idx1(c2), + fulltext index ft(c3) +) comment = 'engine "innodb"'; +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,"ii si ii se ii"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ii oo"); + +show status like 'mroonga_fast_order_limit'; + +select *, match(c3) against("ii") from t1 order by c1 desc limit 1; + +show status like 'mroonga_fast_order_limit'; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..6489407135b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test @@ -0,0 +1,69 @@ +# Copyright(C) 2013 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +--disable_warnings +DROP DATABASE IF EXISTS repair_test; +CREATE DATABASE repair_test; +USE repair_test; + +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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..."); +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.0000103 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000104 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000105 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000105.c + +FLUSH TABLES; + +# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn' (No such file or directory) +--error ER_CANT_OPEN_FILE +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); + +REPAIR TABLE diaries; + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); + +DROP TABLE diaries; + +DROP DATABASE repair_test; +USE test; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..ce6e1d23280 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test @@ -0,0 +1,63 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +--disable_warnings +DROP DATABASE IF EXISTS repair_test; +CREATE DATABASE repair_test; +USE repair_test; + +DROP TABLE IF EXISTS diaries; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + 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..."); +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.0000104 + +FLUSH TABLES; + +# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn.0000104' (No such file or directory) +--error ER_CANT_OPEN_FILE +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); + +REPAIR TABLE diaries; + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); + +DROP TABLE diaries; + +DROP DATABASE repair_test; +USE test; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test new file mode 100644 index 00000000000..0eb5ef514a2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kouhei Sutou +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/skip_osx.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TEMPORARY TABLE IF EXISTS diaries; +--enable_warnings + +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"); +INSERT INTO diaries (title) VALUES ("cloudy day"); + +SELECT * FROM diaries; + +DROP TEMPORARY TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b2522db7919 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test @@ -0,0 +1,53 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +SET @tmp_query_cache_size = @@query_cache_size; +SET GLOBAL query_cache_size = 1048576; + +--disable_warnings +DROP TABLE IF EXISTS simple_table; +--enable_warnings + +CREATE TABLE simple_table ( + id INT PRIMARY KEY +) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET=UTF8; +SHOW CREATE TABLE simple_table; + +INSERT INTO simple_table (id) VALUES (1),(2); + +CONNECT(second_connection, localhost, root); +USE test; +START TRANSACTION; +INSERT INTO simple_table (id) VALUES (3); + +CONNECTION default; +SELECT * FROM simple_table; + +CONNECTION second_connection; +COMMIT; + +CONNECTION default; +SELECT * FROM simple_table; + +DROP TABLE simple_table; +DISCONNECT second_connection; + +SET GLOBAL query_cache_size = @tmp_query_cache_size; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..f0da6934f8e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test @@ -0,0 +1,59 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + body TEXT, + 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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey") AND + MATCH(body) AGAINST("groonga"); + +START TRANSACTION; +DELETE FROM diaries WHERE id = 1; +ROLLBACK; + +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey") AND + MATCH(body) AGAINST("groonga"); + +DELETE FROM diaries WHERE id = 1; + +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey") AND + MATCH(body) AGAINST("groonga"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..425a16c204e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test @@ -0,0 +1,56 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + body TEXT, + 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..."); +INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); + +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey"); + +START TRANSACTION; +DELETE FROM diaries WHERE id = 1; +ROLLBACK; + +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey"); + +UPDATE diaries SET title = "survey day!" WHERE id = 1; + +SELECT * FROM diaries; +SELECT * FROM diaries + WHERE MATCH(title) AGAINST("survey"); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test new file mode 100644 index 00000000000..987fd284f74 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test @@ -0,0 +1,57 @@ +# Copyright(C) 2011-2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + year INT UNSIGNED, + month INT UNSIGNED, + day INT UNSIGNED, + title VARCHAR(255), + content TEXT, + 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, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, 2011, 11, 11, "富士山", "今日も天気がよくてきれいに見える。"); + +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); +TRUNCATE TABLE diaries; +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("今日 天気" IN BOOLEAN MODE); + +INSERT INTO diaries VALUES(1, 2011, 11, 11, "帰り道", "つかれたー"); +INSERT INTO diaries VALUES(2, 2011, 12, 1, "久しぶり", "天気が悪いからずっと留守番。"); +INSERT INTO diaries VALUES(3, 2011, 12, 2, "初雪", "今年はじめての雪!"); + +SELECT * FROM diaries; +SELECT * FROM diaries WHERE MATCH(content) AGAINST("悪い" IN BOOLEAN MODE); + + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test new file mode 100644 index 00000000000..50c14184c98 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test @@ -0,0 +1,43 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 text, fulltext index (c2)) COMMENT = 'engine "innodb"'; +insert into t1 values(10, "aa ii uu ee"); +insert into t1 values(20, "ka ki ku ke"); +insert into t1 values(30, "sa si su se"); + +select * from t1; +update t1 set c2="ta ti tu te" where c1=20; +select * from t1; +select * from t1 where match(c2) against("ti"); +select * from t1 where match(c2) against("ki"); + +update t1 set c1=40 where c1=20; +select * from t1; +select * from t1 where match(c2) against("ti"); +select * from t1 where match(c2) against("ki"); + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..5c794aacf65 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test @@ -0,0 +1,41 @@ +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +create table t1 (c1 int primary key, c2 int) COMMENT = 'engine "innodb"'; +show create table t1; +insert into t1 values (1, 100); +insert into t1 values (2, 101); +insert into t1 values (3, 102); +select * from t1; + +update t1 set c2=c2+100 where c1=1; +select * from t1; +update t1 set c2=c2+100 where c1=2; +select * from t1; +update t1 set c2=c2+100 where c1=3; +select * from t1; + +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.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 new file mode 100644 index 00000000000..165c8df858a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test @@ -0,0 +1,55 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + 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..."); +insert into diaries (body) values ("started groonga."); +select * from diaries; + +set mroonga_dry_write=true; +delete from diaries where id = 2; +select * from diaries; +select * from diaries where match (body) against ("starting"); +select * from diaries where match (body) against ("started"); + +set mroonga_dry_write=false; +delete from diaries where id = 3; +select * from diaries; +select * from diaries where match (body) against ("starting"); +select * from diaries where match (body) against ("started"); + +insert into diaries (id, body) values (2, "sleeping..."); +select * from diaries; +select * from diaries where match (body) against ("starting"); +select * from diaries where match (body) against ("started"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b1222118833 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test @@ -0,0 +1,47 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + 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; +select * from diaries where match (body) against ("groonga"); + +set mroonga_dry_write=true; +insert into diaries (body) values ("starting groonga..."); +select * from diaries; +select * from diaries where match (body) against ("groonga"); + +set mroonga_dry_write=false; +insert into diaries (body) values ("started groonga."); +select * from diaries; +select * from diaries where match (body) against ("groonga"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..6b47d18b872 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test @@ -0,0 +1,48 @@ +# Copyright(C) 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.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, + 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!"); + +set mroonga_dry_write=true; +update diaries set body = "starting groonga..." where id = 1; +select * from diaries; +select * from diaries where match (body) against ("will"); +select * from diaries where match (body) against ("starting"); + +set mroonga_dry_write=false; +update diaries set body = "started groonga." where id = 1; +select * from diaries; +select * from diaries where match (body) against ("will"); +select * from diaries where match (body) against ("starting"); +select * from diaries where match (body) against ("started"); + +drop table diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..b272649c732 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_fulltext_index_comment.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +# MySQL <= 5.5 reports wrong a warning. :< +# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. +--disable_warnings +SET GLOBAL mroonga_match_escalation_threshold = -1; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + tags TEXT, + FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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"); + + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" 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); + +SET mroonga_match_escalation_threshold = 0; +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); + + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc 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 new file mode 100644 index 00000000000..bf22001bb10 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test @@ -0,0 +1,54 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_fulltext_index_comment.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, + tags TEXT, + FULLTEXT INDEX tags_index (tags) COMMENT 'parser "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"); + + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); + +SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); + +# MySQL <= 5.5 reports wrong a warning. :< +# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. +--disable_warnings +SET mroonga_match_escalation_threshold = -1; +--enable_warnings +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); + + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test new file mode 100644 index 00000000000..8519457cc70 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_55.inc +--source include/have_innodb.inc +--source include/have_perfschema.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SHOW VARIABLES LIKE 'performance_schema'; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + content VARCHAR(255), + FULLTEXT INDEX (content) +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); + +SHOW TABLES FROM performance_schema; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test new file mode 100644 index 00000000000..c3d4aae5bf6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_56_or_later.inc +--source include/have_innodb.inc +--source include/have_perfschema.inc +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SHOW VARIABLES LIKE 'performance_schema'; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + content VARCHAR(255), + FULLTEXT INDEX (content) +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); + +SHOW TABLES FROM performance_schema; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/packages/Makefile.am b/storage/mroonga/packages/Makefile.am new file mode 100644 index 00000000000..fed925c3dfc --- /dev/null +++ b/storage/mroonga/packages/Makefile.am @@ -0,0 +1,7 @@ +SUBDIRS = \ + apt \ + rpm \ + source \ + ubuntu \ + windows \ + yum diff --git a/storage/mroonga/packages/apt/Makefile.am b/storage/mroonga/packages/apt/Makefile.am new file mode 100644 index 00000000000..3ca74c7a145 --- /dev/null +++ b/storage/mroonga/packages/apt/Makefile.am @@ -0,0 +1,55 @@ +REPOSITORIES_PATH = repositories +DISTRIBUTIONS = debian +CHROOT_BASE = /var/lib/chroot +ARCHITECTURES = i386 amd64 +CODES = wheezy jessie unstable + +all: + +release: build sign-packages update-repository sign-repository upload + +remove-existing-packages: + for distribution in $(DISTRIBUTIONS); do \ + find $(REPOSITORIES_PATH)/$${distribution}/pool \ + -type f -delete; \ + done + +download: + for distribution in $(DISTRIBUTIONS); do \ + rsync -avz --progress --delete \ + $(RSYNC_PATH)/$${distribution} $(REPOSITORIES_PATH)/; \ + done + +sign-packages: + ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' + +update-repository: + ./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \ + '$(ARCHITECTURES)' '$(CODES)' + +sign-repository: + ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' + +ensure-rsync-path: + @if test -z "$(RSYNC_PATH)"; then \ + echo "--with-rsync-path configure option must be specified."; \ + false; \ + fi + +upload: ensure-rsync-path + for distribution in $(DISTRIBUTIONS); do \ + (cd $(REPOSITORIES_PATH)/$${distribution}; \ + rsync -avz --progress --delete \ + dists pool $(RSYNC_PATH)/$${distribution}; \ + ); \ + done + +build: source + ./build-in-chroot.sh \ + $(PACKAGE) $(VERSION) $(srcdir)/.. $(REPOSITORIES_PATH)/ \ + $(CHROOT_BASE) '$(ARCHITECTURES)' '$(CODES)' + +source: ../$(PACKAGE)-$(VERSION).tar.gz + +../$(PACKAGE)-$(VERSION).tar.gz: + ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../ diff --git a/storage/mroonga/packages/apt/build-deb.sh b/storage/mroonga/packages/apt/build-deb.sh new file mode 100755 index 00000000000..a0f1f1ced03 --- /dev/null +++ b/storage/mroonga/packages/apt/build-deb.sh @@ -0,0 +1,121 @@ +#!/bin/sh + +LANG=C + +PACKAGE=$(cat /tmp/build-package) +USER_NAME=$(cat /tmp/build-user) +VERSION=$(cat /tmp/build-version) +DEPENDED_PACKAGES=$(cat /tmp/depended-packages) +BUILD_SCRIPT=/tmp/build-deb-in-chroot.sh + +mysql_server_package=mysql-server + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +grep '^deb ' /etc/apt/sources.list | \ + sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list + +run apt-get update +run apt-get install -V -y lsb-release +distribution=$(lsb_release --id --short) +code_name=$(lsb_release --codename --short) + +groonga_list=/etc/apt/sources.list.d/groonga.list +if [ ! -f "${groonga_list}" ]; then + case ${distribution} in + Debian) + component=main + if [ "$code_name" = "sid" ]; then + code_name=unstable + fi + ;; + Ubuntu) + component=universe + ;; + esac + downcased_distribtion=$(echo ${distribution} | tr A-Z a-z) + run cat < "${security_list}" +deb http://security.debian.org/ ${code_name}/updates main +deb-src http://security.debian.org/ ${code_name}/updates main +EOF + fi + ;; + Ubuntu) + cat < "${security_list}" +deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted +deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted +EOF + ;; + esac + + run apt-get update + run apt-get upgrade -V -y +fi + +universe_list=/etc/apt/sources.list.d/universe.list +if [ ! -f "$universe_list}" ]; then + case ${distribution} in + Ubuntu) + sed -e 's/main/universe/' /etc/apt/sources.list > ${universe_list} + run apt-get update + ;; + esac +fi + +run apt-get install -V -y devscripts ${DEPENDED_PACKAGES} +run apt-get build-dep -y ${mysql_server_package} +run apt-get clean + +if ! id $USER_NAME >/dev/null 2>&1; then + run useradd -m $USER_NAME +fi + +cat < $BUILD_SCRIPT +#!/bin/sh + +rm -rf build +mkdir -p build + +cp /tmp/${PACKAGE}-${VERSION}.tar.gz build/${PACKAGE}_${VERSION}.orig.tar.gz + +cd build + +tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz +cd ${PACKAGE}-${VERSION}/ +cp -rp /tmp/${PACKAGE}-debian debian +# export DEB_BUILD_OPTIONS="noopt nostrip" +MYSQL_PACKAGE_INFO=\$(apt-cache show mysql-server | grep Version | sort | tail -1) +MYSQL_PACKAGE_VERSION=\${MYSQL_PACKAGE_INFO##Version: } +sed -i "s/MYSQL_VERSION/\$MYSQL_PACKAGE_VERSION/" debian/control +debuild -us -uc +EOF + +run chmod +x $BUILD_SCRIPT +run su - $USER_NAME $BUILD_SCRIPT diff --git a/storage/mroonga/packages/apt/build-in-chroot.sh b/storage/mroonga/packages/apt/build-in-chroot.sh new file mode 100755 index 00000000000..ab5cc589555 --- /dev/null +++ b/storage/mroonga/packages/apt/build-in-chroot.sh @@ -0,0 +1,134 @@ +#!/bin/sh + +if [ $# != 7 ]; then + echo "Usage: $0 PACKAGE VERSION SOURCE_DIR DESTINATION CHROOT_BASE ARCHITECTURES CODES" + echo " e.g.: $0 groonga 0.1.9 SOURCE_DIR repositories/ /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'" + exit 1 +fi + +PACKAGE=$1 +VERSION=$2 +SOURCE_DIR=$3 +DESTINATION=$4 +CHROOT_BASE=$5 +ARCHITECTURES=$6 +CODES=$7 + +PATH=/usr/local/sbin:/usr/sbin:$PATH + +script_base_dir=`dirname $0` + +if test "$PARALLEL" = "yes"; then + parallel="yes" +else + parallel="no" +fi + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +run_sudo() +{ + run sudo "$@" +} + +build_chroot() +{ + architecture=$1 + code_name=$2 + + run_sudo debootstrap --arch $architecture $code_name $base_dir + + case $code_name in + squeeze|wheezy|jessie|unstable) + run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list + ;; + *) + run_sudo sed -i'' \ + -e 's,http://archive,http://jp.archive,' \ + -e 's/main$/main universe/' \ + $base_dir/etc/apt/sources.list + ;; + esac + + run_sudo sh -c "echo >> /etc/fstab" + run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab" + run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab" + run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab" + run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab" + run_sudo mount ${base_dir}/sys + run_sudo mount ${base_dir}/dev + run_sudo mount ${base_dir}/dev/pts + run_sudo mount ${base_dir}/proc +} + +build() +{ + architecture=$1 + code_name=$2 + + target=${code_name}-${architecture} + base_dir=${CHROOT_BASE}/${target} + if [ ! -d $base_dir ]; then + run build_chroot $architecture $code_name + fi + + case ${code_name} in + squeeze|wheezy|jessie|unstable) + distribution=debian + component=main + ;; + *) + distribution=ubuntu + component=universe + ;; + esac + + source_dir=${SOURCE_DIR} + build_user=${PACKAGE}-build + build_user_dir=${base_dir}/home/$build_user + build_dir=${build_user_dir}/build + pool_base_dir=${DESTINATION}${distribution}/pool/${code_name}/${component} + package_initial=$(echo ${PACKAGE} | sed -e 's/\(.\).*/\1/') + pool_dir=${pool_base_dir}/${package_initial}/${PACKAGE} + run cp $source_dir/${PACKAGE}-${VERSION}.tar.gz \ + ${CHROOT_BASE}/$target/tmp/ + run rm -rf ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian + run cp -rp $source_dir/debian/ \ + ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian + run echo $PACKAGE > ${CHROOT_BASE}/$target/tmp/build-package + run echo $VERSION > ${CHROOT_BASE}/$target/tmp/build-version + run echo $build_user > ${CHROOT_BASE}/$target/tmp/build-user + run cp ${script_base_dir}/${PACKAGE}-depended-packages \ + ${CHROOT_BASE}/$target/tmp/depended-packages + run cp ${script_base_dir}/build-deb.sh \ + ${CHROOT_BASE}/$target/tmp/ + run_sudo rm -rf $build_dir + run_sudo su -c "/usr/sbin/chroot ${CHROOT_BASE}/$target /tmp/build-deb.sh" + run mkdir -p $pool_dir + for path in $build_dir/*; do + [ -f $path ] && run cp -p $path $pool_dir/ + done +} + +for architecture in $ARCHITECTURES; do + for code_name in $CODES; do + if test "$parallel" = "yes"; then + build $architecture $code_name & + else + mkdir -p tmp + build_log=tmp/build-$code_name-$architecture.log + build $architecture $code_name 2>&1 | tee $build_log + fi; + done; +done + +if test "$parallel" = "yes"; then + wait +fi diff --git a/storage/mroonga/packages/apt/mroonga-depended-packages b/storage/mroonga/packages/apt/mroonga-depended-packages new file mode 100644 index 00000000000..fe9e01ba19f --- /dev/null +++ b/storage/mroonga/packages/apt/mroonga-depended-packages @@ -0,0 +1,11 @@ +debhelper +autotools-dev +libgroonga-dev +pkg-config +libmecab-dev +mecab-utils +libmysqlclient-dev +libmysqld-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 new file mode 100755 index 00000000000..11a4aea26db --- /dev/null +++ b/storage/mroonga/packages/apt/sign-packages.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESITINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" + exit 1 +fi + +GPG_UID=$1 +DESTINATION=$2 +CODES=$3 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +for code_name in ${CODES}; do + case ${code_name} in + squeeze|wheezy|jessie|unstable) + distribution=debian + ;; + *) + distribution=ubuntu + ;; + esac + + base_directory=${DESTINATION}${distribution} + debsign -pgpg2 --re-sign -k${GPG_UID} \ + $(find ${base_directory} -name '*.dsc' -or -name '*.changes') & + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait diff --git a/storage/mroonga/packages/apt/sign-repository.sh b/storage/mroonga/packages/apt/sign-repository.sh new file mode 100755 index 00000000000..fb0de850d6f --- /dev/null +++ b/storage/mroonga/packages/apt/sign-repository.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESTINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" + exit 1 +fi + +GPG_UID=$1 +DESTINATION=$2 +CODES=$3 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +for code_name in ${CODES}; do + case ${code_name} in + squeeze|wheezy|jessie|unstable) + distribution=debian + ;; + *) + distribution=ubuntu + ;; + esac + + release=${DESTINATION}${distribution}/dists/${code_name}/Release + rm -f ${release}.gpg + gpg2 --sign --detach-sign --armor \ + --local-user ${GPG_UID} \ + --output ${release}.gpg \ + ${release} & + + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait diff --git a/storage/mroonga/packages/apt/update-repository.sh b/storage/mroonga/packages/apt/update-repository.sh new file mode 100755 index 00000000000..da1f8cd121c --- /dev/null +++ b/storage/mroonga/packages/apt/update-repository.sh @@ -0,0 +1,130 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 4 ]; then + echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES" + echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'" + exit 1 +fi + +PROJECT_NAME=$1 +DESTINATION=$2 +ARCHITECTURES=$3 +CODES=$4 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +update_repository() +{ + distribution=$1 + code_name=$2 + component=$3 + + rm -rf dists/${code_name} + mkdir -p dists/${code_name}/${component}/binary-i386/ + mkdir -p dists/${code_name}/${component}/binary-amd64/ + mkdir -p dists/${code_name}/${component}/source/ + + cat < dists/.htaccess +Options +Indexes +EOF + + cat < dists/${code_name}/${component}/binary-i386/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: i386 +EOF + + cat < dists/${code_name}/${component}/binary-amd64/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: amd64 +EOF + + cat < dists/${code_name}/${component}/source/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: source +EOF + + cat < generate-${code_name}.conf +Dir::ArchiveDir "."; +Dir::CacheDir "."; +TreeDefault::Directory "pool/${code_name}/${component}"; +TreeDefault::SrcDirectory "pool/${code_name}/${component}"; +Default::Packages::Extensions ".deb"; +Default::Packages::Compress ". gzip bzip2"; +Default::Sources::Compress ". gzip bzip2"; +Default::Contents::Compress "gzip bzip2"; + +BinDirectory "dists/${code_name}/${component}/binary-i386" { + Packages "dists/${code_name}/${component}/binary-i386/Packages"; + Contents "dists/${code_name}/Contents-i386"; + SrcPackages "dists/${code_name}/${component}/source/Sources"; +}; + +BinDirectory "dists/${code_name}/${component}/binary-amd64" { + Packages "dists/${code_name}/${component}/binary-amd64/Packages"; + Contents "dists/${code_name}/Contents-amd64"; + SrcPackages "dists/${code_name}/${component}/source/Sources"; +}; + +Tree "dists/${code_name}" { + Sections "${component}"; + Architectures "i386 amd64 source"; +}; +EOF + apt-ftparchive generate generate-${code_name}.conf + chmod 644 dists/${code_name}/Contents-* + + rm -f dists/${code_name}/Release* + rm -f *.db + cat < release-${code_name}.conf +APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project"; +APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project"; +APT::FTPArchive::Release::Architectures "i386 amd64"; +APT::FTPArchive::Release::Codename "${code_name}"; +APT::FTPArchive::Release::Suite "${code_name}"; +APT::FTPArchive::Release::Components "${component}"; +APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages"; +EOF + apt-ftparchive -c release-${code_name}.conf \ + release dists/${code_name} > /tmp/Release + mv /tmp/Release dists/${code_name} +} + +for code_name in ${CODES}; do + case ${code_name} in + squeeze|wheezy|jessie|unstable) + distribution=debian + component=main + ;; + *) + distribution=ubuntu + component=universe + ;; + esac + + mkdir -p ${DESTINATION}${distribution} + (cd ${DESTINATION}${distribution} + update_repository $distribution $code_name $component) & + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait diff --git a/storage/mroonga/packages/check-utility.sh b/storage/mroonga/packages/check-utility.sh new file mode 100755 index 00000000000..211e231a473 --- /dev/null +++ b/storage/mroonga/packages/check-utility.sh @@ -0,0 +1,665 @@ +#!/bin/sh + +# Usage: check-utility.sh [--install-groonga] +# [--check-install] +# [--check-address] +# [--enable-repository] +# +# CODES="squeeze wheezy unstable lucid natty oneiric precise" +# DISTRIBUTIONS="centos fedora" + +CHROOT_ROOT=/var/lib/chroot +CHECK_ADDRESS=0 +CHECK_INSTALL=0 +CHECK_INSTALL_PACKAGE=mysql-server-mroonga +CHECK_BUILD=0 +CHECK_DEPENDS=0 +CHECK_PROVIDES=0 +ENABLE_REPOSITORY=0 +DISABLE_REPOSITORY=0 +INSTALL_SCRIPT=0 +INSTALL_MROONGA=0 +UNINSTALL_MROONGA=0 + +common_deb_procedure () +{ + for code in $CODES; do + for arch in $DEB_ARCHITECTURES; do + root_dir=$CHROOT_ROOT/$code-$arch + eval $1 $code $arch $root_dir + done + done +} + +common_rpm_procedure () +{ + for dist in $DISTRIBUTIONS; do + case $dist in + "fedora") + DISTRIBUTIONS_VERSION="19" + ;; + "centos") + DISTRIBUTIONS_VERSION="5 6" + ;; + esac + for ver in $DISTRIBUTIONS_VERSION; do + for arch in $RPM_ARCHITECTURES; do + root_dir=$CHROOT_ROOT/$dist-$ver-$arch + eval $1 $dist $arch $ver $root_dir + done + done + done +} + +echo_packages_repository_address () +{ + root_dir=$1 + code=$2 + arch=$3 + address=`grep "packages.groonga.org" $root_dir/etc/hosts | grep -v "#"` + if [ -z "$address" ]; then + echo "$code-$arch: default" + else + echo "$code-$arch: $address" + fi +} + +setup_distributions () +{ + if [ -z "$DISTRIBUTIONS" ]; then + DISTRIBUTIONS="centos fedora" + fi +} + +setup_rpm_architectures () +{ + if [ -z "$RPM_ARCHITECTURES" ]; then + RPM_ARCHITECTURES="i386 x86_64" + fi +} + +setup_codes () +{ + if [ -z "$CODES" ]; then + CODES="squeeze wheezy jessie unstable lucid precise quantal raring" + fi +} +setup_deb_architectures () +{ + if [ -z "$DEB_ARCHITECTURES" ]; then + DEB_ARCHITECTURES="i386 amd64" + fi +} + +check_packages_repository_address () +{ + common_deb_procedure "check_packages_deb_repository_address" + common_rpm_procedure "check_packages_rpm_repository_address" +} + +check_packages_deb_repository_address () +{ + code=$1 + arch=$2 + root_dir=$4 + echo_packages_repository_address "$root_dir" "$code" "$arch" +} + +check_packages_rpm_repository_address () +{ + dist=$1 + arch=$2 + ver=$3 + root_dir=$4 + echo_packages_repository_address "$root_dir" "$dist-$ver" "$arch" +} + +host_address () +{ + ifconfig_result=`LANG=C /sbin/ifconfig wlan0` + inet_addr=`echo "$ifconfig_result" | grep "inet addr:192"` + address=`echo $inet_addr | ruby -ne '/inet addr:(.+?)\s/ =~ $_ && puts($1)'` + HOST_ADDRESS=$address +} + +check_build_packages () +{ + common_deb_procedure "check_build_deb_packages" + common_rpm_procedure "check_build_rpm_packages" +} + +check_build_deb_packages () +{ + code=$1 + arch=$2 + BASE_VERSION=`cat ../version` + RESULT_SET=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch` + if [ -z "$RESULT_SET" ]; then + printf "%8s %5s %s => 0 deb\n" $code $arch $BASE_VERSION + else + PACKAGE_COUNT=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch | wc | awk '{print \$1}'` + printf "%8s %5s %s => %2d debs\n" $code $arch $BASE_VERSION $PACKAGE_COUNT + fi +} + +check_build_rpm_packages () +{ + dist=$1 + arch=$2 + ver=$3 + BASE_VERSION=`cat ../version` + FIND_PATH=yum/repositories/$dist/$ver/$arch + RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"` + if [ -z "$RESULT_SET" ]; then + printf "%8s %6s %s => 0 rpm\n" $dist$ver $arch $BASE_VERSION + else + PACKAGE_COUNT=`find $FIND_PATH -name "*$BASE_VERSION*" | wc -l` + printf "%8s %6s %s => %2d rpms\n" $dist$ver $arch $BASE_VERSION $PACKAGE_COUNT + fi +} + +check_depends_packages () +{ + common_deb_procedure "check_depends_deb_packages" + common_rpm_procedure "check_depends_rpm_packages" +} + +check_depends_deb_packages () +{ + code=$1 + arch=$2 + BASE_VERSION=`cat ../version` + FIND_PATH=apt/repositories/*/pool/$code + RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*.deb"` + if [ -z "$RESULT_SET" ]; then + printf "%8s %5s %s => 404 deb\n" $code $arch $BASE_VERSION + else + for pkg in $RESULT_SET; do + DEB_NAME=`basename $pkg` + DEPENDS=`dpkg -I $pkg | grep "Depends"` + printf "%8s %5s %s => %s\n" $code $arch $DEB_NAME "$DEPENDS" + done + fi +} + +check_depends_rpm_packages () +{ + dist=$1 + arch=$2 + ver=$3 + BASE_VERSION=`cat ../version` + FIND_PATH=yum/repositories/$dist/$ver/$arch + RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"` + if [ -z "$RESULT_SET" ]; then + printf "%8s %6s %s => 404 rpm\n" $dist$ver $arch $BASE_VERSION + else + for pkg in $RESULT_SET; do + RPM_NAME=`basename $pkg` + DEPENDS=`rpm -qp --requires $pkg | grep -i "mysql" | tr -t '\n' ' '` + printf "%9s %6s %s => %s\n" $dist$ver $arch $RPM_NAME "$DEPENDS" + done + fi +} + +check_provided_mysql_packages () +{ + common_deb_procedure "check_provided_mysql_deb_packages" + common_rpm_procedure "check_provided_mysql_rpm_packages" + for code in $CODES; do + echo $code + cat tmp/$code-amd64-mysql-server.txt + done + for dist in $DISTRIBUTIONS; do + echo $dist + cat tmp/$dist-x86_64-mysql-server.txt + done +} + +check_provided_mysql_deb_packages () +{ + code=$1 + arch=$2 + root_dir=$3 + cat > tmp/check-provided-mysql.sh < /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 new file mode 100644 index 00000000000..259f8d1dc0c --- /dev/null +++ b/storage/mroonga/packages/debian/apparmor/mysql-server-mroonga @@ -0,0 +1,5 @@ +/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 new file mode 100644 index 00000000000..a846b8b5de8 --- /dev/null +++ b/storage/mroonga/packages/debian/changelog @@ -0,0 +1,355 @@ +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 new file mode 100644 index 00000000000..ec635144f60 --- /dev/null +++ b/storage/mroonga/packages/debian/compat @@ -0,0 +1 @@ +9 diff --git a/storage/mroonga/packages/debian/control.in b/storage/mroonga/packages/debian/control.in new file mode 100644 index 00000000000..d6d03fa9a4e --- /dev/null +++ b/storage/mroonga/packages/debian/control.in @@ -0,0 +1,51 @@ +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 new file mode 100644 index 00000000000..bb41984e8e4 --- /dev/null +++ b/storage/mroonga/packages/debian/copyright @@ -0,0 +1,27 @@ +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 new file mode 100644 index 00000000000..ad2e27ef7dd --- /dev/null +++ b/storage/mroonga/packages/debian/mysql-server-mroonga-doc.install @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000000..03f64cfedb4 --- /dev/null +++ b/storage/mroonga/packages/debian/mysql-server-mroonga.install @@ -0,0 +1,3 @@ +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 new file mode 100755 index 00000000000..9a3db8784a2 --- /dev/null +++ b/storage/mroonga/packages/debian/mysql-server-mroonga.postinst @@ -0,0 +1,72 @@ +#! /bin/sh + +set -e + +prevver="$2" + +install_plugin() { + cat /usr/share/mroonga/install.sql | \ + mysql --defaults-file=/etc/mysql/debian.cnf || true +} + +install_apparmor() { + mysql_apparmor_profile_name=usr.sbin.mysqld + mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name} + mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name} + apparmor_profile_name=mysql-server-mroonga + include_profile="#include " + 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 new file mode 100755 index 00000000000..84d7f1ef4ab --- /dev/null +++ b/storage/mroonga/packages/debian/mysql-server-mroonga.postrm @@ -0,0 +1,38 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + mysql_apparmor_profile_name=usr.sbin.mysqld + mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name} + mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name} + mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql + apparmor_profile_name=mysql-server-mroonga + if test -f "${mysql_local_apparmor_profile}"; then + include_profile="#include " + 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 new file mode 100755 index 00000000000..7fad990d75f --- /dev/null +++ b/storage/mroonga/packages/debian/mysql-server-mroonga.prerm @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +cat /usr/share/mroonga/uninstall.sql | \ + mysql --defaults-file=/etc/mysql/debian.cnf || true + +#DEBHELPER# + +exit 0 diff --git a/storage/mroonga/packages/debian/rules b/storage/mroonga/packages/debian/rules new file mode 100755 index 00000000000..8bcd911a113 --- /dev/null +++ b/storage/mroonga/packages/debian/rules @@ -0,0 +1,35 @@ +#!/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: + if [ "$$(lsb_release --id --short)" = "Ubuntu" ]; then \ + base_url=http://archive.ubuntu.com/ubuntu; \ + else \ + base_url=http://ftp.debian.org/debian; \ + fi; \ + wget $${base_url}/pool/main/m/mysql-5.5/mysql-5.5_$(MYSQL_VERSION).orig.tar.gz + 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/Makefile.am b/storage/mroonga/packages/rpm/Makefile.am new file mode 100644 index 00000000000..471ea985921 --- /dev/null +++ b/storage/mroonga/packages/rpm/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + centos \ + fedora diff --git a/storage/mroonga/packages/rpm/centos/Makefile.am b/storage/mroonga/packages/rpm/centos/Makefile.am new file mode 100644 index 00000000000..e7b22cfa025 --- /dev/null +++ b/storage/mroonga/packages/rpm/centos/Makefile.am @@ -0,0 +1,9 @@ +EXTRA_DIST = \ + mysql55-mroonga.spec.in \ + mysql56-community-mroonga.spec.in \ + mariadb-mroonga.spec.in + +noinst_DATA = \ + mysql55-mroonga.spec \ + mysql56-community-mroonga.spec \ + mariadb-mroonga.spec diff --git a/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in new file mode 100644 index 00000000000..5ed56b433b2 --- /dev/null +++ b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in @@ -0,0 +1,375 @@ +%define mariadb_epoch_default 1 +%define mariadb_version_default 5.5.37 +%define mariadb_release_default 1 +%define mariadb_dist_default .el7_0 +%define mariadb_download_base_url_default http://vault.centos.org/7.0.1406/updates/Source/SPackages +%define mariadb_spec_file_default mariadb.spec + +%{!?mariadb_epoch:%define mariadb_epoch %{mariadb_epoch_default}} +%{!?mariadb_version:%define mariadb_version %{mariadb_version_default}} +%{!?mariadb_release:%define mariadb_release %{mariadb_release_default}} +%{!?mariadb_dist:%define mariadb_dist %{mariadb_dist_default}} +%{!?mariadb_download_base_url:%define mariadb_download_base_url %{mariadb_download_base_url_default}} +%{!?mariadb_spec_file:%define mariadb_spec_file %{mariadb_spec_file_default}} + +%define mariadb_package_version %{mariadb_epoch}:%{mariadb_version}-%{mariadb_release}%{mariadb_dist} + +%define groonga_required_version @REQUIRED_GROONGA_VERSION@ + +Name: mariadb-mroonga +Version: @VERSION@ +Release: 1%{?dist} +Summary: A fast fulltext searchable storage engine for MariaDB + +Group: Applications/Databases +License: LGPLv2.1 +URL: http://mroonga.org/ +Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) +BuildRequires: groonga-devel >= %{groonga_required_version} +BuildRequires: groonga-normalizer-mysql-devel +BuildRequires: wget +BuildRequires: mariadb-devel +Requires: mariadb-server = %{mariadb_package_version} +Requires: mariadb = %{mariadb_package_version} +Requires: groonga-libs >= %{groonga_required_version} +Requires: groonga-normalizer-mysql + +%description +Mroonga is a fast fulltext searchable storage plugin for MariaDB. +It is based on Groonga that is a fast fulltext search engine and +column store. Groonga is good at real-time update. + +%package doc +Summary: Documentation for Mroonga +Group: Documentation +License: LGPLv2.1 + +%description doc +Documentation for Mroonga + + +%prep +%setup -q -n mroonga-%{version} + +mariadb_full_version=%{mariadb_version}-%{mariadb_release}%{mariadb_dist} +srpm=mariadb-${mariadb_full_version}.src.rpm +if [ ! -f ../../SRPMS/$srpm ]; then + wget --continue -O ../../SRPMS/$srpm %{mariadb_download_base_url}/$srpm + rpm -Uvh ../../SRPMS/$srpm + rm ../../SRPMS/$srpm +fi + +%build +mariadb_source=../mariadb-%{mariadb_version} +if [ ! -d ${mariadb_source} ]; then + rpmbuild -bc \ + --define 'runselftest 0' \ + --define 'optflags -O0' \ + ../../SPECS/%{mariadb_spec_file} +fi +%configure \ + --disable-static \ + --with-mysql-source=${mariadb_source} \ + %{?mroonga_configure_options} +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la +mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if /usr/bin/mysql -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +current_version=0 +version=$(echo %{groonga_required_version} | sed -e 's/\.//g') +required_version=$(expr $version) +version=$(/usr/bin/mysql -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ + grep mroonga | cut -f 2 | sed -e 's/\.//g') +if [ -n "$version" ]; then + current_version=$(expr $version) +fi +install_sql=%{_datadir}/mroonga/install.sql +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if [ "$1" = 2 ] ; then + if [ $current_version -lt $required_version ]; then + command="/usr/bin/mysql -u root $password_option" + echo "run the following command after restarting MySQL server:"; + echo " $command < ${uninstall_sql}" + echo " $command < ${install_sql}" + exit 0 + else + command="/usr/bin/mysql -u root $password_option" + command="${command} < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") + fi +fi + +command="/usr/bin/mysql -u root $password_option < ${install_sql}" +echo $command +eval $command || \ + (echo "run the following command to register Mroonga:"; \ + echo " $command") + +%preun +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if mysql -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +if [ "$1" = 0 ]; then + command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") +fi + +%files +%defattr(-,root,root,-) +%{_libdir}/mysql/plugin/ +%{_datadir}/mroonga/* +%{_datadir}/man/man1/* +%{_datadir}/man/*/man1/* + +%files doc +%defattr(-,root,root,-) +%doc README COPYING +%doc mysql-mroonga-doc/* + +%changelog +* Fri Aug 29 2014 Kouhei Sutou - 4.05-1 +- new upstream release. + +* Thu Aug 14 2014 Kouhei Sutou - 4.04-4 +- build MariaDB for libmysqlservices.a. + +* Thu Aug 14 2014 Kouhei Sutou - 4.04-3 +- support epoch in MariaDB. + +* Wed Aug 13 2014 Kouhei Sutou - 4.04-2 +- build against mariadb-5.5.37-1.el7_0. + +* Sun Aug 10 2014 Kouhei Sutou - 4.04-1 +- initial packaging for CentOS 7 based on mysql-mroogna package. + +* Tue Jul 29 2014 HAYASHI Kentaro - 4.04-1 +- new upstream release. + +* Thu May 29 2014 Kouhei Sutou - 4.03-1 +- new upstream release. + +* Tue Apr 29 2014 Kouhei Sutou - 4.02-1 +- new upstream release. + +* Sat Mar 29 2014 HAYASHI Kentaro - 4.01-1 +- new upstream release. + +* Thu Feb 13 2014 HAYASHI Kentaro - 4.00-2 +- use MySQL 5.1.73-3 on CentOS 6. + +* Sun Feb 09 2014 HAYASHI Kentaro - 4.00-1 +- new upstream release. + +* Wed Jan 29 2014 HAYASHI Kentaro - 3.12-1 +- new upstream release. + +* Sun Dec 29 2013 HAYASHI Kentaro - 3.11-1 +- new upstream release. + +* Sat Dec 7 2013 HAYASHI Kentaro - 3.10-2 +- use MySQL 5.1.71-1 on CentOS 6. + +* Fri Nov 29 2013 HAYASHI Kentaro - 3.10-1 +- new upstream release. + +* Tue Oct 29 2013 HAYASHI Kentaro - 3.09-1 +- new upstream release. + +* Sun Sep 29 2013 HAYASHI Kentaro - 3.08-1 +- new upstream release. +- use MySQL 5.6.14-1 on CentOS 5. + +* Wed Sep 4 2013 HAYASHI Kentaro - 3.07-2 +- fix a bug that mroonga is removed accidentally on upgrade #1918. + Reported by @ceekz. Thanks!!! + +* Thu Aug 29 2013 HAYASHI Kentaro - 3.07-1 +- new upstream release. +- use MySQL 5.6.13-1 on CentOS 5. + +* Mon Jul 29 2013 HAYASHI Kentaro - 3.06-1 +- new upstream release. +- use MySQL 5.6.12-2 on CentOS 5. + +* Sat Jun 29 2013 HAYASHI Kentaro - 3.05-1 +- new upstream release. +- use MySQL 5.6.12 on CentOS 5. + +* Wed May 29 2013 HAYASHI Kentaro - 3.04-1 +- new upstream release. + +* Fri May 10 2013 HAYASHI Kentaro - 3.03-2 +- use MySQL 5.6.11-2 on CentOS 5. see http://bugs.mysql.com/bug.php?id=69027 + Reported by Y.Kentaro. Thanks!!! + +* Mon Apr 29 2013 HAYASHI Kentaro - 3.03-1 +- new upstream release. + +* Fri Mar 29 2013 HAYASHI Kentaro - 3.02-0 +- new upstream release. + +* Thu Feb 28 2013 HAYASHI Kentaro - 3.01-0 +- new upstream release. + +* Sat Feb 09 2013 HAYASHI Kentaro - 3.00-0 +- new upstream release. +- require groonga 3.0.0 or later + +* Tue Feb 05 2013 HAYASHI Kentaro - 2.10-2 +- use MySQL 5.1.67-1 on CentOS 6. + Reported by wakisuke.ua. Thanks!!! + +* Sat Dec 29 2012 HAYASHI Kentaro - 2.10-0 +- new upstream release. + +* Mon Dec 10 2012 HAYASHI Kentaro - 2.09-1 +- use MySQL 5.1.66-2 on CentOS 6. + Reported by wakisuke.ua. Thanks!!! + +* Thu Nov 29 2012 HAYASHI Kentaro - 2.09-0 +- new upstream release. +- use MySQL 5.5.28 on CentOS 5. +- use MySQL 5.1.66 on CentOS 6. + +* Mon Oct 29 2012 HAYASHI Kentaro - 2.08-0 +- new upstream release. +- add missing "DROP FUNCTION mroonga_snippet". + Reported by @tokuhy. Thanks!!! + +* Sat Sep 29 2012 HAYASHI Kentaro - 2.07-0 +- new upstream release. + +* Wed Aug 29 2012 Kouhei Sutou - 2.06-0 +- new upstream release. +- make MySQL spec file name customizable. +- make mroonga configure options customizable. +- add missing mysql-devel BuildRequires. Reported by wing. Thanks!!! +- use MySQL 5.5.27. + +* Sun Jul 29 2012 HAYASHI Kentaro - 2.05-0 +- new upstream release. +- use MySQL 5.5.25a. + +* Fri Jun 29 2012 Kouhei Sutou - 2.04-0 +- new upstream release. +- ensure deleting mroonga plugin before install. + Suggested by Kazuhiro Isobe. Thanks!!! +- use MySQL 5.5.25. + +* Tue May 29 2012 Kouhei Sutou - 2.03-0 +- new upstream release. +- use MySQL 5.5.24. +- make mysql_* variables customizable +- require groonga 2.0.3 or later. + +* Sun Apr 29 2012 Kouhei Sutou - 2.02-0 +- new upstream release. +- use MySQL 5.5.23. +- require groonga 2.0.2 or later. + +* Thu Mar 29 2012 Kouhei Sutou - 2.01-0 +- new upstream release. +- ensure plugin is uninstalled by closing all tables use mroonga. + +* Wed Feb 29 2012 Kouhei Sutou - 2.00-0 +- new upstream release. +- always install/uninstall plugin. +- use MySQL 5.1.61 and 5.5.21. +- require groonga 2.0.0 or later. + +* Sun Jan 29 2012 Kouhei Sutou - 1.20-0 +- new upstream release. +- require groonga 1.3.0. +- groonga -> mroonga. +- use MySQL 5.5.20. + +* Thu Dec 29 2011 Kouhei Sutou - 1.11-0 +- new upstream release. + +* Sat Oct 29 2011 Kouhei Sutou - 1.10-0 +- new upstream release. +- groonga storage engine -> mroonga. + +* Thu Sep 29 2011 Kouhei Sutou - 1.0.0-0 +- new upstream release. + +* Mon Aug 29 2011 Kouhei Sutou - 0.9-0 +- new upstream release. + +* Fri Jul 29 2011 Kouhei Sutou - 0.8-0 +- new upstream release. + +* Wed Jun 29 2011 Kouhei Sutou - 0.7-0 +- new upstream release. + +* Sun May 29 2011 Kouhei Sutou - 0.6-0 +- new upstream release. + +* Tue May 17 2011 Kouhei Sutou - 0.5-2 +- use MySQL 5.5.12. + +* Tue Mar 29 2011 Kouhei Sutou - 0.5-1 +- new upstream release. + +* Sat Jan 29 2011 Kouhei Sutou - 0.4-4 +- do not remove plugin on upgrade. + +* Wed Jan 12 2011 Kouhei Sutou - 0.4-3 +- rebuild without debug symbol. + +* Thu Dec 30 2010 Kouhei Sutou - 0.4-2 +- use MySQL 5.5.8-1. +- fix SQL literal notation. + +* Mon Nov 29 2010 Kouhei Sutou - 0.4-1 +- use the latest MySQL. +- new upstream release. + +* Sun Nov 21 2010 Kouhei Sutou - 0.3-2 +- install user define function. + +* Fri Oct 29 2010 Kouhei Sutou - 0.3-1 +- new upstream release. + +* Fri Oct 08 2010 Kouhei Sutou - 0.2-2 +- specify target MySQL version. +- use %{version}. + +* Wed Sep 29 2010 Kouhei Sutou - 0.2-1 +- new upstream release. + +* Sun Sep 12 2010 Kouhei Sutou - 0.1-3 +- require MySQL-client-community. + +* Fri Sep 10 2010 Kouhei Sutou - 0.1-2 +- use MySQL-devel-community. + +* Fri Sep 03 2010 Kouhei Sutou - 0.1-1 +- initial packaging for CentOS. diff --git a/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in new file mode 100644 index 00000000000..af2a026c701 --- /dev/null +++ b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in @@ -0,0 +1,200 @@ +%{?scl:%scl_package mroonga} +%{!?scl:%global pkg_name %{name}} +%{!?centos_ver:%define centos_ver 5} + +%if %{centos_ver} == 6 +%define mysql_version_default 5.5.37 +%define mysql_release_default 5 +%define mysql_dist_default el6.centos.alt +%define mysql_download_base_url_default http://vault.centos.org/6.5/SCL/Source/SPackages +%define mysql_spec_file_default mysql.spec +%else +%define mysql_version_default 5.5.37 +%define mysql_release_default 1 +%define mysql_dist_default el5 +%define mysql_download_base_url_default http://vault.centos.org/5.10/updates/SRPMS +%define mysql_spec_file_default mysql.spec +%endif + +%{!?mysql_version:%define mysql_version %{mysql_version_default}} +%{!?mysql_release:%define mysql_release %{mysql_release_default}} +%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}} +%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}} +%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}} + +%define groonga_required_version @REQUIRED_GROONGA_VERSION@ + +Name: %{?scl_prefix}mroonga +Version: @VERSION@ +Release: 1%{?dist} +Summary: A fast fulltext searchable storage engine for MySQL + +Group: Applications/Databases +License: LGPLv2.1 +URL: http://mroonga.org/ +Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) +BuildRequires: groonga-devel >= %{groonga_required_version} +BuildRequires: groonga-normalizer-mysql-devel +BuildRequires: wget +BuildRequires: which +BuildRequires: mysql55-mysql-devel +BuildRequires: mysql55-build +Requires: mysql55-mysql-server = %{mysql_version}-%{mysql_release}.%{mysql_dist} +Requires: mysql55-mysql = %{mysql_version}-%{mysql_release}.%{mysql_dist} +Requires: groonga-libs >= %{groonga_required_version} +Requires: groonga-normalizer-mysql +%{?scl:Requires: %scl_runtime} + +%description +Mroonga is a fast fulltext searchable storage plugin for MySQL. +It is based on Groonga that is a fast fulltext search engine and +column store. Groonga is good at real-time update. + +%package doc +Summary: Documentation for Mroonga +Group: Documentation +License: LGPLv2.1 + +%description doc +Documentation for Mroonga + + +%prep +%setup -q -n %{pkg_name}-%{version} + +mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist} +srpm=mysql55-mysql-${mysql_full_version}.src.rpm +if [ ! -f ../../SRPMS/$srpm ]; then + wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm + rpm -Uvh ../../SRPMS/$srpm +fi + +%build +mysql_source=../mysql-%{mysql_version} +if [ ! -d ${mysql_source} ]; then + specs_dir= + MYSQL_RPMBUILD_TEST=no rpmbuild -bp \ + --define 'runselftest 0' \ + --define 'optflags -O0' \ + ../../SPECS/%{mysql_spec_file} +fi +%configure --disable-static --with-mysql-source=${mysql_source} \ + --disable-fast-mutexes \ + --with-mysql-config=`scl enable mysql55 'which mysql_config'` \ + %{?mroonga_configure_options} +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la +mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +mysql_command=`scl enable mysql55 'which mysql'` +password_option="" +$mysql_command -u root -e "quit" +if [ $? -ne 0 ]; then + password_option="-p" +fi +current_version=0 +version=`echo %{groonga_required_version} | sed -e 's/\.//g'` +required_version=`expr $version` +version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ + grep mroonga | cut -f 2 | sed -e 's/\.//g'` +if [ -n "$version" ]; then + current_version=`expr $version` +fi +install_sql=%{_datadir}/mroonga/install.sql +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if [ "$1" = 2 ] ; then + if [ $current_version -lt $required_version ]; then + command="$mysql_command -u root $password_option" + echo "run the following command after restarting MySQL server:"; + echo " $command < ${uninstall_sql}" + echo " $command < ${install_sql}" + exit 0 + else + command="$mysql_command -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") + fi +fi +command="$mysql_command -u root $password_option < ${install_sql}" +echo $command +eval $command || \ + (echo "run the following command to register Mroonga:"; \ + echo " $command") + +%preun +uninstall_sql=%{_datadir}/mroonga/uninstall.sql +mysql_command=`scl enable mysql55 'which mysql'` +if $mysql_command -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +if [ "$1" = 0 ]; then + command="$mysql_command -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") +fi + +%files +%defattr(-,root,root,-) +%{_libdir}/mysql/plugin/ +%{_datadir}/mroonga/* +%{_datadir}/man/man1/* +%{_datadir}/man/*/man1/* + +%files doc +%defattr(-,root,root,-) +%doc README COPYING +%doc mysql-mroonga-doc/* + +%changelog +* Fri Aug 29 2014 Kouhei Sutou - 4.05-1 +- new upstream release. + +* Tue Jul 29 2014 HAYASHI Kentaro - 4.04-1 +- new upstream release. + +* Thu May 29 2014 Kouhei Sutou - 4.03-2 +- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!! + +* Thu May 29 2014 Kouhei Sutou - 4.03-1 +- new upstream release. + +* Tue Apr 29 2014 Kouhei Sutou - 4.02-1 +- new upstream release. + +* Sat Mar 29 2014 HAYASHI Kentaro - 4.01-1 +- new upstream release. + +* Thu Mar 06 2014 HAYASHI Kentaro - 4.00-2 +- use MySQL 5.5.36 on CentOS 5. + +* Sun Feb 09 2014 HAYASHI Kentaro - 4.00-1 +- new upstream release. + +* Wed Jan 29 2014 HAYASHI Kentaro - 3.12-1 +- new upstream release. + +* Sun Dec 29 2013 HAYASHI Kentaro - 3.11-1 +- new upstream release. + +* Fri Nov 29 2013 HAYASHI Kentaro - 3.10-1 +- new upstream release. + +* Tue Oct 29 2013 HAYASHI Kentaro - 3.09-1 +- initial packaging for MySQL 5.5 on CentOS 5. diff --git a/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in new file mode 100644 index 00000000000..6cd5d30cc84 --- /dev/null +++ b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in @@ -0,0 +1,198 @@ +%{!?centos_ver:%define centos_ver 6} + +%if %{centos_ver} == 7 +%define mysql_version_default 5.6.20 +%define mysql_release_default 4 +%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.20 +%define mysql_release_default 4 +%define mysql_dist_default el6 +%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/6/SRPMS +%define mysql_spec_file_default mysql.spec +%endif + +%{!?mysql_version:%define mysql_version %{mysql_version_default}} +%{!?mysql_release:%define mysql_release %{mysql_release_default}} +%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}} +%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}} +%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}} + +%define groonga_required_version @REQUIRED_GROONGA_VERSION@ + +Name: mysql-community-mroonga +Version: @VERSION@ +Release: 1%{?dist} +Summary: A fast fulltext searchable storage engine for MySQL + +Group: Applications/Databases +License: LGPLv2.1 +URL: http://mroonga.org/ +Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) +BuildRequires: groonga-devel >= %{groonga_required_version} +BuildRequires: groonga-normalizer-mysql-devel +BuildRequires: wget +BuildRequires: which +BuildRequires: gcc, gcc-c++ +BuildRequires: mysql-community-devel +Requires: mysql-community-server = %{mysql_version}-%{mysql_release}.%{mysql_dist} +Requires: mysql-community-client = %{mysql_version}-%{mysql_release}.%{mysql_dist} +Requires: groonga-libs >= %{groonga_required_version} +Requires: groonga-normalizer-mysql + +%description +Mroonga is a fast fulltext searchable storage plugin for MySQL. +It is based on Groonga that is a fast fulltext search engine and +column store. Groonga is good at real-time update. + +%package doc +Summary: Documentation for Mroonga +Group: Documentation +License: LGPLv2.1 + +%description doc +Documentation for Mroonga + + +%prep +%setup -q -n mroonga-%{version} + +mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist} +srpm=mysql-community-${mysql_full_version}.src.rpm +if [ ! -f ../../SRPMS/$srpm ]; then + wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm + rpm -Uvh ../../SRPMS/$srpm +fi + +%build +mysql_source=../mysql-%{mysql_version}/mysql-%{mysql_version} +if [ ! -d ${mysql_source} ]; then + specs_dir= + MYSQL_RPMBUILD_TEST=no rpmbuild -bp \ + --define 'runselftest 0' \ + --define 'optflags -O0' \ + ../../SPECS/%{mysql_spec_file} +fi +%configure --disable-static --with-mysql-source=${mysql_source} \ + %{?mroonga_configure_options} +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la +mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +mysql_command=`which mysql` +password_option="" +$mysql_command -u root -e "quit" +if [ $? -ne 0 ]; then + password_option="-p" +fi +current_version=0 +version=`echo %{groonga_required_version} | sed -e 's/\.//g'` +required_version=`expr $version` +version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ + grep mroonga | cut -f 2 | sed -e 's/\.//g'` +if [ -n "$version" ]; then + current_version=`expr $version` +fi +install_sql=%{_datadir}/mroonga/install.sql +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if [ "$1" = 2 ] ; then + if [ $current_version -lt $required_version ]; then + command="$mysql_command -u root $password_option" + echo "run the following command after restarting MySQL server:"; + echo " $command < ${uninstall_sql}" + echo " $command < ${install_sql}" + exit 0 + else + command="$mysql_command -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") + fi +fi +command="$mysql_command -u root $password_option < ${install_sql}" +echo $command +eval $command || \ + (echo "run the following command to register Mroonga:"; \ + echo " $command") + +%preun +uninstall_sql=%{_datadir}/mroonga/uninstall.sql +mysql_command=`which mysql` +if $mysql_command -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +if [ "$1" = 0 ]; then + command="$mysql_command -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") +fi + +%files +%defattr(-,root,root,-) +%{_libdir}/mysql/plugin/ +%{_datadir}/mroonga/* +%{_datadir}/man/man1/* +%{_datadir}/man/*/man1/* + +%files doc +%defattr(-,root,root,-) +%doc README COPYING +%doc mysql-mroonga-doc/* + +%changelog +* Fri Aug 29 2014 Kouhei Sutou - 4.05-1 +- new upstream release. + +* Sat Aug 09 2014 Eiichi Sato - 4.04-2 +- build against MySQL 5.6.20-4 on MySQL yum repository. + +* Tue Jul 29 2014 HAYASHI Kentaro - 4.04-1 +- new upstream release. + +* Thu May 29 2014 Kouhei Sutou - 4.03-2 +- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!! + +* Thu May 29 2014 Kouhei Sutou - 4.03-1 +- new upstream release. + +* Tue Apr 29 2014 Kouhei Sutou - 4.02-1 +- new upstream release. + +* Sat Mar 29 2014 HAYASHI Kentaro - 4.01-1 +- new upstream release. + +* Thu Mar 06 2014 HAYASHI Kentaro - 4.00-2 +- use MySQL 5.5.36 on CentOS 5. + +* Sun Feb 09 2014 HAYASHI Kentaro - 4.00-1 +- new upstream release. + +* Wed Jan 29 2014 HAYASHI Kentaro - 3.12-1 +- new upstream release. + +* Sun Dec 29 2013 HAYASHI Kentaro - 3.11-1 +- new upstream release. + +* Fri Nov 29 2013 HAYASHI Kentaro - 3.10-1 +- new upstream release. + +* Tue Oct 29 2013 HAYASHI Kentaro - 3.09-1 +- initial packaging for MySQL 5.5 on CentOS 5. diff --git a/storage/mroonga/packages/rpm/fedora/Makefile.am b/storage/mroonga/packages/rpm/fedora/Makefile.am new file mode 100644 index 00000000000..df9df6100e9 --- /dev/null +++ b/storage/mroonga/packages/rpm/fedora/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = mysql-mroonga.spec.in mariadb-mroonga.spec.in +noinst_DATA = mysql-mroonga.spec mariadb-mroonga.spec diff --git a/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in b/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in new file mode 100644 index 00000000000..9ee123448b2 --- /dev/null +++ b/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in @@ -0,0 +1,189 @@ +%define mariadb_version 5.5.38 +%define mariadb_release 3%{?dist} +#%define mariadb_download_base_url http://ftp.iij.ad.jp/pub/linux/fedora/updates/20/SRPMS +%define mariadb_download_base_url http://ftp.riken.jp/Linux/fedora/updates/20/SRPMS +%define groonga_required_version @REQUIRED_GROONGA_VERSION@ + +Name: mariadb-mroonga +Version: @VERSION@ +Release: 1%{?dist} +Summary: A fast fulltext searchable storage engine for MariaDB + +Group: Applications/Databases +License: LGPLv2 +URL: http://mroonga.org/ +Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz + +BuildRequires: groonga-devel >= %{groonga_required_version} +BuildRequires: groonga-normalizer-mysql-devel +BuildRequires: mariadb-devel +BuildRequires: perl(Test::More) +BuildRequires: perl(Env) +BuildRequires: pam-devel +Requires: groonga-libs >= %{groonga_required_version} +Requires: mariadb-server = 1:%{mariadb_version}-%{mariadb_release} +Requires: mariadb = 1:%{mariadb_version}-%{mariadb_release} +Requires: groonga-normalizer-mysql +Obsoletes: mysql-groonga < 1.10-0 + +%description +Mroonga is a fast fulltext searchable storage plugin for MariaDB. +It is based on Groonga that is a fast fulltext search engine and +column store. Groonga is good at real-time update. + +%package doc +Summary: Documentation for Mroonga +Group: Documentation +License: LGPLv2 + +%description doc +Documentation for Mroonga + +%prep +%setup -q -n mroonga-%{version} +srpm=mariadb-%{mariadb_version}-%{mariadb_release}.src.rpm +if [ ! -f ../../SRPMS/$srpm ]; then + curl --output ../../SRPMS/$srpm %{mariadb_download_base_url}/$srpm + rpm -Uvh ../../SRPMS/$srpm +fi + +%build +if [ ! -d ../mariadb-%{mariadb_version} ]; then + rpmbuild -bp --define 'runselftest 0' --define 'optflags -O0' \ + ../../SPECS/mariadb.spec +fi +%configure CPPFLAGS="-DDISABLE_DTRACE" \ + --disable-static \ + --with-mysql-source=../mariadb-%{mariadb_version} \ + --enable-fast-mutexes \ + %{?mroonga_configure_options} +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la +mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mariadb-mroonga-doc/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if /usr/bin/mysql -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +current_version=0 +version=`echo %{groonga_required_version} | sed -e 's/\.//g'` +required_version=`expr $version` +version=`/usr/bin/mysql -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ + grep mroonga | cut -f 2 | sed -e 's/\.//g'` +if [ -n "$version" ]; then + current_version=`expr $version` +fi +install_sql=%{_datadir}/mroonga/install.sql +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if [ "$1" = 2 ] ; then + if [ $current_version -lt $required_version ]; then + command="/usr/bin/mysql -u root $password_option" + echo "run the following command after restarting MariaDB server:"; + echo " $command < ${uninstall_sql}" + echo " $command < ${install_sql}" + exit 0 + else + command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") + fi +fi +sql="$install_sql" +command="/usr/bin/mysql -u root $password_option -e \"$sql\"" +echo $command +eval $command || \ + (echo "run the following command to register mroonga:"; \ + echo " $command") + +%preun +uninstall_sql=%{_datadir}/mroonga/uninstall.sql +password_option="" +mysql -u root -e "quit" +if [ $? -ne 0 ]; then + password_option="-p" +fi +if [ "$1" = 0 ]; then + command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") +fi + +%files +%defattr(-,root,root,-) +%{_libdir}/mysql/plugin/ +%{_datadir}/mroonga/* +%{_datadir}/man/man1/* +%{_datadir}/man/*/man1/* + +%files doc +%defattr(-,root,root,-) +%doc README COPYING +%doc mariadb-mroonga-doc/* + +%changelog +* Fri Aug 29 2014 Kouhei Sutou - 4.05-1 +- new upstream release. + +* Tue Jul 29 2014 HAYASHI Kentaro - 4.04-1 +- new upstream release. + +* Thu May 29 2014 Kouhei Sutou - 4.03-1 +- new upstream release. + +* Tue Apr 29 2014 HAYASHI Kentaro - 4.02-2 +- use MariaDB 5.5.37 on Fedora 20. + +* Tue Apr 29 2014 Kouhei Sutou - 4.02-1 +- new upstream release. + +* Sat Mar 29 2014 HAYASHI Kentaro - 4.01-1 +- new upstream release. +- use MariaDB 5.5.35-3 on Fedora 20. + +* Sun Feb 09 2014 HAYASHI Kentaro - 4.00-1 +- new upstream release. +- use MariaDB 5.5.34-3 on Fedora 20. + +* Wed Jan 29 2014 HAYASHI Kentaro - 3.12-1 +- new upstream release. + +* Sun Dec 29 2013 HAYASHI Kentaro - 3.11-1 +- new upstream release. +- support Fedora 20. + +* Fri Nov 29 2013 HAYASHI Kentaro - 3.10-1 +- new upstream release. + +* Tue Oct 29 2013 HAYASHI Kentaro - 3.09-1 +- new upstream release. +- use MariaDB 5.5.33a on Fedora 19. + +* Sun Sep 29 2013 HAYASHI Kentaro - 3.08-1 +- new upstream release. + +* Wed Sep 4 2013 HAYASHI Kentaro - 3.07-2 +- fix a bug that mroonga is removed accidentally on upgrade #1918. + Reported by @ceekz. Thanks!!! + +* Thu Aug 29 2013 HAYASHI Kentaro - 3.07-1 +- new upstream release. + +* Mon Jul 29 2013 HAYASHI Kentaro - 3.06-1 +- new upstream release. +- initial packaging for mariadb on Fedora 19. + diff --git a/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in b/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in new file mode 100644 index 00000000000..4e28121a611 --- /dev/null +++ b/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in @@ -0,0 +1,324 @@ +%define mysql_version 5.5.38 +%define mysql_release 3%{?dist} +#%define mysql_download_base_url http://ftp.iij.ad.jp/pub/linux/fedora/releases/20/Everything/source/SRPMS/c +# %define mysql_download_base_url http://ftp.iij.ad.jp/pub/linux/fedora/updates/20/SRPMS +%define mysql_download_base_url http://ftp.riken.jp/Linux/fedora/updates/20/SRPMS +%define groonga_required_version @REQUIRED_GROONGA_VERSION@ + +Name: mysql-mroonga +Version: @VERSION@ +Release: 1%{?dist} +Summary: A fast fulltext searchable storage engine for MySQL + +Group: Applications/Databases +License: LGPLv2 +URL: http://mroonga.org/ +Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz + +BuildRequires: groonga-devel >= %{groonga_required_version} +BuildRequires: groonga-normalizer-mysql-devel +BuildRequires: community-mysql-devel +Requires: groonga-libs >= %{groonga_required_version} +Requires: community-mysql-server = %{mysql_version}-%{mysql_release} +Requires: community-mysql = %{mysql_version}-%{mysql_release} +Requires: groonga-normalizer-mysql +Obsoletes: mysql-groonga < 1.10-0 + +%description +Mroonga is a fast fulltext searchable storage plugin for MySQL. +It is based on Groonga that is a fast fulltext search engine and +column store. Groonga is good at real-time update. + +%package doc +Summary: Documentation for Mroonga +Group: Documentation +License: LGPLv2 + +%description doc +Documentation for Mroonga + +%prep +%setup -q -n mroonga-%{version} +srpm=community-mysql-%{mysql_version}-%{mysql_release}.src.rpm +if [ ! -f ../../SRPMS/$srpm ]; then + curl --output ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm + rpm -Uvh ../../SRPMS/$srpm +fi + +%build +if [ ! -d ../mysql-%{mysql_version} ]; then + rpmbuild -bp --define 'runselftest 0' --define 'optflags -O0' \ + ../../SPECS/community-mysql.spec +fi +%configure CPPFLAGS="-DDISABLE_DTRACE" \ + --disable-static \ + --with-mysql-source=../mysql-%{mysql_version} \ + --disable-fast-mutexes \ + %{?mroonga_configure_options} +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la +mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if /usr/bin/mysql -u root -e "quit"; then + password_option="" +else + password_option="-p" +fi +current_version=0 +version=`echo %{groonga_required_version} | sed -e 's/\.//g'` +required_version=`expr $version` +version=`/usr/bin/mysql -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \ + grep mroonga | cut -f 2 | sed -e 's/\.//g'` +if [ -n "$version" ]; then + current_version=`expr $version` +fi +install_sql=%{_datadir}/mroonga/install.sql +uninstall_sql=%{_datadir}/mroonga/uninstall.sql + +if [ "$1" = 2 ] ; then + if [ $current_version -lt $required_version ]; then + command="/usr/bin/mysql -u root $password_option" + echo "run the following command after restarting MySQL server:"; + echo " $command < ${uninstall_sql}" + echo " $command < ${install_sql}" + exit 0 + else + command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") + fi +fi +command="/usr/bin/mysql -u root $password_option < ${install_sql}" +echo $command +eval $command || \ + (echo "run the following command to register Mroonga:"; \ + echo " $command") + +%preun +uninstall_sql=%{_datadir}/mroonga/uninstall.sql +password_option="" +mysql -u root -e "quit" +if [ $? -ne 0 ]; then + password_option="-p" +fi +if [ "$1" = 0 ]; then + command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}" + echo $command + eval $command || \ + (echo "run the following command to unregister Mroonga:"; \ + echo " $command") +fi + +%files +%defattr(-,root,root,-) +%{_libdir}/mysql/plugin/ +%{_datadir}/mroonga/* +%{_datadir}/man/man1/* +%{_datadir}/man/*/man1/* + +%files doc +%defattr(-,root,root,-) +%doc README COPYING +%doc mysql-mroonga-doc/* + +%changelog +* Fri Aug 29 2014 Kouhei Sutou - 4.05-1 +- new upstream release. + +* Tue Jul 29 2014 HAYASHI Kentaro - 4.04-1 +- new upstream release. + +* Thu May 29 2014 Kouhei Sutou - 4.03-1 +- new upstream release. + +* Tue Apr 29 2014 HAYASHI Kentaro - 4.02-2 +- use Community MySQL 5.5.37 on Fedora 20. + +* Tue Apr 29 2014 Kouhei Sutou - 4.02-1 +- new upstream release. + +* Sat Mar 29 2014 HAYASHI Kentaro - 4.01-1 +- new upstream release. + +* Sun Feb 09 2014 HAYASHI Kentaro - 4.00-1 +- new upstream release. + +* Wed Jan 29 2014 HAYASHI Kentaro - 3.12-1 +- new upstream release. +- use MySQL 5.5.35 on Fedora 20. + +* Sun Dec 29 2013 HAYASHI Kentaro - 3.11-1 +- new upstream release. +- support Fedora 20. + +* Fri Nov 29 2013 HAYASHI Kentaro - 3.10-1 +- new upstream release. +- use MySQL 5.5.34 on Fedora 19. + +* Tue Oct 29 2013 HAYASHI Kentaro - 3.09-1 +- new upstream release. + +* Sun Sep 29 2013 HAYASHI Kentaro - 3.08-1 +- new upstream release. +- use MySQL 5.5.33 on Fedora 19. + +* Wed Sep 4 2013 HAYASHI Kentaro - 3.07-2 +- fix a bug that mroonga is removed accidentally on upgrade #1918. + Reported by @ceekz. Thanks!!! + +* Thu Aug 29 2013 HAYASHI Kentaro - 3.07-1 +- new upstream release. + +* Mon Jul 29 2013 HAYASHI Kentaro - 3.06-1 +- new upstream release. + +* Sat Jun 29 2013 HAYASHI Kentaro - 3.05-1 +- new upstream release. +- use MySQL 5.5.32 on Fedora 18. + +* Wed May 29 2013 HAYASHI Kentaro - 3.04-1 +- new upstream release. +- use MySQL 5.5.31 on Fedora 18. + +* Mon Apr 29 2013 HAYASHI Kentaro - 3.03-1 +- new upstream release. + +* Fri Mar 29 2013 HAYASHI Kentaro - 3.02-0 +- new upstream release. + +* Thu Feb 28 2013 HAYASHI Kentaro - 3.01-0 +- new upstream release. +- use MySQL 5.5.30 on Fedora 18. + +* Sat Feb 09 2013 HAYASHI Kentaro - 3.00-0 +- new upstream release. +- support Fedora 18. +- drop Fedora 17 support. +- require groonga 3.0.0 or later + +* Thu Jan 24 2013 HAYASHI Kentaro - 2.10-1 +- build with MySQL 5.5.29 on Fedora 17. + +* Sat Dec 29 2012 HAYASHI Kentaro - 2.10-0 +- new upstream release. + +* Thu Nov 29 2012 HAYASHI Kentaro - 2.09-0 +- new upstream release. + +* Mon Oct 29 2012 HAYASHI Kentaro - 2.08-0 +- new upstream release. +- add missing "DROP FUNCTION mroonga_snippet". + Reported by @tokuhy. Thanks!!! +- use MySQL 5.5.28. + +* Sat Sep 29 2012 HAYASHI Kentaro - 2.07-0 +- new upstream release. + +* Wed Aug 29 2012 Kouhei Sutou - 2.06-0 +- new upstream release. +- use MySQL 5.5.27. + +* Sun Jul 29 2012 HAYASHI Kentaro - 2.05-0 +- new upstream release. +- use MySQL 5.5.25a. + +* Fri Jun 29 2012 Kouhei Sutou - 2.04-0 +- new upstream release. +- ensure deleting mroonga plugin before install. + Suggested by Kazuhiro Isobe. Thanks!!! +- use MySQL 5.5.24. + +* Tue May 29 2012 Kouhei Sutou - 2.03-0 +- new upstream release. +- use MySQL 5.5.23. +- require groonga 2.0.3 or later. + +* Sun Apr 29 2012 Kouhei Sutou - 2.02-0 +- new upstream release. +- require groonga 2.0.2 or later. +- use MySQL 5.5.22. + +* Thu Mar 29 2012 Kouhei Sutou - 2.01-0 +- new upstream release. +- ensure plugin is uninstalled by closing all tables use mroonga. +- use MySQL 5.5.21. + +* Wed Feb 29 2012 Kouhei Sutou - 2.00-0 +- new upstream release. +- always install/uninstall plugin. +- use MySQL 5.5.20. +- require groonga 2.0.0 or later. + +* Sun Jan 29 2012 Kouhei Sutou - 1.20-0 +- new upstream release. +- require groonga 1.3.0. +- groonga -> mroonga. +- use MySQL 5.5.19. + +* Thu Dec 29 2011 Kouhei Sutou - 1.11-0 +- new upstream release. + +* Sat Oct 29 2011 Kouhei Sutou - 1.10-0 +- new upstream release. +- groonga storage engine -> mroonga. +- split document package. + +* Thu Sep 29 2011 Kouhei Sutou - 1.0.0-0 +- new upstream release. + +* Mon Aug 29 2011 Kouhei Sutou - 0.9-0 +- new upstream release. + +* Fri Jul 29 2011 Kouhei Sutou - 0.8-0 +- new upstream release. + +* Wed Jun 29 2011 Kouhei Sutou - 0.7-0 +- new upstream release. + +* Sun May 29 2011 Kouhei Sutou - 0.6-0 +- new upstream release. + +* Tue Mar 29 2011 Kouhei Sutou - 0.5-1 +- new upstream release. + +* Sat Jan 29 2011 Kouhei Sutou - 0.4-3 +- do not remove plugin on upgrade. + +* Thu Dec 30 2010 Kouhei Sutou - 0.4-2 +- fix SQL literal notation. + +* Mon Nov 29 2010 Kouhei Sutou - 0.4-1 +- use the latest MySQL. +- new upstream release. + +* Sun Nov 21 2010 Kouhei Sutou - 0.3-2 +- install user define function. + +* Fri Oct 29 2010 Kouhei Sutou - 0.3-1 +- new upstream release. + +* Fri Oct 08 2010 Kouhei Sutou - 0.2-2 +- use %{version}. + +* Wed Sep 29 2010 Kouhei Sutou - 0.2-1 +- new upstream release. + +* Sun Sep 12 2010 Kouhei Sutou - 0.1-3 +- require mysql-client. + +* Fri Sep 10 2010 Kouhei Sutou - 0.1-2 +- follow configure option changes. + +* Fri Sep 03 2010 Kouhei Sutou - 0.1-1 +- initial packaging for Fedora. diff --git a/storage/mroonga/packages/source/Makefile.am b/storage/mroonga/packages/source/Makefile.am new file mode 100644 index 00000000000..dc4c17d2cd6 --- /dev/null +++ b/storage/mroonga/packages/source/Makefile.am @@ -0,0 +1,122 @@ +MROONGA_BASE = $(PACKAGE)-$(VERSION) +MROONGA_TAR_GZ = $(MROONGA_BASE).tar.gz + +GROONGA_VERSION = 4.0.4 +GROONGA_BASE = groonga-$(GROONGA_VERSION) +GROONGA_TAR_GZ = $(GROONGA_BASE).tar.gz + +GROONGA_NORMALIZER_MYSQL_VERSION = 1.0.6 +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.13 +MARIADB_BASE = mariadb-$(MARIADB_VERSION) +MARIADB_TAR_GZ = $(MARIADB_BASE).tar.gz + +MARIADB_WITH_MROONGA_BASE = $(MARIADB_BASE)-with-$(MROONGA_BASE) +MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE = $(MARIADB_WITH_MROONGA_BASE)-for-windows + +GROONGA_PROJECT_DOWNLOAD_BASE = http://packages.groonga.org/source +GROONGA_DOWNLOAD_BASE = $(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga +GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE = \ + $(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga-normalizer-mysql +MARIADB_DOWNLOAD_BASE = http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb + + +CURL = curl --fail --silent --show-error + +all: + +release: archive upload + +ensure-rsync-path: + @if test -z "$(RSYNC_PATH)"; then \ + echo "--with-rsync-path configure option must be specified."; \ + false; \ + fi + +download: ensure-rsync-path + rsync -avz --progress --delete $(RSYNC_PATH)/source/mroonga/ files + +ARCHIVES = \ + files/$(MROONGA_TAR_GZ) \ + files/$(MARIADB_WITH_MROONGA_BASE).tar.gz \ + files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip + +archive: $(ARCHIVES) + +upload: ensure-rsync-path + rsync -avz --progress --delete files/ $(RSYNC_PATH)/source/mroonga + +files/$(MROONGA_TAR_GZ): $(top_builddir)/$(MROONGA_TAR_GZ) + mkdir -p files + cp -p $< $@ + +tmp/$(GROONGA_TAR_GZ): + mkdir -p tmp + $(CURL) --output $@ $(GROONGA_DOWNLOAD_BASE)/$(GROONGA_TAR_GZ) + +tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ): + mkdir -p tmp + $(CURL) --output $@ $(GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE)/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) + +tmp/$(MARIADB_TAR_GZ): + mkdir -p tmp + $(CURL) --output $@ $(MARIADB_DOWNLOAD_BASE)/mariadb-$(MARIADB_VERSION)/source/$(MARIADB_TAR_GZ) + +MARIADB_WITH_MROONGA_ARCHIVES = \ + tmp/$(GROONGA_TAR_GZ) \ + tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) \ + tmp/$(MARIADB_TAR_GZ) \ + $(top_builddir)/$(MROONGA_TAR_GZ) + +BUNDLED_MROONGA_PATH = $(MARIADB_BASE)/storage/$(PACKAGE) +BUNDLED_GROONGA_PATH = $(BUNDLED_MROONGA_PATH)/vendor/groonga +BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH = \ + $(BUNDLED_GROONGA_PATH)/vendor/plugins/groonga-normalizer-mysql + +tmp/$(MARIADB_WITH_MROONGA_BASE).stamp: $(MARIADB_WITH_MROONGA_ARCHIVES) + rm -rf $(MARIADB_BASE) + tar xf tmp/$(MARIADB_TAR_GZ) + + tar xf $(top_builddir)/$(MROONGA_TAR_GZ) + mv $(MROONGA_BASE) $(BUNDLED_MROONGA_PATH) + + mkdir -p $$(dirname $(BUNDLED_GROONGA_PATH)) + tar xf tmp/$(GROONGA_TAR_GZ) + rm -rf $(GROONGA_BASE)/test + mv $(GROONGA_BASE) $(BUNDLED_GROONGA_PATH) + + tar xf tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) + rm -rf $(GROONGA_NORMALIZER_MYSQL_BASE)/test + mv $(GROONGA_NORMALIZER_MYSQL_BASE) $(BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH) + + rm -rf tmp/$(MARIADB_WITH_MROONGA_BASE) + mv $(MARIADB_BASE) tmp/$(MARIADB_WITH_MROONGA_BASE) + + touch $@ + +files/$(MARIADB_WITH_MROONGA_BASE).tar.gz: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp + mkdir -p files/ + (cd tmp && tar czf ../$@ $(MARIADB_WITH_MROONGA_BASE)) + +PATCHES = \ + patches/mariadb-10.0.3-windows-build.diff + +tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp $(PATCHES) + rm -rf tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE) + cp -a \ + tmp/$(MARIADB_WITH_MROONGA_BASE) \ + tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE) + for patch in $(PATCHES); do \ + (cd tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE) && \ + patch -p1 < $(abs_srcdir)/$${patch}); \ + done + + touch $@ + +files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip: tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp + mkdir -p files/ + (cd tmp && zip -q -r ../$@ $(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE)) diff --git a/storage/mroonga/packages/source/patches/mariadb-10.0.3-windows-build.diff b/storage/mroonga/packages/source/patches/mariadb-10.0.3-windows-build.diff new file mode 100644 index 00000000000..c135088b8cc --- /dev/null +++ b/storage/mroonga/packages/source/patches/mariadb-10.0.3-windows-build.diff @@ -0,0 +1,9 @@ +diff -ur mariadb-10.0.2.orig/sql/sql_locale.cc mariadb-10.0.2/sql/sql_locale.cc +--- mariadb-10.0.2.orig/sql/sql_locale.cc 2013-04-23 13:13:59.000000000 +0900 ++++ mariadb-10.0.2/sql/sql_locale.cc 2013-05-19 12:55:27.590366542 +0900 +@@ -1,4 +1,4 @@ +-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. ++/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by diff --git a/storage/mroonga/packages/ubuntu/Makefile.am b/storage/mroonga/packages/ubuntu/Makefile.am new file mode 100644 index 00000000000..af677d733e0 --- /dev/null +++ b/storage/mroonga/packages/ubuntu/Makefile.am @@ -0,0 +1,24 @@ +CODE_NAMES = precise,trusty +SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz + +all: + +ensure-launchpad-configuration: + @if test -z "$(LAUNCHPAD_UPLOADER_PGP_KEY)"; then \ + echo "--with-launchpad-uploader-pgp-key configure option must be specified."; \ + false; \ + fi + +upload: source ensure-launchpad-configuration + ./upload.rb \ + --package '$(PACKAGE)' \ + --version '$(VERSION)' \ + --source-archive '$(SOURCE)' \ + --code-names '$(CODE_NAMES)' \ + --debian-directory '$(srcdir)/../debian/' \ + --pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)' + +source: $(SOURCE) + +$(SOURCE): + ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE) diff --git a/storage/mroonga/packages/ubuntu/upload.rb b/storage/mroonga/packages/ubuntu/upload.rb new file mode 100755 index 00000000000..3331de6d5eb --- /dev/null +++ b/storage/mroonga/packages/ubuntu/upload.rb @@ -0,0 +1,168 @@ +#!/usr/bin/env ruby +# +# Copyright(C) 2014 Kouhei Sutou +# Copyright(C) 2014 HAYASHI Kentaro +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1 as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +require "optparse" +require "fileutils" +require "pathname" +require "open-uri" + +class Uploader + def initialize + @dput_configuration_name = "groonga-ppa" + end + + def run + ensure_dput_configuration + + parse_command_line! + + ensure_mysql_version + + @required_groonga_version = required_groonga_version + + @code_names.each do |code_name| + upload(code_name) + end + end + + private + def ensure_dput_configuration + dput_cf_path = Pathname.new("~/.dput.cf").expand_path + if dput_cf_path.exist? + dput_cf_content = dput_cf_path.read + else + dput_cf_content = "" + end + dput_cf_content.each_line do |line| + return if line.chomp == "[#{@dput_configuration_name}]" + end + + dput_cf_path.open("w") do |dput_cf| + dput_cf.puts(dput_cf_content) + dput_cf.puts(<<-CONFIGURATION) +[#{@dput_configuration_name}] +fqdn = ppa.launchpad.net +method = ftp +incoming = ~groonga/ppa/ubuntu/ +login = anonymous +allow_unsigned_uploads = 0 + CONFIGURATION + end + end + + def ensure_mysql_version + @mysql_version = {} + @code_names.each do |code_name| + open("http://packages.ubuntu.com/#{code_name}/allpackages?format=txt.gz") do |file| + file.each_line do |line| + @mysql_version[code_name] = $1 if line =~ /\Amysql-server \((.+?)\).+/ + end + end + end + end + + def parse_command_line! + + parser = OptionParser.new + parser.on("--package=NAME", + "The package name") do |name| + @package = name + end + parser.on("--version=VERSION", + "The version") do |version| + @version = version + end + parser.on("--source-archive=ARCHIVE", + "The source archive") do |source_archive| + @source_archive = Pathname.new(source_archive).expand_path + end + parser.on("--code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array, + "The target code names") do |code_names| + @code_names = code_names + end + parser.on("--debian-directory=DIRECTORY", + "The debian/ directory") do |debian_directory| + @debian_directory = Pathname.new(debian_directory).expand_path + end + parser.on("--pgp-sign-key=KEY", + "The PGP key to sign .changes and .dsc") do |pgp_sign_key| + @pgp_sign_key = pgp_sign_key + end + parser.on("--pbuilder", + "Use pbuilder for build check") do |pbuilder| + @use_pbuilder = pbuilder + end + + parser.parse! + end + + def upload(code_name) + in_temporary_directory do + FileUtils.cp(@source_archive.to_s, + "#{@package}_#{@version}.orig.tar.gz") + run_command("tar", "xf", @source_archive.to_s) + directory_name = "#{@package}-#{@version}" + Dir.chdir(directory_name) do + FileUtils.cp_r(@debian_directory.to_s, "debian") + deb_version = "#{current_deb_version.succ}~#{code_name}1" + run_command("dch", + "--distribution", code_name, + "--newversion", deb_version, + "Build for #{code_name}.") + run_command("sed", + "-i", "-e", "s,MYSQL_VERSION,#{@mysql_version[code_name]},", + "debian/control") + run_command("debuild", "-S", "-sa", "-pgpg2", "-k#{@pgp_sign_key}") + if @use_pbuilder + run_command("pbuilder-dist", code_name, "build", + "../#{@package}_#{deb_version}.dsc") + else + run_command("dput", @dput_configuration_name, + "../#{@package}_#{deb_version}_source.changes") + end + end + end + end + + def required_groonga_version + File.read("../../required_groonga_version").lines.first.chomp + end + + def current_deb_version + /\((.+)\)/ =~ File.read("debian/changelog").lines.first + $1 + end + + def in_temporary_directory + name = "tmp" + FileUtils.rm_rf(name) + FileUtils.mkdir_p(name) + Dir.chdir(name) do + yield + end + end + + def run_command(*command_line) + unless system(*command_line) + raise "failed to run command: #{command_line.join(' ')}" + end + end +end + +uploader = Uploader.new +uploader.run diff --git a/storage/mroonga/packages/windows/Makefile.am b/storage/mroonga/packages/windows/Makefile.am new file mode 100644 index 00000000000..a2ff8f59792 --- /dev/null +++ b/storage/mroonga/packages/windows/Makefile.am @@ -0,0 +1,12 @@ +EXTRA_DIST = \ + README.md \ + build-vc2010.bat \ + build-vc2010-zip-32.bat \ + build-vc2010-zip-64.bat \ + build-vc2010-msi-32.bat \ + build-vc2010-msi-64.bat \ + build-vc2013.bat \ + build-vc2013-zip-32.bat \ + build-vc2013-zip-64.bat \ + build-vc2013-msi-32.bat \ + build-vc2013-msi-64.bat diff --git a/storage/mroonga/packages/windows/README.md b/storage/mroonga/packages/windows/README.md new file mode 100644 index 00000000000..f7788ffe26b --- /dev/null +++ b/storage/mroonga/packages/windows/README.md @@ -0,0 +1,20 @@ +# How to build Windows binaries + +## Preparation + +TODO... + +## Build with Visual C++ Express + +You need to use Visual C++ 2012 or later to build Mroonga with Express +edition. `build-vc2013.bat` is a build batch script to build with +Visual C++ Express 2013. + +Note that you can't build MSI file with Express edition. You need to +use Professional edition or upper editions to build MSI file. + +## Build with Visual C++ Professional + +You can build both zip file MSI file with Professional edition. +`build-vc2010.bat` is a build batch script to build with Visual C++ +Professional 2010. diff --git a/storage/mroonga/packages/windows/build-vc2010-msi-32.bat b/storage/mroonga/packages/windows/build-vc2010-msi-32.bat new file mode 100644 index 00000000000..15185eaba92 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2010-msi-32.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2010-msi-32 +mkdir build-vc2010-msi-32 +cd build-vc2010-msi-32 +cmake ..\source -G "Visual Studio 10" > 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-vc2010-msi-64.bat b/storage/mroonga/packages/windows/build-vc2010-msi-64.bat new file mode 100644 index 00000000000..ea0b7f07eb3 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2010-msi-64.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2010-msi-64 +mkdir build-vc2010-msi-64 +cd build-vc2010-msi-64 +cmake ..\source -G "Visual Studio 10 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-vc2010-zip-32.bat b/storage/mroonga/packages/windows/build-vc2010-zip-32.bat new file mode 100644 index 00000000000..6942e01145d --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2010-zip-32.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2010-zip-32 +mkdir build-vc2010-zip-32 +cd build-vc2010-zip-32 +cmake ..\source -G "Visual Studio 10" > 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-vc2010-zip-64.bat b/storage/mroonga/packages/windows/build-vc2010-zip-64.bat new file mode 100644 index 00000000000..de8f1db10e0 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2010-zip-64.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2010-zip-64 +mkdir build-vc2010-zip-64 +cd build-vc2010-zip-64 +cmake ..\source -G "Visual Studio 10 Win64" > 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-vc2010.bat b/storage/mroonga/packages/windows/build-vc2010.bat new file mode 100644 index 00000000000..5fcf0639412 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2010.bat @@ -0,0 +1,4 @@ +build-vc2010-zip-32.bat +build-vc2010-zip-64.bat +build-vc2010-msi-32.bat +build-vc2010-msi-64.bat diff --git a/storage/mroonga/packages/windows/build-vc2013-msi-32.bat b/storage/mroonga/packages/windows/build-vc2013-msi-32.bat new file mode 100644 index 00000000000..22b29972885 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2013-msi-32.bat @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000000..c83a376cdb9 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2013-msi-64.bat @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000000..d6401a6bfed --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2013-zip-32.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2013-zip-32 +mkdir build-vc2013-zip-32 +cd build-vc2013-zip-32 +cmake ..\source -G "Visual Studio 12" > 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 new file mode 100644 index 00000000000..fd55a25d90e --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2013-zip-64.bat @@ -0,0 +1,8 @@ +rmdir /S /Q build-vc2013-zip-64 +mkdir build-vc2013-zip-64 +cd build-vc2013-zip-64 +cmake ..\source -G "Visual Studio 12 Win64" > 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 new file mode 100644 index 00000000000..99d7e4042c5 --- /dev/null +++ b/storage/mroonga/packages/windows/build-vc2013.bat @@ -0,0 +1,4 @@ +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/yum/Makefile.am b/storage/mroonga/packages/yum/Makefile.am new file mode 100644 index 00000000000..b110b478a14 --- /dev/null +++ b/storage/mroonga/packages/yum/Makefile.am @@ -0,0 +1,63 @@ +REPOSITORIES_PATH = repositories +DISTRIBUTIONS = centos +ARCHITECTURES = i386 x86_64 +MYSQL_VARIANTS = mysql55 mysql56-community mariadb +SPEC_DIR = $(builddir)/../rpm/centos + +all: + +release: download build sign-packages update-repository upload + +remove-existing-packages: + for distribution in $(DISTRIBUTIONS); do \ + find $${distribution} -name "*.rpm" -delete; \ + done + +ensure-rsync-path: + @if test -z "$(RSYNC_PATH)"; then \ + echo "--with-rsync-path configure option must be specified."; \ + false; \ + fi + +sign-packages: + ./sign-rpm.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(DISTRIBUTIONS)' + +update-repository: + ./update-repository.sh '$(REPOSITORIES_PATH)/' '$(DISTRIBUTIONS)' + +upload: ensure-rsync-path + for distribution in $(DISTRIBUTIONS); do \ + rsync -avz --progress --delete --exclude .gitignore \ + $(REPOSITORIES_PATH)/$${distribution}/ \ + $(RSYNC_PATH)/$${distribution}; \ + done + +download: ensure-rsync-path + mkdir -p $(REPOSITORIES_PATH) + for distribution in $(DISTRIBUTIONS); do \ + rsync -avz --progress --delete \ + $(RSYNC_PATH)/$${distribution}/ \ + $(REPOSITORIES_PATH)/$${distribution}; \ + done + +build: build-in-vm + +build-in-vm: source specs env.sh + ./build-in-vm.sh \ + "$(PACKAGE)" \ + "$(SPEC_DIR)" \ + "$(MYSQL_VARIANTS)" \ + "$(ARCHITECTURES)" + +source: tmp/$(PACKAGE)-$(VERSION).tar.gz + +tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz + mkdir -p tmp/ + cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz tmp/ + +$(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz: + cd $(abs_top_builddir) && $(MAKE) dist + +specs: $(SPEC_DIR)/mysql55-$(PACKAGE).spec +specs: $(SPEC_DIR)/mysql56-community-$(PACKAGE).spec +specs: $(SPEC_DIR)/mariadb-$(PACKAGE).spec diff --git a/storage/mroonga/packages/yum/Vagrantfile b/storage/mroonga/packages/yum/Vagrantfile new file mode 100644 index 00000000000..aeee1ceb5b2 --- /dev/null +++ b/storage/mroonga/packages/yum/Vagrantfile @@ -0,0 +1,50 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + vms = [ + { + :id => "centos-5-i386", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10-i386_chef-provisionerless.box", + }, + { + :id => "centos-5-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box", + }, + { + :id => "centos-6-i386", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5-i386_chef-provisionerless.box", + }, + { + :id => "centos-6-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box", + }, + { + :id => "centos-7-x86_64", + :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box", + }, + ] + + vms.each do |vm| + config.vm.define(vm[:id]) do |node| + node.vm.box = vm[:id] + node.vm.box_url = vm[:box_url] + node.vm.provision(:shell, :path => "build-rpm.sh") + node.vm.provider("virtualbox") do |virtual_box| + 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 = vm_n_cpus + end + end + end +end diff --git a/storage/mroonga/packages/yum/build-in-vm.sh b/storage/mroonga/packages/yum/build-in-vm.sh new file mode 100755 index 00000000000..5dc27ec38dd --- /dev/null +++ b/storage/mroonga/packages/yum/build-in-vm.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +if [ $# != 4 ]; then + echo "Usage: $0 PACKAGE SPEC_DIR MYSQL_VARIANTS ARCHITECTURES" + echo " e.g.: $0 mroonga ../rpm/centos 'mysql55 mariadb' 'i386 x86_64'" + exit 1 +fi + +PACKAGE="$1" +SPEC_DIR="$2" +MYSQL_VARIANTS="$3" +ARCHITECTURES="$4" + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +run vagrant destroy --force + +for mysql_variant in ${MYSQL_VARIANTS}; do + rm -rf tmp/centos/ + mkdir -p tmp/centos/ + cp ${SPEC_DIR}/${mysql_variant}-${PACKAGE}.spec tmp/centos/ + + architectures="${ARCHITECTURES}" + case ${mysql_variant} in + mysql55) + centos_versions="5 6" + ;; + mysql56-community) + centos_versions="6 7" + ;; + mariadb) + centos_versions="7" + ;; + esac + + for architecture in ${architectures}; do + for centos_version in ${centos_versions}; do + if [ ${mysql_variant} = mysql55 -a ${centos_version} = 6 -a ${architecture} = i386 ]; then + continue + fi + if [ ${centos_version} = 7 -a ${architecture} = i386 ]; then + continue + fi + id=centos-${centos_version}-${architecture} + vagrant up ${id} + build_status=$? + if [ $build_status -ne 0 ]; then + exit $build_status + fi + vagrant destroy --force ${id} + done + done +done diff --git a/storage/mroonga/packages/yum/build-rpm.sh b/storage/mroonga/packages/yum/build-rpm.sh new file mode 100755 index 00000000000..6eaa2cce02a --- /dev/null +++ b/storage/mroonga/packages/yum/build-rpm.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +LANG=C + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +rpmbuild_options= + +. /vagrant/env.sh + +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') + +architecture="$(arch)" +case "${architecture}" in + i*86) + architecture=i386 + ;; +esac + +run yum groupinstall -y "Development Tools" +run yum install -y rpm-build rpmdevtools tar wget + +if [ -x /usr/bin/rpmdev-setuptree ]; then + rm -rf .rpmmacros + run rpmdev-setuptree +else + run cat < ~/.rpmmacros +%_topdir ${HOME}/rpmbuild +EOM + run mkdir -p ~/rpmbuild/SOURCES + run mkdir -p ~/rpmbuild/SPECS + run mkdir -p ~/rpmbuild/BUILD + run mkdir -p ~/rpmbuild/RPMS + run mkdir -p ~/rpmbuild/SRPMS +fi + +repository="/vagrant/repositories/${distribution}/${distribution_version}" +rpm_dir="${repository}/${architecture}/Packages" +srpm_dir="${repository}/source/SRPMS" +run mkdir -p "${rpm_dir}" "${srpm_dir}" + +rpmbuild_options="" + +# for debug +# rpmbuild_options="${rpmbuild_options} --define 'optflags -O0 -g3'" + +cd + +run cp /vagrant/tmp/${PACKAGE}-${VERSION}.* rpmbuild/SOURCES/ +run cp /vagrant/tmp/${distribution}/*.spec rpmbuild/SPECS/ + +package_name=$(cd rpmbuild/SPECS; echo *.spec | sed -e 's/\.spec$//g') + +case ${distribution} in + fedora) + USE_MYSQLSERVICES_COMPAT=yes + run yum install -y mariadb-devel + ;; + centos) + 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 + fi + run yum install -y mysql55-mysql-devel mysql55-build + ;; + mysql56-community-${PACKAGE}) + release_rpm=mysql-community-release-el${distribution_version}-5.noarch.rpm + run yum -y install http://repo.mysql.com/${release_rpm} + run yum -y install mysql-community-devel + ;; + mariadb-${PACKAGE}) + run yum -y install mariadb-devel + ;; + 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} + +if [ "${USE_MYSQLSERVICES_COMPAT}" = "yes" ]; then + rpmbuild_options="$rpmbuild_options --define 'mroonga_configure_options --with-libmysqlservices-compat'" +fi + +run eval rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${package_name}.spec + +run mv rpmbuild/RPMS/*/* "${rpm_dir}/" +run mv rpmbuild/SRPMS/* "${srpm_dir}/" diff --git a/storage/mroonga/packages/yum/env.sh.in b/storage/mroonga/packages/yum/env.sh.in new file mode 100644 index 00000000000..90e701ec89e --- /dev/null +++ b/storage/mroonga/packages/yum/env.sh.in @@ -0,0 +1,27 @@ +PACKAGE=@PACKAGE@ +VERSION=@VERSION@ +DEPENDED_PACKAGES=" +intltool +libtool +gcc +gcc-c++ +make +gperf +readline-devel +openssl-devel +time +wget +ncurses-devel +sudo +pkgconfig +tar +cmake +libaio-devel +systemtap-sdt-devel +perl-Time-HiRes +perl-Env +perl-Test-Simple +pam-devel +groonga-devel +groonga-normalizer-mysql-devel +" diff --git a/storage/mroonga/packages/yum/sign-rpm.sh b/storage/mroonga/packages/yum/sign-rpm.sh new file mode 100755 index 00000000000..511fb3df0a4 --- /dev/null +++ b/storage/mroonga/packages/yum/sign-rpm.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESTINATION DISTRIBUTIONS" + echo " e.g.: $0 'F10399C0' repositories/ 'fedora centos'" + exit 1 +fi + +GPG_UID=$1 +DESTINATION=$2 +DISTRIBUTIONS=$3 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +unsigned_rpms() +{ + while read rpm; do + rpm --checksig "$rpm" | grep -v 'gpg OK' | cut -d":" -f1 + done +} + +rpms="" +for distribution in ${DISTRIBUTIONS}; do + rpms="${rpms} $(find ${DESTINATION}${distribution} -name '*.rpm' | unsigned_rpms)" +done + +echo "NOTE: YOU JUST ENTER! YOU DON'T NEED TO INPUT PASSWORD!" +echo " IT'S JUST FOR rpm COMMAND RESTRICTION!" +run echo $rpms | xargs rpm \ + -D "_gpg_name ${GPG_UID}" \ + -D "_gpg_digest_algo sha1" \ + -D "__gpg /usr/bin/gpg2" \ + -D "__gpg_check_password_cmd /bin/true true" \ + -D "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" \ + --resign diff --git a/storage/mroonga/packages/yum/update-repository.sh b/storage/mroonga/packages/yum/update-repository.sh new file mode 100755 index 00000000000..630b6c87422 --- /dev/null +++ b/storage/mroonga/packages/yum/update-repository.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 2 ]; then + echo "Usage: $0 DESTINATION DISTRIBUTIONS" + echo " e.g.: $0 repositories/ 'fedora centos'" + exit 1 +fi + +DESTINATION=$1 +DISTRIBUTIONS=$2 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +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 + done; +done diff --git a/storage/mroonga/plug.in b/storage/mroonga/plug.in new file mode 100644 index 00000000000..2c9c15f6c86 --- /dev/null +++ b/storage/mroonga/plug.in @@ -0,0 +1,6 @@ +MYSQL_STORAGE_ENGINE(mroonga,,[mroonga], +[[CJK-ready fulltext search, column store]], +[max,max-no-ndb]) +MYSQL_PLUGIN_DIRECTORY(mroonga, [storage/mroonga]) +MYSQL_PLUGIN_STATIC(mroonga, [libmroonga.a]) +MYSQL_PLUGIN_DYNAMIC(mroonga, [ha_mroonga.la]) diff --git a/storage/mroonga/plugin_version b/storage/mroonga/plugin_version new file mode 100644 index 00000000000..958d30d86d0 --- /dev/null +++ b/storage/mroonga/plugin_version @@ -0,0 +1 @@ +4.5 \ No newline at end of file diff --git a/storage/mroonga/required_groonga_normalizer_mysql_version b/storage/mroonga/required_groonga_normalizer_mysql_version new file mode 100644 index 00000000000..af0b7ddbffd --- /dev/null +++ b/storage/mroonga/required_groonga_normalizer_mysql_version @@ -0,0 +1 @@ +1.0.6 diff --git a/storage/mroonga/required_groonga_version b/storage/mroonga/required_groonga_version new file mode 100644 index 00000000000..fcdb2e109f6 --- /dev/null +++ b/storage/mroonga/required_groonga_version @@ -0,0 +1 @@ +4.0.0 diff --git a/storage/mroonga/sources.am b/storage/mroonga/sources.am new file mode 100644 index 00000000000..4082e9465a1 --- /dev/null +++ b/storage/mroonga/sources.am @@ -0,0 +1,13 @@ +sources = \ + mrn_macro.hpp \ + mrn_sys.cpp \ + mrn_sys.hpp \ + mrn_constants.hpp \ + ha_mroonga.cpp \ + ha_mroonga.hpp \ + mrn_table.cpp \ + mrn_table.hpp \ + mrn_err.h \ + mrn_mysql.h \ + mrn_mysql_compat.h \ + ha_mroonga.def diff --git a/storage/mroonga/test/Makefile.am b/storage/mroonga/test/Makefile.am new file mode 100644 index 00000000000..ce75011bee8 --- /dev/null +++ b/storage/mroonga/test/Makefile.am @@ -0,0 +1,14 @@ +SUBDIRS = unit + +TESTS = run-sql-test.sh +TESTS_ENVIRONMENT = \ + NO_MAKE="yes" + +if WITH_CUTTER +TESTS += run-unit-test.sh +TESTS_ENVIRONMENT += CUTTER="$(CUTTER)" +endif + +EXTRA_DIST = \ + run-unit-test.sh \ + run-sql-test.sh diff --git a/storage/mroonga/test/run-sql-test.sh b/storage/mroonga/test/run-sql-test.sh new file mode 100755 index 00000000000..690f75c413b --- /dev/null +++ b/storage/mroonga/test/run-sql-test.sh @@ -0,0 +1,232 @@ +#!/bin/sh +# +# Copyright(C) 2010 Tetsuro IKEDA +# Copyright(C) 2010-2013 Kouhei Sutou +# Copyright(C) 2011 Kazuhiko +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +export BASE_DIR="$(cd $(dirname $0); pwd)" +top_dir="$BASE_DIR/.." +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)" + ;; + *) + : + ;; +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 +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 +fi + +source_mysql_test_dir="${MYSQL_SOURCE_DIR}/mysql-test" +build_mysql_test_dir="${MYSQL_BUILD_DIR}/mysql-test" +source_test_suites_dir="${source_mysql_test_dir}/suite" +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" + fi + ;; +esac + +same_link_p() +{ + 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}" +fi + +innodb_test_suite_dir="${build_test_suites_dir}/innodb" +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}" +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, + \"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 +fi + +all_test_suite_names="" +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}" +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 +fi + +test_suite_names="" +test_names="" +while [ $# -gt 0 ]; do + case "$1" in + --manual-gdb|--debug) + n_processors=1 + break + ;; + --*) + break + ;; + *) + 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 +done + +if [ -z "$test_suite_names" ]; then + test_suite_names="${all_test_suite_names}" +fi + +mysql_test_run_args="" +mysql_test_run_args="${mysql_test_run_args} --mem" +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" +mysql_test_run_args="${mysql_test_run_args} --suite=${test_suite_names}" +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}" +fi + +(cd "$build_mysql_test_dir" && \ + ./mysql-test-run.pl \ + ${mysql_test_run_args} \ + "$@") diff --git a/storage/mroonga/test/run-unit-test.sh b/storage/mroonga/test/run-unit-test.sh new file mode 100755 index 00000000000..6d99513123d --- /dev/null +++ b/storage/mroonga/test/run-unit-test.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +export BASE_DIR="`dirname $0`" +top_dir="$BASE_DIR/.." + +if test -z "$NO_MAKE"; then + MAKE_ARGS= + case `uname` in + Linux) + MAKE_ARGS="-j$(grep '^processor' /proc/cpuinfo | wc -l)" + ;; + Darwin) + MAKE_ARGS="-j$(/usr/sbin/sysctl -n hw.ncpu)" + ;; + *) + : + ;; + esac + make $MAKE_ARGS -C $top_dir > /dev/null || exit 1 +fi + +if test -z "$CUTTER"; then + CUTTER="`make -s -C $top_dir echo-cutter`" +fi +export CUTTER + +CUTTER_ARGS= +CUTTER_WRAPPER= +if test x"$STOP" = x"yes"; then + CUTTER_ARGS="-v v --fatal-failures" +else + CUTTER_ARGS="-v v" +fi + +if test x"$CUTTER_DEBUG" = x"yes"; then + if test x"$TUI_DEBUG" = x"yes"; then + CUTTER_WRAPPER="$top_dir/libtool --mode=execute gdb --tui --args" + else + CUTTER_WRAPPER="$top_dir/libtool --mode=execute gdb --args" + fi + CUTTER_ARGS="--keep-opening-modules" +elif test x"$CUTTER_CHECK_LEAK" = x"yes"; then + CUTTER_WRAPPER="$top_dir/libtool --mode=execute valgrind " + CUTTER_WRAPPER="$CUTTER_WRAPPER --leak-check=full --show-reachable=yes -v" + CUTTER_ARGS="--keep-opening-modules" +fi + +CUTTER_ARGS="$CUTTER_ARGS -s $BASE_DIR" +$CUTTER_WRAPPER $CUTTER $CUTTER_ARGS "$@" $BASE_DIR diff --git a/storage/mroonga/test/unit/Makefile.am b/storage/mroonga/test/unit/Makefile.am new file mode 100644 index 00000000000..30c9ca20486 --- /dev/null +++ b/storage/mroonga/test/unit/Makefile.am @@ -0,0 +1,34 @@ +if WITH_CUTTER +noinst_LTLIBRARIES = \ + test_mrn_sys.la \ + test_mrn_path_mapper.la +endif + +AM_CPPFLAGS = \ + $(GROONGA_CFLAGS) \ + $(CPPCUTTER_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib + +AM_LDFLAGS = \ + -module \ + -rpath $(libdir) \ + -avoid-version \ + -no-undefined + +LIBS = \ + $(CPPCUTTER_LIBS) \ + $(GROONGA_LIBS) \ + $(MECAB_LIBS) + +EXTERNAL_SRC = ../../mrn_sys.cpp + +test_mrn_sys_la_SOURCES = \ + $(EXTERNAL_SRC) \ + test_mrn_sys.cpp + +test_mrn_path_mapper_la_SOURCES = \ + test_mrn_path_mapper.cpp + +test_mrn_path_mapper_la_LIBADD = \ + $(top_builddir)/lib/libmrn_no_mysql.la diff --git a/storage/mroonga/test/unit/test_mrn_path_mapper.cpp b/storage/mroonga/test/unit/test_mrn_path_mapper.cpp new file mode 100644 index 00000000000..70009c5b32e --- /dev/null +++ b/storage/mroonga/test/unit/test_mrn_path_mapper.cpp @@ -0,0 +1,116 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include + +#include + +namespace test_mrn_path_mapper { + namespace db_path { + namespace without_prefix { + void test_normal_db() { + mrn::PathMapper mapper("./db/", NULL); + cppcut_assert_equal("db.mrn", mapper.db_path()); + } + + void test_normal_table() { + mrn::PathMapper mapper("./db/table", NULL); + cppcut_assert_equal("db.mrn", mapper.db_path()); + } + + void test_temporary_table() { + mrn::PathMapper mapper("/tmp/mysqld.1/#sql27c5_1_0", NULL); + cppcut_assert_equal("/tmp/mysqld.1/#sql27c5_1_0.mrn", + mapper.db_path()); + } + } + + namespace with_prefix { + void test_normal_db() { + mrn::PathMapper mapper("./db/", "mroonga.data/"); + cppcut_assert_equal("mroonga.data/db.mrn", mapper.db_path()); + } + + void test_normal_table() { + mrn::PathMapper mapper("./db/table", "mroonga.data/"); + cppcut_assert_equal("mroonga.data/db.mrn", mapper.db_path()); + } + + void test_temporary_table() { + mrn::PathMapper mapper("/tmp/mysqld.1/#sql27c5_1_0", "mroonga.data/"); + cppcut_assert_equal("/tmp/mysqld.1/#sql27c5_1_0.mrn", + mapper.db_path()); + } + } + } + + namespace db_name { + void test_normal_db() { + mrn::PathMapper mapper("./db/", NULL); + cppcut_assert_equal("db", mapper.db_name()); + } + + void test_normal_table() { + mrn::PathMapper mapper("./db/table", NULL); + cppcut_assert_equal("db", mapper.db_name()); + } + + void test_temporary_table() { + mrn::PathMapper mapper("/tmp/mysqld.1/#sql27c5_1_0", NULL); + cppcut_assert_equal("/tmp/mysqld.1/#sql27c5_1_0", + mapper.db_name()); + } + } + + namespace table_name { + void test_normal_table() { + mrn::PathMapper mapper("./db/table", NULL); + cppcut_assert_equal("table", mapper.table_name()); + } + + void test_temporary_table() { + mrn::PathMapper mapper("/tmp/mysqld.1/#sql27c5_1_0", NULL); + cppcut_assert_equal("#sql27c5_1_0", mapper.table_name()); + } + + void test_underscore_start_table() { + mrn::PathMapper mapper("./db/_table", NULL); + cppcut_assert_equal("@005ftable", mapper.table_name()); + } + } + + namespace mysql_table_name { + void test_normal_table() { + mrn::PathMapper mapper("./db/table", NULL); + cppcut_assert_equal("table", mapper.mysql_table_name()); + } + + void test_temporary_table() { + mrn::PathMapper mapper("/tmp/mysqld.1/#sql27c5_1_0", NULL); + cppcut_assert_equal("#sql27c5_1_0", mapper.mysql_table_name()); + } + + void test_underscore_start_table() { + mrn::PathMapper mapper("./db/_table", NULL); + cppcut_assert_equal("_table", mapper.mysql_table_name()); + } + } +} + diff --git a/storage/mroonga/test/unit/test_mrn_sys.cpp b/storage/mroonga/test/unit/test_mrn_sys.cpp new file mode 100644 index 00000000000..fcc4b768efe --- /dev/null +++ b/storage/mroonga/test/unit/test_mrn_sys.cpp @@ -0,0 +1,95 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2010 Tetsuro IKEDA + Copyright(C) 2011-2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include + +#include + +static grn_ctx *ctx; +static grn_obj *db; +static grn_hash *hash; +static grn_obj buffer; + +namespace test_mrn_sys +{ + void cut_startup() + { + ctx = (grn_ctx *)malloc(sizeof(grn_ctx)); + grn_init(); + grn_ctx_init(ctx, 0); + db = grn_db_create(ctx, NULL, NULL); + grn_ctx_use(ctx, db); + } + + void cut_shutdown() + { + grn_obj_unlink(ctx, db); + grn_ctx_fin(ctx); + grn_fin(); + free(ctx); + } + + void cut_setup() + { + hash = grn_hash_create(ctx, NULL, 1024, sizeof(grn_obj *), + GRN_OBJ_KEY_VAR_SIZE); + GRN_TEXT_INIT(&buffer, 0); + } + + void cut_teardown() + { + grn_hash_close(ctx, hash); + grn_obj_unlink(ctx, &buffer); + } + + void test_mrn_hash_put() + { + const char *key = "mroonga"; + + cut_assert_true(mrn_hash_put(ctx, hash, key, &buffer)); + cut_assert_false(mrn_hash_put(ctx, hash, key, &buffer)); + } + + void test_mrn_hash_get() + { + const char *key = "mroonga"; + const char *value = "A storage engine based on groonga."; + grn_obj *result; + + GRN_TEXT_SETS(ctx, &buffer, value); + GRN_TEXT_PUT(ctx, &buffer, "\0", 1); + + mrn_hash_put(ctx, hash, key, &buffer); + cut_assert_true(mrn_hash_get(ctx, hash, key, &result)); + cppcut_assert_equal(value, GRN_TEXT_VALUE(&buffer)); + } + + void test_mrn_hash_remove() + { + const char *key = "mroonga"; + + mrn_hash_put(ctx, hash, key, &buffer); + + cut_assert_false(mrn_hash_remove(ctx, hash, "nonexistent")); + cut_assert_true(mrn_hash_remove(ctx, hash, key)); + cut_assert_false(mrn_hash_remove(ctx, hash, key)); + } +} diff --git a/storage/mroonga/tools/Makefile.am b/storage/mroonga/tools/Makefile.am new file mode 100644 index 00000000000..b65b930029b --- /dev/null +++ b/storage/mroonga/tools/Makefile.am @@ -0,0 +1,6 @@ +noinstall_ruby_scripts = \ + prepare-sphinx-html.rb \ + upload-to-github.rb + +EXTRA_DIST = \ + $(noinstall_ruby_scripts) diff --git a/storage/mroonga/tools/prepare-sphinx-html.rb b/storage/mroonga/tools/prepare-sphinx-html.rb new file mode 100755 index 00000000000..76eed24a042 --- /dev/null +++ b/storage/mroonga/tools/prepare-sphinx-html.rb @@ -0,0 +1,183 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +if ARGV.size != 2 + puts "Usage: #{$0} SOURCE_DIR DEST_DIR" + exit(false) +end + +require 'pathname' +require "fileutils" + +def fix_link(text, extension, language) + send("fix_#{extension}_link", text, language) +end + +def fix_link_path(text) + text.gsub(/\b_(sources|static|images)\b/, '\1') +end + +def fix_language_link(url, language) + url.gsub(/\A((?:\.\.\/){2,})([a-z]{2})\/html\//) do + relative_base_path = $1 + link_language = $2 + close_quote = $3 + if language == "en" + relative_base_path = relative_base_path.gsub(/\A\.\.\//, '') + end + if link_language != "en" + relative_base_path += "#{link_language}/" + end + "#{relative_base_path}docs/" + end +end + +def fix_html_link(html, language) + html = html.gsub(/(href|src)="(.+?)"/) do + attribute = $1 + link = $2 + link = fix_link_path(link) + link = fix_language_link(link, language) + "#{attribute}=\"#{link}\"" + end + html.gsub(/(id="top-link" href=)"(.+?)"/) do + prefix = $1 + top_path = $2.gsub(/\/index\.html\z/, '/') + top_path = "./" if ["index.html", "#"].include?(top_path) + "#{prefix}\"#{top_path}../\"" + 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 + +LANGUAGE_TO_LOCALE = { + "ja" => "ja_JP", + "en" => "en_US", +} + +def insert_facebook_html_header(html) + html.gsub(/<\/head>/) do + <<-HTML + + + + + + + + + HTML + end +end + +def insert_facebook_html_fb_root(html) + html.gsub(//) do + <<-HTML + +
+ HTML + end +end + +def insert_facebook_html_buttons(html) + html.gsub(/(