summaryrefslogtreecommitdiffstats
path: root/storage/mroonga/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/mroonga/mysql-test')
-rw-r--r--storage/mroonga/mysql-test/Makefile.am8
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc26
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc19
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc19
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc31
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc33
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc20
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc32
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc26
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc47
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc42
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc17
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc26
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc28
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc28
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/print_groonga_query_log.inc8
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc28
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc21
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc26
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/disabled.def10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_after.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_first.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_plain.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_duplicated.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_multiple_column_duplicated.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_key_multiple_column_with_data.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_primary_key.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_comment_not_for_mroonga.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_have_index.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_after.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_first.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_multiple.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result63
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_create_fulltext.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_ujis.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_utf8.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_multiple_column.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_normal.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_primary.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_truncate.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_updating.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_multiple.result36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_column_one.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_key_multiple_column_with_data.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_ujis.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_utf8.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_multiple_column.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_normal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_primary.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_no_primary_key.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_table.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_drop_table.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_after.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_first.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_modify_column_no_order.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result132
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_TODO_SPLIT_ME.result53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_table_param.result70
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/auto_increment_text.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/binlog_TODO_SPLIT_ME.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_general_ci_french.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_french.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_ci_japanese.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_comment_index_not_for_mroonga.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_comment_normal_not_for_mroonga.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_date_with_index.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_date_without_index.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_enum_less_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_enum_many_with_index.result287
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result8
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id_invalid_id.result8
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_reference.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_lz4.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zlib.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_lz4.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zlib.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_with_not_for_mroonga_comment.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_order_by_with_function.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_int_with_index_zero_value.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_set_24_with_index.result48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_set_32_with_index.result56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_set_64_with_index.result88
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_set_8_with_index.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_signed_bigint_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_signed_int_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_signed_mediumint_with_index.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_signed_smallint_with_index.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_signed_tinyint_with_index.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_tinyint_without_index.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_bigint_without_index.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_int_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_mediumint_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_smallint_with_index.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_unsigned_tinyint_with_index.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/count_star.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_TODO_SPLIT_ME.result172
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_comment_normal.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_comment.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_none.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_parameter.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_default.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_hash.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_stop_word.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_fulltext_column.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_index_btree_many_records.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_no_unique.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_index_hash_id_unique.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_normal_column.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/delete_unsigned_bigint.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/drop_database_TODO_SPLIT_ME.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/drop_table_TODO_SPLIT_ME.result5
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/flush_logs.result1
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_empty_query.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_escape.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_full_spec.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_no_weight.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_omit_section.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_weight_three_or_more_sections.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_ascii.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_cp932.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_eucjpms.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_japanese.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_empty_query.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_groonga_varchar_vector.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_not_match_against.result68
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_or.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_against.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_match.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_no_where.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_same_match_against.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_two_inner_join.result41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_10_0_no_such_key.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_5_no_such_key.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_6_no_such_key.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_not_string.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_target_characters_is_not_string.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_all.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_custom.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_nested.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_reference.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_id_set.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result7
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result120
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_cp932.result91
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_eucjpms.result91
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_nonexistent_charset.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_invalid_unsupported_charset.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_japanese.result95
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result167
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result169
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/i_s.result7
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_datetime.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_time.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_btree_equal_timestamp.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_btree_normal_column_insert.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_normal.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_unique.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_hash_normal_column_insert.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_smallint.result65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_bigint.result65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_int.result65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_unsigned_smallint.result65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_nullable_varchar.result65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_select_int.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_replace.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_double.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_float.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_int.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_32bit_equal.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_64bit_equal.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_asc.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_32bit_desc.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_asc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_index_read.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_asc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_decimal.result36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_index_read.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_asc.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_order_desc.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_time_reinsert.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_index_read.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_asc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_order_desc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_timestamp_reinsert.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_varchar.resultbin0 -> 1027 bytes
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_32bit_equal.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_64bit_equal.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_index_read.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_asc.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_desc.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_asc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_desc.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_reinsert.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_int.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_string.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_exact_length.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_null_character.resultbin0 -> 387 bytes
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_short.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_varchar_null_character.resultbin0 -> 390 bytes
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_desc.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_asc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_desc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_asc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_desc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_asc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_desc.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_bigint_unsigned.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_double.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_float.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_int_unsigned.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_mediumint_unsigned.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_smallint_unsigned.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint.result38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_tinyint_unsigned.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_multiple_varchar_collation.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_int.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_normal_varchar.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_int.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_read_primary_varchar.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_by_primary_key.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_unique_insert_after_error.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_unique_search_after_duplicated.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_unique_varchar.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_update_multiple_column.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_update_single_column.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_none.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_auto_increment_use.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result78
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_delayed.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/lock_tables_read.result7
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_single_thread.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_between_over.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_where_clause.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_between_over.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_equal.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_greater_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_year_less_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_vector.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/replace_without_key.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_all.result198
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_equal.result12
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_empty_key_where_not_equal.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_with_index.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/select_secondary_key.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/show_create_table_TODO_SPLIT_ME.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/truncate.result47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_id_hash_index.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_id_unique_hash_index.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_int.result42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_last_insert_grn_id.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_column.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_leading_not.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_update.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_query.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_script.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_new_value.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_default_parser_same_value.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_disable.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_invalid.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_no_retry.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_lock_timeout_valid.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_new_value.result6
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_nonexistent_path.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_log_file_same_value.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_log_level_TODO_SPLIT_ME.result49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_vector_column_delimiter.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/suite.opt1
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/suite.pm23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_after.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_first.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_plain.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_key_multiple_column_with_data.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_comment_not_for_mroonga.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_have_index.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_after.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_first.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_multiple.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_column_rename_no_order.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test58
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_create_fulltext.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_ujis.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_utf8.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_multiple_column.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_normal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_primary.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_truncate.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_updating.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_multiple.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_column_one.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_key_multiple_column_with_data.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_ujis.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_utf8.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_multiple_column.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_normal.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_primary.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_no_primary_key.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_table.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_drop_table.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_after.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_first.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_modify_column_no_order.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test151
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_TODO_SPLIT_ME.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_table_param.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/binlog_TODO_SPLIT_ME.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_french.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_ci_japanese.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_comment_index_not_for_mroonga.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_comment_normal_not_for_mroonga.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_enum_less_with_index.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_enum_many_with_index.test298
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id_invalid_id.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_order_by_with_function.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_int_with_index_zero_value.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_set_24_with_index.test65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_set_32_with_index.test74
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_set_64_with_index.test110
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_set_8_with_index.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_signed_bigint_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_signed_int_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_signed_mediumint_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_signed_smallint_with_index.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_signed_tinyint_with_index.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_bigint_without_index.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_int_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_mediumint_with_index.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_smallint_with_index.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_unsigned_tinyint_with_index.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/count_star.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test60
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test149
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_fulltext_column.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_index_btree_many_records.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_no_unique.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_index_hash_id_unique.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_normal_column.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/delete_unsigned_bigint.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/drop_database_TODO_SPLIT_ME.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test57
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/flush_logs.test21
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_no_weight.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_omit_section.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_ten_or_more_sections.test63
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_three_or_more_sections.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_cp932.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_eucjpms.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_japanese.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_or.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test69
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_not_string.test27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_target_characters_is_not_string.test27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test26
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_reference.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_id_set.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_cp932.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_eucjpms.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_unsupported_charset.test28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_japanese.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test154
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test152
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/i_s.test23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_datetime.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_btree_normal_column_insert.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_normal.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_unique.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_hash_normal_column_insert.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_smallint.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_bigint.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_int.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_unsigned_smallint.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_nullable_varchar.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_select_int.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_double.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_float.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_int.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_varchar.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_32bit_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_64bit_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_index_read.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_asc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_32bit_desc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_asc.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_order_64bit_desc.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_date_reinsert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_index_read.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_asc.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_order_desc.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_reinsert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_decimal.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_index_read.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_asc.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_order_desc.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_time_reinsert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_index_read.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_asc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_order_desc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_timestamp_reinsert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_varchar.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_32bit_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_64bit_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_index_read.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_asc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_32bit_desc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_asc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_order_64bit_desc.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_year_reinsert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_int.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_update_string.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_exact_length.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_null_character.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_varchar_null_character.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint_unsigned.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_int_unsigned.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint_unsigned.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint_unsigned.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint_unsigned.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_varchar_collation.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_int.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_normal_varchar.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_int.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_read_primary_varchar.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_unique_insert_after_error.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/information_schema_plugins.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_none.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_auto_increment_use.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test89
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_no_primary_key_and_unique_key_twice.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test59
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test57
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_between_over.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_where_clause.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_between_over.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_equal.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_greater_than_or_equal.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_year_less_than_or_equal.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test52
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test57
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test65
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_vector.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_all.test100
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_equal.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_empty_key_where_not_equal.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_pkey.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/select_secondary_key.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/show_create_table_TODO_SPLIT_ME.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/truncate.test61
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_id_hash_index.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_id_unique_hash_index.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_int.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_last_insert_grn_id.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_new_value.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_default_parser_same_value.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test27
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test25
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_nonexistent_path.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_same_value.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_log_level_TODO_SPLIT_ME.test61
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test61
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test60
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test60
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test31
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test33
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/disabled.def2
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_create_fulltext.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_fulltext.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_multiple_column.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_normal.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_primary.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_disable_keys_updating.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_fulltext.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_lock_tables.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_multiple_column.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_normal.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_enable_keys_primary.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result122
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/auto_increment_text.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/binlog_TODO_SPLIT_ME.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_comment_index_not_for_mroonga.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result11
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result109
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_comment.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_parameter.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result25
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/delete_TODO_SPLIT_ME.result55
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/delete_all.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result13
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_or.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.result19
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_plus_with_or.result16
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_full_spec.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_no_weight.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_weight_omit_section.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_ascii.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_cp932.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_eucjpms.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_charset_japanese.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result70
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result17
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result4381
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_matched_order.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_no_where_both_order.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.result26
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result194
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_not_match_against.result68
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_reference.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/function_last_insert_id_set.result21
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result160
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/index_force_index_not_used.result8
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/insert_TODO_SPLIT_ME.result78
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.result36
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.result39
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_disk_sweep.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result20
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result53
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_where_clause.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result27
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result22
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result14
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result37
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/update_fulltext.result33
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/update_int.result36
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result45
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result34
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result31
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result24
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/suite.opt1
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/suite.pm23
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test59
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_create_fulltext.test56
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_fulltext.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_multiple_column.test52
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_normal.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_primary.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_disable_keys_updating.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_fulltext.test52
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_lock_tables.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_multiple_column.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_normal.test52
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_enable_keys_primary.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test149
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/binlog_TODO_SPLIT_ME.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test53
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test57
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test101
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test37
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/delete_TODO_SPLIT_ME.test59
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_no_operator.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_or.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_minus_with_plus.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_no_operator.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_minus.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_plus_with_or.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_full_spec.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_no_weight.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_weight_omit_section.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_ascii.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_cp932.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_eucjpms.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_charset_japanese.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test34
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test4135
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test101
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_not_match_against.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test73
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_reference.test36
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/function_last_insert_id_set.test38
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test145
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test48
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/index_force_index_not_used.test32
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/insert_TODO_SPLIT_ME.test91
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test51
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test60
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_where_clause.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test50
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt1
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test58
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test58
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test39
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test63
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test58
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test55
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test62
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/update_fulltext.test43
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/update_int.test41
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test54
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test47
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test60
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test52
1515 files changed, 60885 insertions, 0 deletions
diff --git a/storage/mroonga/mysql-test/Makefile.am b/storage/mroonga/mysql-test/Makefile.am
new file mode 100644
index 00000000..9ea677b5
--- /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_64bit.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc
new file mode 100644
index 00000000..9d1ee1d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc
@@ -0,0 +1,22 @@
+# 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-1335 USA
+
+disable_query_log;
+disable_warnings;
+let $version_compile_64bit=
+ `SELECT IF(@@version_compile_machine LIKE '%64%', 1, 0)`;
+enable_warnings;
+enable_query_log;
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 00000000..51bbe572
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_freebsd.inc
@@ -0,0 +1,20 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fef9de96
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_ha_mroonga_so.inc
@@ -0,0 +1,26 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_libgroonga_embedded.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc
new file mode 100644
index 00000000..926620eb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_embedded.inc
@@ -0,0 +1,19 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $libgroonga_embedded = `SELECT @@mroonga_libgroonga_embedded;`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc
new file mode 100644
index 00000000..2acfb1fb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_lz4.inc
@@ -0,0 +1,20 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $libgroonga_support_lz4 =
+ `SELECT @@mroonga_libgroonga_support_lz4;`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc
new file mode 100644
index 00000000..e9b8dee0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zlib.inc
@@ -0,0 +1,20 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $libgroonga_support_zlib =
+ `SELECT @@mroonga_libgroonga_support_zlib;`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc
new file mode 100644
index 00000000..bdaf5cdf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_libgroonga_support_zstd.inc
@@ -0,0 +1,20 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $libgroonga_support_zstd =
+ `SELECT @@mroonga_libgroonga_support_zstd;`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc
new file mode 100644
index 00000000..5e4a986f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_mariadb.inc
@@ -0,0 +1,19 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..facfcc92
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_osx.inc
@@ -0,0 +1,31 @@
+# Copyright(C) 2014 Toshihisa Tashiro
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $version_compile_os_osx=`SELECT IF(@@version_compile_os like 'osx%', 1, 0);`;
+if ($version_compile_os_osx) {
+ let $version_compile_os_osx_10_8_or_later=
+ `SELECT IF(@@version_compile_os = 'osx10.6', 0, 1);`;
+ if ($version_compile_os_osx_10_8_or_later) {
+ let $version_compile_os_osx_10_8_or_later=
+ `SELECT IF(@@version_compile_os = 'osx10.7', 0, 1);`;
+ }
+}
+if (!$version_comiple_os_osx) {
+ let $version_compile_os_osx_10_8_or_later=0;
+}
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc
new file mode 100644
index 00000000..7e942c09
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_solaris.inc
@@ -0,0 +1,20 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $version_compile_os_solaris=
+ `SELECT IF(@@version_compile_os LIKE 'sun-solaris%', 1, 0);`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc
new file mode 100644
index 00000000..8a4ac6c9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_strict_sql_mode.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $strict_sql_mode =
+ `SELECT @@sql_mode LIKE '%STRICT_TRANS_TABLES%' OR
+ @@sql_mode LIKE '%STRICT_ALL_TABLES%'`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc
new file mode 100644
index 00000000..8b5ea402
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc
@@ -0,0 +1,33 @@
+# Copyright(C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+let $version_major_minor =
+ `SELECT CAST(SUBSTRING_INDEX(@@global.version, '.', 2) AS DECIMAL(4, 2))`;
+
+let $version_5_5 = `SELECT $version_major_minor = 5.5`;
+let $version_5_6 = `SELECT $version_major_minor = 5.6`;
+let $version_5_7 = `SELECT $version_major_minor = 5.7`;
+let $version_10_0 = `SELECT $version_major_minor = 10.0`;
+let $version_10_1 = `SELECT $version_major_minor = 10.1`;
+let $version_10_2 = `SELECT $version_major_minor = 10.2`;
+
+let $version_5_5_or_later = `SELECT $version_major_minor >= 5.5`;
+let $version_5_6_or_later = `SELECT $version_major_minor >= 5.6`;
+let $version_5_7_or_later = `SELECT $version_major_minor >= 5.7`;
+let $version_10_0_or_later = `SELECT $version_major_minor >= 10.0`;
+let $version_10_2_or_later = `SELECT $version_major_minor >= 10.2`;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_windows.inc
new file mode 100644
index 00000000..e9fad828
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_fractional_seconds.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc
new file mode 100644
index 00000000..824e960a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_fractional_seconds.inc
@@ -0,0 +1,32 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_mariadb.inc
+--source ../../include/mroonga/check_version.inc
+
+if ($mariadb) {
+ let $fractional_seconds = 1;
+}
+
+if (!$mariadb) {
+ if ($version_5_6) {
+ let $fractional_seconds = `SELECT @@global.version >= '5.6'`;
+ }
+}
+
+if (!$fractional_seconds) {
+ --skip fractional seconds in time values are available in MySQL version 5.6 or later or MariaDB
+}
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 00000000..1a93d014
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_freebsd.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_groonga_plugin_register.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc
new file mode 100644
index 00000000..dafbc344
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_groonga_plugin_register.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_embedded.inc
+
+if ($libgroonga_embedded) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test requires plugin_register of Groonga. libgroonga embedded build doesn't support it.
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc
new file mode 100644
index 00000000..df30270a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_mariadb.inc
+
+if (!$mariadb) {
+ --skip This test is for MariaDB
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc
new file mode 100644
index 00000000..6cb565ab
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mariadb_10_2_or_later.inc
@@ -0,0 +1,26 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if (!$mariadb) {
+ --skip This test is for MariaDB version 10.2.x or later
+}
+
+if (!$version_10_2_or_later) {
+ --skip This test is for MariaDB version 10.2.x or later
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc
new file mode 100644
index 00000000..98d387b0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga.inc
@@ -0,0 +1,47 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"`;
+ if (!$original_default_tmp_storage_engine) {
+ let original_default_tmp_storage_engine=NULL;
+ }
+ 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 00000000..e29300b5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_deinit.inc
@@ -0,0 +1,42 @@
+# Copyright(C) 2010-2014 Kentoku SHIBA
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+}
+
+# Some test re-creates the test database. Put it back in the
+# original character set
+--source include/default_charset.inc
+disable_query_log;
+drop database test;
+create database test;
+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 00000000..83d74867
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mroonga_helper.inc
@@ -0,0 +1,17 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..90e98c56
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_mysql_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc
new file mode 100644
index 00000000..d354b151
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_mysql_5_7_or_later.inc
@@ -0,0 +1,26 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($mariadb) {
+ --skip This test is for MySQL version 5.7.x or later
+}
+
+if (!$version_5_7_or_later) {
+ --skip This test is for MySQL version 5.7.x or later
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc
new file mode 100644
index 00000000..d19cca5a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_signed_64bit_time_t.inc
@@ -0,0 +1,28 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_64bit.inc
+--source ../../include/mroonga/check_osx.inc
+
+if (!$version_compile_64bit) {
+ --skip Need a 64 binary for signed 64bit time_t
+}
+
+if ($version_compile_os_osx) {
+ if (!$version_compile_os_osx_10_8_or_later) {
+ --skip Need OS X 10.8 or later for signed 64bit time_t
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc
new file mode 100644
index 00000000..a4ab246c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_solaris.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_solaris.inc
+
+if (!$version_compile_os_solaris) {
+ --skip Need Solaris
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc
new file mode 100644
index 00000000..a490b7e8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_strict_sql_mode.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_strict_sql_mode.inc
+
+if (!$strict_sql_mode) {
+ --skip This test is for STRICT_ALL_TABLES or STRICT_TRANS_TABLES
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc
new file mode 100644
index 00000000..260e5d3c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_10_0) {
+ --skip This test is for MariaDB version 10.0.x
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc
new file mode 100644
index 00000000..35f8fb7a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_10_0_or_later.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_10_0_or_later) {
+ --skip This test is for MariaDB version 10.0.x or later
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc
new file mode 100644
index 00000000..a04fe560
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_5.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_5_5) {
+ --skip This test is for MySQL version 5.5.x
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc
new file mode 100644
index 00000000..d23f23e5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_5_6) {
+ --skip This test is for MySQL version 5.6.x
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc
new file mode 100644
index 00000000..db1ac8aa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_6_or_later.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_5_6_or_later) {
+ --skip This test is for MySQL version 5.6.x or later
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc
new file mode 100644
index 00000000..80f15c56
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_5_7) {
+ --skip This test is for MySQL version 5.7.x
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc
new file mode 100644
index 00000000..f5898b0b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_5_7_or_later.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+
+if (!$version_5_7_or_later) {
+ --skip This test is for MySQL version 5.7.x or later or MariaDB 10.0.x or later
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc
new file mode 100644
index 00000000..cbcf659f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/load_mroonga_functions.inc
@@ -0,0 +1,28 @@
+# Copyright(C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+eval CREATE FUNCTION mroonga_snippet_html RETURNS STRING SONAME $ha_mroonga_so;
+eval CREATE FUNCTION mroonga_normalize RETURNS STRING SONAME $ha_mroonga_so;
+eval CREATE FUNCTION mroonga_highlight_html RETURNS STRING SONAME $ha_mroonga_so;
+eval CREATE FUNCTION mroonga_query_expand RETURNS STRING SONAME $ha_mroonga_so;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/print_groonga_query_log.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/print_groonga_query_log.inc
new file mode 100644
index 00000000..d5f8c129
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/print_groonga_query_log.inc
@@ -0,0 +1,8 @@
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+perl;
+open(F, '<', $_="$ENV{MYSQLD_DATADIR}/groonga-query-log.log") or die "open(<$_): $!";
+while (<F>) {
+ s/^[^|]+\|[^|]+\|[^|]+\| *//;
+ print;
+}
+EOF
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 00000000..51f783e7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_freebsd.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_10_0_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc
new file mode 100644
index 00000000..67d6251b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_0_or_later.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($mariadb) {
+ if ($version_10_0_or_later) {
+ --skip This test is not for MariaDB 10.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1.inc
new file mode 100644
index 00000000..7e4c1279
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_10_1) {
+ if ($mariadb) {
+ --skip This test is not for MariaDB 10.1.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc
new file mode 100644
index 00000000..506beeb9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_1_or_earlier.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($mariadb) {
+ if (!$version_10_2_or_later) {
+ --skip This test is not for MariaDB 5.x, MariaDB 10.0.x nor 10.1.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc
new file mode 100644
index 00000000..d40c4ddd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_10_2_or_later.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($mariadb) {
+ if ($version_10_2_or_later) {
+ --skip This test is not for MariaDB 10.2.x or later
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc
new file mode 100644
index 00000000..974851f7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_5_5.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_5_5) {
+ if ($mariadb) {
+ --skip This test is not for MariaDB 5.5.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc
new file mode 100644
index 00000000..7446ffa5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_5.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_5_5) {
+ if (!$mariadb) {
+ --skip This test is not for MySQL 5.5.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc
new file mode 100644
index 00000000..6eaa60a4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_5_7) {
+ if (!$mariadb) {
+ --skip This test is not for MySQL 5.7.x
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc
new file mode 100644
index 00000000..599831e3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_5_7_or_later.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_5_7_or_later) {
+ if (!$mariadb) {
+ --skip This test is not for MySQL 5.7.x or later
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_osx.inc
new file mode 100644
index 00000000..2c1da974
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/skip_signed_64bit_time_t.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc
new file mode 100644
index 00000000..cc06b529
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_signed_64bit_time_t.inc
@@ -0,0 +1,28 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_64bit.inc
+--source ../../include/mroonga/check_osx.inc
+
+if ($version_compile_64bit) {
+ --skip This test is for environment that doesn't have signed 64bit time_t
+}
+
+if ($version_compile_os_osx) {
+ if (!$version_compile_os_osx_10_8_or_later) {
+ --skip This test is not for OS X 10.7 or earlier that isn't detected signed 64bit time_t availability
+ }
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc
new file mode 100644
index 00000000..b79188e4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_solaris.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_solaris.inc
+
+if ($version_compile_os_solaris) {
+ --skip This test is not for Solaris
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc
new file mode 100644
index 00000000..8bb15b03
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_strict_sql_mode.inc
@@ -0,0 +1,21 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_strict_sql_mode.inc
+
+if ($strict_sql_mode) {
+ --skip This test is not for STRICT_ALL_TABLES nor STRICT_TRANS_TABLES
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc
new file mode 100644
index 00000000..40fc5978
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_lz4.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_lz4.inc
+
+if (!$libgroonga_support_lz4) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga supports lz4
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc
new file mode 100644
index 00000000..9d0ed6c1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zlib.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_zlib.inc
+
+if (!$libgroonga_support_zlib) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga supports zlib
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc
new file mode 100644
index 00000000..d09495bd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/support_libgroonga_zstd.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_zstd.inc
+
+if (!$libgroonga_support_zstd) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga supports zstd
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc
new file mode 100644
index 00000000..e72baac2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unload_mroonga_functions.inc
@@ -0,0 +1,26 @@
+# Copyright(C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--disable_query_log
+DROP FUNCTION last_insert_grn_id;
+DROP FUNCTION mroonga_snippet;
+DROP FUNCTION mroonga_command;
+DROP FUNCTION mroonga_escape;
+DROP FUNCTION mroonga_snippet_html;
+DROP FUNCTION mroonga_normalize;
+DROP FUNCTION mroonga_highlight_html;
+DROP FUNCTION mroonga_query_expand;
+--enable_query_log
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc
new file mode 100644
index 00000000..f82fc328
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_lz4.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_lz4.inc
+
+if ($libgroonga_support_lz4) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga doesn't support lz4
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc
new file mode 100644
index 00000000..c93038b0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zlib.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_zlib.inc
+
+if ($libgroonga_support_zlib) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga doesn't support zlib
+}
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc
new file mode 100644
index 00000000..b1c081e3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/unsupport_libgroonga_zstd.inc
@@ -0,0 +1,22 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/check_libgroonga_support_zstd.inc
+
+if ($libgroonga_support_zstd) {
+ --source ../../include/mroonga/have_mroonga_deinit.inc
+ --skip This test is for libgroonga doesn't support zstd
+}
diff --git a/storage/mroonga/mysql-test/mroonga/storage/disabled.def b/storage/mroonga/mysql-test/mroonga/storage/disabled.def
new file mode 100644
index 00000000..6866adc1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/disabled.def
@@ -0,0 +1,10 @@
+alter_table_add_index_token_filters_one_token_filter : Bundled Mroonga does not support token filter yet.
+alter_table_change_token_filter : Bundled Mroonga does not support token filter yet.
+fulltext_token_filters_skip : Bundled Mroonga does not support token filter yet.
+create_table_token_filters_index_comment_multiple_token_filters : Bundled Mroonga does not support token filter yet.
+create_table_token_filters_index_comment_one_token_filter : Bundled Mroonga does not support token filter yet.
+create_table_token_filters_table_comment_multiple_token_filters : Bundled Mroonga does not support token filter yet.
+create_table_token_filters_table_comment_one_token_filter : Bundled Mroonga does not support token filter yet.
+foreign_key_create : Bundled Mroonga does not support this test yet.
+partition_insert : Bundled Mroonga does not support this test yet.
+
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 00000000..15cd3499
--- /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 VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries ADD title VARCHAR(40) AFTER id;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+id title body
+1 groonga (1) starting groonga.
+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 00000000..8b3de1bf
--- /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 VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries ADD title VARCHAR(40) FIRST;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `title` varchar(40) DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+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_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result
new file mode 100644
index 00000000..de0482e6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_comment.result
@@ -0,0 +1,15 @@
+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 --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY UInt32
+column_create tags id COLUMN_SCALAR UInt32
+column_create tags name COLUMN_VECTOR ShortText
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result
new file mode 100644
index 00000000..b3c9875f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_flags_parameter.result
@@ -0,0 +1,22 @@
+CREATE TABLE tags (
+id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
+) DEFAULT CHARSET=utf8;
+ALTER TABLE tags ADD COLUMN name VARCHAR(64) FLAGS='COLUMN_VECTOR';
+SHOW CREATE TABLE tags;
+Table Create Table
+tags CREATE TABLE `tags` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(64) DEFAULT NULL `FLAGS`='COLUMN_VECTOR',
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY UInt32
+column_create tags id COLUMN_SCALAR UInt32
+column_create tags name COLUMN_VECTOR ShortText
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result
new file mode 100644
index 00000000..8a1c18b7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_comment.result
@@ -0,0 +1,23 @@
+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 'groonga_type "tags"';
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY UInt32
+column_create tags id COLUMN_SCALAR UInt32
+
+column_create bugs name COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result
new file mode 100644
index 00000000..85330471
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_groonga_type_parameter.result
@@ -0,0 +1,30 @@
+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) GROONGA_TYPE='tags';
+SHOW CREATE TABLE bugs;
+Table Create Table
+bugs CREATE TABLE `bugs` (
+ `id` int(10) unsigned NOT NULL,
+ `name` varchar(64) DEFAULT NULL `GROONGA_TYPE`='tags',
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY UInt32
+column_create tags id COLUMN_SCALAR UInt32
+
+column_create bugs name COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result
new file mode 100644
index 00000000..6fb1a107
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_cp932.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS users;
+SET NAMES cp932;
+CREATE TABLE users (
+id int PRIMARY KEY
+) DEFAULT CHARSET=cp932;
+ALTER TABLE users
+ADD COLUMN O text,
+ADD FULLTEXT INDEX (O);
+INSERT INTO users VALUES (1, "܂");
+INSERT INTO users VALUES (2, "Ȃ");
+INSERT INTO users VALUES (3, "");
+SELECT * FROM users;
+id O
+1 ܂
+2 Ȃ
+3
+SELECT * FROM users
+WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+id O
+2 Ȃ
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_PAT_KEY Int32
+column_create users @540d@524d COLUMN_SCALAR LongText
+column_create users id COLUMN_SCALAR Int32
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result
new file mode 100644
index 00000000..70c9ea0c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multibyte_utf8.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS users;
+SET NAMES utf8;
+CREATE TABLE users (
+id int PRIMARY KEY
+) DEFAULT CHARSET=utf8;
+ALTER TABLE users
+ADD COLUMN 名前 text,
+ADD FULLTEXT INDEX (名前);
+INSERT INTO users VALUES (1, "やまだ");
+INSERT INTO users VALUES (2, "たなか");
+INSERT INTO users VALUES (3, "すずき");
+SELECT * FROM users;
+id 名前
+1 やまだ
+2 たなか
+3 すずき
+SELECT * FROM users
+WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+id 名前
+2 たなか
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_PAT_KEY Int32
+column_create users @540d@524d COLUMN_SCALAR LongText
+column_create users id COLUMN_SCALAR Int32
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_multiple.result
new file mode 100644
index 00000000..6c6024e4
--- /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 VARCHAR(40)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title) VALUES ("survey");
+SELECT * FROM diaries;
+id title
+1 survey
+ALTER TABLE diaries
+ADD COLUMN body VARCHAR(140) 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` varchar(140) DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `published` tinyint(1) DEFAULT NULL,
+ `title` varchar(40) DEFAULT NULL,
+ `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 00000000..5a5d3715
--- /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 VARCHAR(40)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title) VALUES ("survey");
+SELECT * FROM diaries;
+id title
+1 survey
+ALTER TABLE diaries ADD COLUMN body VARCHAR(140);
+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` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result
new file mode 100644
index 00000000..51362826
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_type_comment.result
@@ -0,0 +1,23 @@
+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 --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY UInt32
+column_create tags id COLUMN_SCALAR UInt32
+
+column_create bugs name COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result
new file mode 100644
index 00000000..373c70e8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result
@@ -0,0 +1,22 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL
+) DEFAULT CHARSET=utf8;
+ALTER TABLE memos ADD FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"';
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_NO_KEY
+column_create memos content COLUMN_SCALAR ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_duplicated.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_duplicated.result
new file mode 100644
index 00000000..8b8b2efb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_duplicated.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT
+) DEFAULT CHARSET UTF8;
+INSERT INTO ids (id) values (1), (1);
+ALTER TABLE ids ADD UNIQUE INDEX (id);
+ERROR 23000: Can't write, because of unique constraint, to table 'ids'
+SHOW CREATE TABLE ids;
+Table Create Table
+ids CREATE TABLE `ids` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT * FROM ids;
+id
+1
+1
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_multiple_column_duplicated.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_multiple_column_duplicated.result
new file mode 100644
index 00000000..8ab7ef22
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_unique_multiple_column_duplicated.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id1 INT,
+id2 INT
+) DEFAULT CHARSET=utf8mb4;
+INSERT INTO ids (id1, id2) values (1, 2), (1, 2);
+ALTER TABLE ids ADD UNIQUE INDEX (id1, id2);
+ERROR 23000: Can't write, because of unique constraint, to table 'ids'
+SHOW CREATE TABLE ids;
+Table Create Table
+ids CREATE TABLE `ids` (
+ `id1` int(11) DEFAULT NULL,
+ `id2` int(11) DEFAULT NULL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4
+SELECT * FROM ids;
+id1 id2
+1 2
+1 2
+DROP TABLE ids;
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 00000000..73fb6a7a
--- /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_add_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_primary_key.result
new file mode 100644
index 00000000..439684ac
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_primary_key.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT NOT NULL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+ALTER TABLE ids ADD PRIMARY KEY (id);
+SHOW CREATE TABLE ids;
+Table Create Table
+ids CREATE TABLE `ids` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT * FROM ids WHERE id = 2;
+id
+2
+DROP TABLE ids;
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 00000000..a993756a
--- /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 00000000..c51c10b6
--- /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 00000000..a9b192e9
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries CHANGE body description VARCHAR(140) AFTER id;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `description` varchar(140) DEFAULT NULL,
+ `title` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga.");
+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 00000000..4faf39ad
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries CHANGE body description VARCHAR(140) FIRST;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `description` varchar(140) DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ 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 00000000..f640e8de
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries
+CHANGE body description VARCHAR(140) FIRST,
+CHANGE title subject VARCHAR(40) AFTER internal_id,
+CHANGE id internal_id INT AUTO_INCREMENT;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `description` varchar(140) DEFAULT NULL,
+ `internal_id` int(11) NOT NULL AUTO_INCREMENT,
+ `subject` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`internal_id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT IGNORE INTO diaries (subject, description)
+VALUES ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+description internal_id subject
+starting groonga. 1 groonga (1)
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_column_rename_no_order.result
new file mode 100644
index 00000000..d49acc52
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ALTER TABLE diaries CHANGE body description VARCHAR(140);
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `description` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, description) values ("groonga (1)", "starting groonga.");
+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_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result
new file mode 100644
index 00000000..dc2ae025
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_decimal.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+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,
+ `temperature` decimal(6,3) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+INSERT INTO diaries (temperature) VALUES (21.281);
+SELECT * FROM diaries;
+id temperature
+1 21.281
+ALTER TABLE diaries ENGINE = mroonga;
+SELECT * FROM diaries;
+id temperature
+1 21.281
+INSERT INTO diaries (temperature) VALUES (14.213);
+INSERT INTO diaries (temperature) VALUES (17.821);
+SELECT * FROM diaries;
+id temperature
+1 21.281
+2 14.213
+3 17.821
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `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_change_engine_fulltext_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result
new file mode 100644
index 00000000..706764a5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_engine_fulltext_index.result
@@ -0,0 +1,39 @@
+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;
+SELECT table_name, engine
+FROM information_schema.tables
+WHERE table_name = 'diaries';
+table_name engine
+diaries MyISAM
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga...");
+SELECT * FROM diaries
+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;
+SELECT table_name, engine
+FROM information_schema.tables
+WHERE table_name = 'diaries';
+table_name engine
+diaries Mroonga
+SELECT * FROM diaries
+WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND
+MATCH(body) AGAINST("groonga" IN BOOLEAN MODE);
+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_change_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result
new file mode 100644
index 00000000..9fc3b408
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result
@@ -0,0 +1,63 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL PRIMARY KEY,
+is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content COLUMN_INDEX|WITH_POSITION memos content
+ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"';
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+ALTER TABLE memos DISABLE KEYS;
+ALTER TABLE memos ENABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/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 00000000..6127df61
--- /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_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result
new file mode 100644
index 00000000..7416481e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result
@@ -0,0 +1,41 @@
+SET NAMES utf8;
+CREATE TABLE terms (
+term varchar(256) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
+ DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+content text NOT NULL,
+FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content
+ALTER TABLE memos DISABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create terms term COLUMN_SCALAR ShortText
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_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 00000000..ff7bc5e7
--- /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 00000000..cbaa8d62
--- /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 00000000..9d6cdcd9
--- /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 00000000..09399c12
--- /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 00000000..f94c98ff
--- /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 00000000..7b71832b
--- /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 00000000..8b6f94c0
--- /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 00000000..a8b8edf2
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+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 00000000..569bba2f
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+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` varchar(40) DEFAULT NULL,
+ 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 00000000..b0aa59a2
--- /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_drop_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result
new file mode 100644
index 00000000..cbcf9a69
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+ALTER TABLE ids DROP PRIMARY KEY;
+SHOW CREATE TABLE ids;
+Table Create Table
+ids CREATE TABLE `ids` (
+ `id` int(11) NOT NULL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT * FROM ids WHERE id = 2;
+id
+2
+DROP TABLE ids;
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 00000000..e5c8a349
--- /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_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result
new file mode 100644
index 00000000..7b3b2863
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result
@@ -0,0 +1,42 @@
+SET NAMES utf8;
+CREATE TABLE terms (
+term varchar(256) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
+ DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+content text NOT NULL,
+FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+ALTER TABLE memos DISABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create terms term COLUMN_SCALAR ShortText
+ALTER TABLE memos ENABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_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 00000000..3853cc84
--- /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 00000000..e5c8a349
--- /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 00000000..e252061d
--- /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 00000000..0e56e78d
--- /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 00000000..722e62f9
--- /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_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 00000000..bf7593f7
--- /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 00000000..cf6840a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_fulltext_add_normal.result
@@ -0,0 +1,14 @@
+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);
+SELECT * FROM memos WHERE MATCH(content) AGAINST("+groonga" IN BOOLEAN MODE);
+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 00000000..705d2f70
--- /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 00000000..2d5e3d55
--- /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 00000000..9b7040bd
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+id title body
+1 groonga (1) starting groonga.
+ALTER TABLE diaries MODIFY body VARCHAR(140) AFTER id;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `body` varchar(140) DEFAULT NULL,
+ `title` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga.");
+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 00000000..f6b3df92
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+id title body
+1 groonga (1) starting groonga.
+ALTER TABLE diaries MODIFY body VARCHAR(140) FIRST;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `body` varchar(140) DEFAULT NULL,
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga.");
+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 00000000..e156a7fd
--- /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 VARCHAR(40),
+body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `body` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+id title body
+1 groonga (1) starting groonga.
+ALTER TABLE diaries MODIFY 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` varchar(140) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
+INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga.");
+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 00000000..6ee8f8ba
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_recreate_anonymous_index_at_once.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT,
+FULLTEXT INDEX (body)
+) 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!
+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 00000000..84861ea7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_rename_table.result
@@ -0,0 +1,35 @@
+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;
+SELECT table_name, engine
+FROM information_schema.tables
+WHERE table_name = 'diaries';
+table_name engine
+diaries Mroonga
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+id title body
+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
+SELECT table_name, engine
+FROM information_schema.tables
+WHERE table_name = 'memos';
+table_name engine
+memos Mroonga
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result
new file mode 100644
index 00000000..ac1a096d
--- /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 VARCHAR(40),
+location GEOMETRY NOT NULL
+);
+INSERT INTO shops (name, location)
+VALUES ('nezu-no-taiyaki',
+ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+VALUES ('taiyaki-kataoka',
+ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+VALUES ('soba-taiyaki-ku',
+ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+VALUES ('kuruma',
+ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+VALUES ('hirose-ya',
+ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+VALUES ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+VALUES ('omede-taiyaki',
+ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+VALUES ('onaga-ya',
+ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+VALUES ('shiro-ya',
+ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+VALUES ('fuji-ya',
+ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+VALUES ('miyoshi',
+ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+VALUES ('juju-ya',
+ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+VALUES ('tatsumi-ya',
+ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+VALUES ('tetsuji',
+ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+VALUES ('gazuma-ya',
+ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+VALUES ('honma-mon',
+ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+VALUES ('naniwa-ya',
+ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+VALUES ('kuro-dai',
+ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+VALUES ('daruma',
+ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+VALUES ('yanagi-ya',
+ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+VALUES ('sharaku',
+ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+VALUES ('takane',
+ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+VALUES ('chiyoda',
+ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+VALUES ('da-ka-po',
+ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+VALUES ('matsushima-ya',
+ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+VALUES ('kazuya',
+ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+VALUES ('furuya-kogane-an',
+ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+VALUES ('hachi-no-ie',
+ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+VALUES ('azuki-chan',
+ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+VALUES ('kuriko-an',
+ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+VALUES ('naze-ya',
+ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+VALUES ('sanoki-ya',
+ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+VALUES ('shigeta',
+ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+VALUES ('nishimi-ya',
+ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+VALUES ('hiiragi',
+ST_GeomFromText('POINT(139.711517 35.647701)'));
+ALTER TABLE shops ADD SPATIAL KEY location_index (location);
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+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` varchar(40) DEFAULT NULL,
+ `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 00000000..6a5729af
--- /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 00000000..f89b74e5
--- /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 00000000..fe5e6409
--- /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 00000000..340509f6
--- /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/check_table_broken.result b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result
new file mode 100644
index 00000000..4926a72a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_broken.result
@@ -0,0 +1,18 @@
+SET NAMES UTF8;
+CREATE DATABASE check_test;
+USE check_test;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT INDEX (title)
+);
+INSERT INTO diaries VALUES ('Hello');
+FLUSH TABLES;
+CHECK TABLE diaries;
+Table Op Msg_type Msg_text
+check_test.diaries check error Corrupt
+REPAIR TABLE diaries;
+Table Op Msg_type Msg_text
+check_test.diaries repair status OK
+DROP TABLE diaries;
+DROP DATABASE check_test;
+USE test;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result
new file mode 100644
index 00000000..def3368e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/check_table_not_broken.result
@@ -0,0 +1,13 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+title TEXT
+);
+INSERT INTO diaries VALUES ('Hello');
+CHECK TABLE diaries;
+Table Op Msg_type Msg_text
+test.diaries check status OK
+SELECT * FROM diaries;
+title
+Hello
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/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 00000000..880092f4
--- /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_520_ci_french.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result
new file mode 100644
index 00000000..b9e22da4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8mb4;
+CREATE TABLE diaries (
+content varchar(256) COLLATE utf8mb4_unicode_520_ci,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+INSERT INTO diaries VALUES ("Je suis un garçon.");
+SELECT * FROM diaries WHERE MATCH (content) AGAINST ("+garcon" IN BOOLEAN MODE);
+content
+Je suis un garçon.
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result
new file mode 100644
index 00000000..29e55b7d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8mb4;
+CREATE TABLE diaries (
+content varchar(256) COLLATE utf8mb4_unicode_520_ci,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。");
+SELECT * FROM diaries
+WHERE MATCH (content) AGAINST ("+かたかな" IN BOOLEAN MODE);
+content
+ひらがなとカタカナを覚えました。
+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 00000000..3f24de87
--- /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 00000000..94ef2608
--- /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 00000000..94b3a603
--- /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 00000000..162b515d
--- /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 00000000..9aec8dd6
--- /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 VARCHAR(40),
+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` varchar(40) DEFAULT NULL,
+ `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 00000000..4d2166ec
--- /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 VARCHAR(40),
+created_at DATE
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+Table Create Table
+diaries CREATE TABLE `diaries` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(40) DEFAULT NULL,
+ `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 00000000..022d6c00
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_date_zero_date.result
@@ -0,0 +1,29 @@
+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
+SET sql_mode = '';
+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
+SET sql_mode = DEFAULT;
+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 00000000..712d87ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_2038.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('2038-01-18 03:14:07', '2038-01-18 03:14:07');
+INSERT IGNORE 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 00000000..85f091cc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_before_unix_epoch.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT IGNORE 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 00000000..9d9e2f61
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_max.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT IGNORE 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 00000000..99611268
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_32bit_out_of_range.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT IGNORE 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 00000000..f0f03a82
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_2038.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('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 00000000..8a775960
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_before_unix_epoch.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('1000-01-02 00:00:00', '1000-01-02 00:00:00');
+SELECT * FROM diaries;
+id title created_at
+1 1000-01-02 00:00:00 1000-01-02 00:00:00
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result
new file mode 100644
index 00000000..44d20d97
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_max.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('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_strict_sql_mode_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result
new file mode 100644
index 00000000..6617b49d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_strict_sql_mode_out_of_range.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('2012', '2012');
+ERROR 22007: Incorrect datetime value: '2012' for column `test`.`diaries`.`created_at` at row 1
+SELECT * FROM diaries;
+id title created_at
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result
new file mode 100644
index 00000000..21e715e1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_5_out_of_range.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('2012', '2012');
+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_5_6_or_later_out_of_range.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result
new file mode 100644
index 00000000..3500d651
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_64bit_version_5_6_or_later_out_of_range.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('2012', '2012');
+Warnings:
+Warning 1265 Data truncated for column 'created_at' at row 1
+Warning 1265 Data truncated for column 'created_at' at row 1
+INSERT INTO diaries (title, created_at) VALUES ('2012', '2012');
+ERROR 22007: Incorrect datetime value: '2012' for column 'created_at' at row 1
+SELECT * FROM diaries;
+id title created_at
+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 00000000..e7094fd4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_with_index.result
@@ -0,0 +1,25 @@
+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;
+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 00000000..028fb257
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_fractional_seconds_without_index.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME(6)
+) 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 00000000..a48be4da
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_freebsd_before_unix_epoch.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('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_mariadb_10_2_or_later_zero_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result
new file mode 100644
index 00000000..ffd6a707
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_date.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+ERROR 22003: Out of range value for column 'create_dt' at row 1
+SELECT * FROM timestamps;
+id create_dt
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+id create_dt
+2 2015-06-17 00:00:00
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result
new file mode 100644
index 00000000..61d2ed8d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mariadb_10_2_or_later_zero_month_day.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+ERROR 22003: Out of range value for column 'create_dt' at row 1
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+ERROR 22003: Out of range value for column 'create_dt' at row 1
+SELECT * FROM timestamps;
+id create_dt
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result
new file mode 100644
index 00000000..0ca19e54
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_date.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'create_dt' at row 1
+SELECT * FROM timestamps;
+id create_dt
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+id create_dt
+1 2015-06-17 00:00:00
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result
new file mode 100644
index 00000000..94479c23
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_mysql_5_7_or_later_zero_month_day.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+ERROR 22007: Incorrect datetime value: '2012-00-01 00:00:00' for column 'create_dt' at row 1
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+ERROR 22007: Incorrect datetime value: '2012-01-00 00:00:00' for column 'create_dt' at row 1
+SELECT * FROM timestamps;
+id create_dt
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result
new file mode 100644
index 00000000..510fa2dc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_null.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO diaries (title, created_at)
+VALUES ('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 00000000..6f79b31f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_with_index.result
@@ -0,0 +1,24 @@
+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;
+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 00000000..8a45ece7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_without_index.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;
+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 00000000..659c5742
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_date.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+SET sql_mode='STRICT_TRANS_TABLES';
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+ERROR 22003: Out of range value for column 'create_dt' at row 1
+SET sql_mode=default;
+SELECT * FROM timestamps;
+id create_dt
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+id create_dt
+2 2015-06-17 00:00:00
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result
new file mode 100644
index 00000000..03633a50
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_datetime_zero_month_day.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS timestamps;
+CREATE TABLE timestamps (
+id INT PRIMARY KEY AUTO_INCREMENT,
+create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+Warnings:
+Warning 1265 Data truncated for column 'create_dt' at row 1
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+Warnings:
+Warning 1265 Data truncated for column 'create_dt' at row 1
+SELECT * FROM timestamps;
+id create_dt
+1 2012-01-01 00:00:00
+2 2012-01-01 00:00:00
+SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00";
+id create_dt
+1 2012-01-01 00:00:00
+2 2012-01-01 00:00:00
+DROP TABLE timestamps;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result
new file mode 100644
index 00000000..196e4b80
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_with_index.result
@@ -0,0 +1,20 @@
+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;
+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 00000000..b67846bb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_fractional_seconds_without_index.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+temperature DECIMAL(6, 3)
+) 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 00000000..620e9b69
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_with_index.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+temperature DECIMAL,
+KEY (temperature)
+) 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 00000000..1ba47b34
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_decimal_without_index.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+temperature DECIMAL
+) 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 00000000..28c80dcc
--- /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 00000000..731a9690
--- /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_generated_stored_add_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result
new file mode 100644
index 00000000..924c3134
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result
@@ -0,0 +1,16 @@
+set names utf8mb4;
+CREATE TABLE logs (
+id INT,
+record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (1, json_object('message', repeat('☹', 253)));
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
+ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result
new file mode 100644
index 00000000..1ee7d8f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_delete.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+DELETE FROM logs WHERE id = 1;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result
new file mode 100644
index 00000000..5b518516
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_drop_column.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DROP COLUMN message;
+SELECT * FROM logs;
+id record
+1 {"level": "info", "message": "start"}
+2 {"level": "info", "message": "restart"}
+3 {"level": "warn", "message": "abort"}
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result
new file mode 100644
index 00000000..ff22175e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_insert.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result
new file mode 100644
index 00000000..fac82467
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_reindex.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DISABLE KEYS;
+ALTER TABLE logs ENABLE KEYS;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result
new file mode 100644
index 00000000..71fc442d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_update.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE);
+id record message
+2 {"level": "info", "message": "shutdown"} "shutdown"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result
new file mode 100644
index 00000000..27c9effc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_add_column.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL;
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result
new file mode 100644
index 00000000..260c774e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_delete.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+DELETE FROM logs WHERE id = 1;
+SELECT * FROM logs;
+id record message
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result
new file mode 100644
index 00000000..bc9339ab
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_drop_column.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DROP COLUMN message;
+SELECT * FROM logs;
+id record
+1 {"level": "info", "message": "start"}
+2 {"level": "info", "message": "restart"}
+3 {"level": "warn", "message": "abort"}
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result
new file mode 100644
index 00000000..92463c94
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_insert.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result
new file mode 100644
index 00000000..1a502edf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_add_index.result
@@ -0,0 +1,9 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+ALTER TABLE logs ADD INDEX (message);
+ERROR HY000: mroonga: storage: failed to create index: Index for virtual generated column is not supported: message
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result
new file mode 100644
index 00000000..16acc89b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.result
@@ -0,0 +1,8 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL,
+FULLTEXT INDEX (message)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+ERROR HY000: mroonga: storage: failed to create index: Index for virtual generated column is not supported: message
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result
new file mode 100644
index 00000000..93046e39
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_mysql_5_7_or_later_add_index.result
@@ -0,0 +1,9 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+ALTER TABLE logs ADD INDEX (message);
+ERROR HY000: Table storage engine 'Mroonga' does not support the create option 'Index on virtual generated column'
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result
new file mode 100644
index 00000000..c4e46d0d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_virtual_update.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "shutdown"} "shutdown"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga__id__id.result
new file mode 100644
index 00000000..33f31ed3
--- /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 00000000..903e3a85
--- /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 00000000..767fe491
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_other_table.result
@@ -0,0 +1,30 @@
+CREATE TABLE terms (
+name VARCHAR(64) PRIMARY KEY
+) DEFAULT CHARSET=utf8
+COMMENT='default_tokenizer "TokenBigram"';
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY,
+title TEXT,
+FULLTEXT INDEX (title) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO bugs (id, title) VALUES (1, "Mroonga can't build with MySQL X.Y.Z");
+SELECT * FROM terms ORDER BY name;
+name
+'
+.
+BUILD
+CAN
+MROONGA
+MYSQL
+T
+WITH
+X
+Y
+Z
+SELECT *, MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
+FROM bugs
+WHERE MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE);
+id title score
+1 Mroonga can't build with MySQL X.Y.Z 1
+DROP TABLE bugs;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result
new file mode 100644
index 00000000..f9fc8366
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result
@@ -0,0 +1,38 @@
+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 --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
+column_create tags name COLUMN_SCALAR ShortText
+
+column_create bugs tags COLUMN_VECTOR tags
+
+column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags
+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 00000000..0f57885c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result
@@ -0,0 +1,39 @@
+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 --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create priorities TABLE_PAT_KEY Int32
+column_create priorities id COLUMN_SCALAR Int32
+
+column_create bugs priority COLUMN_SCALAR priorities
+
+column_create priorities bugs_priority_index COLUMN_INDEX bugs priority
+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 00000000..8acf8aab
--- /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_support_lz4.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_lz4.result
new file mode 100644
index 00000000..11875e15
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_lz4.result
@@ -0,0 +1,10 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zlib.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zlib.result
new file mode 100644
index 00000000..5d704e3e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zlib.result
@@ -0,0 +1,10 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result
new file mode 100644
index 00000000..a9c917f8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_support_zstd.result
@@ -0,0 +1,10 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_lz4.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_lz4.result
new file mode 100644
index 00000000..a9a5f55f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_lz4.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
+) DEFAULT CHARSET=utf8;
+Warnings:
+Warning 16506 The column flag 'COMPRESS_LZ4' is unsupported. It is ignored
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zlib.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zlib.result
new file mode 100644
index 00000000..068ce58b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zlib.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
+) DEFAULT CHARSET=utf8;
+Warnings:
+Warning 16506 The column flag 'COMPRESS_ZLIB' is unsupported. It is ignored
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result
new file mode 100644
index 00000000..b2bb3b89
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_scalar_unsupport_zstd.result
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS entries;
+CREATE TABLE entries (
+id INT UNSIGNED PRIMARY KEY,
+content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"'
+) DEFAULT CHARSET=utf8;
+Warnings:
+Warning 16506 The column flag 'COMPRESS_ZSTD' is unsupported. It is ignored
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+SELECT * FROM entries;
+id content
+1 I found Mroonga that is a MySQL storage engine to use Groonga!
+DROP TABLE entries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_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 00000000..cd910206
--- /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 00000000..468115e8
--- /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 00000000..a6afe72f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_vector_reference.result
@@ -0,0 +1,28 @@
+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 VARCHAR(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE bugs;
+Table Create Table
+bugs CREATE TABLE `bugs` (
+ `id` int(10) unsigned NOT NULL,
+ `tags` varchar(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"',
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
+SELECT * FROM bugs;
+id tags
+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 00000000..1afd7da9
--- /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_json_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result
new file mode 100644
index 00000000..e6a3aa5e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_json_insert.result
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+INSERT INTO logs VALUES ('{"message": "start"}');
+INSERT INTO logs VALUES ('{"message": "restart"}');
+INSERT INTO logs VALUES ('{"message": "shutdown"}');
+SELECT * FROM logs;
+record
+{"message": "start"}
+{"message": "restart"}
+{"message": "shutdown"}
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result
new file mode 100644
index 00000000..eb1a08f2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_cp932.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS users;
+SET NAMES cp932;
+CREATE TABLE users (
+O text,
+FULLTEXT INDEX (O)
+) DEFAULT CHARSET=cp932;
+INSERT INTO users VALUES ("܂");
+INSERT INTO users VALUES ("Ȃ");
+INSERT INTO users VALUES ("");
+SELECT * FROM users;
+O
+
+SELECT * FROM users
+WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+O
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_NO_KEY
+column_create users @540d@524d COLUMN_SCALAR LongText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result
new file mode 100644
index 00000000..6f63b5b3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_multibyte_utf8.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS users;
+SET NAMES utf8;
+CREATE TABLE users (
+名前 text,
+FULLTEXT INDEX (名前)
+) DEFAULT CHARSET=utf8;
+INSERT INTO users VALUES ("やまだ");
+INSERT INTO users VALUES ("たなか");
+INSERT INTO users VALUES ("すずき");
+SELECT * FROM users;
+名前
+やまだ
+たなか
+すずき
+SELECT * FROM users
+WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+名前
+たなか
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_NO_KEY
+column_create users @540d@524d COLUMN_SCALAR LongText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users @540d@524d
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_set_16_with_index.result
new file mode 100644
index 00000000..ee818a62
--- /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 00000000..10d4fd8b
--- /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 00000000..0432970a
--- /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 00000000..5b6d4511
--- /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 00000000..3e6bf4e1
--- /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 00000000..262f7755
--- /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 00000000..867b8871
--- /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 00000000..c8b4f895
--- /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 00000000..8a51ee5f
--- /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 00000000..d14efcca
--- /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 00000000..35434a00
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_fractional_seconds_with_index.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..a0b0350a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_time_with_index.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..7ccb1fa2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_fractional_seconds_with_index.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..4c221d9e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_timestamp_with_index.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+created_at TIMESTAMP DEFAULT '2016-04-21 00:00:00',
+updated_at TIMESTAMP DEFAULT '2016-04-21 00:00:00',
+KEY (updated_at)
+) DEFAULT CHARSET UTF8;
+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 00000000..8dde1bdd
--- /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 00000000..d16004e3
--- /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 00000000..277580c7
--- /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 00000000..d14ef877
--- /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 00000000..2825aada
--- /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 00000000..8586d091
--- /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 00000000..90adb048
--- /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 00000000..be97d4fc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_with_index.result
@@ -0,0 +1,28 @@
+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;
+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 00000000..a56271bc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_year_without_index.result
@@ -0,0 +1,27 @@
+DROP TABLE IF EXISTS aniversary_memos;
+CREATE TABLE aniversary_memos (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+party_year YEAR
+) 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/count_star.result b/storage/mroonga/mysql-test/mroonga/storage/r/count_star.result
new file mode 100644
index 00000000..ab6be3a7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/count_star.result
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id int PRIMARY KEY
+);
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+SELECT COUNT(*) FROM ids;
+COUNT(*)
+3
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_database_name_slash.result
new file mode 100644
index 00000000..56c868b2
--- /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 00000000..d2a00b77
--- /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_column_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result
new file mode 100644
index 00000000..e4c4ea05
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_comment.result
@@ -0,0 +1,15 @@
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY,
+tags TEXT COMMENT 'flags "COLUMN_VECTOR"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+column_create bugs tags COLUMN_VECTOR LongText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+DROP TABLE bugs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result
new file mode 100644
index 00000000..9923b91f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_flags_parameter.result
@@ -0,0 +1,15 @@
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY,
+tags TEXT FLAGS='COLUMN_VECTOR'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+column_create bugs tags COLUMN_VECTOR LongText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+DROP TABLE bugs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result
new file mode 100644
index 00000000..7dede867
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_comment.result
@@ -0,0 +1,23 @@
+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 'groonga_type "tags"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY ShortText
+column_create tags name COLUMN_SCALAR ShortText
+
+column_create bugs tag COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result
new file mode 100644
index 00000000..99dc30aa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_nonexistent.result
@@ -0,0 +1,6 @@
+DROP TABLE IF EXISTS bugs;
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY,
+tag VARCHAR(64) COMMENT 'groonga_type "Nonexistent"'
+) DEFAULT CHARSET=utf8mb4;
+ERROR HY000: unknown custom Groonga type name for <tag> column: <Nonexistent>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result
new file mode 100644
index 00000000..89e28aea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_groonga_type_parameter.result
@@ -0,0 +1,30 @@
+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) GROONGA_TYPE='tags'
+) 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 `GROONGA_TYPE`='tags',
+ PRIMARY KEY (`id`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY ShortText
+column_create tags name COLUMN_SCALAR ShortText
+
+column_create bugs tag COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result
new file mode 100644
index 00000000..357adfdf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_comment.result
@@ -0,0 +1,23 @@
+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 --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_PAT_KEY UInt32
+column_create bugs id COLUMN_SCALAR UInt32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY ShortText
+column_create tags name COLUMN_SCALAR ShortText
+
+column_create bugs tag COLUMN_SCALAR tags
+DROP TABLE bugs;
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result
new file mode 100644
index 00000000..a66a2bd2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_column_type_nonexistent.result
@@ -0,0 +1,6 @@
+DROP TABLE IF EXISTS bugs;
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY,
+tag VARCHAR(64) COMMENT 'type "Nonexistent"'
+) DEFAULT CHARSET=utf8mb4;
+ERROR HY000: unknown custom Groonga type name for <tag> column: <Nonexistent>
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 00000000..edda98cd
--- /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 00000000..0c33fac1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result
@@ -0,0 +1,15 @@
+CREATE TABLE tags (
+name VARCHAR(64) PRIMARY KEY
+) DEFAULT CHARSET=utf8
+COLLATE=utf8_bin
+COMMENT='default_tokenizer "TokenDelimit"';
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
+column_create tags name COLUMN_SCALAR ShortText
+DROP TABLE tags;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result
new file mode 100644
index 00000000..8d39cac4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_comment.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result
new file mode 100644
index 00000000..e9d90b0b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_medium.result
@@ -0,0 +1,10 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+content_size INT NOT NULL,
+KEY (content_size) COMMENT 'flags "INDEX_MEDIUM"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content_size index COLUMN_INDEX|INDEX_MEDIUM memos content_size
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result
new file mode 100644
index 00000000..38a83b89
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_index_small.result
@@ -0,0 +1,10 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+is_read BOOL NOT NULL,
+KEY (is_read) COMMENT 'flags "INDEX_SMALL"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#is_read index COLUMN_INDEX|INDEX_SMALL memos is_read
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result
new file mode 100644
index 00000000..e90fd833
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'flags "NONE"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result
new file mode 100644
index 00000000..8fbbd197
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_parameter.result
@@ -0,0 +1,15 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) FLAGS='WITH_POSITION|WITH_WEIGHT'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `content` varchar(64) NOT NULL,
+ FULLTEXT KEY `content` (`content`) `FLAGS`='WITH_POSITION|WITH_WEIGHT'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result
new file mode 100644
index 00000000..3d31400f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_none.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result
new file mode 100644
index 00000000..8f0c4995
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_index_flags_with_position_and_with_weight.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_comment.result
new file mode 100644
index 00000000..e2d405a1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_comment.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_index_normalizer_fulltext_index_bin.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result
new file mode 100644
index 00000000..b6da79c7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_fulltext_index_bin.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8;
+CREATE TABLE diaries (
+day DATE PRIMARY KEY,
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+INSERT INTO diaries VALUES ("2013-04-23", "ブラックコーヒーを飲んだ。");
+SELECT * FROM diaries
+WHERE MATCH (content) AGAINST ("+ふらつく" IN BOOLEAN MODE);
+day content
+SELECT * FROM diaries
+WHERE MATCH (content) AGAINST ("+ブラック" IN BOOLEAN MODE);
+day content
+2013-04-23 ブラックコーヒーを飲んだ。
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result
new file mode 100644
index 00000000..2a05ccdc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_index_bin.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8;
+CREATE TABLE diaries (
+day DATE PRIMARY KEY,
+content VARCHAR(64) NOT NULL,
+INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create diaries TABLE_PAT_KEY Time
+column_create diaries content COLUMN_SCALAR ShortText
+column_create diaries day COLUMN_SCALAR Time
+
+table_create diaries#content TABLE_PAT_KEY ShortText --normalizer NormalizerAuto
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create diaries#content index COLUMN_INDEX diaries content
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.result
new file mode 100644
index 00000000..9d12e2d0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_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_index_normalizer_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_none.result
new file mode 100644
index 00000000..52c6f055
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_none.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 "none"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES ("2013-04-23", "Mroonga");
+SELECT * FROM diaries
+WHERE MATCH (content) AGAINST ("+Mroonga" IN BOOLEAN MODE);
+day content
+2013-04-23 Mroonga
+SELECT * FROM diaries
+WHERE MATCH (content) AGAINST ("+mroonga" IN BOOLEAN MODE);
+day content
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_parameter.result
new file mode 100644
index 00000000..d68de436
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_normalizer_parameter.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) NORMALIZER='NormalizerAuto'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `id` int(11) NOT NULL,
+ `content` text NOT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `content` (`content`) `NORMALIZER`='NormalizerAuto'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_comment.result
new file mode 100644
index 00000000..29f27d15
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_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;
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+INSERT INTO diaries (body) VALUES ("will start Groonga!");
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+INSERT INTO diaries (body) VALUES ("starting Groonga...");
+INSERT INTO diaries (body) VALUES ("started Groonga.");
+SELECT * FROM diaries;
+id body
+1 will start Groonga!
+2 starting Groonga...
+3 started Groonga.
+SELECT * FROM diaries
+WHERE MATCH(body) AGAINST("+start" IN BOOLEAN MODE)
+ORDER BY id;
+id body
+1 will start Groonga!
+2 starting Groonga...
+3 started Groonga.
+DROP TABLE diaries;
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result
new file mode 100644
index 00000000..34545ecc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_default.result
@@ -0,0 +1,25 @@
+drop table if exists diaries;
+set @mroonga_default_tokenizer_backup=@@mroonga_default_tokenizer;
+set global mroonga_default_tokenizer=TokenBigramSplitSymbolAlphaDigit;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+) 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" IN BOOLEAN MODE) order by id;
+id body
+1 will start Groonga!
+2 starting Groonga...
+3 started Groonga.
+drop table diaries;
+set global mroonga_default_tokenizer=@mroonga_default_tokenizer_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result
new file mode 100644
index 00000000..f827c0ad
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_parser_off.result
@@ -0,0 +1,40 @@
+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;
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix");
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer");
+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_tokenizer
+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_tokenizer
+DROP TABLE variables;
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result
new file mode 100644
index 00000000..ad68ca01
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_multiple_token_filters.result
@@ -0,0 +1,22 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_NO_KEY
+column_create memos content COLUMN_SCALAR ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result
new file mode 100644
index 00000000..2cbb5a6b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_one_token_filter.result
@@ -0,0 +1,22 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_NO_KEY
+column_create memos content COLUMN_SCALAR ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result
new file mode 100644
index 00000000..333cf3d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_token_filters_parameter.result
@@ -0,0 +1,28 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) TOKEN_FILTERS='TokenFilterStopWord,TokenFilterStopWord'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `content` varchar(64) NOT NULL,
+ FULLTEXT KEY `content` (`content`) `TOKEN_FILTERS`='TokenFilterStopWord,TokenFilterStopWord'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_NO_KEY
+column_create memos content COLUMN_SCALAR ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result
new file mode 100644
index 00000000..a3904216
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_comment.result
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id int PRIMARY KEY AUTO_INCREMENT,
+body text,
+FULLTEXT INDEX body_index (body)
+COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) 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" IN BOOLEAN MODE)
+ORDER BY id;
+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/create_table_index_tokenizer_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result
new file mode 100644
index 00000000..34545ecc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_default.result
@@ -0,0 +1,25 @@
+drop table if exists diaries;
+set @mroonga_default_tokenizer_backup=@@mroonga_default_tokenizer;
+set global mroonga_default_tokenizer=TokenBigramSplitSymbolAlphaDigit;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+) 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" IN BOOLEAN MODE) order by id;
+id body
+1 will start Groonga!
+2 starting Groonga...
+3 started Groonga.
+drop table diaries;
+set global mroonga_default_tokenizer=@mroonga_default_tokenizer_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result
new file mode 100644
index 00000000..91a5b96d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_off.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS variables;
+CREATE TABLE variables (
+id INT PRIMARY KEY AUTO_INCREMENT,
+name TEXT,
+FULLTEXT INDEX (name) COMMENT 'tokenizer "off"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix");
+INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer");
+INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine");
+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_tokenizer
+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_tokenizer
+DROP TABLE variables;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result
new file mode 100644
index 00000000..c827abe2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_tokenizer_parameter.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id int PRIMARY KEY AUTO_INCREMENT,
+body text,
+FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit'
+) 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" IN BOOLEAN MODE)
+ORDER BY id;
+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/create_table_table_normalizer_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_default.result
new file mode 100644
index 00000000..dbf69362
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_default.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS memos;
+DROP TABLE IF EXISTS terms;
+SET NAMES utf8;
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_hash.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_hash.result
new file mode 100644
index 00000000..5e4f4afa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_normalizer_hash.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS memos;
+DROP TABLE IF EXISTS terms;
+SET NAMES utf8;
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL,
+PRIMARY KEY (term) USING HASH
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result
new file mode 100644
index 00000000..8934be78
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_multiple_token_filters.result
@@ -0,0 +1,30 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL PRIMARY KEY,
+is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord,TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result
new file mode 100644
index 00000000..e3df2850
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_one_token_filter.result
@@ -0,0 +1,30 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL PRIMARY KEY,
+is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+
+column_create terms content COLUMN_INDEX|WITH_POSITION memos content
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_stop_word.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_stop_word.result
new file mode 100644
index 00000000..bc21ed97
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_table_token_filters_stop_word.result
@@ -0,0 +1,23 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+CREATE TABLE terms (
+term VARCHAR(64) NOT NULL PRIMARY KEY,
+is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO terms VALUES ("and", true);
+INSERT INTO memos VALUES (1, "Hello");
+INSERT INTO memos VALUES (2, "Hello and Good-bye");
+INSERT INTO memos VALUES (3, "Good-bye");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+\"Hello and\"" IN BOOLEAN MODE);
+id content
+1 Hello
+2 Hello and Good-bye
+DROP TABLE memos;
+DROP TABLE terms;
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 00000000..5fb52294
--- /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 00000000..f318e125
--- /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 00000000..76a4ed88
--- /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 00000000..6307c55f
--- /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 00000000..7503c0b8
--- /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 00000000..23cc23ee
--- /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 00000000..4bd97162
--- /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_database_no_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result
new file mode 100644
index 00000000..ebc7db1c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/drop_database_no_table.result
@@ -0,0 +1,20 @@
+SET NAMES UTF8;
+DROP DATABASE IF EXISTS another;
+CREATE DATABASE another;
+USE another;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT INDEX (title)
+);
+DROP TABLE diaries;
+USE test;
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT INDEX (title)
+);
+DROP DATABASE another;
+SELECT mroonga_command('object_exist mroonga_operations');
+mroonga_command('object_exist mroonga_operations')
+true
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/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 00000000..99896765
--- /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 00000000..449f6437
--- /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_alter_add.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result
new file mode 100644
index 00000000..e2e712af
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+CREATE TABLE comments (
+comment int unsigned PRIMARY KEY,
+content text NOT NULL
+);
+CREATE TABLE articles (
+content text NOT NULL,
+comment int unsigned
+);
+ALTER TABLE articles ADD FOREIGN KEY (comment) REFERENCES comments (comment);
+SHOW CREATE TABLE articles;
+Table Create Table
+articles CREATE TABLE `articles` (
+ `content` text NOT NULL,
+ `comment` int(10) unsigned DEFAULT NULL,
+ KEY `comment` (`comment`),
+ CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE=Mroonga DEFAULT CHARSET=latin1
+SELECT * FROM information_schema.referential_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
+def test comment def test PRIMARY NONE RESTRICT RESTRICT articles comments
+DROP TABLE articles;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result
new file mode 100644
index 00000000..fc3cda00
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_drop.result
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+CREATE TABLE comments (
+comment int unsigned PRIMARY KEY,
+content text NOT NULL
+);
+CREATE TABLE articles (
+content text NOT NULL,
+comment int unsigned,
+FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+ALTER TABLE articles DROP FOREIGN KEY comment;
+SHOW CREATE TABLE articles;
+Table Create Table
+articles CREATE TABLE `articles` (
+ `content` text NOT NULL,
+ `comment` int(10) unsigned DEFAULT NULL,
+ KEY `comment` (`comment`)
+) ENGINE=Mroonga DEFAULT CHARSET=latin1
+SELECT * FROM information_schema.referential_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
+DROP TABLE articles;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result
new file mode 100644
index 00000000..c17780c0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_create.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+CREATE TABLE comments (
+comment int unsigned PRIMARY KEY,
+content text NOT NULL
+);
+CREATE TABLE articles (
+content text NOT NULL,
+comment int unsigned,
+FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+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;
+DROP TABLE articles;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result
new file mode 100644
index 00000000..e16157b4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_existent.result
@@ -0,0 +1,53 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+DELETE FROM comments WHERE id = 100;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (one or more child rows exist in <entries>)
+SELECT * FROM entries;
+content comment_id
+Hello! 100
+SELECT * FROM comments;
+id content
+100 Good entry!
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+load --table comments
+[
+["_key","content","id"],
+[100,"Good entry!",100]
+]
+
+load --table entries
+[
+["_id","comment_id","content"],
+[1,100,"Hello!"]
+]
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result
new file mode 100644
index 00000000..edaba25f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_delete_nonexistent.result
@@ -0,0 +1,53 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO comments (id, content) VALUES (200, 'Very good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+DELETE FROM comments WHERE id = 200;
+SELECT * FROM entries;
+content comment_id
+Hello! 100
+SELECT * FROM comments;
+id content
+100 Good entry!
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+load --table comments
+[
+["_key","content","id"],
+[100,"Good entry!",100]
+]
+
+load --table entries
+[
+["_id","comment_id","content"],
+[1,100,"Hello!"]
+]
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result
new file mode 100644
index 00000000..ddc54cb3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_existent.result
@@ -0,0 +1,51 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+SELECT * FROM entries;
+content comment_id
+Hello! 100
+SELECT * FROM comments;
+id content
+100 Good entry!
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+load --table comments
+[
+["_key","content","id"],
+[100,"Good entry!",100]
+]
+
+load --table entries
+[
+["_id","comment_id","content"],
+[1,100,"Hello!"]
+]
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result
new file mode 100644
index 00000000..c220bb89
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_insert_nonexistent.result
@@ -0,0 +1,37 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 1);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (foreign record doesn't exist: <comment_id>:<1>)
+SELECT * FROM entries;
+content comment_id
+SELECT * FROM comments;
+id content
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result
new file mode 100644
index 00000000..5ea0ae3e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_rename.result
@@ -0,0 +1,28 @@
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+DROP TABLE IF EXISTS articles2;
+DROP TABLE IF EXISTS comments2;
+CREATE TABLE comments (
+comment int unsigned PRIMARY KEY,
+content text NOT NULL
+);
+CREATE TABLE articles (
+content text NOT NULL,
+comment int unsigned,
+FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+RENAME TABLE comments TO comments2;
+RENAME TABLE articles TO articles2;
+SHOW CREATE TABLE articles2;
+Table Create Table
+articles2 CREATE TABLE `articles2` (
+ `content` text NOT NULL,
+ `comment` int(10) unsigned DEFAULT NULL,
+ KEY `comment` (`comment`),
+ CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments2` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE=Mroonga DEFAULT CHARSET=latin1
+SELECT * FROM information_schema.referential_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME
+def test comment def test PRIMARY NONE RESTRICT RESTRICT articles2 comments2
+DROP TABLE articles2;
+DROP TABLE comments2;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result
new file mode 100644
index 00000000..9db892d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_existent.result
@@ -0,0 +1,55 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO comments (id, content) VALUES (200, 'Very good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+UPDATE entries SET comment_id = 200 WHERE content = 'Hello!';
+SELECT * FROM entries;
+content comment_id
+Hello! 200
+SELECT * FROM comments;
+id content
+100 Good entry!
+200 Very good entry!
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+load --table comments
+[
+["_key","content","id"],
+[100,"Good entry!",100],
+[200,"Very good entry!",200]
+]
+
+load --table entries
+[
+["_id","comment_id","content"],
+[1,200,"Hello!"]
+]
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result
new file mode 100644
index 00000000..615c3a09
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_update_nonexistent.result
@@ -0,0 +1,53 @@
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+CREATE TABLE comments (
+id int unsigned PRIMARY KEY,
+content varchar(140) NOT NULL
+);
+CREATE TABLE entries (
+content varchar(140) NOT NULL,
+comment_id int unsigned,
+FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+UPDATE entries SET comment_id = 200 WHERE content = 'Hello!';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (foreign record doesn't exist: <comment_id>:<200>)
+SELECT * FROM entries;
+content comment_id
+Hello! 100
+SELECT * FROM comments;
+id content
+100 Good entry!
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create comments TABLE_PAT_KEY UInt32
+column_create comments content COLUMN_SCALAR ShortText
+column_create comments id COLUMN_SCALAR UInt32
+
+table_create entries TABLE_NO_KEY
+column_create entries content COLUMN_SCALAR ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create entries comment_id COLUMN_SCALAR comments
+
+load --table comments
+[
+["_key","content","id"],
+[100,"Good entry!",100]
+]
+
+load --table entries
+[
+["_id","comment_id","content"],
+[1,100,"Hello!"]
+]
+
+column_create comments entries-comment_id----------------------------------------------- COLUMN_INDEX entries comment_id
+DROP TABLE entries;
+DROP TABLE comments;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/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 00000000..96c6ae41
--- /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 00000000..5beda03c
--- /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_tokenizer = 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_tokenizer = TokenBigram;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result
new file mode 100644
index 00000000..758f969f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_leading_not.result
@@ -0,0 +1,15 @@
+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;
+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_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result
new file mode 100644
index 00000000..c8270bc3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT PRIMARY KEY,
+title VARCHAR(255),
+content TEXT,
+FULLTEXT INDEX (title, content)
+) DEFAULT CHARSET=utf8;
+INSERT INTO memos VALUES(1, "Groonga", "Groonga is fast.");
+INSERT INTO memos VALUES(2, "Mroonga", "Mroonga is also fast.");
+INSERT INTO memos VALUES(3, "Rroonga", "Rroonga is also fast.");
+SELECT *,
+MATCH(title, content)
+AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE) AS score
+FROM memos
+WHERE MATCH(title, content)
+AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE);
+id title content score
+1 Groonga Groonga is fast. 12
+2 Mroonga Mroonga is also fast. 12
+DROP TABLE memos;
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 00000000..d10b5dad
--- /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 00000000..82c7e799
--- /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 00000000..c4c7b0e8
--- /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 00000000..0c81bf6c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/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 (
+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)
+ORDER BY content;
+content
+Today is fine.
+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_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 00000000..dfeb71f0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/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 (
+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)
+ORDER BY content;
+content
+Today is fine.
+Tomorrow will be 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_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 00000000..e72cf8d4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/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 (
+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)
+ORDER BY content;
+content
+Today is good day.
+Tomorrow will be 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_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 00000000..4d1f6592
--- /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_astarisk.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.result
new file mode 100644
index 00000000..7a30baab
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.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 fi*" 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_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 00000000..deda6f3b
--- /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 00000000..2d25388f
--- /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_syntax_script_operator.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result
new file mode 100644
index 00000000..deb4bd85
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_operator.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8;
+CREATE TABLE diaries (
+id INT PRIMARY KEY,
+title VARCHAR(255),
+content TEXT,
+FULLTEXT INDEX (title, content)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。");
+INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について");
+INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。");
+SELECT *, MATCH(title, content)
+AGAINST("*SS content @ '天気'" in BOOLEAN MODE) AS score
+FROM diaries
+WHERE MATCH(title, content)
+AGAINST("*SS content @ '天気'" in BOOLEAN MODE);
+id title content score
+2 天気 明日の富士山の天気について 1
+3 富士山 今日も天気がよくてきれいに見える。 1
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result
new file mode 100644
index 00000000..43b21bc1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_syntax_script_selector.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS items;
+DROP TABLE IF EXISTS readings;
+SET NAMES utf8;
+CREATE TABLE readings (
+reading VARCHAR(255) PRIMARY KEY
+) DEFAULT CHARSET=utf8
+COLLATE=utf8_bin
+COMMENT='default_tokenizer "TokenDelimit"';
+CREATE TABLE items (
+name VARCHAR(255) PRIMARY KEY,
+readings TEXT COMMENT 'flags "COLUMN_VECTOR", type "readings"',
+FULLTEXT INDEX items_index(readings) COMMENT 'table "readings"'
+) DEFAULT CHARSET=utf8;
+INSERT INTO items VALUES("日本", "ニホン ニッポン");
+INSERT INTO items VALUES("ローマ字", "ローマジ");
+INSERT INTO items VALUES("漢字", "カンジ");
+SELECT *, MATCH(readings)
+AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE) AS score
+FROM items
+WHERE MATCH(readings)
+AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE);
+name readings score
+日本 ニホン ニッポン 1
+DROP TABLE items;
+DROP TABLE readings;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_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 00000000..b8f15d98
--- /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 00000000..42aa068a
--- /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 00000000..c73d2660
--- /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 00000000..b1b9d5f4
--- /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 00000000..02db17e6
--- /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 00000000..46dd3290
--- /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_tokenizer = 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>: <Syntax error: <(groonga||>>
+DROP TABLE memos;
+SET GLOBAL mroonga_default_tokenizer = TokenBigram;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_error_and_log.result
new file mode 100644
index 00000000..d782357e
--- /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_tokenizer = 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>: <Syntax error: <(groonga||>>
+DROP TABLE memos;
+SET GLOBAL mroonga_default_tokenizer = TokenBigram;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore.result
new file mode 100644
index 00000000..fd5b8d1e
--- /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_tokenizer = 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_tokenizer = TokenBigram;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_syntax_error_ignore_and_log.result
new file mode 100644
index 00000000..a485e1ca
--- /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_tokenizer = 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_tokenizer = 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 00000000..c542ba1a
--- /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 00000000..bd208d52
--- /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 00000000..51360875
--- /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 00000000..cfff3f2e
--- /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 00000000..136585c3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_charset_utf8mb4.result
@@ -0,0 +1,17 @@
+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;
+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 00000000..bb7b3b63
--- /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 00000000..25da7011
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_found_rows.result
@@ -0,0 +1,29 @@
+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;
+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 00000000..a23d8e5b
--- /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 00000000..e38913a6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_index_recreate.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)
+) 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 00000000..c337bfcb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result
@@ -0,0 +1,46 @@
+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
+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 00000000..5c48cadf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_values.result
@@ -0,0 +1,17 @@
+drop table if exists t1, t2, t3;
+create table t1 (c1 int primary key, c2 text, fulltext index ft (c2));
+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 00000000..6475f9ec
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_delete.result
@@ -0,0 +1,23 @@
+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;
+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 00000000..4244af26
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_insert.result
@@ -0,0 +1,29 @@
+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;
+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 00000000..8d18efaa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_recreate.result
@@ -0,0 +1,31 @@
+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;
+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 00000000..0e85b45a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_column_index_update.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 (title, content),
+fulltext index (title),
+fulltext index (content)
+) 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 00000000..37d7597b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_multiple_index.result
@@ -0,0 +1,23 @@
+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;
+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 00000000..db4afff0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_no_primary_key.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title VARCHAR(255),
+content TEXT,
+FULLTEXT INDEX (content)
+) 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 00000000..b6d6febf
--- /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" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+c1 c2 c3
+select * from t1 where not match(c3) against("+dummy" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+c1 c2 c3
+4 10 ka ki ku ke ko
+select * from t1 where c1 <= 4 and not match(c3) against("+uu" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+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" in boolean mode) order by c1;
+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 00000000..f1f7888c
--- /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_boolean_mode_different_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_against.result
new file mode 100644
index 00000000..d1f0d6bc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_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_boolean_mode_different_match.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_match.result
new file mode 100644
index 00000000..b4a07cd0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_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_boolean_mode_no_where.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_no_where.result
new file mode 100644
index 00000000..125b35fb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_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_boolean_mode_same_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_same_match_against.result
new file mode 100644
index 00000000..a3a668c4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_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_order_natural_language_mode_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result
new file mode 100644
index 00000000..7f0934d3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+SELECT * FROM logs;
+message
+Error Error Error
+Warning Warning Warning
+Error Error
+Warning Warning
+Error
+Warning
+Error Error Error Error
+Warning Warning Warning Warning
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) ASC;
+message score
+Error 174763
+Error Error 349526
+Error Error Error 524289
+Error Error Error Error 699052
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result
new file mode 100644
index 00000000..fa577b17
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+SELECT * FROM logs;
+message
+Error Error Error
+Warning Warning Warning
+Error Error
+Warning Warning
+Error
+Warning
+Error Error Error Error
+Warning Warning Warning Warning
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) DESC;
+message score
+Error Error Error Error 699052
+Error Error Error 524289
+Error Error 349526
+Error 174763
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result
new file mode 100644
index 00000000..958883e5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+SELECT * FROM logs;
+message
+Error Error Error
+Warning Warning Warning
+Error Error
+Warning Warning
+Error
+Warning
+Error Error Error Error
+Warning Warning Warning Warning
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+WHERE MATCH(message) AGAINST("Error Warning" IN NATURAL LANGUAGE MODE)
+ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+message score
+Error 174763
+Error Error 349526
+Error Error Error 524289
+Error Error Error Error 699052
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result
new file mode 100644
index 00000000..76abb660
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result
@@ -0,0 +1,36 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+host TEXT,
+FULLTEXT KEY (message),
+FULLTEXT KEY (host)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error", "host1");
+INSERT INTO logs VALUES("Warning Warning Warning", "host1");
+INSERT INTO logs VALUES("Error Error", "host2");
+INSERT INTO logs VALUES("Warning Warning", "host2");
+INSERT INTO logs VALUES("Error", "host2");
+INSERT INTO logs VALUES("Warning", "host2");
+INSERT INTO logs VALUES("Error Error Error Error", "host2");
+INSERT INTO logs VALUES("Warning Warning Warning Warning", "host2");
+SELECT * FROM logs;
+message host
+Error Error Error host1
+Warning Warning Warning host1
+Error Error host2
+Warning Warning host2
+Error host2
+Warning host2
+Error Error Error Error host2
+Warning Warning Warning Warning host2
+SELECT *, MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ORDER BY MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE);
+message host score
+Error Error Error host1 0
+Error Error host2 116509
+Error host2 116509
+Error Error Error Error host2 116509
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result
new file mode 100644
index 00000000..30130e6c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+SELECT * FROM logs;
+message
+Error Error Error
+Warning Warning Warning
+Error Error
+Warning Warning
+Error
+Warning
+Error Error Error Error
+Warning Warning Warning Warning
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+message score
+Warning Warning Warning 0
+Warning Warning 0
+Warning 0
+Warning Warning Warning Warning 0
+Error 174763
+Error Error 349526
+Error Error Error 524289
+Error Error Error Error 699052
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result
new file mode 100644
index 00000000..ac2e7522
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs(
+message TEXT,
+FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+SELECT * FROM logs;
+message
+Error Error Error
+Warning Warning Warning
+Error Error
+Warning Warning
+Error
+Warning
+Error Error Error Error
+Warning Warning Warning Warning
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+FROM logs
+WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+message score
+Error 174763
+Error Error 349526
+Error Error Error 524289
+Error Error Error Error 699052
+DROP TABLE logs;
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 00000000..e39790ed
--- /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_10_0_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_10_0_no_such_key.result
new file mode 100644
index 00000000..d3ac2387
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_10_0_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_5_5_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_5_no_such_key.result
new file mode 100644
index 00000000..5f7bc98a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_5_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_5_6_no_such_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_6_no_such_key.result
new file mode 100644
index 00000000..d3ac2387
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_version_5_6_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_auto-escape.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result
new file mode 100644
index 00000000..e07eae11
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_auto-escape.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES('It is Groonga');
+INSERT INTO diaries VALUES('It is Mroonga');
+SELECT mroonga_command('select',
+'table', 'diaries',
+'filter', 'title @ "Groonga"');
+mroonga_command('select',
+'table', 'diaries',
+'filter', 'title @ "Groonga"')
+[[[1],[["_id","UInt32"],["title","LongText"]],[1,"It is Groonga"]]]
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_select.result
new file mode 100644
index 00000000..1551d32c
--- /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_command_special-database-name.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result
new file mode 100644
index 00000000..e588408e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_command_special-database-name.result
@@ -0,0 +1,22 @@
+DROP DATABASE IF EXISTS `db-1`;
+CREATE DATABASE `db-1`;
+USE `db-1`;
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command('dump --dump_plugins no');
+mroonga_command('dump --dump_plugins no')
+table_create diaries TABLE_NO_KEY
+column_create diaries title COLUMN_SCALAR LongText
+
+table_create diaries#title TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create diaries#title index COLUMN_INDEX|WITH_POSITION diaries title
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_error_query_is_missing.result
new file mode 100644
index 00000000..98213e81
--- /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 00000000..bb68bbff
--- /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 query argument must be 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 00000000..77dc420f
--- /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_query_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_all.result
new file mode 100644
index 00000000..b002262a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_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_query_custom.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_custom.result
new file mode 100644
index 00000000..c2e7d8f5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_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_query_join.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result
new file mode 100644
index 00000000..ec765b11
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_join.result
@@ -0,0 +1,26 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS users;
+DROP TABLE IF EXISTS queries;
+CREATE TABLE users (
+id INT
+);
+CREATE TABLE queries (
+user_id INT,
+query TEXT
+);
+INSERT INTO users VALUES (1);
+INSERT INTO users VALUES (2);
+INSERT INTO users VALUES (3);
+INSERT INTO queries VALUES (1, '(a)');
+INSERT INTO queries VALUES (2, '(b)');
+INSERT INTO queries VALUES (3, '(c)');
+SELECT users.id, mroonga_escape(queries.query) AS escaped_query
+FROM queries
+LEFT JOIN users ON users.id = queries.user_id
+ORDER BY users.id;
+id escaped_query
+1 \(a\)
+2 \(b\)
+3 \(c\)
+DROP TABLE queries;
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result
new file mode 100644
index 00000000..adf6b3a4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_match_against.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS memos;
+SET GLOBAL mroonga_default_tokenizer = TokenDelimit;
+SET NAMES utf8mb4;
+CREATE TABLE memos (
+id INT PRIMARY KEY,
+content TEXT,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+INSERT INTO memos VALUES(1, "(Groonga) Installed!");
+INSERT INTO memos VALUES(2, "(Mroonga) Installed!");
+INSERT INTO memos VALUES(3, "(Groonga) Upgraded!");
+SELECT * FROM memos
+WHERE MATCH(content) AGAINST(mroonga_escape("(groonga)") IN BOOLEAN MODE);
+id content
+1 (Groonga) Installed!
+3 (Groonga) Upgraded!
+DROP TABLE memos;
+SET GLOBAL mroonga_default_tokenizer = TokenBigram;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result
new file mode 100644
index 00000000..c6c39fcc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_named.result
@@ -0,0 +1,4 @@
+SET NAMES UTF8;
+SELECT mroonga_escape('+-><~*()\"\\:' AS query) AS escaped_query;
+escaped_query
+\+\-\>\<\~\*\(\)\"\\\:
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_nested.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_nested.result
new file mode 100644
index 00000000..5a57c144
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_query_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_escape_script_decimal.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result
new file mode 100644
index 00000000..246f2800
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_decimal.result
@@ -0,0 +1,11 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS data;
+CREATE TABLE data (
+value DECIMAL(5, 3)
+);
+INSERT INTO data VALUES (2.9);
+SELECT mroonga_escape(value AS script)
+FROM data;
+mroonga_escape(value AS script)
+2.9
+DROP TABLE data;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result
new file mode 100644
index 00000000..902bbd31
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_integer.result
@@ -0,0 +1,4 @@
+SET NAMES UTF8;
+SELECT mroonga_escape(-29 AS script) AS escaped_query;
+escaped_query
+-29
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result
new file mode 100644
index 00000000..178ff312
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_real.result
@@ -0,0 +1,11 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS data;
+CREATE TABLE data (
+value REAL
+);
+INSERT INTO data VALUES (2.9);
+SELECT mroonga_escape(value AS script)
+FROM data;
+mroonga_escape(value AS script)
+2.9
+DROP TABLE data;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result
new file mode 100644
index 00000000..6f5e9b2a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_escape_script_string.result
@@ -0,0 +1,4 @@
+SET NAMES UTF8;
+SELECT mroonga_escape('a\"\\\'z' AS script) AS escaped_query;
+escaped_query
+"a\"\\'z"
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result
new file mode 100644
index 00000000..96df6506
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_dynamic_keyword.result
@@ -0,0 +1,11 @@
+CREATE TABLE keywords (
+keyword text
+);
+INSERT INTO keywords VALUES ('Mroonga');
+INSERT INTO keywords VALUES ('Groonga');
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+keyword) AS highlighted
+FROM keywords;
+highlighted
+<span class="keyword">Mroonga</span> is the Groonga based storage engine.
+Mroonga is the <span class="keyword">Groonga</span> based storage engine.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result
new file mode 100644
index 00000000..ca7d7968
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_japanese.result
@@ -0,0 +1,13 @@
+SET NAMES utf8;
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'ロック', '更新') AS highlighted;
+highlighted
+Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネックになることが多いでしょう。
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result
new file mode 100644
index 00000000..9f4a3dff
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_multiple_keywords.result
@@ -0,0 +1,4 @@
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+'Mroonga', 'Groonga') AS highlighted;
+highlighted
+<span class="keyword">Mroonga</span> is the <span class="keyword">Groonga</span> based storage engine.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result
new file mode 100644
index 00000000..bf280dba
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_normalizer.result
@@ -0,0 +1,4 @@
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+'mroonga') AS highlighted;
+highlighted
+<span class="keyword">Mroonga</span> is the Groonga based storage engine.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result
new file mode 100644
index 00000000..b2d0f509
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query.result
@@ -0,0 +1,13 @@
+SET NAMES utf8;
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'ロック 更新 -ボトルネック' AS query) AS highlighted;
+highlighted
+Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネックになることが多いでしょう。
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result
new file mode 100644
index 00000000..bd11a908
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_query_pragma.result
@@ -0,0 +1,13 @@
+SET NAMES utf8;
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'*D- +ロック +更新 ボトルネック' AS query) AS highlighted;
+highlighted
+Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネックになることが多いでしょう。
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result
new file mode 100644
index 00000000..fce13d9c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_highlight_html_record.result
@@ -0,0 +1,32 @@
+CREATE TABLE memos (
+content text
+);
+INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL.
+
+By using Mroonga, you can use Groonga with SQL.');
+INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.');
+INSERT INTO memos VALUES ('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.');
+SELECT mroonga_highlight_html(content, 'Mroonga') AS highlighted
+FROM memos;
+highlighted
+<span class="keyword">Mroonga</span> is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement <span class="keyword">Mroonga</span>, so that we can use Groonga through MySQL.
+
+By using <span class="keyword">Mroonga</span>, you can use Groonga with SQL.
+Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, <span class="keyword">Mroonga</span> is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL's official binary. So we can use it more easily than Tritonn.
+<span class="keyword">Mroonga</span> has two running modes.
+
+One is &quot;storage mode&quot;, that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is &quot;wrapper mode&quot;, that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga's fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga's read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_last_insert_grn_id.result
new file mode 100644
index 00000000..42064b7f
--- /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 00000000..b0db86cb
--- /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 00000000..ec6f2f98
--- /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_normalize_default.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result
new file mode 100644
index 00000000..fe5cc885
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_default.result
@@ -0,0 +1,3 @@
+SELECT mroonga_normalize('aBcAbC㍑');
+mroonga_normalize('aBcAbC㍑')
+abcabcリットル
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result
new file mode 100644
index 00000000..3d675fb0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_normalizer.result
@@ -0,0 +1,3 @@
+SELECT mroonga_normalize('aBcAbC㍑', "NormalizerAuto");
+mroonga_normalize('aBcAbC㍑', "NormalizerAuto")
+abcabcリットル
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result
new file mode 100644
index 00000000..7d4192f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_normalize_record.result
@@ -0,0 +1,7 @@
+CREATE TABLE memos (
+content text
+);
+INSERT INTO memos VALUES ('aBcAbC㍑');
+SELECT mroonga_normalize(content) FROM memos;
+mroonga_normalize(content)
+abcabcリットル
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result
new file mode 100644
index 00000000..9160633c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_multiple.result
@@ -0,0 +1,18 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS synonyms;
+CREATE TABLE synonyms (
+term varchar(255),
+synonym varchar(255),
+INDEX (term)
+);
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+INSERT INTO synonyms VALUES ('Mroonga', 'Mroonga');
+INSERT INTO synonyms VALUES ('Mroonga', 'Groonga MySQL');
+SELECT mroonga_query_expand('synonyms',
+'term',
+'synonym',
+'Mroonga Rroonga PGroonga') AS query;
+query
+((Mroonga) OR (Groonga MySQL)) ((Rroonga) OR (Groonga Ruby)) PGroonga
+DROP TABLE synonyms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result
new file mode 100644
index 00000000..6a2b5d7a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_no_index.result
@@ -0,0 +1,15 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS synonyms;
+CREATE TABLE synonyms (
+term varchar(255),
+synonym varchar(255)
+);
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+SELECT mroonga_query_expand('synonyms',
+'term',
+'synonym',
+'Mroonga Rroonga PGroonga') AS query;
+query
+Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga
+DROP TABLE synonyms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result
new file mode 100644
index 00000000..5f7b0f73
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_one.result
@@ -0,0 +1,16 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS synonyms;
+CREATE TABLE synonyms (
+term varchar(255),
+synonym varchar(255),
+INDEX (term)
+);
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+SELECT mroonga_query_expand('synonyms',
+'term',
+'synonym',
+'Mroonga Rroonga PGroonga') AS query;
+query
+Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga
+DROP TABLE synonyms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result
new file mode 100644
index 00000000..4690cd01
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_query_expand_pragma.result
@@ -0,0 +1,17 @@
+SET NAMES UTF8;
+DROP TABLE IF EXISTS synonyms;
+CREATE TABLE synonyms (
+term varchar(255),
+synonym varchar(255),
+INDEX (term)
+);
+INSERT INTO synonyms VALUES ('D+', '[D+]');
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+SELECT mroonga_query_expand('synonyms',
+'term',
+'synonym',
+'*D+ Mroonga Rroonga PGroonga') AS query;
+query
+*D+ Mroonga ((Rroonga) OR (Groonga Ruby)) PGroonga
+DROP TABLE synonyms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_ascii.result
new file mode 100644
index 00000000..5766f822
--- /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, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 0, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>')
+1 10 ...a<span class="w1"> bb</span> cc<span class="w3"> dd</span>...<br>
+...e &gt;&lt;<span class="w2"> ff</span> gg...<br>
+
+2 20 ...g<span class="w2"> ff</span> ee<span class="w3"> dd</span>...<br>
+... cc<span class="w1"> bb</span> aa...<br>
+
+3 30 ...c<span class="w3"> dd</span> ee<span class="w2"> ff</span>...<br>
+
+4 40 ...ee<span class="w2"> ff</span> gg h...<br>
+
+5 50 ...A<span class="w1"> BB</span> CC<span class="w3"> DD</span>...<br>
+...E &gt;&lt;<span class="w2"> FF</span> GG...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>')
+1 10 ... <span class="w1">bb</span> cc <span class="w3">dd</span> ...<br>
+... &gt;&lt; <span class="w2">ff</span> gg ...<br>
+
+2 20 ... <span class="w2">ff</span> ee <span class="w3">dd</span> ...<br>
+...cc <span class="w1">bb</span> aa...<br>
+
+3 30 ... <span class="w3">dd</span> ee <span class="w2">ff</span> ...<br>
+
+4 40 ...ee <span class="w2">ff</span> gg h...<br>
+
+5 50
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>')
+1 10 ... <span class="w1">bb</span> cc <span class="w3">dd</span> ...<br>
+... &gt;&lt; <span class="w2">ff</span> gg ...<br>
+
+2 20 ... <span class="w2">ff</span> ee <span class="w3">dd</span> ...<br>
+...cc <span class="w1">bb</span> aa...<br>
+
+3 30 ... <span class="w3">dd</span> ee <span class="w2">ff</span> ...<br>
+
+4 40 ...ee <span class="w2">ff</span> gg h...<br>
+
+5 50 ... <span class="w1">BB</span> CC <span class="w3">DD</span> ...<br>
+... &gt;&lt; <span class="w2">FF</span> GG ...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>')
+1 10 ... <span class="w1">bb</span> cc <span class="w3">dd</span> ...<br>
+... &gt;&lt; <span class="w2">ff</span> gg ...<br>
+
+2 20 ... <span class="w2">ff</span> ee <span class="w3">dd</span> ...<br>
+...cc <span class="w1">bb</span> aa...<br>
+
+3 30 ... <span class="w3">dd</span> ee <span class="w2">ff</span> ...<br>
+
+4 40 ...ee <span class="w2">ff</span> gg h...<br>
+
+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 00000000..a21157a0
--- /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, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 0, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>')
+1 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+2 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>͕...<br>
+
+3 ...<span class="w1">29</span>̕xm...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>')
+1 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+2 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>͕...<br>
+
+3 ...<span class="w3">xmR</span>...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>')
+1 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+2 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>͕...<br>
+
+3 ...<span class="w1">29</span>̕xm...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>')
+1 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>ɂ...<br>
+
+2 ...<span class="w1">QX</span>̕x...<br>
+...<span class="w2">VC</span>͕...<br>
+
+3 ...<span class="w3">xmR</span>...<br>
+
+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 00000000..e4c6a417
--- /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, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 0, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>')
+1 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+2 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ʬ...<br>
+
+3 ...<span class="w1">29</span>ٻ...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>')
+1 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+2 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ʬ...<br>
+
+3 ...<span class="w3">ٻλ</span>...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>')
+1 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+2 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ʬ...<br>
+
+3 ...<span class="w1">29</span>ٻ...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>')
+1 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ˤ...<br>
+
+2 ...<span class="w1"></span>...<br>
+...<span class="w2">ŷ</span>ʬ...<br>
+
+3 ...<span class="w3">ٻλ</span>...<br>
+
+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_html_dynamic_keyword.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result
new file mode 100644
index 00000000..24665fbf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_dynamic_keyword.result
@@ -0,0 +1,11 @@
+CREATE TABLE keywords (
+keyword text
+);
+INSERT INTO keywords VALUES ('Mroonga');
+INSERT INTO keywords VALUES ('Groonga');
+SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.',
+keyword) as snippet
+FROM keywords;
+snippet
+<div class="snippet"><span class="keyword">Mroonga</span> is the Groonga based storage engine.</div>
+<div class="snippet">Mroonga is the <span class="keyword">Groonga</span> based storage engine.</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result
new file mode 100644
index 00000000..f1efa42c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_japanese.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'ロック', '更新') as snippet;
+snippet
+<div class="snippet">がデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。</div><div class="snippet">用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネッ</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result
new file mode 100644
index 00000000..013ad5b1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_keywords.result
@@ -0,0 +1,4 @@
+SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.',
+'Mroonga', 'Groonga') as snippet;
+snippet
+<div class="snippet"><span class="keyword">Mroonga</span> is the <span class="keyword">Groonga</span> based storage engine.</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result
new file mode 100644
index 00000000..d3f790b3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_multiple_snippets.result
@@ -0,0 +1,10 @@
+SELECT mroonga_snippet_html('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.',
+'lock') as snippet;
+snippet
+<div class="snippet">ng. With this mode, you can have full benefits of Groonga described above, like fast data update, <span class="keyword">lock</span>-free full text search and geolocation search. But it does not support transactions.
+
+Another one </div><div class="snippet">f the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga's read-<span class="keyword">lock</span> free characteristic. And you might have the performance bottle neck in the storage engine in upda</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result
new file mode 100644
index 00000000..d05c2323
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'ロック 更新 -ボトルネック' AS query) as snippet;
+snippet
+<div class="snippet">がデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。</div><div class="snippet">用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネッ</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result
new file mode 100644
index 00000000..02ce9098
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_query_pragma.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+'*D- +ロック +更新 ボトルネック' AS query) as snippet;
+snippet
+<div class="snippet">がデフォルトのモードです。上述の参照<span class="keyword">ロック</span>フリーなGroongaの性能特性をフルに活かした高速なデータ<span class="keyword">更新</span>・全文検索・位置情報検索が特長です。</div><div class="snippet">用することができます。一方、Groongaの参照<span class="keyword">ロック</span>フリーな特性は活かすことができません。また、<span class="keyword">更新</span>処理は他のストレージエンジンがボトルネッ</div>
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result
new file mode 100644
index 00000000..469defbc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/function_snippet_html_record.result
@@ -0,0 +1,30 @@
+CREATE TABLE memos (
+content text
+);
+INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL.
+
+By using Mroonga, you can use Groonga with SQL.');
+INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.');
+INSERT INTO memos VALUES ('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.');
+SELECT mroonga_snippet_html(content, 'Mroonga') as snippet
+FROM memos;
+snippet
+<div class="snippet"><span class="keyword">Mroonga</span> is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily.</div><div class="snippet"> So we implement <span class="keyword">Mroonga</span>, so that we can use Groonga through MySQL.
+
+By using <span class="keyword">Mroonga</span>, you can use Groonga with SQL.</div>
+<div class="snippet">onn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, <span class="keyword">Mroonga</span> is an independent program (shared library) using Pluggable Storage Engine interface, and we can</div>
+<div class="snippet"><span class="keyword">Mroonga</span> has two running modes.
+
+One is &quot;storage mode&quot;, that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described</div>
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 00000000..78cee626
--- /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: <nonexistent_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 00000000..bf967adb
--- /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: <big5>
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 00000000..05a63a3d
--- /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, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 0, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>')
+1 あああああ ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+2 いいいいい ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+3 ううううう ...<span class="w1">29日</span>の...<br>
+...<span class="w2">天気</span>に...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>')
+1 あああああ ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+2 いいいいい ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+3 ううううう ...<span class="w3">富士山</span>...<br>
+...<span class="w2">天気</span>に...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>')
+1 あああああ ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+2 いいいいい ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+3 ううううう ...<span class="w1">29日</span>の...<br>
+...<span class="w2">天気</span>に...<br>
+
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+c1 c2 mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>')
+1 あああああ ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+2 いいいいい ...<span class="w1">29日</span>...<br>
+...<span class="w3">富士山</span>...<br>
+
+3 ううううう ...<span class="w3">富士山</span>...<br>
+...<span class="w2">天気</span>に...<br>
+
+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 00000000..fc16c590
--- /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 IGNORE INTO shops VALUES (NULL), (NULL);
+Warnings:
+Warning 1048 Column 'location' cannot be null
+Warning 1048 Column 'location' cannot be null
+SELECT ST_AsText(location) FROM shops;
+ST_AsText(location)
+POINT(0 0)
+POINT(0 0)
+DROP TABLE shops;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result
new file mode 100644
index 00000000..5095232d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result
@@ -0,0 +1,167 @@
+DROP TABLE IF EXISTS shops;
+CREATE TABLE shops (
+id INT PRIMARY KEY AUTO_INCREMENT,
+name TEXT,
+location GEOMETRY NOT NULL,
+SPATIAL KEY location_index (location)
+);
+INSERT INTO shops (name, location)
+VALUES ('nezu-no-taiyaki',
+ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+VALUES ('taiyaki-kataoka',
+ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+VALUES ('soba-taiyaki-ku',
+ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+VALUES ('kuruma',
+ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+VALUES ('hirose-ya',
+ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+VALUES ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+VALUES ('omede-taiyaki',
+ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+VALUES ('onaga-ya',
+ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+VALUES ('shiro-ya',
+ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+VALUES ('fuji-ya',
+ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+VALUES ('miyoshi',
+ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+VALUES ('juju-ya',
+ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+VALUES ('tatsumi-ya',
+ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+VALUES ('tetsuji',
+ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+VALUES ('gazuma-ya',
+ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+VALUES ('honma-mon',
+ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+VALUES ('naniwa-ya',
+ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+VALUES ('kuro-dai',
+ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+VALUES ('daruma',
+ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+VALUES ('yanagi-ya',
+ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+VALUES ('sharaku',
+ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+VALUES ('takane',
+ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+VALUES ('chiyoda',
+ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+VALUES ('da-ka-po',
+ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+VALUES ('matsushima-ya',
+ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+VALUES ('kazuya',
+ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+VALUES ('furuya-kogane-an',
+ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+VALUES ('hachi-no-ie',
+ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+VALUES ('azuki-chan',
+ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+VALUES ('kuriko-an',
+ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+VALUES ('naze-ya',
+ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+VALUES ('sanoki-ya',
+ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+VALUES ('shigeta',
+ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+VALUES ('nishimi-ya',
+ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+VALUES ('hiiragi',
+ST_GeomFromText('POINT(139.711517 35.647701)'));
+SELECT id, name, ST_AsText(location) AS location_text FROM shops;
+id name location_text
+1 nezu-no-taiyaki POINT(139.76257305555555 35.72025305555556)
+2 taiyaki-kataoka POINT(139.7155911111111 35.712521111111116)
+3 soba-taiyaki-ku POINT(139.65908805555557 35.68371194444445)
+4 kuruma POINT(139.70620694444446 35.72151611111111)
+5 hirose-ya POINT(139.68560805555555 35.71484388888889)
+6 sazare POINT(139.68504305555555 35.71465305555556)
+7 omede-taiyaki POINT(139.8171538888889 35.70051611111111)
+8 onaga-ya POINT(139.81105 35.69825388888889)
+9 shiro-ya POINT(139.63861111111112 35.70551694444445)
+10 fuji-ya POINT(139.637115 35.703938055555554)
+11 miyoshi POINT(139.53732305555556 35.644538888888896)
+12 juju-ya POINT(139.69575500000002 35.62892194444445)
+13 tatsumi-ya POINT(139.63865694444445 35.66550111111111)
+14 tetsuji POINT(139.76857 35.680911944444446)
+15 gazuma-ya POINT(139.64759805555553 35.70081694444444)
+16 honma-mon POINT(139.65257305555556 35.72273611111111)
+17 naniwa-ya POINT(139.79623388888888 35.73006111111111)
+18 kuro-dai POINT(139.70483388888888 35.650345)
+19 daruma POINT(139.7705988888889 35.68146111111111)
+20 yanagi-ya POINT(139.78398111111113 35.685341111111114)
+21 sharaku POINT(139.79484611111113 35.71696888888889)
+22 takane POINT(139.56091305555555 35.69860111111112)
+23 chiyoda POINT(139.65281694444442 35.64260111111111)
+24 da-ka-po POINT(139.72735611111113 35.62734611111111)
+25 matsushima-ya POINT(139.73738111111112 35.64055611111111)
+26 kazuya POINT(139.760895 35.67350805555556)
+27 furuya-kogane-an POINT(139.67607111111113 35.68060305555556)
+28 hachi-no-ie POINT(139.66810611111111 35.608021111111114)
+29 azuki-chan POINT(139.67320305555555 35.641510000000004)
+30 kuriko-an POINT(139.79682888888888 35.71201305555556)
+31 yume-no-aru-machi-no-taiyaki-ya-san POINT(139.71252388888888 35.61619888888889)
+32 naze-ya POINT(139.66583305555557 35.60903888888889)
+33 sanoki-ya POINT(139.7707211111111 35.66592)
+34 shigeta POINT(139.78027305555557 35.67262611111111)
+35 nishimi-ya POINT(139.77462805555555 35.671825)
+36 hiiragi POINT(139.71151694444444 35.64770111111111)
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ORDER BY id;
+id name location_text
+14 tetsuji POINT(139.76857 35.680911944444446)
+19 daruma POINT(139.7705988888889 35.68146111111111)
+26 kazuya POINT(139.760895 35.67350805555556)
+EXPLAIN
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ORDER BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE shops range location_index location_index 34 NULL 36 Using where; Using filesort
+DROP TABLE shops;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result
new file mode 100644
index 00000000..73573355
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_bulk_insert_null.result
@@ -0,0 +1,9 @@
+DROP TABLE IF EXISTS shops;
+CREATE TABLE shops (
+location GEOMETRY NOT NULL
+);
+INSERT INTO shops VALUES (NULL), (NULL);
+ERROR 23000: Column 'location' cannot be null
+SELECT ST_AsText(location) FROM shops;
+ST_AsText(location)
+DROP TABLE shops;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result
new file mode 100644
index 00000000..2f432fc8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_strict_sql_mode_contains.result
@@ -0,0 +1,169 @@
+DROP TABLE IF EXISTS shops;
+CREATE TABLE shops (
+id INT PRIMARY KEY AUTO_INCREMENT,
+name TEXT,
+location GEOMETRY NOT NULL,
+SPATIAL KEY location_index (location)
+);
+INSERT INTO shops (name, location)
+VALUES ('nezu-no-taiyaki',
+ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+VALUES ('taiyaki-kataoka',
+ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+VALUES ('soba-taiyaki-ku',
+ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+VALUES ('kuruma',
+ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+VALUES ('hirose-ya',
+ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+VALUES ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+VALUES ('omede-taiyaki',
+ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+VALUES ('onaga-ya',
+ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+VALUES ('shiro-ya',
+ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+VALUES ('fuji-ya',
+ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+VALUES ('miyoshi',
+ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+VALUES ('juju-ya',
+ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+VALUES ('tatsumi-ya',
+ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+VALUES ('tetsuji',
+ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+VALUES ('gazuma-ya',
+ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+VALUES ('honma-mon',
+ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+VALUES ('naniwa-ya',
+ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+VALUES ('kuro-dai',
+ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+VALUES ('daruma',
+ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+VALUES ('yanagi-ya',
+ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+VALUES ('sharaku',
+ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+VALUES ('takane',
+ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+VALUES ('chiyoda',
+ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+VALUES ('da-ka-po',
+ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+VALUES ('matsushima-ya',
+ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+VALUES ('kazuya',
+ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+VALUES ('furuya-kogane-an',
+ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+VALUES ('hachi-no-ie',
+ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+VALUES ('azuki-chan',
+ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+VALUES ('kuriko-an',
+ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+VALUES ('naze-ya',
+ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+VALUES ('sanoki-ya',
+ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+VALUES ('shigeta',
+ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+VALUES ('nishimi-ya',
+ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+VALUES ('hiiragi',
+ST_GeomFromText('POINT(139.711517 35.647701)'));
+SELECT id, name, ST_AsText(location) AS location_text FROM shops;
+id name location_text
+1 nezu-no-taiyaki POINT(139.76257305555555 35.72025305555556)
+2 taiyaki-kataoka POINT(139.7155911111111 35.712521111111116)
+3 soba-taiyaki-ku POINT(139.65908805555557 35.68371194444445)
+4 kuruma POINT(139.70620694444446 35.72151611111111)
+5 hirose-ya POINT(139.68560805555555 35.71484388888889)
+6 sazare POINT(139.68504305555555 35.71465305555556)
+7 omede-taiyaki POINT(139.8171538888889 35.70051611111111)
+8 onaga-ya POINT(139.81105 35.69825388888889)
+9 shiro-ya POINT(139.63861111111112 35.70551694444445)
+10 fuji-ya POINT(139.637115 35.703938055555554)
+11 miyoshi POINT(139.53732305555556 35.644538888888896)
+12 juju-ya POINT(139.69575500000002 35.62892194444445)
+13 tatsumi-ya POINT(139.63865694444445 35.66550111111111)
+14 tetsuji POINT(139.76857 35.680911944444446)
+15 gazuma-ya POINT(139.64759805555553 35.70081694444444)
+16 honma-mon POINT(139.65257305555556 35.72273611111111)
+17 naniwa-ya POINT(139.79623388888888 35.73006111111111)
+18 kuro-dai POINT(139.70483388888888 35.650345)
+19 daruma POINT(139.7705988888889 35.68146111111111)
+20 yanagi-ya POINT(139.78398111111113 35.685341111111114)
+21 sharaku POINT(139.79484611111113 35.71696888888889)
+22 takane POINT(139.56091305555555 35.69860111111112)
+23 chiyoda POINT(139.65281694444442 35.64260111111111)
+24 da-ka-po POINT(139.72735611111113 35.62734611111111)
+25 matsushima-ya POINT(139.73738111111112 35.64055611111111)
+26 kazuya POINT(139.760895 35.67350805555556)
+27 furuya-kogane-an POINT(139.67607111111113 35.68060305555556)
+28 hachi-no-ie POINT(139.66810611111111 35.608021111111114)
+29 azuki-chan POINT(139.67320305555555 35.641510000000004)
+30 kuriko-an POINT(139.79682888888888 35.71201305555556)
+31 yume-no-aru-machi-no-taiyaki-ya-san POINT(139.71252388888888 35.61619888888889)
+32 naze-ya POINT(139.66583305555557 35.60903888888889)
+33 sanoki-ya POINT(139.7707211111111 35.66592)
+34 shigeta POINT(139.78027305555557 35.67262611111111)
+35 nishimi-ya POINT(139.77462805555555 35.671825)
+36 hiiragi POINT(139.71151694444444 35.64770111111111)
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ORDER BY id;
+id name location_text
+14 tetsuji POINT(139.76857 35.680911944444446)
+19 daruma POINT(139.7705988888889 35.68146111111111)
+26 kazuya POINT(139.760895 35.67350805555556)
+EXPLAIN
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ORDER BY id;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE shops NULL range location_index location_index 34 NULL 36 100.00 Using where; Using filesort
+Warnings:
+Note 1003 /* select#1 */ select `test`.`shops`.`id` AS `id`,`test`.`shops`.`name` AS `name`,st_astext(`test`.`shops`.`location`) AS `location_text` from `test`.`shops` where mbrcontains(<cache>(st_geometryfromtext('LineString(139.7727 35.6684, 139.7038 35.7121)')),`test`.`shops`.`location`) order by `test`.`shops`.`id`
+DROP TABLE shops;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result b/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result
new file mode 100644
index 00000000..b403eccf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result
@@ -0,0 +1,7 @@
+SHOW CREATE TABLE INFORMATION_SCHEMA.MROONGA_STATS;
+Table Create Table
+Mroonga_stats CREATE TEMPORARY TABLE `Mroonga_stats` (
+ `VERSION` varchar(40) NOT NULL DEFAULT '',
+ `rows_written` int(11) NOT NULL DEFAULT 0,
+ `rows_read` int(11) NOT NULL DEFAULT 0
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
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 00000000..78ed69f0
--- /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 00000000..a55a184d
--- /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 00000000..57eb6ae2
--- /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 00000000..043d1e3c
--- /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 00000000..5f92c086
--- /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 00000000..b0bbaf09
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_id_primary.result
@@ -0,0 +1,28 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH);
+INSERT INTO t1 VALUES(null, 100);
+ERROR 23000: Column '_id' cannot be null
+INSERT INTO t1 VALUES(1,100);
+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 00000000..1a30a1ec
--- /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 00000000..6e642ce1
--- /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_hash_strict_sql_mode_id_primary.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result
new file mode 100644
index 00000000..8fb46156
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_hash_strict_sql_mode_id_primary.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH);
+INSERT INTO t1 VALUES(null, 100);
+ERROR 23000: Column '_id' cannot be null
+INSERT INTO t1 VALUES(1,100);
+ERROR 01000: Data truncated for column '_id' at row 1
+INSERT INTO t1 VALUES(1,100);
+ERROR 01000: Data truncated for column '_id' at row 1
+INSERT INTO t1 VALUES(1,100);
+ERROR 01000: Data truncated for column '_id' at row 1
+INSERT INTO t1 VALUES(1,100);
+ERROR 01000: Data truncated for column '_id' at row 1
+SELECT * FROM t1;
+_id a
+SELECT * FROM t1 WHERE _id = 2;
+_id a
+SELECT * FROM t1 WHERE _id = 20;
+_id a
+DROP TABLE t1;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_delete.result
new file mode 100644
index 00000000..c680a373
--- /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 00000000..a627f432
--- /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 00000000..368f88a6
--- /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 00000000..6d5516f7
--- /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 00000000..b0edfb9e
--- /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 00000000..587e3c5f
--- /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_order_by_where_equal_asc_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result
new file mode 100644
index 00000000..055ca69f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_asc_asc.result
@@ -0,0 +1,40 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+score3 INT,
+INDEX (score1, score2, score3)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `score3` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`score2`,`score3`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100);
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100);
+SELECT *
+FROM items
+WHERE score1 = 2
+ORDER BY score2 ASC, score3 ASC;
+id score1 score2 score3
+3 2 10 100
+7 2 20 -100
+8 2 20 0
+9 2 20 100
+4 2 30 -100
+5 2 30 0
+6 2 30 100
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result
new file mode 100644
index 00000000..0d7faddc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_order_by_where_equal_desc_desc.result
@@ -0,0 +1,40 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+score3 INT,
+INDEX (score1, score2, score3)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `score3` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`score2`,`score3`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100);
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100);
+SELECT *
+FROM items
+WHERE score1 = 2
+ORDER BY score2 DESC, score3 DESC;
+id score1 score2 score3
+6 2 30 100
+5 2 30 0
+4 2 30 -100
+9 2 20 100
+8 2 20 0
+7 2 20 -100
+3 2 10 100
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_delete.result
new file mode 100644
index 00000000..ac673bac
--- /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 00000000..20b45861
--- /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_strict_sql_mode_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result
new file mode 100644
index 00000000..b390ca7a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_strict_sql_mode_update.result
@@ -0,0 +1,26 @@
+DROP TABLE IF EXISTS scores;
+SET NAMES utf8;
+CREATE TABLE scores (
+name char(30) NOT NULL,
+score int NOT NULL,
+PRIMARY KEY (name, score)
+) DEFAULT CHARSET=utf8;
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10);
+SELECT * FROM scores;
+name score
+Jiro Yamada 27
+Taro Yamada -12
+Taro Yamada 10
+Taro Yamada 29
+UPDATE scores SET name = "Taro Yamada"
+ WHERE name = "Jiro Yamada" AND score = 27;
+ERROR 01000: data truncated for primary key column: <name>
+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 00000000..a58a487a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_primary_update.result
@@ -0,0 +1,27 @@
+DROP TABLE IF EXISTS scores;
+SET NAMES utf8;
+CREATE TABLE scores (
+name char(30) NOT NULL,
+score int NOT NULL,
+PRIMARY KEY (name, score)
+) DEFAULT CHARSET=utf8;
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10);
+SELECT * FROM scores;
+name score
+Jiro Yamada 27
+Taro Yamada -12
+Taro Yamada 10
+Taro Yamada 29
+UPDATE scores SET name = "Taro Yamada"
+ WHERE name = "Jiro Yamada" AND score = 27;
+Warnings:
+Warning 1265 data truncated for primary key column: <name>
+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_range_all_used_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than.result
new file mode 100644
index 00000000..870c5ba7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than.result
@@ -0,0 +1,28 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score INT,
+created_at DATETIME,
+INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score` (`score`,`created_at`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+SELECT *
+FROM items
+WHERE score = 2 AND created_at > "2014-09-11 00:00:00"
+ ORDER BY created_at DESC;
+id score created_at
+4 2 2014-09-12 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result
new file mode 100644
index 00000000..06661210
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_greater_than_or_equal.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score INT,
+created_at DATETIME,
+INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score` (`score`,`created_at`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+SELECT *
+FROM items
+WHERE score = 2 AND created_at >= "2014-09-11 00:00:00"
+ ORDER BY created_at DESC;
+id score created_at
+4 2 2014-09-12 00:00:00
+2 2 2014-09-11 00:00:00
+3 2 2014-09-11 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result
new file mode 100644
index 00000000..f528f90b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score INT,
+created_at DATETIME,
+INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score` (`score`,`created_at`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+SELECT *
+FROM items
+WHERE score = 2 AND created_at < "2014-09-12 00:00:00"
+ ORDER BY created_at DESC;
+id score created_at
+2 2 2014-09-11 00:00:00
+3 2 2014-09-11 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result
new file mode 100644
index 00000000..9250ecb8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_all_used_less_than_or_equal.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score INT,
+created_at DATETIME,
+INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score` (`score`,`created_at`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+SELECT *
+FROM items
+WHERE score = 2 AND created_at <= "2014-09-12 00:00:00"
+ ORDER BY created_at DESC;
+id score created_at
+4 2 2014-09-12 00:00:00
+2 2 2014-09-11 00:00:00
+3 2 2014-09-11 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result
new file mode 100644
index 00000000..8e5f4329
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`created_at`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE score1 = 2 AND created_at > "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+8 2 0 2015-07-02 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result
new file mode 100644
index 00000000..1a3021e2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`created_at`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE score1 = 2 AND created_at >= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+8 2 0 2015-07-02 00:00:00
+5 2 0 2015-07-01 12:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result
new file mode 100644
index 00000000..6adaa987
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than.result
@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`created_at`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE score1 = 2 AND created_at < "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+2 2 0 2015-07-01 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result
new file mode 100644
index 00000000..dfc7ef6f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `score1` (`score1`,`created_at`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE score1 = 2 AND created_at <= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+5 2 0 2015-07-01 12:00:00
+2 2 0 2015-07-01 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result
new file mode 100644
index 00000000..502c0c10
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `created_at` (`created_at`,`score1`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE created_at > "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+4 2 0 2015-07-02 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result
new file mode 100644
index 00000000..60ffa88b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `created_at` (`created_at`,`score1`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE created_at >= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+4 2 0 2015-07-02 00:00:00
+3 2 0 2015-07-01 12:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result
new file mode 100644
index 00000000..2cdb3de3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `created_at` (`created_at`,`score1`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE created_at < "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+2 2 0 2015-07-01 00:00:00
+1 1 0 2015-07-01 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result
new file mode 100644
index 00000000..3443bbc3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.result
@@ -0,0 +1,31 @@
+DROP TABLE IF EXISTS items;
+CREATE TABLE items (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT,
+score2 INT,
+created_at DATETIME,
+INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+Table Create Table
+items CREATE TABLE `items` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `score1` int(11) DEFAULT NULL,
+ `score2` int(11) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `created_at` (`created_at`,`score1`,`score2`)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+SELECT *
+FROM items
+WHERE created_at <= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+id score1 score2 created_at
+3 2 0 2015-07-01 12:00:00
+2 2 0 2015-07-01 00:00:00
+1 1 0 2015-07-01 00:00:00
+DROP TABLE items;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_recreate.result
new file mode 100644
index 00000000..02222965
--- /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 00000000..df67c8a3
--- /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 00000000..c75733f4
--- /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 00000000..452cae2d
--- /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 00000000..ecf7706b
--- /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_max.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result
new file mode 100644
index 00000000..b6091784
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_max.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS listing;
+CREATE TABLE scores (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT NOT NULL,
+score2 INT NOT NULL,
+INDEX (score1, score2)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO scores (score1, score2) VALUES(1, 1);
+INSERT INTO scores (score1, score2) VALUES(1, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 3);
+INSERT INTO scores (score1, score2) VALUES(2, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 1);
+INSERT INTO scores (score1, score2) VALUES(2, 0);
+INSERT INTO scores (score1, score2) VALUES(2, -1);
+INSERT INTO scores (score1, score2) VALUES(2, -2);
+INSERT INTO scores (score1, score2) VALUES(2, -3);
+SELECT MAX(score2) FROM scores WHERE score1 = 2;
+MAX(score2)
+3
+DROP TABLE scores;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result
new file mode 100644
index 00000000..0792751a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_min.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS listing;
+CREATE TABLE scores (
+id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+score1 INT NOT NULL,
+score2 INT NOT NULL,
+INDEX (score1, score2)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO scores (score1, score2) VALUES(1, 1);
+INSERT INTO scores (score1, score2) VALUES(1, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 3);
+INSERT INTO scores (score1, score2) VALUES(2, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 1);
+INSERT INTO scores (score1, score2) VALUES(2, 0);
+INSERT INTO scores (score1, score2) VALUES(2, -1);
+INSERT INTO scores (score1, score2) VALUES(2, -2);
+INSERT INTO scores (score1, score2) VALUES(2, -3);
+SELECT MIN(score2) FROM scores WHERE score1 = 2;
+MIN(score2)
+-3
+DROP TABLE scores;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_string.result
new file mode 100644
index 00000000..ad73669e
--- /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 00000000..543a9012
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_select_varchar.result
@@ -0,0 +1,41 @@
+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;
+Warnings:
+Warning 1280 Name 'property' ignored for PRIMARY key.
+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 00000000..61ce4406
--- /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 IGNORE INTO ranges VALUES (1, "1000-01-01", "2012-10-05");
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE 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 IGNORE INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE 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 00000000..21168547
--- /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-02", "2012-10-05");
+INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31");
+INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02");
+SELECT * FROM ranges FORCE INDEX(range_key)
+WHERE start = "1000-01-02" AND end = "9999-12-31";
+id start end
+2 1000-01-02 9999-12-31
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_index_read.result
new file mode 100644
index 00000000..93e34d88
--- /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-02", "2012-10-05");
+INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31");
+INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02");
+SELECT start, end
+FROM ranges FORCE INDEX(range_key)
+ORDER BY start, end;
+start end
+1000-01-02 2012-10-05
+1000-01-02 9999-12-31
+2012-10-25 9999-12-31
+9999-12-31 1000-01-02
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_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 00000000..bc1c3c57
--- /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 IGNORE INTO ranges VALUES (1, "2012-10-25", "9999-12-31");
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (2, "1000-01-01", "2012-10-05");
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE 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 IGNORE 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 00000000..820ee4f4
--- /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 IGNORE INTO ranges VALUES (1, "2012-10-25", "9999-12-31");
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (2, "1000-01-01", "2012-10-05");
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE 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 IGNORE 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 00000000..c2a94a84
--- /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-02", "2012-10-05");
+INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02");
+INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31");
+SELECT * FROM ranges FORCE INDEX(range_key)
+ORDER BY start, end;
+id start end
+2 1000-01-02 2012-10-05
+4 1000-01-02 9999-12-31
+1 2012-10-25 9999-12-31
+3 9999-12-31 1000-01-02
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_order_64bit_desc.result
new file mode 100644
index 00000000..2d100156
--- /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-02", "2012-10-05");
+INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02");
+INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31");
+SELECT * FROM ranges FORCE INDEX(range_key)
+ORDER BY start DESC, end DESC;
+id start end
+3 9999-12-31 1000-01-02
+1 2012-10-25 9999-12-31
+4 1000-01-02 9999-12-31
+2 1000-01-02 2012-10-05
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_date_reinsert.result
new file mode 100644
index 00000000..bd1bdc33
--- /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 00000000..a8546c4b
--- /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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "9999-12-31 23:59:59");
+INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-02 00:00:00");
+SELECT start, end
+FROM ranges FORCE INDEX(range_key)
+ORDER BY start, end;
+start end
+1000-01-02 00:00:00 2012-10-05 16:18:29
+1000-01-02 00:00:00 9999-12-31 23:59:59
+2012-10-25 16:18:29 9999-12-31 23:59:59
+9999-12-31 23:59:59 1000-01-02 00:00:00
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.result
new file mode 100644
index 00000000..130c03ed
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS ranges;
+CREATE TABLE ranges (
+id int PRIMARY KEY,
+start datetime,
+end datetime,
+UNIQUE KEY range_key(start, end)
+);
+INSERT IGNORE INTO ranges VALUES (1, "1990-00-00 00:00:00", "2012-10-05 23:59:59");
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+SELECT * FROM ranges;
+id start end
+1 1990-01-01 00:00:00 2012-10-05 23:59:59
+DELETE FROM ranges WHERE id = 1;
+INSERT IGNORE INTO ranges VALUES (1, "1990-00-00 00:00:00", "2012-10-05 23:59:59");
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+SELECT * FROM ranges;
+id start end
+1 1990-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_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 00000000..5cffb71d
--- /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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00");
+INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+SELECT * FROM ranges FORCE INDEX(range_key)
+ORDER BY start, end;
+id start end
+2 1000-01-02 00:00:00 2012-10-05 16:18:29
+4 1000-01-02 00:00:00 9999-12-31 23:59:59
+1 2012-10-25 16:18:29 9999-12-31 23:59:59
+3 9999-12-31 23:59:59 1000-01-02 00:00:00
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_order_desc.result
new file mode 100644
index 00000000..4429f787
--- /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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00");
+INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+SELECT * FROM ranges FORCE INDEX(range_key)
+ORDER BY start DESC, end DESC;
+id start end
+3 9999-12-31 23:59:59 1000-01-02 00:00:00
+1 2012-10-25 16:18:29 9999-12-31 23:59:59
+4 1000-01-02 00:00:00 9999-12-31 23:59:59
+2 1000-01-02 00:00:00 2012-10-05 16:18:29
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_datetime_reinsert.result
new file mode 100644
index 00000000..50d5da49
--- /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 00000000..cb8a1c61
--- /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.000000000000000000000000...' 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 00000000..4e0dec32
--- /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 00000000..3c6520a6
--- /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 00000000..c1be8030
--- /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 00000000..0613de3e
--- /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 00000000..92e95d92
--- /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 DEFAULT '2016-04-21 00:00:00',
+end timestamp DEFAULT '2016-04-22 00:00:00',
+UNIQUE KEY range_key(start, end)
+);
+INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29");
+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 00000000..35bc4123
--- /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 DEFAULT '2016-04-21 00:00:00',
+end timestamp DEFAULT '2016-04-22 00:00:00',
+UNIQUE KEY range_key(start, end)
+);
+INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07");
+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 00000000..fbf88cf3
--- /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 DEFAULT '2016-04-21 00:00:00',
+end timestamp DEFAULT '2016-04-22 00:00:00',
+UNIQUE KEY range_key(start, end)
+);
+INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07");
+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 00000000..b799cc27
--- /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 DEFAULT '2016-04-21 00:00:00',
+end timestamp DEFAULT '2016-04-22 00:00:00',
+UNIQUE KEY range_key(start, end)
+);
+INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59");
+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 00000000..5c9cd959
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_varchar.result
Binary files differ
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_32bit_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_32bit_equal.result
new file mode 100644
index 00000000..ad936268
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_32bit_equal.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS ranges;
+CREATE TABLE ranges (
+id INT PRIMARY KEY,
+start YEAR,
+end YEAR,
+UNIQUE KEY range_key(start, end)
+);
+INSERT IGNORE INTO ranges VALUES (1, 1901, 2012);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2155);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (3, 2012, 2155);
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (4, 2155, 1901);
+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 = 1901 AND end = 2155;
+id start end
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_64bit_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_64bit_equal.result
new file mode 100644
index 00000000..e96754e5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_64bit_equal.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS ranges;
+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;
+id start end
+2 1901 2155
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_index_read.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_index_read.result
new file mode 100644
index 00000000..997c5e7d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_index_read.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS ranges;
+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;
+start end
+1901 2012
+1901 2155
+2012 2155
+2155 1901
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_asc.result
new file mode 100644
index 00000000..8200263a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_asc.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS ranges;
+CREATE TABLE ranges (
+id INT PRIMARY KEY,
+start YEAR,
+end YEAR,
+UNIQUE KEY range_key(start, end)
+);
+INSERT IGNORE INTO ranges VALUES (1, 2012, 2155);
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2012);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE INTO ranges VALUES (3, 2155, 1901);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (4, 1901, 2155);
+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 2012
+4 1970 1970
+1 2012 1970
+3 1970 1970
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_desc.result
new file mode 100644
index 00000000..fc85d2a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_32bit_desc.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS ranges;
+CREATE TABLE ranges (
+id INT PRIMARY KEY,
+start YEAR,
+end YEAR,
+UNIQUE KEY range_key(start, end)
+);
+INSERT IGNORE INTO ranges VALUES (1, 2012, 2155);
+Warnings:
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2012);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+INSERT IGNORE INTO ranges VALUES (3, 2155, 1901);
+Warnings:
+Warning 1265 Data truncated for column 'start' at row 1
+Warning 1265 Data truncated for column 'end' at row 1
+INSERT IGNORE INTO ranges VALUES (4, 1901, 2155);
+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 1970
+1 2012 1970
+4 1970 1970
+2 1970 2012
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_asc.result
new file mode 100644
index 00000000..335b9eb9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_asc.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS ranges;
+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;
+id start end
+2 1901 2012
+4 1901 2155
+1 2012 2155
+3 2155 1901
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_desc.result
new file mode 100644
index 00000000..524456b7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_order_64bit_desc.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS ranges;
+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;
+id start end
+3 2155 1901
+1 2012 2155
+4 1901 2155
+2 1901 2012
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_reinsert.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_reinsert.result
new file mode 100644
index 00000000..7362411d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_unique_year_reinsert.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS ranges;
+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;
+id start end
+1 2010 2012
+DELETE FROM ranges WHERE id = 1;
+INSERT INTO ranges VALUES (1, 2010, 2012);
+SELECT * FROM ranges;
+id start end
+1 2010 2012
+DROP TABLE ranges;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_int.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_int.result
new file mode 100644
index 00000000..bfc30a1f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_int.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS scores;
+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;
+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", 29);
+INSERT INTO scores (name, score) VALUES("Taro Yamada", 10);
+SELECT * FROM scores WHERE score = 29;
+id name score
+3 Jiro Yamada 29
+1 Taro Yamada 29
+UPDATE scores SET name = "Saburo YAMADA" WHERE id = 3;
+SELECT * FROM scores WHERE score = 29;
+id name score
+3 Saburo YAMADA 29
+1 Taro Yamada 29
+DROP TABLE scores;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_string.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_string.result
new file mode 100644
index 00000000..550551d0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_update_string.result
@@ -0,0 +1,34 @@
+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
+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);
+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 00000000..95d7c78b
--- /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 00000000..f7a80206
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_char_null_character.result
Binary files differ
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 00000000..fb08c660
--- /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 00000000..b1eafd2d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_date.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+day DATE PRIMARY KEY,
+title TEXT
+) 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 00000000..0ae41c51
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_with_fractional_seconds.result
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+day DATETIME(6) PRIMARY KEY,
+title TEXT
+) 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 00000000..f5e743dc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_datetime_without_fractional_seconds.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+day DATETIME PRIMARY KEY,
+title TEXT
+) 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 00000000..6a529b50
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_with_fractional_seconds.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS releases;
+CREATE TABLE releases (
+version DECIMAL(6, 3) PRIMARY KEY,
+message TEXT
+) 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 00000000..d36688bb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_decimal_without_fractional_seconds.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS releases;
+CREATE TABLE releases (
+version DECIMAL PRIMARY KEY,
+message TEXT
+) 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 00000000..5437c789
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_with_fractional_seconds.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS running_records;
+CREATE TABLE running_records (
+time TIME(6) PRIMARY KEY,
+title TEXT
+) 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 00000000..e59dee4c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_time_without_fractional_seconds.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS running_records;
+CREATE TABLE running_records (
+time TIME PRIMARY KEY,
+title TEXT
+) 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 00000000..0fba3da7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_with_fractional_seconds.result
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+time TIMESTAMP(6) PRIMARY KEY,
+title TEXT
+) 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 00000000..8116bda2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_timestamp_without_fractional_seconds.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+time TIMESTAMP PRIMARY KEY,
+title TEXT
+) 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 00000000..9079d9c4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_varchar_null_character.result
Binary files differ
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result
new file mode 100644
index 00000000..78c56f25
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_primary_year.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS aniversary_memos;
+CREATE TABLE aniversary_memos (
+party_year YEAR PRIMARY KEY,
+title TEXT
+) DEFAULT CHARSET UTF8;
+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;
+party_year title
+2011 We need a big cake!
+2012 Invitations are sent.
+2013 Wow! Today is the anniversary party day!
+SELECT * FROM aniversary_memos
+WHERE party_year BETWEEN "12" AND "2013";
+party_year title
+2012 Invitations are sent.
+2013 Wow! Today is the anniversary party day!
+DROP TABLE aniversary_memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result
new file mode 100644
index 00000000..c2adc1cd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value > 10 ORDER BY value ASC LIMIT 3;
+id value
+3 30
+1 50
+2 70
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result
new file mode 100644
index 00000000..715d299d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value > 10 ORDER BY value DESC LIMIT 3;
+id value
+4 90
+2 70
+1 50
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result
new file mode 100644
index 00000000..d562fbbb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value >= 30 ORDER BY value ASC LIMIT 3;
+id value
+3 30
+1 50
+2 70
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result
new file mode 100644
index 00000000..5ecb4699
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value >= 30 ORDER BY value DESC LIMIT 3;
+id value
+4 90
+2 70
+1 50
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result
new file mode 100644
index 00000000..45b3fbe1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value < 90 ORDER BY value ASC LIMIT 3;
+id value
+5 10
+3 30
+1 50
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result
new file mode 100644
index 00000000..2e896e5e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value < 90 ORDER BY value DESC LIMIT 3;
+id value
+2 70
+1 50
+3 30
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result
new file mode 100644
index 00000000..d5313c9d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value <= 70 ORDER BY value ASC LIMIT 3;
+id value
+5 10
+3 30
+1 50
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result
new file mode 100644
index 00000000..c56a4332
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS ids;
+SET NAMES UTF8;
+CREATE TABLE ids (
+id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
+value INT(10),
+INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+SELECT id, value FROM ids WHERE value <= 70 ORDER BY value DESC LIMIT 3;
+id value
+2 70
+1 50
+3 30
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result
new file mode 100644
index 00000000..1ca4b145
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_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 > 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_primary_greater_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_desc.result
new file mode 100644
index 00000000..80dcb25f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_greater_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_asc.result
new file mode 100644
index 00000000..4c1ff997
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_greater_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_desc.result
new file mode 100644
index 00000000..4998725a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_less_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_asc.result
new file mode 100644
index 00000000..8b142f30
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_less_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_desc.result
new file mode 100644
index 00000000..eaf5b87e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_less_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_asc.result
new file mode 100644
index 00000000..e1e96c9c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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_primary_less_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_desc.result
new file mode 100644
index 00000000..e8124ca1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_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 00000000..77b32101
--- /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 00000000..b0004a3c
--- /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 00000000..862a314c
--- /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 00000000..04d44130
--- /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 00000000..8d3f6f7f
--- /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 00000000..d09f97e0
--- /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 00000000..5242f10f
--- /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 00000000..41d9c0eb
--- /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 00000000..e34b7b7d
--- /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 00000000..9014f9af
--- /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 00000000..63b27fdd
--- /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 00000000..412b9b7c
--- /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 00000000..c08522d0
--- /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 00000000..9882f2b1
--- /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 00000000..67f1f4f8
--- /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 00000000..2cdde6c4
--- /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 00000000..23f63d2f
--- /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 00000000..7fa17bd7
--- /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_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result
new file mode 100644
index 00000000..f2a0b28b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_delete_all.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id int,
+UNIQUE KEY (id)
+);
+INSERT INTO ids VALUES (1);
+DELETE FROM ids;
+INSERT INTO ids VALUES (1);
+SELECT * FROM ids;
+id
+1
+INSERT INTO ids VALUES (1);
+ERROR 23000: Duplicate entry '1' for key 'id'
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/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 00000000..4e10cf72
--- /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 00000000..7b2c0b86
--- /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_search_after_duplicated.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_search_after_duplicated.result
new file mode 100644
index 00000000..1d9d5fbb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_unique_search_after_duplicated.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+CREATE TABLE users (
+id int PRIMARY KEY,
+name varchar(100) NOT NULL,
+UNIQUE KEY (name)
+) DEFAULT CHARSET=utf8;
+INSERT INTO users VALUES (1, "Alice");
+INSERT INTO users VALUES (2, "Bob");
+INSERT INTO users VALUES (3, "Bob");
+ERROR 23000: Duplicate entry 'Bob' for key 'name'
+SELECT * FROM users;
+id name
+1 Alice
+2 Bob
+SELECT * FROM users WHERE name = "Bob";
+id name
+2 Bob
+DROP TABLE users;
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 00000000..155cdf15
--- /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 00000000..9165ca26
--- /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 00000000..b283af17
--- /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.in b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result.in
new file mode 100644
index 00000000..f1020453
--- /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 00000000..c23dab5e
--- /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 00000000..96d1b0ad
--- /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 00000000..3600c920
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_tables_data_length.result
@@ -0,0 +1,17 @@
+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;
+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 00000000..f8d41bb7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_TODO_SPLIT_ME.result
@@ -0,0 +1,78 @@
+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 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_delayed.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_delayed.result
new file mode 100644
index 00000000..eb11e26e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_delayed.result
@@ -0,0 +1,9 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT DELAYED INTO ids (id) VALUES (1);
+ERROR HY000: DELAYED option not supported for table 'ids'
+SELECT * FROM ids;
+id
+DROP TABLE ids;
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 00000000..0d2c9dd7
--- /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 00000000..94421a5c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_primary_key.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+day DATE PRIMARY KEY,
+title TEXT
+) 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 00000000..1ef6f1f2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_on_duplicate_key_update_unique_key.result
@@ -0,0 +1,24 @@
+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;
+INSERT INTO diaries (day, title)
+VALUES ("2012-02-14", "clear day1")
+ON DUPLICATE KEY UPDATE title = "clear day1 (duplicated)";
+INSERT INTO diaries (day, title)
+VALUES ("2012-02-14", "clear day2")
+ON DUPLICATE KEY UPDATE title = "clear day2 (duplicated)";
+INSERT INTO diaries (day, title)
+VALUES ("2012-02-14", "clear day3")
+ON DUPLICATE KEY UPDATE title = "clear day3 (duplicated)";
+INSERT INTO diaries (day, title)
+VALUES ("2012-02-15", "cloudy day")
+ON DUPLICATE KEY UPDATE title = "cloudy day (duplicated)";
+SELECT * FROM diaries;
+id day title
+1 2012-02-14 clear day3 (duplicated)
+4 2012-02-15 cloudy day
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result
new file mode 100644
index 00000000..624ac00d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/insert_virtual_column.result
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int, _id int);
+SET sql_mode="";
+INSERT INTO t1 (c1,_id) VALUES (1,1);
+Warnings:
+Warning 1265 Data truncated for column '_id' at row 1
+SET sql_mode="STRICT_ALL_TABLES";
+INSERT INTO t1 (c1,_id) VALUES (4,1);
+ERROR 01000: Data truncated for column '_id' at row 1
+SELECT * FROM t1;
+c1 _id
+1 1
+DROP TABLE t1;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result b/storage/mroonga/mysql-test/mroonga/storage/r/like_unicode_ci.result
new file mode 100644
index 00000000..1cc1d924
--- /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 00000000..4e1db465
--- /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_count_skip_after_insert_multithread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result
new file mode 100644
index 00000000..c09ec340
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_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_count_skip_after_insert_single_thread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_single_thread.result
new file mode 100644
index 00000000..c09ec340
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_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_count_skip_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result
new file mode 100644
index 00000000..8d29e042
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result
@@ -0,0 +1,24 @@
+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;
+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_count_skip_index_and.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result
new file mode 100644
index 00000000..26ca6de7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_and.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT,
+age INT,
+INDEX (id, age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id, age) VALUES (1, 28);
+INSERT INTO users (id, age) VALUES (1, 28);
+INSERT INTO users (id, age) VALUES (1, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (3, 29);
+SELECT COUNT(*) FROM users WHERE id = 2 AND age = 29;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result
new file mode 100644
index 00000000..c4b1dbf7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_between.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+SELECT COUNT(*) FROM users WHERE age BETWEEN 28 AND 30;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result
new file mode 100644
index 00000000..2bbcfe75
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_equal.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+SELECT COUNT(*) FROM users WHERE age = 29;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result
new file mode 100644
index 00000000..6ec4d774
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_boolean_mode.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+CREATE TABLE memos (
+content TEXT,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO memos (content) VALUES ('Groonga is good.');
+INSERT INTO memos (content) VALUES ('Groonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga is good.');
+INSERT INTO memos (content) VALUES ('Mroonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.');
+SELECT COUNT(*) FROM memos
+WHERE MATCH(content) AGAINST('+Groonga' IN BOOLEAN MODE);
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result
new file mode 100644
index 00000000..36a19589
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_full_text_search_in_natural_language_mode.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+CREATE TABLE memos (
+content TEXT,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO memos (content) VALUES ('Groonga is good.');
+INSERT INTO memos (content) VALUES ('Groonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga is good.');
+INSERT INTO memos (content) VALUES ('Mroonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.');
+SELECT COUNT(*) FROM memos
+WHERE MATCH(content) AGAINST('Groonga');
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result
new file mode 100644
index 00000000..4eba1922
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (1),(2),(3),(4),(5),(6);
+SELECT COUNT(*) FROM users WHERE age > 29;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result
new file mode 100644
index 00000000..4de49651
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_greater_equal.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (1),(2),(3),(4),(5),(6);
+SELECT COUNT(*) FROM users WHERE age >= 29;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result
new file mode 100644
index 00000000..a57a3b8f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+SELECT COUNT(*) FROM users WHERE age < 29;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result
new file mode 100644
index 00000000..c770b63d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_less_equal.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+SELECT COUNT(*) FROM users WHERE age <= 29;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result
new file mode 100644
index 00000000..a1a123e7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+SELECT COUNT(*) FROM users WHERE age <> 29;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 2
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result
new file mode 100644
index 00000000..407347a4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_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/optimization_count_skip_multiple_conditions.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result
new file mode 100644
index 00000000..39a0f0bd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_multiple_conditions.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT,
+age INT,
+INDEX (age)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id, age) VALUES (1, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (3, 29);
+SELECT COUNT(*) FROM users WHERE id = 3 AND age = 29;
+COUNT(*)
+1
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 0
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result
new file mode 100644
index 00000000..26c8b6a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_between.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (32),(33),(34),(35),(36),(37);
+SELECT COUNT(*) FROM users WHERE id BETWEEN 2 AND 4;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result
new file mode 100644
index 00000000..713a19dd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_equal.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+SELECT COUNT(*) FROM users WHERE id = 3;
+COUNT(*)
+1
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result
new file mode 100644
index 00000000..fe9de9e6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (-1),(-2),(-3),(-4);
+SELECT COUNT(*) FROM users WHERE id > 3;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result
new file mode 100644
index 00000000..2fa5213e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_greater_equal.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (-1),(-2),(-3),(-4);
+SELECT COUNT(*) FROM users WHERE id >= 3;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result
new file mode 100644
index 00000000..05afd7e8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+SELECT COUNT(*) FROM users WHERE id < 3;
+COUNT(*)
+2
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 0
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result
new file mode 100644
index 00000000..200f89d3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_less_equal.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+SELECT COUNT(*) FROM users WHERE id <= 3;
+COUNT(*)
+3
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 0
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result
new file mode 100644
index 00000000..1b253a8e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_primary_key_not_equal.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS users;
+FLUSH STATUS;
+CREATE TABLE users (
+id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+SELECT COUNT(*) FROM users WHERE id <> 3;
+COUNT(*)
+4
+SHOW STATUS LIKE 'mroonga_count_skip';
+Variable_name Value
+Mroonga_count_skip 0
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result
new file mode 100644
index 00000000..dcf0f3ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_disabled.result
@@ -0,0 +1,34 @@
+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;
+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_multiple_match_againsts.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result
new file mode 100644
index 00000000..124a7750
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_multiple_match_againsts.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+SET NAMES UTF8;
+CREATE TABLE memos (
+id INT UNSIGNED NOT NULL,
+title VARCHAR(255),
+content TEXT,
+FULLTEXT INDEX(title),
+FULLTEXT INDEX(content)
+) DEFAULT CHARSET UTF8;
+INSERT INTO memos VALUES(5, "title 1", "content a");
+INSERT INTO memos VALUES(12, "title 1", "content a");
+INSERT INTO memos VALUES(10, "title 1", "content a");
+INSERT INTO memos VALUES(4, "title 2", "content b");
+INSERT INTO memos VALUES(6, "title 2", "content b");
+INSERT INTO memos VALUES(1, "title 2", "content b");
+INSERT INTO memos VALUES(11, "title 1-a", "content a-1");
+INSERT INTO memos VALUES(3, "title 2-b", "content a-2");
+INSERT INTO memos VALUES(2, "title 2-c", "content a-3");
+INSERT INTO memos VALUES(8, "title 1-a", "content b-1");
+INSERT INTO memos VALUES(9, "title 2-b", "content b-2");
+INSERT INTO memos VALUES(7, "title 2-c", "content b-3");
+SELECT * FROM memos
+WHERE MATCH(title) AGAINST("+1" IN BOOLEAN MODE) AND
+MATCH(content) AGAINST("+a" IN BOOLEAN MODE)
+ORDER BY id
+LIMIT 1,3;
+id title content
+10 title 1 content a
+11 title 1-a content a-1
+12 title 1 content a
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 0
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result
new file mode 100644
index 00000000..5a0ea86c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_not_optimized_no_limit.result
@@ -0,0 +1,34 @@
+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;
+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_cp932.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result
new file mode 100644
index 00000000..d58c3cf2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_cp932.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+SET NAMES CP932;
+CREATE TABLE memos (
+ʎq INT UNSIGNED,
+e TEXT,
+FULLTEXT INDEX(e),
+KEY(ʎq)
+) DEFAULT CHARSET CP932;
+INSERT INTO memos VALUES(2, "͎RoB");
+INSERT INTO memos VALUES(3, "̓T{eB");
+INSERT INTO memos VALUES(1, "͓VC悭Ă悩B");
+SELECT * FROM memos
+WHERE MATCH(e) AGAINST("" IN BOOLEAN MODE)
+ORDER BY ʎq
+LIMIT 1;
+ʎq e
+1 ͓VC悭Ă悩B
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 1
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result
new file mode 100644
index 00000000..f1cc14b4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..0374f500
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_between_over.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..4bc3f9d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_equal.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..56629777
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..b03fe20f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_greater_than_or_equal.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..c25f2a56
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..ef93bf8b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_datetime_less_than_or_equal.result
@@ -0,0 +1,26 @@
+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;
+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_duplicated_order_by_columns.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result
new file mode 100644
index 00000000..9ea8ea40
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS ids;
+FLUSH STATUS;
+SET NAMES utf8mb4;
+CREATE TABLE ids (
+id int PRIMARY KEY,
+text varchar(32),
+FULLTEXT INDEX (text)
+) DEFAULT CHARSET=utf8mb4;
+INSERT INTO ids VALUES (1, 'first');
+SELECT * FROM ids
+WHERE MATCH(text) AGAINST('+first' IN BOOLEAN MODE)
+ORDER BY id, id
+LIMIT 1;
+id text
+1 first
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 1
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result
new file mode 100644
index 00000000..f20089f0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_name.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+SET NAMES utf8;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+tag ENUM('Groonga', 'Mroonga'),
+content TEXT,
+FULLTEXT INDEX(content),
+KEY(tag),
+KEY(id)
+) DEFAULT CHARSET=utf8;
+INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!');
+INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!');
+INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.');
+INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.');
+SELECT * FROM memos
+WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND
+tag = 'Mroonga'
+ ORDER BY id LIMIT 1;
+id tag content
+4 Mroonga Mroonga is based on Groonga.
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 1
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result
new file mode 100644
index 00000000..88ec9dd8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_enum_value.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+SET NAMES utf8;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+tag ENUM('Groonga', 'Mroonga'),
+content TEXT,
+FULLTEXT INDEX(content),
+KEY(tag),
+KEY(id)
+) DEFAULT CHARSET=utf8;
+INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!');
+INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!');
+INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.');
+INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.');
+SELECT * FROM memos
+WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND
+tag = 2
+ORDER BY id LIMIT 1;
+id tag content
+4 Mroonga Mroonga is based on Groonga.
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 1
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result
new file mode 100644
index 00000000..5c18e22d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_have_primary_key.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..ed86c0e1
--- /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 00000000..a18e2a15
--- /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 00000000..634fe89c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_equal.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..22305c70
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..439f453d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_greater_than_or_equal.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..51ec2fde
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..3c4f3973
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_int_less_than_or_equal.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..03364eb1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_no_primary_key.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..9730069c
--- /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 00000000..a284f4dd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_asc.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..270d2639
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_desc.result
@@ -0,0 +1,30 @@
+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;
+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 00000000..eb19384e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_id.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..80bd895a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_order_by_match_against.result
@@ -0,0 +1,31 @@
+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;
+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 00000000..b3ed4bf6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_select_match_against.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..793423f5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..f50417d1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_between_over.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..26da3500
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_equal.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..342947cc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..adc4ec63
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_greater_than_or_equal.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..2881cc77
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..d1a9fc27
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_time_less_than_or_equal.result
@@ -0,0 +1,26 @@
+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;
+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 00000000..bff0d993
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_with_index.result
@@ -0,0 +1,32 @@
+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;
+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 00000000..cc3173ec
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_varchar_equal_without_index.result
@@ -0,0 +1,31 @@
+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;
+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 00000000..5a1b1bda
--- /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 00000000..b0ad41fb
--- /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 00000000..08db6b38
--- /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 00000000..a33cd484
--- /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 00000000..7d2471b3
--- /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 00000000..cac3d6f4
--- /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 00000000..df57f51e
--- /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/partition_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result
new file mode 100644
index 00000000..0252fd90
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/partition_insert.result
@@ -0,0 +1,42 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs (
+timestamp DATETIME,
+message TEXT
+) DEFAULT CHARSET=UTF8
+PARTITION BY RANGE (TO_DAYS(timestamp)) (
+PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
+PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
+PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
+PARTITION pfuture VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE logs;
+Table Create Table
+logs CREATE TABLE `logs` (
+ `timestamp` datetime DEFAULT NULL,
+ `message` text
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+ PARTITION BY RANGE (TO_DAYS(timestamp))
+(PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga,
+ PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga,
+ PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga,
+ PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga)
+INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-01-31 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-02-28 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-03-31 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-04-30 23:59:59', 'Shutdown');
+SELECT * FROM logs ORDER BY timestamp;
+timestamp message
+2015-01-01 00:00:00 Start
+2015-01-31 23:59:59 Shutdown
+2015-02-01 00:00:00 Start
+2015-02-28 23:59:59 Shutdown
+2015-03-01 00:00:00 Start
+2015-03-31 23:59:59 Shutdown
+2015-04-01 00:00:00 Start
+2015-04-30 23:59:59 Shutdown
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result
new file mode 100644
index 00000000..754c4f98
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result
@@ -0,0 +1,43 @@
+DROP TABLE IF EXISTS logs;
+SET NAMES UTF8;
+CREATE TABLE logs (
+timestamp DATETIME,
+message TEXT
+) DEFAULT CHARSET=UTF8
+PARTITION BY RANGE (TO_DAYS(timestamp)) (
+PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
+PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
+PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
+PARTITION pfuture VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE logs;
+Table Create Table
+logs CREATE TABLE `logs` (
+ `timestamp` datetime DEFAULT NULL,
+ `message` text
+) ENGINE=Mroonga DEFAULT CHARSET=utf8
+PARTITION BY RANGE (TO_DAYS(timestamp))
+(PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga,
+ PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga,
+ PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga,
+ PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga)
+INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
+SELECT * FROM logs ORDER BY timestamp;
+timestamp message
+2015-01-01 00:00:00 Start
+2015-02-01 00:00:00 Start
+2015-03-01 00:00:00 Start
+2015-04-01 00:00:00 Start
+UPDATE logs
+SET message = 'Started'
+ WHERE timestamp < '2015-03-01 00:00:00';
+SELECT * FROM logs ORDER BY timestamp;
+timestamp message
+2015-01-01 00:00:00 Started
+2015-02-01 00:00:00 Started
+2015-03-01 00:00:00 Start
+2015-04-01 00:00:00 Start
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result
new file mode 100644
index 00000000..24d427ed
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result
@@ -0,0 +1,31 @@
+CREATE DATABASE repair_test;
+USE repair_test;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT,
+FULLTEXT INDEX body_index (body)
+) 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(body) AGAINST("+starting" IN BOOLEAN MODE);
+id title body
+2 Groonga (1) starting Groonga...
+FLUSH TABLES;
+SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE);
+ERROR HY000: system call error: No such file or directory: failed to open path: <repair_test.mrn.000010E.c>
+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" IN BOOLEAN MODE);
+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/storage/r/replace_geometry.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result
new file mode 100644
index 00000000..e88a799f
--- /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, ST_AsText(geo) FROM geo_replace;
+id ST_AsText(geo)
+1 POINT(100 100)
+REPLACE INTO geo_replace VALUES(1, POINT(100,200));
+SELECT id, ST_AsText(geo) FROM geo_replace;
+id ST_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, ST_AsText(geo) FROM geo_replace;
+id ST_AsText(geo)
+1 POINT(200 200)
+UPDATE geo_replace SET geo = POINT(200,300);
+SELECT id, ST_AsText(geo) FROM geo_replace;
+id ST_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 00000000..b9aebee3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_select_varchar.result
@@ -0,0 +1,40 @@
+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")
+ORDER BY id;
+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 00000000..c70ce337
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_text.result
@@ -0,0 +1,25 @@
+drop table if exists diaries;
+set names utf8;
+create table diaries (
+id int primary key,
+content text,
+fulltext index (content)
+) 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 00000000..fd2cb655
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_varchar.result
@@ -0,0 +1,25 @@
+drop table if exists diaries;
+set names utf8;
+create table diaries (
+id int primary key,
+content varchar(256),
+fulltext index (content)
+) 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 00000000..3e987631
--- /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/replace_without_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_without_key.result
new file mode 100644
index 00000000..e67f0fe4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_without_key.result
@@ -0,0 +1,10 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES utf8;
+CREATE TABLE diaries (
+id varchar(32) NOT NULL PRIMARY KEY,
+content text,
+FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8;
+REPLACE INTO diaries(content) VALUES("Hello");
+Got one of the listed errors
+DROP TABLE diaries;
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 00000000..18318bdb
--- /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 00000000..e0e3e21c
--- /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 00000000..3732cb28
--- /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 00000000..a111880a
--- /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 age, COUNT(*) FROM users GROUP BY age;
+age COUNT(*)
+20 2
+29 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result
new file mode 100644
index 00000000..93d29c2d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/select_group_by_without_index.result
@@ -0,0 +1,14 @@
+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);
+SELECT age, COUNT(*) FROM users GROUP BY age;
+age COUNT(*)
+20 2
+29 1
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result b/storage/mroonga/mysql-test/mroonga/storage/r/select_pkey.result
new file mode 100644
index 00000000..99f69f49
--- /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 00000000..1c24089e
--- /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 00000000..ef87703e
--- /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 00000000..87c9f4ef
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/sub_query_fulltext.result
@@ -0,0 +1,35 @@
+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;
+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 00000000..0a18d817
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/temporary_table.result
@@ -0,0 +1,14 @@
+DROP TEMPORARY TABLE IF EXISTS diaries;
+CREATE TEMPORARY TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT
+) 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 00000000..3525e235
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/truncate.result
@@ -0,0 +1,47 @@
+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;
+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)
+ORDER BY id;
+id year month day title content
+1 2011 11 9 Hello 今日からはじめました。
+3 2011 11 11 富士山 今日も天気がよくてきれいに見える。
+TRUNCATE TABLE diaries;
+SELECT * FROM diaries;
+id year month day title content
+SELECT * FROM diaries
+WHERE MATCH(content) AGAINST("+今日" IN BOOLEAN MODE)
+ORDER BY id;
+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)
+ORDER BY id;
+id year month day title content
+2 2011 12 1 久しぶり 天気が悪いからずっと留守番。
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result
new file mode 100644
index 00000000..72a913b4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_binlog_row.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS memos;
+SET SESSION binlog_format = 'ROW';
+CREATE TABLE memos (
+title varchar(20) PRIMARY KEY,
+content varchar(140) NOT NULL
+) COLLATE=utf8mb4_general_ci
+DEFAULT CHARSET=utf8mb4;
+INSERT INTO memos (title, content) VALUES ('Mroonga', 'Mroonga is great!');
+SELECT * FROM memos;
+title content
+Mroonga Mroonga is great!
+UPDATE memos SET content = 'Mroonga is very great!' WHERE title = 'Mroonga';
+SELECT * FROM memos;
+title content
+Mroonga Mroonga is very great!
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result b/storage/mroonga/mysql-test/mroonga/storage/r/update_fulltext.result
new file mode 100644
index 00000000..bf81d5e0
--- /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 00000000..35d8843a
--- /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 00000000..dba9c964
--- /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 00000000..e022fa23
--- /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 00000000..af592631
--- /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 00000000..e823e128
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/update_virtual_column.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int, _id int);
+INSERT INTO t1 VALUES(1,null);
+INSERT INTO t1 VALUES(2,null);
+INSERT INTO t1 VALUES(3,null);
+SELECT * FROM t1;
+c1 _id
+1 1
+2 2
+3 3
+SET sql_mode="";
+UPDATE t1 SET _id = 10 WHERE c1 = 1;
+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;
+SET sql_mode=DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_column.result
new file mode 100644
index 00000000..37826335
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_column.result
@@ -0,0 +1,18 @@
+SET @mroonga_boolean_mode_syntax_flags_backup =
+@@mroonga_boolean_mode_syntax_flags;
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN";
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+content TEXT,
+FULLTEXT KEY (title),
+FULLTEXT KEY (content)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
+SELECT * FROM diaries
+WHERE MATCH(title) AGAINST("content:@Hello" IN BOOLEAN MODE);
+title content
+Groonga Hello Groonga
+DROP TABLE diaries;
+SET mroonga_boolean_mode_syntax_flags =
+@mroonga_boolean_mode_syntax_flags_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_leading_not.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_leading_not.result
new file mode 100644
index 00000000..d3ccb150
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_leading_not.result
@@ -0,0 +1,16 @@
+SET @mroonga_boolean_mode_syntax_flags_backup =
+@@mroonga_boolean_mode_syntax_flags;
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_LEADING_NOT";
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES("Groonga");
+INSERT INTO diaries VALUES("Mroonga");
+SELECT * FROM diaries WHERE MATCH(title) AGAINST("-Groonga" IN BOOLEAN MODE);
+title
+Mroonga
+DROP TABLE diaries;
+SET mroonga_boolean_mode_syntax_flags =
+@mroonga_boolean_mode_syntax_flags_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_update.result
new file mode 100644
index 00000000..55cd8742
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_allow_update.result
@@ -0,0 +1,18 @@
+SET @mroonga_boolean_mode_syntax_flags_backup =
+@@mroonga_boolean_mode_syntax_flags;
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN,ALLOW_UPDATE";
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+content TEXT,
+FULLTEXT KEY (title),
+FULLTEXT KEY (content)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
+SELECT * FROM diaries
+WHERE MATCH(title) AGAINST('content:="Hello Mroonga"' IN BOOLEAN MODE);
+title content
+Groonga Hello Mroonga
+DROP TABLE diaries;
+SET mroonga_boolean_mode_syntax_flags =
+@mroonga_boolean_mode_syntax_flags_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_query.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_query.result
new file mode 100644
index 00000000..5736fd52
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_query.result
@@ -0,0 +1,15 @@
+SET @mroonga_boolean_mode_syntax_flags_backup =
+@@mroonga_boolean_mode_syntax_flags;
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY";
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES("Re:Mroonga");
+SELECT * FROM diaries WHERE MATCH(title) AGAINST("Re:Mroonga" IN BOOLEAN MODE);
+title
+Re:Mroonga
+DROP TABLE diaries;
+SET mroonga_boolean_mode_syntax_flags =
+@mroonga_boolean_mode_syntax_flags_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_script.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_script.result
new file mode 100644
index 00000000..e42fa259
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_boolean_mode_syntax_flags_syntax_script.result
@@ -0,0 +1,16 @@
+SET @mroonga_boolean_mode_syntax_flags_backup =
+@@mroonga_boolean_mode_syntax_flags;
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_SCRIPT";
+SET NAMES UTF8;
+CREATE TABLE diaries (
+title TEXT,
+FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+INSERT INTO diaries VALUES("Re:Mroonga");
+SELECT * FROM diaries
+WHERE MATCH(title) AGAINST("title @ 'Re:Mroonga'" IN BOOLEAN MODE);
+title
+Re:Mroonga
+DROP TABLE diaries;
+SET mroonga_boolean_mode_syntax_flags =
+@mroonga_boolean_mode_syntax_flags_backup;
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 00000000..beca93b6
--- /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;
+SET GLOBAL mroonga_database_path_prefix = NULL;
+USE test;
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 00000000..959383ee
--- /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 00000000..7f441b4b
--- /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_default_tokenizer_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result
new file mode 100644
index 00000000..1f457eb5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_new_value.result
@@ -0,0 +1,6 @@
+SET @mroonga_default_tokenizer_backup = @@mroonga_default_tokenizer;
+SET GLOBAL mroonga_default_tokenizer = "TokenBigramSplitAlpha";
+SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer';
+Variable_name Value
+mroonga_default_tokenizer TokenBigramSplitAlpha
+SET GLOBAL mroonga_default_tokenizer = @mroonga_default_tokenizer_backup;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result
new file mode 100644
index 00000000..9ad80e9a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_same_value.result
@@ -0,0 +1,4 @@
+SET GLOBAL mroonga_default_tokenizer = "TokenBigram";
+SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer';
+Variable_name Value
+mroonga_default_tokenizer TokenBigram
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result
new file mode 100644
index 00000000..4238cb63
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_delete.result
@@ -0,0 +1,20 @@
+drop table if exists diaries;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+) 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 00000000..429398f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_insert.result
@@ -0,0 +1,22 @@
+drop table if exists diaries;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+) 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 00000000..9cd6f5c9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_dry_write_update.result
@@ -0,0 +1,18 @@
+drop table if exists diaries;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+) 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_enable_operations_recording_insert.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result
new file mode 100644
index 00000000..5a19ab6f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_enable_operations_recording_insert.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+title TEXT
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command('truncate mroonga_operations');
+mroonga_command('truncate mroonga_operations')
+true
+INSERT INTO diaries VALUES("Unlogged: Research for Mroonga");
+SELECT mroonga_command('load --table mroonga_operations --values "[{}]"');
+mroonga_command('load --table mroonga_operations --values "[{}]"')
+1
+SELECT mroonga_command('select mroonga_operations --output_columns _id');
+mroonga_command('select mroonga_operations --output_columns _id')
+[[[1],[["_id","UInt32"]],[2]]]
+SET GLOBAL mroonga_enable_operations_recording = false;
+FLUSH TABLES;
+SELECT mroonga_command('truncate mroonga_operations');
+mroonga_command('truncate mroonga_operations')
+true
+INSERT INTO diaries VALUES("Logged: Research for Mroonga");
+SELECT mroonga_command('load --table mroonga_operations --values "[{}]"');
+mroonga_command('load --table mroonga_operations --values "[{}]"')
+1
+SELECT mroonga_command('select mroonga_operations --output_columns _id');
+mroonga_command('select mroonga_operations --output_columns _id')
+[[[1],[["_id","UInt32"]],[1]]]
+DROP TABLE diaries;
+SELECT mroonga_command('truncate mroonga_operations');
+mroonga_command('truncate mroonga_operations')
+true
+SET GLOBAL mroonga_enable_operations_recording = default;
+FLUSH TABLES;
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 00000000..789316d8
--- /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 00000000..029b1ab1
--- /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 00000000..f47a2e66
--- /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 00000000..6ec1004f
--- /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 00000000..db469479
--- /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 00000000..1dbec1f8
--- /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 00000000..5824f090
--- /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 00000000..cb646ece
--- /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 00000000..19abff38
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_global.result
@@ -0,0 +1,24 @@
+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 'tokenizer "TokenDelimit"'
+) 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 00000000..30e9262b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_match_escalation_threshold_session.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+tags TEXT,
+FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) 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_max_n_records_for_estimate_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result
new file mode 100644
index 00000000..0181fe02
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+SET GLOBAL mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index
+SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result
new file mode 100644
index 00000000..ff574f7b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+SET GLOBAL mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE ids NULL range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using index
+Warnings:
+Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 5)
+SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result
new file mode 100644
index 00000000..5ecf8969
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT,
+INDEX (id)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+DELETE FROM ids WHERE id < 2;
+SET mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 0;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE ids NULL range id id 5 NULL 1 100.00 Using where; Using index
+Warnings:
+Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 0)
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result
new file mode 100644
index 00000000..b28eac5a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+SET mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE ids NULL range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using index
+Warnings:
+Note 1003 /* select#1 */ select `test`.`ids`.`id` AS `id` from `test`.`ids` where (`test`.`ids`.`id` > 5)
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result
new file mode 100644
index 00000000..d318a654
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_not_found_in_limit.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT,
+INDEX (id)
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4),(5),(6),(7);
+DELETE FROM ids WHERE id < 2;
+SET mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE ids range id id 5 NULL 1 Using where; Using index
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result
new file mode 100644
index 00000000..aca9d75c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+SET mroonga_max_n_records_for_estimate = 1;
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result
new file mode 100644
index 00000000..3d7f36d1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_empty_value.result
@@ -0,0 +1,9 @@
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = "";
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log file is still disabled
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result
new file mode 100644
index 00000000..aed9d91a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_disabled_null_value.result
@@ -0,0 +1,9 @@
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = NULL;
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log file is still disabled
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result
new file mode 100644
index 00000000..22ac271e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_empty_value.result
@@ -0,0 +1,10 @@
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = "";
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log file is disabled: <groonga-query.log>
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result
new file mode 100644
index 00000000..3921fb16
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_enabled_null_value.result
@@ -0,0 +1,10 @@
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = NULL;
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log file is disabled: <groonga-query.log>
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result
new file mode 100644
index 00000000..7b1be136
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_new_value.result
@@ -0,0 +1,9 @@
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file groonga-query.log
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log is enabled: <groonga-query.log>
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result
new file mode 100644
index 00000000..adf3d1bf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_query_log_file_same_value.result
@@ -0,0 +1,10 @@
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+SHOW GLOBAL VARIABLES LIKE "mroonga_query_log_file";
+Variable_name Value
+mroonga_query_log_file groonga-query.log
+log file is changed: <groonga.log> -> <groonga-query-log.log>
+query log file isn't changed because the requested path isn't different: <groonga-query.log>
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
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 00000000..f3c8f1e8
--- /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.in b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result.in
new file mode 100644
index 00000000..26ff300a
--- /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 00000000..d5a1e519
--- /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 00000000..7e4f8c17
--- /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 { not $::opt_embedded_server }
+
+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 00000000..0e348f26
--- /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 <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries ADD title VARCHAR(40) 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 00000000..4375a6f1
--- /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 <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries ADD title VARCHAR(40) 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_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test
new file mode 100644
index 00000000..ec9e3c9d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_comment.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 --dump_plugins no");
+
+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_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test
new file mode 100644
index 00000000..e3b7df72
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_flags_parameter.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--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) FLAGS='COLUMN_VECTOR';
+SHOW CREATE TABLE tags;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_groonga_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test
new file mode 100644
index 00000000..964426b4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_comment.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 'groonga_type "tags"';
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_groonga_type_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test
new file mode 100644
index 00000000..0f92c024
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_groonga_type_parameter.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--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) GROONGA_TYPE='tags';
+SHOW CREATE TABLE bugs;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test
new file mode 100644
index 00000000..0516186b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_cp932.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES cp932;
+
+CREATE TABLE users (
+ id int PRIMARY KEY
+) DEFAULT CHARSET=cp932;
+ALTER TABLE users
+ ADD COLUMN O text,
+ ADD FULLTEXT INDEX (O);
+
+INSERT INTO users VALUES (1, "܂");
+INSERT INTO users VALUES (2, "Ȃ");
+INSERT INTO users VALUES (3, "");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test
new file mode 100644
index 00000000..0ed92333
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multibyte_utf8.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE users (
+ id int PRIMARY KEY
+) DEFAULT CHARSET=utf8;
+ALTER TABLE users
+ ADD COLUMN 名前 text,
+ ADD FULLTEXT INDEX (名前);
+
+INSERT INTO users VALUES (1, "やまだ");
+INSERT INTO users VALUES (2, "たなか");
+INSERT INTO users VALUES (3, "すずき");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_multiple.test
new file mode 100644
index 00000000..a76869ac
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title) VALUES ("survey");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries
+ ADD COLUMN body VARCHAR(140) 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 00000000..3e21daab
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title) VALUES ("survey");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries ADD COLUMN body VARCHAR(140);
+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_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test
new file mode 100644
index 00000000..54fb986a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_type_comment.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 --dump_plugins no");
+
+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_index_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test
new file mode 100644
index 00000000..8a63885a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL
+) DEFAULT CHARSET=utf8;
+
+ALTER TABLE memos ADD FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"';
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test
new file mode 100644
index 00000000..bfc527c9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_duplicated.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO ids (id) values (1), (1);
+
+--error ER_DUP_UNIQUE
+ALTER TABLE ids ADD UNIQUE INDEX (id);
+SHOW CREATE TABLE ids;
+
+SELECT * FROM ids;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test
new file mode 100644
index 00000000..dccba803
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_unique_multiple_column_duplicated.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id1 INT,
+ id2 INT
+) DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO ids (id1, id2) values (1, 2), (1, 2);
+
+--error ER_DUP_UNIQUE
+ALTER TABLE ids ADD UNIQUE INDEX (id1, id2);
+SHOW CREATE TABLE ids;
+
+SELECT * FROM ids;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
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 00000000..a7d9c4a4
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_add_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test
new file mode 100644
index 00000000..a1cf13c2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT NOT NULL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+
+ALTER TABLE ids ADD PRIMARY KEY (id);
+SHOW CREATE TABLE ids;
+
+SELECT * FROM ids WHERE id = 2;
+
+DROP TABLE ids;
+
+--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 00000000..3f7aea2a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..0fb3f176
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..70cf4d14
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries CHANGE body description VARCHAR(140) 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 00000000..b959d30e
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries CHANGE body description VARCHAR(140) 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 00000000..fa97b30d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries
+ CHANGE body description VARCHAR(140) FIRST,
+ CHANGE title subject VARCHAR(40) AFTER internal_id,
+ CHANGE id internal_id INT AUTO_INCREMENT;
+SHOW CREATE TABLE diaries;
+
+INSERT IGNORE 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 00000000..3e02a644
--- /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 <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+ALTER TABLE diaries CHANGE body description VARCHAR(140);
+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_decimal.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test
new file mode 100644
index 00000000..d8775f07
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_decimal.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ temperature DECIMAL(6, 3)
+) ENGINE InnoDB DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (temperature) VALUES (21.281);
+SELECT * FROM diaries;
+
+ALTER TABLE diaries ENGINE = mroonga;
+SELECT * FROM diaries;
+
+INSERT INTO diaries (temperature) VALUES (14.213);
+INSERT INTO diaries (temperature) VALUES (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_change_engine_fulltext_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test
new file mode 100644
index 00000000..b9dfddda
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_engine_fulltext_index.test
@@ -0,0 +1,58 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+SELECT table_name, engine
+ FROM information_schema.tables
+ WHERE table_name = 'diaries';
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga...");
+SELECT * FROM diaries
+ WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND
+ MATCH(body) AGAINST("groonga" IN BOOLEAN MODE);
+
+ALTER TABLE diaries ENGINE = mroonga;
+SELECT table_name, engine
+ FROM information_schema.tables
+ WHERE table_name = '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_change_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test
new file mode 100644
index 00000000..8efaad2a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL PRIMARY KEY,
+ is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"';
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+ALTER TABLE memos DISABLE KEYS;
+ALTER TABLE memos ENABLE KEYS;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_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 00000000..ed3d4a13
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test
new file mode 100644
index 00000000..83ce2ca7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+CREATE TABLE terms (
+ term varchar(256) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
+ DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ content text NOT NULL,
+ FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+ALTER TABLE memos DISABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_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 00000000..f612272f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..999415b1
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d0e7e0e8
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..e8140ff5
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..390afd98
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8b3e0928
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..94a3de4b
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d640249d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) 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 00000000..9544eb90
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) 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 00000000..8596e18f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_drop_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test
new file mode 100644
index 00000000..e12e5b8d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+
+ALTER TABLE ids DROP PRIMARY KEY;
+SHOW CREATE TABLE ids;
+
+SELECT * FROM ids WHERE id = 2;
+
+DROP TABLE ids;
+
+--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 00000000..e7f9f548
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test
new file mode 100644
index 00000000..424e51ad
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+CREATE TABLE terms (
+ term varchar(256) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"'
+ DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ content text NOT NULL,
+ FULLTEXT INDEX content_index (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+ALTER TABLE memos DISABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+ALTER TABLE memos ENABLE KEYS;
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_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 00000000..c5889caf
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..e7f9f548
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7ae83d84
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..012fae91
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9817aa94
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_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 00000000..41fae0e7
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..dab39fc8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_fulltext_add_normal.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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);
+
+SELECT * FROM memos WHERE MATCH(content) AGAINST("+groonga" IN BOOLEAN MODE);
+
+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 00000000..fd2a6008
--- /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 <hayashi@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU 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-1335 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 00000000..d59e24f4
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fb967163
--- /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 <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries MODIFY body VARCHAR(140) 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 00000000..86d22e3c
--- /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 <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries MODIFY body VARCHAR(140) 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 00000000..d39b4fc9
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ body VARCHAR(140)
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE diaries;
+
+INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga.");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries MODIFY 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 00000000..93210e13
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_recreate_anonymous_index_at_once.test
@@ -0,0 +1,48 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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);
+
+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 00000000..1102144b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_rename_table.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+SELECT table_name, engine
+ FROM information_schema.tables
+ WHERE table_name = 'diaries';
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+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");
+
+SELECT table_name, engine
+ FROM information_schema.tables
+ WHERE table_name = '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 00000000..2581fa7c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test
@@ -0,0 +1,151 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ name VARCHAR(40),
+ location GEOMETRY NOT NULL
+);
+
+INSERT INTO shops (name, location)
+ VALUES ('nezu-no-taiyaki',
+ ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+ VALUES ('taiyaki-kataoka',
+ ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+ VALUES ('soba-taiyaki-ku',
+ ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuruma',
+ ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+ VALUES ('hirose-ya',
+ ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+ VALUES ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+ VALUES ('omede-taiyaki',
+ ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+ VALUES ('onaga-ya',
+ ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+ VALUES ('shiro-ya',
+ ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+ VALUES ('fuji-ya',
+ ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+ VALUES ('miyoshi',
+ ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+ VALUES ('juju-ya',
+ ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+ VALUES ('tatsumi-ya',
+ ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+ VALUES ('tetsuji',
+ ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+ VALUES ('gazuma-ya',
+ ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+ VALUES ('honma-mon',
+ ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+ VALUES ('naniwa-ya',
+ ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuro-dai',
+ ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+ VALUES ('daruma',
+ ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+ VALUES ('yanagi-ya',
+ ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+ VALUES ('sharaku',
+ ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+ VALUES ('takane',
+ ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+ VALUES ('chiyoda',
+ ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+ VALUES ('da-ka-po',
+ ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+ VALUES ('matsushima-ya',
+ ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+ VALUES ('kazuya',
+ ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+ VALUES ('furuya-kogane-an',
+ ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+ VALUES ('hachi-no-ie',
+ ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+ VALUES ('azuki-chan',
+ ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuriko-an',
+ ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+ VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+ VALUES ('naze-ya',
+ ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+ VALUES ('sanoki-ya',
+ ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+ VALUES ('shigeta',
+ ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+ VALUES ('nishimi-ya',
+ ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+ VALUES ('hiiragi',
+ ST_GeomFromText('POINT(139.711517 35.647701)'));
+
+ALTER TABLE shops ADD SPATIAL KEY location_index (location);
+
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ 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 00000000..34a517f9
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f5de201d
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a23e09de
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/auto_increment_text.test
@@ -0,0 +1,33 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..281617e3
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/check_table_broken.test b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test
new file mode 100644
index 00000000..d438a912
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_broken.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET NAMES UTF8;
+
+CREATE DATABASE check_test;
+USE check_test;
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT INDEX (title)
+);
+
+INSERT INTO diaries VALUES ('Hello');
+
+--remove_file $MYSQLD_DATADIR/check_test.mrn.000010C
+
+FLUSH TABLES;
+
+CHECK TABLE diaries;
+
+REPAIR TABLE diaries;
+DROP TABLE diaries;
+
+DROP DATABASE check_test;
+USE test;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test
new file mode 100644
index 00000000..c3f24494
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/check_table_not_broken.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ title TEXT
+);
+
+INSERT INTO diaries VALUES ('Hello');
+
+CHECK TABLE diaries;
+
+SELECT * FROM diaries;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_general_ci_french.test
new file mode 100644
index 00000000..1139d5eb
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_520_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test
new file mode 100644
index 00000000..e0480fb5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test
@@ -0,0 +1,36 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8mb4;
+CREATE TABLE diaries (
+ content varchar(256) COLLATE utf8mb4_unicode_520_ci,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO diaries VALUES ("Je suis un garçon.");
+
+SELECT * FROM diaries WHERE MATCH (content) AGAINST ("+garcon" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test
new file mode 100644
index 00000000..a23126c3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8mb4;
+CREATE TABLE diaries (
+ content varchar(256) COLLATE utf8mb4_unicode_520_ci,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。");
+
+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/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 00000000..2fbf5da8
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bc598fea
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..c21ce814
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f0d4aebf
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..ef53212b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_with_index.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ 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 00000000..63a2a39d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_without_index.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(40),
+ 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 00000000..8b069cab
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_date_zero_date.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2013 Kentoku SHIBA
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATE
+) DEFAULT CHARSET UTF8;
+SHOW CREATE TABLE timestamps;
+
+SET sql_mode = '';
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01");
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00");
+SET sql_mode = DEFAULT;
+
+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 00000000..c9308b95
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_2038.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('2038-01-18 03:14:07', '2038-01-18 03:14:07');
+INSERT IGNORE 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 00000000..5a6cee77
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_before_unix_epoch.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT IGNORE 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 00000000..502d261c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_max.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT IGNORE 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 00000000..aa0bf65d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_32bit_out_of_range.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT IGNORE 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 00000000..9c2a4d92
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_2038.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('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 00000000..942a8cc5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_before_unix_epoch.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('1000-01-02 00:00:00', '1000-01-02 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 00000000..e1df8812
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_max.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('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_strict_sql_mode_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test
new file mode 100644
index 00000000..ba01e892
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_strict_sql_mode_out_of_range.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+--error ER_TRUNCATED_WRONG_VALUE
+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_5_5_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.test
new file mode 100644
index 00000000..e3115505
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_5_out_of_range.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_version_5_5.inc
+--source ../../include/mroonga/have_mysql.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('2012', '2012');
+
+SELECT * FROM diaries;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test
new file mode 100644
index 00000000..cfd370ae
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_64bit_version_5_6_or_later_out_of_range.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ created_at DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries (title, created_at)
+ VALUES ('2012', '2012');
+
+SELECT * FROM diaries;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test
new file mode 100644
index 00000000..7cf8be3f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_with_index.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..2b3865f3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_fractional_seconds_without_index.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..cebffc7e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_freebsd_before_unix_epoch.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_mariadb_10_2_or_later_zero_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test
new file mode 100644
index 00000000..6cd65be5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_date.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb_10_2_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+
+SELECT * FROM timestamps;
+
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test
new file mode 100644
index 00000000..8639e9ff
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mariadb_10_2_or_later_zero_month_day.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2013 Kentoku SHIBA
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb_10_2_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+
+SELECT * FROM timestamps;
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test
new file mode 100644
index 00000000..e4ed57dc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_date.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+
+SELECT * FROM timestamps;
+
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test
new file mode 100644
index 00000000..e2fd01b1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_mysql_5_7_or_later_zero_month_day.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2013 Kentoku SHIBA
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+
+SELECT * FROM timestamps;
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test
new file mode 100644
index 00000000..e51a6623
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_null.test
@@ -0,0 +1,36 @@
+# 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-1335 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;
+
+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 00000000..f93bffd9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_with_index.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..0df1be26
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_without_index.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..b0c0e11a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_date.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+SET sql_mode='STRICT_TRANS_TABLES';
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO timestamps (create_dt) VALUES ("0000-00-00 00:00:00");
+SET sql_mode=default;
+
+SELECT * FROM timestamps;
+
+INSERT INTO timestamps (create_dt) VALUES ("2015-06-17 00:00:00");
+SELECT * FROM timestamps;
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test
new file mode 100644
index 00000000..f3ec9465
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_datetime_zero_month_day.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2013 Kentoku SHIBA
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS timestamps;
+--enable_warnings
+
+CREATE TABLE timestamps (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ create_dt DATETIME
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO timestamps (create_dt) VALUES ("2012-00-01 00:00:00");
+INSERT INTO timestamps (create_dt) VALUES ("2012-01-00 00:00:00");
+
+SELECT * FROM timestamps;
+
+SELECT * FROM timestamps WHERE create_dt = "2012-01-01 00:00:00";
+
+DROP TABLE timestamps;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test
new file mode 100644
index 00000000..cf201088
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_with_index.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..83fd7564
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_fractional_seconds_without_index.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..315846cc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_with_index.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..6924885f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_decimal_without_index.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..ae85ae7a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..91daafed
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_generated_stored_add_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test
new file mode 100644
index 00000000..5dc58df1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+set names utf8mb4;
+
+CREATE TABLE logs (
+ id INT,
+ record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (1, json_object('message', repeat('☹', 253)));
+
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
+ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';
+
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test
new file mode 100644
index 00000000..f8e658f0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_delete.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+DELETE FROM logs WHERE id = 1;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test
new file mode 100644
index 00000000..342f954b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_drop_column.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DROP COLUMN message;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test
new file mode 100644
index 00000000..009b519a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_insert.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test
new file mode 100644
index 00000000..18c624a3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_reindex.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DISABLE KEYS;
+ALTER TABLE logs ENABLE KEYS;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test
new file mode 100644
index 00000000..07b987ce
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_update.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test
new file mode 100644
index 00000000..ffbe2415
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_add_column.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL;
+
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test
new file mode 100644
index 00000000..8e110a23
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_delete.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+DELETE FROM logs WHERE id = 1;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test
new file mode 100644
index 00000000..2b723d46
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_drop_column.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DROP COLUMN message;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test
new file mode 100644
index 00000000..7cb6895a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_insert.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test
new file mode 100644
index 00000000..ca9bb7a4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_add_index.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb_10_2_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+--error 16509
+ALTER TABLE logs ADD INDEX (message);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test
new file mode 100644
index 00000000..49bc21c9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mariadb_10_2_or_later_create_table_with_index.test
@@ -0,0 +1,32 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb_10_2_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+--error 16509
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL,
+ FULLTEXT INDEX (message)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test
new file mode 100644
index 00000000..c624566c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_mysql_5_7_or_later_add_index.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+ALTER TABLE logs ADD INDEX (message);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test
new file mode 100644
index 00000000..76d80420
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_virtual_update.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga__id__id.test
new file mode 100644
index 00000000..17a69b3e
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1d30d0ec
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d171d062
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_other_table.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+CREATE TABLE terms (
+ name VARCHAR(64) PRIMARY KEY
+) DEFAULT CHARSET=utf8
+ COMMENT='default_tokenizer "TokenBigram"';
+
+CREATE TABLE bugs (
+ id INT UNSIGNED PRIMARY KEY,
+ title TEXT,
+ FULLTEXT INDEX (title) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO bugs (id, title) VALUES (1, "Mroonga can't build with MySQL X.Y.Z");
+
+SELECT * FROM terms ORDER BY name;
+
+SELECT *, MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
+ FROM bugs
+ WHERE MATCH (title) AGAINST ("+MySQL" IN BOOLEAN MODE);
+
+DROP TABLE bugs;
+DROP TABLE terms;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test
new file mode 100644
index 00000000..c23f35ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 --dump_plugins no --dump_records no");
+
+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 00000000..9e128a00
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 --dump_plugins no --dump_records no");
+
+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 00000000..359dbbda
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_reference.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_support_lz4.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test
new file mode 100644
index 00000000..f0362241
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_lz4.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/support_libgroonga_lz4.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test
new file mode 100644
index 00000000..612b2d6a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zlib.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/support_libgroonga_zlib.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test
new file mode 100644
index 00000000..74b79210
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_support_zstd.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/support_libgroonga_zstd.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test
new file mode 100644
index 00000000..73f15477
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_lz4.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/unsupport_libgroonga_lz4.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_LZ4"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test
new file mode 100644
index 00000000..6d97eb5a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zlib.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/unsupport_libgroonga_zlib.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZLIB"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test
new file mode 100644
index 00000000..b9a5dce5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_unsupport_zstd.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/unsupport_libgroonga_zstd.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS entries;
+--enable_warnings
+
+CREATE TABLE entries (
+ id INT UNSIGNED PRIMARY KEY,
+ content TEXT COMMENT 'flags "COLUMN_SCALAR|COMPRESS_ZSTD"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO entries (id, content) VALUES (1, "I found Mroonga that is a MySQL storage engine to use Groonga!");
+
+SELECT * FROM entries;
+
+DROP TABLE entries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_scalar_with_not_for_mroonga_comment.test
new file mode 100644
index 00000000..bd5894f6
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1787c111
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..29ccc4e8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_vector_reference.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 VARCHAR(128) DEFAULT '' COMMENT 'flags "COLUMN_VECTOR", type "tags"'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE bugs;
+
+INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
+
+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 00000000..758f01cf
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_json_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test
new file mode 100644
index 00000000..9e031a3a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_json_insert.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO logs VALUES ('{"message": "start"}');
+INSERT INTO logs VALUES ('{"message": "restart"}');
+INSERT INTO logs VALUES ('{"message": "shutdown"}');
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test
new file mode 100644
index 00000000..be26045a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_cp932.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES cp932;
+
+CREATE TABLE users (
+ O text,
+ FULLTEXT INDEX (O)
+) DEFAULT CHARSET=cp932;
+
+INSERT INTO users VALUES ("܂");
+INSERT INTO users VALUES ("Ȃ");
+INSERT INTO users VALUES ("");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test
new file mode 100644
index 00000000..efbaf31f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_multibyte_utf8.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE users (
+ 名前 text,
+ FULLTEXT INDEX (名前)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO users VALUES ("やまだ");
+INSERT INTO users VALUES ("たなか");
+INSERT INTO users VALUES ("すずき");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_set_16_with_index.test
new file mode 100644
index 00000000..c1f7fa3d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..0b02b5e6
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2dd39e8d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..117be846
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..001f4a4a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..4587be4d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..18f52ac0
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..0d37290f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..ba6b4388
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5978564a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..05afa745
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_fractional_seconds_with_index.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..b6de0404
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_time_with_index.test
@@ -0,0 +1,48 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..c4f1980a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_fractional_seconds_with_index.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mariadb_5_5.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;
+
+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 00000000..1410b4c3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_timestamp_with_index.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 DEFAULT '2016-04-21 00:00:00',
+ updated_at TIMESTAMP DEFAULT '2016-04-21 00:00:00',
+ KEY (updated_at)
+) 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;
+
+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 00000000..08884ae5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_tinyint_without_index.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..dee9bcb2
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..be97f2da
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..52c98463
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..940695ca
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2e941449
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..72d436b1
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..799fcb29
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_with_index.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..49aa1eaf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_year_without_index.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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/count_star.test b/storage/mroonga/mysql-test/mroonga/storage/t/count_star.test
new file mode 100644
index 00000000..f20499ef
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/count_star.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id int PRIMARY KEY
+);
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+
+SELECT COUNT(*) FROM ids;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test
new file mode 100644
index 00000000..52a1162b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_database_name_slash.test
@@ -0,0 +1,60 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..51eb67ec
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_TODO_SPLIT_ME.test
@@ -0,0 +1,149 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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);
+# For MariaDB 10.2.3
+-- replace_result current_timestamp() CURRENT_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_column_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test
new file mode 100644
index 00000000..6bafebd8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_comment.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 bugs (
+ id INT UNSIGNED PRIMARY KEY,
+ tags TEXT COMMENT 'flags "COLUMN_VECTOR"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test
new file mode 100644
index 00000000..3baa576a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_flags_parameter.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--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 bugs (
+ id INT UNSIGNED PRIMARY KEY,
+ tags TEXT FLAGS='COLUMN_VECTOR'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_groonga_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test
new file mode 100644
index 00000000..28f0f214
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_comment.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 'groonga_type "tags"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_groonga_type_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test
new file mode 100644
index 00000000..e27f169b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_nonexistent.test
@@ -0,0 +1,29 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS bugs;
+--enable_warnings
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE bugs (
+ id INT UNSIGNED PRIMARY KEY,
+ tag VARCHAR(64) COMMENT 'groonga_type "Nonexistent"'
+) DEFAULT CHARSET=utf8mb4;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test
new file mode 100644
index 00000000..a6642872
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_groonga_type_parameter.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--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) GROONGA_TYPE='tags'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE bugs;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_column_type_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test
new file mode 100644
index 00000000..bd4b268b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_comment.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 --dump_plugins no");
+
+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_column_type_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test
new file mode 100644
index 00000000..08792d20
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_column_type_nonexistent.test
@@ -0,0 +1,29 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS bugs;
+--enable_warnings
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE bugs (
+ id INT UNSIGNED PRIMARY KEY,
+ tag VARCHAR(64) COMMENT 'type "Nonexistent"'
+) DEFAULT CHARSET=utf8mb4;
+
+--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 00000000..8badcf84
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_comment_normal.test
@@ -0,0 +1,34 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..ade4099a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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
+ COMMENT='default_tokenizer "TokenDelimit"';
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_index_flags_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test
new file mode 100644
index 00000000..e0273d17
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_comment.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei SUtou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test
new file mode 100644
index 00000000..d1abc4a0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_medium.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ content_size INT NOT NULL,
+ KEY (content_size) COMMENT 'flags "INDEX_MEDIUM"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test
new file mode 100644
index 00000000..a519eca4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_index_small.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ is_read BOOL NOT NULL,
+ KEY (is_read) COMMENT 'flags "INDEX_SMALL"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test
new file mode 100644
index 00000000..b5615ff4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei SUtou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'flags "NONE"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test
new file mode 100644
index 00000000..5524c7ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_parameter.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei SUtou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) FLAGS='WITH_POSITION|WITH_WEIGHT'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test
new file mode 100644
index 00000000..3852ebd1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_none.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test
new file mode 100644
index 00000000..f557c5f3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_index_flags_with_position_and_with_weight.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test
new file mode 100644
index 00000000..33d1bfda
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_comment.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_index_normalizer_fulltext_index_bin.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test
new file mode 100644
index 00000000..7b3673ae
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_fulltext_index_bin.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE diaries (
+ day DATE PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+INSERT INTO diaries VALUES ("2013-04-23", "ブラックコーヒーを飲んだ。");
+
+SELECT * FROM diaries
+ WHERE MATCH (content) AGAINST ("+ふらつく" IN BOOLEAN MODE);
+SELECT * FROM diaries
+ WHERE MATCH (content) AGAINST ("+ブラック" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test
new file mode 100644
index 00000000..4997dbf7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_index_bin.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE diaries (
+ day DATE PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test
new file mode 100644
index 00000000..5e7c67fe
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_no_utf8_charset_with_utf8_normalizer.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_index_normalizer_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test
new file mode 100644
index 00000000..9bffd2c3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_none.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE diaries (
+ day DATE PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'normalizer "none"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES ("2013-04-23", "Mroonga");
+
+SELECT * FROM diaries
+ WHERE MATCH (content) AGAINST ("+Mroonga" IN BOOLEAN MODE);
+SELECT * FROM diaries
+ WHERE MATCH (content) AGAINST ("+mroonga" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test
new file mode 100644
index 00000000..489e82ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_normalizer_parameter.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) NORMALIZER='NormalizerAuto'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test
new file mode 100644
index 00000000..82d68ae5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_comment.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ FULLTEXT INDEX body_index (body)
+ COMMENT 'parser "TokenBigramSplitSymbolAlphaDigit"'
+) 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;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("+start" IN BOOLEAN MODE)
+ ORDER BY id;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test
new file mode 100644
index 00000000..773c740b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_default.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+drop table if exists diaries;
+--enable_warnings
+
+set @mroonga_default_tokenizer_backup=@@mroonga_default_tokenizer;
+set global mroonga_default_tokenizer=TokenBigramSplitSymbolAlphaDigit;
+create table diaries (
+ id int primary key auto_increment,
+ body text,
+ fulltext index body_index (body)
+) 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;
+select * from diaries where match(body) against("+start" IN BOOLEAN MODE) order by id;
+drop table diaries;
+set global mroonga_default_tokenizer=@mroonga_default_tokenizer_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test
new file mode 100644
index 00000000..f62a6a0f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_parser_off.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.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;
+
+INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix");
+INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer");
+INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine");
+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/create_table_index_token_filters_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test
new file mode 100644
index 00000000..f7add5db
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_multiple_token_filters.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test
new file mode 100644
index 00000000..2fc98e61
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_one_token_filter.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test
new file mode 100644
index 00000000..aaf60b02
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_token_filters_parameter.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) TOKEN_FILTERS='TokenFilterStopWord,TokenFilterStopWord'
+) DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test
new file mode 100644
index 00000000..0d640c84
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_comment.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) 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;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("+start" IN BOOLEAN MODE)
+ ORDER BY id;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test
new file mode 100644
index 00000000..773c740b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_default.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+drop table if exists diaries;
+--enable_warnings
+
+set @mroonga_default_tokenizer_backup=@@mroonga_default_tokenizer;
+set global mroonga_default_tokenizer=TokenBigramSplitSymbolAlphaDigit;
+create table diaries (
+ id int primary key auto_increment,
+ body text,
+ fulltext index body_index (body)
+) 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;
+select * from diaries where match(body) against("+start" IN BOOLEAN MODE) order by id;
+drop table diaries;
+set global mroonga_default_tokenizer=@mroonga_default_tokenizer_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test
new file mode 100644
index 00000000..698202a6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_off.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2013-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--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 'tokenizer "off"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO variables (name) VALUES ("mroonga_database_path_prefix");
+INSERT INTO variables (name) VALUES ("mroonga_default_tokenizer");
+INSERT INTO variables (name) VALUES ("mroonga_default_wrapper_engine");
+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/create_table_index_tokenizer_parameter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test
new file mode 100644
index 00000000..1bf4dc10
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_tokenizer_parameter.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.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) TOKENIZER='TokenBigramSplitSymbolAlphaDigit'
+) 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;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("+start" IN BOOLEAN MODE)
+ ORDER BY id;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test
new file mode 100644
index 00000000..c4b6fe84
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_default.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+DROP TABLE IF EXISTS terms;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL PRIMARY KEY
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_table_normalizer_hash.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test
new file mode 100644
index 00000000..42521f1d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_normalizer_hash.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+DROP TABLE IF EXISTS terms;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL,
+ PRIMARY KEY (term) USING HASH
+) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_table_token_filters_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test
new file mode 100644
index 00000000..dc0996d2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_multiple_token_filters.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL PRIMARY KEY,
+ is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord,TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_table_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test
new file mode 100644
index 00000000..ee1da6d0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_one_token_filter.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL PRIMARY KEY,
+ is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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_table_token_filters_stop_word.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test
new file mode 100644
index 00000000..87a35657
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_table_token_filters_stop_word.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+CREATE TABLE terms (
+ term VARCHAR(64) NOT NULL PRIMARY KEY,
+ is_stop_word BOOL NOT NULL
+) COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"' DEFAULT CHARSET=utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'table "terms"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO terms VALUES ("and", true);
+
+INSERT INTO memos VALUES (1, "Hello");
+INSERT INTO memos VALUES (2, "Hello and Good-bye");
+INSERT INTO memos VALUES (3, "Good-bye");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+\"Hello and\"" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+DROP TABLE terms;
+
+--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 00000000..de2b24cf
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..be739549
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f42651cd
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5bbc7979
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..b9e23e64
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..056dcae0
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f7bc51db
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_database_no_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test
new file mode 100644
index 00000000..db4a9a03
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/drop_database_no_table.test
@@ -0,0 +1,57 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP DATABASE IF EXISTS another;
+--enable_warnings
+
+CREATE DATABASE another;
+USE another;
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT INDEX (title)
+);
+
+DROP TABLE diaries;
+
+
+USE test;
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT INDEX (title)
+);
+
+
+DROP DATABASE another;
+
+SELECT mroonga_command('object_exist mroonga_operations');
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/drop_table_TODO_SPLIT_ME.test
new file mode 100644
index 00000000..e672f80f
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5cb3894a
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_alter_add.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test
new file mode 100644
index 00000000..03d05fe1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_add.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2013 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/skip_mariadb_10_1.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+--enable_warnings
+
+CREATE TABLE comments (
+ comment int unsigned PRIMARY KEY,
+ content text NOT NULL
+);
+
+CREATE TABLE articles (
+ content text NOT NULL,
+ comment int unsigned
+);
+
+ALTER TABLE articles ADD FOREIGN KEY (comment) REFERENCES comments (comment);
+
+SHOW CREATE TABLE articles;
+
+SELECT * FROM information_schema.referential_constraints;
+
+DROP TABLE articles;
+DROP TABLE comments;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test
new file mode 100644
index 00000000..d6ef43fa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_alter_drop.test
@@ -0,0 +1,48 @@
+# 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-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/skip_mariadb_10_1.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+--enable_warnings
+
+CREATE TABLE comments (
+ comment int unsigned PRIMARY KEY,
+ content text NOT NULL
+);
+
+CREATE TABLE articles (
+ content text NOT NULL,
+ comment int unsigned,
+ FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+
+ALTER TABLE articles DROP FOREIGN KEY comment;
+
+SHOW CREATE TABLE articles;
+
+SELECT * FROM information_schema.referential_constraints;
+
+DROP TABLE articles;
+DROP TABLE comments;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test
new file mode 100644
index 00000000..4efd2052
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2013 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/skip_mariadb_10_1.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+--enable_warnings
+
+CREATE TABLE comments (
+ comment int unsigned PRIMARY KEY,
+ content text NOT NULL
+);
+
+CREATE TABLE articles (
+ content text NOT NULL,
+ comment int unsigned,
+ FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+
+SHOW CREATE TABLE articles;
+
+SELECT * FROM information_schema.referential_constraints;
+
+DROP TABLE articles;
+DROP TABLE comments;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test
new file mode 100644
index 00000000..37405696
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_existent.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+--error ER_ROW_IS_REFERENCED_2
+DELETE FROM comments WHERE id = 100;
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test
new file mode 100644
index 00000000..9322876b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_delete_nonexistent.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO comments (id, content) VALUES (200, 'Very good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+DELETE FROM comments WHERE id = 200;
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test
new file mode 100644
index 00000000..283efbd3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_existent.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test
new file mode 100644
index 00000000..4b873f50
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_insert_nonexistent.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 1);
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test
new file mode 100644
index 00000000..d445731b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_rename.test
@@ -0,0 +1,51 @@
+# 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-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/skip_mariadb_10_1.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS articles;
+DROP TABLE IF EXISTS comments;
+DROP TABLE IF EXISTS articles2;
+DROP TABLE IF EXISTS comments2;
+--enable_warnings
+
+CREATE TABLE comments (
+ comment int unsigned PRIMARY KEY,
+ content text NOT NULL
+);
+
+CREATE TABLE articles (
+ content text NOT NULL,
+ comment int unsigned,
+ FOREIGN KEY (comment) REFERENCES comments (comment)
+);
+
+RENAME TABLE comments TO comments2;
+RENAME TABLE articles TO articles2;
+
+SHOW CREATE TABLE articles2;
+
+SELECT * FROM information_schema.referential_constraints;
+
+DROP TABLE articles2;
+DROP TABLE comments2;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test
new file mode 100644
index 00000000..fc3590f3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_existent.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO comments (id, content) VALUES (200, 'Very good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+UPDATE entries SET comment_id = 200 WHERE content = 'Hello!';
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test
new file mode 100644
index 00000000..bcba6e75
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_update_nonexistent.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_5.inc
+--source ../../include/mroonga/skip_mariadb_5_5.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_warnings
+
+CREATE TABLE comments (
+ id int unsigned PRIMARY KEY,
+ content varchar(140) NOT NULL
+);
+
+CREATE TABLE entries (
+ content varchar(140) NOT NULL,
+ comment_id int unsigned,
+ FOREIGN KEY (comment_id) REFERENCES comments (id)
+);
+
+INSERT INTO comments (id, content) VALUES (100, 'Good entry!');
+INSERT INTO entries (content, comment_id) VALUES ('Hello!', 100);
+--error ER_NO_REFERENCED_ROW_2
+UPDATE entries SET comment_id = 200 WHERE content = 'Hello!';
+
+SELECT * FROM entries;
+SELECT * FROM comments;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE entries;
+DROP TABLE comments;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_empty_query.test
new file mode 100644
index 00000000..07470050
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..50cb1282
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_escape.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = 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_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test
new file mode 100644
index 00000000..bfe2cdc0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_leading_not.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test
new file mode 100644
index 00000000..fe904693
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--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,
+ title VARCHAR(255),
+ content TEXT,
+ FULLTEXT INDEX (title, content)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO memos VALUES(1, "Groonga", "Groonga is fast.");
+INSERT INTO memos VALUES(2, "Mroonga", "Mroonga is also fast.");
+INSERT INTO memos VALUES(3, "Rroonga", "Rroonga is also fast.");
+
+SELECT *,
+ MATCH(title, content)
+ AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE) AS score
+ FROM memos
+ WHERE MATCH(title, content)
+ AGAINST("*W1:10,2:2DOR Groonga Mroonga" 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_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 00000000..af142c8d
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9c04d835
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d1996f54
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a4c90fdd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY content;
+
+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 00000000..6ac03531
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY content;
+
+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 00000000..24681974
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY content;
+
+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 00000000..3e91ba89
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_astarisk.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test
new file mode 100644
index 00000000..bfe8bb11
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_default_operator_plus_with_astarisk.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 fi*" 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 00000000..eafacedb
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8b7bb2e1
--- /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 <kou@clear-code.com>
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_syntax_script_operator.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test
new file mode 100644
index 00000000..3630052a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_operator.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8;
+CREATE TABLE diaries (
+ id INT PRIMARY KEY,
+ title VARCHAR(255),
+ content TEXT,
+ FULLTEXT INDEX (title, content)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。");
+INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について");
+INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。");
+
+SELECT *, MATCH(title, content)
+ AGAINST("*SS content @ '天気'" in BOOLEAN MODE) AS score
+ FROM diaries
+ WHERE MATCH(title, content)
+ AGAINST("*SS content @ '天気'" in BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test
new file mode 100644
index 00000000..21d53b39
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_syntax_script_selector.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2016 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+DROP TABLE IF EXISTS readings;
+--enable_warnings
+
+SET NAMES utf8;
+CREATE TABLE readings (
+ reading VARCHAR(255) PRIMARY KEY
+) DEFAULT CHARSET=utf8
+ COLLATE=utf8_bin
+ COMMENT='default_tokenizer "TokenDelimit"';
+
+CREATE TABLE items (
+ name VARCHAR(255) PRIMARY KEY,
+ readings TEXT COMMENT 'flags "COLUMN_VECTOR", type "readings"',
+ FULLTEXT INDEX items_index(readings) COMMENT 'table "readings"'
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO items VALUES("日本", "ニホン ニッポン");
+INSERT INTO items VALUES("ローマ字", "ローマジ");
+INSERT INTO items VALUES("漢字", "カンジ");
+
+SELECT *, MATCH(readings)
+ AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE) AS score
+ FROM items
+ WHERE MATCH(readings)
+ AGAINST("*SS sub_filter(readings, 'prefix_rk_search(_key, \"niho\")')" in BOOLEAN MODE);
+
+DROP TABLE items;
+DROP TABLE readings;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_weight_full_spec.test
new file mode 100644
index 00000000..b8aa91ec
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..30ba517a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..96fefd3e
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2a8e1c19
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..87cd8de6
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..83990fdc
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = 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_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_error_and_log.test
new file mode 100644
index 00000000..494bf760
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = 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_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore.test
new file mode 100644
index 00000000..828726d0
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = 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_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_syntax_error_ignore_and_log.test
new file mode 100644
index 00000000..d9a0adac
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = 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_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_ascii.test
new file mode 100644
index 00000000..3cf85e35
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..301a85c1
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..985ce19d
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d1d80170
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9492b33b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_charset_utf8mb4.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..048fcd1c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_empty_query.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..08acc357
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_found_rows.test
@@ -0,0 +1,48 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..4b113946
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_groonga_varchar_vector.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1846e37b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_index_recreate.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+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 00000000..c43341f7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test
@@ -0,0 +1,41 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+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 00000000..e133073e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_values.test
@@ -0,0 +1,32 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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));
+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 00000000..c5199ee5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_delete.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+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 00000000..799b9c81
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_insert.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+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 00000000..36dcb6c0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_recreate.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..d84888f9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_column_index_update.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+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 00000000..7b04e9a6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_multiple_index.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..aca6a6a0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_no_primary_key.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..b99abc8b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_not_match_against.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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" in boolean mode) order by c1;
+select * from t1 where not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where match(c3) against("+dummy" in boolean mode) order by c1;
+select * from t1 where not match(c3) against("+dummy" in boolean mode) order by c1;
+select * from t1 where c1 = 4 and not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where c1 <= 4 and not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where c1 > 4 and not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where c2 = 10 and not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where c2 >= 15 and not match(c3) against("+uu" in boolean mode) order by c1;
+select * from t1 where c2 < 15 and not match(c3) against("+uu" in boolean mode) order by c1;
+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 00000000..ad93bdd7
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_boolean_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test
new file mode 100644
index 00000000..90b8bc8f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_boolean_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test
new file mode 100644
index 00000000..fbcbce13
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_boolean_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test
new file mode 100644
index 00000000..a421a31b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_boolean_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test
new file mode 100644
index 00000000..3dbaa6bf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_order_natural_language_mode_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test
new file mode 100644
index 00000000..4a3af371
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) ASC;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test
new file mode 100644
index 00000000..fb45c0c6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) DESC;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test
new file mode 100644
index 00000000..8af0e41e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ WHERE MATCH(message) AGAINST("Error Warning" IN NATURAL LANGUAGE MODE)
+ ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test
new file mode 100644
index 00000000..6c7eb0a6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ host TEXT,
+ FULLTEXT KEY (message),
+ FULLTEXT KEY (host)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error", "host1");
+INSERT INTO logs VALUES("Warning Warning Warning", "host1");
+INSERT INTO logs VALUES("Error Error", "host2");
+INSERT INTO logs VALUES("Warning Warning", "host2");
+INSERT INTO logs VALUES("Error", "host2");
+INSERT INTO logs VALUES("Warning", "host2");
+INSERT INTO logs VALUES("Error Error Error Error", "host2");
+INSERT INTO logs VALUES("Warning Warning Warning Warning", "host2");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ ORDER BY MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test
new file mode 100644
index 00000000..917d437d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test
new file mode 100644
index 00000000..b4dd8ade
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015 Kouhei Sutou
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs(
+ message TEXT,
+ FULLTEXT KEY (message)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO logs VALUES("Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning");
+INSERT INTO logs VALUES("Error Error");
+INSERT INTO logs VALUES("Warning Warning");
+INSERT INTO logs VALUES("Error");
+INSERT INTO logs VALUES("Warning");
+INSERT INTO logs VALUES("Error Error Error Error");
+INSERT INTO logs VALUES("Warning Warning Warning Warning");
+
+SELECT * FROM logs;
+
+SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score
+ FROM logs
+ WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE)
+ ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE);
+
+DROP TABLE logs;
+
+--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 00000000..538b741f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_two_inner_join.test
@@ -0,0 +1,69 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_10_0_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test
new file mode 100644
index 00000000..606e0c0f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_10_0_no_such_key.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_10_0.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_5_5_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test
new file mode 100644
index 00000000..311a623b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_5_no_such_key.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_5.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_5_6_no_such_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test
new file mode 100644
index 00000000..d51636cb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_version_5_6_no_such_key.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_5_6.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_auto-escape.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test
new file mode 100644
index 00000000..e40a703b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_auto-escape.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES('It is Groonga');
+INSERT INTO diaries VALUES('It is Mroonga');
+
+SELECT mroonga_command('select',
+ 'table', 'diaries',
+ 'filter', 'title @ "Groonga"');
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test
new file mode 100644
index 00000000..5ba0ca77
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_select.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+# 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-1335 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_command_special-database-name.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test
new file mode 100644
index 00000000..720c547c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_command_special-database-name.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS `db-1`;
+CREATE DATABASE `db-1`;
+USE `db-1`;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command('dump --dump_plugins no');
+
+DROP TABLE diaries;
+
+--disable_query_log
+USE test;
+DROP DATABASE `db-1`;
+--enable_query_log
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_error_query_is_missing.test
new file mode 100644
index 00000000..ee0b4833
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8023de1d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f9cbf025
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_query_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test
new file mode 100644
index 00000000..9ed61499
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_all.test
@@ -0,0 +1,26 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_query_custom.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test
new file mode 100644
index 00000000..5d1555cb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_custom.test
@@ -0,0 +1,26 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_query_join.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test
new file mode 100644
index 00000000..8f0090fd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_join.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+DROP TABLE IF EXISTS queries;
+--enable_warnings
+
+CREATE TABLE users (
+ id INT
+);
+
+CREATE TABLE queries (
+ user_id INT,
+ query TEXT
+);
+
+INSERT INTO users VALUES (1);
+INSERT INTO users VALUES (2);
+INSERT INTO users VALUES (3);
+
+INSERT INTO queries VALUES (1, '(a)');
+INSERT INTO queries VALUES (2, '(b)');
+INSERT INTO queries VALUES (3, '(c)');
+
+SELECT users.id, mroonga_escape(queries.query) AS escaped_query
+ FROM queries
+ LEFT JOIN users ON users.id = queries.user_id
+ ORDER BY users.id;
+
+DROP TABLE queries;
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test
new file mode 100644
index 00000000..bab9f917
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_match_against.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET GLOBAL mroonga_default_tokenizer = TokenDelimit;
+
+SET NAMES utf8mb4;
+CREATE TABLE memos (
+ id INT PRIMARY KEY,
+ content TEXT,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO memos VALUES(1, "(Groonga) Installed!");
+INSERT INTO memos VALUES(2, "(Mroonga) Installed!");
+INSERT INTO memos VALUES(3, "(Groonga) Upgraded!");
+
+SELECT * FROM memos
+ WHERE MATCH(content) AGAINST(mroonga_escape("(groonga)") IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+SET GLOBAL mroonga_default_tokenizer = TokenBigram;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test
new file mode 100644
index 00000000..8c7776a2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_named.test
@@ -0,0 +1,26 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+SELECT mroonga_escape('+-><~*()\"\\:' AS query) AS escaped_query;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test
new file mode 100644
index 00000000..ed8e77cb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_query_nested.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_escape_script_decimal.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test
new file mode 100644
index 00000000..d8d97996
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_decimal.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS data;
+--enable_warnings
+
+CREATE TABLE data (
+ value DECIMAL(5, 3)
+);
+
+INSERT INTO data VALUES (2.9);
+
+SELECT mroonga_escape(value AS script)
+ FROM data;
+
+DROP TABLE data;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test
new file mode 100644
index 00000000..51c1df9d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_integer.test
@@ -0,0 +1,26 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+SELECT mroonga_escape(-29 AS script) AS escaped_query;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test
new file mode 100644
index 00000000..10859733
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_real.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS data;
+--enable_warnings
+
+CREATE TABLE data (
+ value REAL
+);
+
+INSERT INTO data VALUES (2.9);
+
+SELECT mroonga_escape(value AS script)
+ FROM data;
+
+DROP TABLE data;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test
new file mode 100644
index 00000000..46c3b558
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_escape_script_string.test
@@ -0,0 +1,26 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+SELECT mroonga_escape('a\"\\\'z' AS script) AS escaped_query;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test
new file mode 100644
index 00000000..3958782a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_dynamic_keyword.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS keywords;
+--enable_query_log
+--enable_warnings
+
+CREATE TABLE keywords (
+ keyword text
+);
+
+INSERT INTO keywords VALUES ('Mroonga');
+INSERT INTO keywords VALUES ('Groonga');
+
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+ keyword) AS highlighted
+ FROM keywords;
+
+--disable_query_log
+DROP TABLE keywords;
+--enable_query_log
+
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test
new file mode 100644
index 00000000..533bf1c2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_japanese.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ 'ロック', '更新') AS highlighted;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test
new file mode 100644
index 00000000..98643876
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_multiple_keywords.test
@@ -0,0 +1,25 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+ 'Mroonga', 'Groonga') AS highlighted;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test
new file mode 100644
index 00000000..83e5966d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_normalizer.test
@@ -0,0 +1,25 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_highlight_html('Mroonga is the Groonga based storage engine.',
+ 'mroonga') AS highlighted;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test
new file mode 100644
index 00000000..e632f027
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ 'ロック 更新 -ボトルネック' AS query) AS highlighted;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test
new file mode 100644
index 00000000..f17aa0f7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_query_pragma.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2017-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_highlight_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ '*D- +ロック +更新 ボトルネック' AS query) AS highlighted;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test
new file mode 100644
index 00000000..07b1273e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_highlight_html_record.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS memos;
+--enable_query_log
+--enable_warnings
+
+CREATE TABLE memos (
+ content text
+);
+
+INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL.
+
+By using Mroonga, you can use Groonga with SQL.');
+
+INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.');
+
+INSERT INTO memos VALUES ('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.');
+
+SELECT mroonga_highlight_html(content, 'Mroonga') AS highlighted
+ FROM memos;
+
+--disable_query_log
+DROP TABLE memos;
+--enable_query_log
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_last_insert_grn_id.test
new file mode 100644
index 00000000..b6bced16
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a287da00
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..acb253a4
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_normalize_default.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test
new file mode 100644
index 00000000..aa2eee53
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_default.test
@@ -0,0 +1,24 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_normalize('aBcAbC㍑');
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test
new file mode 100644
index 00000000..bb9199f0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_normalizer.test
@@ -0,0 +1,24 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_normalize('aBcAbC㍑', "NormalizerAuto");
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test
new file mode 100644
index 00000000..b67ff53a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_normalize_record.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS memos;
+--enable_query_log
+--enable_warnings
+
+CREATE TABLE memos (
+ content text
+);
+
+INSERT INTO memos VALUES ('aBcAbC㍑');
+
+SELECT mroonga_normalize(content) FROM memos;
+
+--disable_query_log
+DROP TABLE memos;
+--enable_query_log
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test
new file mode 100644
index 00000000..8b0ae025
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_multiple.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS synonyms;
+--enable_warnings
+
+CREATE TABLE synonyms (
+ term varchar(255),
+ synonym varchar(255),
+ INDEX (term)
+);
+
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+INSERT INTO synonyms VALUES ('Mroonga', 'Mroonga');
+INSERT INTO synonyms VALUES ('Mroonga', 'Groonga MySQL');
+
+SELECT mroonga_query_expand('synonyms',
+ 'term',
+ 'synonym',
+ 'Mroonga Rroonga PGroonga') AS query;
+
+DROP TABLE synonyms;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test
new file mode 100644
index 00000000..400503ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_no_index.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS synonyms;
+--enable_warnings
+
+CREATE TABLE synonyms (
+ term varchar(255),
+ synonym varchar(255)
+);
+
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+
+SELECT mroonga_query_expand('synonyms',
+ 'term',
+ 'synonym',
+ 'Mroonga Rroonga PGroonga') AS query;
+
+DROP TABLE synonyms;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test
new file mode 100644
index 00000000..22241f6b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_one.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS synonyms;
+--enable_warnings
+
+CREATE TABLE synonyms (
+ term varchar(255),
+ synonym varchar(255),
+ INDEX (term)
+);
+
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+
+SELECT mroonga_query_expand('synonyms',
+ 'term',
+ 'synonym',
+ 'Mroonga Rroonga PGroonga') AS query;
+
+DROP TABLE synonyms;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test
new file mode 100644
index 00000000..3627a2c4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_query_expand_pragma.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES UTF8;
+
+--disable_warnings
+DROP TABLE IF EXISTS synonyms;
+--enable_warnings
+
+CREATE TABLE synonyms (
+ term varchar(255),
+ synonym varchar(255),
+ INDEX (term)
+);
+
+INSERT INTO synonyms VALUES ('D+', '[D+]');
+INSERT INTO synonyms VALUES ('Rroonga', 'Rroonga');
+INSERT INTO synonyms VALUES ('Rroonga', 'Groonga Ruby');
+
+SELECT mroonga_query_expand('synonyms',
+ 'term',
+ 'synonym',
+ '*D+ Mroonga Rroonga PGroonga') AS query;
+
+DROP TABLE synonyms;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_ascii.test
new file mode 100644
index 00000000..72da393f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 0, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_general_ci', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'ascii_bin', 1, 1, '...', '...<br>\n', 'bb', '<span class="w1">', '</span>', 'ff', '<span class="w2">', '</span>', 'dd', '<span class="w3">', '</span>') 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 00000000..afaa4368
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 0, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_japanese_ci', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'cp932_bin', 1, 1, '...', '...<br>\n', 'QX', '<span class="w1">', '</span>', 'VC', '<span class="w2">', '</span>', 'xmR', '<span class="w3">', '</span>') 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 00000000..cd59a216
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 0, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_japanese_ci', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'eucjpms_bin', 1, 1, '...', '...<br>\n', '', '<span class="w1">', '</span>', 'ŷ', '<span class="w2">', '</span>', 'ٻλ', '<span class="w3">', '</span>') 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_html_dynamic_keyword.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test
new file mode 100644
index 00000000..a92e651c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_dynamic_keyword.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS keywords;
+--enable_query_log
+--enable_warnings
+
+CREATE TABLE keywords (
+ keyword text
+);
+
+INSERT INTO keywords VALUES ('Mroonga');
+INSERT INTO keywords VALUES ('Groonga');
+
+SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.',
+ keyword) as snippet
+ FROM keywords;
+
+--disable_query_log
+DROP TABLE keywords;
+--enable_query_log
+
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test
new file mode 100644
index 00000000..fcc5a0fc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_japanese.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ 'ロック', '更新') as snippet;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test
new file mode 100644
index 00000000..54953ebe
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_keywords.test
@@ -0,0 +1,25 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_snippet_html('Mroonga is the Groonga based storage engine.',
+ 'Mroonga', 'Groonga') as snippet;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test
new file mode 100644
index 00000000..9aac07a0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_multiple_snippets.test
@@ -0,0 +1,29 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SELECT mroonga_snippet_html('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.',
+ 'lock') as snippet;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test
new file mode 100644
index 00000000..d441b0ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ 'ロック 更新 -ボトルネック' AS query) as snippet;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test
new file mode 100644
index 00000000..0aa115d7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_query_pragma.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+SET NAMES utf8;
+
+SELECT mroonga_snippet_html('Mroongaには2つの動作モードがあります。
+
+1つが「ストレージモード」で、データストアも検索機能もすべてGroongaを使うモードです。これがデフォルトのモードです。上述の参照ロックフリーなGroongaの性能特性をフルに活かした高速なデータ更新・全文検索・位置情報検索が特長です。一方、トランザクションなどの機能は提供されません。
+
+もう1つが「ラッパーモード」で、MyISAMやInnoDBといった他のストレージエンジンに 全文検索機能だけ を追加するモードです。このモードではトランザクションなど他のストレージエンジンがサポートしている機能に加えてGroongaの高速な全文検索機能を利用することができます。一方、Groongaの参照ロックフリーな特性は活かすことができません。また、更新処理は他のストレージエンジンがボトルネックになることが多いでしょう。',
+ '*D- +ロック +更新 ボトルネック' AS query) as snippet;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test
new file mode 100644
index 00000000..c25d140c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_html_record.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS memos;
+--enable_query_log
+--enable_warnings
+
+CREATE TABLE memos (
+ content text
+);
+
+INSERT INTO memos VALUES ('Mroonga is a MySQL storage engine based on Groonga, the full text search engine.
+
+In MySQL 5.1 or later, Pluggable Storage Engine interface is introduced, and we can use custom storage engines easily. So we implement Mroonga, so that we can use Groonga through MySQL.
+
+By using Mroonga, you can use Groonga with SQL.');
+
+INSERT INTO memos VALUES ('Since Tritonn was the modified version of MySQL, we need to build it by ourselves or use binary files provided by Tritonn project, thus we cannot use the official binary files provided by MySQL.
+
+On the other hand, Mroonga is an independent program (shared library) using Pluggable Storage Engine interface, and we can dynamically load it on MySQL''s official binary. So we can use it more easily than Tritonn.');
+
+INSERT INTO memos VALUES ('Mroonga has two running modes.
+
+One is "storage mode", that is the default mode, and we use Groonga for both storing data and searching. With this mode, you can have full benefits of Groonga described above, like fast data update, lock-free full text search and geolocation search. But it does not support transactions.
+
+Another one is "wrapper mode", that adds full text search function on other storage engines like MyISAM or InnoDB. With this mode, you can use Groonga''s fast full text search with having the benefits of the storage engine, ex. transaction in InnoDB. But you cannot have benefits from Groonga''s read-lock free characteristic. And you might have the performance bottle neck in the storage engine in updating data.');
+
+SELECT mroonga_snippet_html(content, 'Mroonga') as snippet
+ FROM memos;
+
+--disable_query_log
+DROP TABLE memos;
+--enable_query_log
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test b/storage/mroonga/mysql-test/mroonga/storage/t/function_snippet_invalid_nonexistent_charset.test
new file mode 100644
index 00000000..c6b19acd
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7182dfbc
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..dfa373dc
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 0, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_general_ci', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') from t1;
+select c1, c2, mroonga_snippet(c3, 10, 2, 'utf8_bin', 1, 1, '...', '...<br>\n', '29日', '<span class="w1">', '</span>', '天気', '<span class="w2">', '</span>', '富士山', '<span class="w3">', '</span>') 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 00000000..160fbf53
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test
@@ -0,0 +1,36 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ location GEOMETRY NOT NULL
+);
+
+INSERT IGNORE INTO shops VALUES (NULL), (NULL);
+
+SELECT ST_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 00000000..7b4bd34d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test
@@ -0,0 +1,154 @@
+# Copyright(C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/skip_mysql_5_7.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ name TEXT,
+ location GEOMETRY NOT NULL,
+ SPATIAL KEY location_index (location)
+);
+
+INSERT INTO shops (name, location)
+ VALUES ('nezu-no-taiyaki',
+ ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+ VALUES ('taiyaki-kataoka',
+ ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+ VALUES ('soba-taiyaki-ku',
+ ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuruma',
+ ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+ VALUES ('hirose-ya',
+ ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+ VALUES ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+ VALUES ('omede-taiyaki',
+ ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+ VALUES ('onaga-ya',
+ ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+ VALUES ('shiro-ya',
+ ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+ VALUES ('fuji-ya',
+ ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+ VALUES ('miyoshi',
+ ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+ VALUES ('juju-ya',
+ ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+ VALUES ('tatsumi-ya',
+ ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+ VALUES ('tetsuji',
+ ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+ VALUES ('gazuma-ya',
+ ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+ VALUES ('honma-mon',
+ ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+ VALUES ('naniwa-ya',
+ ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuro-dai',
+ ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+ VALUES ('daruma',
+ ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+ VALUES ('yanagi-ya',
+ ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+ VALUES ('sharaku',
+ ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+ VALUES ('takane',
+ ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+ VALUES ('chiyoda',
+ ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+ VALUES ('da-ka-po',
+ ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+ VALUES ('matsushima-ya',
+ ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+ VALUES ('kazuya',
+ ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+ VALUES ('furuya-kogane-an',
+ ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+ VALUES ('hachi-no-ie',
+ ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+ VALUES ('azuki-chan',
+ ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuriko-an',
+ ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+ VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+ VALUES ('naze-ya',
+ ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+ VALUES ('sanoki-ya',
+ ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+ VALUES ('shigeta',
+ ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+ VALUES ('nishimi-ya',
+ ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+ VALUES ('hiiragi',
+ ST_GeomFromText('POINT(139.711517 35.647701)'));
+
+SELECT id, name, ST_AsText(location) AS location_text FROM shops;
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ ORDER BY id;
+
+EXPLAIN
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ ORDER BY id;
+
+DROP TABLE shops;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test
new file mode 100644
index 00000000..5664bc4b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_bulk_insert_null.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ location GEOMETRY NOT NULL
+);
+
+--error ER_BAD_NULL_ERROR
+INSERT INTO shops VALUES (NULL), (NULL);
+
+SELECT ST_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_strict_sql_mode_contains.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test
new file mode 100644
index 00000000..a337ac6a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_strict_sql_mode_contains.test
@@ -0,0 +1,152 @@
+# Copyright(C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ name TEXT,
+ location GEOMETRY NOT NULL,
+ SPATIAL KEY location_index (location)
+);
+
+INSERT INTO shops (name, location)
+ VALUES ('nezu-no-taiyaki',
+ ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+ VALUES ('taiyaki-kataoka',
+ ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+ VALUES ('soba-taiyaki-ku',
+ ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuruma',
+ ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+ VALUES ('hirose-ya',
+ ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+ VALUES ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+ VALUES ('omede-taiyaki',
+ ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+ VALUES ('onaga-ya',
+ ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+ VALUES ('shiro-ya',
+ ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+ VALUES ('fuji-ya',
+ ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+ VALUES ('miyoshi',
+ ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+ VALUES ('juju-ya',
+ ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+ VALUES ('tatsumi-ya',
+ ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+ VALUES ('tetsuji',
+ ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+ VALUES ('gazuma-ya',
+ ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+ VALUES ('honma-mon',
+ ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+ VALUES ('naniwa-ya',
+ ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuro-dai',
+ ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+ VALUES ('daruma',
+ ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+ VALUES ('yanagi-ya',
+ ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+ VALUES ('sharaku',
+ ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+ VALUES ('takane',
+ ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+ VALUES ('chiyoda',
+ ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+ VALUES ('da-ka-po',
+ ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+ VALUES ('matsushima-ya',
+ ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+ VALUES ('kazuya',
+ ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+ VALUES ('furuya-kogane-an',
+ ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+ VALUES ('hachi-no-ie',
+ ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+ VALUES ('azuki-chan',
+ ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuriko-an',
+ ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+ VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+ VALUES ('naze-ya',
+ ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+ VALUES ('sanoki-ya',
+ ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+ VALUES ('shigeta',
+ ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+ VALUES ('nishimi-ya',
+ ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+ VALUES ('hiiragi',
+ ST_GeomFromText('POINT(139.711517 35.647701)'));
+
+SELECT id, name, ST_AsText(location) AS location_text FROM shops;
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ ORDER BY id;
+
+EXPLAIN
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location)
+ ORDER BY id;
+
+DROP TABLE shops;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/i_s.test b/storage/mroonga/mysql-test/mroonga/storage/t/i_s.test
new file mode 100644
index 00000000..fdb8e205
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/i_s.test
@@ -0,0 +1,23 @@
+# Copyright (c) 2019, MariaDB
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+SHOW CREATE TABLE INFORMATION_SCHEMA.MROONGA_STATS;
+
+--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 00000000..0b16dfbd
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..c27e05a7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_time.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..c7b57f49
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_btree_equal_timestamp.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a922bc03
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f385fb28
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fa22ab1f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_id_primary.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH);
+
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 VALUES(null, 100);
+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 00000000..0a39b8d4
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..341873ee
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_hash_strict_sql_mode_id_primary.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test
new file mode 100644
index 00000000..0f27d333
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_hash_strict_sql_mode_id_primary.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2016-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (_id int, a int, PRIMARY KEY (_id) USING HASH);
+
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 VALUES(null, 100);
+--error 1265
+INSERT INTO t1 VALUES(1,100);
+--error 1265
+INSERT INTO t1 VALUES(1,100);
+--error 1265
+INSERT INTO t1 VALUES(1,100);
+--error 1265
+INSERT INTO t1 VALUES(1,100);
+
+SELECT * FROM t1;
+SELECT * FROM t1 WHERE _id = 2;
+SELECT * FROM t1 WHERE _id = 20;
+
+DROP TABLE t1;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test
new file mode 100644
index 00000000..9507b395
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_delete.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..b1095ae0
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..3f43db0c
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..31e5a791
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9340c784
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..3787489e
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_order_by_where_equal_asc_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test
new file mode 100644
index 00000000..e4f07494
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_asc_asc.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ score3 INT,
+ INDEX (score1, score2, score3)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100);
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100);
+
+SELECT *
+ FROM items
+ WHERE score1 = 2
+ ORDER BY score2 ASC, score3 ASC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test
new file mode 100644
index 00000000..1d636391
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_order_by_where_equal_desc_desc.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ score3 INT,
+ INDEX (score1, score2, score3)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, -100);
+INSERT INTO items (score1, score2, score3) VALUES(1, 10, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 10, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 30, 100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, -100);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 0);
+INSERT INTO items (score1, score2, score3) VALUES(2, 20, 100);
+
+SELECT *
+ FROM items
+ WHERE score1 = 2
+ ORDER BY score2 DESC, score3 DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_delete.test
new file mode 100644
index 00000000..19fd3c1f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..092b9ad9
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_strict_sql_mode_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test
new file mode 100644
index 00000000..e99db080
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_strict_sql_mode_update.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2011-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS scores;
+--enable_warnings
+
+SET NAMES utf8;
+CREATE TABLE scores (
+ name char(30) NOT NULL,
+ score int NOT NULL,
+ PRIMARY KEY (name, score)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10);
+
+SELECT * FROM scores;
+
+--error 1265
+UPDATE scores SET name = "Taro Yamada"
+ WHERE name = "Jiro Yamada" AND score = 27;
+
+SELECT * FROM scores
+ WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+
+DROP TABLE scores;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test
new file mode 100644
index 00000000..e4a38ea0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_primary_update.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2011-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_strict_sql_mode.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS scores;
+--enable_warnings
+
+SET NAMES utf8;
+CREATE TABLE scores (
+ name char(30) NOT NULL,
+ score int NOT NULL,
+ PRIMARY KEY (name, score)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 29);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", -12);
+INSERT INTO scores (name, score) VALUES ("Jiro Yamada", 27);
+INSERT INTO scores (name, score) VALUES ("Taro Yamada", 10);
+
+SELECT * FROM scores;
+
+UPDATE scores SET name = "Taro Yamada"
+ WHERE name = "Jiro Yamada" AND score = 27;
+
+SELECT * FROM scores
+ WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
+
+DROP TABLE scores;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test
new file mode 100644
index 00000000..171919b1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score INT,
+ created_at DATETIME,
+ INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score = 2 AND created_at > "2014-09-11 00:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test
new file mode 100644
index 00000000..67d5c44f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_greater_than_or_equal.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score INT,
+ created_at DATETIME,
+ INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score = 2 AND created_at >= "2014-09-11 00:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test
new file mode 100644
index 00000000..b7d0b074
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score INT,
+ created_at DATETIME,
+ INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score = 2 AND created_at < "2014-09-12 00:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test
new file mode 100644
index 00000000..5576bbc3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_all_used_less_than_or_equal.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score INT,
+ created_at DATETIME,
+ INDEX (score, created_at)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score, created_at) VALUES(1, "2014-09-10 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-11 00:00:00");
+INSERT INTO items (score, created_at) VALUES(2, "2014-09-12 00:00:00");
+INSERT INTO items (score, created_at) VALUES(3, "2014-09-13 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score = 2 AND created_at <= "2014-09-12 00:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test
new file mode 100644
index 00000000..13c47b4a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score1 = 2 AND created_at > "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test
new file mode 100644
index 00000000..7b890430
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_greater_than_or_equal.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score1 = 2 AND created_at >= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test
new file mode 100644
index 00000000..60b4cd27
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score1 = 2 AND created_at < "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test
new file mode 100644
index 00000000..ece1d157
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_have_prefix_less_than_or_equal.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (score1, created_at, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE score1 = 2 AND created_at <= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test
new file mode 100644
index 00000000..924a0ac2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE created_at > "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test
new file mode 100644
index 00000000..8636e5ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_greater_than_or_equal.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE created_at >= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test
new file mode 100644
index 00000000..73d53693
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE created_at < "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test
new file mode 100644
index 00000000..630d60a7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_partially_used_no_prefix_less_than_or_equal.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT,
+ score2 INT,
+ created_at DATETIME,
+ INDEX (created_at, score1, score2)
+) DEFAULT CHARSET=UTF8;
+SHOW CREATE TABLE items;
+
+INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
+INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
+
+SELECT *
+ FROM items
+ WHERE created_at <= "2015-07-01 12:00:00"
+ ORDER BY created_at DESC;
+
+DROP TABLE items;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test
new file mode 100644
index 00000000..e8840b4a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_recreate.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d31762b2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_replace.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5730aaf8
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1b7132b3
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..332ecfc9
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_max.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test
new file mode 100644
index 00000000..bdd3b0c3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_max.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS listing;
+--enable_warnings
+
+CREATE TABLE scores (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT NOT NULL,
+ score2 INT NOT NULL,
+ INDEX (score1, score2)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO scores (score1, score2) VALUES(1, 1);
+INSERT INTO scores (score1, score2) VALUES(1, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 3);
+INSERT INTO scores (score1, score2) VALUES(2, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 1);
+INSERT INTO scores (score1, score2) VALUES(2, 0);
+INSERT INTO scores (score1, score2) VALUES(2, -1);
+INSERT INTO scores (score1, score2) VALUES(2, -2);
+INSERT INTO scores (score1, score2) VALUES(2, -3);
+
+SELECT MAX(score2) FROM scores WHERE score1 = 2;
+
+DROP TABLE scores;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test
new file mode 100644
index 00000000..23a16379
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_min.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS listing;
+--enable_warnings
+
+CREATE TABLE scores (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ score1 INT NOT NULL,
+ score2 INT NOT NULL,
+ INDEX (score1, score2)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO scores (score1, score2) VALUES(1, 1);
+INSERT INTO scores (score1, score2) VALUES(1, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 3);
+INSERT INTO scores (score1, score2) VALUES(2, 2);
+INSERT INTO scores (score1, score2) VALUES(2, 1);
+INSERT INTO scores (score1, score2) VALUES(2, 0);
+INSERT INTO scores (score1, score2) VALUES(2, -1);
+INSERT INTO scores (score1, score2) VALUES(2, -2);
+INSERT INTO scores (score1, score2) VALUES(2, -3);
+
+SELECT MIN(score2) FROM scores WHERE score1 = 2;
+
+DROP TABLE scores;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_select_string.test
new file mode 100644
index 00000000..8805771e
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fad11187
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bf420af0
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, "1000-01-01", "2012-10-05");
+INSERT IGNORE INTO ranges VALUES (2, "1000-01-01", "9999-12-31");
+INSERT IGNORE INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+INSERT IGNORE 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 00000000..236ff40c
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02", "2012-10-05");
+INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31");
+INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02");
+
+SELECT * FROM ranges FORCE INDEX(range_key)
+ WHERE start = "1000-01-02" 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 00000000..901d55ed
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02", "2012-10-05");
+INSERT INTO ranges VALUES (2, "1000-01-02", "9999-12-31");
+INSERT INTO ranges VALUES (3, "2012-10-25", "9999-12-31");
+INSERT INTO ranges VALUES (4, "9999-12-31", "1000-01-02");
+
+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 00000000..767fcce9
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, "2012-10-25", "9999-12-31");
+INSERT IGNORE INTO ranges VALUES (2, "1000-01-01", "2012-10-05");
+INSERT IGNORE INTO ranges VALUES (3, "9999-12-31", "1000-01-01");
+INSERT IGNORE 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 00000000..fa1b841a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, "2012-10-25", "9999-12-31");
+INSERT IGNORE INTO ranges VALUES (2, "1000-01-01", "2012-10-05");
+INSERT IGNORE INTO ranges VALUES (3, "9999-12-31", "1000-01-01");
+INSERT IGNORE 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 00000000..c5147500
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02", "2012-10-05");
+INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02");
+INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31");
+
+SELECT * FROM ranges FORCE INDEX(range_key)
+ ORDER BY start, end;
+
+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 00000000..3ccb4249
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02", "2012-10-05");
+INSERT INTO ranges VALUES (3, "9999-12-31", "1000-01-02");
+INSERT INTO ranges VALUES (4, "1000-01-02", "9999-12-31");
+
+SELECT * FROM ranges FORCE INDEX(range_key)
+ ORDER BY start DESC, end DESC;
+
+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 00000000..a6d82c32
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..b1e4a3b8
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (2, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+INSERT INTO ranges VALUES (3, "2012-10-25 16:18:29", "9999-12-31 23:59:59");
+INSERT INTO ranges VALUES (4, "9999-12-31 23:59:59", "1000-01-02 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_insert_delete_insert_invalid_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test
new file mode 100644
index 00000000..dc8cebf7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_unique_datetime_insert_delete_insert_invalid_value.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_strict_sql_mode.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 IGNORE INTO ranges VALUES (1, "1990-00-00 00:00:00", "2012-10-05 23:59:59");
+SELECT * FROM ranges;
+
+DELETE FROM ranges WHERE id = 1;
+INSERT IGNORE INTO ranges VALUES (1, "1990-00-00 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_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 00000000..7cb4e219
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00");
+INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+
+SELECT * FROM ranges FORCE INDEX(range_key)
+ ORDER BY start, end;
+
+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 00000000..e2b1bb0a
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_freebsd.inc
+--source ../../include/mroonga/have_signed_64bit_time_t.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-02 00:00:00", "2012-10-05 16:18:29");
+INSERT INTO ranges VALUES (3, "9999-12-31 23:59:59", "1000-01-02 00:00:00");
+INSERT INTO ranges VALUES (4, "1000-01-02 00:00:00", "9999-12-31 23:59:59");
+
+SELECT * FROM ranges FORCE INDEX(range_key)
+ ORDER BY start DESC, end DESC;
+
+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 00000000..927d8aed
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7ae2be84
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1229d887
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..68fbb2ac
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..3ae97526
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..20b08342
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..0c3315d0
--- /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-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 DEFAULT '2016-04-21 00:00:00',
+ end timestamp DEFAULT '2016-04-22 00:00:00',
+ UNIQUE KEY range_key(start, end)
+);
+
+INSERT INTO ranges VALUES (1, "1970-01-01 12:00:00", "2012-10-05 16:18:29");
+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 00000000..2780a153
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 DEFAULT '2016-04-21 00:00:00',
+ end timestamp DEFAULT '2016-04-22 00:00:00',
+ UNIQUE KEY range_key(start, end)
+);
+
+INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07");
+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 00000000..2e827343
--- /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-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 DEFAULT '2016-04-21 00:00:00',
+ end timestamp DEFAULT '2016-04-22 00:00:00',
+ UNIQUE KEY range_key(start, end)
+);
+
+INSERT INTO ranges VALUES (1, "2012-10-25 16:18:29", "2038-01-18 15:14:07");
+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 00000000..36532836
--- /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-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 DEFAULT '2016-04-21 00:00:00',
+ end timestamp DEFAULT '2016-04-22 00:00:00',
+ UNIQUE KEY range_key(start, end)
+);
+
+INSERT INTO ranges VALUES (1, "2010-01-01 00:00:00", "2012-10-05 23:59:59");
+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 00000000..eb0aabde
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1d93df36
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, 1901, 2012);
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2155);
+INSERT IGNORE INTO ranges VALUES (3, 2012, 2155);
+INSERT IGNORE 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 00000000..5cad0231
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..9bc8aaf2
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..8090ccc5
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, 2012, 2155);
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2012);
+INSERT IGNORE INTO ranges VALUES (3, 2155, 1901);
+INSERT IGNORE 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 00000000..8927d4bd
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_signed_64bit_time_t.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 IGNORE INTO ranges VALUES (1, 2012, 2155);
+INSERT IGNORE INTO ranges VALUES (2, 1901, 2012);
+INSERT IGNORE INTO ranges VALUES (3, 2155, 1901);
+INSERT IGNORE 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 00000000..d9d1f458
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..1a2b70eb
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_signed_64bit_time_t.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 00000000..3ee06c48
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d7f9dd93
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..6efe83ce
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bd3d182d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..afc0b9ff
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..ee0887f3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_char_short.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..455017bf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_date.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..6daeed75
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_with_fractional_seconds.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..9500148e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_datetime_without_fractional_seconds.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..37ccd1e5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_with_fractional_seconds.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..477368ba
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_decimal_without_fractional_seconds.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..7db2825f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_with_fractional_seconds.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..721d6392
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_time_without_fractional_seconds.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..116f11a5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_with_fractional_seconds.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mariadb_5_5.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;
+
+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 00000000..67f03299
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_timestamp_without_fractional_seconds.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..6d458d78
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f6bb7dc3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_primary_year.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_normal_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test
new file mode 100644
index 00000000..660e4370
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value > 10 ORDER BY value 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_normal_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test
new file mode 100644
index 00000000..7abae60f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value > 10 ORDER BY value 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_normal_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test
new file mode 100644
index 00000000..063d2ff7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value >= 30 ORDER BY value 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_normal_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test
new file mode 100644
index 00000000..e3d22364
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value >= 30 ORDER BY value 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_normal_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test
new file mode 100644
index 00000000..0efc5544
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value < 90 ORDER BY value 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_normal_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test
new file mode 100644
index 00000000..c356a714
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value < 90 ORDER BY value 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_normal_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test
new file mode 100644
index 00000000..b919b5f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value <= 70 ORDER BY value 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_normal_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test
new file mode 100644
index 00000000..43e870a3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ value INT(10),
+ INDEX (value)
+) ENGINE=Mroonga DEFAULT CHARSET=utf8;
+
+INSERT INTO ids VALUES(1, 50);
+INSERT INTO ids VALUES(2, 70);
+INSERT INTO ids VALUES(3, 30);
+INSERT INTO ids VALUES(4, 90);
+INSERT INTO ids VALUES(5, 10);
+
+SELECT id, value FROM ids WHERE value <= 70 ORDER BY value 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_primary_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test
new file mode 100644
index 00000000..c7086421
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test
new file mode 100644
index 00000000..dd53c39c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test
new file mode 100644
index 00000000..25dfa56f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test
new file mode 100644
index 00000000..b74b2533
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test
new file mode 100644
index 00000000..2848d4eb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test
new file mode 100644
index 00000000..99854c57
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test
new file mode 100644
index 00000000..801d6fd9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_primary_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test
new file mode 100644
index 00000000..c5d2f5cd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..cc37192e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_bigint.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..df0bf264
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..df0e9e81
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_double.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a04f84eb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_float.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..aafb352b
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d82bcb9c
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8afe5411
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_mediumint.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..70c89470
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f33b6356
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_smallint.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..4a36ef3a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..40d338d4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_read_multiple_tinyint.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..40e91829
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bbc89e09
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8d695b2e
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..abe68f79
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7203b005
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bd286894
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2a166d01
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test
new file mode 100644
index 00000000..d67d5849
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_all.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id int,
+ UNIQUE KEY (id)
+);
+
+INSERT INTO ids VALUES (1);
+DELETE FROM ids;
+INSERT INTO ids VALUES (1);
+
+SELECT * FROM ids;
+
+-- error ER_DUP_ENTRY
+INSERT INTO ids VALUES (1);
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_delete_by_primary_key.test
new file mode 100644
index 00000000..38b281f6
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..13bf0eba
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_search_after_duplicated.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test
new file mode 100644
index 00000000..4f464cca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_search_after_duplicated.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+CREATE TABLE users (
+ id int PRIMARY KEY,
+ name varchar(100) NOT NULL,
+ UNIQUE KEY (name)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO users VALUES (1, "Alice");
+
+INSERT INTO users VALUES (2, "Bob");
+-- error ER_DUP_ENTRY
+INSERT INTO users VALUES (3, "Bob");
+
+SELECT * FROM users;
+SELECT * FROM users WHERE name = "Bob";
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
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 00000000..22aba9b9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_unique_varchar.test
@@ -0,0 +1,36 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9d83b461
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_multiple_column.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..84a94b95
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_update_single_column.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2d65b763
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d9cb66c8
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7723bf65
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8a49ed22
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/information_schema_tables_data_length.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..81e98c3e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_TODO_SPLIT_ME.test
@@ -0,0 +1,89 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+# 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_delayed.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test
new file mode 100644
index 00000000..4d8248b3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2014-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+skip "This test is too fragile.";
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+--error ER_DELAYED_NOT_SUPPORTED
+INSERT DELAYED INTO ids (id) VALUES (1);
+
+SELECT * FROM ids;
+
+DROP TABLE ids;
+
+--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 00000000..dbeb6ae3
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9093560f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_primary_key.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..5d8439f2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_on_duplicate_key_update_unique_key.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+INSERT INTO diaries (day, title)
+ VALUES ("2012-02-14", "clear day1")
+ ON DUPLICATE KEY UPDATE title = "clear day1 (duplicated)";
+INSERT INTO diaries (day, title)
+ VALUES ("2012-02-14", "clear day2")
+ ON DUPLICATE KEY UPDATE title = "clear day2 (duplicated)";
+INSERT INTO diaries (day, title)
+ VALUES ("2012-02-14", "clear day3")
+ ON DUPLICATE KEY UPDATE title = "clear day3 (duplicated)";
+INSERT INTO diaries (day, title)
+ 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_virtual_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test
new file mode 100644
index 00000000..6c68a9ff
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_virtual_column.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (c1 int, _id int);
+--disable_warnings
+SET sql_mode="";
+--enable_warnings
+# warning WARN_DATA_TRUNCATED
+INSERT INTO t1 (c1,_id) VALUES (1,1);
+--disable_warnings
+SET sql_mode="STRICT_ALL_TABLES";
+--enable_warnings
+# We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported
+# MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it.
+# We share this test with all MySQL servers. So we use number here.
+--error 1265
+INSERT INTO t1 (c1,_id) VALUES (4,1);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test b/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test
new file mode 100644
index 00000000..4f5940c1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/like_unicode_ci.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2ce2ae94
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/lock_tables_read.test
@@ -0,0 +1,32 @@
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_count_skip_after_insert_multithread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test
new file mode 100644
index 00000000..4857286a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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.");
+
+disable_query_log;
+CONNECT (thread2, localhost, root, ,);
+CONNECTION thread2;
+enable_query_log;
+
+INSERT INTO diaries VALUES("Happy birthday!");
+
+disable_query_log;
+DISCONNECT thread2;
+CONNECTION default;
+enable_query_log;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE);
+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_count_skip_after_insert_single_thread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test
new file mode 100644
index 00000000..d0116e7f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_count_skip_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test
new file mode 100644
index 00000000..d84112b4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_count_skip_index_and.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test
new file mode 100644
index 00000000..691497be
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_and.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT,
+ age INT,
+ INDEX (id, age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id, age) VALUES (1, 28);
+INSERT INTO users (id, age) VALUES (1, 28);
+INSERT INTO users (id, age) VALUES (1, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (3, 29);
+
+SELECT COUNT(*) FROM users WHERE id = 2 AND age = 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test
new file mode 100644
index 00000000..76675fde
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_between.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+
+SELECT COUNT(*) FROM users WHERE age BETWEEN 28 AND 30;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test
new file mode 100644
index 00000000..b422e06e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_equal.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+
+SELECT COUNT(*) FROM users WHERE age = 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test
new file mode 100644
index 00000000..b59ca7f5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_boolean_mode.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE memos (
+ content TEXT,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO memos (content) VALUES ('Groonga is good.');
+INSERT INTO memos (content) VALUES ('Groonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga is good.');
+INSERT INTO memos (content) VALUES ('Mroonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.');
+
+SELECT COUNT(*) FROM memos
+ WHERE MATCH(content) AGAINST('+Groonga' IN BOOLEAN MODE);
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test
new file mode 100644
index 00000000..c8de7b95
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_full_text_search_in_natural_language_mode.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE memos (
+ content TEXT,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO memos (content) VALUES ('Groonga is good.');
+INSERT INTO memos (content) VALUES ('Groonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga is good.');
+INSERT INTO memos (content) VALUES ('Mroonga is very good.');
+INSERT INTO memos (content) VALUES ('Mroonga uses Groonga.');
+
+SELECT COUNT(*) FROM memos
+ WHERE MATCH(content) AGAINST('Groonga');
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test
new file mode 100644
index 00000000..fb5c336c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (1),(2),(3),(4),(5),(6);
+
+SELECT COUNT(*) FROM users WHERE age > 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test
new file mode 100644
index 00000000..c897d8d8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_greater_equal.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (1),(2),(3),(4),(5),(6);
+
+SELECT COUNT(*) FROM users WHERE age >= 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test
new file mode 100644
index 00000000..f03156d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+
+SELECT COUNT(*) FROM users WHERE age < 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test
new file mode 100644
index 00000000..20863705
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_less_equal.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (27);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (30);
+INSERT INTO users (age) VALUES (31);
+INSERT INTO users (age) VALUES (32),(33),(34),(35),(36),(37);
+
+SELECT COUNT(*) FROM users WHERE age <= 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test
new file mode 100644
index 00000000..3948d218
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_not_equal.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (28);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+INSERT INTO users (age) VALUES (29);
+
+SELECT COUNT(*) FROM users WHERE age <> 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test
new file mode 100644
index 00000000..85ee2d45
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test
@@ -0,0 +1,56 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/optimization_count_skip_multiple_conditions.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test
new file mode 100644
index 00000000..917d6a1b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_multiple_conditions.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT,
+ age INT,
+ INDEX (age)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id, age) VALUES (1, 29);
+INSERT INTO users (id, age) VALUES (2, 29);
+INSERT INTO users (id, age) VALUES (3, 29);
+
+SELECT COUNT(*) FROM users WHERE id = 3 AND age = 29;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test
new file mode 100644
index 00000000..25d6c734
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_between.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (32),(33),(34),(35),(36),(37);
+
+SELECT COUNT(*) FROM users WHERE id BETWEEN 2 AND 4;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test
new file mode 100644
index 00000000..c0db5729
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_equal.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+
+SELECT COUNT(*) FROM users WHERE id = 3;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test
new file mode 100644
index 00000000..f91cf193
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (-1),(-2),(-3),(-4);
+
+SELECT COUNT(*) FROM users WHERE id > 3;
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test
new file mode 100644
index 00000000..dd374012
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_greater_equal.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+INSERT INTO users (id) VALUES (-1),(-2),(-3),(-4);
+
+SELECT COUNT(*) FROM users WHERE id >= 3;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test
new file mode 100644
index 00000000..529dfde6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+
+SELECT COUNT(*) FROM users WHERE id < 3;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test
new file mode 100644
index 00000000..d2a863ae
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_less_equal.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+
+SELECT COUNT(*) FROM users WHERE id <= 3;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test
new file mode 100644
index 00000000..7e8c3180
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_primary_key_not_equal.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE users (
+ id INT PRIMARY KEY
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO users (id) VALUES (1);
+INSERT INTO users (id) VALUES (2);
+INSERT INTO users (id) VALUES (3);
+INSERT INTO users (id) VALUES (4);
+INSERT INTO users (id) VALUES (5);
+
+SELECT COUNT(*) FROM users WHERE id <> 3;
+
+SHOW STATUS LIKE 'mroonga_count_skip';
+
+DROP TABLE users;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test
new file mode 100644
index 00000000..c0dab283
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_disabled.test
@@ -0,0 +1,59 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_multiple_match_againsts.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test
new file mode 100644
index 00000000..ce1f6360
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_multiple_match_againsts.test
@@ -0,0 +1,57 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+SET NAMES UTF8;
+CREATE TABLE memos (
+ id INT UNSIGNED NOT NULL,
+ title VARCHAR(255),
+ content TEXT,
+ FULLTEXT INDEX(title),
+ FULLTEXT INDEX(content)
+) DEFAULT CHARSET UTF8;
+
+INSERT INTO memos VALUES(5, "title 1", "content a");
+INSERT INTO memos VALUES(12, "title 1", "content a");
+INSERT INTO memos VALUES(10, "title 1", "content a");
+INSERT INTO memos VALUES(4, "title 2", "content b");
+INSERT INTO memos VALUES(6, "title 2", "content b");
+INSERT INTO memos VALUES(1, "title 2", "content b");
+INSERT INTO memos VALUES(11, "title 1-a", "content a-1");
+INSERT INTO memos VALUES(3, "title 2-b", "content a-2");
+INSERT INTO memos VALUES(2, "title 2-c", "content a-3");
+INSERT INTO memos VALUES(8, "title 1-a", "content b-1");
+INSERT INTO memos VALUES(9, "title 2-b", "content b-2");
+INSERT INTO memos VALUES(7, "title 2-c", "content b-3");
+
+SELECT * FROM memos
+ WHERE MATCH(title) AGAINST("+1" IN BOOLEAN MODE) AND
+ MATCH(content) AGAINST("+a" IN BOOLEAN MODE)
+ ORDER BY id
+ LIMIT 1,3;
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test
new file mode 100644
index 00000000..99abc046
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_not_optimized_no_limit.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_cp932.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test
new file mode 100644
index 00000000..19c2bc40
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_cp932.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+SET NAMES CP932;
+CREATE TABLE memos (
+ ʎq INT UNSIGNED,
+ e TEXT,
+ FULLTEXT INDEX(e),
+ KEY(ʎq)
+) DEFAULT CHARSET CP932;
+
+INSERT INTO memos VALUES(2, "͎RoB");
+INSERT INTO memos VALUES(3, "̓T{eB");
+INSERT INTO memos VALUES(1, "͓VC悭Ă悩B");
+
+SELECT * FROM memos
+ WHERE MATCH(e) AGAINST("" IN BOOLEAN MODE)
+ ORDER BY ʎq
+ LIMIT 1;
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test
new file mode 100644
index 00000000..9ad4a696
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..170e9796
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_between_over.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..32555b2a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..9c4c8754
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..375080ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_greater_than_or_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..cdd4a2ba
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..b0af56e0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_datetime_less_than_or_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_duplicated_order_by_columns.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test
new file mode 100644
index 00000000..e9d1ca29
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2015 GMO Media, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU 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-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+FLUSH STATUS;
+
+SET NAMES utf8mb4;
+
+CREATE TABLE ids (
+ id int PRIMARY KEY,
+ text varchar(32),
+ FULLTEXT INDEX (text)
+) DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO ids VALUES (1, 'first');
+
+SELECT * FROM ids
+ WHERE MATCH(text) AGAINST('+first' IN BOOLEAN MODE)
+ ORDER BY id, id
+ LIMIT 1;
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test
new file mode 100644
index 00000000..3a4f4faa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_name.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+SET NAMES utf8;
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ tag ENUM('Groonga', 'Mroonga'),
+ content TEXT,
+ FULLTEXT INDEX(content),
+ KEY(tag),
+ KEY(id)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!');
+INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!');
+INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.');
+INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.');
+
+SELECT * FROM memos
+ WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND
+ tag = 'Mroonga'
+ ORDER BY id LIMIT 1;
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test
new file mode 100644
index 00000000..b8126b3f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_enum_value.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+SET NAMES utf8;
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ tag ENUM('Groonga', 'Mroonga'),
+ content TEXT,
+ FULLTEXT INDEX(content),
+ KEY(tag),
+ KEY(id)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!');
+INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!');
+INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.');
+INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.');
+
+SELECT * FROM memos
+ WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND
+ tag = 2
+ ORDER BY id LIMIT 1;
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test
new file mode 100644
index 00000000..64f5a605
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_have_primary_key.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..2fa838ea
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5981c99f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f2158a82
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_equal.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..856c9f71
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..6115bf68
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_greater_than_or_equal.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..f5001bdf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..790e8f14
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_int_less_than_or_equal.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..2aad7f0f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_no_primary_key.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..72889f96
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..c58d7353
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_asc.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..a979e88c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_desc.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..6bf3c6a8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_id.test
@@ -0,0 +1,56 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..bd86c6a2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_order_by_match_against.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..52720370
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_select_match_against.test
@@ -0,0 +1,56 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..23bb7103
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..2450f8a2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_between_over.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..46dc7cb5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..62acda78
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..ee706c5f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_greater_than_or_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..01764064
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..51423125
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_time_less_than_or_equal.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..c3456c25
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_with_index.test
@@ -0,0 +1,56 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..2ce06201
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_varchar_equal_without_index.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..c07368fb
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..599cc8fa
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..35ce6066
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..88bb6a27
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..64b9f831
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5f3f89fe
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5db8d96e
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/partition_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test
new file mode 100644
index 00000000..c60a6664
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test
@@ -0,0 +1,52 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source include/have_partition.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs (
+ timestamp DATETIME,
+ message TEXT
+) DEFAULT CHARSET=UTF8
+ PARTITION BY RANGE (TO_DAYS(timestamp)) (
+ PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
+ PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
+ PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
+ PARTITION pfuture VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE logs;
+
+INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-01-31 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-02-28 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-03-31 23:59:59', 'Shutdown');
+INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-04-30 23:59:59', 'Shutdown');
+
+SELECT * FROM logs ORDER BY timestamp;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test
new file mode 100644
index 00000000..0620de86
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mariadb_10_0_or_later.inc
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source include/have_partition.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE logs (
+ timestamp DATETIME,
+ message TEXT
+) DEFAULT CHARSET=UTF8
+ PARTITION BY RANGE (TO_DAYS(timestamp)) (
+ PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')),
+ PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')),
+ PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')),
+ PARTITION pfuture VALUES LESS THAN MAXVALUE
+);
+SHOW CREATE TABLE logs;
+
+INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start');
+INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start');
+
+SELECT * FROM logs ORDER BY timestamp;
+
+UPDATE logs
+ SET message = 'Started'
+ WHERE timestamp < '2015-03-01 00:00:00';
+
+SELECT * FROM logs ORDER BY timestamp;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test
new file mode 100644
index 00000000..0f04bd3e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test
@@ -0,0 +1,57 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/skip_solaris.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+CREATE DATABASE repair_test;
+USE repair_test;
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ body TEXT,
+ FULLTEXT INDEX body_index (body)
+) 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(body) AGAINST("+starting" IN BOOLEAN MODE);
+
+--remove_file $MYSQLD_DATADIR/repair_test.mrn.000010E.c
+
+FLUSH TABLES;
+
+# Error ER_CANT_OPEN_FILE system call error: No such file or directory: failed to open path: <repair_test.mrn.000010E.c>
+--error ER_CANT_OPEN_FILE
+SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE);
+
+REPAIR TABLE diaries;
+
+SELECT * FROM diaries;
+
+SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+DROP DATABASE repair_test;
+USE test;
+
+--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 00000000..854a93a2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--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, ST_AsText(geo) FROM geo_replace;
+REPLACE INTO geo_replace VALUES(1, POINT(100,200));
+SELECT id, ST_AsText(geo) FROM geo_replace;
+INSERT INTO geo_replace VALUES(1, POINT(200,200)) ON DUPLICATE KEY UPDATE geo = POINT(200,200);
+SELECT id, ST_AsText(geo) FROM geo_replace;
+UPDATE geo_replace SET geo = POINT(200,300);
+SELECT id, ST_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 00000000..80b56639
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_select_varchar.test
@@ -0,0 +1,65 @@
+# 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-1335 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")
+ ORDER BY id;
+
+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 00000000..add74ad7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_text.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..ef4739f1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_varchar.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..72d233bc
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/replace_without_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test
new file mode 100644
index 00000000..4e408522
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_without_key.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+SET NAMES utf8;
+CREATE TABLE diaries (
+ id varchar(32) NOT NULL PRIMARY KEY,
+ content text,
+ FULLTEXT INDEX (content)
+) DEFAULT CHARSET=utf8;
+
+-- error ER_ERROR_ON_WRITE, ER_NO_DEFAULT_FOR_FIELD
+REPLACE INTO diaries(content) VALUES("Hello");
+
+DROP TABLE diaries;
+
+--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 00000000..47f6e65c
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..686a9aa2
--- /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 <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2c40b00e
--- /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 <mmmaru777@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1d8e84a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_with_index.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 age, 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 00000000..5d695d6b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/select_group_by_without_index.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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);
+
+SELECT age, 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 00000000..8bfecaf7
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..838c01e4
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..81004f9b
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..819a27c1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/sub_query_fulltext.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..14aa7f26
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/temporary_table.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Toshihisa Tashiro
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..12adecb6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/truncate.test
@@ -0,0 +1,61 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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)
+ ORDER BY id;
+TRUNCATE TABLE diaries;
+SELECT * FROM diaries;
+SELECT * FROM diaries
+ WHERE MATCH(content) AGAINST("+今日" IN BOOLEAN MODE)
+ ORDER BY id;
+
+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)
+ ORDER BY id;
+
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test
new file mode 100644
index 00000000..c97b0e4e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_binlog_row.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET SESSION binlog_format = 'ROW';
+
+CREATE TABLE memos (
+ title varchar(20) PRIMARY KEY,
+ content varchar(140) NOT NULL
+) COLLATE=utf8mb4_general_ci
+ DEFAULT CHARSET=utf8mb4;
+
+INSERT INTO memos (title, content) VALUES ('Mroonga', 'Mroonga is great!');
+SELECT * FROM memos;
+UPDATE memos SET content = 'Mroonga is very great!' WHERE title = 'Mroonga';
+SELECT * FROM memos;
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test b/storage/mroonga/mysql-test/mroonga/storage/t/update_fulltext.test
new file mode 100644
index 00000000..73e57dac
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..bd1d4537
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..3e05cd49
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..02151964
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7496f7a0
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..c0f2aece
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test
@@ -0,0 +1,49 @@
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# for virtual columns
+CREATE TABLE t1 (c1 int, _id int);
+INSERT INTO t1 VALUES(1,null);
+INSERT INTO t1 VALUES(2,null);
+INSERT INTO t1 VALUES(3,null);
+SELECT * FROM t1;
+--disable_warnings
+SET sql_mode="";
+--enable_warnings
+# warning WARN_DATA_TRUNCATED
+UPDATE t1 SET _id = 10 WHERE c1 = 1;
+SELECT * FROM t1;
+--disable_warnings
+SET sql_mode="STRICT_ALL_TABLES";
+--enable_warnings
+# We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported
+# MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it.
+# We share this test with all MySQL servers. So we use number here.
+--error 1265
+UPDATE t1 SET _id = 11 WHERE c1 = 1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+SET sql_mode=DEFAULT;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test
new file mode 100644
index 00000000..b84e955f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released.
+--source ../../include/mroonga/have_mysql.inc
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_boolean_mode_syntax_flags_backup =
+ @@mroonga_boolean_mode_syntax_flags;
+
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN";
+
+SET NAMES UTF8;
+
+CREATE TABLE diaries (
+ title TEXT,
+ content TEXT,
+ FULLTEXT KEY (title),
+ FULLTEXT KEY (content)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
+
+SELECT * FROM diaries
+ WHERE MATCH(title) AGAINST("content:@Hello" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+SET mroonga_boolean_mode_syntax_flags =
+ @mroonga_boolean_mode_syntax_flags_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test
new file mode 100644
index 00000000..bb9eb04b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released.
+--source ../../include/mroonga/have_mysql.inc
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_boolean_mode_syntax_flags_backup =
+ @@mroonga_boolean_mode_syntax_flags;
+
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_LEADING_NOT";
+
+SET NAMES UTF8;
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES("Groonga");
+INSERT INTO diaries VALUES("Mroonga");
+
+SELECT * FROM diaries WHERE MATCH(title) AGAINST("-Groonga" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+SET mroonga_boolean_mode_syntax_flags =
+ @mroonga_boolean_mode_syntax_flags_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test
new file mode 100644
index 00000000..940b4484
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released.
+--source ../../include/mroonga/have_mysql.inc
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_boolean_mode_syntax_flags_backup =
+ @@mroonga_boolean_mode_syntax_flags;
+
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY,ALLOW_COLUMN,ALLOW_UPDATE";
+
+SET NAMES UTF8;
+
+CREATE TABLE diaries (
+ title TEXT,
+ content TEXT,
+ FULLTEXT KEY (title),
+ FULLTEXT KEY (content)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES("Groonga", "Hello Groonga");
+
+SELECT * FROM diaries
+ WHERE MATCH(title) AGAINST('content:="Hello Mroonga"' IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+SET mroonga_boolean_mode_syntax_flags =
+ @mroonga_boolean_mode_syntax_flags_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test
new file mode 100644
index 00000000..0da5eed7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released.
+--source ../../include/mroonga/have_mysql.inc
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_boolean_mode_syntax_flags_backup =
+ @@mroonga_boolean_mode_syntax_flags;
+
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_QUERY";
+
+SET NAMES UTF8;
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES("Re:Mroonga");
+
+SELECT * FROM diaries WHERE MATCH(title) AGAINST("Re:Mroonga" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+SET mroonga_boolean_mode_syntax_flags =
+ @mroonga_boolean_mode_syntax_flags_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test
new file mode 100644
index 00000000..3c73e214
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released.
+--source ../../include/mroonga/have_mysql.inc
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_boolean_mode_syntax_flags_backup =
+ @@mroonga_boolean_mode_syntax_flags;
+
+SET mroonga_boolean_mode_syntax_flags = "SYNTAX_SCRIPT";
+
+SET NAMES UTF8;
+
+CREATE TABLE diaries (
+ title TEXT,
+ FULLTEXT KEY (title)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO diaries VALUES("Re:Mroonga");
+
+SELECT * FROM diaries
+ WHERE MATCH(title) AGAINST("title @ 'Re:Mroonga'" IN BOOLEAN MODE);
+
+DROP TABLE diaries;
+
+SET mroonga_boolean_mode_syntax_flags =
+ @mroonga_boolean_mode_syntax_flags_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
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 00000000..9a3b5715
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+SET GLOBAL mroonga_database_path_prefix = NULL;
+
+USE test;
+
+--rmdir $MYSQLD_DATADIR/test/mroonga.data
+
+--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 00000000..b3bc8815
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..46065e41
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_default_tokenizer_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test
new file mode 100644
index 00000000..5aec9b4f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_new_value.test
@@ -0,0 +1,25 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET @mroonga_default_tokenizer_backup = @@mroonga_default_tokenizer;
+SET GLOBAL mroonga_default_tokenizer = "TokenBigramSplitAlpha";
+SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer';
+SET GLOBAL mroonga_default_tokenizer = @mroonga_default_tokenizer_backup;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test
new file mode 100644
index 00000000..f2ee331e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_same_value.test
@@ -0,0 +1,22 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+SET GLOBAL mroonga_default_tokenizer = "TokenBigram";
+SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer';
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test
new file mode 100644
index 00000000..34929331
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_delete.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..ece2a65d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_insert.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..a9b3005f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_dry_write_update.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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_enable_operations_recording_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test
new file mode 100644
index 00000000..2a77a013
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_enable_operations_recording_insert.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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
+
+CREATE TABLE diaries (
+ title TEXT
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command('truncate mroonga_operations');
+INSERT INTO diaries VALUES("Unlogged: Research for Mroonga");
+SELECT mroonga_command('load --table mroonga_operations --values "[{}]"');
+SELECT mroonga_command('select mroonga_operations --output_columns _id');
+
+SET GLOBAL mroonga_enable_operations_recording = false;
+FLUSH TABLES;
+
+SELECT mroonga_command('truncate mroonga_operations');
+INSERT INTO diaries VALUES("Logged: Research for Mroonga");
+SELECT mroonga_command('load --table mroonga_operations --values "[{}]"');
+SELECT mroonga_command('select mroonga_operations --output_columns _id');
+
+DROP TABLE diaries;
+SELECT mroonga_command('truncate mroonga_operations');
+
+SET GLOBAL mroonga_enable_operations_recording = default;
+FLUSH TABLES;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--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 00000000..bf9387c8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_disable.test
@@ -0,0 +1,28 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_10_0_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+SET GLOBAL mroonga_lock_timeout = -1;
+SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout";
+
+
+--disable_query_log
+SET GLOBAL mroonga_lock_timeout = DEFAULT;
+--enable_query_log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test
new file mode 100644
index 00000000..1126628d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_invalid.test
@@ -0,0 +1,28 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_version_10_0_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+SET GLOBAL mroonga_lock_timeout = -2;
+SHOW GLOBAL VARIABLES LIKE "mroonga_lock_timeout";
+
+
+--disable_query_log
+SET GLOBAL mroonga_lock_timeout = DEFAULT;
+--enable_query_log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test
new file mode 100644
index 00000000..aae419e6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_no_retry.test
@@ -0,0 +1,27 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 = DEFAULT;
+--enable_query_log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test
new file mode 100644
index 00000000..e8eb2952
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_lock_timeout_valid.test
@@ -0,0 +1,27 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 = DEFAULT;
+--enable_query_log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_log_file_new_value.test
new file mode 100644
index 00000000..b17163c8
--- /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 <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..40000b45
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..8333ed4b
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..72de94c5
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fe026a31
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_global.test
@@ -0,0 +1,61 @@
+# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS diaries;
+--enable_warnings
+
+# MySQL <= 5.5 reports a wrong warning. :<
+# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3.
+--disable_warnings
+SET GLOBAL mroonga_match_escalation_threshold = -1;
+--enable_warnings
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ tags TEXT,
+ FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO diaries (title, tags) VALUES ("Hello Groonga!", "groonga install");
+INSERT INTO diaries (title, tags) VALUES ("Hello Mroonga!", "mroonga install");
+
+disable_query_log;
+CONNECT (new_connection, localhost, root, ,);
+CONNECTION new_connection;
+enable_query_log;
+
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+install" IN BOOLEAN MODE);
+
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("+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);
+
+disable_query_log;
+CONNECTION default;
+DISCONNECT new_connection;
+enable_query_log;
+
+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 00000000..24c5c484
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_match_escalation_threshold_session.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ tags TEXT,
+ FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) 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);
+
+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_max_n_records_for_estimate_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test
new file mode 100644
index 00000000..56117e2b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test
@@ -0,0 +1,60 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+
+
+SET GLOBAL mroonga_max_n_records_for_estimate = 1;
+
+disable_query_log;
+CONNECT (new_connection, localhost, root, ,);
+CONNECTION new_connection;
+enable_query_log;
+
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+
+disable_query_log;
+CONNECTION default;
+DISCONNECT new_connection;
+enable_query_log;
+
+SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT;
+
+
+DROP TABLE ids;
+
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test
new file mode 100644
index 00000000..57e2a186
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_global.test
@@ -0,0 +1,60 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+
+
+SET GLOBAL mroonga_max_n_records_for_estimate = 1;
+
+disable_query_log;
+CONNECT (new_connection, localhost, root, ,);
+CONNECTION new_connection;
+enable_query_log;
+
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+
+disable_query_log;
+CONNECTION default;
+DISCONNECT new_connection;
+enable_query_log;
+
+SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT;
+
+
+DROP TABLE ids;
+
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test
new file mode 100644
index 00000000..f0f548f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_not_found_in_limit.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT,
+ INDEX (id)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+
+DELETE FROM ids WHERE id < 2;
+
+SET mroonga_max_n_records_for_estimate = 1;
+
+EXPLAIN SELECT * FROM ids WHERE id > 0;
+
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test
new file mode 100644
index 00000000..b25e01b7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_mysql_5_7_or_later_session.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+
+SET mroonga_max_n_records_for_estimate = 1;
+
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test
new file mode 100644
index 00000000..79c75308
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_not_found_in_limit.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT,
+ INDEX (id)
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4),(5),(6),(7);
+
+DELETE FROM ids WHERE id < 2;
+
+SET mroonga_max_n_records_for_estimate = 1;
+
+EXPLAIN SELECT * FROM ids WHERE id > 0;
+
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test
new file mode 100644
index 00000000..59af3e6a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2015-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id INT PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=UTF8;
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+INSERT INTO ids VALUES (4);
+INSERT INTO ids VALUES (5);
+INSERT INTO ids VALUES (6);
+INSERT INTO ids VALUES (7);
+INSERT INTO ids VALUES (8);
+INSERT INTO ids VALUES (9);
+INSERT INTO ids VALUES (10);
+
+SET mroonga_max_n_records_for_estimate = 1;
+
+EXPLAIN SELECT * FROM ids WHERE id > 5;
+
+SET mroonga_max_n_records_for_estimate = DEFAULT;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test
new file mode 100644
index 00000000..57c62b2b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_empty_value.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = "";
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test
new file mode 100644
index 00000000..97590b34
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_disabled_null_value.test
@@ -0,0 +1,31 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = NULL;
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test
new file mode 100644
index 00000000..3021fe12
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_empty_value.test
@@ -0,0 +1,33 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = "";
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test
new file mode 100644
index 00000000..f233b7ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_enabled_null_value.test
@@ -0,0 +1,33 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = NULL;
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test
new file mode 100644
index 00000000..a98824cf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_new_value.test
@@ -0,0 +1,33 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Kentoku SHIBA
+# Copyright(C) 2017 Kentaro Hayashi <hayashi@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU 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-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test
new file mode 100644
index 00000000..faeb90ba
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_query_log_file_same_value.test
@@ -0,0 +1,34 @@
+# Copyright(C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2017 Kentaro Hayashi <hayashi@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU 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-1335 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+
+SET GLOBAL mroonga_log_file = "groonga-query-log.log";
+
+SET GLOBAL mroonga_query_log_file = "groonga-query.log";
+--source ../../include/mroonga/print_groonga_query_log.inc
+
+SET GLOBAL mroonga_query_log_file = DEFAULT;
+SET GLOBAL mroonga_log_file = DEFAULT;
+
+--remove_file $MYSQLD_DATADIR/groonga-query-log.log
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test
new file mode 100644
index 00000000..94e8cb9b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_vector_column_delimiter.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d9795eab
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_version.test
@@ -0,0 +1,22 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/disabled.def b/storage/mroonga/mysql-test/mroonga/wrapper/disabled.def
new file mode 100644
index 00000000..f3f211b6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/disabled.def
@@ -0,0 +1,2 @@
+create_table_token_filters_index_comment_multiple_token_filters : Bundled Mroonga does not support token filter yet.
+create_table_token_filters_index_comment_one_token_filter : Bundled Mroonga does not support token filter yet.
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 00000000..2be9834c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT
+) 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.
+DROP TABLE diaries;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result
new file mode 100644
index 00000000..9628df68
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_cp932.result
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS users;
+SET NAMES cp932;
+CREATE TABLE users (
+id int unsigned PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"';
+ALTER TABLE users
+ADD COLUMN O text,
+ADD FULLTEXT INDEX (O);
+INSERT INTO users (O) VALUES ("܂");
+INSERT INTO users (O) VALUES ("Ȃ");
+INSERT INTO users (O) VALUES ("");
+SELECT * FROM users;
+id O
+1 ܂
+2 Ȃ
+3
+SELECT * FROM users
+WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+id O
+2 Ȃ
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_HASH_KEY ShortText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result
new file mode 100644
index 00000000..abd2271f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_add_column_multibyte_utf8.result
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS users;
+SET NAMES utf8;
+CREATE TABLE users (
+id int unsigned PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"';
+ALTER TABLE users
+ADD COLUMN 名前 text,
+ADD FULLTEXT INDEX (名前);
+INSERT INTO users (名前) VALUES ("やまだ");
+INSERT INTO users (名前) VALUES ("たなか");
+INSERT INTO users (名前) VALUES ("すずき");
+SELECT * FROM users;
+id 名前
+1 やまだ
+2 たなか
+3 すずき
+SELECT * FROM users
+WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+id 名前
+2 たなか
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_HASH_KEY ShortText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_column_comment.result
new file mode 100644
index 00000000..af302b5a
--- /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 00000000..7197d3a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_change_engine.result
@@ -0,0 +1,39 @@
+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;
+SELECT table_name, engine, table_comment
+FROM information_schema.tables
+WHERE table_name = 'diaries';
+table_name engine table_comment
+diaries MyISAM
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga...");
+SELECT * FROM diaries
+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"';
+SELECT table_name, engine, table_comment
+FROM information_schema.tables
+WHERE table_name = 'diaries';
+table_name engine table_comment
+diaries Mroonga ENGINE "InnoDB"
+SELECT * FROM diaries
+WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND
+MATCH(body) AGAINST("groonga" IN BOOLEAN MODE);
+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 00000000..05bd0e4e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_comment_change_engine.result
@@ -0,0 +1,27 @@
+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"';
+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"';
+SELECT table_name, table_comment
+FROM information_schema.tables
+WHERE table_name = 'memos';
+table_name table_comment
+memos engine "MyISAM"
+SELECT * FROM memos;
+id title content
+1 Hello I start to write memos!
+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 00000000..b185bf26
--- /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 00000000..e71132be
--- /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 00000000..1fefc1d9
--- /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 00000000..d115cefb
--- /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 00000000..47649911
--- /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 00000000..06e1a12d
--- /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 00000000..25cb53de
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_drop_column.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT
+) 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;
+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 00000000..b9a0f545
--- /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 00000000..341cc4f7
--- /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 00000000..21f6b908
--- /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 00000000..2ba4f1b6
--- /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 00000000..a1ee9013
--- /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 00000000..37f03b40
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_fulltext.result
@@ -0,0 +1,34 @@
+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"';
+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...
+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 00000000..bfbe96d1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_rename_table.result
@@ -0,0 +1,25 @@
+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"';
+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
+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 00000000..fa42d4a1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result
@@ -0,0 +1,122 @@
+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',
+ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+VALUES ('taiyaki-kataoka',
+ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+VALUES ('soba-taiyaki-ku',
+ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+VALUES ('kuruma',
+ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+VALUES ('hirose-ya',
+ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+VALUES ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+VALUES ('omede-taiyaki',
+ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+VALUES ('onaga-ya',
+ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+VALUES ('shiro-ya',
+ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+VALUES ('fuji-ya',
+ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+VALUES ('miyoshi',
+ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+VALUES ('juju-ya',
+ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+VALUES ('tatsumi-ya',
+ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+VALUES ('tetsuji',
+ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+VALUES ('gazuma-ya',
+ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+VALUES ('honma-mon',
+ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+VALUES ('naniwa-ya',
+ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+VALUES ('kuro-dai',
+ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+VALUES ('daruma',
+ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+VALUES ('yanagi-ya',
+ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+VALUES ('sharaku',
+ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+VALUES ('takane',
+ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+VALUES ('chiyoda',
+ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+VALUES ('da-ka-po',
+ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+VALUES ('matsushima-ya',
+ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+VALUES ('kazuya',
+ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+VALUES ('furuya-kogane-an',
+ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+VALUES ('hachi-no-ie',
+ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+VALUES ('azuki-chan',
+ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+VALUES ('kuriko-an',
+ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+VALUES ('naze-ya',
+ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+VALUES ('sanoki-ya',
+ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+VALUES ('shigeta',
+ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+VALUES ('nishimi-ya',
+ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+VALUES ('hiiragi',
+ST_GeomFromText('POINT(139.711517 35.647701)'));
+ALTER TABLE shops ADD SPATIAL KEY location_index (location);
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location);
+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/auto_increment_text.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/auto_increment_text.result
new file mode 100644
index 00000000..9d45d2fe
--- /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 00000000..f0792094
--- /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/check_table_for_upgrade.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result
new file mode 100644
index 00000000..61122f78
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/check_table_for_upgrade.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id int NOT NULL PRIMARY KEY,
+content text,
+FULLTEXT INDEX (content)
+) COMMENT='engine "InnoDB"';
+INSERT INTO memos VALUES (1, 'Hello MySQL');
+INSERT INTO memos VALUES (2, 'Hello Mroonga');
+CHECK TABLE memos FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.memos check status OK
+FLUSH TABLES;
+SELECT * FROM memos
+WHERE MATCH(content) AGAINST('+mroonga' IN BOOLEAN MODE);
+id content
+2 Hello Mroonga
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_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 00000000..b1a7c8ef
--- /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_generated_stored_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result
new file mode 100644
index 00000000..5b379d08
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_add_column.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
+ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result
new file mode 100644
index 00000000..24c9275b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_delete.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+DELETE FROM logs WHERE id = 1;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result
new file mode 100644
index 00000000..65a55204
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_drop_column.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DROP COLUMN message;
+SELECT * FROM logs;
+id record
+1 {"level": "info", "message": "start"}
+2 {"level": "info", "message": "restart"}
+3 {"level": "warn", "message": "abort"}
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result
new file mode 100644
index 00000000..febfd343
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_insert.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result
new file mode 100644
index 00000000..c0d9452f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_reindex.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DISABLE KEYS;
+ALTER TABLE logs ENABLE KEYS;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result
new file mode 100644
index 00000000..ae9c244d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_stored_update.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE);
+id record message
+2 {"level": "info", "message": "shutdown"} "shutdown"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result
new file mode 100644
index 00000000..6daeb5e2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_column.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL;
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result
new file mode 100644
index 00000000..82a46e3f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_fulltext_index.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record)
+VALUES (1, '{"level": "info", "message": "start server"}');
+ALTER TABLE logs ADD FULLTEXT INDEX (message);
+INSERT INTO logs(id, record)
+VALUES (2, '{"level": "info", "message": "start server"}');
+INSERT INTO logs(id, record)
+VALUES (3, '{"level": "warn", "message": "abort server"}');
+SELECT * FROM logs WHERE MATCH(message) AGAINST('+start' IN BOOLEAN MODE);
+id record message
+2 {"level": "info", "message": "start server"} "start server"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result
new file mode 100644
index 00000000..09cd1891
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_add_index.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+level VARCHAR(255) GENERATED ALWAYS AS
+(json_unquote(json_extract(`record`, '$.level'))) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record)
+VALUES (1, '{"level": "info", "message": "start server"}');
+ALTER TABLE logs ADD INDEX (level);
+INSERT INTO logs(id, record)
+VALUES (2, '{"level": "info", "message": "start server"}');
+INSERT INTO logs(id, record)
+VALUES (3, '{"level": "warn", "message": "abort server"}');
+SELECT * FROM logs WHERE level = 'info';
+id record level
+1 {"level": "info", "message": "start server"} info
+2 {"level": "info", "message": "start server"} info
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result
new file mode 100644
index 00000000..8c1ceaf1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_delete.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+DELETE FROM logs WHERE id = 1;
+SELECT * FROM logs;
+id record message
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result
new file mode 100644
index 00000000..7d322617
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_drop_column.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+ALTER TABLE logs DROP COLUMN message;
+SELECT * FROM logs;
+id record
+1 {"level": "info", "message": "start"}
+2 {"level": "info", "message": "restart"}
+3 {"level": "warn", "message": "abort"}
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result
new file mode 100644
index 00000000..5a0e63ed
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_insert.result
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "restart"} "restart"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result
new file mode 100644
index 00000000..2411f7a7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_generated_virtual_update.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY,
+record JSON,
+message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+SELECT * FROM logs;
+id record message
+1 {"level": "info", "message": "start"} "start"
+2 {"level": "info", "message": "shutdown"} "shutdown"
+3 {"level": "warn", "message": "abort"} "abort"
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result
new file mode 100644
index 00000000..38185f5e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_cp932.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS users;
+SET NAMES cp932;
+CREATE TABLE users (
+id int unsigned PRIMARY KEY AUTO_INCREMENT,
+O text,
+FULLTEXT INDEX (O)
+) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"';
+INSERT INTO users (O) VALUES ("܂");
+INSERT INTO users (O) VALUES ("Ȃ");
+INSERT INTO users (O) VALUES ("");
+SELECT * FROM users;
+id O
+1 ܂
+2 Ȃ
+3
+SELECT * FROM users
+WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+id O
+2 Ȃ
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_HASH_KEY ShortText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result
new file mode 100644
index 00000000..2d313073
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_multibyte_utf8.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS users;
+SET NAMES utf8;
+CREATE TABLE users (
+id int unsigned PRIMARY KEY AUTO_INCREMENT,
+名前 text,
+FULLTEXT INDEX (名前)
+) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"';
+INSERT INTO users (名前) VALUES ("やまだ");
+INSERT INTO users (名前) VALUES ("たなか");
+INSERT INTO users (名前) VALUES ("すずき");
+SELECT * FROM users;
+id 名前
+1 やまだ
+2 たなか
+3 すずき
+SELECT * FROM users
+WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+id 名前
+2 たなか
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+mroonga_command("dump --dump_plugins no --dump_records no")
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+table_create users TABLE_HASH_KEY ShortText
+
+table_create users#@540d@524d TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+
+column_create users#@540d@524d index COLUMN_INDEX|WITH_POSITION users
+DROP TABLE users;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/column_normal_comment.result
new file mode 100644
index 00000000..26790796
--- /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.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result
new file mode 100644
index 00000000..7822d118
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star.result
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS ids;
+CREATE TABLE ids (
+id int PRIMARY KEY
+) COMMENT='ENGINE "InnoDB"';
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+SELECT COUNT(*) FROM ids;
+COUNT(*)
+3
+DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result
new file mode 100644
index 00000000..141117f6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_mysql_5_7_or_later_with_index.result
@@ -0,0 +1,30 @@
+CREATE TABLE diaries_innodb (
+id INT PRIMARY KEY AUTO_INCREMENT,
+body TEXT,
+flag TINYINT(2),
+INDEX (flag)
+) ENGINE = InnoDB DEFAULT CHARSET UTF8;
+CREATE TABLE diaries_mroonga (
+id INT PRIMARY KEY AUTO_INCREMENT,
+body TEXT,
+flag TINYINT(2),
+INDEX (flag)
+) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8;
+INSERT INTO diaries_innodb (body) VALUES ("will start groonga!");
+INSERT INTO diaries_innodb (body) VALUES ("starting groonga...");
+INSERT INTO diaries_innodb (body) VALUES ("started groonga.");
+INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!");
+INSERT INTO diaries_mroonga (body) VALUES ("starting groonga...");
+INSERT INTO diaries_mroonga (body) VALUES ("started groonga.");
+EXPLAIN SELECT COUNT(*) FROM diaries_innodb;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE diaries_innodb NULL index NULL flag 2 NULL 3 100.00 Using index
+Warnings:
+Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`diaries_innodb`
+EXPLAIN SELECT COUNT(*) FROM diaries_mroonga;
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE diaries_mroonga NULL index NULL flag 2 NULL 3 100.00 Using index
+Warnings:
+Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`diaries_mroonga`
+DROP TABLE diaries_innodb;
+DROP TABLE diaries_mroonga;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result
new file mode 100644
index 00000000..1ebd0ba8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result
@@ -0,0 +1,26 @@
+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 # 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 # 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 00000000..b3814331
--- /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 00000000..3610ab6f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_comment_combined.result
@@ -0,0 +1,14 @@
+DROP TABLE IF EXISTS bugs;
+CREATE TABLE bugs (
+id INT UNSIGNED PRIMARY KEY
+) DEFAULT CHARSET=utf8
+COMMENT='Free style normal comment, engine "InnoDB"';
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create bugs TABLE_HASH_KEY ShortText
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+DROP TABLE bugs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result
new file mode 100644
index 00000000..6ff4c105
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_comment.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL PRIMARY KEY,
+FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result
new file mode 100644
index 00000000..9048b677
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_none.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL PRIMARY KEY,
+FULLTEXT INDEX (content) COMMENT 'flags "NONE"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result
new file mode 100644
index 00000000..1c701d0e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_flags_parameter.result
@@ -0,0 +1,16 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL PRIMARY KEY,
+FULLTEXT INDEX (content) FLAGS='WITH_POSITION|WITH_WEIGHT'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `content` varchar(64) NOT NULL,
+ PRIMARY KEY (`content`),
+ FULLTEXT KEY `content` (`content`) `FLAGS`='WITH_POSITION|WITH_WEIGHT'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result
new file mode 100644
index 00000000..e378ba3b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL PRIMARY KEY,
+FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result
new file mode 100644
index 00000000..1367a3ad
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result
@@ -0,0 +1,9 @@
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL PRIMARY KEY,
+FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+mroonga_command("dump --dump_plugins no --dump_schema no")
+column_create memos#content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_comment.result
new file mode 100644
index 00000000..1c9bf50f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_comment.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `id` int(11) NOT NULL,
+ `content` text NOT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `content` (`content`) COMMENT 'normalizer "NormalizerAuto"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result
new file mode 100644
index 00000000..5230963a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_fulltext_index_bin.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `id` int(11) NOT NULL,
+ `content` text COLLATE utf8_bin NOT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `content` (`content`) COMMENT 'normalizer "NormalizerAuto"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ENGINE "InnoDB"'
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_parameter.result
new file mode 100644
index 00000000..d3bc05a9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_normalizer_parameter.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS memos;
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content TEXT NOT NULL,
+FULLTEXT INDEX (content) NORMALIZER='NormalizerAuto'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `id` int(11) NOT NULL,
+ `content` text NOT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `content` (`content`) `NORMALIZER`='NormalizerAuto'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+SELECT * FROM memos
+WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+id content
+1 1日の消費㌍は約2000㌔㌍
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result
new file mode 100644
index 00000000..4d9d20dc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_parser_comment.result
@@ -0,0 +1,25 @@
+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;
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+insert into diaries (body) values ("will start Groonga!");
+Warnings:
+Warning 1287 'parser' is deprecated and will be removed in a future release. Please use tokenizer instead
+insert into diaries (body) values ("starting Groonga...");
+insert into diaries (body) values ("started Groonga.");
+select * from diaries;
+id body
+1 will start Groonga!
+2 starting Groonga...
+3 started Groonga.
+select * from diaries where match(body) against("+start" in boolean mode) order by id;
+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/create_table_token_filters_index_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result
new file mode 100644
index 00000000..7f4885fb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_multiple_token_filters.result
@@ -0,0 +1,22 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_HASH_KEY ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result
new file mode 100644
index 00000000..2d7c6748
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_one_token_filter.result
@@ -0,0 +1,22 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_HASH_KEY ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result
new file mode 100644
index 00000000..4626d144
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_parameter.result
@@ -0,0 +1,30 @@
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+mroonga_command("plugin_register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+id INT NOT NULL PRIMARY KEY,
+content VARCHAR(64) NOT NULL,
+FULLTEXT INDEX (content) TOKEN_FILTERS='TokenFilterStopWord,TokenFilterStopWord'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+Table Create Table
+memos CREATE TABLE `memos` (
+ `id` int(11) NOT NULL,
+ `content` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `content` (`content`) `TOKEN_FILTERS`='TokenFilterStopWord,TokenFilterStopWord'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
+SELECT mroonga_command("dump --dump_plugins no");
+mroonga_command("dump --dump_plugins no")
+table_create memos TABLE_HASH_KEY ShortText
+
+table_create memos#content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+
+table_create mroonga_operations TABLE_NO_KEY
+column_create mroonga_operations record COLUMN_SCALAR UInt32
+column_create mroonga_operations table COLUMN_SCALAR ShortText
+column_create mroonga_operations type COLUMN_SCALAR ShortText
+
+column_create memos#content index COLUMN_INDEX|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result
new file mode 100644
index 00000000..34e3f88d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_comment.result
@@ -0,0 +1,21 @@
+drop table if exists diaries;
+create table diaries (
+id int primary key auto_increment,
+body text,
+fulltext index body_index (body)
+comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) comment = 'engine "innodb"' 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" in boolean mode) order by id;
+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/create_table_tokenizer_parameter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result
new file mode 100644
index 00000000..219d8e08
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_tokenizer_parameter.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id int PRIMARY KEY AUTO_INCREMENT,
+body text,
+FULLTEXT INDEX body_index (body) TOKENIZER='TokenBigramSplitSymbolAlphaDigit'
+) COMMENT = 'ENGINE "InnoDB"' 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" IN BOOLEAN MODE)
+ORDER BY id;
+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/delete_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/delete_TODO_SPLIT_ME.result
new file mode 100644
index 00000000..99053762
--- /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 00000000..200e978a
--- /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/drop_table_new_connection.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result
new file mode 100644
index 00000000..f7d5b439
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/drop_table_new_connection.result
@@ -0,0 +1,13 @@
+CREATE TABLE logs (
+id INT PRIMARY KEY AUTO_INCREMENT,
+message TEXT,
+FULLTEXT INDEX (message)
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+USE test;
+DROP TABLE logs;
+CREATE TABLE logs (
+id INT PRIMARY KEY AUTO_INCREMENT,
+message TEXT,
+FULLTEXT INDEX (message)
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+DROP TABLE logs;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result
new file mode 100644
index 00000000..8614eaa7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_leading_not.result
@@ -0,0 +1,15 @@
+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"';
+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 00000000..1ecf18cb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_multiple_match_against.result
@@ -0,0 +1,22 @@
+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"';
+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 00000000..190105a3
--- /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 00000000..240da5c3
--- /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 00000000..6dedd218
--- /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 00000000..96d92e53
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_no_operator.result
@@ -0,0 +1,20 @@
+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)
+ORDER BY id;
+id content
+1 Today is good day.
+2 Tomorrow will be good day.
+3 Today is fine.
+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 00000000..ee8d8510
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_minus.result
@@ -0,0 +1,20 @@
+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)
+ORDER BY id;
+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 00000000..bb940432
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_boolean_mode_pragma_default_operator_or_with_plus.result
@@ -0,0 +1,20 @@
+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)
+ORDER BY id;
+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 00000000..29975d55
--- /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 00000000..2294308a
--- /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 00000000..b61f0637
--- /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 00000000..e603cc27
--- /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 00000000..6a5dbd5c
--- /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 00000000..2fe63a68
--- /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 00000000..b58f4ad3
--- /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 00000000..d7b64010
--- /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 00000000..9aa60690
--- /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 00000000..6c73f462
--- /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 00000000..d3bdfca0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_index_recreate.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)
+) 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 00000000..c25b47c6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_select.result
@@ -0,0 +1,70 @@
+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 values (1, "aa ii uu ee oo");
+insert into t2 values (2, "ka ki ku ke ko");
+insert into t2 values (3, "aa ii ii ii oo");
+insert into t2 values (4, "sa si su se so");
+insert into t2 values (5, "ta ti ii ii to");
+select * from t1;
+c1 c2
+1 aa ii uu ee oo
+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")
+3 aa ii ii ii oo 524289
+5 ta ti ii ii to 349526
+1 aa ii uu ee oo 174763
+select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
+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
+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 00000000..f4719cbd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_insert_values.result
@@ -0,0 +1,17 @@
+drop table if exists t1, t2, t3;
+create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) 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 00000000..9d1e838b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_many_records.result
@@ -0,0 +1,4381 @@
+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"';
+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") order by id;
+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_matched_and_not_matched_have_where_matched_order.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_matched_order.result
new file mode 100644
index 00000000..def5db40
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_matched_order.result
@@ -0,0 +1,26 @@
+DROP TABLE IF EXISTS texts;
+SET NAMES UTF8;
+CREATE TABLE texts (
+id INT PRIMARY KEY,
+matched TEXT,
+not_matched TEXT,
+FULLTEXT KEY (matched),
+FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+SELECT id,
+matched,
+not_matched,
+MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+FROM texts
+WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE)
+ORDER BY MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE),
+id;
+id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+1 Hello1 World1 1 0
+2 Hello2 World2 1 0
+3 Hello3 World3 1 0
+DROP TABLE texts;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result
new file mode 100644
index 00000000..39ab80ed
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_have_where_no_order.result
@@ -0,0 +1,27 @@
+DROP TABLE IF EXISTS texts;
+SET NAMES UTF8;
+CREATE TABLE texts (
+id INT PRIMARY KEY,
+matched TEXT,
+not_matched TEXT,
+FULLTEXT KEY (matched),
+FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+SELECT *
+FROM (SELECT id,
+matched,
+not_matched,
+MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+FROM texts
+WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE))
+AS searched_texts
+ORDER BY id;
+id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+1 Hello1 World1 1 0
+2 Hello2 World2 1 0
+3 Hello3 World3 1 0
+DROP TABLE texts;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_no_where_both_order.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_no_where_both_order.result
new file mode 100644
index 00000000..f619e467
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_matched_and_not_matched_no_where_both_order.result
@@ -0,0 +1,26 @@
+DROP TABLE IF EXISTS texts;
+SET NAMES UTF8;
+CREATE TABLE texts (
+id INT PRIMARY KEY,
+matched TEXT,
+not_matched TEXT,
+FULLTEXT KEY (matched),
+FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+SELECT id,
+matched,
+not_matched,
+MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+FROM texts
+ORDER BY MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE),
+id;
+id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+1 Hello1 World1 1 0
+2 Hello2 World2 1 0
+3 Hello3 World3 1 0
+DROP TABLE texts;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result
new file mode 100644
index 00000000..fbdf241b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_delete.result
@@ -0,0 +1,23 @@
+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"';
+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 00000000..074d1991
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_insert.result
@@ -0,0 +1,29 @@
+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"';
+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 00000000..756a7021
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_recreate.result
@@ -0,0 +1,31 @@
+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"';
+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 00000000..db869eaa
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_column_index_update.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 (title, content),
+fulltext index (title),
+fulltext index (content)
+) 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 00000000..7121e510
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_multiple_index.result
@@ -0,0 +1,23 @@
+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;
+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 00000000..90376bdf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_myisam.result
@@ -0,0 +1,194 @@
+drop table if exists t1, t2, t3;
+create table t1 (c1 int primary key, c2 text, fulltext index ft (c2)) 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") order by c1;
+c1 c2 c3
+3 30 sa si su se so
+select * from t1 where match(c3) against("ii") order by c1;
+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) order by c1;
+c1 c2 c3
+3 30 sa si su se so
+select * from t1 where match(c3) against("+ii" in boolean mode) order by c1;
+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("富士山") order by c1;
+c1 c2 c3
+1 明日の富士山の天気について あああああああ
+select * from t1 where match(c3) against("富士山") order by c1;
+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")
+3 aa ii ii ii oo 524289
+5 ta ti ii ii to 349526
+1 aa ii uu ee oo 174763
+select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
+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
+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") order by c1;
+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 00000000..4646aad6
--- /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") order by c1;
+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") order by c1;
+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") order by c1;
+c1 c2 c3 match(c3) against("dummy")
+select * from t1 where not match(c3) against("dummy") order by c1;
+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") order by c1;
+c1 c2 c3
+4 10 ka ki ku ke ko
+select * from t1 where c1 <= 4 and not match(c3) against("uu") order by c1;
+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") order by c1;
+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") order by c1;
+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") order by c1;
+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") order by c1;
+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 00000000..f79798ce
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_TODO_SPLIT_ME.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS diaries;
+SET NAMES UTF8;
+CREATE TABLE ft(
+a INT DEFAULT 0,
+b TEXT,
+c TEXT,
+PRIMARY KEY(a),
+FULLTEXT KEY ftx1(b),
+FULLTEXT KEY ftx2(c)
+)ENGINE=Mroonga DEFAULT CHARSET=UTF8 COMMENT = 'engine "innodb"';
+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(c) AGAINST('bbbbb' IN BOOLEAN MODE);
+a b c
+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 00000000..3ee15c63
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result
@@ -0,0 +1,40 @@
+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;
+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/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 00000000..d31d5454
--- /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 00000000..39791b93
--- /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 00000000..550554ea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result
@@ -0,0 +1,160 @@
+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"';
+insert into shops (name, location)
+values ('nezu-no-taiyaki',
+ST_GeomFromText('POINT(139.762573 35.720253)'));
+insert into shops (name, location)
+values ('taiyaki-kataoka',
+ST_GeomFromText('POINT(139.715591 35.712521)'));
+insert into shops (name, location)
+values ('soba-taiyaki-ku',
+ST_GeomFromText('POINT(139.659088 35.683712)'));
+insert into shops (name, location)
+values ('kuruma',
+ST_GeomFromText('POINT(139.706207 35.721516)'));
+insert into shops (name, location)
+values ('hirose-ya',
+ST_GeomFromText('POINT(139.685608 35.714844)'));
+insert into shops (name, location)
+values ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+insert into shops (name, location)
+values ('omede-taiyaki',
+ST_GeomFromText('POINT(139.817154 35.700516)'));
+insert into shops (name, location)
+values ('onaga-ya',
+ST_GeomFromText('POINT(139.81105 35.698254)'));
+insert into shops (name, location)
+values ('shiro-ya',
+ST_GeomFromText('POINT(139.638611 35.705517)'));
+insert into shops (name, location)
+values ('fuji-ya',
+ST_GeomFromText('POINT(139.637115 35.703938)'));
+insert into shops (name, location)
+values ('miyoshi',
+ST_GeomFromText('POINT(139.537323 35.644539)'));
+insert into shops (name, location)
+values ('juju-ya',
+ST_GeomFromText('POINT(139.695755 35.628922)'));
+insert into shops (name, location)
+values ('tatsumi-ya',
+ST_GeomFromText('POINT(139.638657 35.665501)'));
+insert into shops (name, location)
+values ('tetsuji',
+ST_GeomFromText('POINT(139.76857 35.680912)'));
+insert into shops (name, location)
+values ('gazuma-ya',
+ST_GeomFromText('POINT(139.647598 35.700817)'));
+insert into shops (name, location)
+values ('honma-mon',
+ST_GeomFromText('POINT(139.652573 35.722736)'));
+insert into shops (name, location)
+values ('naniwa-ya',
+ST_GeomFromText('POINT(139.796234 35.730061)'));
+insert into shops (name, location)
+values ('kuro-dai',
+ST_GeomFromText('POINT(139.704834 35.650345)'));
+insert into shops (name, location)
+values ('daruma',
+ST_GeomFromText('POINT(139.770599 35.681461)'));
+insert into shops (name, location)
+values ('yanagi-ya',
+ST_GeomFromText('POINT(139.783981 35.685341)'));
+insert into shops (name, location)
+values ('sharaku',
+ST_GeomFromText('POINT(139.794846 35.716969)'));
+insert into shops (name, location)
+values ('takane',
+ST_GeomFromText('POINT(139.560913 35.698601)'));
+insert into shops (name, location)
+values ('chiyoda',
+ST_GeomFromText('POINT(139.652817 35.642601)'));
+insert into shops (name, location)
+values ('da-ka-po',
+ST_GeomFromText('POINT(139.727356 35.627346)'));
+insert into shops (name, location)
+values ('matsushima-ya',
+ST_GeomFromText('POINT(139.737381 35.640556)'));
+insert into shops (name, location)
+values ('kazuya',
+ST_GeomFromText('POINT(139.760895 35.673508)'));
+insert into shops (name, location)
+values ('furuya-kogane-an',
+ST_GeomFromText('POINT(139.676071 35.680603)'));
+insert into shops (name, location)
+values ('hachi-no-ie',
+ST_GeomFromText('POINT(139.668106 35.608021)'));
+insert into shops (name, location)
+values ('azuki-chan',
+ST_GeomFromText('POINT(139.673203 35.64151)'));
+insert into shops (name, location)
+values ('kuriko-an',
+ST_GeomFromText('POINT(139.796829 35.712013)'));
+insert into shops (name, location)
+values ('yume-no-aru-machi-no-taiyaki-ya-san',
+ST_GeomFromText('POINT(139.712524 35.616199)'));
+insert into shops (name, location)
+values ('naze-ya',
+ST_GeomFromText('POINT(139.665833 35.609039)'));
+insert into shops (name, location)
+values ('sanoki-ya',
+ST_GeomFromText('POINT(139.770721 35.66592)'));
+insert into shops (name, location)
+values ('shigeta',
+ST_GeomFromText('POINT(139.780273 35.672626)'));
+insert into shops (name, location)
+values ('nishimi-ya',
+ST_GeomFromText('POINT(139.774628 35.671825)'));
+insert into shops (name, location)
+values ('hiiragi',
+ST_GeomFromText('POINT(139.711517 35.647701)'));
+select id, name, ST_AsText(location) as location_text from shops;
+id name location_text
+1 nezu-no-taiyaki POINT(139.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, ST_AsText(location) as location_text from shops
+where MBRContains(ST_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 00000000..615d185f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result
@@ -0,0 +1,22 @@
+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"';
+insert into shops (name, location)
+values ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+select id, name, ST_AsText(location) as location_text from shops
+where MBRContains(ST_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(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+select id, name, ST_AsText(location) as location_text from shops
+where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+id name location_text
+select id, name, ST_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 00000000..adfb53e1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result
@@ -0,0 +1,27 @@
+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"';
+insert into shops (name, location)
+values ('sazare',
+ST_GeomFromText('POINT(139.685043 35.714653)'));
+select id, name, ST_AsText(location) as location_text from shops
+where MBRContains(ST_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, ST_AsText(location) as location_text from shops
+where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location);
+id name location_text
+update shops set location = ST_GeomFromText('POINT(139.66116 35.57566)')
+where name = 'sazare';
+select id, name, ST_AsText(location) as location_text from shops
+where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+id name location_text
+select id, name, ST_AsText(location) as location_text from shops
+where MBRContains(ST_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 00000000..3fbc85ff
--- /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 00000000..93c05bff
--- /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 00000000..552cf586
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/insert_bulk.result
@@ -0,0 +1,22 @@
+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"';
+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 00000000..f0ceb937
--- /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 00000000..97428b76
--- /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 00000000..aa7a32db
--- /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/multi_range_read_mysql_5_7_or_later_disk_sweep.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result
new file mode 100644
index 00000000..bf1e67b9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/multi_range_read_mysql_5_7_or_later_disk_sweep.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS integers;
+SET optimizer_switch='mrr_cost_based=off';
+CREATE TABLE integers (
+id INT PRIMARY KEY AUTO_INCREMENT,
+value INT,
+KEY (value)
+) COMMENT='engine "InnoDB"';
+INSERT INTO integers (value) VALUES (0), (1), (2), (3);
+EXPLAIN SELECT * FROM integers
+WHERE value IN (0, 2);
+id select_type table partitions type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE integers NULL range value value 5 NULL 2 100.00 Using where; Using MRR
+Warnings:
+Note 1003 /* select#1 */ select `test`.`integers`.`id` AS `id`,`test`.`integers`.`value` AS `value` from `test`.`integers` where (`test`.`integers`.`value` in (0,2))
+SELECT * FROM integers
+WHERE value IN (0, 2);
+id value
+1 0
+3 2
+DROP TABLE integers;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/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 00000000..66070060
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result
@@ -0,0 +1,53 @@
+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 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_direction.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result
new file mode 100644
index 00000000..9dd3e6ea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result
@@ -0,0 +1,27 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+content TEXT,
+FULLTEXT INDEX (content)
+) COMMENT = 'engine "InnoDB"';
+INSERT INTO memos VALUES(1, "Groonga is fast");
+INSERT INTO memos VALUES(2, "Mroonga is fast");
+INSERT INTO memos VALUES(3, "Mroonga is easy");
+INSERT INTO memos VALUES(4, "Mroonga is useful");
+INSERT INTO memos VALUES(5, "Mroonga is great");
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 0
+SELECT id, content
+FROM memos
+WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE)
+ORDER BY id
+LIMIT 2;
+id content
+2 Mroonga is fast
+3 Mroonga is easy
+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/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 00000000..b31d2ee5
--- /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/optimization_order_limit_order_by_primary_key.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result
new file mode 100644
index 00000000..eb5e04fc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result
@@ -0,0 +1,27 @@
+DROP TABLE IF EXISTS memos;
+FLUSH STATUS;
+CREATE TABLE memos (
+id int PRIMARY KEY,
+content TEXT,
+FULLTEXT INDEX (content)
+) COMMENT = 'engine "InnoDB"';
+INSERT INTO memos VALUES(1, "Mroonga is fast");
+INSERT INTO memos VALUES(2, "Mroonga is easy");
+INSERT INTO memos VALUES(3, "Mroonga is useful");
+INSERT INTO memos VALUES(4, "Mroonga is great");
+INSERT INTO memos VALUES(5, "Groonga is fast");
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+Variable_name Value
+Mroonga_fast_order_limit 0
+SELECT id, content
+FROM memos
+WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE)
+ORDER BY id DESC
+LIMIT 2;
+id content
+4 Mroonga is great
+3 Mroonga is useful
+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/wrapper/r/performance_schema.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result
new file mode 100644
index 00000000..c9af869f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result
@@ -0,0 +1,22 @@
+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 LIKE 'threads';
+Tables_in_performance_schema (threads)
+threads
+DROP TABLE diaries;
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 00000000..8258a03b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result
@@ -0,0 +1,31 @@
+CREATE DATABASE repair_test;
+USE repair_test;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT,
+FULLTEXT INDEX body_index (body)
+) COMMENT = 'engine "innodb"' 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(body) AGAINST("starting");
+id title body
+2 groonga (1) starting groonga...
+FLUSH TABLES;
+SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting");
+ERROR HY000: mroonga: failed to open table: <diaries>
+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 00000000..cca7aee9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result
@@ -0,0 +1,31 @@
+CREATE DATABASE repair_test;
+USE repair_test;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+body TEXT,
+FULLTEXT INDEX body_index (body)
+) COMMENT = 'engine "innodb"' 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(body) AGAINST("starting");
+id title body
+2 groonga (1) starting groonga...
+FLUSH TABLES;
+SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting");
+ERROR HY000: system call error: No such file or directory: failed to open path: <repair_test.mrn.000010A>
+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 00000000..d66b463d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/temporary_table.result
@@ -0,0 +1,14 @@
+DROP TEMPORARY TABLE IF EXISTS diaries;
+CREATE TEMPORARY TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT
+) 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 00000000..54afac7a
--- /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 00000000..8c61d9e8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_delete.result
@@ -0,0 +1,40 @@
+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;
+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=<\0001>
+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 00000000..0a424e77
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_rollback_delete_update.result
@@ -0,0 +1,37 @@
+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;
+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 00000000..296f87ad
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/truncate.result
@@ -0,0 +1,47 @@
+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"';
+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)
+ORDER BY id;
+id year month day title content
+1 2011 11 9 Hello 今日からはじめました。
+3 2011 11 11 富士山 今日も天気がよくてきれいに見える。
+TRUNCATE TABLE diaries;
+SELECT * FROM diaries;
+id year month day title content
+SELECT * FROM diaries
+WHERE MATCH(content) AGAINST("+今日" IN BOOLEAN MODE)
+ORDER BY id;
+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)
+ORDER BY id;
+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 00000000..655d2424
--- /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 00000000..5506f6b1
--- /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 00000000..ccc28a0f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_delete.result
@@ -0,0 +1,45 @@
+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"';
+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 00000000..a9bdd38f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_insert.result
@@ -0,0 +1,34 @@
+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"';
+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 00000000..b2fe4607
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_dry_write_update.result
@@ -0,0 +1,31 @@
+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"';
+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 00000000..9405879f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+tags TEXT,
+FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"';
+INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install");
+INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install");
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
+id title tags
+1 Hello groonga! groonga install
+SET GLOBAL mroonga_match_escalation_threshold = -1;
+USE test;
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
+id title tags
+SET GLOBAL mroonga_match_escalation_threshold = DEFAULT;
+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 00000000..fa2da48c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_session.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS diaries;
+CREATE TABLE diaries (
+id INT PRIMARY KEY AUTO_INCREMENT,
+title TEXT,
+tags TEXT,
+FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) 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/suite.opt b/storage/mroonga/mysql-test/mroonga/wrapper/suite.opt
new file mode 100644
index 00000000..d5a1e519
--- /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 00000000..7e4f8c17
--- /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 { not $::opt_embedded_server }
+
+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 00000000..92e48bb1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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;
+
+DROP TABLE diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test
new file mode 100644
index 00000000..21e80a74
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_cp932.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES cp932;
+
+CREATE TABLE users (
+ id int unsigned PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"';
+ALTER TABLE users
+ ADD COLUMN O text,
+ ADD FULLTEXT INDEX (O);
+
+INSERT INTO users (O) VALUES ("܂");
+INSERT INTO users (O) VALUES ("Ȃ");
+INSERT INTO users (O) VALUES ("");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test
new file mode 100644
index 00000000..f98d0e0d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_add_column_multibyte_utf8.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE users (
+ id int unsigned PRIMARY KEY AUTO_INCREMENT
+) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"';
+ALTER TABLE users
+ ADD COLUMN 名前 text,
+ ADD FULLTEXT INDEX (名前);
+
+INSERT INTO users (名前) VALUES ("やまだ");
+INSERT INTO users (名前) VALUES ("たなか");
+INSERT INTO users (名前) VALUES ("すずき");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_column_comment.test
new file mode 100644
index 00000000..024da5ec
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..fc0379f2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_change_engine.test
@@ -0,0 +1,59 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+SELECT table_name, engine, table_comment
+ FROM information_schema.tables
+ WHERE table_name = 'diaries';
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga...");
+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"';
+SELECT table_name, engine, table_comment
+ FROM information_schema.tables
+ WHERE table_name = 'diaries';
+
+SELECT * FROM diaries
+ WHERE MATCH(title) AGAINST("survey" IN BOOLEAN MODE) AND
+ 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 00000000..ff54f1b5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_comment_change_engine.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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"';
+SELECT table_name, table_comment
+ FROM information_schema.tables
+ WHERE table_name = 'memos';
+
+SELECT * FROM memos;
+SELECT * FROM memos WHERE MATCH(content) AGAINST("start" IN BOOLEAN MODE);
+
+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 00000000..80d3ee72
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..867ca370
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..4bf97aac
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..0eccfded
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..76cce0c9
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..de1af71d
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..9a8c9722
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_drop_column.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
+SELECT * FROM diaries;
+
+ALTER TABLE diaries DROP COLUMN body;
+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 00000000..84409307
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..1532c916
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..78707797
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2427353a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..7c3c7176
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..95220759
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_fulltext.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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");
+
+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 00000000..46c57f05
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_rename_table.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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");
+
+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 00000000..727557f8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test
@@ -0,0 +1,149 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS shops;
+--enable_warnings
+
+CREATE TABLE shops (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ name TEXT,
+ location GEOMETRY NOT NULL
+) COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO shops (name, location)
+ VALUES ('nezu-no-taiyaki',
+ ST_GeomFromText('POINT(139.762573 35.720253)'));
+INSERT INTO shops (name, location)
+ VALUES ('taiyaki-kataoka',
+ ST_GeomFromText('POINT(139.715591 35.712521)'));
+INSERT INTO shops (name, location)
+ VALUES ('soba-taiyaki-ku',
+ ST_GeomFromText('POINT(139.659088 35.683712)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuruma',
+ ST_GeomFromText('POINT(139.706207 35.721516)'));
+INSERT INTO shops (name, location)
+ VALUES ('hirose-ya',
+ ST_GeomFromText('POINT(139.685608 35.714844)'));
+INSERT INTO shops (name, location)
+ VALUES ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+INSERT INTO shops (name, location)
+ VALUES ('omede-taiyaki',
+ ST_GeomFromText('POINT(139.817154 35.700516)'));
+INSERT INTO shops (name, location)
+ VALUES ('onaga-ya',
+ ST_GeomFromText('POINT(139.81105 35.698254)'));
+INSERT INTO shops (name, location)
+ VALUES ('shiro-ya',
+ ST_GeomFromText('POINT(139.638611 35.705517)'));
+INSERT INTO shops (name, location)
+ VALUES ('fuji-ya',
+ ST_GeomFromText('POINT(139.637115 35.703938)'));
+INSERT INTO shops (name, location)
+ VALUES ('miyoshi',
+ ST_GeomFromText('POINT(139.537323 35.644539)'));
+INSERT INTO shops (name, location)
+ VALUES ('juju-ya',
+ ST_GeomFromText('POINT(139.695755 35.628922)'));
+INSERT INTO shops (name, location)
+ VALUES ('tatsumi-ya',
+ ST_GeomFromText('POINT(139.638657 35.665501)'));
+INSERT INTO shops (name, location)
+ VALUES ('tetsuji',
+ ST_GeomFromText('POINT(139.76857 35.680912)'));
+INSERT INTO shops (name, location)
+ VALUES ('gazuma-ya',
+ ST_GeomFromText('POINT(139.647598 35.700817)'));
+INSERT INTO shops (name, location)
+ VALUES ('honma-mon',
+ ST_GeomFromText('POINT(139.652573 35.722736)'));
+INSERT INTO shops (name, location)
+ VALUES ('naniwa-ya',
+ ST_GeomFromText('POINT(139.796234 35.730061)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuro-dai',
+ ST_GeomFromText('POINT(139.704834 35.650345)'));
+INSERT INTO shops (name, location)
+ VALUES ('daruma',
+ ST_GeomFromText('POINT(139.770599 35.681461)'));
+INSERT INTO shops (name, location)
+ VALUES ('yanagi-ya',
+ ST_GeomFromText('POINT(139.783981 35.685341)'));
+INSERT INTO shops (name, location)
+ VALUES ('sharaku',
+ ST_GeomFromText('POINT(139.794846 35.716969)'));
+INSERT INTO shops (name, location)
+ VALUES ('takane',
+ ST_GeomFromText('POINT(139.560913 35.698601)'));
+INSERT INTO shops (name, location)
+ VALUES ('chiyoda',
+ ST_GeomFromText('POINT(139.652817 35.642601)'));
+INSERT INTO shops (name, location)
+ VALUES ('da-ka-po',
+ ST_GeomFromText('POINT(139.727356 35.627346)'));
+INSERT INTO shops (name, location)
+ VALUES ('matsushima-ya',
+ ST_GeomFromText('POINT(139.737381 35.640556)'));
+INSERT INTO shops (name, location)
+ VALUES ('kazuya',
+ ST_GeomFromText('POINT(139.760895 35.673508)'));
+INSERT INTO shops (name, location)
+ VALUES ('furuya-kogane-an',
+ ST_GeomFromText('POINT(139.676071 35.680603)'));
+INSERT INTO shops (name, location)
+ VALUES ('hachi-no-ie',
+ ST_GeomFromText('POINT(139.668106 35.608021)'));
+INSERT INTO shops (name, location)
+ VALUES ('azuki-chan',
+ ST_GeomFromText('POINT(139.673203 35.64151)'));
+INSERT INTO shops (name, location)
+ VALUES ('kuriko-an',
+ ST_GeomFromText('POINT(139.796829 35.712013)'));
+INSERT INTO shops (name, location)
+ VALUES ('yume-no-aru-machi-no-taiyaki-ya-san',
+ ST_GeomFromText('POINT(139.712524 35.616199)'));
+INSERT INTO shops (name, location)
+ VALUES ('naze-ya',
+ ST_GeomFromText('POINT(139.665833 35.609039)'));
+INSERT INTO shops (name, location)
+ VALUES ('sanoki-ya',
+ ST_GeomFromText('POINT(139.770721 35.66592)'));
+INSERT INTO shops (name, location)
+ VALUES ('shigeta',
+ ST_GeomFromText('POINT(139.780273 35.672626)'));
+INSERT INTO shops (name, location)
+ VALUES ('nishimi-ya',
+ ST_GeomFromText('POINT(139.774628 35.671825)'));
+INSERT INTO shops (name, location)
+ VALUES ('hiiragi',
+ ST_GeomFromText('POINT(139.711517 35.647701)'));
+
+ALTER TABLE shops ADD SPATIAL KEY location_index (location);
+
+SELECT id, name, ST_AsText(location) AS location_text FROM shops
+ WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location);
+
+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 00000000..e8cd2585
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/auto_increment_text.test
@@ -0,0 +1,34 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..328d2f7d
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/check_table_for_upgrade.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test
new file mode 100644
index 00000000..f846cce7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/check_table_for_upgrade.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id int NOT NULL PRIMARY KEY,
+ content text,
+ FULLTEXT INDEX (content)
+) COMMENT='engine "InnoDB"';
+
+INSERT INTO memos VALUES (1, 'Hello MySQL');
+INSERT INTO memos VALUES (2, 'Hello Mroonga');
+
+CHECK TABLE memos FOR UPGRADE;
+
+FLUSH TABLES;
+
+SELECT * FROM memos
+ WHERE MATCH(content) AGAINST('+mroonga' IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_comment_index_not_for_mroonga.test
new file mode 100644
index 00000000..3213693e
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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_generated_stored_add_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test
new file mode 100644
index 00000000..b1c5a80c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_add_column.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
+ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';
+
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test
new file mode 100644
index 00000000..5ee4c000
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_delete.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+DELETE FROM logs WHERE id = 1;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test
new file mode 100644
index 00000000..4193b268
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_drop_column.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DROP COLUMN message;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test
new file mode 100644
index 00000000..bcea1738
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_insert.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test
new file mode 100644
index 00000000..130d41d1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_reindex.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DISABLE KEYS;
+ALTER TABLE logs ENABLE KEYS;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test
new file mode 100644
index 00000000..77562cb6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_stored_update.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED,
+ FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST("hut" IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test
new file mode 100644
index 00000000..68567b80
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_column.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+
+ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL;
+
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test
new file mode 100644
index 00000000..ebf7213b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_fulltext_index.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mariadb_10_2_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record)
+ VALUES (1, '{"level": "info", "message": "start server"}');
+
+ALTER TABLE logs ADD FULLTEXT INDEX (message);
+
+INSERT INTO logs(id, record)
+ VALUES (2, '{"level": "info", "message": "start server"}');
+INSERT INTO logs(id, record)
+ VALUES (3, '{"level": "warn", "message": "abort server"}');
+
+SELECT * FROM logs WHERE MATCH(message) AGAINST('+start' IN BOOLEAN MODE);
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test
new file mode 100644
index 00000000..c5719ff7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_add_index.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ level VARCHAR(255) GENERATED ALWAYS AS
+ (json_unquote(json_extract(`record`, '$.level'))) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record)
+ VALUES (1, '{"level": "info", "message": "start server"}');
+
+ALTER TABLE logs ADD INDEX (level);
+
+INSERT INTO logs(id, record)
+ VALUES (2, '{"level": "info", "message": "start server"}');
+INSERT INTO logs(id, record)
+ VALUES (3, '{"level": "warn", "message": "abort server"}');
+
+SELECT * FROM logs WHERE level = 'info';
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test
new file mode 100644
index 00000000..df371534
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_delete.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+DELETE FROM logs WHERE id = 1;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test
new file mode 100644
index 00000000..b025fd79
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_drop_column.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+ALTER TABLE logs DROP COLUMN message;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test
new file mode 100644
index 00000000..4ef127f3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_insert.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test
new file mode 100644
index 00000000..fe9b662b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_generated_virtual_update.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_version_5_7_or_later.inc
+--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS logs;
+--enable_warnings
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY,
+ record JSON,
+ message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
+) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
+
+INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
+INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
+INSERT INTO logs(id, record) VALUES (3, '{"level": "warn", "message": "abort"}');
+
+UPDATE logs SET record = '{"level": "info", "message": "shutdown"}' WHERE id = 2;
+
+SELECT * FROM logs;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test
new file mode 100644
index 00000000..5898e377
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_cp932.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES cp932;
+
+CREATE TABLE users (
+ id int unsigned PRIMARY KEY AUTO_INCREMENT,
+ O text,
+ FULLTEXT INDEX (O)
+) DEFAULT CHARSET=cp932 COMMENT='Engine "InnoDB"';
+
+INSERT INTO users (O) VALUES ("܂");
+INSERT INTO users (O) VALUES ("Ȃ");
+INSERT INTO users (O) VALUES ("");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (O) AGAINST ('+Ȃ' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test
new file mode 100644
index 00000000..c646a1d2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_multibyte_utf8.test
@@ -0,0 +1,53 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS users;
+--enable_warnings
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SET NAMES utf8;
+
+CREATE TABLE users (
+ id int unsigned PRIMARY KEY AUTO_INCREMENT,
+ 名前 text,
+ FULLTEXT INDEX (名前)
+) DEFAULT CHARSET=utf8 COMMENT='Engine "InnoDB"';
+
+INSERT INTO users (名前) VALUES ("やまだ");
+INSERT INTO users (名前) VALUES ("たなか");
+INSERT INTO users (名前) VALUES ("すずき");
+
+SELECT * FROM users;
+
+SELECT * FROM users
+ WHERE MATCH (名前) AGAINST ('+たなか' IN BOOLEAN MODE);
+
+SELECT mroonga_command("dump --dump_plugins no --dump_records no");
+
+DROP TABLE users;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test
new file mode 100644
index 00000000..802f5beb
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/column_normal_comment.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test
new file mode 100644
index 00000000..de9e8108
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star.test
@@ -0,0 +1,36 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ id int PRIMARY KEY
+) COMMENT='ENGINE "InnoDB"';
+
+INSERT INTO ids VALUES (1);
+INSERT INTO ids VALUES (2);
+INSERT INTO ids VALUES (3);
+
+SELECT COUNT(*) FROM ids;
+
+DROP TABLE ids;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test
new file mode 100644
index 00000000..9a082c69
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_mysql_5_7_or_later_with_index.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+CREATE TABLE diaries_innodb (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ body TEXT,
+ flag TINYINT(2),
+ INDEX (flag)
+) ENGINE = InnoDB DEFAULT CHARSET UTF8;
+
+CREATE TABLE diaries_mroonga (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ body TEXT,
+ flag TINYINT(2),
+ INDEX (flag)
+) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries_innodb (body) VALUES ("will start groonga!");
+INSERT INTO diaries_innodb (body) VALUES ("starting groonga...");
+INSERT INTO diaries_innodb (body) VALUES ("started groonga.");
+
+INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!");
+INSERT INTO diaries_mroonga (body) VALUES ("starting groonga...");
+INSERT INTO diaries_mroonga (body) VALUES ("started groonga.");
+
+EXPLAIN SELECT COUNT(*) FROM diaries_innodb;
+EXPLAIN SELECT COUNT(*) FROM diaries_mroonga;
+
+DROP TABLE diaries_innodb;
+DROP TABLE diaries_mroonga;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test
new file mode 100644
index 00000000..dce0899e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test
@@ -0,0 +1,57 @@
+# Copyright(C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+CREATE TABLE diaries_innodb (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ body TEXT,
+ flag TINYINT(2),
+ INDEX (flag)
+) ENGINE = InnoDB DEFAULT CHARSET UTF8;
+
+CREATE TABLE diaries_mroonga (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ body TEXT,
+ flag TINYINT(2),
+ INDEX (flag)
+) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8;
+
+INSERT INTO diaries_innodb (body) VALUES ("will start groonga!");
+INSERT INTO diaries_innodb (body) VALUES ("starting groonga...");
+INSERT INTO diaries_innodb (body) VALUES ("started groonga.");
+
+INSERT INTO diaries_mroonga (body) VALUES ("will start groonga!");
+INSERT INTO diaries_mroonga (body) VALUES ("starting groonga...");
+INSERT INTO diaries_mroonga (body) VALUES ("started groonga.");
+
+-- replace_column 9 #
+EXPLAIN SELECT COUNT(*) FROM diaries_innodb;
+-- replace_column 9 #
+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 00000000..997410b5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_TODO_SPLIT_ME.test
@@ -0,0 +1,101 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+# For MariaDB 10.2.3
+-- replace_result current_timestamp() CURRENT_TIMESTAMP
+desc t1;
+drop table t1;
+create table t1 (c1 datetime primary key) COMMENT = 'engine "innodb"';
+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 00000000..e6dd9908
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_comment_combined.test
@@ -0,0 +1,35 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+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_flags_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test
new file mode 100644
index 00000000..e5c66243
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_comment.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL PRIMARY KEY,
+ FULLTEXT INDEX (content) COMMENT 'flags "WITH_POSITION|WITH_WEIGHT"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+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/wrapper/t/create_table_flags_none.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test
new file mode 100644
index 00000000..e8b57a93
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_none.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL PRIMARY KEY,
+ FULLTEXT INDEX (content) COMMENT 'flags "NONE"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test
new file mode 100644
index 00000000..ca536cc3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_flags_parameter.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source include/have_innodb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL PRIMARY KEY,
+ FULLTEXT INDEX (content) FLAGS='WITH_POSITION|WITH_WEIGHT'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test
new file mode 100644
index 00000000..0b02780d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL PRIMARY KEY,
+ FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test
new file mode 100644
index 00000000..aa0737f4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.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
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL PRIMARY KEY,
+ FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no --dump_schema no");
+
+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/wrapper/t/create_table_normalizer_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test
new file mode 100644
index 00000000..b393c59a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_comment.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test
new file mode 100644
index 00000000..000d2d5b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_fulltext_index_bin.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+SHOW CREATE TABLE memos;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test
new file mode 100644
index 00000000..354d27c6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_normalizer_parameter.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL,
+ FULLTEXT INDEX (content) NORMALIZER='NormalizerAuto'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍");
+
+SELECT * FROM memos
+ WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE);
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test
new file mode 100644
index 00000000..064685d2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_parser_comment.test
@@ -0,0 +1,38 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--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)
+ comment 'parser "TokenBigramSplitSymbolAlphaDigit"'
+) comment = 'engine "innodb"' 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;
+select * from diaries where match(body) against("+start" in boolean mode) order by id;
+drop table diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test
new file mode 100644
index 00000000..45c75817
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_multiple_token_filters.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test
new file mode 100644
index 00000000..64732efd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_one_token_filter.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"'
+) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test
new file mode 100644
index 00000000..3fb0caea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_parameter.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_groonga_plugin_register.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("plugin_register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ id INT NOT NULL PRIMARY KEY,
+ content VARCHAR(64) NOT NULL,
+ FULLTEXT INDEX (content) TOKEN_FILTERS='TokenFilterStopWord,TokenFilterStopWord'
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE memos;
+
+SELECT mroonga_command("dump --dump_plugins no");
+
+DROP TABLE memos;
+
+--source ../../include/mroonga/unload_mroonga_functions.inc
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test
new file mode 100644
index 00000000..29233d01
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_comment.test
@@ -0,0 +1,37 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"'
+) comment = 'engine "innodb"' 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;
+select * from diaries where match(body) against("+start" in boolean mode) order by id;
+drop table diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test
new file mode 100644
index 00000000..072ad450
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_tokenizer_parameter.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mariadb.inc
+--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) TOKENIZER='TokenBigramSplitSymbolAlphaDigit'
+) COMMENT = 'ENGINE "InnoDB"' 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;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("+start" IN BOOLEAN MODE)
+ ORDER BY id;
+
+DROP TABLE diaries;
+
+--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 00000000..9491ba7f
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..50ebec44
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/delete_all.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/drop_table_new_connection.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test
new file mode 100644
index 00000000..5e761376
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/drop_table_new_connection.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ message TEXT,
+ FULLTEXT INDEX (message)
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+
+disable_query_log;
+CONNECT(drop_connection, localhost, root);
+enable_query_log;
+
+USE test;
+DROP TABLE logs;
+
+disable_query_log;
+CONNECTION default;
+enable_query_log;
+
+CREATE TABLE logs (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ message TEXT,
+ FULLTEXT INDEX (message)
+) COMMENT='ENGINE "InnoDB"' DEFAULT CHARSET=utf8;
+
+DROP TABLE logs;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test
new file mode 100644
index 00000000..92c6b3fd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_leading_not.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..5acbbe5c
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_multiple_match_against.test
@@ -0,0 +1,43 @@
+# 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-1335 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"';
+
+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 00000000..bbd8223b
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d49e7e92
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2f90b965
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..dffbb6e3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_no_operator.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY id;
+
+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 00000000..310ca900
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_minus.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY id;
+
+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 00000000..cd65c792
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_boolean_mode_pragma_default_operator_or_with_plus.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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)
+ ORDER BY id;
+
+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 00000000..3c8145f1
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..f7e45706
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..94069f9a
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5c36b04b
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a8ee6cf3
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..63379dcd
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..5f42b534
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..b7b5ccf2
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..afe22027
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..d013abb5
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..e6f3d811
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_index_recreate.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..38adadea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_select.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 values (1, "aa ii uu ee oo");
+insert into t2 values (2, "ka ki ku ke ko");
+insert into t2 values (3, "aa ii ii ii oo");
+insert into t2 values (4, "sa si su se so");
+insert into t2 values (5, "ta ti ii ii to");
+select * from t1;
+select * from t2;
+select * from t1 where c1=3;
+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 00000000..b8e55db4
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_insert_values.test
@@ -0,0 +1,34 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+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 00000000..a036a521
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_many_records.test
@@ -0,0 +1,4135 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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") order by id;
+
+drop table diaries;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test
new file mode 100644
index 00000000..306a12bd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_matched_order.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS texts;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE texts (
+ id INT PRIMARY KEY,
+ matched TEXT,
+ not_matched TEXT,
+ FULLTEXT KEY (matched),
+ FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+
+SELECT id,
+ matched,
+ not_matched,
+ MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+ FROM texts
+ WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE)
+ ORDER BY MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ id;
+
+DROP TABLE texts;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test
new file mode 100644
index 00000000..488af677
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_have_where_no_order.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS texts;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE texts (
+ id INT PRIMARY KEY,
+ matched TEXT,
+ not_matched TEXT,
+ FULLTEXT KEY (matched),
+ FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+
+SELECT *
+ FROM (SELECT id,
+ matched,
+ not_matched,
+ MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+ FROM texts
+ WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE))
+ AS searched_texts
+ ORDER BY id;
+
+DROP TABLE texts;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test
new file mode 100644
index 00000000..89a0804e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_matched_and_not_matched_no_where_both_order.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2012 Kentoku SHIBA
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS texts;
+--enable_warnings
+
+SET NAMES UTF8;
+CREATE TABLE texts (
+ id INT PRIMARY KEY,
+ matched TEXT,
+ not_matched TEXT,
+ FULLTEXT KEY (matched),
+ FULLTEXT KEY (not_matched)
+) DEFAULT CHARSET=UTF8 COMMENT='engine "InnoDB"';
+
+INSERT INTO texts VALUES (1, 'Hello1', 'World1');
+INSERT INTO texts VALUES (2, 'Hello2', 'World2');
+INSERT INTO texts VALUES (3, 'Hello3', 'World3');
+
+SELECT id,
+ matched,
+ not_matched,
+ MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
+ FROM texts
+ ORDER BY MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE),
+ id;
+
+DROP TABLE texts;
+
+--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 00000000..0d2e0056
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_delete.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+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 00000000..2886edaf
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_insert.test
@@ -0,0 +1,42 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+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 00000000..249abeed
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_recreate.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..63b5943f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_column_index_update.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+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 00000000..749b08ee
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_multiple_index.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..dc92fafd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_myisam.test
@@ -0,0 +1,101 @@
+# Copyright(C) 2010 Tetsuro IKEDA
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+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") order by c1;
+select * from t1 where match(c3) against("ii") order by c1;
+select * from t1 where match(c3) against("+su" in boolean mode) order by c1;
+select * from t1 where match(c3) against("+ii" in boolean mode) order by c1;
+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("富士山") order by c1;
+select * from t1 where match(c3) against("富士山") order by c1;
+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") order by c1;
+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 00000000..473fd2d7
--- /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-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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") order by c1;
+select * from t1 where not match(c3) against("uu") order by c1;
+select *,match(c3) against("dummy") from t1 where match(c3) against("dummy") order by c1;
+select * from t1 where not match(c3) against("dummy") order by c1;
+select * from t1 where c1 = 4 and not match(c3) against("uu") order by c1;
+select * from t1 where c1 <= 4 and not match(c3) against("uu") order by c1;
+select * from t1 where c1 > 4 and not match(c3) against("uu") order by c1;
+select * from t1 where c2 = 10 and not match(c3) against("uu") order by c1;
+select * from t1 where c2 >= 15 and not match(c3) against("uu") order by c1;
+select * from t1 where c2 < 15 and not match(c3) against("uu") order by c1;
+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 00000000..6949ecd6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_TODO_SPLIT_ME.test
@@ -0,0 +1,46 @@
+# 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-1335 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 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);
+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(c) AGAINST('bbbbb' IN BOOLEAN MODE);
+
+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 00000000..aa510012
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/fulltext_order_transaction.test
@@ -0,0 +1,73 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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;
+
+disable_query_log;
+CONNECT(search_connection, localhost, root);
+enable_query_log;
+USE test;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("groonga")
+ ORDER BY id;
+
+disable_query_log;
+CONNECTION default;
+enable_query_log;
+COMMIT;
+
+disable_query_log;
+CONNECTION search_connection;
+enable_query_log;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("groonga")
+ ORDER BY id;
+disable_query_log;
+DISCONNECT search_connection;
+enable_query_log;
+
+disable_query_log;
+CONNECTION default;
+enable_query_log;
+SELECT * FROM diaries
+ WHERE MATCH(body) AGAINST("groonga")
+ ORDER BY id;
+
+DROP TABLE diaries;
+
+--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 00000000..0423e948
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..046e9d74
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..80dc209a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test
@@ -0,0 +1,145 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+drop table if exists shops;
+--enable_warnings
+
+create table shops (
+ id int primary key auto_increment,
+ name text,
+ location geometry NOT NULL,
+ spatial key location_index (location)
+) comment = 'engine "innodb"';
+insert into shops (name, location)
+ values ('nezu-no-taiyaki',
+ ST_GeomFromText('POINT(139.762573 35.720253)'));
+insert into shops (name, location)
+ values ('taiyaki-kataoka',
+ ST_GeomFromText('POINT(139.715591 35.712521)'));
+insert into shops (name, location)
+ values ('soba-taiyaki-ku',
+ ST_GeomFromText('POINT(139.659088 35.683712)'));
+insert into shops (name, location)
+ values ('kuruma',
+ ST_GeomFromText('POINT(139.706207 35.721516)'));
+insert into shops (name, location)
+ values ('hirose-ya',
+ ST_GeomFromText('POINT(139.685608 35.714844)'));
+insert into shops (name, location)
+ values ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+insert into shops (name, location)
+ values ('omede-taiyaki',
+ ST_GeomFromText('POINT(139.817154 35.700516)'));
+insert into shops (name, location)
+ values ('onaga-ya',
+ ST_GeomFromText('POINT(139.81105 35.698254)'));
+insert into shops (name, location)
+ values ('shiro-ya',
+ ST_GeomFromText('POINT(139.638611 35.705517)'));
+insert into shops (name, location)
+ values ('fuji-ya',
+ ST_GeomFromText('POINT(139.637115 35.703938)'));
+insert into shops (name, location)
+ values ('miyoshi',
+ ST_GeomFromText('POINT(139.537323 35.644539)'));
+insert into shops (name, location)
+ values ('juju-ya',
+ ST_GeomFromText('POINT(139.695755 35.628922)'));
+insert into shops (name, location)
+ values ('tatsumi-ya',
+ ST_GeomFromText('POINT(139.638657 35.665501)'));
+insert into shops (name, location)
+ values ('tetsuji',
+ ST_GeomFromText('POINT(139.76857 35.680912)'));
+insert into shops (name, location)
+ values ('gazuma-ya',
+ ST_GeomFromText('POINT(139.647598 35.700817)'));
+insert into shops (name, location)
+ values ('honma-mon',
+ ST_GeomFromText('POINT(139.652573 35.722736)'));
+insert into shops (name, location)
+ values ('naniwa-ya',
+ ST_GeomFromText('POINT(139.796234 35.730061)'));
+insert into shops (name, location)
+ values ('kuro-dai',
+ ST_GeomFromText('POINT(139.704834 35.650345)'));
+insert into shops (name, location)
+ values ('daruma',
+ ST_GeomFromText('POINT(139.770599 35.681461)'));
+insert into shops (name, location)
+ values ('yanagi-ya',
+ ST_GeomFromText('POINT(139.783981 35.685341)'));
+insert into shops (name, location)
+ values ('sharaku',
+ ST_GeomFromText('POINT(139.794846 35.716969)'));
+insert into shops (name, location)
+ values ('takane',
+ ST_GeomFromText('POINT(139.560913 35.698601)'));
+insert into shops (name, location)
+ values ('chiyoda',
+ ST_GeomFromText('POINT(139.652817 35.642601)'));
+insert into shops (name, location)
+ values ('da-ka-po',
+ ST_GeomFromText('POINT(139.727356 35.627346)'));
+insert into shops (name, location)
+ values ('matsushima-ya',
+ ST_GeomFromText('POINT(139.737381 35.640556)'));
+insert into shops (name, location)
+ values ('kazuya',
+ ST_GeomFromText('POINT(139.760895 35.673508)'));
+insert into shops (name, location)
+ values ('furuya-kogane-an',
+ ST_GeomFromText('POINT(139.676071 35.680603)'));
+insert into shops (name, location)
+ values ('hachi-no-ie',
+ ST_GeomFromText('POINT(139.668106 35.608021)'));
+insert into shops (name, location)
+ values ('azuki-chan',
+ ST_GeomFromText('POINT(139.673203 35.64151)'));
+insert into shops (name, location)
+ values ('kuriko-an',
+ ST_GeomFromText('POINT(139.796829 35.712013)'));
+insert into shops (name, location)
+ values ('yume-no-aru-machi-no-taiyaki-ya-san',
+ ST_GeomFromText('POINT(139.712524 35.616199)'));
+insert into shops (name, location)
+ values ('naze-ya',
+ ST_GeomFromText('POINT(139.665833 35.609039)'));
+insert into shops (name, location)
+ values ('sanoki-ya',
+ ST_GeomFromText('POINT(139.770721 35.66592)'));
+insert into shops (name, location)
+ values ('shigeta',
+ ST_GeomFromText('POINT(139.780273 35.672626)'));
+insert into shops (name, location)
+ values ('nishimi-ya',
+ ST_GeomFromText('POINT(139.774628 35.671825)'));
+insert into shops (name, location)
+ values ('hiiragi',
+ ST_GeomFromText('POINT(139.711517 35.647701)'));
+select id, name, ST_AsText(location) as location_text from shops;
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location);
+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 00000000..cc4d50b8
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test
@@ -0,0 +1,48 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+drop table if exists shops;
+--enable_warnings
+
+create table shops (
+ id int primary key auto_increment,
+ name text,
+ location geometry NOT NULL,
+ spatial key location_index (location)
+) comment = 'engine "innodb"';
+
+insert into shops (name, location)
+ values ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+
+delete from shops
+ where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+
+select id, name, ST_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 00000000..b340cf71
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/have_geometry.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+drop table if exists shops;
+--enable_warnings
+
+create table shops (
+ id int primary key auto_increment,
+ name text,
+ location geometry NOT NULL,
+ spatial key location_index (location)
+) comment = 'engine "innodb"';
+
+insert into shops (name, location)
+ values ('sazare',
+ ST_GeomFromText('POINT(139.685043 35.714653)'));
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location);
+
+update shops set location = ST_GeomFromText('POINT(139.66116 35.57566)')
+ where name = 'sazare';
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
+select id, name, ST_AsText(location) as location_text from shops
+ where MBRContains(ST_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 00000000..89e87360
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..03aa71cd
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..e315ac5d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_bulk.test
@@ -0,0 +1,43 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..e7fba640
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_primary_key_myisam.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+# For MariaDB 10.2.3
+-- replace_result current_timestamp() CURRENT_TIMESTAMP
+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 00000000..dc5d8b5a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/insert_on_duplicate_key_update_multiple_column_unique_index_myisam.test
@@ -0,0 +1,51 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+# For MariaDB 10.2.3
+-- replace_result current_timestamp() CURRENT_TIMESTAMP
+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 00000000..436904e2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_disk_sweep.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2013-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql.inc
+--source ../../include/mroonga/have_version_5_6_or_later.inc
+--source ../../include/mroonga/skip_mysql_5_7_or_later.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--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/multi_range_read_mysql_5_7_or_later_disk_sweep.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test
new file mode 100644
index 00000000..c883e493
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/multi_range_read_mysql_5_7_or_later_disk_sweep.test
@@ -0,0 +1,44 @@
+# Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
+# Copyright(C) 2013-2016 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source ../../include/mroonga/have_mysql_5_7_or_later.inc
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS integers;
+--enable_warnings
+
+SET optimizer_switch='mrr_cost_based=off';
+
+CREATE TABLE integers (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ value INT,
+ KEY (value)
+) COMMENT='engine "InnoDB"';
+
+INSERT INTO integers (value) VALUES (0), (1), (2), (3);
+
+EXPLAIN SELECT * FROM integers
+ WHERE value IN (0, 2);
+
+SELECT * FROM integers
+ WHERE value IN (0, 2);
+
+DROP TABLE integers;
+
+--source ../../include/mroonga/have_mroonga_deinit.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test
new file mode 100644
index 00000000..a47e73f5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test
@@ -0,0 +1,60 @@
+# Copyright(C) 2010 Kentoku SHIBA
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 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_direction.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test
new file mode 100644
index 00000000..21180eb9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ content TEXT,
+ FULLTEXT INDEX (content)
+) COMMENT = 'engine "InnoDB"';
+
+INSERT INTO memos VALUES(1, "Groonga is fast");
+INSERT INTO memos VALUES(2, "Mroonga is fast");
+INSERT INTO memos VALUES(3, "Mroonga is easy");
+INSERT INTO memos VALUES(4, "Mroonga is useful");
+INSERT INTO memos VALUES(5, "Mroonga is great");
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+SELECT id, content
+ FROM memos
+ WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE)
+ ORDER BY id
+ LIMIT 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/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 00000000..d4032829
--- /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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/optimization_order_limit_order_by_primary_key.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test
new file mode 100644
index 00000000..2513df8e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test
@@ -0,0 +1,50 @@
+# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS memos;
+--enable_warnings
+
+FLUSH STATUS;
+
+CREATE TABLE memos (
+ id int PRIMARY KEY,
+ content TEXT,
+ FULLTEXT INDEX (content)
+) COMMENT = 'engine "InnoDB"';
+
+INSERT INTO memos VALUES(1, "Mroonga is fast");
+INSERT INTO memos VALUES(2, "Mroonga is easy");
+INSERT INTO memos VALUES(3, "Mroonga is useful");
+INSERT INTO memos VALUES(4, "Mroonga is great");
+INSERT INTO memos VALUES(5, "Groonga is fast");
+
+SHOW STATUS LIKE 'mroonga_fast_order_limit';
+
+SELECT id, content
+ FROM memos
+ WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE)
+ ORDER BY id DESC
+ LIMIT 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/wrapper/t/performance_schema-master.opt b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt
new file mode 100644
index 00000000..d2ed32dd
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt
@@ -0,0 +1 @@
+--loose-performance-schema
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test
new file mode 100644
index 00000000..6270ea66
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test
@@ -0,0 +1,41 @@
+# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.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 LIKE 'threads';
+
+DROP TABLE diaries;
+
+--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 00000000..5d9c5bd2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test
@@ -0,0 +1,58 @@
+# Copyright(C) 2013 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source ../../include/mroonga/skip_solaris.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+CREATE DATABASE repair_test;
+USE repair_test;
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ body TEXT,
+ FULLTEXT INDEX body_index (body)
+) COMMENT = 'engine "innodb"' 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(body) AGAINST("starting");
+
+--remove_files_wildcard $MYSQLD_DATADIR repair_test.mrn*
+
+FLUSH TABLES;
+
+# Error ER_CANT_OPEN_FILE mroonga: failed to open table: <diaries>
+--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 00000000..2fefadc2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test
@@ -0,0 +1,58 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source ../../include/mroonga/skip_solaris.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/have_mroonga_helper.inc
+
+CREATE DATABASE repair_test;
+USE repair_test;
+
+CREATE TABLE diaries (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ title TEXT,
+ body TEXT,
+ FULLTEXT INDEX body_index (body)
+) COMMENT = 'engine "innodb"' 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(body) AGAINST("starting");
+
+--remove_file $MYSQLD_DATADIR/repair_test.mrn.000010A
+
+FLUSH TABLES;
+
+# Error ER_CANT_OPEN_FILE system call error: No such file or directory: failed to open path: <repair_test.mrn.000010A>
+--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 00000000..e93f7f79
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/temporary_table.test
@@ -0,0 +1,39 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2014 Toshihisa Tashiro
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..4284f60a
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_query_cache.test
@@ -0,0 +1,63 @@
+# 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-1335 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);
+
+disable_query_log;
+CONNECT(second_connection, localhost, root);
+enable_query_log;
+USE test;
+START TRANSACTION;
+INSERT INTO simple_table (id) VALUES (3);
+
+disable_query_log;
+CONNECTION default;
+enable_query_log;
+SELECT * FROM simple_table;
+
+disable_query_log;
+CONNECTION second_connection;
+enable_query_log;
+COMMIT;
+
+disable_query_log;
+CONNECTION default;
+enable_query_log;
+SELECT * FROM simple_table;
+
+DROP TABLE simple_table;
+disable_query_log;
+DISCONNECT second_connection;
+enable_query_log;
+
+SET GLOBAL query_cache_size = @tmp_query_cache_size;
+
+--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 00000000..8d3a569d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_delete.test
@@ -0,0 +1,58 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..df568a79
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/transaction_rollback_delete_update.test
@@ -0,0 +1,55 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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;
+
+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 00000000..f538c3d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/truncate.test
@@ -0,0 +1,62 @@
+# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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)
+ ORDER BY id;
+TRUNCATE TABLE diaries;
+SELECT * FROM diaries;
+SELECT * FROM diaries
+ WHERE MATCH(content) AGAINST("+今日" IN BOOLEAN MODE)
+ ORDER BY id;
+
+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)
+ ORDER BY id;
+
+
+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 00000000..fae21d7b
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..a42c06e6
--- /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 <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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 00000000..2669423f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_delete.test
@@ -0,0 +1,54 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..5e369b24
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_insert.test
@@ -0,0 +1,46 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..f27e9c7d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_dry_write_update.test
@@ -0,0 +1,47 @@
+# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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"';
+
+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 00000000..a81468ea
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test
@@ -0,0 +1,60 @@
+# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ tags TEXT,
+ FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) DEFAULT CHARSET=UTF8 COMMENT='ENGINE "InnoDB"';
+
+INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install");
+INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install");
+
+
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
+
+# MySQL <= 5.5 reports a wrong warning. :<
+# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3.
+--disable_warnings
+SET GLOBAL mroonga_match_escalation_threshold = -1;
+--enable_warnings
+
+disable_query_log;
+CONNECT(search_connection, localhost, root);
+enable_query_log;
+USE test;
+
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
+
+disable_query_log;
+DISCONNECT search_connection;
+CONNECTION default;
+enable_query_log;
+
+SET GLOBAL mroonga_match_escalation_threshold = DEFAULT;
+
+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 00000000..94f1a3ca
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test
@@ -0,0 +1,52 @@
+# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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,
+ tags TEXT,
+ FULLTEXT INDEX tags_index (tags) COMMENT 'tokenizer "TokenDelimit"'
+) 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);
+
+SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
+
+# MySQL <= 5.5 reports a wrong 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