summaryrefslogtreecommitdiff
path: root/storage/mroonga
diff options
context:
space:
mode:
authorKentoku SHIBA <kentokushiba@gmail.com>2014-10-21 04:51:38 +0900
committerKentoku SHIBA <kentokushiba@gmail.com>2014-10-21 04:51:38 +0900
commit7f3d55508790c928fc57b6a6ada79c8202598a58 (patch)
tree7c48447bf47bff96844c5f2557ac9e185c6b9a92 /storage/mroonga
parent1cdd679ce574208fd52e08bb0e4429a55fea8fd2 (diff)
downloadmariadb-git-7f3d55508790c928fc57b6a6ada79c8202598a58.tar.gz
Update Mroonga to the latest version on 2014-10-21T04:51:38+0900
Diffstat (limited to 'storage/mroonga')
-rw-r--r--storage/mroonga/CMakeLists.txt35
-rw-r--r--storage/mroonga/Makefile.am1
-rw-r--r--storage/mroonga/configure.ac1
-rw-r--r--storage/mroonga/ha_mroonga.cpp653
-rw-r--r--storage/mroonga/ha_mroonga.hpp13
-rw-r--r--storage/mroonga/lib/libmrn_need_mysql_sources.am4
-rw-r--r--storage/mroonga/lib/libmrn_no_mysql_sources.am3
-rw-r--r--storage/mroonga/lib/mrn_database_manager.cpp341
-rw-r--r--storage/mroonga/lib/mrn_database_manager.hpp50
-rw-r--r--storage/mroonga/lib/mrn_encoding.cpp22
-rw-r--r--storage/mroonga/lib/mrn_encoding.hpp3
-rw-r--r--storage/mroonga/lib/mrn_field_normalizer.cpp2
-rw-r--r--storage/mroonga/lib/mrn_grn.hpp (renamed from storage/mroonga/mrn_sys.hpp)35
-rw-r--r--storage/mroonga/lib/mrn_path_mapper.cpp6
-rw-r--r--storage/mroonga/mrn_mysql.h1
-rw-r--r--storage/mroonga/mrn_sys.cpp88
-rw-r--r--storage/mroonga/mrn_table.cpp35
-rw-r--r--storage/mroonga/mrn_table.hpp4
-rw-r--r--storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc24
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/disabled.def7
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result19
-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_change_token_filter.result32
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result1
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_table_comment.result18
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_multiple_token_filters.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_one_token_filter.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_multiple_token_filters.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_one_token_filter.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result1
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/fulltext_token_filters_skip.result23
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than.result28
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than.result29
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.result30
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result2
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/insert_delayed.result9
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result2
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test43
-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_change_token_filter.test49
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test8
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_table_comment.test46
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_multiple_token_filters.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_one_token_filter.test40
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_multiple_token_filters.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_one_token_filter.test45
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test8
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test11
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/fulltext_token_filters_skip.test52
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test44
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test35
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/disabled.def2
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_multiple_token_filters.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_one_token_filter.result15
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result2
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_multiple_token_filters.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_one_token_filter.test42
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test2
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test1
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test1
-rw-r--r--storage/mroonga/packages/apt/Makefile.am35
-rw-r--r--storage/mroonga/packages/apt/Vagrantfile30
-rwxr-xr-xstorage/mroonga/packages/apt/build-deb.sh147
-rwxr-xr-xstorage/mroonga/packages/apt/build-in-chroot.sh134
-rw-r--r--storage/mroonga/packages/apt/env.sh.in (renamed from storage/mroonga/packages/apt/mroonga-depended-packages)4
-rw-r--r--storage/mroonga/packages/debian/changelog6
-rw-r--r--storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in3
-rw-r--r--storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in3
-rw-r--r--storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in14
-rw-r--r--storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in3
-rw-r--r--storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in3
-rw-r--r--storage/mroonga/packages/source/Makefile.am4
-rwxr-xr-xstorage/mroonga/packages/yum/sign-rpm.sh8
-rw-r--r--storage/mroonga/plugin_version2
-rw-r--r--storage/mroonga/sources.am2
-rw-r--r--storage/mroonga/test/unit/Makefile.am7
-rw-r--r--storage/mroonga/test/unit/test_mrn_sys.cpp95
-rwxr-xr-xstorage/mroonga/tools/travis/before_script.sh12
-rwxr-xr-xstorage/mroonga/tools/travis/install.sh2
-rwxr-xr-xstorage/mroonga/tools/travis/script.sh26
-rw-r--r--storage/mroonga/udf/mrn_udf_command.cpp28
-rw-r--r--storage/mroonga/udf/mrn_udf_snippet.cpp2
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt28
-rw-r--r--storage/mroonga/vendor/groonga/base_version2
-rw-r--r--storage/mroonga/vendor/groonga/benchmark/Makefile.am17
-rw-r--r--storage/mroonga/vendor/groonga/benchmark/bench-range-select.c274
-rw-r--r--storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m41
-rw-r--r--storage/mroonga/vendor/groonga/config.h.cmake1
-rw-r--r--storage/mroonga/vendor/groonga/configure.ac26
-rw-r--r--storage/mroonga/vendor/groonga/data/account/conoha.gpg.koubin0 -> 671 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service1
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp1
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http1
-rw-r--r--storage/mroonga/vendor/groonga/include/groonga.h9
-rw-r--r--storage/mroonga/vendor/groonga/include/groonga/Makefile.am1
-rw-r--r--storage/mroonga/vendor/groonga/include/groonga/token_filter.h71
-rw-r--r--storage/mroonga/vendor/groonga/include/groonga/tokenizer.h34
-rw-r--r--storage/mroonga/vendor/groonga/lib/CMakeLists.txt1
-rw-r--r--storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c2
-rw-r--r--storage/mroonga/vendor/groonga/lib/dat.cpp9
-rw-r--r--storage/mroonga/vendor/groonga/lib/dat.h3
-rw-r--r--storage/mroonga/vendor/groonga/lib/db.c303
-rw-r--r--storage/mroonga/vendor/groonga/lib/db.h15
-rw-r--r--storage/mroonga/vendor/groonga/lib/ecmascript.c292
-rw-r--r--storage/mroonga/vendor/groonga/lib/ecmascript.lemon7
-rw-r--r--storage/mroonga/vendor/groonga/lib/expr.c123
-rw-r--r--storage/mroonga/vendor/groonga/lib/expr.h7
-rw-r--r--storage/mroonga/vendor/groonga/lib/groonga_in.h3
-rw-r--r--storage/mroonga/vendor/groonga/lib/hash.c6
-rw-r--r--storage/mroonga/vendor/groonga/lib/hash.h1
-rw-r--r--storage/mroonga/vendor/groonga/lib/ii.c204
-rw-r--r--storage/mroonga/vendor/groonga/lib/io.h1
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb.h6
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c479
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h3
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_error.c185
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_error.h34
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c78
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c21
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb3
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb106
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb27
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/sources.am2
-rw-r--r--storage/mroonga/vendor/groonga/lib/output.c1
-rw-r--r--storage/mroonga/vendor/groonga/lib/pat.c5
-rw-r--r--storage/mroonga/vendor/groonga/lib/pat.h3
-rw-r--r--storage/mroonga/vendor/groonga/lib/plugin.c1
-rw-r--r--storage/mroonga/vendor/groonga/lib/proc.c317
-rw-r--r--storage/mroonga/vendor/groonga/lib/snip.c2
-rw-r--r--storage/mroonga/vendor/groonga/lib/sources.am1
-rw-r--r--storage/mroonga/vendor/groonga/lib/store.c47
-rw-r--r--storage/mroonga/vendor/groonga/lib/str.c2
-rw-r--r--storage/mroonga/vendor/groonga/lib/token.c287
-rw-r--r--storage/mroonga/vendor/groonga/lib/token.h30
-rw-r--r--storage/mroonga/vendor/groonga/lib/token_filter.c59
-rw-r--r--storage/mroonga/vendor/groonga/lib/tokenizer.c60
-rw-r--r--storage/mroonga/vendor/groonga/lib/util.c7
-rw-r--r--storage/mroonga/vendor/groonga/nginx_version2
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/Makefile.am59
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/Vagrantfile33
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/build-deb.sh134
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/build-in-chroot.sh134
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/env.sh.in13
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/groonga-depended-packages7
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/groonga-keyring-depended-packages1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/changelog10
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/copyright96
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default12
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init65
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install1
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in5
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in5
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/Makefile.am2
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/Rakefile46
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/Vagrantfile7
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/build-rpm.sh13
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh8
-rw-r--r--storage/mroonga/vendor/groonga/plugins/CMakeLists.txt3
-rw-r--r--storage/mroonga/vendor/groonga/plugins/Makefile.am3
-rw-r--r--storage/mroonga/vendor/groonga/plugins/suggest/suggest.c13
-rw-r--r--storage/mroonga/vendor/groonga/plugins/token_filters/CMakeLists.txt34
-rw-r--r--storage/mroonga/vendor/groonga/plugins/token_filters/Makefile.am20
-rw-r--r--storage/mroonga/vendor/groonga/plugins/token_filters/stop_word.c150
-rw-r--r--storage/mroonga/vendor/groonga/plugins/token_filters/stop_word_sources.am2
-rw-r--r--storage/mroonga/vendor/groonga/src/groonga.c4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/Makefile.am3
-rw-r--r--storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am49
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.c173
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.h75
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES)56
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES.ru)58
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/LICENSE)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/README)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/acc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/ccc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/clang)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/gcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/icc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/name)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/owc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/sunc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/define)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/endianness)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/feature)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have_headers)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/headers)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/include)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/init)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/geoip/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/google-perftools/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libgd/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libxslt/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.owc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.owc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.owc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/test)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.bcc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.msvc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.owc)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/make)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/modules)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/nohave)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/options)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/darwin)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/freebsd)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/linux)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/solaris)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32 (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/win32)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/sources)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/stubs)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/summary)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/sizeof)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/typedef)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/uintptr_t)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/value)0
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/unix)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi.conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi_params)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-utf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-win)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/mime.types)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/nginx.conf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/scgi_params)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/uwsgi_params)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/win-utf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/README)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/geo2nginx.pl)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/koi-utf)0
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/unicode-to-nginx.pl)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/win-utf)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/ftdetect/nginx.vim)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/indent/nginx.vim)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/syntax/nginx.vim)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/50x.html)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/index.html)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8 (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/man/nginx.8)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_aio_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_devpoll_module.c)31
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_epoll_module.c)29
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_eventport_module.c)31
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_kqueue_module.c)32
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_poll_module.c)54
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_rtsig_module.c)40
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_select_module.c)18
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_win32_select_module.c)14
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.c)32
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.h)36
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_accept.c)7
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.c)11
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.h)1
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_mutex.c)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.c)115
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl_stapling.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c35
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h48
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.c)30
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_access_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_addition_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_basic_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_request_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_autoindex_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_browser_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_charset_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_chunked_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_dav_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_degradation_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_empty_gif_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_fastcgi_module.c)28
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_flv_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geo_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geoip_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gunzip_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_static_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_headers_filter_module.c)54
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_image_filter_module.c)1
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_index_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_conn_module.c)227
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_req_module.c)120
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_log_module.c)58
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_map_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_memcached_module.c)24
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_mp4_module.c)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_not_modified_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_proxy_module.c)22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_random_index_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_range_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_realip_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_referer_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_rewrite_module.c)6
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_scgi_module.c)30
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_secure_link_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_split_clients_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_static_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_stub_status_module.c)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_sub_filter_module.c)8
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_hash_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_ip_hash_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_keepalive_module.c)22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_least_conn_module.c)5
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_userid_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_uwsgi_module.c)30
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_xslt_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/Makefile.PL)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.pm)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.xs)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.c)3
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/typemap)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.c)6
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_cache.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_copy_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.c)1
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.h)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_file_cache.c)4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_header_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse_time.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_postpone_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.c)6
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request_body.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.c)4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_filter_module.c)5
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_special_response.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.c)50
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.h)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.c)13
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.c)7
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_write_filter_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.c)3
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_auth_http_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_core_module.c)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_handler.c)2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_handler.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_parse.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_handler.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_proxy_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_handler.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_cpp_test_module.cpp)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_google_perftools_module.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read_chain.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write_chain.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_atomic.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.c)7
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_daemon.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_init.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_sendfile_chain.c)65
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_file_aio_read.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_init.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_sendfile_chain.c)63
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_amd64.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_ppc.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_sparc64.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_x86.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_aio_read.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_init.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_sendfile_chain.c)57
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_os.h)7
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_init.c)4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.c)9
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_pthread_thread.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_readv_chain.c)119
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_recv.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_send.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.h)4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_config.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_init.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_sendfilev_chain.c)53
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_amd64.il)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_atomic_sparc64.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_sparc64.il)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_x86.il)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_thread.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_udp_recv.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.c)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.h)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_writev_chain.c)52
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S (renamed from storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/rfork_thread.S)0
-rw-r--r--storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am9
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac1
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am39
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Vagrantfile27
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh115
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-in-chroot.sh134
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/env.sh.in8
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/groonga-normalizer-mysql-depended-packages4
-rw-r--r--storage/mroonga/version2
-rw-r--r--storage/mroonga/version_in_hex2
-rw-r--r--storage/mroonga/version_micro2
484 files changed, 6263 insertions, 3314 deletions
diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt
index 29801eb5ce6..5881bd5e9b2 100644
--- a/storage/mroonga/CMakeLists.txt
+++ b/storage/mroonga/CMakeLists.txt
@@ -33,6 +33,12 @@ else()
set(MRN_BUNDLED TRUE)
endif()
+if(MRN_BUNDLED)
+ if(WITHOUT_HA_MROONGA OR WITHOUT_HA_MROONGA_STORAGE_ENGINE)
+ return()
+ endif()
+endif()
+
set(MRN_BUNDLED_GROONGA_RELATIVE_DIR "vendor/groonga")
set(MRN_BUNDLED_GROONGA_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
@@ -85,24 +91,22 @@ set(MRN_C_COMPILE_FLAGS "")
set(MRN_CXX_COMPILE_FLAGS "")
macro(mrn_check_cflag flag)
- set(checking_message "checking for C flag '${flag}'")
- check_c_compiler_flag(${flag} is_available)
- if(${is_available})
- message(STATUS "${checking_message} - available")
+ string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
+ string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
+ set(temporary_variable_name "CFLAG${temporary_variable_name}")
+ check_c_compiler_flag(${flag} ${temporary_variable_name})
+ if(${temporary_variable_name})
set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}")
- else()
- message(STATUS "${checking_message} - not available")
endif()
endmacro()
macro(mrn_check_cxxflag flag)
- set(checking_message "checking for CXX flag '${flag}'")
- check_cxx_compiler_flag(${flag} is_available)
- if(${is_available})
- message(STATUS "${checking_message} - available")
+ string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
+ string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
+ set(temporary_variable_name "CXXFLAG${temporary_variable_name}")
+ check_cxx_compiler_flag(${flag} ${temporary_variable_name})
+ if(${temporary_variable_name})
set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}")
- else()
- message(STATUS "${checking_message} - not available")
endif()
endmacro()
@@ -157,8 +161,7 @@ set(MYSQL_INCLUDE_DIRS
"${MYSQL_SOURCE_DIR}/sql"
"${MYSQL_SOURCE_DIR}/include"
"${MYSQL_REGEX_INCLUDE_DIR}"
- "${MYSQL_SOURCE_DIR}"
- CACHE INTERNAL "MySQL include directories")
+ "${MYSQL_SOURCE_DIR}")
if(MRN_BUNDLED)
set(MYSQL_PLUGIN_DIR "${INSTALL_PLUGINDIR}")
@@ -340,9 +343,9 @@ if(GROONGA_NORMALIZER_MYSQL_FOUND)
endif()
endif()
-set(DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser")
+set(MRN_DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser")
set_property(TARGET ha_mroonga APPEND PROPERTY
- COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${DEFAULT_PARSER}\"")
+ COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${MRN_DEFAULT_PARSER}\"")
configure_file(
"${PROJECT_SOURCE_DIR}/mrn_version.h.in"
diff --git a/storage/mroonga/Makefile.am b/storage/mroonga/Makefile.am
index 250aefdd87c..32fc88ad061 100644
--- a/storage/mroonga/Makefile.am
+++ b/storage/mroonga/Makefile.am
@@ -154,4 +154,3 @@ misc:
exit 1; \
fi
ln -s "$(CUTTER_SOURCE_PATH)/misc" misc
-
diff --git a/storage/mroonga/configure.ac b/storage/mroonga/configure.ac
index dc39935d8ee..48312a44c8c 100644
--- a/storage/mroonga/configure.ac
+++ b/storage/mroonga/configure.ac
@@ -482,6 +482,7 @@ AC_OUTPUT([
mysql-test/mroonga/storage/information_schema/r/plugins.result
mysql-test/mroonga/storage/variable/r/version.result
packages/debian/control
+ packages/apt/env.sh
packages/rpm/centos/mysql55-mroonga.spec
packages/rpm/centos/mysql56-community-mroonga.spec
packages/rpm/centos/mariadb-mroonga.spec
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index e9906103fff..8b9a08b59dc 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -49,7 +49,6 @@
#ifdef WIN32
# include <math.h>
# include <direct.h>
-# define MRN_MKDIR(pathname, mode) _mkdir((pathname))
# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
type *variable_name = (type *)_malloca(sizeof(type) * (variable_size))
# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) _freea(variable_name)
@@ -65,7 +64,6 @@
#else
# include <dirent.h>
# include <unistd.h>
-# define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode))
# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
type variable_name[variable_size]
# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name)
@@ -89,6 +87,8 @@
#include <mrn_condition_converter.hpp>
#include <mrn_time_converter.hpp>
#include <mrn_smart_grn_obj.hpp>
+#include <mrn_database_manager.hpp>
+#include <mrn_grn.hpp>
#ifdef MRN_SUPPORT_FOREIGN_KEYS
# include <sql_table.h>
@@ -103,17 +103,17 @@
#ifdef MRN_HAVE_TDC_LOCK_TABLE_SHARE
# define mrn_open_mutex(share) &((share)->tdc.LOCK_table_share)
-# define mrn_open_mutex_lock(share) do { \
- TABLE_SHARE *share_ = share; \
- if (share_) { \
- mysql_mutex_lock(mrn_open_mutex(share_)); \
- } \
+# define mrn_open_mutex_lock(share) do { \
+ TABLE_SHARE *share_ = share; \
+ if (share_ && share_->tmp_table == NO_TMP_TABLE) { \
+ mysql_mutex_lock(mrn_open_mutex(share_)); \
+ } \
} while (0)
-# define mrn_open_mutex_unlock(share) do { \
- TABLE_SHARE *share_ = share; \
- if (share_) { \
- mysql_mutex_unlock(mrn_open_mutex(share_)); \
- } \
+# define mrn_open_mutex_unlock(share) do { \
+ TABLE_SHARE *share_ = share; \
+ if (share_ && share_->tmp_table == NO_TMP_TABLE) { \
+ mysql_mutex_unlock(mrn_open_mutex(share_)); \
+ } \
} while (0)
#else
# if MYSQL_VERSION_ID >= 50500
@@ -156,7 +156,7 @@ static pthread_mutex_t *mrn_LOCK_open;
# define st_mysql_plugin st_maria_plugin
# define mrn_declare_plugin(NAME) maria_declare_plugin(NAME)
# define mrn_declare_plugin_end maria_declare_plugin_end
-# define MRN_PLUGIN_LAST_VALUES MRN_VERSION, MariaDB_PLUGIN_MATURITY_BETA
+# define MRN_PLUGIN_LAST_VALUES MRN_VERSION, MariaDB_PLUGIN_MATURITY_STABLE
# define MRN_ABORT_ON_WARNING(thd) thd_kill_level(thd)
#else
# define mrn_declare_plugin(NAME) mysql_declare_plugin(NAME)
@@ -204,12 +204,10 @@ extern "C" {
#endif
/* groonga's internal functions */
-const char *grn_obj_get_value_(grn_ctx *ctx, grn_obj *obj, grn_id id, uint32 *size);
int grn_atoi(const char *nptr, const char *end, const char **rest);
uint grn_atoui(const char *nptr, const char *end, const char **rest);
/* global variables */
-static pthread_mutex_t mrn_db_mutex;
static pthread_mutex_t mrn_log_mutex;
handlerton *mrn_hton_ptr;
HASH mrn_open_tables;
@@ -220,7 +218,8 @@ pthread_mutex_t mrn_long_term_share_mutex;
/* internal variables */
static grn_ctx mrn_ctx;
static grn_obj *mrn_db;
-static grn_hash *mrn_hash;
+static grn_ctx mrn_db_manager_ctx;
+mrn::DatabaseManager *mrn_db_manager = NULL;
#ifdef WIN32
static inline double round(double x)
@@ -236,20 +235,7 @@ static void mrn_init_encoding_map()
static int mrn_change_encoding(grn_ctx *ctx, const CHARSET_INFO *charset)
{
- int error = 0;
- if (!mrn::encoding::set(ctx, charset)) {
- const char *name = "<null>";
- const char *csname = "<null>";
- if (charset) {
- name = charset->name;
- csname = charset->csname;
- }
- error = ER_MRN_CHARSET_NOT_SUPPORT_NUM;
- my_printf_error(error,
- ER_MRN_CHARSET_NOT_SUPPORT_STR,
- MYF(0), name, csname);
- }
- return error;
+ return mrn::encoding::set(ctx, charset);
}
#if !defined(DBUG_OFF) && !defined(_lint)
@@ -1001,32 +987,10 @@ static handler *mrn_handler_create(handlerton *hton, TABLE_SHARE *share, MEM_ROO
DBUG_RETURN(new_handler);
}
-static void mrn_drop_db(const char *path)
-{
- MRN_DBUG_ENTER_FUNCTION();
- mrn::PathMapper mapper(path);
- mrn::Lock lock(&mrn_db_mutex);
- grn_obj *db = NULL;
- if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) {
- struct stat dummy;
- if (stat(mapper.db_path(), &dummy) == 0) {
- db = grn_db_open(&mrn_ctx, mapper.db_path());
- }
- }
- if (db) {
- if (grn_obj_remove(&mrn_ctx, db)) {
- GRN_LOG(&mrn_ctx, GRN_LOG_ERROR,
- "cannot drop database (%s)", mapper.db_path());
- }
- }
- mrn_hash_remove(&mrn_ctx, mrn_hash, mapper.db_name());
- DBUG_VOID_RETURN;
-}
-
static void mrn_drop_database(handlerton *hton, char *path)
{
MRN_DBUG_ENTER_FUNCTION();
- mrn_drop_db(path);
+ mrn_db_manager->drop(path);
DBUG_VOID_RETURN;
}
@@ -1270,7 +1234,8 @@ static int mrn_set_geometry(grn_ctx *ctx, grn_obj *buf,
}
#endif
-static uint mrn_alter_table_flags(uint flags) {
+static uint mrn_alter_table_flags(uint flags)
+{
uint alter_flags = 0;
#ifdef HA_INPLACE_ADD_INDEX_NO_READ_WRITE
bool is_inplace_index_change;
@@ -1391,17 +1356,11 @@ static int mrn_init(void *p)
}
grn_ctx_use(ctx, mrn_db);
- // init hash
- if (!(mrn_hash = grn_hash_create(ctx, NULL,
- MRN_MAX_KEY_SIZE, sizeof(grn_obj *),
- GRN_OBJ_KEY_VAR_SIZE))) {
- GRN_LOG(ctx, GRN_LOG_ERROR, "cannot init hash, exiting");
- goto err_hash_create;
- }
-
- // init lock
- if ((pthread_mutex_init(&mrn_db_mutex, NULL) != 0)) {
- goto err_db_mutex_init;
+ grn_ctx_init(&mrn_db_manager_ctx, 0);
+ grn_logger_set(&mrn_db_manager_ctx, &mrn_logger);
+ mrn_db_manager = new mrn::DatabaseManager(&mrn_db_manager_ctx);
+ if (!mrn_db_manager->init()) {
+ goto err_db_manager_init;
}
if ((pthread_mutex_init(&mrn_allocated_thds_mutex, NULL) != 0)) {
goto err_allocated_thds_mutex_init;
@@ -1442,10 +1401,9 @@ err_allocated_open_tables_mutex_init:
error_allocated_thds_hash_init:
pthread_mutex_destroy(&mrn_allocated_thds_mutex);
err_allocated_thds_mutex_init:
- pthread_mutex_destroy(&mrn_db_mutex);
-err_db_mutex_init:
- grn_hash_close(ctx, mrn_hash);
-err_hash_create:
+err_db_manager_init:
+ delete mrn_db_manager;
+ grn_ctx_fin(&mrn_db_manager_ctx);
grn_obj_unlink(ctx, mrn_db);
err_db_create:
if (mrn_log_file_opened) {
@@ -1466,7 +1424,6 @@ static int mrn_deinit(void *p)
{
THD *thd = current_thd, *tmp_thd;
grn_ctx *ctx = &mrn_ctx;
- void *value;
MRN_LONG_TERM_SHARE *long_term_share;
GRN_LOG(ctx, GRN_LOG_NOTICE, "%s deinit", MRN_PACKAGE_STRING);
@@ -1498,15 +1455,10 @@ static int mrn_deinit(void *p)
pthread_mutex_destroy(&mrn_open_tables_mutex);
my_hash_free(&mrn_allocated_thds);
pthread_mutex_destroy(&mrn_allocated_thds_mutex);
- pthread_mutex_destroy(&mrn_db_mutex);
- GRN_HASH_EACH(ctx, mrn_hash, id, NULL, 0, &value, {
- grn_obj *db;
- memcpy(&db, value, sizeof(grn_obj *));
- grn_obj_unlink(ctx, db);
- });
- grn_hash_close(ctx, mrn_hash);
- grn_obj_unlink(ctx, mrn_db);
+ delete mrn_db_manager;
+ grn_ctx_fin(&mrn_db_manager_ctx);
+ grn_obj_unlink(ctx, mrn_db);
grn_ctx_fin(ctx);
grn_fin();
@@ -2284,7 +2236,6 @@ ulonglong ha_mroonga::storage_table_flags() const
HA_CAN_INDEX_BLOBS |
HA_STATS_RECORDS_IS_EXACT |
HA_CAN_FULLTEXT |
- HA_CAN_INSERT_DELAYED |
HA_BINLOG_FLAGS |
HA_CAN_BIT_FIELD |
HA_DUPLICATE_POS |
@@ -2628,6 +2579,16 @@ int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name,
grn_obj_unlink(ctx, tokenizer);
}
+ {
+ grn_obj token_filters;
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, 0);
+ if (find_token_filters(key_info, &token_filters)) {
+ grn_obj_set_info(ctx, index_table,
+ GRN_INFO_TOKEN_FILTERS, &token_filters);
+ }
+ grn_obj_unlink(ctx, &token_filters);
+ }
+
if (should_normalize(&key_info->key_part->field[0])) {
grn_info_type info_type = GRN_INFO_NORMALIZER;
grn_obj *normalizer = find_normalizer(key_info);
@@ -2724,7 +2685,7 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table,
MRN_DBUG_ENTER_METHOD();
int error = 0;
- error = ensure_database_create(name);
+ error = ensure_database_open(name);
if (error)
DBUG_RETURN(error);
@@ -2807,7 +2768,7 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
if (error)
DBUG_RETURN(error);
- error = ensure_database_create(name);
+ error = ensure_database_open(name);
if (error)
DBUG_RETURN(error);
@@ -2875,15 +2836,22 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
KEY key_info = table->s->key_info[pkey_nr];
int key_parts = KEY_N_KEY_PARTS(&key_info);
if (key_parts == 1) {
- Field *field = &(key_info.key_part->field[0]);
- if (should_normalize(field)) {
- grn_obj *normalizer = find_normalizer(&key_info);
- if (normalizer) {
- grn_info_type info_type = GRN_INFO_NORMALIZER;
- grn_obj_set_info(ctx, table_obj, info_type, normalizer);
- grn_obj_unlink(ctx, normalizer);
+ grn_obj *normalizer = NULL;
+ if (tmp_share->normalizer) {
+ normalizer = grn_ctx_get(ctx,
+ tmp_share->normalizer,
+ tmp_share->normalizer_length);
+ } else {
+ Field *field = &(key_info.key_part->field[0]);
+ if (should_normalize(field)) {
+ normalizer = find_normalizer(&key_info);
}
}
+ if (normalizer) {
+ grn_info_type info_type = GRN_INFO_NORMALIZER;
+ grn_obj_set_info(ctx, table_obj, info_type, normalizer);
+ grn_obj_unlink(ctx, normalizer);
+ }
if (tmp_share->default_tokenizer) {
grn_obj *default_tokenizer =
grn_ctx_get(ctx,
@@ -2895,6 +2863,17 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
grn_obj_unlink(ctx, default_tokenizer);
}
}
+ if (tmp_share->token_filters) {
+ grn_obj token_filters;
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, 0);
+ if (find_token_filters_fill(&token_filters,
+ tmp_share->token_filters,
+ tmp_share->token_filters_length)) {
+ grn_obj_set_info(ctx, table_obj,
+ GRN_INFO_TOKEN_FILTERS, &token_filters);
+ }
+ grn_obj_unlink(ctx, &token_filters);
+ }
}
}
@@ -3303,6 +3282,16 @@ int ha_mroonga::storage_create_index_table(TABLE *table,
grn_obj_set_info(ctx, index_table, info_type, tokenizer);
grn_obj_unlink(ctx, tokenizer);
}
+
+ {
+ grn_obj token_filters;
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, 0);
+ if (find_token_filters(key_info, &token_filters)) {
+ grn_obj_set_info(ctx, index_table,
+ GRN_INFO_TOKEN_FILTERS, &token_filters);
+ }
+ grn_obj_unlink(ctx, &token_filters);
+ }
}
{
@@ -3471,175 +3460,18 @@ int ha_mroonga::storage_create_indexes(TABLE *table, const char *grn_table_name,
DBUG_RETURN(error);
}
-int ha_mroonga::close_databases()
-{
- MRN_DBUG_ENTER_METHOD();
-
- int error = 0;
- mrn::Lock lock(&mrn_db_mutex);
-
- grn_hash_cursor *hash_cursor;
- hash_cursor = grn_hash_cursor_open(&mrn_ctx, mrn_hash,
- NULL, 0, NULL, 0,
- 0, -1, 0);
- if (mrn_ctx.rc) {
- my_message(ER_ERROR_ON_READ, mrn_ctx.errbuf, MYF(0));
- DBUG_RETURN(ER_ERROR_ON_READ);
- }
-
- while (grn_hash_cursor_next(&mrn_ctx, hash_cursor) != GRN_ID_NIL) {
- if (mrn_ctx.rc) {
- error = ER_ERROR_ON_READ;
- my_message(error, mrn_ctx.errbuf, MYF(0));
- break;
- }
- void *value;
- grn_obj *db;
- grn_hash_cursor_get_value(&mrn_ctx, hash_cursor, &value);
- memcpy(&db, value, sizeof(grn_obj *));
- grn_rc rc = grn_hash_cursor_delete(&mrn_ctx, hash_cursor, NULL);
- if (rc)
- {
- error = ER_ERROR_ON_READ;
- my_message(error, mrn_ctx.errbuf, MYF(0));
- break;
- }
- grn_obj_close(&mrn_ctx, db);
- }
- grn_hash_cursor_close(&mrn_ctx, hash_cursor);
-
- DBUG_RETURN(error);
-}
-
-void ha_mroonga::ensure_database_directory()
-{
- MRN_DBUG_ENTER_METHOD();
-
- const char *path_prefix = mrn::PathMapper::default_path_prefix;
- if (!path_prefix)
- DBUG_VOID_RETURN;
-
- const char *last_path_separator;
- last_path_separator = strrchr(path_prefix, FN_LIBCHAR);
- if (!last_path_separator)
- last_path_separator = strrchr(path_prefix, FN_LIBCHAR2);
- if (!last_path_separator)
- DBUG_VOID_RETURN;
- if (path_prefix == last_path_separator)
- DBUG_VOID_RETURN;
-
- char database_directory[MRN_MAX_PATH_SIZE];
- size_t database_directory_length = last_path_separator - path_prefix;
- strncpy(database_directory, path_prefix, database_directory_length);
- database_directory[database_directory_length] = '\0';
- mkdir_p(database_directory);
-
- DBUG_VOID_RETURN;
-}
-
-int ha_mroonga::ensure_normalizers_register()
-{
- MRN_DBUG_ENTER_METHOD();
-
- int error = 0;
-#ifdef WITH_GROONGA_NORMALIZER_MYSQL
- {
- grn_obj *mysql_normalizer;
- mysql_normalizer = grn_ctx_get(ctx, "NormalizerMySQLGeneralCI", -1);
- if (mysql_normalizer) {
- grn_obj_unlink(ctx, mysql_normalizer);
- } else {
-#ifdef GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC
- char ref_path[FN_REFLEN + 1], *tmp;
- tmp = strmov(ref_path, opt_plugin_dir);
- tmp = strmov(tmp, "/ha_mroonga");
- strcpy(tmp, SO_EXT);
- grn_plugin_register_by_path(ctx, ref_path);
-#else
- grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
-#endif
- }
- }
-#endif
-
- DBUG_RETURN(error);
-}
-
-int ha_mroonga::ensure_database_create(const char *name)
-{
- int error;
-
- MRN_DBUG_ENTER_METHOD();
- /* before creating table, we must check if database is alreadly opened, created */
- grn_obj *db;
- struct stat db_stat;
-
- error = mrn_change_encoding(ctx, system_charset_info);
- if (error)
- DBUG_RETURN(error);
-
- mrn::PathMapper mapper(name);
- {
- mrn::Lock lock(&mrn_db_mutex);
- if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) {
- if (stat(mapper.db_path(), &db_stat)) {
- // creating new database
- GRN_LOG(ctx, GRN_LOG_INFO,
- "database not found. creating...(%s)", mapper.db_path());
- if (name[0] == FN_CURLIB &&
- (name[1] == FN_LIBCHAR || name[1] == FN_LIBCHAR2)) {
- ensure_database_directory();
- }
- db = grn_db_create(&mrn_ctx, mapper.db_path(), NULL);
- if (mrn_ctx.rc) {
- error = ER_CANT_CREATE_TABLE;
- my_message(error, mrn_ctx.errbuf, MYF(0));
- DBUG_RETURN(error);
- }
- } else {
- // opening existing database
- db = grn_db_open(&mrn_ctx, mapper.db_path());
- if (mrn_ctx.rc) {
- error = ER_CANT_OPEN_FILE;
- my_message(error, mrn_ctx.errbuf, MYF(0));
- DBUG_RETURN(error);
- }
- }
- mrn_hash_put(&mrn_ctx, mrn_hash, mapper.db_name(), db);
- }
- }
- grn_ctx_use(ctx, db);
- error = ensure_normalizers_register();
-
- DBUG_RETURN(error);
-}
-
int ha_mroonga::ensure_database_open(const char *name)
{
int error;
MRN_DBUG_ENTER_METHOD();
- grn_obj *db;
- error = mrn_change_encoding(ctx, system_charset_info);
+ grn_obj *db;
+ error = mrn_db_manager->open(name, &db);
if (error)
DBUG_RETURN(error);
- mrn::PathMapper mapper(name);
- {
- mrn::Lock lock(&mrn_db_mutex);
- if (!mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) {
- db = grn_db_open(&mrn_ctx, mapper.db_path());
- if (mrn_ctx.rc) {
- error = ER_CANT_OPEN_FILE;
- my_message(error, mrn_ctx.errbuf, MYF(0));
- DBUG_RETURN(error);
- }
- mrn_hash_put(&mrn_ctx, mrn_hash, mapper.db_name(), db);
- }
- }
grn_ctx_use(ctx, db);
- error = ensure_normalizers_register();
DBUG_RETURN(error);
}
@@ -3654,15 +3486,9 @@ int ha_mroonga::ensure_database_remove(const char *name)
if (error)
DBUG_RETURN(error);
+ mrn_db_manager->close(name);
+
mrn::PathMapper mapper(name);
- {
- mrn::Lock lock(&mrn_db_mutex);
- grn_obj *db;
- if (mrn_hash_get(&mrn_ctx, mrn_hash, mapper.db_name(), &db)) {
- mrn_hash_remove(&mrn_ctx, mrn_hash, mapper.db_name());
- grn_obj_close(&mrn_ctx, db);
- }
- }
remove_related_files(mapper.db_path());
DBUG_RETURN(error);
@@ -3708,7 +3534,7 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked)
error = ensure_database_remove(name);
if (error)
DBUG_RETURN(error);
- error = ensure_database_create(name);
+ error = ensure_database_open(name);
if (error)
DBUG_RETURN(error);
grn_table = NULL;
@@ -4354,7 +4180,7 @@ int ha_mroonga::close()
mrn::Lock lock(&mrn_open_tables_mutex);
if (!mrn_open_tables.records)
{
- int tmp_error = close_databases();
+ int tmp_error = mrn_db_manager->clear();
if (tmp_error)
error = tmp_error;
}
@@ -4543,7 +4369,7 @@ int ha_mroonga::delete_table(const char *name)
mrn_free_tmp_table_share(tmp_table_share);
mrn_open_mutex_unlock(NULL);
if (is_temporary_table_name(name)) {
- mrn_drop_db(name);
+ mrn_db_manager->drop(name);
}
DBUG_RETURN(error);
}
@@ -6374,7 +6200,10 @@ int ha_mroonga::storage_prepare_delete_row_unique_index(const uchar *buf,
uint32 ukey_size = 0;
MRN_DBUG_ENTER_METHOD();
if (KEY_N_KEY_PARTS(key_info) == 1) {
- ukey = grn_obj_get_value_(ctx, index_column, record_id, &ukey_size);
+ GRN_BULK_REWIND(&key_buffer);
+ grn_obj_get_value(ctx, index_column, record_id, &key_buffer);
+ ukey = GRN_TEXT_VALUE(&key_buffer);
+ ukey_size = GRN_TEXT_LEN(&key_buffer);
} else {
mrn_change_encoding(ctx, NULL);
uchar key[MRN_MAX_KEY_SIZE];
@@ -6777,12 +6606,32 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
bool is_multiple_column_index = KEY_N_KEY_PARTS(&key_info) > 1;
if (is_multiple_column_index) {
mrn_change_encoding(ctx, NULL);
- flags |= GRN_CURSOR_PREFIX;
uint key_length = calculate_key_len(table, active_index, key, keypart_map);
- key_min = key_min_entity;
- storage_encode_multiple_column_key(&key_info,
- key, key_length,
- key_min, &size_min);
+ DBUG_PRINT("info",
+ ("mroonga: multiple column index: "
+ "search key length=<%u>, "
+ "multiple column index key length=<%u>",
+ key_length, key_info.key_length));
+ if (key_length == key_info.key_length) {
+ if (find_flag == HA_READ_BEFORE_KEY ||
+ find_flag == HA_READ_PREFIX_LAST_OR_PREV) {
+ key_max = key_max_entity;
+ storage_encode_multiple_column_key(&key_info,
+ key, key_length,
+ key_max, &size_max);
+ } else {
+ key_min = key_min_entity;
+ storage_encode_multiple_column_key(&key_info,
+ key, key_length,
+ key_min, &size_min);
+ }
+ } else {
+ flags |= GRN_CURSOR_PREFIX;
+ key_min = key_min_entity;
+ storage_encode_multiple_column_key(&key_info,
+ key, key_length,
+ key_min, &size_min);
+ }
} else if (mrn_is_geo_key(&key_info)) {
error = mrn_change_encoding(ctx, key_info.key_part->field->charset());
if (error)
@@ -6819,10 +6668,8 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
}
- } else if (
- find_flag == HA_READ_BEFORE_KEY ||
- find_flag == HA_READ_PREFIX_LAST_OR_PREV
- ) {
+ } else if (find_flag == HA_READ_BEFORE_KEY ||
+ find_flag == HA_READ_PREFIX_LAST_OR_PREV) {
key_max = key_max_entity;
storage_encode_key(field, key, key_max_entity, &size_max);
} else {
@@ -8264,49 +8111,6 @@ bool ha_mroonga::get_error_message(int error, String *buf)
DBUG_RETURN(temporary_error);
}
-void ha_mroonga::mkdir_p(const char *directory)
-{
- MRN_DBUG_ENTER_METHOD();
-
- int i = 0;
- char sub_directory[MRN_MAX_PATH_SIZE];
- sub_directory[0] = '\0';
- while (true) {
- if (directory[i] == FN_LIBCHAR ||
- directory[i] == FN_LIBCHAR2 ||
- directory[i] == '\0') {
- sub_directory[i] = '\0';
- struct stat directory_status;
- if (stat(sub_directory, &directory_status) != 0) {
- DBUG_PRINT("info", ("mroonga: creating directory: <%s>", sub_directory));
- GRN_LOG(ctx, GRN_LOG_INFO, "creating directory: <%s>", sub_directory);
- if (MRN_MKDIR(sub_directory, S_IRWXU) == 0) {
- DBUG_PRINT("info",
- ("mroonga: created directory: <%s>", sub_directory));
- GRN_LOG(ctx, GRN_LOG_INFO, "created directory: <%s>", sub_directory);
- } else {
- DBUG_PRINT("error",
- ("mroonga: failed to create directory: <%s>: <%s>",
- sub_directory, strerror(errno)));
- GRN_LOG(ctx, GRN_LOG_ERROR,
- "failed to create directory: <%s>: <%s>",
- sub_directory, strerror(errno));
- DBUG_VOID_RETURN;
- }
- }
- }
-
- if (directory[i] == '\0') {
- break;
- }
-
- sub_directory[i] = directory[i];
- ++i;
- }
-
- DBUG_VOID_RETURN;
-}
-
ulonglong ha_mroonga::file_size(const char *path)
{
MRN_DBUG_ENTER_METHOD();
@@ -8636,6 +8440,117 @@ grn_obj *ha_mroonga::find_normalizer(KEY *key_info)
DBUG_RETURN(normalizer);
}
+bool ha_mroonga::find_token_filters(KEY *key_info, grn_obj *token_filters)
+{
+ MRN_DBUG_ENTER_METHOD();
+ bool found = false;
+#if MYSQL_VERSION_ID >= 50500
+ if (key_info->comment.length > 0) {
+ mrn::ParametersParser parser(key_info->comment.str,
+ key_info->comment.length);
+ parser.parse();
+ const char *names = parser["token_filters"];
+ if (names) {
+ found = find_token_filters_fill(token_filters, names, strlen(names));
+ }
+ }
+#endif
+ DBUG_RETURN(found);
+}
+
+bool ha_mroonga::find_token_filters_put(grn_obj *token_filters,
+ const char *token_filter_name,
+ int token_filter_name_length)
+{
+ grn_obj *token_filter;
+
+ token_filter = grn_ctx_get(ctx,
+ token_filter_name,
+ token_filter_name_length);
+ if (token_filter) {
+ GRN_PTR_PUT(ctx, token_filters, token_filter);
+ return true;
+ } else {
+ char message[MRN_BUFFER_SIZE];
+ sprintf(message,
+ "nonexistent token filter: <%.*s>",
+ token_filter_name_length, token_filter_name);
+ push_warning(ha_thd(),
+ Sql_condition::WARN_LEVEL_WARN, ER_UNSUPPORTED_EXTENSION,
+ message);
+ return false;
+ }
+}
+
+bool ha_mroonga::find_token_filters_fill(grn_obj *token_filters,
+ const char *token_filter_names,
+ int token_filter_names_length)
+{
+ const char *start, *current, *end;
+ const char *name_start, *name_end;
+ const char *last_name_end;
+
+ start = token_filter_names;
+ end = start + token_filter_names_length;
+ current = start;
+ name_start = NULL;
+ name_end = NULL;
+ last_name_end = start;
+ while (current < end) {
+ switch (current[0]) {
+ case ' ' :
+ if (name_start && !name_end) {
+ name_end = current;
+ }
+ break;
+ case ',' :
+ if (!name_start) {
+ goto break_loop;
+ }
+ if (!name_end) {
+ name_end = current;
+ }
+ find_token_filters_put(token_filters,
+ name_start,
+ name_end - name_start);
+ last_name_end = name_end + 1;
+ name_start = NULL;
+ name_end = NULL;
+ break;
+ default :
+ if (!name_start) {
+ name_start = current;
+ }
+ break;
+ }
+ current++;
+ }
+
+break_loop:
+ if (!name_start) {
+ char message[MRN_BUFFER_SIZE];
+ sprintf(message,
+ "empty token filter name: "
+ "<%.*s|%.*s|%.*s>",
+ (int)(last_name_end - start), start,
+ (int)(current - last_name_end), last_name_end,
+ (int)(end - current), current);
+ push_warning(ha_thd(),
+ Sql_condition::WARN_LEVEL_WARN, ER_UNSUPPORTED_EXTENSION,
+ message);
+ return false;
+ }
+
+ if (!name_end) {
+ name_end = current;
+ }
+ find_token_filters_put(token_filters,
+ name_start,
+ name_end - name_start);
+
+ return true;
+}
+
int ha_mroonga::wrapper_get_record(uchar *buf, const uchar *key)
{
MRN_DBUG_ENTER_METHOD();
@@ -9664,8 +9579,8 @@ void ha_mroonga::storage_store_field_integer(Field *field,
field_value = *((unsigned char *)value);
field->store(field_value, is_unsigned);
} else {
- char field_value;
- field_value = *((char *)value);
+ signed char field_value;
+ field_value = *((signed char *)value);
field->store(field_value, is_unsigned);
}
break;
@@ -10079,6 +9994,60 @@ void ha_mroonga::storage_store_field(Field *field,
}
}
+void ha_mroonga::storage_store_field_column(Field *field,
+ int nth_column, grn_id record_id)
+{
+ MRN_DBUG_ENTER_METHOD();
+
+ grn_obj *column = grn_columns[nth_column];
+ grn_id range_id = grn_obj_get_range(ctx, column);
+ grn_obj *range = grn_column_ranges[nth_column];
+ grn_obj *value = &new_value_buffer;
+
+ if (mrn::grn::is_table(range)) {
+ if (mrn::grn::is_vector_column(column)) {
+ grn_obj_reinit(ctx, value, range_id, GRN_OBJ_VECTOR);
+ grn_obj_get_value(ctx, column, record_id, value);
+
+ // TODO: Check whether reference type or not
+ grn_obj unvectored_value;
+ GRN_TEXT_INIT(&unvectored_value, 0);
+ int n_ids = GRN_BULK_VSIZE(value) / sizeof(grn_id);
+ for (int i = 0; i < n_ids; i++) {
+ grn_id id = GRN_RECORD_VALUE_AT(value, i);
+ if (i > 0) {
+ GRN_TEXT_PUTS(ctx, &unvectored_value, mrn_vector_column_delimiter);
+ }
+ char key[GRN_TABLE_MAX_KEY_SIZE];
+ int key_length;
+ key_length = grn_table_get_key(ctx, range, id,
+ &key, GRN_TABLE_MAX_KEY_SIZE);
+ GRN_TEXT_PUT(ctx, &unvectored_value, key, key_length);
+ }
+ storage_store_field(field,
+ GRN_TEXT_VALUE(&unvectored_value),
+ GRN_TEXT_LEN(&unvectored_value));
+ GRN_OBJ_FIN(ctx, &unvectored_value);
+ } else {
+ grn_obj_reinit(ctx, value, range_id, 0);
+ grn_obj_get_value(ctx, column, record_id, value);
+
+ grn_id id = GRN_RECORD_VALUE(value);
+ char key[GRN_TABLE_MAX_KEY_SIZE];
+ int key_length;
+ key_length = grn_table_get_key(ctx, range, id,
+ &key, GRN_TABLE_MAX_KEY_SIZE);
+ storage_store_field(field, key, key_length);
+ }
+ } else {
+ grn_obj_reinit(ctx, value, range_id, 0);
+ grn_obj_get_value(ctx, column, record_id, value);
+ storage_store_field(field, GRN_BULK_HEAD(value), GRN_BULK_VSIZE(value));
+ }
+
+ DBUG_VOID_RETURN;
+}
+
void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id)
{
MRN_DBUG_ENTER_METHOD();
@@ -10124,49 +10093,7 @@ void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id)
&key, GRN_TABLE_MAX_KEY_SIZE);
storage_store_field(field, key, key_length);
} else {
- // actual column
- const char *value;
- uint32 value_length;
- value = grn_obj_get_value_(ctx, grn_columns[i], record_id,
- &value_length);
- DBUG_PRINT("info", ("mroonga: value_length=%u",value_length));
- grn_obj *range = grn_column_ranges[i];
- // TODO: create mrn::is_grn_table() and use it.
- if (GRN_TABLE_HASH_KEY <= range->header.type &&
- range->header.type <= GRN_DB) {
- // TODO: extract as a method
- if (((grn_columns[i]->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) ==
- GRN_OBJ_COLUMN_VECTOR)) {
- // TODO: Check whether reference type or not
- grn_obj unvectored_value;
- GRN_TEXT_INIT(&unvectored_value, 0);
- grn_id *ids = (grn_id *)value;
- for (int i = 0; i * sizeof(grn_id) < value_length; i++) {
- grn_id id = ids[i];
- if (i > 0) {
- GRN_TEXT_PUTS(ctx, &unvectored_value, mrn_vector_column_delimiter);
- }
- char key[GRN_TABLE_MAX_KEY_SIZE];
- int key_length;
- key_length = grn_table_get_key(ctx, range, id,
- &key, GRN_TABLE_MAX_KEY_SIZE);
- GRN_TEXT_PUT(ctx, &unvectored_value, key, key_length);
- }
- storage_store_field(field,
- GRN_TEXT_VALUE(&unvectored_value),
- GRN_TEXT_LEN(&unvectored_value));
- GRN_OBJ_FIN(ctx, &unvectored_value);
- } else {
- grn_id id = *((grn_id *)value);
- char key[GRN_TABLE_MAX_KEY_SIZE];
- int key_length;
- key_length = grn_table_get_key(ctx, range, id,
- &key, GRN_TABLE_MAX_KEY_SIZE);
- storage_store_field(field, key, key_length);
- }
- } else {
- storage_store_field(field, value, value_length);
- }
+ storage_store_field_column(field, i ,record_id);
}
field->move_field_offset(-ptr_diff);
}
@@ -10216,20 +10143,20 @@ void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data,
) {
mrn::DebugColumnAccess debug_column_access(table, table->write_set);
DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index));
- const char *value;
- uint32 value_length;
- value = grn_obj_get_value_(ctx, grn_columns[i], record_id,
- &value_length);
+ grn_obj value;
+ GRN_OBJ_INIT(&value, GRN_BULK, 0, grn_obj_get_range(ctx, grn_columns[i]));
+ grn_obj_get_value(ctx, grn_columns[i], record_id, &value);
// old column
field->move_field_offset(ptr_diff_old);
- storage_store_field(field, value, value_length);
+ storage_store_field(field, GRN_BULK_HEAD(&value), GRN_BULK_VSIZE(&value));
field->move_field_offset(-ptr_diff_old);
if (new_data) {
// new column
field->move_field_offset(ptr_diff_new);
- storage_store_field(field, value, value_length);
+ storage_store_field(field, GRN_BULK_HEAD(&value), GRN_BULK_VSIZE(&value));
field->move_field_offset(-ptr_diff_new);
}
+ GRN_OBJ_FIN(ctx, &value);
}
}
@@ -13483,6 +13410,8 @@ bool ha_mroonga::storage_inplace_alter_table_index(
grn_table_size(ctx, index_tables[key_pos])
) {
error = HA_ERR_FOUND_DUPP_UNIQUE;
+ my_printf_error(ER_DUP_UNIQUE, ER(ER_DUP_UNIQUE), MYF(0),
+ table_share->table_name);
++i;
break;
}
diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp
index 0aec57c87ae..224abb09732 100644
--- a/storage/mroonga/ha_mroonga.hpp
+++ b/storage/mroonga/ha_mroonga.hpp
@@ -31,7 +31,6 @@ extern "C" {
#endif
#include <groonga.h>
-#include "mrn_sys.hpp"
#include "mrn_mysql_compat.h"
#if (MYSQL_VERSION_ID >= 50603) || \
@@ -558,6 +557,13 @@ private:
int drop_index(MRN_SHARE *target_share, uint key_index);
grn_obj *find_tokenizer(const char *name, int name_length);
grn_obj *find_normalizer(KEY *key_info);
+ bool find_token_filters(KEY *key_info, grn_obj *token_filters);
+ bool find_token_filters_put(grn_obj *token_filters,
+ const char *token_filter_name,
+ int token_filter_name_length);
+ bool find_token_filters_fill(grn_obj *token_filters,
+ const char *token_filter_names,
+ int token_filter_name_length);
int wrapper_get_record(uchar *buf, const uchar *key);
int wrapper_get_next_geo_record(uchar *buf);
int storage_get_next_record(uchar *buf);
@@ -635,6 +641,8 @@ private:
void storage_store_field_geometry(Field *field,
const char *value, uint value_length);
void storage_store_field(Field *field, const char *value, uint value_length);
+ void storage_store_field_column(Field *field,
+ int nth_column, grn_id record_id);
void storage_store_fields(uchar *buf, grn_id record_id);
void storage_store_fields_for_prep_update(const uchar *old_data,
uchar *new_data,
@@ -723,9 +731,6 @@ private:
int storage_create_indexes(TABLE *table, const char *grn_table_name,
grn_obj *grn_table, MRN_SHARE *tmp_share);
int close_databases();
- void ensure_database_directory();
- int ensure_normalizers_register();
- int ensure_database_create(const char *name);
int ensure_database_open(const char *name);
int ensure_database_remove(const char *name);
int wrapper_delete_table(const char *name, MRN_SHARE *tmp_share,
diff --git a/storage/mroonga/lib/libmrn_need_mysql_sources.am b/storage/mroonga/lib/libmrn_need_mysql_sources.am
index 9dca2b6fb04..bd852829467 100644
--- a/storage/mroonga/lib/libmrn_need_mysql_sources.am
+++ b/storage/mroonga/lib/libmrn_need_mysql_sources.am
@@ -22,4 +22,6 @@ libmrn_need_mysql_la_SOURCES = \
mrn_condition_converter.cpp \
mrn_condition_converter.hpp \
mrn_time_converter.cpp \
- mrn_time_converter.hpp
+ mrn_time_converter.hpp \
+ mrn_database_manager.cpp \
+ mrn_database_manager.hpp
diff --git a/storage/mroonga/lib/libmrn_no_mysql_sources.am b/storage/mroonga/lib/libmrn_no_mysql_sources.am
index 89cfb277595..fd2d942d345 100644
--- a/storage/mroonga/lib/libmrn_no_mysql_sources.am
+++ b/storage/mroonga/lib/libmrn_no_mysql_sources.am
@@ -5,4 +5,5 @@ libmrn_no_mysql_la_SOURCES = \
mrn_path_mapper.hpp \
mrn_windows.hpp \
mrn_smart_grn_obj.cpp \
- mrn_smart_grn_obj.hpp
+ mrn_smart_grn_obj.hpp \
+ mrn_grn.hpp
diff --git a/storage/mroonga/lib/mrn_database_manager.cpp b/storage/mroonga/lib/mrn_database_manager.cpp
new file mode 100644
index 00000000000..52ec78fccc0
--- /dev/null
+++ b/storage/mroonga/lib/mrn_database_manager.cpp
@@ -0,0 +1,341 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2010 Tetsuro IKEDA
+ Copyright(C) 2010-2013 Kentoku SHIBA
+ 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-1301 USA
+*/
+
+#include <mrn_mysql.h>
+
+#include "mrn_database_manager.hpp"
+#include "mrn_encoding.hpp"
+#include "mrn_lock.hpp"
+#include "mrn_path_mapper.hpp"
+
+// for debug
+#define MRN_CLASS_NAME "mrn::DatabaseManager"
+
+#ifdef WIN32
+# include <direct.h>
+# define MRN_MKDIR(pathname, mode) _mkdir((pathname))
+#else
+# include <dirent.h>
+# include <unistd.h>
+# define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode))
+#endif
+
+namespace mrn {
+ DatabaseManager::DatabaseManager(grn_ctx *ctx)
+ : ctx_(ctx),
+ cache_(NULL),
+ mutex_(),
+ mutex_initialized_(false) {
+ }
+
+ DatabaseManager::~DatabaseManager(void) {
+ if (mutex_initialized_) {
+ pthread_mutex_destroy(&mutex_);
+ }
+
+ if (cache_) {
+ void *db_address;
+ GRN_HASH_EACH(ctx_, cache_, id, NULL, 0, &db_address, {
+ grn_obj *db;
+ memcpy(&db, db_address, sizeof(grn_obj *));
+ grn_obj_unlink(ctx_, db);
+ });
+ grn_hash_close(ctx_, cache_);
+ }
+ }
+
+ bool DatabaseManager::init(void) {
+ MRN_DBUG_ENTER_METHOD();
+ cache_ = grn_hash_create(ctx_,
+ NULL,
+ GRN_TABLE_MAX_KEY_SIZE,
+ sizeof(grn_obj *),
+ GRN_OBJ_KEY_VAR_SIZE);
+ if (!cache_) {
+ GRN_LOG(ctx_, GRN_LOG_ERROR,
+ "failed to initialize hash table for caching opened databases");
+ DBUG_RETURN(false);
+ }
+
+ if (pthread_mutex_init(&mutex_, NULL) != 0) {
+ GRN_LOG(ctx_, GRN_LOG_ERROR,
+ "failed to initialize mutex for opened database cache hash table");
+ DBUG_RETURN(false);
+ }
+
+ mutex_initialized_ = true;
+ DBUG_RETURN(true);
+ }
+
+ int DatabaseManager::open(const char *path, grn_obj **db) {
+ MRN_DBUG_ENTER_METHOD();
+
+ int error = 0;
+ *db = NULL;
+
+ mrn::PathMapper mapper(path);
+ mrn::Lock lock(&mutex_);
+
+ error = mrn::encoding::set(ctx_, system_charset_info);
+ if (error) {
+ DBUG_RETURN(error);
+ }
+
+ grn_id id;
+ void *db_address;
+ id = grn_hash_get(ctx_, cache_,
+ mapper.db_name(), strlen(mapper.db_name()),
+ &db_address);
+ if (id == GRN_ID_NIL) {
+ struct stat db_stat;
+ if (stat(mapper.db_path(), &db_stat)) {
+ GRN_LOG(ctx_, GRN_LOG_INFO,
+ "database not found. creating...: <%s>", mapper.db_path());
+ if (path[0] == FN_CURLIB &&
+ (path[1] == FN_LIBCHAR || path[1] == FN_LIBCHAR2)) {
+ ensure_database_directory();
+ }
+ *db = grn_db_create(ctx_, mapper.db_path(), NULL);
+ if (ctx_->rc) {
+ error = ER_CANT_CREATE_TABLE;
+ my_message(error, ctx_->errbuf, MYF(0));
+ DBUG_RETURN(error);
+ }
+ } else {
+ *db = grn_db_open(ctx_, mapper.db_path());
+ if (ctx_->rc) {
+ error = ER_CANT_OPEN_FILE;
+ my_message(error, ctx_->errbuf, MYF(0));
+ DBUG_RETURN(error);
+ }
+ }
+ grn_hash_add(ctx_, cache_,
+ mapper.db_name(), strlen(mapper.db_name()),
+ &db_address, NULL);
+ memcpy(db_address, db, sizeof(grn_obj *));
+ } else {
+ memcpy(db, db_address, sizeof(grn_obj *));
+ grn_ctx_use(ctx_, *db);
+ }
+
+ error = ensure_normalizers_registered(*db);
+
+ DBUG_RETURN(error);
+ }
+
+ void DatabaseManager::close(const char *path) {
+ MRN_DBUG_ENTER_METHOD();
+
+ mrn::PathMapper mapper(path);
+ mrn::Lock lock(&mutex_);
+
+ grn_id id;
+ void *db_address;
+ id = grn_hash_get(ctx_, cache_,
+ mapper.db_name(), strlen(mapper.db_name()),
+ &db_address);
+ if (id == GRN_ID_NIL) {
+ DBUG_VOID_RETURN;
+ }
+
+ grn_obj *db = NULL;
+ memcpy(&db, db_address, sizeof(grn_obj *));
+ if (db) {
+ grn_obj_close(ctx_, db);
+ }
+
+ grn_hash_delete_by_id(ctx_, cache_, id, NULL);
+
+ DBUG_VOID_RETURN;
+ }
+
+ bool DatabaseManager::drop(const char *path) {
+ MRN_DBUG_ENTER_METHOD();
+
+ mrn::PathMapper mapper(path);
+ mrn::Lock lock(&mutex_);
+
+ grn_id id;
+ void *db_address;
+ id = grn_hash_get(ctx_, cache_,
+ mapper.db_name(), strlen(mapper.db_name()),
+ &db_address);
+
+ grn_obj *db = NULL;
+ if (id == GRN_ID_NIL) {
+ struct stat dummy;
+ if (stat(mapper.db_path(), &dummy) == 0) {
+ db = grn_db_open(ctx_, mapper.db_path());
+ }
+ } else {
+ memcpy(&db, db_address, sizeof(grn_obj *));
+ }
+
+ if (!db) {
+ DBUG_RETURN(false);
+ }
+
+ if (grn_obj_remove(ctx_, db) == GRN_SUCCESS) {
+ if (id != GRN_ID_NIL) {
+ grn_hash_delete_by_id(ctx_, cache_, id, NULL);
+ }
+ DBUG_RETURN(true);
+ } else {
+ GRN_LOG(ctx_, GRN_LOG_ERROR,
+ "failed to drop database: <%s>: <%s>",
+ mapper.db_path(), ctx_->errbuf);
+ DBUG_RETURN(false);
+ }
+ }
+
+ int DatabaseManager::clear(void) {
+ MRN_DBUG_ENTER_METHOD();
+
+ int error = 0;
+
+ mrn::Lock lock(&mutex_);
+
+ grn_hash_cursor *cursor;
+ cursor = grn_hash_cursor_open(ctx_, cache_,
+ NULL, 0, NULL, 0,
+ 0, -1, 0);
+ if (ctx_->rc) {
+ my_message(ER_ERROR_ON_READ, ctx_->errbuf, MYF(0));
+ DBUG_RETURN(ER_ERROR_ON_READ);
+ }
+
+ while (grn_hash_cursor_next(ctx_, cursor) != GRN_ID_NIL) {
+ if (ctx_->rc) {
+ error = ER_ERROR_ON_READ;
+ my_message(error, ctx_->errbuf, MYF(0));
+ break;
+ }
+ void *db_address;
+ grn_obj *db;
+ grn_hash_cursor_get_value(ctx_, cursor, &db_address);
+ memcpy(&db, db_address, sizeof(grn_obj *));
+ grn_rc rc = grn_hash_cursor_delete(ctx_, cursor, NULL);
+ if (rc) {
+ error = ER_ERROR_ON_READ;
+ my_message(error, ctx_->errbuf, MYF(0));
+ break;
+ }
+ grn_obj_close(ctx_, db);
+ }
+ grn_hash_cursor_close(ctx_, cursor);
+
+ DBUG_RETURN(error);
+ }
+
+ void DatabaseManager::mkdir_p(const char *directory) {
+ MRN_DBUG_ENTER_METHOD();
+
+ int i = 0;
+ char sub_directory[MRN_MAX_PATH_SIZE];
+ sub_directory[0] = '\0';
+ while (true) {
+ if (directory[i] == FN_LIBCHAR ||
+ directory[i] == FN_LIBCHAR2 ||
+ directory[i] == '\0') {
+ sub_directory[i] = '\0';
+ struct stat directory_status;
+ if (stat(sub_directory, &directory_status) != 0) {
+ DBUG_PRINT("info", ("mroonga: creating directory: <%s>", sub_directory));
+ GRN_LOG(ctx_, GRN_LOG_INFO, "creating directory: <%s>", sub_directory);
+ if (MRN_MKDIR(sub_directory, S_IRWXU) == 0) {
+ DBUG_PRINT("info",
+ ("mroonga: created directory: <%s>", sub_directory));
+ GRN_LOG(ctx_, GRN_LOG_INFO, "created directory: <%s>", sub_directory);
+ } else {
+ DBUG_PRINT("error",
+ ("mroonga: failed to create directory: <%s>: <%s>",
+ sub_directory, strerror(errno)));
+ GRN_LOG(ctx_, GRN_LOG_ERROR,
+ "failed to create directory: <%s>: <%s>",
+ sub_directory, strerror(errno));
+ DBUG_VOID_RETURN;
+ }
+ }
+ }
+
+ if (directory[i] == '\0') {
+ break;
+ }
+
+ sub_directory[i] = directory[i];
+ ++i;
+ }
+
+ DBUG_VOID_RETURN;
+ }
+
+ void DatabaseManager::ensure_database_directory(void) {
+ MRN_DBUG_ENTER_METHOD();
+
+ const char *path_prefix = mrn::PathMapper::default_path_prefix;
+ if (!path_prefix)
+ DBUG_VOID_RETURN;
+
+ const char *last_path_separator;
+ last_path_separator = strrchr(path_prefix, FN_LIBCHAR);
+ if (!last_path_separator)
+ last_path_separator = strrchr(path_prefix, FN_LIBCHAR2);
+ if (!last_path_separator)
+ DBUG_VOID_RETURN;
+ if (path_prefix == last_path_separator)
+ DBUG_VOID_RETURN;
+
+ char database_directory[MRN_MAX_PATH_SIZE];
+ size_t database_directory_length = last_path_separator - path_prefix;
+ strncpy(database_directory, path_prefix, database_directory_length);
+ database_directory[database_directory_length] = '\0';
+ mkdir_p(database_directory);
+
+ DBUG_VOID_RETURN;
+ }
+
+ int DatabaseManager::ensure_normalizers_registered(grn_obj *db) {
+ MRN_DBUG_ENTER_METHOD();
+
+ int error = 0;
+#ifdef WITH_GROONGA_NORMALIZER_MYSQL
+ {
+ grn_obj *mysql_normalizer;
+ mysql_normalizer = grn_ctx_get(ctx_, "NormalizerMySQLGeneralCI", -1);
+ if (mysql_normalizer) {
+ grn_obj_unlink(ctx_, mysql_normalizer);
+ } else {
+#ifdef GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC
+ char ref_path[FN_REFLEN + 1], *tmp;
+ tmp = strmov(ref_path, opt_plugin_dir);
+ tmp = strmov(tmp, "/ha_mroonga");
+ strcpy(tmp, SO_EXT);
+ grn_plugin_register_by_path(ctx_, ref_path);
+#else
+ grn_plugin_register(ctx_, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
+#endif
+ }
+ }
+#endif
+
+ DBUG_RETURN(error);
+ }
+}
diff --git a/storage/mroonga/lib/mrn_database_manager.hpp b/storage/mroonga/lib/mrn_database_manager.hpp
new file mode 100644
index 00000000000..46bce7ab1a5
--- /dev/null
+++ b/storage/mroonga/lib/mrn_database_manager.hpp
@@ -0,0 +1,50 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2010 Tetsuro IKEDA
+ Copyright(C) 2010-2013 Kentoku SHIBA
+ 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-1301 USA
+*/
+
+#ifndef MRN_DATABASE_MANAGER_HPP_
+#define MRN_DATABASE_MANAGER_HPP_
+
+#include <groonga.h>
+
+namespace mrn {
+ class DatabaseManager {
+ public:
+ DatabaseManager(grn_ctx *ctx);
+ ~DatabaseManager(void);
+ bool init(void);
+ int open(const char *path, grn_obj **db);
+ void close(const char *path);
+ bool drop(const char *path);
+ int clear(void);
+
+ private:
+ grn_ctx *ctx_;
+ grn_hash *cache_;
+ pthread_mutex_t mutex_;
+ bool mutex_initialized_;
+
+ void mkdir_p(const char *directory);
+ void ensure_database_directory(void);
+ int ensure_normalizers_registered(grn_obj *db);
+ };
+}
+
+#endif /* MRN_DATABASE_MANAGER_HPP_ */
diff --git a/storage/mroonga/lib/mrn_encoding.cpp b/storage/mroonga/lib/mrn_encoding.cpp
index a69a849c053..f6f66758b2f 100644
--- a/storage/mroonga/lib/mrn_encoding.cpp
+++ b/storage/mroonga/lib/mrn_encoding.cpp
@@ -153,7 +153,27 @@ namespace mrn {
DBUG_VOID_RETURN;
}
- bool set(grn_ctx *ctx, const CHARSET_INFO *charset) {
+ int set(grn_ctx *ctx, const CHARSET_INFO *charset) {
+ MRN_DBUG_ENTER_FUNCTION();
+ int error = 0;
+
+ if (!set_raw(ctx, charset)) {
+ const char *name = "<null>";
+ const char *csname = "<null>";
+ if (charset) {
+ name = charset->name;
+ csname = charset->csname;
+ }
+ error = ER_MRN_CHARSET_NOT_SUPPORT_NUM;
+ my_printf_error(error,
+ ER_MRN_CHARSET_NOT_SUPPORT_STR,
+ MYF(0), name, csname);
+ }
+
+ DBUG_RETURN(error);
+ }
+
+ bool set_raw(grn_ctx *ctx, const CHARSET_INFO *charset) {
MRN_DBUG_ENTER_FUNCTION();
if (!charset)
{
diff --git a/storage/mroonga/lib/mrn_encoding.hpp b/storage/mroonga/lib/mrn_encoding.hpp
index b4f21e1a274..b29b44d967e 100644
--- a/storage/mroonga/lib/mrn_encoding.hpp
+++ b/storage/mroonga/lib/mrn_encoding.hpp
@@ -28,7 +28,8 @@
namespace mrn {
namespace encoding {
void init(void);
- bool set(grn_ctx *ctx, const CHARSET_INFO *charset);
+ int set(grn_ctx *ctx, const CHARSET_INFO *charset);
+ bool set_raw(grn_ctx *ctx, const CHARSET_INFO *charset);
}
}
diff --git a/storage/mroonga/lib/mrn_field_normalizer.cpp b/storage/mroonga/lib/mrn_field_normalizer.cpp
index bb91b3ab98d..c34f9975e37 100644
--- a/storage/mroonga/lib/mrn_field_normalizer.cpp
+++ b/storage/mroonga/lib/mrn_field_normalizer.cpp
@@ -95,7 +95,7 @@ namespace mrn {
grn_obj *normalizer = find_grn_normalizer();
int flags = 0;
grn_encoding original_encoding = GRN_CTX_GET_ENCODING(ctx_);
- encoding::set(ctx_, field_->charset());
+ encoding::set_raw(ctx_, field_->charset());
grn_obj *grn_string = grn_string_open(ctx_, string, string_length,
normalizer, flags);
GRN_CTX_SET_ENCODING(ctx_, original_encoding);
diff --git a/storage/mroonga/mrn_sys.hpp b/storage/mroonga/lib/mrn_grn.hpp
index 904421682ff..f60fb7b616e 100644
--- a/storage/mroonga/mrn_sys.hpp
+++ b/storage/mroonga/lib/mrn_grn.hpp
@@ -1,7 +1,6 @@
+/* -*- c-basic-offset: 2 -*- */
/*
- Copyright(C) 2010 Tetsuro IKEDA
- Copyright(C) 2011 Kentoku SHIBA
- Copyright(C) 2011-2012 Kouhei Sutou <kou@clear-code.com>
+ Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,19 +17,23 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef MRN_SYS_HPP_
-#define MRN_SYS_HPP_
+#ifndef MRN_GRN_HPP_
+#define MRN_GRN_HPP_
#include <groonga.h>
-#include "mrn_macro.hpp"
-MRN_BEGIN_DECLS
-
-/* functions */
-bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value);
-bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value);
-bool mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key);
-
-MRN_END_DECLS
-
-#endif /* MRN_SYS_HPP_ */
+namespace mrn {
+ namespace grn {
+ bool is_table(grn_obj *obj) {
+ grn_id type = obj->header.type;
+ return GRN_TABLE_HASH_KEY <= type && obj->header.type <= GRN_DB;
+ }
+
+ bool is_vector_column(grn_obj *column) {
+ int column_type = (column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK);
+ return column_type == GRN_OBJ_COLUMN_VECTOR;
+ }
+ }
+}
+
+#endif // MRN_GRN_HPP_
diff --git a/storage/mroonga/lib/mrn_path_mapper.cpp b/storage/mroonga/lib/mrn_path_mapper.cpp
index 8856e6f6082..ee5432f16bb 100644
--- a/storage/mroonga/lib/mrn_path_mapper.cpp
+++ b/storage/mroonga/lib/mrn_path_mapper.cpp
@@ -19,16 +19,12 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <mrn_mysql.h>
#include "mrn_path_mapper.hpp"
#include <string.h>
-#include <mrn_mysql.h>
-
namespace mrn {
char *PathMapper::default_path_prefix = NULL;
char *PathMapper::default_mysql_data_home_path = NULL;
diff --git a/storage/mroonga/mrn_mysql.h b/storage/mroonga/mrn_mysql.h
index b80ec195ada..cf2a54621bb 100644
--- a/storage/mroonga/mrn_mysql.h
+++ b/storage/mroonga/mrn_mysql.h
@@ -47,7 +47,6 @@
# include <mysql_priv.h>
# include <mysql/plugin.h>
#else
-# include <my_global.h>
# include <sql_priv.h>
# include <sql_class.h>
# include <probes_mysql.h>
diff --git a/storage/mroonga/mrn_sys.cpp b/storage/mroonga/mrn_sys.cpp
deleted file mode 100644
index 86cce1cc415..00000000000
--- a/storage/mroonga/mrn_sys.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- c-basic-offset: 2 -*- */
-/*
- Copyright(C) 2010 Tetsuro IKEDA
- Copyright(C) 2011-2012 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-1301 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "mrn_sys.hpp"
-
-bool mrn_hash_put(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj *value)
-{
- int added;
- bool succeed;
- void *buf;
- grn_hash_add(ctx, hash, (const char *)key, strlen(key), &buf, &added);
- // duplicate check
- if (added == 0) {
- GRN_LOG(ctx, GRN_LOG_WARNING, "hash put duplicated (key=%s)", key);
- succeed = false;
- } else {
- // store address of value
- memcpy(buf, &value, sizeof(grn_obj *));
- GRN_LOG(ctx, GRN_LOG_DEBUG, "hash put (key=%s)", key);
- succeed = true;
- }
- return succeed;
-}
-
-bool mrn_hash_get(grn_ctx *ctx, grn_hash *hash, const char *key, grn_obj **value)
-{
- bool found;
- grn_id id;
- void *buf;
- id = grn_hash_get(ctx, hash, (const char *)key, strlen(key), &buf);
- // key not found
- if (id == GRN_ID_NIL) {
- GRN_LOG(ctx, GRN_LOG_DEBUG, "hash get not found (key=%s)", key);
- found = false;
- } else {
- // restore address of value
- memcpy(value, buf, sizeof(grn_obj *));
- found = true;
- }
- return found;
-}
-
-bool mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key)
-{
- bool succeed;
- grn_rc rc;
- grn_id id;
- id = grn_hash_get(ctx, hash, (const char*) key, strlen(key), NULL);
- if (id == GRN_ID_NIL) {
- GRN_LOG(ctx, GRN_LOG_WARNING, "hash remove not found (key=%s)", key);
- succeed = false;
- } else {
- rc = grn_hash_delete_by_id(ctx, hash, id, NULL);
- if (rc != GRN_SUCCESS) {
- GRN_LOG(ctx, GRN_LOG_ERROR, "hash remove error (key=%s)", key);
- succeed = false;
- } else {
- GRN_LOG(ctx, GRN_LOG_DEBUG, "hash remove (key=%s)", key);
- succeed = true;
- }
- }
- return succeed;
-}
diff --git a/storage/mroonga/mrn_table.cpp b/storage/mroonga/mrn_table.cpp
index df252dd9f1e..fd406ac2dcf 100644
--- a/storage/mroonga/mrn_table.cpp
+++ b/storage/mroonga/mrn_table.cpp
@@ -18,9 +18,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <config.h>
-#include <string>
-
#include "mrn_mysql.h"
#if MYSQL_VERSION_ID >= 50500
@@ -28,7 +25,6 @@
# include <sql_base.h>
#endif
#include "mrn_err.h"
-#include "mrn_sys.hpp"
#include "mrn_table.hpp"
#include "mrn_mysql_compat.h"
#include <mrn_lock.hpp>
@@ -301,10 +297,11 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
{
- int i, error;
+ int i, error = 0;
int title_length;
const char *sprit_ptr[2];
const char *tmp_ptr, *start_ptr;
+ char *params_string = NULL;
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_element *part_elem;
partition_element *sub_elem;
@@ -371,8 +368,15 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
}
{
- std::string params_string(params_string_value, params_string_length);
- sprit_ptr[0] = params_string.c_str();
+ params_string = my_strndup(params_string_value,
+ params_string_length,
+ MYF(MY_WME));
+ if (!params_string) {
+ error = HA_ERR_OUT_OF_MEM;
+ goto error;
+ }
+
+ sprit_ptr[0] = params_string;
while (sprit_ptr[0])
{
if ((sprit_ptr[1] = strchr(sprit_ptr[0], ',')))
@@ -406,6 +410,12 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
case 6:
MRN_PARAM_STR("engine", engine);
break;
+ case 10:
+ MRN_PARAM_STR("normalizer", normalizer);
+ break;
+ case 13:
+ MRN_PARAM_STR("token_filters", token_filters);
+ break;
case 17:
MRN_PARAM_STR("default_tokenizer", default_tokenizer);
break;
@@ -413,6 +423,9 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
break;
}
}
+
+ my_free(params_string, MYF(0));
+ params_string = NULL;
}
}
@@ -459,9 +472,9 @@ int mrn_parse_table_param(MRN_SHARE *share, TABLE *table)
}
}
- DBUG_RETURN(0);
-
error:
+ if (params_string)
+ my_free(params_string, MYF(0));
DBUG_RETURN(error);
}
@@ -704,6 +717,10 @@ int mrn_free_share_alloc(
my_free(share->engine, MYF(0));
if (share->default_tokenizer)
my_free(share->default_tokenizer, MYF(0));
+ if (share->normalizer)
+ my_free(share->normalizer, MYF(0));
+ if (share->token_filters)
+ my_free(share->token_filters, MYF(0));
for (i = 0; i < share->table_share->keys; i++)
{
if (share->index_table && share->index_table[i])
diff --git a/storage/mroonga/mrn_table.hpp b/storage/mroonga/mrn_table.hpp
index 25fffa914a0..813e69e1023 100644
--- a/storage/mroonga/mrn_table.hpp
+++ b/storage/mroonga/mrn_table.hpp
@@ -53,6 +53,10 @@ typedef struct st_mroonga_share
int engine_length;
char *default_tokenizer;
int default_tokenizer_length;
+ char *normalizer;
+ int normalizer_length;
+ char *token_filters;
+ int token_filters_length;
plugin_ref plugin;
handlerton *hton;
char **index_table;
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc
new file mode 100644
index 00000000000..86bb34ff86d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_55.inc
@@ -0,0 +1,24 @@
+# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/check_version.inc
+--source ../../include/mroonga/check_mariadb.inc
+
+if ($version_55) {
+ if (!$mariadb) {
+ skip This test is not for MySQL 5.5.x;
+ }
+}
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 00000000000..53a2b8a4af9
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/disabled.def
@@ -0,0 +1,7 @@
+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.
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 00000000000..e0449e3e54b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result
@@ -0,0 +1,19 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("register token_filters/stop_word")
+true
+SET NAMES utf8;
+CREATE TABLE memos (
+content VARCHAR(64) NOT NULL
+) DEFAULT CHARSET=utf8;
+SELECT mroonga_command("dump");
+mroonga_command("dump")
+table_create memos TABLE_NO_KEY
+column_create memos content COLUMN_SCALAR ShortText
+ALTER TABLE memos ADD FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"';
+SELECT mroonga_command("dump");
+mroonga_command("dump")
+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
+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 00000000000..8b8b2efbc44
--- /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_change_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result
new file mode 100644
index 00000000000..5046dc8e142
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result
@@ -0,0 +1,32 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+column_create terms content COLUMN_INDEX|WITH_POSITION memos content
+ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"';
+SELECT mroonga_command("dump");
+mroonga_command("dump")
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+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
+DROP TABLE memos;
+DROP TABLE terms;
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result
index 1a9888d71da..e14c67291cd 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_default_tokenizer.result
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS tags;
CREATE TABLE tags (
name VARCHAR(64) PRIMARY KEY
) DEFAULT CHARSET=utf8
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_table_comment.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_table_comment.result
new file mode 100644
index 00000000000..dbf69362ee7
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_table_comment.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_token_filters_index_comment_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_multiple_token_filters.result
new file mode 100644
index 00000000000..7d762258e6f
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_multiple_token_filters.result
@@ -0,0 +1,15 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+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
+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_token_filters_index_comment_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_one_token_filter.result
new file mode 100644
index 00000000000..6cc89a7b941
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_index_comment_one_token_filter.result
@@ -0,0 +1,15 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+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
+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_token_filters_table_comment_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_multiple_token_filters.result
new file mode 100644
index 00000000000..fe7e0059250
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_multiple_token_filters.result
@@ -0,0 +1,23 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+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_token_filters_table_comment_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_one_token_filter.result
new file mode 100644
index 00000000000..fe855b60f38
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_token_filters_table_comment_one_token_filter.result
@@ -0,0 +1,23 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+column_create terms is_stop_word COLUMN_SCALAR Int8
+column_create terms term COLUMN_SCALAR ShortText
+table_create memos TABLE_PAT_KEY Int32
+column_create memos content COLUMN_SCALAR LongText
+column_create memos id COLUMN_SCALAR Int32
+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_vector.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result
index cb6248ec3d5..561a266598f 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_vector.result
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS bugs;
CREATE TABLE bugs (
id INT UNSIGNED PRIMARY KEY,
tags TEXT COMMENT 'flags "COLUMN_VECTOR"'
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_token_filters_skip.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_token_filters_skip.result
new file mode 100644
index 00000000000..290f96df35d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_token_filters_skip.result
@@ -0,0 +1,23 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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/index_multiple_column_range_not_used_in_order_by_greater_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than.result
new file mode 100644
index 00000000000..870c5ba73e5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_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_not_used_in_order_by_greater_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.result
new file mode 100644
index 00000000000..06661210817
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_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_not_used_in_order_by_less_than.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than.result
new file mode 100644
index 00000000000..f528f90b7dc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_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_not_used_in_order_by_less_than_or_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.result
new file mode 100644
index 00000000000..9250ecb8dbc
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_multiple_column_range_not_used_in_order_by_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/information_schema_plugins.result b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
index 46c6f6ab258..8d3decfa32a 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
@@ -1,4 +1,4 @@
select PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE
from information_schema.plugins where plugin_name = "Mroonga";
PLUGIN_NAME PLUGIN_VERSION PLUGIN_TYPE
-Mroonga 4.5 STORAGE ENGINE
+Mroonga 4.6 STORAGE ENGINE
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 00000000000..eb11e26e566
--- /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/variable_version.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
index 4c22040ab5a..aae83fe2b38 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
@@ -1,3 +1,3 @@
show variables like 'mroonga_version';
Variable_name Value
-mroonga_version 4.05
+mroonga_version 4.06
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 00000000000..aee355fdfc1
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("register token_filters/stop_word");
+
+SET NAMES utf8;
+
+CREATE TABLE memos (
+ content VARCHAR(64) NOT NULL
+) DEFAULT CHARSET=utf8;
+
+SELECT mroonga_command("dump");
+
+ALTER TABLE memos ADD FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"';
+
+SELECT mroonga_command("dump");
+
+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 00000000000..1dd6b31fb64
--- /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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ 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_change_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test
new file mode 100644
index 00000000000..fd47d2a60f0
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test
@@ -0,0 +1,49 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"';
+
+SELECT mroonga_command("dump");
+
+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_default_tokenizer.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test
index ee1afdfe4f6..7c8cd3f32a0 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_default_tokenizer.test
@@ -18,9 +18,11 @@
--source ../../include/mroonga/have_mroonga.inc
--source ../../include/mroonga/load_mroonga_functions.inc
---disable_warnings
-DROP TABLE IF EXISTS tags;
---enable_warnings
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
CREATE TABLE tags (
name VARCHAR(64) PRIMARY KEY
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_table_comment.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_table_comment.test
new file mode 100644
index 00000000000..1da8026f56d
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_table_comment.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS 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_token_filters_index_comment_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_multiple_token_filters.test
new file mode 100644
index 00000000000..66bf9cef699
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_multiple_token_filters.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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_token_filters_index_comment_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_one_token_filter.test
new file mode 100644
index 00000000000..49a23ec6b74
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_index_comment_one_token_filter.test
@@ -0,0 +1,40 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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_token_filters_table_comment_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_multiple_token_filters.test
new file mode 100644
index 00000000000..7d890aff9d3
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_multiple_token_filters.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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_token_filters_table_comment_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_one_token_filter.test
new file mode 100644
index 00000000000..f391647a538
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_token_filters_table_comment_one_token_filter.test
@@ -0,0 +1,45 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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_vector.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test
index 440619c33c0..8707ce0e34b 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_vector.test
@@ -18,9 +18,11 @@
--source ../../include/mroonga/have_mroonga.inc
--source ../../include/mroonga/load_mroonga_functions.inc
---disable_warnings
-DROP TABLE IF EXISTS bugs;
---enable_warnings
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
CREATE TABLE bugs (
id INT UNSIGNED PRIMARY KEY,
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test
index 0ab06083b7d..fe457562967 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/foreign_key_create.test
@@ -14,14 +14,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---source ../../include/mroonga/have_version_56.inc
---source ../../include/mroonga/check_mariadb.inc
-
-if ($mariadb)
-{
- skip This test is for MySQL version 5.6.x;
-}
-
+--source ../../include/mroonga/skip_mysql_55.inc
+--source ../../include/mroonga/skip_mariadb_55.inc
+--source include/have_innodb.inc
--source ../../include/mroonga/have_mroonga.inc
--disable_warnings
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_token_filters_skip.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_token_filters_skip.test
new file mode 100644
index 00000000000..b27fb5b70d6
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_token_filters_skip.test
@@ -0,0 +1,52 @@
+# Copyright(C) 2014 Naoya Murakami <naoya@createfield.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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/index_multiple_column_range_not_used_in_order_by_greater_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than.test
new file mode 100644
index 00000000000..aff138eb45e
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ 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_not_used_in_order_by_greater_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_greater_than_or_equal.test
new file mode 100644
index 00000000000..0177c1a1479
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ 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_not_used_in_order_by_less_than.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than.test
new file mode 100644
index 00000000000..987db143da5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ 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_not_used_in_order_by_less_than_or_equal.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_less_than_or_equal.test
new file mode 100644
index 00000000000..0a4eded6710
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_multiple_column_range_not_used_in_order_by_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS items;
+--enable_warnings
+
+CREATE TABLE items (
+ 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/insert_delayed.test b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.test
new file mode 100644
index 00000000000..48a85f5d72b
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/insert_delayed.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source include/not_embedded.inc
+--source ../../include/mroonga/have_mroonga.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS ids;
+--enable_warnings
+
+CREATE TABLE ids (
+ 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/wrapper/disabled.def b/storage/mroonga/mysql-test/mroonga/wrapper/disabled.def
new file mode 100644
index 00000000000..f3f211b63ed
--- /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/create_table_token_filters_index_comment_multiple_token_filters.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_multiple_token_filters.result
new file mode 100644
index 00000000000..0c0af7a9db2
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_multiple_token_filters.result
@@ -0,0 +1,15 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+table_create memos TABLE_HASH_KEY ShortText
+table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord
+column_create memos-content index COLUMN_INDEX|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_one_token_filter.result
new file mode 100644
index 00000000000..aef34c0bc26
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_token_filters_index_comment_one_token_filter.result
@@ -0,0 +1,15 @@
+SELECT mroonga_command("register token_filters/stop_word");
+mroonga_command("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");
+mroonga_command("dump")
+table_create memos TABLE_HASH_KEY ShortText
+table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord
+column_create memos-content index COLUMN_INDEX|WITH_POSITION memos
+DROP TABLE memos;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result
index 87a4fea1c3d..61c8e18b17d 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result
@@ -25,7 +25,7 @@ id title body
2 groonga (1) starting groonga...
FLUSH TABLES;
SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting");
-ERROR HY000: syscall error 'repair_test.mrn' (No such file or directory)
+ERROR HY000: mroonga: failed to open table: <diaries>
REPAIR TABLE diaries;
Table Op Msg_type Msg_text
repair_test.diaries repair status OK
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_multiple_token_filters.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_multiple_token_filters.test
new file mode 100644
index 00000000000..9ba941f8701
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_multiple_token_filters.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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_comment_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_one_token_filter.test
new file mode 100644
index 00000000000..91ac84c04d5
--- /dev/null
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_token_filters_index_comment_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+--source include/have_innodb.inc
+--source ../../include/mroonga/have_mroonga.inc
+--source ../../include/mroonga/load_mroonga_functions.inc
+
+--disable_query_log
+DROP DATABASE test;
+CREATE DATABASE test;
+USE test;
+--enable_query_log
+
+SELECT mroonga_command("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");
+
+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/repair_table_no_files.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test
index 6489407135b..b333991d27e 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test
@@ -51,7 +51,7 @@ SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting");
FLUSH TABLES;
-# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn' (No such file or directory)
+# Error ER_CANT_OPEN_FILE mroonga: failed to open table: <diaries>
--error ER_CANT_OPEN_FILE
SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting");
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test
index 8519457cc70..809b6fa29b1 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_55_performance_schema.test
@@ -16,7 +16,6 @@
--source ../../include/mroonga/have_version_55.inc
--source include/have_innodb.inc
---source include/have_perfschema.inc
--source include/not_embedded.inc
--source ../../include/mroonga/have_mroonga.inc
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test
index c3d4aae5bf6..6a5eafe5288 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/version_56_or_later_performance_schema.test
@@ -16,7 +16,6 @@
--source ../../include/mroonga/have_version_56_or_later.inc
--source include/have_innodb.inc
---source include/have_perfschema.inc
--source include/not_embedded.inc
--source ../../include/mroonga/have_mroonga.inc
diff --git a/storage/mroonga/packages/apt/Makefile.am b/storage/mroonga/packages/apt/Makefile.am
index 3ca74c7a145..99d9642339e 100644
--- a/storage/mroonga/packages/apt/Makefile.am
+++ b/storage/mroonga/packages/apt/Makefile.am
@@ -2,7 +2,7 @@ REPOSITORIES_PATH = repositories
DISTRIBUTIONS = debian
CHROOT_BASE = /var/lib/chroot
ARCHITECTURES = i386 amd64
-CODES = wheezy jessie unstable
+CODE_NAMES = wheezy
all:
@@ -21,14 +21,14 @@ download:
done
sign-packages:
- ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
update-repository:
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
- '$(ARCHITECTURES)' '$(CODES)'
+ '$(ARCHITECTURES)' '$(CODE_NAMES)'
sign-repository:
- ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
@@ -44,12 +44,25 @@ upload: ensure-rsync-path
); \
done
-build: source
- ./build-in-chroot.sh \
- $(PACKAGE) $(VERSION) $(srcdir)/.. $(REPOSITORIES_PATH)/ \
- $(CHROOT_BASE) '$(ARCHITECTURES)' '$(CODES)'
+build: build-package-deb
-source: ../$(PACKAGE)-$(VERSION).tar.gz
+build-package-deb: prepare-build-package-deb
+ vagrant destroy --force
+ for architecture in $(ARCHITECTURES); do \
+ for code_name in $(CODE_NAMES); do \
+ id=debian-$$code_name-$$architecture; \
+ vagrant up $$id || exit 1; \
+ vagrant destroy --force $$id; \
+ done; \
+ done
+
+prepare-build-package-deb: source env.sh
+ cp env.sh tmp/
+ rm -rf tmp/debian
+ cp -rp $(srcdir)/../debian tmp/
+
+source: tmp/$(PACKAGE)-$(VERSION).tar.gz
-../$(PACKAGE)-$(VERSION).tar.gz:
- ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../
+tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
+ mkdir -p tmp
+ cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
diff --git a/storage/mroonga/packages/apt/Vagrantfile b/storage/mroonga/packages/apt/Vagrantfile
new file mode 100644
index 00000000000..429768e0ec5
--- /dev/null
+++ b/storage/mroonga/packages/apt/Vagrantfile
@@ -0,0 +1,30 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ vms = [
+ {
+ :id => "debian-wheezy-i386",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6-i386_chef-provisionerless.box
+",
+ },
+ {
+ :id => "debian-wheezy-amd64",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6_chef-provisionerless.box",
+ },
+ ]
+
+ vms.each do |vm|
+ config.vm.define(vm[:id]) do |node|
+ node.vm.box = vm[:id]
+ node.vm.box_url = vm[:box_url]
+ node.vm.provision(:shell, :path => "build-deb.sh")
+ node.vm.provider("virtualbox") do |virtual_box|
+ virtual_box.memory = 768
+ end
+ end
+ end
+end
diff --git a/storage/mroonga/packages/apt/build-deb.sh b/storage/mroonga/packages/apt/build-deb.sh
index a0f1f1ced03..40d4d61b3de 100755
--- a/storage/mroonga/packages/apt/build-deb.sh
+++ b/storage/mroonga/packages/apt/build-deb.sh
@@ -2,120 +2,77 @@
LANG=C
-PACKAGE=$(cat /tmp/build-package)
-USER_NAME=$(cat /tmp/build-user)
-VERSION=$(cat /tmp/build-version)
-DEPENDED_PACKAGES=$(cat /tmp/depended-packages)
-BUILD_SCRIPT=/tmp/build-deb-in-chroot.sh
-
mysql_server_package=mysql-server
run()
{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
+ "$@"
+ if test $? -ne 0; then
+ echo "Failed $@"
+ exit 1
+ fi
}
+. /vagrant/tmp/env.sh
+
grep '^deb ' /etc/apt/sources.list | \
sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list
run apt-get update
-run apt-get install -V -y lsb-release
-distribution=$(lsb_release --id --short)
-code_name=$(lsb_release --codename --short)
+run apt-get install -y lsb-release
-groonga_list=/etc/apt/sources.list.d/groonga.list
-if [ ! -f "${groonga_list}" ]; then
- case ${distribution} in
- Debian)
- component=main
- if [ "$code_name" = "sid" ]; then
- code_name=unstable
- fi
- ;;
- Ubuntu)
- component=universe
- ;;
- esac
- downcased_distribtion=$(echo ${distribution} | tr A-Z a-z)
- run cat <<EOF | run tee ${groonga_list}
-deb http://packages.groonga.org/${downcased_distribtion}/ ${code_name} ${component}
-deb-src http://packages.groonga.org/${downcased_distribtion}/ ${code_name} ${component}
+distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
+code_name=$(lsb_release --codename --short)
+case "${distribution}" in
+ debian)
+ component=main
+ run cat <<EOF > /etc/apt/sources.list.d/groonga.list
+deb http://packages.groonga.org/debian/ wheezy main
+deb-src http://packages.groonga.org/debian/ wheezy main
EOF
- apt-get update
- run apt-get -V -y --allow-unauthenticated install groonga-keyring
-fi
-
-run apt-get update
-run apt-get upgrade -V -y
-
-security_list=/etc/apt/sources.list.d/security.list
-if [ ! -f "${security_list}" ]; then
- run apt-get install -V -y lsb-release
-
- case ${distribution} in
- Debian)
- if [ "${code_name}" = "sid" ]; then
- touch "${security_list}"
- else
- cat <<EOF > "${security_list}"
+ if ! grep --quiet security /etc/apt/sources.list; then
+ run cat <<EOF > /etc/apt/sources.list.d/security.list
deb http://security.debian.org/ ${code_name}/updates main
deb-src http://security.debian.org/ ${code_name}/updates main
EOF
- fi
- ;;
- Ubuntu)
- cat <<EOF > "${security_list}"
+ fi
+ run apt-get update
+ run apt-get install -y --allow-unauthenticated groonga-keyring
+ run apt-get update
+ ;;
+ ubuntu)
+ component=universe
+ run cat <<EOF > /etc/apt/sources.list.d/security.list
deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
EOF
- ;;
- esac
-
+ run sed -e 's/main/universe/' /etc/apt/sources.list > \
+ /etc/apt/sources.list.d/universe.list
+ run apt-get -y install software-properties-common
+ run add-apt-repository -y universe
+ run add-apt-repository -y ppa:groonga/ppa
run apt-get update
- run apt-get upgrade -V -y
-fi
-
-universe_list=/etc/apt/sources.list.d/universe.list
-if [ ! -f "$universe_list}" ]; then
- case ${distribution} in
- Ubuntu)
- sed -e 's/main/universe/' /etc/apt/sources.list > ${universe_list}
- run apt-get update
- ;;
- esac
-fi
+ ;;
+esac
-run apt-get install -V -y devscripts ${DEPENDED_PACKAGES}
+run apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
run apt-get build-dep -y ${mysql_server_package}
-run apt-get clean
-
-if ! id $USER_NAME >/dev/null 2>&1; then
- run useradd -m $USER_NAME
-fi
-
-cat <<EOF > $BUILD_SCRIPT
-#!/bin/sh
-
-rm -rf build
-mkdir -p build
-
-cp /tmp/${PACKAGE}-${VERSION}.tar.gz build/${PACKAGE}_${VERSION}.orig.tar.gz
-
-cd build
-
-tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
-cd ${PACKAGE}-${VERSION}/
-cp -rp /tmp/${PACKAGE}-debian debian
-# export DEB_BUILD_OPTIONS="noopt nostrip"
-MYSQL_PACKAGE_INFO=\$(apt-cache show mysql-server | grep Version | sort | tail -1)
-MYSQL_PACKAGE_VERSION=\${MYSQL_PACKAGE_INFO##Version: }
-sed -i "s/MYSQL_VERSION/\$MYSQL_PACKAGE_VERSION/" debian/control
-debuild -us -uc
-EOF
-run chmod +x $BUILD_SCRIPT
-run su - $USER_NAME $BUILD_SCRIPT
+run mkdir -p build
+run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
+ build/${PACKAGE}_${VERSION}.orig.tar.gz
+run cd build
+run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
+run cd ${PACKAGE}-${VERSION}/
+run cp -rp /vagrant/tmp/debian debian
+# export DEB_BUILD_OPTIONS=noopt
+MYSQL_PACKAGE_INFO=$(apt-cache show mysql-server | grep Version | sort | tail -1)
+MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_INFO##Version: }
+sed -i "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/" debian/control
+run debuild -us -uc
+run cd -
+
+package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
+pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
+run mkdir -p "${pool_dir}/"
+run cp *.tar.gz *.dsc *.deb "${pool_dir}/"
diff --git a/storage/mroonga/packages/apt/build-in-chroot.sh b/storage/mroonga/packages/apt/build-in-chroot.sh
deleted file mode 100755
index ab5cc589555..00000000000
--- a/storage/mroonga/packages/apt/build-in-chroot.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-
-if [ $# != 7 ]; then
- echo "Usage: $0 PACKAGE VERSION SOURCE_DIR DESTINATION CHROOT_BASE ARCHITECTURES CODES"
- echo " e.g.: $0 groonga 0.1.9 SOURCE_DIR repositories/ /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-PACKAGE=$1
-VERSION=$2
-SOURCE_DIR=$3
-DESTINATION=$4
-CHROOT_BASE=$5
-ARCHITECTURES=$6
-CODES=$7
-
-PATH=/usr/local/sbin:/usr/sbin:$PATH
-
-script_base_dir=`dirname $0`
-
-if test "$PARALLEL" = "yes"; then
- parallel="yes"
-else
- parallel="no"
-fi
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-run_sudo()
-{
- run sudo "$@"
-}
-
-build_chroot()
-{
- architecture=$1
- code_name=$2
-
- run_sudo debootstrap --arch $architecture $code_name $base_dir
-
- case $code_name in
- squeeze|wheezy|jessie|unstable)
- run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list
- ;;
- *)
- run_sudo sed -i'' \
- -e 's,http://archive,http://jp.archive,' \
- -e 's/main$/main universe/' \
- $base_dir/etc/apt/sources.list
- ;;
- esac
-
- run_sudo sh -c "echo >> /etc/fstab"
- run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab"
- run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab"
- run_sudo mount ${base_dir}/sys
- run_sudo mount ${base_dir}/dev
- run_sudo mount ${base_dir}/dev/pts
- run_sudo mount ${base_dir}/proc
-}
-
-build()
-{
- architecture=$1
- code_name=$2
-
- target=${code_name}-${architecture}
- base_dir=${CHROOT_BASE}/${target}
- if [ ! -d $base_dir ]; then
- run build_chroot $architecture $code_name
- fi
-
- case ${code_name} in
- squeeze|wheezy|jessie|unstable)
- distribution=debian
- component=main
- ;;
- *)
- distribution=ubuntu
- component=universe
- ;;
- esac
-
- source_dir=${SOURCE_DIR}
- build_user=${PACKAGE}-build
- build_user_dir=${base_dir}/home/$build_user
- build_dir=${build_user_dir}/build
- pool_base_dir=${DESTINATION}${distribution}/pool/${code_name}/${component}
- package_initial=$(echo ${PACKAGE} | sed -e 's/\(.\).*/\1/')
- pool_dir=${pool_base_dir}/${package_initial}/${PACKAGE}
- run cp $source_dir/${PACKAGE}-${VERSION}.tar.gz \
- ${CHROOT_BASE}/$target/tmp/
- run rm -rf ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run cp -rp $source_dir/debian/ \
- ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run echo $PACKAGE > ${CHROOT_BASE}/$target/tmp/build-package
- run echo $VERSION > ${CHROOT_BASE}/$target/tmp/build-version
- run echo $build_user > ${CHROOT_BASE}/$target/tmp/build-user
- run cp ${script_base_dir}/${PACKAGE}-depended-packages \
- ${CHROOT_BASE}/$target/tmp/depended-packages
- run cp ${script_base_dir}/build-deb.sh \
- ${CHROOT_BASE}/$target/tmp/
- run_sudo rm -rf $build_dir
- run_sudo su -c "/usr/sbin/chroot ${CHROOT_BASE}/$target /tmp/build-deb.sh"
- run mkdir -p $pool_dir
- for path in $build_dir/*; do
- [ -f $path ] && run cp -p $path $pool_dir/
- done
-}
-
-for architecture in $ARCHITECTURES; do
- for code_name in $CODES; do
- if test "$parallel" = "yes"; then
- build $architecture $code_name &
- else
- mkdir -p tmp
- build_log=tmp/build-$code_name-$architecture.log
- build $architecture $code_name 2>&1 | tee $build_log
- fi;
- done;
-done
-
-if test "$parallel" = "yes"; then
- wait
-fi
diff --git a/storage/mroonga/packages/apt/mroonga-depended-packages b/storage/mroonga/packages/apt/env.sh.in
index fe9e01ba19f..a44d6b36871 100644
--- a/storage/mroonga/packages/apt/mroonga-depended-packages
+++ b/storage/mroonga/packages/apt/env.sh.in
@@ -1,3 +1,6 @@
+PACKAGE=@PACKAGE@
+VERSION=@VERSION@
+DEPENDED_PACKAGES="
debhelper
autotools-dev
libgroonga-dev
@@ -9,3 +12,4 @@ libmysqld-dev
libssl-dev
groonga-normalizer-mysql
wget
+"
diff --git a/storage/mroonga/packages/debian/changelog b/storage/mroonga/packages/debian/changelog
index a846b8b5de8..5554825d99e 100644
--- a/storage/mroonga/packages/debian/changelog
+++ b/storage/mroonga/packages/debian/changelog
@@ -1,3 +1,9 @@
+mroonga (4.06-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Sep 2014 00:00:00 +0900
+
mroonga (4.05-1) unstable; urgency=low
* New upstream release.
diff --git a/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in
index 5ed56b433b2..34ac9b9f87b 100644
--- a/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in
+++ b/storage/mroonga/packages/rpm/centos/mariadb-mroonga.spec.in
@@ -154,6 +154,9 @@ fi
%doc mysql-mroonga-doc/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
diff --git a/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in
index af2a026c701..e87abb51e51 100644
--- a/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in
+++ b/storage/mroonga/packages/rpm/centos/mysql55-mroonga.spec.in
@@ -163,6 +163,9 @@ fi
%doc mysql-mroonga-doc/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
diff --git a/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in
index 6cd5d30cc84..ce8fd63a467 100644
--- a/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in
+++ b/storage/mroonga/packages/rpm/centos/mysql56-community-mroonga.spec.in
@@ -1,14 +1,14 @@
%{!?centos_ver:%define centos_ver 6}
%if %{centos_ver} == 7
-%define mysql_version_default 5.6.20
-%define mysql_release_default 4
+%define mysql_version_default 5.6.21
+%define mysql_release_default 2
%define mysql_dist_default el7
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/7/SRPMS
%define mysql_spec_file_default mysql.spec
%else
-%define mysql_version_default 5.6.20
-%define mysql_release_default 4
+%define mysql_version_default 5.6.21
+%define mysql_release_default 2
%define mysql_dist_default el6
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/6/SRPMS
%define mysql_spec_file_default mysql.spec
@@ -158,6 +158,12 @@ fi
%doc mysql-mroonga-doc/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
+- new upstream release.
+
+* Sat Sep 27 2014 Eiichi Sato <miko@cafelounge.net> - 4.05-2
+- build against MySQL 5.6.21-2 on MySQL yum repository.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
diff --git a/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in b/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in
index 9ee123448b2..2e4f1a60729 100644
--- a/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in
+++ b/storage/mroonga/packages/rpm/fedora/mariadb-mroonga.spec.in
@@ -136,6 +136,9 @@ fi
%doc mariadb-mroonga-doc/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
diff --git a/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in b/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in
index 4e28121a611..665f0c2259e 100644
--- a/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in
+++ b/storage/mroonga/packages/rpm/fedora/mysql-mroonga.spec.in
@@ -133,6 +133,9 @@ fi
%doc mysql-mroonga-doc/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
diff --git a/storage/mroonga/packages/source/Makefile.am b/storage/mroonga/packages/source/Makefile.am
index dc4c17d2cd6..53667d83894 100644
--- a/storage/mroonga/packages/source/Makefile.am
+++ b/storage/mroonga/packages/source/Makefile.am
@@ -1,7 +1,7 @@
MROONGA_BASE = $(PACKAGE)-$(VERSION)
MROONGA_TAR_GZ = $(MROONGA_BASE).tar.gz
-GROONGA_VERSION = 4.0.4
+GROONGA_VERSION = 4.0.6
GROONGA_BASE = groonga-$(GROONGA_VERSION)
GROONGA_TAR_GZ = $(GROONGA_BASE).tar.gz
@@ -11,7 +11,7 @@ GROONGA_NORMALIZER_MYSQL_BASE = \
GROONGA_NORMALIZER_MYSQL_TAR_GZ = \
$(GROONGA_NORMALIZER_MYSQL_BASE).tar.gz
-MARIADB_VERSION = 10.0.13
+MARIADB_VERSION = 10.0.14
MARIADB_BASE = mariadb-$(MARIADB_VERSION)
MARIADB_TAR_GZ = $(MARIADB_BASE).tar.gz
diff --git a/storage/mroonga/packages/yum/sign-rpm.sh b/storage/mroonga/packages/yum/sign-rpm.sh
index 511fb3df0a4..b3a45afe7f5 100755
--- a/storage/mroonga/packages/yum/sign-rpm.sh
+++ b/storage/mroonga/packages/yum/sign-rpm.sh
@@ -28,6 +28,14 @@ unsigned_rpms()
done
}
+if ! gpg --list-keys "${GPG_UID}" > /dev/null 2>&1; then
+ run gpg --keyserver keyserver.ubuntu.com --recv-key "${GPG_UID}"
+fi
+run mkdir -p tmp
+run gpg --armor --export "${GPG_UID}" > tmp/sign-key
+run rpm --import tmp/sign-key
+run rm -rf tmp/sign-key
+
rpms=""
for distribution in ${DISTRIBUTIONS}; do
rpms="${rpms} $(find ${DESTINATION}${distribution} -name '*.rpm' | unsigned_rpms)"
diff --git a/storage/mroonga/plugin_version b/storage/mroonga/plugin_version
index 958d30d86d0..be9fc83102e 100644
--- a/storage/mroonga/plugin_version
+++ b/storage/mroonga/plugin_version
@@ -1 +1 @@
-4.5 \ No newline at end of file
+4.6 \ No newline at end of file
diff --git a/storage/mroonga/sources.am b/storage/mroonga/sources.am
index 4082e9465a1..0cf4a64b504 100644
--- a/storage/mroonga/sources.am
+++ b/storage/mroonga/sources.am
@@ -1,7 +1,5 @@
sources = \
mrn_macro.hpp \
- mrn_sys.cpp \
- mrn_sys.hpp \
mrn_constants.hpp \
ha_mroonga.cpp \
ha_mroonga.hpp \
diff --git a/storage/mroonga/test/unit/Makefile.am b/storage/mroonga/test/unit/Makefile.am
index 30c9ca20486..3950ce0dc7f 100644
--- a/storage/mroonga/test/unit/Makefile.am
+++ b/storage/mroonga/test/unit/Makefile.am
@@ -1,6 +1,5 @@
if WITH_CUTTER
noinst_LTLIBRARIES = \
- test_mrn_sys.la \
test_mrn_path_mapper.la
endif
@@ -21,12 +20,6 @@ LIBS = \
$(GROONGA_LIBS) \
$(MECAB_LIBS)
-EXTERNAL_SRC = ../../mrn_sys.cpp
-
-test_mrn_sys_la_SOURCES = \
- $(EXTERNAL_SRC) \
- test_mrn_sys.cpp
-
test_mrn_path_mapper_la_SOURCES = \
test_mrn_path_mapper.cpp
diff --git a/storage/mroonga/test/unit/test_mrn_sys.cpp b/storage/mroonga/test/unit/test_mrn_sys.cpp
deleted file mode 100644
index fcc4b768efe..00000000000
--- a/storage/mroonga/test/unit/test_mrn_sys.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- c-basic-offset: 2 -*- */
-/*
- Copyright(C) 2010 Tetsuro IKEDA
- Copyright(C) 2011-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <string.h>
-#include <cppcutter.h>
-
-#include <mrn_sys.hpp>
-
-static grn_ctx *ctx;
-static grn_obj *db;
-static grn_hash *hash;
-static grn_obj buffer;
-
-namespace test_mrn_sys
-{
- void cut_startup()
- {
- ctx = (grn_ctx *)malloc(sizeof(grn_ctx));
- grn_init();
- grn_ctx_init(ctx, 0);
- db = grn_db_create(ctx, NULL, NULL);
- grn_ctx_use(ctx, db);
- }
-
- void cut_shutdown()
- {
- grn_obj_unlink(ctx, db);
- grn_ctx_fin(ctx);
- grn_fin();
- free(ctx);
- }
-
- void cut_setup()
- {
- hash = grn_hash_create(ctx, NULL, 1024, sizeof(grn_obj *),
- GRN_OBJ_KEY_VAR_SIZE);
- GRN_TEXT_INIT(&buffer, 0);
- }
-
- void cut_teardown()
- {
- grn_hash_close(ctx, hash);
- grn_obj_unlink(ctx, &buffer);
- }
-
- void test_mrn_hash_put()
- {
- const char *key = "mroonga";
-
- cut_assert_true(mrn_hash_put(ctx, hash, key, &buffer));
- cut_assert_false(mrn_hash_put(ctx, hash, key, &buffer));
- }
-
- void test_mrn_hash_get()
- {
- const char *key = "mroonga";
- const char *value = "A storage engine based on groonga.";
- grn_obj *result;
-
- GRN_TEXT_SETS(ctx, &buffer, value);
- GRN_TEXT_PUT(ctx, &buffer, "\0", 1);
-
- mrn_hash_put(ctx, hash, key, &buffer);
- cut_assert_true(mrn_hash_get(ctx, hash, key, &result));
- cppcut_assert_equal(value, GRN_TEXT_VALUE(&buffer));
- }
-
- void test_mrn_hash_remove()
- {
- const char *key = "mroonga";
-
- mrn_hash_put(ctx, hash, key, &buffer);
-
- cut_assert_false(mrn_hash_remove(ctx, hash, "nonexistent"));
- cut_assert_true(mrn_hash_remove(ctx, hash, key));
- cut_assert_false(mrn_hash_remove(ctx, hash, key));
- }
-}
diff --git a/storage/mroonga/tools/travis/before_script.sh b/storage/mroonga/tools/travis/before_script.sh
index fb0d78d4922..8fd3f78f1db 100755
--- a/storage/mroonga/tools/travis/before_script.sh
+++ b/storage/mroonga/tools/travis/before_script.sh
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
#
-# Copyright(C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2012-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
@@ -19,8 +19,12 @@
# set -x
set -e
-if [ "$MRN_BUNDLED" = "yes" ]; then
- cmake . -DWITH_DEBUG=1
+if [ "${MROONGA_BUNDLED}" = "yes" ]; then
+ cmake_args=(-DCMAKE_BUILD_TYPE=Debug)
+ if [ "${MROONGA_TEST_EMBEDDED}" = "yes" ]; then
+ cmake_args=("${cmake_args[@]}" "-DWITH_EMBEDDED_SERVER=TRUE")
+ fi
+ cmake . "${cmake_args[@]}"
else
./autogen.sh
diff --git a/storage/mroonga/tools/travis/install.sh b/storage/mroonga/tools/travis/install.sh
index 64bcde764cf..fd3d2187914 100755
--- a/storage/mroonga/tools/travis/install.sh
+++ b/storage/mroonga/tools/travis/install.sh
@@ -32,7 +32,7 @@ if [ ! -f /usr/lib/groonga/plugins/tokenizers/mecab.so ]; then
sudo apt-get -qq -y install groonga-tokenizer-mecab
fi
-if [ "${MRN_BUNDLED}" = "yes" ]; then
+if [ "${MROONGA_BUNDLED}" = "yes" ]; then
mkdir -p .mroonga
mv * .mroonga/
mv .mroonga/tools ./
diff --git a/storage/mroonga/tools/travis/script.sh b/storage/mroonga/tools/travis/script.sh
index 9eb8a805e23..632a4db7a7e 100755
--- a/storage/mroonga/tools/travis/script.sh
+++ b/storage/mroonga/tools/travis/script.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright(C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
+# Copyright(C) 2012-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
@@ -31,20 +31,24 @@ else
. "${top_dir}/config.sh"
fi
-if [ "${MRN_BUNDLED}" = "TRUE" ]; then
- n_processors=1
-else
- n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)"
+n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)"
+max_n_processors=8
+if (( $n_processors > $max_n_processors )); then
+ n_processors=$max_n_processors
fi
build()
{
- make -j${n_processors} > /dev/null
+ if [ "${MROONGA_BUNDLED}" = "yes" ]; then
+ make > /dev/null
+ else
+ make -j${n_processors} > /dev/null
+ fi
}
run_unit_test()
{
- if [ "${MRN_BUNDLED}" != "TRUE" ]; then
+ if [ "${MROONGA_BUNDLED}" != "yes" ]; then
NO_MAKE=yes ${mroonga_dir}/test/run-unit-test.sh
fi
}
@@ -89,12 +93,14 @@ prepare_sql_test()
run_sql_test()
{
test_args=()
- if [ "${MRN_TEST_EMBEDDED}" = "yes" ]; then
+ if [ "${MROONGA_TEST_EMBEDDED}" = "yes" ]; then
test_args=("${test_args[@]}" "--embedded-server")
fi
- if [ "${MRN_BUNDLED}" = "TRUE" ]; then
- ${mroonga_dir}/test/run-sql-test.sh "${test_args[@]}"
+ if [ "${MROONGA_BUNDLED}" = "yes" ]; then
+ ${mroonga_dir}/test/run-sql-test.sh \
+ "${test_args[@]}" \
+ --parallel="${n_processors}"
else
prepare_sql_test
diff --git a/storage/mroonga/udf/mrn_udf_command.cpp b/storage/mroonga/udf/mrn_udf_command.cpp
index 67dbf8bcd1d..ba92e8daa26 100644
--- a/storage/mroonga/udf/mrn_udf_command.cpp
+++ b/storage/mroonga/udf/mrn_udf_command.cpp
@@ -24,12 +24,17 @@
#include <mrn_path_mapper.hpp>
#include <mrn_windows.hpp>
#include <mrn_macro.hpp>
+#include <mrn_database_manager.hpp>
+
+extern mrn::DatabaseManager *mrn_db_manager;
MRN_BEGIN_DECLS
struct CommandInfo
{
grn_ctx ctx;
+ grn_obj *db;
+ bool use_shared_db;
String result;
};
@@ -66,13 +71,17 @@ MRN_API my_bool mroonga_command_init(UDF_INIT *initid, UDF_ARGS *args,
const char *action;
if (current_db_path) {
action = "open database";
- mrn::PathMapper mapper(current_db_path);
- grn_db_open(&(info->ctx), mapper.db_path());
+ int error = mrn_db_manager->open(current_db_path, &(info->db));
+ if (error == 0) {
+ grn_ctx_use(&(info->ctx), info->db);
+ info->use_shared_db = true;
+ }
} else {
action = "create anonymous database";
- grn_db_create(&(info->ctx), NULL, NULL);
+ info->db = grn_db_create(&(info->ctx), NULL, NULL);
+ info->use_shared_db = false;
}
- if (info->ctx.rc != GRN_SUCCESS) {
+ if (!info->db) {
sprintf(message,
"mroonga_command(): failed to %s: %s",
action,
@@ -87,10 +96,8 @@ MRN_API my_bool mroonga_command_init(UDF_INIT *initid, UDF_ARGS *args,
error:
if (info) {
- grn_obj *db;
- db = grn_ctx_db(&(info->ctx));
- if (db) {
- grn_obj_close(&(info->ctx), db);
+ if (!info->use_shared_db) {
+ grn_obj_close(&(info->ctx), info->db);
}
grn_ctx_fin(&(info->ctx));
my_free(info, MYF(0));
@@ -152,9 +159,8 @@ MRN_API void mroonga_command_deinit(UDF_INIT *initid)
{
CommandInfo *info = (CommandInfo *)initid->ptr;
if (info) {
- grn_obj *db = grn_ctx_db(&(info->ctx));
- if (db) {
- grn_obj_close(&(info->ctx), db);
+ if (!info->use_shared_db) {
+ grn_obj_close(&(info->ctx), info->db);
}
grn_ctx_fin(&(info->ctx));
info->result.free();
diff --git a/storage/mroonga/udf/mrn_udf_snippet.cpp b/storage/mroonga/udf/mrn_udf_snippet.cpp
index a959377d9ce..84166a36f16 100644
--- a/storage/mroonga/udf/mrn_udf_snippet.cpp
+++ b/storage/mroonga/udf/mrn_udf_snippet.cpp
@@ -69,7 +69,7 @@ static my_bool mrn_snippet_prepare(st_mrn_snip_info *snip_info, UDF_ARGS *args,
goto error;
}
}
- if (!mrn::encoding::set(ctx, cs)) {
+ if (!mrn::encoding::set_raw(ctx, cs)) {
snprintf(message, MYSQL_ERRMSG_SIZE,
"Unsupported charset: <%s>", cs->name);
goto error;
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index 649bc9a103f..930556e8fe6 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright(C) 2012-2013 Brazil
+# Copyright(C) 2012-2014 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -97,32 +97,22 @@ set(GRN_RUBY_SCRIPTS_DIR
"${CMAKE_INSTALL_PREFIX}/${GRN_RELATIVE_RUBY_SCRIPTS_DIR}")
macro(check_cflag flag)
- set(checking_message "checking for C flag '${flag}'")
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
set(temporary_variable_name "CFLAG${temporary_variable_name}")
-# unset(${temporary_variable_name})
check_c_compiler_flag(${flag} ${temporary_variable_name})
if(${temporary_variable_name})
- message(STATUS "${checking_message} - available")
set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} ${flag}")
- else()
- message(STATUS "${checking_message} - not available")
endif()
endmacro()
macro(check_cxxflag flag)
- set(checking_message "checking for CXX flag '${flag}'")
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
set(temporary_variable_name "CXXFLAG${temporary_variable_name}")
-# unset(${temporary_variable_name})
check_cxx_compiler_flag(${flag} ${temporary_variable_name})
if(${temporary_variable_name})
- message(STATUS "${checking_message} - available")
set(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} ${flag}")
- else()
- message(STATUS "${checking_message} - not available")
endif()
endmacro()
@@ -187,21 +177,18 @@ macro(ac_check_headers header)
string(REGEX REPLACE "[/.]" "_" output_variable_name ${header})
string(TOUPPER "${output_variable_name}" output_variable_name)
set(output_variable_name "HAVE_${output_variable_name}")
-# unset(${output_variable_name})
check_include_file(${header} ${output_variable_name})
endmacro()
macro(ac_check_funcs function)
string(TOUPPER "${function}" output_variable_name)
set(output_variable_name "HAVE_${output_variable_name}")
-# unset(${output_variable_name})
check_function_exists(${function} ${output_variable_name})
endmacro()
macro(ac_check_symbols symbol files)
string(TOUPPER "${symbol}" output_variable_name)
set(output_variable_name "HAVE_${output_variable_name}")
-# unset(${output_variable_name})
check_symbol_exists(${symbol} ${files} ${output_variable_name})
endmacro()
@@ -210,7 +197,6 @@ macro(ac_check_lib library function)
string(TOUPPER "${output_variable_base_name}" output_variable_base_name)
set(output_variable_name "HAVE_LIB${output_variable_base_name}")
set(location "${ARG2}")
-# unset(${output_variable_name})
check_library_exists(${library} ${function} "${location}"
${output_variable_name})
if(${output_variable_name})
@@ -332,15 +318,15 @@ endif()
set(GRN_WITH_MECAB "auto"
CACHE STRING "use MeCab for morphological analysis")
if(NOT ${GRN_WITH_MECAB} STREQUAL "no")
- set(MECAB_CONFIG "mecab-config" CACHE FILEPATH "mecab-config path")
+ set(GRN_MECAB_CONFIG "mecab-config" CACHE FILEPATH "mecab-config path")
if(NOT CMAKE_CROSSCOMPILING)
- find_program(MECAB_CONFIG_ABSOLUTE_PATH "${MECAB_CONFIG}")
+ find_program(GRN_MECAB_CONFIG_ABSOLUTE_PATH "${GRN_MECAB_CONFIG}")
endif()
- if(EXISTS "${MECAB_CONFIG_ABSOLUTE_PATH}")
- execute_process(COMMAND "${MECAB_CONFIG_ABSOLUTE_PATH}" --inc-dir
+ if(EXISTS "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}")
+ execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --inc-dir
OUTPUT_VARIABLE MECAB_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND "${MECAB_CONFIG_ABSOLUTE_PATH}" --libs-only-L
+ execute_process(COMMAND "${GRN_MECAB_CONFIG_ABSOLUTE_PATH}" --libs-only-L
OUTPUT_VARIABLE MECAB_LIBRARY_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(MECAB_LIBRARIES "mecab")
@@ -358,7 +344,7 @@ if(NOT ${GRN_WITH_MECAB} STREQUAL "no")
endif()
else()
if(${GRN_WITH_MECAB} STREQUAL "yes")
- message(FATAL_ERROR "No mecab-config found: <${MECAB_CONFIG}>")
+ message(FATAL_ERROR "No mecab-config found: <${GRN_MECAB_CONFIG}>")
endif()
set(GRN_WITH_MECAB FALSE)
endif()
diff --git a/storage/mroonga/vendor/groonga/base_version b/storage/mroonga/vendor/groonga/base_version
index 8b2dd6c36f4..9eefef7bd65 100644
--- a/storage/mroonga/vendor/groonga/base_version
+++ b/storage/mroonga/vendor/groonga/base_version
@@ -1 +1 @@
-4.0.5 \ No newline at end of file
+4.0.6 \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/benchmark/Makefile.am b/storage/mroonga/vendor/groonga/benchmark/Makefile.am
index 146bd49d8ff..310fb4585a3 100644
--- a/storage/mroonga/vendor/groonga/benchmark/Makefile.am
+++ b/storage/mroonga/vendor/groonga/benchmark/Makefile.am
@@ -10,7 +10,8 @@ noinst_PROGRAMS = \
bench-geo-distance \
bench-geo-select \
bench-ctx-create \
- bench-query-optimizer
+ bench-query-optimizer \
+ bench-range-select
endif
EXTRA_DIST = \
@@ -46,12 +47,16 @@ nodist_EXTRA_bench_ctx_create_SOURCES = $(NONEXISTENT_CXX_SOURCE)
bench_query_optimizer_SOURCES = bench-query-optimizer.c
nodist_EXTRA_bench_query_optimizer_SOURCES = $(NONEXISTENT_CXX_SOURCE)
+bench_range_select_SOURCES = bench-range-select.c
+nodist_EXTRA_bench_range_select_SOURCES = $(NONEXISTENT_CXX_SOURCE)
+
benchmarks = \
run-bench-table-factory \
run-bench-geo-distance \
run-bench-geo-select \
run-bench-ctx-create \
- run-bench-query-optimizer
+ run-bench-query-optimizer \
+ run-bench-range-select
run-bench-table-factory: bench-table-factory
@echo $@:
@@ -86,4 +91,12 @@ run-bench-query-optimizer: bench-query-optimizer
GRN_RUBY_SCRIPTS_DIR=$(top_srcdir)/lib/mrb/scripts \
./bench-query-optimizer
+run-bench-range-select: bench-range-select
+ @echo $@:
+ @[ ! -e tmp ] && ln -s /dev/shm tmp || :
+ @mkdir -p tmp/range-select
+ env \
+ GRN_RUBY_SCRIPTS_DIR=$(top_srcdir)/lib/mrb/scripts \
+ ./bench-range-select
+
benchmark: $(benchmarks)
diff --git a/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c b/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c
new file mode 100644
index 00000000000..4c0b500aae2
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/benchmark/bench-range-select.c
@@ -0,0 +1,274 @@
+/* -*- c-basic-offset: 2; coding: utf-8 -*- */
+/*
+ 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 version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/*
+ Groonga: 09a4c4e00832fb90dee74c5b97b7cf0f5952f85b
+
+ CPU Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz (fam: 06, model: 1e, stepping: 05)
+
+ CFLAGS: -O0 -g3
+ % make --quiet -C benchmark run-bench-range-select
+ run-bench-range-select:
+ Process 10 times in each pattern
+ (total) (average) (median)
+ ( 500, 600] ( 1000): with mruby: (0.0058s) (0.5773ms) (0.5830ms)
+ ( 500, 600] ( 1000): without mruby: (0.0062s) (0.6203ms) (0.6200ms)
+ ( 5000, 5100] ( 10000): with mruby: (0.0058s) (0.5827ms) (0.5800ms)
+ ( 5000, 5100] ( 10000): without mruby: (0.0473s) (0.0047s) (0.0048s)
+ ( 50000, 50100] ( 100000): with mruby: (0.0064s) (0.6397ms) (0.6370ms)
+ ( 50000, 50100] ( 100000): without mruby: (0.4498s) (0.0450s) (0.0442s)
+ (500000, 500100] (1000000): with mruby: (0.0057s) (0.5710ms) (0.5190ms)
+ (500000, 500100] (1000000): without mruby: (4.3193s) (0.4319s) (0.4306s)
+
+ CFLAGS: -O2 -g
+ % make --quiet -C benchmark run-bench-range-select
+ run-bench-range-select:
+ Process 10 times in each pattern
+ (total) (average) (median)
+ ( 500, 600] ( 1000): with mruby: (0.0031s) (0.3058ms) (0.2890ms)
+ ( 500, 600] ( 1000): without mruby: (0.0031s) (0.3132ms) (0.3090ms)
+ ( 5000, 5100] ( 10000): with mruby: (0.0031s) (0.3063ms) (0.3100ms)
+ ( 5000, 5100] ( 10000): without mruby: (0.0239s) (0.0024s) (0.0023s)
+ ( 50000, 50100] ( 100000): with mruby: (0.0028s) (0.2825ms) (0.2660ms)
+ ( 50000, 50100] ( 100000): without mruby: (0.2117s) (0.0212s) (0.0211s)
+ (500000, 500100] (1000000): with mruby: (0.0028s) (0.2757ms) (0.2650ms)
+ (500000, 500100] (1000000): without mruby: (2.0874s) (0.2087s) (0.2092s)
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include <db.h>
+#include <groonga.h>
+
+#include "lib/benchmark.h"
+
+#define GET(context, name) (grn_ctx_get(context, name, strlen(name)))
+
+typedef struct _BenchmarkData
+{
+ grn_ctx context;
+ grn_obj *database;
+ guint n_records;
+ grn_bool use_mruby;
+ const gchar *command;
+} BenchmarkData;
+
+static void
+run_command(grn_ctx *context, const gchar *command)
+{
+ gchar *response;
+ unsigned int response_length;
+ int flags;
+
+ grn_ctx_send(context, command, strlen(command), 0);
+ grn_ctx_recv(context, &response, &response_length, &flags);
+}
+
+static void
+bench(gpointer user_data)
+{
+ BenchmarkData *data = user_data;
+ grn_ctx *context = &(data->context);
+
+ run_command(context, data->command);
+}
+
+static gchar *
+get_tmp_dir(void)
+{
+ gchar *current_dir;
+ gchar *tmp_dir;
+
+ current_dir = g_get_current_dir();
+ tmp_dir = g_build_filename(current_dir, "tmp", NULL);
+ g_free(current_dir);
+
+ return tmp_dir;
+}
+
+static void
+setup_database(BenchmarkData *data)
+{
+ grn_ctx *context = &(data->context);
+ gchar *tmp_dir;
+ gchar *database_last_component_name;
+ gchar *database_path;
+ guint i;
+
+ tmp_dir = get_tmp_dir();
+ database_last_component_name =
+ g_strdup_printf("db-%d-%s-mruby",
+ data->n_records,
+ data->use_mruby ? "with" : "without");
+ database_path = g_build_filename(tmp_dir,
+ "range-select",
+ database_last_component_name,
+ NULL);
+ g_free(database_last_component_name);
+
+ if (g_file_test(database_path, G_FILE_TEST_EXISTS)) {
+ data->database = grn_db_open(context, database_path);
+ run_command(context, "dump");
+ } else {
+ data->database = grn_db_create(context, database_path, NULL);
+
+ run_command(context, "table_create Entries TABLE_NO_KEY");
+ run_command(context, "column_create Entries rank COLUMN_SCALAR Int32");
+ run_command(context, "table_create Ranks TABLE_PAT_KEY Int32");
+ run_command(context,
+ "column_create Ranks entries_rank COLUMN_INDEX Entries rank");
+
+ run_command(context, "load --table Entries");
+ run_command(context, "[");
+ for (i = 0; i < data->n_records; i++) {
+#define BUFFER_SIZE 4096
+ gchar buffer[BUFFER_SIZE];
+ const gchar *separator;
+ if (i == (data->n_records - 1)) {
+ separator = "";
+ } else {
+ separator = ",";
+ }
+ snprintf(buffer, BUFFER_SIZE, "{\"rank\": %u}%s", i, separator);
+ run_command(context, buffer);
+#undef BUFFER_SIZE
+ }
+ run_command(context, "]");
+ }
+
+ g_free(database_path);
+}
+
+static void
+bench_startup(BenchmarkData *data)
+{
+ if (data->use_mruby) {
+ g_setenv("GRN_MRUBY_ENABLED", "yes", TRUE);
+ } else {
+ g_setenv("GRN_MRUBY_ENABLED", "no", TRUE);
+ }
+ grn_ctx_init(&(data->context), 0);
+ setup_database(data);
+}
+
+static void
+bench_shutdown(BenchmarkData *data)
+{
+ grn_ctx *context = &(data->context);
+
+ grn_obj_close(context, data->database);
+ grn_ctx_fin(context);
+}
+
+int
+main(int argc, gchar **argv)
+{
+ BenchReporter *reporter;
+ gint n = 10;
+
+ grn_init();
+
+ g_print("Process %d times in each pattern\n", n);
+
+ bench_init(&argc, &argv);
+ reporter = bench_reporter_new();
+
+ {
+ BenchmarkData data_small_with_mruby;
+ BenchmarkData data_small_without_mruby;
+ BenchmarkData data_medium_with_mruby;
+ BenchmarkData data_medium_without_mruby;
+ BenchmarkData data_large_with_mruby;
+ BenchmarkData data_large_without_mruby;
+ BenchmarkData data_very_large_with_mruby;
+ BenchmarkData data_very_large_without_mruby;
+
+#define REGISTER(data, n_records_, min, max, use_mruby_) \
+ do { \
+ gchar *label; \
+ label = g_strdup_printf("(%6d, %6d] (%7d): %7s mruby", \
+ min, max, n_records_, \
+ use_mruby_ ? "with" : "without"); \
+ data.use_mruby = use_mruby_; \
+ data.n_records = n_records_; \
+ data.command = \
+ "select Entries --cache no " \
+ "--filter 'rank > " #min " && rank <= " #max "'"; \
+ bench_startup(&data); \
+ bench_reporter_register(reporter, label, \
+ n, \
+ NULL, \
+ bench, \
+ NULL, \
+ &data); \
+ g_free(label); \
+ } while(FALSE)
+
+ REGISTER(data_small_with_mruby,
+ 1000,
+ 500, 600,
+ GRN_TRUE);
+ REGISTER(data_small_without_mruby,
+ 1000,
+ 500, 600,
+ GRN_FALSE);
+ REGISTER(data_medium_with_mruby,
+ 10000,
+ 5000, 5100,
+ GRN_TRUE);
+ REGISTER(data_medium_without_mruby,
+ 10000,
+ 5000, 5100,
+ GRN_FALSE);
+ REGISTER(data_large_with_mruby,
+ 100000,
+ 50000, 50100,
+ GRN_TRUE);
+ REGISTER(data_large_without_mruby,
+ 100000,
+ 50000, 50100,
+ GRN_FALSE);
+ REGISTER(data_very_large_with_mruby,
+ 1000000,
+ 500000, 500100,
+ GRN_TRUE);
+ REGISTER(data_very_large_without_mruby,
+ 1000000,
+ 500000, 500100,
+ GRN_FALSE);
+
+#undef REGISTER
+
+ bench_reporter_run(reporter);
+
+ bench_shutdown(&data_small_with_mruby);
+ bench_shutdown(&data_small_without_mruby);
+ bench_shutdown(&data_medium_with_mruby);
+ bench_shutdown(&data_medium_without_mruby);
+ bench_shutdown(&data_large_with_mruby);
+ bench_shutdown(&data_large_without_mruby);
+ bench_shutdown(&data_very_large_with_mruby);
+ bench_shutdown(&data_very_large_without_mruby);
+ }
+ g_object_unref(reporter);
+
+ grn_fin();
+
+ return 0;
+}
diff --git a/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4 b/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4
index 676b41f7e59..513f61afac4 100644
--- a/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4
+++ b/storage/mroonga/vendor/groonga/build/ac_macros/check_headers.m4
@@ -16,7 +16,6 @@ AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/sysctl.h)
AC_CHECK_HEADERS(sys/time.h)
-AC_CHECK_HEADERS(sys/timeb.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(time.h)
diff --git a/storage/mroonga/vendor/groonga/config.h.cmake b/storage/mroonga/vendor/groonga/config.h.cmake
index 1744b192ad5..d172bc36dba 100644
--- a/storage/mroonga/vendor/groonga/config.h.cmake
+++ b/storage/mroonga/vendor/groonga/config.h.cmake
@@ -116,7 +116,6 @@
#cmakedefine HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_SYSCALL_H
#cmakedefine HAVE_SYS_SYSCTL_H
-#cmakedefine HAVE_SYS_TIMEB_H
#cmakedefine HAVE_SYS_TIME_H
#cmakedefine HAVE_SYS_TYPES_H
#cmakedefine HAVE_SYS_WAIT_H
diff --git a/storage/mroonga/vendor/groonga/configure.ac b/storage/mroonga/vendor/groonga/configure.ac
index 9a07e410125..2be82a165e2 100644
--- a/storage/mroonga/vendor/groonga/configure.ac
+++ b/storage/mroonga/vendor/groonga/configure.ac
@@ -75,6 +75,7 @@ AC_MSG_RESULT([$solaris])
AC_C_BIGENDIAN
AC_PROG_CXX
AC_PROG_CC
+AC_PROG_CC_C99
AM_PROG_CC_C_O
m4_ifdef([PKG_PROG_PKG_CONFIG],
[PKG_PROG_PKG_CONFIG([0.19])
@@ -233,6 +234,7 @@ AC_CONFIG_FILES([
plugins/table/Makefile
plugins/query_expanders/Makefile
plugins/ruby/Makefile
+ plugins/token_filters/Makefile
examples/Makefile
examples/dictionary/Makefile
examples/dictionary/edict/Makefile
@@ -1139,7 +1141,12 @@ For Debian GNU/Linux based system like Ubuntu:
For Red Hat based system like CentOS:
% sudo yum install -y python-pip
- % sudo pip install sphinx])
+ % sudo pip install sphinx
+
+For OS X with Homebrew:
+ % brew install pip
+ % export PATH="`brew --prefix gettext`/bin:\$PATH"
+ % pip install sphinx])
fi
AC_SUBST(SPHINX_BUILD)
fi
@@ -1237,6 +1244,9 @@ AC_SUBST(table_pluginsdir)
ruby_pluginsdir="\${pluginsdir}/ruby"
AC_SUBST(ruby_pluginsdir)
+token_filter_pluginsdir="\${pluginsdir}/token_filters"
+AC_SUBST(token_filter_pluginsdir)
+
AC_MSG_CHECKING(for the suffix of plugin shared libraries)
shrext_cmds=$(./libtool --config | grep '^shrext_cmds=')
eval $shrext_cmds
@@ -1269,6 +1279,8 @@ AC_SUBST(examples_dictionarydir)
# for ruby scripts
relative_ruby_scriptsdir_base="\$(PACKAGE)/scripts/ruby"
AC_SUBST(relative_ruby_scriptsdir_base)
+relative_ruby_scriptsdir="lib/\$(relative_ruby_scriptsdir_base)"
+AC_SUBST(relative_ruby_scriptsdir)
ruby_scriptsdir="\${libdir}/\$(relative_ruby_scriptsdir_base)"
AC_SUBST(ruby_scriptsdir)
@@ -1343,7 +1355,8 @@ fi
AC_MSG_RESULT($enable_mruby)
if test "$enable_mruby" = "yes"; then
- if test "$ac_cv_ruby_available" != "yes"; then
+ if test ! -f "$srcdir/vendor/mruby/mruby-build.timestamp" -a \
+ "$ac_cv_ruby_available" != "yes"; then
AC_MSG_ERROR(--enable-ruby requires --with-ruby)
fi
AC_DEFINE(GRN_WITH_MRUBY, [1], [Define to 1 if mruby is enabled.])
@@ -1359,6 +1372,14 @@ AC_SUBST(MRUBY_CFLAGS)
AC_SUBST(MRUBY_LIBS)
AM_CONDITIONAL(WITH_MRUBY, test "$enable_mruby" = "yes")
+# This option is used in vendor/onigmo/configure
+AC_ARG_ENABLE(shared-onigmo,
+ [AS_HELP_STRING([--enable-shared-onigmo],
+ [use Onigmo as shared library instead of static library. [default=no]])],
+ [enable_shared_onigmo="$enableval"],
+ [enable_shared_onigmo="no"])
+AM_CONDITIONAL(WITH_SHARED_ONIGMO, test "$enable_shared_onigmo" = "yes")
+
# PCRE
GRN_WITH_PCRE=no
AC_ARG_WITH(pcre,
@@ -1427,6 +1448,7 @@ AC_OUTPUT([
packages/rpm/centos/groonga.spec
packages/rpm/fedora/groonga.spec
packages/apt/debian/groonga-keyring.postrm
+ packages/apt/env.sh
packages/yum/env.sh
groonga.pc
config.sh
diff --git a/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou b/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou
new file mode 100644
index 00000000000..15cdec60fe6
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service b/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service
index 96129dcbe68..7f19d7228d3 100644
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service
+++ b/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service
@@ -7,6 +7,7 @@ Conflicts=groonga.service
Type=forking
User=root
Group=root
+ExecStartPre=-/usr/bin/mkdir -p /var/log/groonga/httpd
ExecStart=/usr/sbin/groonga-httpd
ExecStop=/usr/sbin/groonga-httpd -s stop
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp
index f9fb2c70660..89e45c35942 100644
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp
+++ b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp
@@ -6,4 +6,3 @@ QUERY_LOG_PATH=/var/log/groonga/query-gqtp.log
PROTOCOL=gqtp
PORT=10043
GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
-#GRN_JA_SKIP_SAME_VALUE_PUT=yes
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http
index 0b917b4732b..7141818a331 100644
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http
+++ b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http
@@ -6,4 +6,3 @@ QUERY_LOG_PATH=/var/log/groonga/query-http.log
PROTOCOL=http
PORT=10041
GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
-#GRN_JA_SKIP_SAME_VALUE_PUT=yes
diff --git a/storage/mroonga/vendor/groonga/include/groonga.h b/storage/mroonga/vendor/groonga/include/groonga.h
index 7ac7f8704a7..d1cf1e24a56 100644
--- a/storage/mroonga/vendor/groonga/include/groonga.h
+++ b/storage/mroonga/vendor/groonga/include/groonga.h
@@ -116,6 +116,7 @@ typedef enum {
GRN_CAS_ERROR = -70,
GRN_UNSUPPORTED_COMMAND_VERSION = -71,
GRN_NORMALIZER_ERROR = -72,
+ GRN_TOKEN_FILTER_ERROR = -73,
} grn_rc;
GRN_API grn_rc grn_init(void);
@@ -478,7 +479,8 @@ typedef enum {
GRN_PROC_COMMAND,
GRN_PROC_FUNCTION,
GRN_PROC_HOOK,
- GRN_PROC_NORMALIZER
+ GRN_PROC_NORMALIZER,
+ GRN_PROC_TOKEN_FILTER
} grn_proc_type;
GRN_API grn_obj *grn_proc_create(grn_ctx *ctx,
@@ -790,7 +792,8 @@ typedef enum {
GRN_INFO_II_SPLIT_THRESHOLD,
GRN_INFO_SUPPORT_ZLIB,
GRN_INFO_SUPPORT_LZO,
- GRN_INFO_NORMALIZER
+ GRN_INFO_NORMALIZER,
+ GRN_INFO_TOKEN_FILTERS
} grn_info_type;
GRN_API grn_obj *grn_obj_get_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valuebuf);
@@ -1692,6 +1695,8 @@ GRN_API grn_obj *grn_expr_append_const_int(grn_ctx *ctx, grn_obj *expr, int i,
grn_operator op, int nargs);
GRN_API grn_rc grn_expr_append_op(grn_ctx *ctx, grn_obj *expr, grn_operator op, int nargs);
+GRN_API grn_rc grn_expr_get_keywords(grn_ctx *ctx, grn_obj *expr, grn_obj *keywords);
+
GRN_API grn_rc grn_expr_syntax_escape(grn_ctx *ctx,
const char *query, int query_size,
const char *target_characters,
diff --git a/storage/mroonga/vendor/groonga/include/groonga/Makefile.am b/storage/mroonga/vendor/groonga/include/groonga/Makefile.am
index baf9ca5bd1b..5cfb61937fb 100644
--- a/storage/mroonga/vendor/groonga/include/groonga/Makefile.am
+++ b/storage/mroonga/vendor/groonga/include/groonga/Makefile.am
@@ -2,5 +2,6 @@ groonga_includedir = $(pkgincludedir)/groonga
groonga_include_HEADERS = \
plugin.h \
tokenizer.h \
+ token_filter.h \
nfkc.h \
normalizer.h
diff --git a/storage/mroonga/vendor/groonga/include/groonga/token_filter.h b/storage/mroonga/vendor/groonga/include/groonga/token_filter.h
new file mode 100644
index 00000000000..2ae553b8630
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/include/groonga/token_filter.h
@@ -0,0 +1,71 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2014 Brazil
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+#ifndef GRN_PLUGIN_TOKEN_FILTER_H
+#define GRN_PLUGIN_TOKEN_FILTER_H
+
+#include <stddef.h>
+
+#include <groonga/tokenizer.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef void *grn_token_filter_init_func(grn_ctx *ctx,
+ grn_obj *table,
+ grn_token_mode mode);
+
+typedef void grn_token_filter_filter_func(grn_ctx *ctx,
+ grn_token *current_token,
+ grn_token *next_token,
+ void *user_data);
+
+typedef void grn_token_filter_fin_func(grn_ctx *ctx,
+ void *user_data);
+
+
+/*
+ grn_token_filter_register() registers a plugin to the database which is
+ associated with `ctx'. `plugin_name_ptr' and `plugin_name_length' specify the
+ plugin name. Alphabetic letters ('A'-'Z' and 'a'-'z'), digits ('0'-'9') and
+ an underscore ('_') are capable characters.
+
+ `init', `filter' and `fin' specify the plugin functions.
+
+ `init' is called for initializing a token_filter for a document or
+ query.
+
+ `filter' is called for filtering tokens one by one.
+
+ `fin' is called for finalizing a token_filter.
+
+ grn_token_filter_register() returns GRN_SUCCESS on success, an error
+ code on failure.
+ */
+GRN_PLUGIN_EXPORT grn_rc grn_token_filter_register(grn_ctx *ctx,
+ const char *plugin_name_ptr,
+ int plugin_name_length,
+ grn_token_filter_init_func *init,
+ grn_token_filter_filter_func *filter,
+ grn_token_filter_fin_func *fin);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* GRN_PLUGIN_TOKEN_FILTER_H */
diff --git a/storage/mroonga/vendor/groonga/include/groonga/tokenizer.h b/storage/mroonga/vendor/groonga/include/groonga/tokenizer.h
index c2e05d6e0a2..9792e018b31 100644
--- a/storage/mroonga/vendor/groonga/include/groonga/tokenizer.h
+++ b/storage/mroonga/vendor/groonga/include/groonga/tokenizer.h
@@ -30,6 +30,23 @@ extern "C" {
#define GRN_TOKENIZER_TOKENIZED_DELIMITER_UTF8_LEN 3
/*
+ grn_token_mode describes propose for tokenization.
+
+ `GRN_TOKEN_GET`: Tokenization for search.
+
+ `GRN_TOKEN_ADD`: Tokenization for adding token to index.
+
+ `GRN_TOKEN_DEL`: Tokenization for deleting token from index.
+
+ @since 4.0.7
+ */
+typedef enum {
+ GRN_TOKEN_GET = 0,
+ GRN_TOKEN_ADD,
+ GRN_TOKEN_DEL
+} grn_token_mode;
+
+/*
grn_tokenizer_charlen() returns the length (#bytes) of the first character
in the string specified by `str_ptr' and `str_length'. If the starting bytes
are invalid as a character, grn_tokenizer_charlen() returns 0. See
@@ -84,7 +101,7 @@ struct _grn_tokenizer_query {
grn_encoding encoding;
unsigned int flags;
grn_bool have_tokenized_delimiter;
- unsigned int token_mode;
+ grn_token_mode token_mode;
};
/*
@@ -176,6 +193,21 @@ typedef unsigned int grn_tokenizer_status;
#define GRN_TOKENIZER_CONTINUE GRN_TOKENIZER_TOKEN_CONTINUE
#define GRN_TOKENIZER_LAST GRN_TOKENIZER_TOKEN_LAST
+typedef struct _grn_token grn_token;
+
+GRN_PLUGIN_EXPORT grn_obj *grn_token_get_data(grn_ctx *ctx,
+ grn_token *token);
+GRN_PLUGIN_EXPORT grn_rc grn_token_set_data(grn_ctx *ctx,
+ grn_token *token,
+ const char *str_ptr,
+ int str_length);
+GRN_PLUGIN_EXPORT grn_tokenizer_status grn_token_get_status(grn_ctx *ctx,
+ grn_token *token);
+GRN_PLUGIN_EXPORT grn_rc grn_token_set_status(grn_ctx *ctx,
+ grn_token *token,
+ grn_tokenizer_status status);
+
+
/*
grn_tokenizer_token_push() pushes the next token into `token'. Note that
grn_tokenizer_token_push() does not make a copy of the given string. This
diff --git a/storage/mroonga/vendor/groonga/lib/CMakeLists.txt b/storage/mroonga/vendor/groonga/lib/CMakeLists.txt
index 5be82fa6620..d19c88e4311 100644
--- a/storage/mroonga/vendor/groonga/lib/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/lib/CMakeLists.txt
@@ -50,7 +50,6 @@ else()
${MRUBY_LIBS})
endif()
set_target_properties(libgroonga PROPERTIES OUTPUT_NAME "groonga")
-
if(NOT MRN_GROONGA_BUNDLED)
target_link_libraries(libgroonga
${EXECINFO_LIBS}
diff --git a/storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c b/storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c
index 657e95ae4ce..21531e4a837 100644
--- a/storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c
+++ b/storage/mroonga/vendor/groonga/lib/ctx_impl_mrb.c
@@ -20,6 +20,7 @@
#include "ctx_impl.h"
#include "mrb.h"
+#include "mrb/mrb_error.h"
#include "mrb/mrb_id.h"
#include "mrb/mrb_operator.h"
#include "mrb/mrb_ctx.h"
@@ -46,6 +47,7 @@ grn_ctx_impl_mrb_init_bindings(grn_ctx *ctx)
grn_mrb_load(ctx, "backtrace_entry.rb");
+ grn_mrb_error_init(ctx);
grn_mrb_id_init(ctx);
grn_mrb_operator_init(ctx);
grn_mrb_ctx_init(ctx);
diff --git a/storage/mroonga/vendor/groonga/lib/dat.cpp b/storage/mroonga/vendor/groonga/lib/dat.cpp
index 2d335e1f2f1..8588857cd5d 100644
--- a/storage/mroonga/vendor/groonga/lib/dat.cpp
+++ b/storage/mroonga/vendor/groonga/lib/dat.cpp
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2011-2012 Brazil
+/* Copyright(C) 2011-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -112,6 +112,8 @@ grn_dat_init(grn_ctx *, grn_dat *dat)
dat->trie = NULL;
dat->old_trie = NULL;
dat->tokenizer = NULL;
+ dat->normalizer = NULL;
+ GRN_PTR_INIT(&(dat->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
CRITICAL_SECTION_INIT(dat->lock);
}
@@ -127,6 +129,7 @@ grn_dat_fin(grn_ctx *ctx, grn_dat *dat)
grn_io_close(ctx, dat->io);
dat->io = NULL;
}
+ GRN_OBJ_FIN(ctx, &(dat->token_filters));
}
/*
@@ -312,6 +315,7 @@ grn_dat_create(grn_ctx *ctx, const char *path, uint32_t,
}
dat->encoding = encoding;
dat->tokenizer = NULL;
+ GRN_PTR_INIT(&(dat->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
dat->obj.header.flags = dat->header->flags;
@@ -354,6 +358,7 @@ grn_dat_open(grn_ctx *ctx, const char *path)
} else {
dat->normalizer = grn_ctx_at(ctx, dat->header->normalizer);
}
+ GRN_PTR_INIT(&(dat->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
dat->obj.header.flags = dat->header->flags;
return dat;
}
@@ -696,7 +701,7 @@ grn_dat_scan(grn_ctx *ctx, grn_dat *dat, const char *str,
dat->normalizer,
flags);
if (!normalized_string) {
- fprintf(stderr, "error: grn_string_open() failed!\n");
+ *str_rest = str;
return -1;
}
grn_string_get_normalized(ctx, normalized_string, &str, &str_size, NULL);
diff --git a/storage/mroonga/vendor/groonga/lib/dat.h b/storage/mroonga/vendor/groonga/lib/dat.h
index 00c71df4c3b..d0c44b7035d 100644
--- a/storage/mroonga/vendor/groonga/lib/dat.h
+++ b/storage/mroonga/vendor/groonga/lib/dat.h
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2011 Brazil
+/* Copyright(C) 2011-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@ struct _grn_dat {
void *old_trie;
grn_obj *tokenizer;
grn_obj *normalizer;
+ grn_obj token_filters;
grn_critical_section lock;
};
diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c
index 28ec256c036..f948dc7353a 100644
--- a/storage/mroonga/vendor/groonga/lib/db.c
+++ b/storage/mroonga/vendor/groonga/lib/db.c
@@ -301,12 +301,20 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
grn_bool ctx_used_db;
if (!s) { return GRN_INVALID_ARGUMENT; }
GRN_API_ENTER;
+
ctx_used_db = ctx->impl && ctx->impl->db == db;
if (ctx_used_db) {
grn_ctx_loader_clear(ctx);
if (ctx->impl->parser) {
grn_expr_parser_close(ctx);
}
+ }
+
+ GRN_TINY_ARRAY_EACH(&s->values, 1, grn_db_curr_id(ctx, db), id, vp, {
+ if (vp->ptr) { grn_obj_close(ctx, vp->ptr); }
+ });
+
+ if (ctx_used_db) {
if (ctx->impl->values) {
grn_db_obj *o;
GRN_ARRAY_EACH(ctx, ctx->impl->values, 0, 0, id, &o, {
@@ -315,9 +323,7 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
grn_array_truncate(ctx, ctx->impl->values);
}
}
- GRN_TINY_ARRAY_EACH(&s->values, 1, grn_db_curr_id(ctx, db), id, vp, {
- if (vp->ptr) { grn_obj_close(ctx, vp->ptr); }
- });
+
/* grn_tiny_array_fin should be refined.. */
#ifdef WIN32
{
@@ -326,6 +332,7 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
}
#endif
grn_tiny_array_fin(&s->values);
+
switch (s->keys->header.type) {
case GRN_TABLE_PAT_KEY :
grn_pat_close(ctx, (grn_pat *)s->keys);
@@ -337,6 +344,7 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
CRITICAL_SECTION_FIN(s->lock);
if (s->specs) { grn_ja_close(ctx, s->specs); }
GRN_FREE(s);
+
if (ctx_used_db) {
grn_cache *cache;
cache = grn_cache_current_get(ctx);
@@ -345,6 +353,7 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
}
ctx->impl->db = NULL;
}
+
GRN_API_RETURN(GRN_SUCCESS);
}
@@ -1472,11 +1481,11 @@ call_delete_hook(grn_ctx *ctx, grn_obj *table, grn_id rid, const void *key, unsi
GRN_TEXT_SET_REF(&oldvalue_, key, key_size);
GRN_UINT32_SET(ctx, &id_, rid);
GRN_UINT32_SET(ctx, &flags_, GRN_OBJ_SET);
- grn_ctx_push(ctx, &id_);
- grn_ctx_push(ctx, &oldvalue_);
- grn_ctx_push(ctx, &value_);
- grn_ctx_push(ctx, &flags_);
while (hooks) {
+ grn_ctx_push(ctx, &id_);
+ grn_ctx_push(ctx, &oldvalue_);
+ grn_ctx_push(ctx, &value_);
+ grn_ctx_push(ctx, &flags_);
pctx.caller = NULL;
pctx.currh = hooks;
if (hooks->proc) {
@@ -1845,6 +1854,7 @@ grn_table_truncate(grn_ctx *ctx, grn_obj *table)
grn_hash *cols;
grn_obj *tokenizer;
grn_obj *normalizer;
+ grn_obj token_filters;
if ((cols = grn_hash_create(ctx, NULL, sizeof(grn_id), 0,
GRN_OBJ_TABLE_HASH_KEY|GRN_HASH_TINY))) {
if (grn_table_columns(ctx, table, "", 0, (grn_obj *)cols)) {
@@ -1856,7 +1866,9 @@ grn_table_truncate(grn_ctx *ctx, grn_obj *table)
}
grn_hash_close(ctx, cols);
}
- grn_table_get_info(ctx, table, NULL, NULL, &tokenizer, &normalizer);
+ grn_table_get_info(ctx, table, NULL, NULL, &tokenizer, &normalizer, NULL);
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, GRN_ID_NIL);
+ grn_obj_get_info(ctx, table, GRN_INFO_TOKEN_FILTERS, &token_filters);
switch (table->header.type) {
case GRN_TABLE_PAT_KEY :
for (hooks = DB_OBJ(table)->hooks[GRN_HOOK_INSERT]; hooks; hooks = hooks->next) {
@@ -1891,6 +1903,8 @@ grn_table_truncate(grn_ctx *ctx, grn_obj *table)
}
grn_obj_set_info(ctx, table, GRN_INFO_DEFAULT_TOKENIZER, tokenizer);
grn_obj_set_info(ctx, table, GRN_INFO_NORMALIZER, normalizer);
+ grn_obj_set_info(ctx, table, GRN_INFO_TOKEN_FILTERS, &token_filters);
+ GRN_OBJ_FIN(ctx, &token_filters);
grn_obj_touch(ctx, table, NULL);
}
exit :
@@ -1900,7 +1914,8 @@ exit :
grn_rc
grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
grn_encoding *encoding, grn_obj **tokenizer,
- grn_obj **normalizer)
+ grn_obj **normalizer,
+ grn_obj **token_filters)
{
grn_rc rc = GRN_INVALID_ARGUMENT;
GRN_API_ENTER;
@@ -1911,6 +1926,7 @@ grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
if (encoding) { *encoding = ((grn_pat *)table)->encoding; }
if (tokenizer) { *tokenizer = ((grn_pat *)table)->tokenizer; }
if (normalizer) { *normalizer = ((grn_pat *)table)->normalizer; }
+ if (token_filters) { *token_filters = &(((grn_pat *)table)->token_filters); }
rc = GRN_SUCCESS;
break;
case GRN_TABLE_DAT_KEY :
@@ -1918,6 +1934,7 @@ grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
if (encoding) { *encoding = ((grn_dat *)table)->encoding; }
if (tokenizer) { *tokenizer = ((grn_dat *)table)->tokenizer; }
if (normalizer) { *normalizer = ((grn_dat *)table)->normalizer; }
+ if (token_filters) { *token_filters = &(((grn_dat *)table)->token_filters); }
rc = GRN_SUCCESS;
break;
case GRN_TABLE_HASH_KEY :
@@ -1925,6 +1942,7 @@ grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
if (encoding) { *encoding = ((grn_hash *)table)->encoding; }
if (tokenizer) { *tokenizer = ((grn_hash *)table)->tokenizer; }
if (normalizer) { *normalizer = ((grn_hash *)table)->normalizer; }
+ if (token_filters) { *token_filters = &(((grn_hash *)table)->token_filters); }
rc = GRN_SUCCESS;
break;
case GRN_TABLE_NO_KEY :
@@ -1932,6 +1950,7 @@ grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
if (encoding) { *encoding = GRN_ENC_NONE; }
if (tokenizer) { *tokenizer = grn_token_uvector; }
if (normalizer) { *normalizer = NULL; }
+ if (token_filters) { *token_filters = NULL; }
rc = GRN_SUCCESS;
break;
}
@@ -3515,7 +3534,6 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
grn_id domain = GRN_ID_NIL;
char fullname[GRN_TABLE_MAX_KEY_SIZE];
char buffer[PATH_MAX];
- grn_bool ja_p = GRN_FALSE;
GRN_API_ENTER;
if (!table) {
ERR(GRN_INVALID_ARGUMENT, "[column][create] table is missing");
@@ -3635,14 +3653,12 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
case GRN_OBJ_COLUMN_SCALAR :
if ((flags & GRN_OBJ_KEY_VAR_SIZE) || value_size > sizeof(int64_t)) {
res = (grn_obj *)grn_ja_create(ctx, path, value_size, flags);
- ja_p = GRN_TRUE;
} else {
res = (grn_obj *)grn_ra_create(ctx, path, value_size);
}
break;
case GRN_OBJ_COLUMN_VECTOR :
res = (grn_obj *)grn_ja_create(ctx, path, value_size * 30/*todo*/, flags);
- ja_p = GRN_TRUE;
//todo : zlib support
break;
case GRN_OBJ_COLUMN_INDEX :
@@ -3655,31 +3671,6 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
DB_OBJ(res)->range = range;
DB_OBJ(res)->header.flags = flags;
res->header.flags = flags;
- if (ja_p) {
- grn_bool zlib_p = GRN_FALSE;
- grn_bool lzo_p = GRN_FALSE;
-#ifdef GRN_WITH_ZLIB
- if (flags & GRN_OBJ_COMPRESS_ZLIB) {
- zlib_p = GRN_TRUE;
- }
-#endif /* GRN_WITH_ZLIB */
-#ifdef GRN_WITH_LZO
- if (flags & GRN_OBJ_COMPRESS_LZO) {
- lzo_p = GRN_TRUE;
- }
-#endif /* GRN_WITH_LZO */
- if (zlib_p || lzo_p) {
- int table_name_len;
- char table_name[GRN_TABLE_MAX_KEY_SIZE];
- table_name_len = grn_obj_name(ctx, table, table_name,
- GRN_TABLE_MAX_KEY_SIZE);
- GRN_LOG(ctx, GRN_LOG_WARNING,
- "[column][create] "
- "%s compressed column will leaks memories: <%.*s>.<%.*s>",
- zlib_p ? "zlib" : "lzo",
- table_name_len, table_name, name_size, name);
- }
- }
if (grn_db_obj_init(ctx, db, id, DB_OBJ(res))) {
_grn_obj_remove(ctx, res);
res = NULL;
@@ -5676,15 +5667,15 @@ grn_obj_set_value_column_var_size_vector(grn_ctx *ctx, grn_obj *obj, grn_id id,
case GRN_BULK :
{
unsigned int token_flags = 0;
- grn_token *token;
+ grn_token_cursor *token_cursor;
if (v && s &&
- (token = grn_token_open(ctx, lexicon, v, s,
- GRN_TOKEN_ADD, token_flags))) {
- while (!token->status) {
- grn_id tid = grn_token_next(ctx, token);
+ (token_cursor = grn_token_cursor_open(ctx, lexicon, v, s,
+ GRN_TOKEN_ADD, token_flags))) {
+ while (token_cursor->status == GRN_TOKEN_DOING) {
+ grn_id tid = grn_token_cursor_next(ctx, token_cursor);
grn_uvector_add_element(ctx, &uvector, tid, 0);
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
rc = grn_ja_put(ctx, (grn_ja *)obj, id,
GRN_BULK_HEAD(&uvector), GRN_BULK_VSIZE(&uvector),
@@ -6289,6 +6280,42 @@ grn_obj_get_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valueb
break;
}
break;
+ case GRN_INFO_TOKEN_FILTERS :
+ if (!valuebuf) {
+ if (!(valuebuf = grn_obj_open(ctx, GRN_PVECTOR, 0, 0))) {
+ ERR(GRN_NO_MEMORY_AVAILABLE,
+ "grn_obj_get_info: failed to allocate value buffer");
+ goto exit;
+ }
+ }
+ {
+ grn_obj *token_filters = NULL;
+ switch (obj->header.type) {
+ case GRN_TABLE_HASH_KEY :
+ token_filters = &(((grn_hash *)obj)->token_filters);
+ break;
+ case GRN_TABLE_PAT_KEY :
+ token_filters = &(((grn_pat *)obj)->token_filters);
+ break;
+ case GRN_TABLE_DAT_KEY :
+ token_filters = &(((grn_dat *)obj)->token_filters);
+ break;
+ default :
+ ERR(GRN_INVALID_ARGUMENT,
+ /* TODO: Show type name instead of type ID */
+ "[info][get][token-filters] target object must be one of "
+ "GRN_TABLE_HASH_KEY, GRN_TABLE_PAT_KEY and GRN_TABLE_DAT_KEY: %d",
+ obj->header.type);
+ break;
+ }
+ if (token_filters) {
+ grn_bulk_write(ctx,
+ valuebuf,
+ GRN_BULK_HEAD(token_filters),
+ GRN_BULK_VSIZE(token_filters));
+ }
+ }
+ break;
default :
/* todo */
break;
@@ -6311,7 +6338,7 @@ build_index(grn_ctx *ctx, grn_obj *obj)
grn_obj_flags flags;
grn_ii *ii = (grn_ii *)obj;
grn_bool use_grn_ii_build;
- grn_table_get_info(ctx, ii->lexicon, &flags, NULL, NULL, NULL);
+ grn_table_get_info(ctx, ii->lexicon, &flags, NULL, NULL, NULL, NULL);
switch (flags & GRN_OBJ_TABLE_TYPE_MASK) {
case GRN_OBJ_TABLE_PAT_KEY :
case GRN_OBJ_TABLE_DAT_KEY :
@@ -6519,6 +6546,23 @@ grn_hook_unpack(grn_ctx *ctx, grn_db_obj *obj, const char *buf, uint32_t buf_siz
return GRN_SUCCESS;
}
+static void
+grn_token_filters_pack(grn_ctx *ctx,
+ grn_obj *token_filters,
+ grn_obj *buffer)
+{
+ unsigned int i, n_token_filters;
+
+ n_token_filters = GRN_BULK_VSIZE(token_filters) / sizeof(grn_obj *);
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter = GRN_PTR_VALUE_AT(token_filters, i);
+ grn_id token_filter_id;
+
+ token_filter_id = grn_obj_id(ctx, token_filter);
+ GRN_RECORD_PUT(ctx, buffer, token_filter_id);
+ }
+}
+
void
grn_obj_spec_save(grn_ctx *ctx, grn_db_obj *obj)
{
@@ -6543,6 +6587,18 @@ grn_obj_spec_save(grn_ctx *ctx, grn_db_obj *obj)
grn_hook_pack(ctx, obj, b);
grn_vector_delimit(ctx, &v, 0, 0);
switch (obj->header.type) {
+ case GRN_TABLE_HASH_KEY :
+ grn_token_filters_pack(ctx, &(((grn_hash *)obj)->token_filters), b);
+ grn_vector_delimit(ctx, &v, 0, 0);
+ break;
+ case GRN_TABLE_PAT_KEY :
+ grn_token_filters_pack(ctx, &(((grn_pat *)obj)->token_filters), b);
+ grn_vector_delimit(ctx, &v, 0, 0);
+ break;
+ case GRN_TABLE_DAT_KEY :
+ grn_token_filters_pack(ctx, &(((grn_dat *)obj)->token_filters), b);
+ grn_vector_delimit(ctx, &v, 0, 0);
+ break;
case GRN_EXPR :
grn_expr_pack(ctx, b, (grn_obj *)obj);
grn_vector_delimit(ctx, &v, 0, 0);
@@ -6748,6 +6804,62 @@ grn_obj_set_info_source(grn_ctx *ctx, grn_obj *obj, grn_obj *value)
return rc;
}
+static grn_rc
+grn_obj_set_info_token_filters(grn_ctx *ctx,
+ grn_obj *table,
+ grn_obj *token_filters)
+{
+ grn_obj *current_token_filters;
+ unsigned int i, n_token_filters;
+ grn_obj token_filter_names;
+
+ switch (table->header.type) {
+ case GRN_TABLE_HASH_KEY :
+ current_token_filters = &(((grn_hash *)table)->token_filters);
+ break;
+ case GRN_TABLE_PAT_KEY :
+ current_token_filters = &(((grn_pat *)table)->token_filters);
+ break;
+ case GRN_TABLE_DAT_KEY :
+ current_token_filters = &(((grn_dat *)table)->token_filters);
+ break;
+ default :
+ /* TODO: Show type name instead of type ID */
+ ERR(GRN_INVALID_ARGUMENT,
+ "[info][set][token-filters] target object must be one of "
+ "GRN_TABLE_HASH_KEY, GRN_TABLE_PAT_KEY and GRN_TABLE_DAT_KEY: %d",
+ table->header.type);
+ return ctx->rc;
+ }
+
+ GRN_TEXT_INIT(&token_filter_names, 0);
+ GRN_BULK_REWIND(current_token_filters);
+ n_token_filters = GRN_BULK_VSIZE(token_filters) / sizeof(grn_obj *);
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter = GRN_PTR_VALUE_AT(token_filters, i);
+ char token_filter_name[GRN_TABLE_MAX_KEY_SIZE];
+ unsigned int token_filter_name_size;
+
+ GRN_PTR_PUT(ctx, current_token_filters, token_filter);
+
+ token_filter_name_size = grn_obj_name(ctx,
+ token_filter,
+ token_filter_name,
+ GRN_TABLE_MAX_KEY_SIZE);
+ GRN_TEXT_PUT(ctx,
+ &token_filter_names,
+ token_filter_name,
+ token_filter_name_size);
+ }
+ GRN_LOG(ctx, GRN_LOG_NOTICE, "DDL:set_token_filters %.*s",
+ (int)GRN_BULK_VSIZE(&token_filter_names),
+ GRN_BULK_HEAD(&token_filter_names));
+ GRN_OBJ_FIN(ctx, &token_filter_names);
+ grn_obj_spec_save(ctx, DB_OBJ(table));
+
+ return GRN_SUCCESS;
+}
+
grn_rc
grn_obj_set_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *value)
{
@@ -6807,6 +6919,9 @@ grn_obj_set_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *value)
}
}
break;
+ case GRN_INFO_TOKEN_FILTERS :
+ rc = grn_obj_set_info_token_filters(ctx, obj, value);
+ break;
default :
/* todo */
break;
@@ -7702,10 +7817,22 @@ grn_db_obj_init(grn_ctx *ctx, grn_obj *db, grn_id id, grn_db_obj *obj)
return rc;
}
+#define SERIALIZED_SPEC_INDEX_SPEC 0
+#define SERIALIZED_SPEC_INDEX_PATH 1
+#define SERIALIZED_SPEC_INDEX_SOURCE 2
+#define SERIALIZED_SPEC_INDEX_HOOK 3
+#define SERIALIZED_SPEC_INDEX_TOKEN_FILTERS 4
+#define SERIALIZED_SPEC_INDEX_EXPR 4
+
#define GET_PATH(spec,buffer,s,id) do {\
if (spec->header.flags & GRN_OBJ_CUSTOM_NAME) {\
const char *path;\
- unsigned int size = grn_vector_get_element(ctx, &v, 1, &path, NULL, NULL); \
+ unsigned int size = grn_vector_get_element(ctx,\
+ &v,\
+ SERIALIZED_SPEC_INDEX_PATH,\
+ &path,\
+ NULL,\
+ NULL);\
if (size > PATH_MAX) { ERR(GRN_FILENAME_TOO_LONG, "too long path"); }\
memcpy(buffer, path, size);\
buffer[size] = '\0';\
@@ -7721,18 +7848,62 @@ grn_db_obj_init(grn_ctx *ctx, grn_obj *db, grn_id id, grn_db_obj *obj)
r->id = id;\
r->range = spec->range;\
r->db = (grn_obj *)s;\
- size = grn_vector_get_element(ctx, &v, 2, &p, NULL, NULL);\
+ size = grn_vector_get_element(ctx,\
+ &v,\
+ SERIALIZED_SPEC_INDEX_SOURCE,\
+ &p,\
+ NULL,\
+ NULL);\
if (size) {\
if ((r->source = GRN_MALLOC(size))) {\
memcpy(r->source, p, size);\
r->source_size = size;\
}\
}\
- size = grn_vector_get_element(ctx, &v, 3, &p, NULL, NULL);\
+ size = grn_vector_get_element(ctx,\
+ &v,\
+ SERIALIZED_SPEC_INDEX_HOOK,\
+ &p,\
+ NULL,\
+ NULL);\
grn_hook_unpack(ctx, r, p, size);\
}\
} while (0)
+static void
+grn_token_filters_unpack(grn_ctx *ctx,
+ grn_obj *token_filters,
+ grn_obj *spec_vector)
+{
+ grn_id *token_filter_ids;
+ unsigned int element_size;
+ unsigned int i, n_token_filter_ids;
+
+ if (grn_vector_size(ctx, spec_vector) < SERIALIZED_SPEC_INDEX_TOKEN_FILTERS) {
+ return;
+ }
+
+ element_size = grn_vector_get_element(ctx,
+ spec_vector,
+ SERIALIZED_SPEC_INDEX_TOKEN_FILTERS,
+ (const char **)(&token_filter_ids),
+ NULL,
+ NULL);
+ n_token_filter_ids = element_size / sizeof(grn_id);
+ for (i = 0; i < n_token_filter_ids; i++) {
+ grn_id token_filter_id = token_filter_ids[i];
+ grn_obj *token_filter;
+
+ token_filter = grn_ctx_at(ctx, token_filter_id);
+ if (!token_filter) {
+ ERR(GRN_INVALID_ARGUMENT,
+ "nonexistent token filter ID: %d", token_filter_id);
+ return;
+ }
+ GRN_PTR_PUT(ctx, token_filters, token_filter);
+ }
+}
+
grn_obj *
grn_ctx_at(grn_ctx *ctx, grn_id id)
{
@@ -7792,7 +7963,12 @@ grn_ctx_at(grn_ctx *ctx, grn_id id)
uint32_t size;
grn_obj_spec *spec;
char buffer[PATH_MAX];
- size = grn_vector_get_element(ctx, &v, 0, (const char **)&spec, NULL, NULL);
+ size = grn_vector_get_element(ctx,
+ &v,
+ SERIALIZED_SPEC_INDEX_SPEC,
+ (const char **)&spec,
+ NULL,
+ NULL);
if (size) {
switch (spec->header.type) {
case GRN_TYPE :
@@ -7803,27 +7979,33 @@ grn_ctx_at(grn_ctx *ctx, grn_id id)
GET_PATH(spec, buffer, s, id);
vp->ptr = (grn_obj *)grn_hash_open(ctx, buffer);
if (vp->ptr) {
+ grn_hash *hash = (grn_hash *)(vp->ptr);
grn_obj_flags flags = vp->ptr->header.flags;
UNPACK_INFO();
vp->ptr->header.flags = flags;
+ grn_token_filters_unpack(ctx, &(hash->token_filters), &v);
}
break;
case GRN_TABLE_PAT_KEY :
GET_PATH(spec, buffer, s, id);
vp->ptr = (grn_obj *)grn_pat_open(ctx, buffer);
if (vp->ptr) {
+ grn_pat *pat = (grn_pat *)(vp->ptr);
grn_obj_flags flags = vp->ptr->header.flags;
UNPACK_INFO();
vp->ptr->header.flags = flags;
+ grn_token_filters_unpack(ctx, &(pat->token_filters), &v);
}
break;
case GRN_TABLE_DAT_KEY :
GET_PATH(spec, buffer, s, id);
vp->ptr = (grn_obj *)grn_dat_open(ctx, buffer);
if (vp->ptr) {
+ grn_dat *dat = (grn_dat *)(vp->ptr);
grn_obj_flags flags = vp->ptr->header.flags;
UNPACK_INFO();
vp->ptr->header.flags = flags;
+ grn_token_filters_unpack(ctx, &(dat->token_filters), &v);
}
break;
case GRN_TABLE_NO_KEY :
@@ -7856,7 +8038,12 @@ grn_ctx_at(grn_ctx *ctx, grn_id id)
case GRN_EXPR :
{
uint8_t *u;
- size = grn_vector_get_element(ctx, &v, 4, &p, NULL, NULL);
+ size = grn_vector_get_element(ctx,
+ &v,
+ SERIALIZED_SPEC_INDEX_EXPR,
+ &p,
+ NULL,
+ NULL);
u = (uint8_t *)p;
vp->ptr = grn_expr_open(ctx, spec, u, u + size);
}
@@ -9050,7 +9237,7 @@ grn_column_index_column_equal(grn_ctx *ctx, grn_obj *obj, grn_operator op,
if (obj->header.type != GRN_COLUMN_FIX_SIZE) {
grn_obj *tokenizer, *lexicon = grn_ctx_at(ctx, target->header.domain);
if (!lexicon) { continue; }
- grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL);
+ grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL, NULL);
if (tokenizer) { continue; }
}
if (n < buf_size) {
@@ -9115,7 +9302,7 @@ grn_column_index_column_range(grn_ctx *ctx, grn_obj *obj, grn_operator op,
if (!lexicon) { continue; }
if (lexicon->header.type != GRN_TABLE_PAT_KEY) { continue; }
/* FIXME: GRN_TABLE_DAT_KEY should be supported */
- grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL);
+ grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL, NULL);
if (tokenizer) { continue; }
}
if (n < buf_size) {
@@ -9147,7 +9334,7 @@ is_valid_range_index(grn_ctx *ctx, grn_obj *index_column)
return GRN_FALSE;
}
- grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL);
+ grn_table_get_info(ctx, lexicon, NULL, NULL, &tokenizer, NULL, NULL);
grn_obj_unlink(ctx, lexicon);
if (tokenizer) { return GRN_FALSE; }
@@ -9644,10 +9831,10 @@ grn_table_tokenize(grn_ctx *ctx, grn_obj *table,
const char *str, unsigned int str_len,
grn_obj *buf, grn_bool addp)
{
- grn_token *token = NULL;
+ grn_token_cursor *token_cursor = NULL;
grn_token_mode mode = addp ? GRN_TOKEN_ADD : GRN_TOKEN_GET;
GRN_API_ENTER;
- if (!(token = grn_token_open(ctx, table, str, str_len, mode, 0))) {
+ if (!(token_cursor = grn_token_cursor_open(ctx, table, str, str_len, mode, 0))) {
goto exit;
}
if (buf) {
@@ -9657,15 +9844,15 @@ grn_table_tokenize(grn_ctx *ctx, grn_obj *table,
goto exit;
}
}
- while (token->status != GRN_TOKEN_DONE) {
+ while (token_cursor->status != GRN_TOKEN_DONE && token_cursor->status != GRN_TOKEN_DONE_SKIP) {
grn_id tid;
- if ((tid = grn_token_next(ctx, token))) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
GRN_RECORD_PUT(ctx, buf, tid);
}
}
exit :
- if (token) {
- grn_token_close(ctx, token);
+ if (token_cursor) {
+ grn_token_cursor_close(ctx, token_cursor);
}
GRN_API_RETURN(buf);
}
diff --git a/storage/mroonga/vendor/groonga/lib/db.h b/storage/mroonga/vendor/groonga/lib/db.h
index d48a625ef44..f2f95560b08 100644
--- a/storage/mroonga/vendor/groonga/lib/db.h
+++ b/storage/mroonga/vendor/groonga/lib/db.h
@@ -29,6 +29,8 @@
#include "store.h"
#endif /* GRN_STORE_H */
+#include <groonga/token_filter.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -96,7 +98,8 @@ grn_id grn_table_add_v(grn_ctx *ctx, grn_obj *table, const void *key, int key_si
void **value, int *added);
GRN_API grn_rc grn_table_get_info(grn_ctx *ctx, grn_obj *table, grn_obj_flags *flags,
grn_encoding *encoding, grn_obj **tokenizer,
- grn_obj **normalizer);
+ grn_obj **normalizer,
+ grn_obj **token_filters);
const char *_grn_table_key(grn_ctx *ctx, grn_obj *table, grn_id id, uint32_t *key_size);
grn_rc grn_table_search(grn_ctx *ctx, grn_obj *table,
@@ -184,6 +187,16 @@ struct _grn_proc {
grn_selector_func *selector;
+ union {
+ struct {
+ grn_token_filter_init_func *init;
+ grn_token_filter_filter_func *filter;
+ grn_token_filter_fin_func *fin;
+ } token_filter;
+ } callbacks;
+
+ void *user_data;
+
grn_id module;
// uint32_t nargs;
// uint32_t nresults;
diff --git a/storage/mroonga/vendor/groonga/lib/ecmascript.c b/storage/mroonga/vendor/groonga/lib/ecmascript.c
index fd74f95b815..e973f1281a4 100644
--- a/storage/mroonga/vendor/groonga/lib/ecmascript.c
+++ b/storage/mroonga/vendor/groonga/lib/ecmascript.c
@@ -4,7 +4,7 @@
/* First off, code is included that follows the "include" declaration
** in the input grammar file. */
#include <stdio.h>
-#line 3 "ecmascript.lemon"
+#line 4 "ecmascript.lemon"
#define assert GRN_ASSERT
#line 11 "ecmascript.c"
@@ -867,7 +867,7 @@ static void yy_destructor(
*/
case 74: /* suppress_unused_variable_warning */
{
-#line 10 "ecmascript.lemon"
+#line 11 "ecmascript.lemon"
(void)efsi;
@@ -1295,7 +1295,7 @@ static void yy_reduce(
** break;
*/
case 5: /* query ::= query query_element */
-#line 45 "ecmascript.lemon"
+#line 46 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, grn_int32_value_at(&efsi->op_stack, -1), 2);
}
@@ -1303,7 +1303,7 @@ static void yy_reduce(
break;
case 6: /* query ::= query LOGICAL_AND query_element */
case 35: /* logical_and_expression ::= logical_and_expression LOGICAL_AND bitwise_or_expression */ yytestcase(yyruleno==35);
-#line 48 "ecmascript.lemon"
+#line 49 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND, 2);
}
@@ -1311,7 +1311,7 @@ static void yy_reduce(
break;
case 7: /* query ::= query LOGICAL_AND_NOT query_element */
case 36: /* logical_and_expression ::= logical_and_expression LOGICAL_AND_NOT bitwise_or_expression */ yytestcase(yyruleno==36);
-#line 51 "ecmascript.lemon"
+#line 52 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND_NOT, 2);
}
@@ -1319,14 +1319,14 @@ static void yy_reduce(
break;
case 8: /* query ::= query LOGICAL_OR query_element */
case 33: /* logical_or_expression ::= logical_or_expression LOGICAL_OR logical_and_expression */ yytestcase(yyruleno==33);
-#line 54 "ecmascript.lemon"
+#line 55 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_OR, 2);
}
#line 1327 "ecmascript.c"
break;
case 11: /* query_element ::= RELATIVE_OP query_element */
-#line 61 "ecmascript.lemon"
+#line 62 "ecmascript.lemon"
{
int mode;
GRN_INT32_POP(&efsi->mode_stack, mode);
@@ -1334,7 +1334,7 @@ static void yy_reduce(
#line 1335 "ecmascript.c"
break;
case 12: /* query_element ::= IDENTIFIER RELATIVE_OP query_element */
-#line 65 "ecmascript.lemon"
+#line 66 "ecmascript.lemon"
{
int mode;
grn_obj *c;
@@ -1348,314 +1348,320 @@ static void yy_reduce(
GRN_INT32_POP(&efsi->max_interval_stack, max_interval);
}
break;
+ case GRN_OP_SIMILAR :
+ {
+ int similarity_threshold;
+ GRN_INT32_POP(&efsi->similarity_threshold_stack, similarity_threshold);
+ }
+ break;
default :
break;
}
}
-#line 1356 "ecmascript.c"
+#line 1362 "ecmascript.c"
break;
case 13: /* query_element ::= BRACEL expression BRACER */
case 14: /* query_element ::= EVAL primary_expression */ yytestcase(yyruleno==14);
-#line 82 "ecmascript.lemon"
+#line 89 "ecmascript.lemon"
{
efsi->flags = efsi->default_flags;
}
-#line 1364 "ecmascript.c"
+#line 1370 "ecmascript.c"
break;
case 16: /* expression ::= expression COMMA assignment_expression */
-#line 90 "ecmascript.lemon"
+#line 97 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_COMMA, 2);
}
-#line 1371 "ecmascript.c"
+#line 1377 "ecmascript.c"
break;
case 18: /* assignment_expression ::= lefthand_side_expression ASSIGN assignment_expression */
-#line 95 "ecmascript.lemon"
+#line 102 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_ASSIGN, 2);
}
-#line 1378 "ecmascript.c"
+#line 1384 "ecmascript.c"
break;
case 19: /* assignment_expression ::= lefthand_side_expression STAR_ASSIGN assignment_expression */
-#line 98 "ecmascript.lemon"
+#line 105 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_STAR_ASSIGN, 2);
}
-#line 1385 "ecmascript.c"
+#line 1391 "ecmascript.c"
break;
case 20: /* assignment_expression ::= lefthand_side_expression SLASH_ASSIGN assignment_expression */
-#line 101 "ecmascript.lemon"
+#line 108 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SLASH_ASSIGN, 2);
}
-#line 1392 "ecmascript.c"
+#line 1398 "ecmascript.c"
break;
case 21: /* assignment_expression ::= lefthand_side_expression MOD_ASSIGN assignment_expression */
-#line 104 "ecmascript.lemon"
+#line 111 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MOD_ASSIGN, 2);
}
-#line 1399 "ecmascript.c"
+#line 1405 "ecmascript.c"
break;
case 22: /* assignment_expression ::= lefthand_side_expression PLUS_ASSIGN assignment_expression */
-#line 107 "ecmascript.lemon"
+#line 114 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS_ASSIGN, 2);
}
-#line 1406 "ecmascript.c"
+#line 1412 "ecmascript.c"
break;
case 23: /* assignment_expression ::= lefthand_side_expression MINUS_ASSIGN assignment_expression */
-#line 110 "ecmascript.lemon"
+#line 117 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS_ASSIGN, 2);
}
-#line 1413 "ecmascript.c"
+#line 1419 "ecmascript.c"
break;
case 24: /* assignment_expression ::= lefthand_side_expression SHIFTL_ASSIGN assignment_expression */
-#line 113 "ecmascript.lemon"
+#line 120 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTL_ASSIGN, 2);
}
-#line 1420 "ecmascript.c"
+#line 1426 "ecmascript.c"
break;
case 25: /* assignment_expression ::= lefthand_side_expression SHIFTR_ASSIGN assignment_expression */
-#line 116 "ecmascript.lemon"
+#line 123 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTR_ASSIGN, 2);
}
-#line 1427 "ecmascript.c"
+#line 1433 "ecmascript.c"
break;
case 26: /* assignment_expression ::= lefthand_side_expression SHIFTRR_ASSIGN assignment_expression */
-#line 119 "ecmascript.lemon"
+#line 126 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTRR_ASSIGN, 2);
}
-#line 1434 "ecmascript.c"
+#line 1440 "ecmascript.c"
break;
case 27: /* assignment_expression ::= lefthand_side_expression AND_ASSIGN assignment_expression */
-#line 122 "ecmascript.lemon"
+#line 129 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND_ASSIGN, 2);
}
-#line 1441 "ecmascript.c"
+#line 1447 "ecmascript.c"
break;
case 28: /* assignment_expression ::= lefthand_side_expression XOR_ASSIGN assignment_expression */
-#line 125 "ecmascript.lemon"
+#line 132 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_XOR_ASSIGN, 2);
}
-#line 1448 "ecmascript.c"
+#line 1454 "ecmascript.c"
break;
case 29: /* assignment_expression ::= lefthand_side_expression OR_ASSIGN assignment_expression */
-#line 128 "ecmascript.lemon"
+#line 135 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_OR_ASSIGN, 2);
}
-#line 1455 "ecmascript.c"
+#line 1461 "ecmascript.c"
break;
case 31: /* conditional_expression ::= logical_or_expression QUESTION assignment_expression COLON assignment_expression */
-#line 133 "ecmascript.lemon"
+#line 140 "ecmascript.lemon"
{
grn_expr *e = (grn_expr *)efsi->e;
e->codes[yymsp[-3].minor.yy0].nargs = yymsp[-1].minor.yy0 - yymsp[-3].minor.yy0;
e->codes[yymsp[-1].minor.yy0].nargs = e->codes_curr - yymsp[-1].minor.yy0 - 1;
}
-#line 1464 "ecmascript.c"
+#line 1470 "ecmascript.c"
break;
case 38: /* bitwise_or_expression ::= bitwise_or_expression BITWISE_OR bitwise_xor_expression */
-#line 153 "ecmascript.lemon"
+#line 160 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_OR, 2);
}
-#line 1471 "ecmascript.c"
+#line 1477 "ecmascript.c"
break;
case 40: /* bitwise_xor_expression ::= bitwise_xor_expression BITWISE_XOR bitwise_and_expression */
-#line 158 "ecmascript.lemon"
+#line 165 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_XOR, 2);
}
-#line 1478 "ecmascript.c"
+#line 1484 "ecmascript.c"
break;
case 42: /* bitwise_and_expression ::= bitwise_and_expression BITWISE_AND equality_expression */
-#line 163 "ecmascript.lemon"
+#line 170 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_AND, 2);
}
-#line 1485 "ecmascript.c"
+#line 1491 "ecmascript.c"
break;
case 44: /* equality_expression ::= equality_expression EQUAL relational_expression */
-#line 168 "ecmascript.lemon"
+#line 175 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_EQUAL, 2);
}
-#line 1492 "ecmascript.c"
+#line 1498 "ecmascript.c"
break;
case 45: /* equality_expression ::= equality_expression NOT_EQUAL relational_expression */
-#line 171 "ecmascript.lemon"
+#line 178 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NOT_EQUAL, 2);
}
-#line 1499 "ecmascript.c"
+#line 1505 "ecmascript.c"
break;
case 47: /* relational_expression ::= relational_expression LESS shift_expression */
-#line 176 "ecmascript.lemon"
+#line 183 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LESS, 2);
}
-#line 1506 "ecmascript.c"
+#line 1512 "ecmascript.c"
break;
case 48: /* relational_expression ::= relational_expression GREATER shift_expression */
-#line 179 "ecmascript.lemon"
+#line 186 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GREATER, 2);
}
-#line 1513 "ecmascript.c"
+#line 1519 "ecmascript.c"
break;
case 49: /* relational_expression ::= relational_expression LESS_EQUAL shift_expression */
-#line 182 "ecmascript.lemon"
+#line 189 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LESS_EQUAL, 2);
}
-#line 1520 "ecmascript.c"
+#line 1526 "ecmascript.c"
break;
case 50: /* relational_expression ::= relational_expression GREATER_EQUAL shift_expression */
-#line 185 "ecmascript.lemon"
+#line 192 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GREATER_EQUAL, 2);
}
-#line 1527 "ecmascript.c"
+#line 1533 "ecmascript.c"
break;
case 51: /* relational_expression ::= relational_expression IN shift_expression */
-#line 188 "ecmascript.lemon"
+#line 195 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_IN, 2);
}
-#line 1534 "ecmascript.c"
+#line 1540 "ecmascript.c"
break;
case 52: /* relational_expression ::= relational_expression MATCH shift_expression */
case 130: /* adjust_match_expression ::= IDENTIFIER MATCH STRING */ yytestcase(yyruleno==130);
-#line 191 "ecmascript.lemon"
+#line 198 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MATCH, 2);
}
-#line 1542 "ecmascript.c"
+#line 1548 "ecmascript.c"
break;
case 53: /* relational_expression ::= relational_expression NEAR shift_expression */
-#line 194 "ecmascript.lemon"
+#line 201 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NEAR, 2);
}
-#line 1549 "ecmascript.c"
+#line 1555 "ecmascript.c"
break;
case 54: /* relational_expression ::= relational_expression NEAR2 shift_expression */
-#line 197 "ecmascript.lemon"
+#line 204 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NEAR2, 2);
}
-#line 1556 "ecmascript.c"
+#line 1562 "ecmascript.c"
break;
case 55: /* relational_expression ::= relational_expression SIMILAR shift_expression */
-#line 200 "ecmascript.lemon"
+#line 207 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SIMILAR, 2);
}
-#line 1563 "ecmascript.c"
+#line 1569 "ecmascript.c"
break;
case 56: /* relational_expression ::= relational_expression TERM_EXTRACT shift_expression */
-#line 203 "ecmascript.lemon"
+#line 210 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_TERM_EXTRACT, 2);
}
-#line 1570 "ecmascript.c"
+#line 1576 "ecmascript.c"
break;
case 57: /* relational_expression ::= relational_expression LCP shift_expression */
-#line 206 "ecmascript.lemon"
+#line 213 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LCP, 2);
}
-#line 1577 "ecmascript.c"
+#line 1583 "ecmascript.c"
break;
case 58: /* relational_expression ::= relational_expression PREFIX shift_expression */
-#line 209 "ecmascript.lemon"
+#line 216 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PREFIX, 2);
}
-#line 1584 "ecmascript.c"
+#line 1590 "ecmascript.c"
break;
case 59: /* relational_expression ::= relational_expression SUFFIX shift_expression */
-#line 212 "ecmascript.lemon"
+#line 219 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SUFFIX, 2);
}
-#line 1591 "ecmascript.c"
+#line 1597 "ecmascript.c"
break;
case 61: /* shift_expression ::= shift_expression SHIFTL additive_expression */
-#line 217 "ecmascript.lemon"
+#line 224 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTL, 2);
}
-#line 1598 "ecmascript.c"
+#line 1604 "ecmascript.c"
break;
case 62: /* shift_expression ::= shift_expression SHIFTR additive_expression */
-#line 220 "ecmascript.lemon"
+#line 227 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTR, 2);
}
-#line 1605 "ecmascript.c"
+#line 1611 "ecmascript.c"
break;
case 63: /* shift_expression ::= shift_expression SHIFTRR additive_expression */
-#line 223 "ecmascript.lemon"
+#line 230 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTRR, 2);
}
-#line 1612 "ecmascript.c"
+#line 1618 "ecmascript.c"
break;
case 65: /* additive_expression ::= additive_expression PLUS multiplicative_expression */
case 127: /* adjuster ::= adjuster PLUS adjust_expression */ yytestcase(yyruleno==127);
-#line 228 "ecmascript.lemon"
+#line 235 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS, 2);
}
-#line 1620 "ecmascript.c"
+#line 1626 "ecmascript.c"
break;
case 66: /* additive_expression ::= additive_expression MINUS multiplicative_expression */
-#line 231 "ecmascript.lemon"
+#line 238 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS, 2);
}
-#line 1627 "ecmascript.c"
+#line 1633 "ecmascript.c"
break;
case 68: /* multiplicative_expression ::= multiplicative_expression STAR unary_expression */
case 129: /* adjust_expression ::= adjust_match_expression STAR DECIMAL */ yytestcase(yyruleno==129);
-#line 236 "ecmascript.lemon"
+#line 243 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_STAR, 2);
}
-#line 1635 "ecmascript.c"
+#line 1641 "ecmascript.c"
break;
case 69: /* multiplicative_expression ::= multiplicative_expression SLASH unary_expression */
-#line 239 "ecmascript.lemon"
+#line 246 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SLASH, 2);
}
-#line 1642 "ecmascript.c"
+#line 1648 "ecmascript.c"
break;
case 70: /* multiplicative_expression ::= multiplicative_expression MOD unary_expression */
-#line 242 "ecmascript.lemon"
+#line 249 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MOD, 2);
}
-#line 1649 "ecmascript.c"
+#line 1655 "ecmascript.c"
break;
case 72: /* unary_expression ::= DELETE unary_expression */
-#line 247 "ecmascript.lemon"
+#line 254 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DELETE, 1);
}
-#line 1656 "ecmascript.c"
+#line 1662 "ecmascript.c"
break;
case 73: /* unary_expression ::= INCR unary_expression */
-#line 250 "ecmascript.lemon"
+#line 257 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
grn_expr *e = (grn_expr *)(efsi->e);
@@ -1673,10 +1679,10 @@ static void yy_reduce(
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_INCR, 1);
}
}
-#line 1677 "ecmascript.c"
+#line 1683 "ecmascript.c"
break;
case 74: /* unary_expression ::= DECR unary_expression */
-#line 267 "ecmascript.lemon"
+#line 274 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
grn_expr *e = (grn_expr *)(efsi->e);
@@ -1694,66 +1700,66 @@ static void yy_reduce(
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DECR, 1);
}
}
-#line 1698 "ecmascript.c"
+#line 1704 "ecmascript.c"
break;
case 75: /* unary_expression ::= PLUS unary_expression */
-#line 284 "ecmascript.lemon"
+#line 291 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS, 1);
}
-#line 1705 "ecmascript.c"
+#line 1711 "ecmascript.c"
break;
case 76: /* unary_expression ::= MINUS unary_expression */
-#line 287 "ecmascript.lemon"
+#line 294 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS, 1);
}
-#line 1712 "ecmascript.c"
+#line 1718 "ecmascript.c"
break;
case 77: /* unary_expression ::= NOT unary_expression */
-#line 290 "ecmascript.lemon"
+#line 297 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NOT, 1);
}
-#line 1719 "ecmascript.c"
+#line 1725 "ecmascript.c"
break;
case 78: /* unary_expression ::= BITWISE_NOT unary_expression */
-#line 293 "ecmascript.lemon"
+#line 300 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_NOT, 1);
}
-#line 1726 "ecmascript.c"
+#line 1732 "ecmascript.c"
break;
case 79: /* unary_expression ::= ADJUST unary_expression */
-#line 296 "ecmascript.lemon"
+#line 303 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_ADJUST, 1);
}
-#line 1733 "ecmascript.c"
+#line 1739 "ecmascript.c"
break;
case 80: /* unary_expression ::= EXACT unary_expression */
-#line 299 "ecmascript.lemon"
+#line 306 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_EXACT, 1);
}
-#line 1740 "ecmascript.c"
+#line 1746 "ecmascript.c"
break;
case 81: /* unary_expression ::= PARTIAL unary_expression */
-#line 302 "ecmascript.lemon"
+#line 309 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PARTIAL, 1);
}
-#line 1747 "ecmascript.c"
+#line 1753 "ecmascript.c"
break;
case 82: /* unary_expression ::= UNSPLIT unary_expression */
-#line 305 "ecmascript.lemon"
+#line 312 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_UNSPLIT, 1);
}
-#line 1754 "ecmascript.c"
+#line 1760 "ecmascript.c"
break;
case 84: /* postfix_expression ::= lefthand_side_expression INCR */
-#line 310 "ecmascript.lemon"
+#line 317 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
grn_expr *e = (grn_expr *)(efsi->e);
@@ -1771,10 +1777,10 @@ static void yy_reduce(
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_INCR_POST, 1);
}
}
-#line 1775 "ecmascript.c"
+#line 1781 "ecmascript.c"
break;
case 85: /* postfix_expression ::= lefthand_side_expression DECR */
-#line 327 "ecmascript.lemon"
+#line 334 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
grn_expr *e = (grn_expr *)(efsi->e);
@@ -1792,51 +1798,51 @@ static void yy_reduce(
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DECR_POST, 1);
}
}
-#line 1796 "ecmascript.c"
+#line 1802 "ecmascript.c"
break;
case 88: /* call_expression ::= member_expression arguments */
-#line 348 "ecmascript.lemon"
+#line 355 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_CALL, yymsp[0].minor.yy0);
}
-#line 1803 "ecmascript.c"
+#line 1809 "ecmascript.c"
break;
case 113: /* member_expression_part ::= BRACKETL expression BRACKETR */
-#line 384 "ecmascript.lemon"
+#line 391 "ecmascript.lemon"
{
grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GET_MEMBER, 2);
}
-#line 1810 "ecmascript.c"
+#line 1816 "ecmascript.c"
break;
case 115: /* arguments ::= PARENL argument_list PARENR */
-#line 389 "ecmascript.lemon"
+#line 396 "ecmascript.lemon"
{ yygotominor.yy0 = yymsp[-1].minor.yy0; }
-#line 1815 "ecmascript.c"
+#line 1821 "ecmascript.c"
break;
case 116: /* argument_list ::= */
-#line 390 "ecmascript.lemon"
+#line 397 "ecmascript.lemon"
{ yygotominor.yy0 = 0; }
-#line 1820 "ecmascript.c"
+#line 1826 "ecmascript.c"
break;
case 117: /* argument_list ::= assignment_expression */
-#line 391 "ecmascript.lemon"
+#line 398 "ecmascript.lemon"
{ yygotominor.yy0 = 1; }
-#line 1825 "ecmascript.c"
+#line 1831 "ecmascript.c"
break;
case 118: /* argument_list ::= argument_list COMMA assignment_expression */
-#line 392 "ecmascript.lemon"
+#line 399 "ecmascript.lemon"
{ yygotominor.yy0 = yymsp[-2].minor.yy0 + 1; }
-#line 1830 "ecmascript.c"
+#line 1836 "ecmascript.c"
break;
case 119: /* output_columns ::= */
-#line 394 "ecmascript.lemon"
+#line 401 "ecmascript.lemon"
{
yygotominor.yy0 = 0;
}
-#line 1837 "ecmascript.c"
+#line 1843 "ecmascript.c"
break;
case 120: /* output_columns ::= output_column */
-#line 397 "ecmascript.lemon"
+#line 404 "ecmascript.lemon"
{
if (yymsp[0].minor.yy0) {
yygotominor.yy0 = 0;
@@ -1844,10 +1850,10 @@ static void yy_reduce(
yygotominor.yy0 = 1;
}
}
-#line 1848 "ecmascript.c"
+#line 1854 "ecmascript.c"
break;
case 121: /* output_columns ::= output_columns COMMA output_column */
-#line 405 "ecmascript.lemon"
+#line 412 "ecmascript.lemon"
{
if (yymsp[0].minor.yy0) {
yygotominor.yy0 = yymsp[-2].minor.yy0;
@@ -1858,10 +1864,10 @@ static void yy_reduce(
yygotominor.yy0 = 1;
}
}
-#line 1862 "ecmascript.c"
+#line 1868 "ecmascript.c"
break;
case 122: /* output_column ::= STAR */
-#line 416 "ecmascript.lemon"
+#line 423 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
grn_obj *expr = efsi->e;
@@ -1899,21 +1905,21 @@ static void yy_reduce(
yygotominor.yy0 = GRN_TRUE;
}
}
-#line 1903 "ecmascript.c"
+#line 1909 "ecmascript.c"
break;
case 123: /* output_column ::= NONEXISTENT_COLUMN */
-#line 453 "ecmascript.lemon"
+#line 460 "ecmascript.lemon"
{
yygotominor.yy0 = GRN_TRUE;
}
-#line 1910 "ecmascript.c"
+#line 1916 "ecmascript.c"
break;
case 124: /* output_column ::= assignment_expression */
-#line 456 "ecmascript.lemon"
+#line 463 "ecmascript.lemon"
{
yygotominor.yy0 = GRN_FALSE;
}
-#line 1917 "ecmascript.c"
+#line 1923 "ecmascript.c"
break;
default:
/* (0) input ::= query */ yytestcase(yyruleno==0);
@@ -2027,7 +2033,7 @@ static void yy_syntax_error(
){
grn_expr_parserARG_FETCH;
#define TOKEN (yyminor.yy0)
-#line 16 "ecmascript.lemon"
+#line 17 "ecmascript.lemon"
{
grn_ctx *ctx = efsi->ctx;
@@ -2049,7 +2055,7 @@ static void yy_syntax_error(
GRN_OBJ_FIN(ctx, &message);
}
}
-#line 2053 "ecmascript.c"
+#line 2059 "ecmascript.c"
grn_expr_parserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
diff --git a/storage/mroonga/vendor/groonga/lib/ecmascript.lemon b/storage/mroonga/vendor/groonga/lib/ecmascript.lemon
index 669269973dc..322d7ac8264 100644
--- a/storage/mroonga/vendor/groonga/lib/ecmascript.lemon
+++ b/storage/mroonga/vendor/groonga/lib/ecmascript.lemon
@@ -1,3 +1,4 @@
+/* -*- mode: c; c-basic-offset: 2 -*- */
%name grn_expr_parser
%token_prefix GRN_EXPR_TOKEN_
%include {
@@ -75,6 +76,12 @@ query_element ::= IDENTIFIER RELATIVE_OP query_element. {
GRN_INT32_POP(&efsi->max_interval_stack, max_interval);
}
break;
+ case GRN_OP_SIMILAR :
+ {
+ int similarity_threshold;
+ GRN_INT32_POP(&efsi->similarity_threshold_stack, similarity_threshold);
+ }
+ break;
default :
break;
}
diff --git a/storage/mroonga/vendor/groonga/lib/expr.c b/storage/mroonga/vendor/groonga/lib/expr.c
index 8010f5ddbc0..dd70ebecb40 100644
--- a/storage/mroonga/vendor/groonga/lib/expr.c
+++ b/storage/mroonga/vendor/groonga/lib/expr.c
@@ -343,9 +343,11 @@ grn_ctx_push(grn_ctx *ctx, grn_obj *obj)
return GRN_STACK_OVER_FLOW;
}
-static grn_obj *
-const_new(grn_ctx *ctx, grn_expr *e)
+grn_obj *
+grn_expr_alloc_const(grn_ctx *ctx, grn_obj *expr)
{
+ grn_expr *e = (grn_expr *)expr;
+
if (!e->consts) {
if (!(e->consts = GRN_MALLOCN(grn_obj, GRN_STACK_SIZE))) {
ERR(GRN_NO_MEMORY_AVAILABLE, "malloc failed");
@@ -482,7 +484,7 @@ grn_expr_unpack(grn_ctx *ctx, const uint8_t *p, const uint8_t *pe, grn_obj *expr
GRN_B_DEC(id, p);
code->value = grn_ctx_at(ctx, id);
} else {
- if (!(v = const_new(ctx, e))) { return NULL; }
+ if (!(v = grn_expr_alloc_const(ctx, expr))) { return NULL; }
p = grn_obj_unpack(ctx, p, pe, object_type, GRN_OBJ_EXPRCONST, v);
code->value = v;
}
@@ -539,6 +541,14 @@ exit :
return (grn_obj *)expr;
}
+/* Pass ownership of `obj` to `expr`. */
+void
+grn_expr_take_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj)
+{
+ grn_expr *e = (grn_expr *)expr;
+ GRN_PTR_PUT(ctx, &(e->objs), obj);
+}
+
/* data flow info */
typedef struct {
grn_expr_code *code;
@@ -804,6 +814,19 @@ grn_expr_get_var_by_offset(grn_ctx *ctx, grn_obj *expr, unsigned int offset)
x = code_->value; \
if (CONSTP(x)) { \
switch (domain) { \
+ case GRN_DB_INT32: \
+ { \
+ int value; \
+ value = GRN_INT32_VALUE(x); \
+ if (value == (int)0x80000000) { \
+ domain = GRN_DB_INT64; \
+ x->header.domain = domain; \
+ GRN_INT64_SET(ctx, x, -((long long int)value)); \
+ } else { \
+ GRN_INT32_SET(ctx, x, -value); \
+ } \
+ } \
+ break; \
case GRN_DB_UINT32: \
{ \
unsigned int value; \
@@ -1134,7 +1157,7 @@ grn_expr_append_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj, grn_operator op,
obj = col;
type = col->header.type;
domain = grn_obj_get_range(ctx, col);
- GRN_PTR_PUT(ctx, &(e->objs), col);
+ grn_expr_take_obj(ctx, (grn_obj *)e, col);
}
} else {
domain = grn_obj_get_range(ctx, obj);
@@ -1253,7 +1276,6 @@ grn_expr_append_const(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
grn_operator op, int nargs)
{
grn_obj *res = NULL;
- grn_expr *e = (grn_expr *)expr;
GRN_API_ENTER;
if (!obj) {
ERR(GRN_SYNTAX_ERROR, "constant is null");
@@ -1262,7 +1284,7 @@ grn_expr_append_const(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
if (GRN_DB_OBJP(obj) || GRN_ACCESSORP(obj)) {
res = obj;
} else {
- if ((res = const_new(ctx, e))) {
+ if ((res = grn_expr_alloc_const(ctx, expr))) {
switch (obj->header.type) {
case GRN_VOID :
case GRN_BULK :
@@ -1287,8 +1309,7 @@ static grn_obj *
grn_expr_add_str(grn_ctx *ctx, grn_obj *expr, const char *str, unsigned int str_size)
{
grn_obj *res = NULL;
- grn_expr *e = (grn_expr *)expr;
- if ((res = const_new(ctx, e))) {
+ if ((res = grn_expr_alloc_const(ctx, expr))) {
GRN_TEXT_INIT(res, 0);
grn_bulk_write(ctx, res, str, str_size);
res->header.impl_flags |= GRN_OBJ_EXPRCONST;
@@ -1312,9 +1333,8 @@ grn_expr_append_const_int(grn_ctx *ctx, grn_obj *expr, int i,
grn_operator op, int nargs)
{
grn_obj *res = NULL;
- grn_expr *e = (grn_expr *)expr;
GRN_API_ENTER;
- if ((res = const_new(ctx, e))) {
+ if ((res = grn_expr_alloc_const(ctx, expr))) {
GRN_INT32_INIT(res, 0);
GRN_INT32_SET(ctx, res, i);
res->header.impl_flags |= GRN_OBJ_EXPRCONST;
@@ -2886,7 +2906,7 @@ grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs)
if (col->header.type == GRN_BULK) {
grn_obj *table = grn_ctx_at(ctx, GRN_OBJ_GET_DOMAIN(rec));
col = grn_obj_column(ctx, table, GRN_BULK_HEAD(col), GRN_BULK_VSIZE(col));
- if (col) { GRN_PTR_PUT(ctx, &e->objs, col); }
+ if (col) { grn_expr_take_obj(ctx, (grn_obj *)e, col); }
}
if (col) {
res->header.type = GRN_PTR;
@@ -3223,7 +3243,7 @@ grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs)
if (col->header.type == GRN_BULK) {
grn_obj *table = grn_ctx_at(ctx, GRN_OBJ_GET_DOMAIN(rec));
col = grn_obj_column(ctx, table, GRN_BULK_HEAD(col), GRN_BULK_VSIZE(col));
- if (col) { GRN_PTR_PUT(ctx, &e->objs, col); }
+ if (col) { grn_expr_take_obj(ctx, (grn_obj *)expr, col); }
}
if (col) {
grn_obj_reinit_for(ctx, res, col);
@@ -4042,7 +4062,7 @@ grn_expr_get_value(grn_ctx *ctx, grn_obj *expr, int offset)
#define DEFAULT_WEIGHT 5
#define DEFAULT_DECAYSTEP 2
#define DEFAULT_MAX_INTERVAL 10
-#define DEFAULT_SIMILARITY_THRESHOLD 10
+#define DEFAULT_SIMILARITY_THRESHOLD 0
#define DEFAULT_TERM_EXTRACT_POLICY 0
#define DEFAULT_WEIGHT_VECTOR_SIZE 4096
@@ -4058,6 +4078,7 @@ struct _grn_scan_info {
grn_obj *query;
grn_obj *args[8];
int max_interval;
+ int similarity_threshold;
};
#define SI_FREE(si) do {\
@@ -4079,6 +4100,7 @@ struct _grn_scan_info {
(si)->flags = SCAN_PUSH;\
(si)->nargs = 0;\
(si)->max_interval = DEFAULT_MAX_INTERVAL;\
+ (si)->similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD;\
(si)->start = (st);\
} while (0)
@@ -4219,6 +4241,7 @@ grn_scan_info_open(grn_ctx *ctx, int start)
si->flags = SCAN_PUSH;
si->nargs = 0;
si->max_interval = DEFAULT_MAX_INTERVAL;
+ si->similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD;
si->start = start;
return si;
@@ -4309,6 +4332,18 @@ grn_scan_info_set_max_interval(scan_info *si, int max_interval)
si->max_interval = max_interval;
}
+int
+grn_scan_info_get_similarity_threshold(scan_info *si)
+{
+ return si->similarity_threshold;
+}
+
+void
+grn_scan_info_set_similarity_threshold(scan_info *si, int similarity_threshold)
+{
+ si->similarity_threshold = similarity_threshold;
+}
+
grn_bool
grn_scan_info_push_arg(scan_info *si, grn_obj *arg)
{
@@ -4344,9 +4379,14 @@ scan_info_build_find_index_column_index(grn_ctx *ctx,
index = ec->value;
if (n_rest_codes > 2 &&
ec[1].value &&
- ec[1].value->header.domain == GRN_DB_UINT32 &&
+ (ec[1].value->header.domain == GRN_DB_INT32 ||
+ ec[1].value->header.domain == GRN_DB_UINT32) &&
ec[2].op == GRN_OP_GET_MEMBER) {
- sid = GRN_UINT32_VALUE(ec[1].value) + 1;
+ if (ec[1].value->header.domain == GRN_DB_INT32) {
+ sid = GRN_INT32_VALUE(ec[1].value) + 1;
+ } else {
+ sid = GRN_UINT32_VALUE(ec[1].value) + 1;
+ }
offset = 2;
weight = get_weight(ctx, ec + offset);
} else {
@@ -4525,6 +4565,15 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n,
si->query = *p;
}
break;
+ case GRN_OP_SIMILAR :
+ if (si->nargs == 3 &&
+ *p == si->args[2] &&
+ (*p)->header.domain == GRN_DB_INT32) {
+ si->similarity_threshold = GRN_INT32_VALUE(*p);
+ } else {
+ si->query = *p;
+ }
+ break;
default :
si->query = *p;
break;
@@ -5135,14 +5184,17 @@ grn_table_select_index(grn_ctx *ctx, grn_obj *table, scan_info *si,
} else {
optarg.mode = si->op;
}
+ optarg.max_interval = 0;
optarg.similarity_threshold = 0;
switch (si->op) {
case GRN_OP_NEAR :
case GRN_OP_NEAR2 :
optarg.max_interval = si->max_interval;
break;
+ case GRN_OP_SIMILAR :
+ optarg.similarity_threshold = si->similarity_threshold;
+ break;
default :
- optarg.max_interval = 0;
break;
}
optarg.weight_vector = (int *)GRN_BULK_HEAD(&wv);
@@ -5373,6 +5425,7 @@ typedef struct {
grn_obj op_stack;
grn_obj mode_stack;
grn_obj max_interval_stack;
+ grn_obj similarity_threshold_stack;
grn_operator default_op;
grn_select_optarg opt;
grn_operator default_mode;
@@ -5935,6 +5988,16 @@ accept_query_string(grn_ctx *ctx, efs_info *efsi,
grn_expr_append_op(efsi->ctx, efsi->e, mode, 3);
}
break;
+ case GRN_OP_SIMILAR :
+ {
+ int similarity_threshold;
+ similarity_threshold =
+ grn_int32_value_at(&efsi->similarity_threshold_stack, -1);
+ grn_expr_append_const_int(efsi->ctx, efsi->e, similarity_threshold,
+ GRN_OP_PUSH, 1);
+ grn_expr_append_op(efsi->ctx, efsi->e, mode, 3);
+ }
+ break;
default :
grn_expr_append_op(efsi->ctx, efsi->e, mode, 2);
break;
@@ -6022,12 +6085,12 @@ get_word_(grn_ctx *ctx, efs_info *q)
PARSE(GRN_EXPR_TOKEN_IDENTIFIER);
PARSE(GRN_EXPR_TOKEN_RELATIVE_OP);
- GRN_PTR_PUT(ctx, &((grn_expr *)(q->e))->objs, c);
+ grn_expr_take_obj(ctx, q->e, c);
GRN_PTR_PUT(ctx, &q->column_stack, c);
GRN_INT32_PUT(ctx, &q->mode_stack, mode);
return GRN_SUCCESS;
- } else if (*end == GRN_QUERY_PREFIX) {
+ } else if (GRN_TEXT_LEN(&q->buf) > 1 && *end == GRN_QUERY_PREFIX) {
q->cur = end + 1;
GRN_INT32_PUT(ctx, &q->mode_stack, GRN_OP_PREFIX);
break;
@@ -6111,6 +6174,9 @@ parse_query(grn_ctx *ctx, efs_info *q)
case GRN_OP_NEAR2 :
GRN_INT32_PUT(ctx, &q->max_interval_stack, option);
break;
+ case GRN_OP_SIMILAR :
+ GRN_INT32_PUT(ctx, &q->similarity_threshold_stack, option);
+ break;
default :
break;
}
@@ -6328,13 +6394,13 @@ done :
goto exit;
}
if ((obj = grn_obj_column(ctx, q->table, name, name_size))) {
- GRN_PTR_PUT(ctx, &((grn_expr *)q->e)->objs, obj);
+ grn_expr_take_obj(ctx, q->e, obj);
PARSE(GRN_EXPR_TOKEN_IDENTIFIER);
grn_expr_append_obj(ctx, q->e, obj, GRN_OP_GET_VALUE, 1);
goto exit;
}
if ((obj = resolve_top_level_name(ctx, name, name_size))) {
- GRN_PTR_PUT(ctx, &((grn_expr *)q->e)->objs, obj);
+ grn_expr_take_obj(ctx, q->e, obj);
PARSE(GRN_EXPR_TOKEN_IDENTIFIER);
grn_expr_append_obj(ctx, q->e, obj, GRN_OP_PUSH, 1);
goto exit;
@@ -6758,7 +6824,7 @@ parse_script(grn_ctx *ctx, efs_info *q)
rest = rest_float;
} else {
const char *rest64 = rest;
- unsigned int uint32 = grn_atoui(q->cur, q->str_end, &rest);
+ grn_atoui(q->cur, q->str_end, &rest);
// checks to see grn_atoi failed (see above NOTE)
if ((int64 > UINT32_MAX) ||
(q->str_end != rest && *rest >= '0' && *rest <= '9')) {
@@ -6767,11 +6833,16 @@ parse_script(grn_ctx *ctx, efs_info *q)
GRN_INT64_SET(ctx, &int64buf, int64);
grn_expr_append_const(ctx, q->e, &int64buf, GRN_OP_PUSH, 1);
rest = rest64;
+ } else if (int64 > INT32_MAX || int64 < INT32_MIN) {
+ grn_obj int64buf;
+ GRN_INT64_INIT(&int64buf, 0);
+ GRN_INT64_SET(ctx, &int64buf, int64);
+ grn_expr_append_const(ctx, q->e, &int64buf, GRN_OP_PUSH, 1);
} else {
- grn_obj uint32buf;
- GRN_UINT32_INIT(&uint32buf, 0);
- GRN_UINT32_SET(ctx, &uint32buf, uint32);
- grn_expr_append_const(ctx, q->e, &uint32buf, GRN_OP_PUSH, 1);
+ grn_obj int32buf;
+ GRN_INT32_INIT(&int32buf, 0);
+ GRN_INT32_SET(ctx, &int32buf, (int32_t)int64);
+ grn_expr_append_const(ctx, q->e, &int32buf, GRN_OP_PUSH, 1);
}
}
PARSE(GRN_EXPR_TOKEN_DECIMAL);
@@ -6806,6 +6877,7 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
GRN_INT32_INIT(&efsi.op_stack, GRN_OBJ_VECTOR);
GRN_INT32_INIT(&efsi.mode_stack, GRN_OBJ_VECTOR);
GRN_INT32_INIT(&efsi.max_interval_stack, GRN_OBJ_VECTOR);
+ GRN_INT32_INIT(&efsi.similarity_threshold_stack, GRN_OBJ_VECTOR);
GRN_PTR_INIT(&efsi.column_stack, GRN_OBJ_VECTOR, GRN_ID_NIL);
GRN_PTR_INIT(&efsi.token_stack, GRN_OBJ_VECTOR, GRN_ID_NIL);
efsi.e = expr;
@@ -6855,6 +6927,7 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
GRN_OBJ_FIN(ctx, &efsi.op_stack);
GRN_OBJ_FIN(ctx, &efsi.mode_stack);
GRN_OBJ_FIN(ctx, &efsi.max_interval_stack);
+ GRN_OBJ_FIN(ctx, &efsi.similarity_threshold_stack);
GRN_OBJ_FIN(ctx, &efsi.column_stack);
GRN_OBJ_FIN(ctx, &efsi.token_stack);
GRN_OBJ_FIN(ctx, &efsi.buf);
diff --git a/storage/mroonga/vendor/groonga/lib/expr.h b/storage/mroonga/vendor/groonga/lib/expr.h
index a42be924f58..67e134e47b9 100644
--- a/storage/mroonga/vendor/groonga/lib/expr.h
+++ b/storage/mroonga/vendor/groonga/lib/expr.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
- Copyright(C) 2013 Brazil
+ Copyright(C) 2013-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -57,11 +57,14 @@ void grn_scan_info_set_end(scan_info *si, uint32_t end);
void grn_scan_info_set_query(scan_info *si, grn_obj *query);
int grn_scan_info_get_max_interval(scan_info *si);
void grn_scan_info_set_max_interval(scan_info *si, int max_interval);
+int grn_scan_info_get_similarity_threshold(scan_info *si);
+void grn_scan_info_set_similarity_threshold(scan_info *si, int similarity_threshold);
grn_bool grn_scan_info_push_arg(scan_info *si, grn_obj *arg);
grn_obj *grn_scan_info_get_arg(grn_ctx *ctx, scan_info *si, int i);
int32_t grn_expr_code_get_weight(grn_ctx *ctx, grn_expr_code *ec);
-grn_rc grn_expr_get_keywords(grn_ctx *ctx, grn_obj *expr, grn_obj *keywords);
+void grn_expr_take_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj);
+grn_obj *grn_expr_alloc_const(grn_ctx *ctx, grn_obj *expr);
#ifdef __cplusplus
}
diff --git a/storage/mroonga/vendor/groonga/lib/groonga_in.h b/storage/mroonga/vendor/groonga/lib/groonga_in.h
index f3fce4782cd..d7ecff2808b 100644
--- a/storage/mroonga/vendor/groonga/lib/groonga_in.h
+++ b/storage/mroonga/vendor/groonga/lib/groonga_in.h
@@ -50,9 +50,6 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
-#ifdef HAVE_SYS_TIMEB_H
-#include <sys/timeb.h>
-#endif /* HAVE_SYS_TIMEB_H */
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
diff --git a/storage/mroonga/vendor/groonga/lib/hash.c b/storage/mroonga/vendor/groonga/lib/hash.c
index 79402848f55..fa5854a6a93 100644
--- a/storage/mroonga/vendor/groonga/lib/hash.c
+++ b/storage/mroonga/vendor/groonga/lib/hash.c
@@ -1609,6 +1609,7 @@ grn_io_hash_init(grn_ctx *ctx, grn_hash *hash, const char *path,
hash->normalizer = NULL;
header->normalizer = GRN_ID_NIL;
}
+ GRN_PTR_INIT(&(hash->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
grn_table_queue_init(ctx, &header->queue);
hash->obj.header.flags = header->flags;
@@ -1683,6 +1684,7 @@ grn_tiny_hash_init(grn_ctx *ctx, grn_hash *hash, const char *path,
hash->garbages = GRN_ID_NIL;
hash->tokenizer = NULL;
hash->normalizer = NULL;
+ GRN_PTR_INIT(&(hash->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
grn_tiny_array_init(ctx, &hash->a, entry_size, GRN_TINY_ARRAY_CLEAR);
grn_tiny_bitmap_init(ctx, &hash->bitmap);
return GRN_SUCCESS;
@@ -1755,6 +1757,7 @@ grn_hash_open(grn_ctx *ctx, const char *path)
} else {
hash->normalizer = grn_ctx_at(ctx, header->normalizer);
}
+ GRN_PTR_INIT(&(hash->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
hash->obj.header.flags = header->flags;
return hash;
} else {
@@ -1779,6 +1782,8 @@ grn_tiny_hash_fin(grn_ctx *ctx, grn_hash *hash)
return GRN_INVALID_ARGUMENT;
}
+ GRN_OBJ_FIN(ctx, &(hash->token_filters));
+
if (hash->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) {
uint32_t num_remaining_entries = *hash->n_entries;
grn_id *hash_ptr;
@@ -1808,6 +1813,7 @@ grn_hash_close(grn_ctx *ctx, grn_hash *hash)
if (!ctx || !hash) { return GRN_INVALID_ARGUMENT; }
if (grn_hash_is_io_hash(hash)) {
rc = grn_io_close(ctx, hash->io);
+ GRN_PTR_INIT(&(hash->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
} else {
GRN_ASSERT(ctx == hash->ctx);
rc = grn_tiny_hash_fin(ctx, hash);
diff --git a/storage/mroonga/vendor/groonga/lib/hash.h b/storage/mroonga/vendor/groonga/lib/hash.h
index 59cdec1223b..6f2e68de246 100644
--- a/storage/mroonga/vendor/groonga/lib/hash.h
+++ b/storage/mroonga/vendor/groonga/lib/hash.h
@@ -206,6 +206,7 @@ struct _grn_hash {
uint32_t *max_offset;
grn_obj *tokenizer;
grn_obj *normalizer;
+ grn_obj token_filters;
/* For grn_io_hash. */
grn_io *io;
diff --git a/storage/mroonga/vendor/groonga/lib/ii.c b/storage/mroonga/vendor/groonga/lib/ii.c
index f3b67628818..5dc203865ad 100644
--- a/storage/mroonga/vendor/groonga/lib/ii.c
+++ b/storage/mroonga/vendor/groonga/lib/ii.c
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009-2012 Brazil
+/* Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -3467,7 +3467,8 @@ _grn_ii_create(grn_ctx *ctx, grn_ii *ii, const char *path, grn_obj *lexicon, uin
free_histogram[i] = 0;
}
*/
- if (grn_table_get_info(ctx, lexicon, &lflags, &encoding, &tokenizer, NULL)) {
+ if (grn_table_get_info(ctx, lexicon, &lflags, &encoding, &tokenizer,
+ NULL, NULL)) {
return NULL;
}
if (path && strlen(path) + 6 >= PATH_MAX) { return NULL; }
@@ -3589,7 +3590,8 @@ grn_ii_open(grn_ctx *ctx, const char *path, grn_obj *lexicon)
grn_obj_flags lflags;
grn_encoding encoding;
grn_obj *tokenizer;
- if (grn_table_get_info(ctx, lexicon, &lflags, &encoding, &tokenizer, NULL)) {
+ if (grn_table_get_info(ctx, lexicon, &lflags, &encoding, &tokenizer,
+ NULL, NULL)) {
return NULL;
}
if (strlen(path) + 6 >= PATH_MAX) { return NULL; }
@@ -4612,26 +4614,26 @@ index_add(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgr
{
grn_hash *h;
unsigned int token_flags = 0;
- grn_token *token;
+ grn_token_cursor *token_cursor;
grn_ii_updspec **u;
grn_id tid, *tp;
grn_rc r, rc = GRN_SUCCESS;
grn_vgram_buf *sbuf = NULL;
if (!rid) { return GRN_INVALID_ARGUMENT; }
- if (!(token = grn_token_open(ctx, lexicon, value, value_len,
- GRN_TOKEN_ADD, token_flags))) {
+ if (!(token_cursor = grn_token_cursor_open(ctx, lexicon, value, value_len,
+ GRN_TOKEN_ADD, token_flags))) {
return GRN_NO_MEMORY_AVAILABLE;
}
if (vgram) { sbuf = grn_vgram_buf_open(value_len); }
h = grn_hash_create(ctx, NULL, sizeof(grn_id), sizeof(grn_ii_updspec *), GRN_HASH_TINY);
if (!h) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_hash_create on index_add failed !");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
if (sbuf) { grn_vgram_buf_close(sbuf); }
return GRN_NO_MEMORY_AVAILABLE;
}
- while (!token->status) {
- (tid = grn_token_next(ctx, token));
+ while (!token_cursor->status) {
+ (tid = grn_token_cursor_next(ctx, token_cursor));
if (tid) {
if (!grn_hash_add(ctx, h, &tid, sizeof(grn_id), (void **) &u, NULL)) { break; }
if (!*u) {
@@ -4640,14 +4642,14 @@ index_add(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgr
goto exit;
}
}
- if (grn_ii_updspec_add(ctx, *u, token->pos, 0)) {
+ if (grn_ii_updspec_add(ctx, *u, token_cursor->pos, 0)) {
GRN_LOG(ctx, GRN_LOG_ERROR, "grn_ii_updspec_add on index_add failed!");
goto exit;
}
if (sbuf) { grn_vgram_buf_add(sbuf, tid); }
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
// todo : support vgram
// if (sbuf) { grn_vgram_update(vgram, rid, sbuf, (grn_set *)h); }
GRN_HASH_EACH(ctx, h, id, &tp, NULL, &u, {
@@ -4659,7 +4661,7 @@ index_add(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgr
return rc;
exit:
grn_hash_close(ctx, h);
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
if (sbuf) { grn_vgram_buf_close(sbuf); }
return GRN_NO_MEMORY_AVAILABLE;
}
@@ -4670,34 +4672,34 @@ index_del(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgr
{
grn_hash *h;
unsigned int token_flags = 0;
- grn_token *token;
+ grn_token_cursor *token_cursor;
grn_ii_updspec **u;
grn_id tid, *tp;
if (!rid) { return GRN_INVALID_ARGUMENT; }
- if (!(token = grn_token_open(ctx, lexicon, value, value_len,
- GRN_TOKEN_DEL, token_flags))) {
+ if (!(token_cursor = grn_token_cursor_open(ctx, lexicon, value, value_len,
+ GRN_TOKEN_DEL, token_flags))) {
return GRN_NO_MEMORY_AVAILABLE;
}
h = grn_hash_create(ctx, NULL, sizeof(grn_id), sizeof(grn_ii_updspec *), GRN_HASH_TINY);
if (!h) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_hash_create on index_del failed !");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
return GRN_NO_MEMORY_AVAILABLE;
}
- while (!token->status) {
- if ((tid = grn_token_next(ctx, token))) {
+ while (!token_cursor->status) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
if (!grn_hash_add(ctx, h, &tid, sizeof(grn_id), (void **) &u, NULL)) { break; }
if (!*u) {
if (!(*u = grn_ii_updspec_open(ctx, rid, 0))) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_open on index_del failed !");
grn_hash_close(ctx, h);
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
return GRN_NO_MEMORY_AVAILABLE;
}
}
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
GRN_HASH_EACH(ctx, h, id, &tp, NULL, &u, {
if (*tp) {
grn_ii_delete_one(ctx, ii, *tp, *u, NULL);
@@ -4736,7 +4738,7 @@ grn_ii_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, grn_vgram *vgram, unsigned i
int j;
grn_value *v;
unsigned int token_flags = 0;
- grn_token *token;
+ grn_token_cursor *token_cursor;
grn_rc rc = GRN_SUCCESS;
grn_hash *old, *new;
grn_id tid, *tp;
@@ -4754,32 +4756,32 @@ grn_ii_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, grn_vgram *vgram, unsigned i
goto exit;
}
for (j = newvalues->n_values, v = newvalues->values; j; j--, v++) {
- if ((token = grn_token_open(ctx, lexicon, v->str, v->str_len,
- GRN_TOKEN_ADD, token_flags))) {
- while (!token->status) {
- if ((tid = grn_token_next(ctx, token))) {
+ if ((token_cursor = grn_token_cursor_open(ctx, lexicon, v->str, v->str_len,
+ GRN_TOKEN_ADD, token_flags))) {
+ while (!token_cursor->status) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
if (!grn_hash_add(ctx, new, &tid, sizeof(grn_id), (void **) &u, NULL)) {
break;
}
if (!*u) {
if (!(*u = grn_ii_updspec_open(ctx, rid, section))) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_open on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
grn_hash_close(ctx, new);
rc = GRN_NO_MEMORY_AVAILABLE;
goto exit;
}
}
- if (grn_ii_updspec_add(ctx, *u, token->pos, v->weight)) {
+ if (grn_ii_updspec_add(ctx, *u, token_cursor->pos, v->weight)) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_add on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
grn_hash_close(ctx, new);
rc = GRN_NO_MEMORY_AVAILABLE;
goto exit;
}
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
}
if (!GRN_HASH_SIZE(new)) {
@@ -4798,26 +4800,26 @@ grn_ii_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, grn_vgram *vgram, unsigned i
goto exit;
}
for (j = oldvalues->n_values, v = oldvalues->values; j; j--, v++) {
- if ((token = grn_token_open(ctx, lexicon, v->str, v->str_len,
- GRN_TOKEN_DEL, token_flags))) {
- while (!token->status) {
- if ((tid = grn_token_next(ctx, token))) {
+ if ((token_cursor = grn_token_cursor_open(ctx, lexicon, v->str, v->str_len,
+ GRN_TOKEN_DEL, token_flags))) {
+ while (!token_cursor->status) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
if (!grn_hash_add(ctx, old, &tid, sizeof(grn_id), (void **) &u, NULL)) {
break;
}
if (!*u) {
if (!(*u = grn_ii_updspec_open(ctx, rid, section))) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_open on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
if (new) { grn_hash_close(ctx, new); };
grn_hash_close(ctx, old);
rc = GRN_NO_MEMORY_AVAILABLE;
goto exit;
}
}
- if (grn_ii_updspec_add(ctx, *u, token->pos, v->weight)) {
+ if (grn_ii_updspec_add(ctx, *u, token_cursor->pos, v->weight)) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_add on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
if (new) { grn_hash_close(ctx, new); };
grn_hash_close(ctx, old);
rc = GRN_NO_MEMORY_AVAILABLE;
@@ -4825,7 +4827,7 @@ grn_ii_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, grn_vgram *vgram, unsigned i
}
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
}
} else {
@@ -4870,7 +4872,7 @@ grn_vector2updspecs(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
int j;
grn_id tid;
grn_section *v;
- grn_token *token;
+ grn_token_cursor *token_cursor;
grn_ii_updspec **u;
grn_hash *h = (grn_hash *)out;
grn_obj *lexicon = ii->lexicon;
@@ -4879,10 +4881,10 @@ grn_vector2updspecs(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
for (j = in->u.v.n_sections, v = in->u.v.sections; j; j--, v++) {
unsigned int token_flags = 0;
if (v->length &&
- (token = grn_token_open(ctx, lexicon, head + v->offset, v->length,
- mode, token_flags))) {
- while (!token->status) {
- if ((tid = grn_token_next(ctx, token))) {
+ (token_cursor = grn_token_cursor_open(ctx, lexicon, head + v->offset, v->length,
+ mode, token_flags))) {
+ while (!token_cursor->status) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
if (posting) { GRN_RECORD_PUT(ctx, posting, tid); }
if (!grn_hash_add(ctx, h, &tid, sizeof(grn_id), (void **) &u, NULL)) {
break;
@@ -4890,18 +4892,18 @@ grn_vector2updspecs(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
if (!*u) {
if (!(*u = grn_ii_updspec_open(ctx, rid, section))) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_open on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
return GRN_NO_MEMORY_AVAILABLE;
}
}
- if (grn_ii_updspec_add(ctx, *u, token->pos, v->weight)) {
+ if (grn_ii_updspec_add(ctx, *u, token_cursor->pos, v->weight)) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_ii_updspec_add on grn_ii_update failed!");
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
return GRN_NO_MEMORY_AVAILABLE;
}
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
}
}
@@ -5353,18 +5355,22 @@ token_compare(const void *a, const void *b)
inline static grn_rc
token_info_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string, unsigned int string_len,
- token_info **tis, uint32_t *n, grn_operator mode)
+ token_info **tis, uint32_t *n, grn_bool *only_skip_token,
+ grn_operator mode)
{
token_info *ti;
const char *key;
uint32_t size;
grn_rc rc = GRN_END_OF_DATA;
unsigned int token_flags = GRN_TOKEN_ENABLE_TOKENIZED_DELIMITER;
- grn_token *token = grn_token_open(ctx, lexicon, string, string_len,
- GRN_TOKEN_GET, token_flags);
- if (!token) { return GRN_NO_MEMORY_AVAILABLE; }
+ grn_token_cursor *token_cursor = grn_token_cursor_open(ctx, lexicon,
+ string, string_len,
+ GRN_TOKEN_GET,
+ token_flags);
+ *only_skip_token = GRN_FALSE;
+ if (!token_cursor) { return GRN_NO_MEMORY_AVAILABLE; }
if (mode == GRN_OP_UNSPLIT) {
- if ((ti = token_info_open(ctx, lexicon, ii, (char *)token->orig, token->orig_blen, 0, EX_BOTH))) {
+ if ((ti = token_info_open(ctx, lexicon, ii, (char *)token_cursor->orig, token_cursor->orig_blen, 0, EX_BOTH))) {
tis[(*n)++] = ti;
rc = GRN_SUCCESS;
}
@@ -5385,48 +5391,53 @@ token_info_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string,
ef = EX_NONE;
break;
}
- tid = grn_token_next(ctx, token);
- if (token->force_prefix) { ef |= EX_PREFIX; }
- switch (token->status) {
+ tid = grn_token_cursor_next(ctx, token_cursor);
+ if (token_cursor->force_prefix) { ef |= EX_PREFIX; }
+ switch (token_cursor->status) {
case GRN_TOKEN_DOING :
key = _grn_table_key(ctx, lexicon, tid, &size);
- ti = token_info_open(ctx, lexicon, ii, key, size, token->pos, ef & EX_SUFFIX);
+ ti = token_info_open(ctx, lexicon, ii, key, size, token_cursor->pos, ef & EX_SUFFIX);
break;
case GRN_TOKEN_DONE :
- ti = token_info_open(ctx, lexicon, ii, (const char *)token->curr,
- token->curr_size, 0, ef);
+ ti = token_info_open(ctx, lexicon, ii, (const char *)token_cursor->curr,
+ token_cursor->curr_size, 0, ef);
/*
key = _grn_table_key(ctx, lexicon, tid, &size);
- ti = token_info_open(ctx, lexicon, ii, token->curr, token->curr_size, token->pos, ef);
- ti = token_info_open(ctx, lexicon, ii, (char *)token->orig,
- token->orig_blen, token->pos, ef);
+ ti = token_info_open(ctx, lexicon, ii, token_cursor->curr, token_cursor->curr_size, token_cursor->pos, ef);
+ ti = token_info_open(ctx, lexicon, ii, (char *)token_cursor->orig,
+ token_cursor->orig_blen, token_cursor->pos, ef);
*/
break;
case GRN_TOKEN_NOT_FOUND :
- ti = token_info_open(ctx, lexicon, ii, (char *)token->orig,
- token->orig_blen, 0, ef);
+ ti = token_info_open(ctx, lexicon, ii, (char *)token_cursor->orig,
+ token_cursor->orig_blen, 0, ef);
break;
+ case GRN_TOKEN_DONE_SKIP :
+ *only_skip_token = GRN_TRUE;
+ goto exit;
default :
goto exit;
}
if (!ti) { goto exit ; }
tis[(*n)++] = ti;
- while (token->status == GRN_TOKEN_DOING) {
- tid = grn_token_next(ctx, token);
- switch (token->status) {
+ while (token_cursor->status == GRN_TOKEN_DOING) {
+ tid = grn_token_cursor_next(ctx, token_cursor);
+ switch (token_cursor->status) {
+ case GRN_TOKEN_DONE_SKIP :
+ continue;
case GRN_TOKEN_DOING :
key = _grn_table_key(ctx, lexicon, tid, &size);
- ti = token_info_open(ctx, lexicon, ii, key, size, token->pos, EX_NONE);
+ ti = token_info_open(ctx, lexicon, ii, key, size, token_cursor->pos, EX_NONE);
break;
case GRN_TOKEN_DONE :
if (tid) {
key = _grn_table_key(ctx, lexicon, tid, &size);
- ti = token_info_open(ctx, lexicon, ii, key, size, token->pos, ef & EX_PREFIX);
+ ti = token_info_open(ctx, lexicon, ii, key, size, token_cursor->pos, ef & EX_PREFIX);
break;
} /* else fallthru */
default :
- ti = token_info_open(ctx, lexicon, ii, (char *)token->curr,
- token->curr_size, token->pos, ef & EX_PREFIX);
+ ti = token_info_open(ctx, lexicon, ii, (char *)token_cursor->curr,
+ token_cursor->curr_size, token_cursor->pos, ef & EX_PREFIX);
break;
}
if (!ti) { goto exit; }
@@ -5435,7 +5446,7 @@ token_info_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string,
rc = GRN_SUCCESS;
}
exit :
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
return rc;
}
@@ -5644,35 +5655,36 @@ grn_ii_similar_search(grn_ctx *ctx, grn_ii *ii,
grn_id tid, *tp, max_size;
grn_rc rc = GRN_SUCCESS;
grn_hash *h;
- grn_token *token;
+ grn_token_cursor *token_cursor;
unsigned int token_flags = GRN_TOKEN_ENABLE_TOKENIZED_DELIMITER;
grn_obj *lexicon = ii->lexicon;
if (!lexicon || !ii || !string || !string_len || !s || !optarg) { return GRN_INVALID_ARGUMENT; }
if (!(h = grn_hash_create(ctx, NULL, sizeof(grn_id), sizeof(int), 0))) {
return GRN_NO_MEMORY_AVAILABLE;
}
- if (!(token = grn_token_open(ctx, lexicon, string, string_len,
- GRN_TOKEN_GET, token_flags))) {
+ if (!(token_cursor = grn_token_cursor_open(ctx, lexicon, string, string_len,
+ GRN_TOKEN_GET, token_flags))) {
grn_hash_close(ctx, h);
return GRN_NO_MEMORY_AVAILABLE;
}
if (!(max_size = optarg->max_size)) { max_size = 1048576; }
- while (token->status != GRN_TOKEN_DONE) {
- if ((tid = grn_token_next(ctx, token))) {
+ while (token_cursor->status != GRN_TOKEN_DONE &&
+ token_cursor->status != GRN_TOKEN_DONE_SKIP) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
if (grn_hash_add(ctx, h, &tid, sizeof(grn_id), (void **)&w1, NULL)) { (*w1)++; }
}
- if (tid && token->curr_size) {
+ if (tid && token_cursor->curr_size) {
if (optarg->max_interval == GRN_OP_UNSPLIT) {
- grn_table_search(ctx, lexicon, token->curr, token->curr_size,
+ grn_table_search(ctx, lexicon, token_cursor->curr, token_cursor->curr_size,
GRN_OP_PREFIX, (grn_obj *)h, GRN_OP_OR);
}
if (optarg->max_interval == GRN_OP_PARTIAL) {
- grn_table_search(ctx, lexicon, token->curr, token->curr_size,
+ grn_table_search(ctx, lexicon, token_cursor->curr, token_cursor->curr_size,
GRN_OP_SUFFIX, (grn_obj *)h, GRN_OP_OR);
}
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
{
grn_hash_cursor *c = grn_hash_cursor_open(ctx, h, NULL, 0, NULL, 0, 0, -1, 0);
if (!c) {
@@ -5702,7 +5714,12 @@ grn_ii_similar_search(grn_ctx *ctx, grn_ii *ii,
grn_ii_cursor *c;
grn_ii_posting *pos;
grn_wv_mode wvm = grn_wv_none;
- grn_table_sort_optarg arg = {GRN_TABLE_SORT_DESC, NULL, (void *)sizeof(grn_id), 0};
+ grn_table_sort_optarg arg = {
+ GRN_TABLE_SORT_DESC|GRN_TABLE_SORT_BY_VALUE|GRN_TABLE_SORT_AS_NUMBER,
+ NULL,
+ NULL,
+ 0
+ };
grn_array *sorted = grn_array_create(ctx, NULL, sizeof(grn_id), 0);
if (!sorted) {
GRN_LOG(ctx, GRN_LOG_ALERT, "grn_hash_sort on grn_ii_similar_search failed !");
@@ -5851,6 +5868,7 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_
int rep, orp, weight, max_interval = 0;
token_info *ti, **tis = NULL, **tip, **tie;
uint32_t n = 0, rid, sid, nrid, nsid;
+ grn_bool only_skip_token = GRN_FALSE;
grn_operator mode = GRN_OP_EXACT;
grn_wv_mode wvm = grn_wv_none;
grn_obj *lexicon = ii->lexicon;
@@ -5879,7 +5897,7 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_
if (!(tis = GRN_MALLOC(sizeof(token_info *) * string_len * 2))) {
return GRN_NO_MEMORY_AVAILABLE;
}
- if (token_info_build(ctx, lexicon, ii, string, string_len, tis, &n, mode) || !n) { goto exit; }
+ if (token_info_build(ctx, lexicon, ii, string, string_len, tis, &n, &only_skip_token, mode) || !n) { goto exit; }
switch (mode) {
case GRN_OP_NEAR2 :
token_info_clear_offset(tis, n);
@@ -6005,7 +6023,9 @@ exit :
if (*tip) { token_info_close(ctx, *tip); }
}
if (tis) { GRN_FREE(tis); }
- grn_ii_resolve_sel_and(ctx, s, op);
+ if (!only_skip_token) {
+ grn_ii_resolve_sel_and(ctx, s, op);
+ }
// grn_hash_cursor_clear(r);
bt_close(ctx, bt);
#ifdef DEBUG
@@ -6037,6 +6057,7 @@ grn_ii_sel(grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len
break;
case GRN_OP_SIMILAR :
arg.mode = optarg->mode;
+ arg.similarity_threshold = optarg->similarity_threshold;
break;
default :
break;
@@ -6700,7 +6721,7 @@ get_tmp_lexicon(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
grn_obj *normalizer;
grn_obj_flags flags;
grn_table_get_info(ctx, ii_buffer->lexicon, &flags, NULL,
- &tokenizer, &normalizer);
+ &tokenizer, &normalizer, NULL);
flags &= ~GRN_OBJ_PERSISTENT;
tmp_lexicon = grn_table_create(ctx, NULL, 0, NULL, flags, domain, range);
if (tmp_lexicon) {
@@ -6756,7 +6777,7 @@ grn_ii_buffer_tokenize(grn_ctx *ctx, grn_ii_buffer *ii_buffer, grn_id rid,
}
if ((tmp_lexicon = get_tmp_lexicon(ctx, ii_buffer))) {
unsigned int token_flags = 0;
- grn_token *token;
+ grn_token_cursor *token_cursor;
grn_id *buffer = ii_buffer->block_buf;
uint32_t block_pos = ii_buffer->block_pos;
buffer[block_pos++] = rid + II_BUFFER_RID_FLAG;
@@ -6766,12 +6787,13 @@ grn_ii_buffer_tokenize(grn_ctx *ctx, grn_ii_buffer *ii_buffer, grn_id rid,
if (weight) {
buffer[block_pos++] = weight + II_BUFFER_WEIGHT_FLAG;
}
- if ((token = grn_token_open(ctx, tmp_lexicon, value,
- value_len, GRN_TOKEN_ADD, token_flags))) {
+ if ((token_cursor = grn_token_cursor_open(ctx, tmp_lexicon,
+ value, value_len,
+ GRN_TOKEN_ADD, token_flags))) {
uint32_t pos;
- for (pos = 0; !token->status; pos++) {
+ for (pos = 0; !token_cursor->status; pos++) {
grn_id tid;
- if ((tid = grn_token_next(ctx, token))) {
+ if ((tid = grn_token_cursor_next(ctx, token_cursor))) {
ii_buffer_counter *counter;
counter = get_buffer_counter(ctx, ii_buffer, tmp_lexicon, tid);
if (!counter) { return; }
@@ -6810,7 +6832,7 @@ grn_ii_buffer_tokenize(grn_ctx *ctx, grn_ii_buffer *ii_buffer, grn_id rid,
counter->nposts++;
}
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
ii_buffer->block_pos = block_pos;
}
@@ -7151,7 +7173,7 @@ grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
S_IRUSR|S_IWUSR);
if (ii_buffer->tmpfd != -1) {
grn_obj_flags flags;
- grn_table_get_info(ctx, ii->lexicon, &flags, NULL, NULL, NULL);
+ grn_table_get_info(ctx, ii->lexicon, &flags, NULL, NULL, NULL, NULL);
if ((flags & GRN_OBJ_TABLE_TYPE_MASK) == GRN_OBJ_TABLE_PAT_KEY) {
grn_pat_cache_enable(ctx, (grn_pat *)ii->lexicon,
PAT_CACHE_SIZE);
@@ -7274,7 +7296,7 @@ grn_ii_buffer_close(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
{
uint32_t i;
grn_obj_flags flags;
- grn_table_get_info(ctx, ii_buffer->ii->lexicon, &flags, NULL, NULL, NULL);
+ grn_table_get_info(ctx, ii_buffer->ii->lexicon, &flags, NULL, NULL, NULL, NULL);
if ((flags & GRN_OBJ_TABLE_TYPE_MASK) == GRN_OBJ_TABLE_PAT_KEY) {
grn_pat_cache_disable(ctx, (grn_pat *)ii_buffer->ii->lexicon);
}
diff --git a/storage/mroonga/vendor/groonga/lib/io.h b/storage/mroonga/vendor/groonga/lib/io.h
index 27538b381e2..04c75919c5f 100644
--- a/storage/mroonga/vendor/groonga/lib/io.h
+++ b/storage/mroonga/vendor/groonga/lib/io.h
@@ -75,6 +75,7 @@ typedef struct {
#if defined(WIN32) && defined(WIN32_FMO_EACH)
HANDLE fmo;
#endif /* defined(WIN32) && defined(WIN32_FMO_EACH) */
+ void *value;
} grn_io_win;
typedef struct {
diff --git a/storage/mroonga/vendor/groonga/lib/mrb.h b/storage/mroonga/vendor/groonga/lib/mrb.h
index 4cff30ef1e9..fe51e5e7670 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb.h
+++ b/storage/mroonga/vendor/groonga/lib/mrb.h
@@ -31,9 +31,9 @@ extern "C" {
#endif
#ifdef GRN_WITH_MRUBY
-mrb_value grn_mrb_eval(grn_ctx *ctx, const char *script, int script_length);
-mrb_value grn_mrb_load(grn_ctx *ctx, const char *path);
-grn_rc grn_mrb_to_grn(grn_ctx *ctx, mrb_value mrb_object, grn_obj *grn_object);
+GRN_API mrb_value grn_mrb_eval(grn_ctx *ctx, const char *script, int script_length);
+GRN_API mrb_value grn_mrb_load(grn_ctx *ctx, const char *path);
+GRN_API grn_rc grn_mrb_to_grn(grn_ctx *ctx, mrb_value mrb_object, grn_obj *grn_object);
#endif
#ifdef __cplusplus
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c b/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c
index 81a584d0f95..3f7bc36202d 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.c
@@ -34,9 +34,17 @@ ctx_class_instance(mrb_state *mrb, mrb_value klass)
{
grn_ctx *ctx = (grn_ctx *)mrb->ud;
mrb_value mrb_ctx;
-
- mrb_ctx = mrb_obj_value(mrb_obj_alloc(mrb, MRB_TT_DATA, mrb_class_ptr(klass)));
- DATA_PTR(mrb_ctx) = ctx;
+ mrb_sym iv_name;
+
+ iv_name = mrb_intern_lit(mrb, "@instance");
+ mrb_ctx = mrb_iv_get(mrb, klass, iv_name);
+ if (mrb_nil_p(mrb_ctx)) {
+ struct RBasic *raw_mrb_ctx;
+ raw_mrb_ctx = mrb_obj_alloc(mrb, MRB_TT_DATA, mrb_class_ptr(klass));
+ mrb_ctx = mrb_obj_value(raw_mrb_ctx);
+ DATA_PTR(mrb_ctx) = ctx;
+ mrb_iv_set(mrb, klass, iv_name, mrb_ctx);
+ }
return mrb_ctx;
}
@@ -180,6 +188,471 @@ ctx_set_error_message(mrb_state *mrb, mrb_value self)
}
void
+grn_mrb_ctx_check(mrb_state *mrb)
+{
+ grn_ctx *ctx = (grn_ctx *)mrb->ud;
+ grn_mrb_data *data = &(ctx->impl->mrb);
+ struct RClass *module = data->module;
+ struct RClass *error_class;
+#define MESSAGE_SIZE 4096
+ char message[MESSAGE_SIZE];
+
+ switch (ctx->rc) {
+ case GRN_SUCCESS:
+ return;
+ case GRN_END_OF_DATA:
+ error_class = mrb_class_get_under(mrb, module, "EndOfData");
+ snprintf(message, MESSAGE_SIZE,
+ "end of data: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_UNKNOWN_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "UnknownError");
+ snprintf(message, MESSAGE_SIZE,
+ "unknown error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_OPERATION_NOT_PERMITTED:
+ error_class = mrb_class_get_under(mrb, module, "OperationNotPermitted");
+ snprintf(message, MESSAGE_SIZE,
+ "operation not permitted: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_SUCH_FILE_OR_DIRECTORY:
+ error_class = mrb_class_get_under(mrb, module, "NoSuchFileOrDirectory");
+ snprintf(message, MESSAGE_SIZE,
+ "no such file or directory: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_SUCH_PROCESS:
+ error_class = mrb_class_get_under(mrb, module, "NoSuchProcess");
+ snprintf(message, MESSAGE_SIZE,
+ "no such process: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INTERRUPTED_FUNCTION_CALL:
+ error_class = mrb_class_get_under(mrb, module, "InterruptedFunctionCall");
+ snprintf(message, MESSAGE_SIZE,
+ "interrupted function call: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INPUT_OUTPUT_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "InputOutputError");
+ snprintf(message, MESSAGE_SIZE,
+ "input output error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_SUCH_DEVICE_OR_ADDRESS:
+ error_class = mrb_class_get_under(mrb, module, "NoSuchDeviceOrAddress");
+ snprintf(message, MESSAGE_SIZE,
+ "no such device or address: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_ARG_LIST_TOO_LONG:
+ error_class = mrb_class_get_under(mrb, module, "ArgListTooLong");
+ snprintf(message, MESSAGE_SIZE,
+ "arg list too long: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_EXEC_FORMAT_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "ExecFormatError");
+ snprintf(message, MESSAGE_SIZE,
+ "exec format error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_BAD_FILE_DESCRIPTOR:
+ error_class = mrb_class_get_under(mrb, module, "BadFileDescriptor");
+ snprintf(message, MESSAGE_SIZE,
+ "bad file descriptor: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_CHILD_PROCESSES:
+ error_class = mrb_class_get_under(mrb, module, "NoChildProcesses");
+ snprintf(message, MESSAGE_SIZE,
+ "no child processes: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RESOURCE_TEMPORARILY_UNAVAILABLE:
+ error_class = mrb_class_get_under(mrb, module,
+ "ResourceTemporarilyUnavailable");
+ snprintf(message, MESSAGE_SIZE,
+ "resource temporarily unavailable: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NOT_ENOUGH_SPACE:
+ error_class = mrb_class_get_under(mrb, module, "NotEnoughSpace");
+ snprintf(message, MESSAGE_SIZE,
+ "not enough space: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_PERMISSION_DENIED:
+ error_class = mrb_class_get_under(mrb, module, "PermissionDenied");
+ snprintf(message, MESSAGE_SIZE,
+ "permission denied: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_BAD_ADDRESS:
+ error_class = mrb_class_get_under(mrb, module, "BadAddress");
+ snprintf(message, MESSAGE_SIZE,
+ "bad address: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RESOURCE_BUSY:
+ error_class = mrb_class_get_under(mrb, module, "ResourceBusy");
+ snprintf(message, MESSAGE_SIZE,
+ "resource busy: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_FILE_EXISTS:
+ error_class = mrb_class_get_under(mrb, module, "FileExists");
+ snprintf(message, MESSAGE_SIZE,
+ "file exists: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_IMPROPER_LINK:
+ error_class = mrb_class_get_under(mrb, module, "ImproperLink");
+ snprintf(message, MESSAGE_SIZE,
+ "improper link: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_SUCH_DEVICE:
+ error_class = mrb_class_get_under(mrb, module, "NoSuchDevice");
+ snprintf(message, MESSAGE_SIZE,
+ "no such device: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NOT_A_DIRECTORY:
+ error_class = mrb_class_get_under(mrb, module, "NotDirectory");
+ snprintf(message, MESSAGE_SIZE,
+ "not directory: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_IS_A_DIRECTORY:
+ error_class = mrb_class_get_under(mrb, module, "IsDirectory");
+ snprintf(message, MESSAGE_SIZE,
+ "is directory: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INVALID_ARGUMENT:
+ error_class = mrb_class_get_under(mrb, module, "InvalidArgument");
+ snprintf(message, MESSAGE_SIZE,
+ "invalid argument: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_MANY_OPEN_FILES_IN_SYSTEM:
+ error_class = mrb_class_get_under(mrb, module, "TooManyOpenFilesInSystem");
+ snprintf(message, MESSAGE_SIZE,
+ "too many open files in system: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_MANY_OPEN_FILES:
+ error_class = mrb_class_get_under(mrb, module, "TooManyOpenFiles");
+ snprintf(message, MESSAGE_SIZE,
+ "too many open files: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INAPPROPRIATE_I_O_CONTROL_OPERATION:
+ error_class = mrb_class_get_under(mrb, module,
+ "InappropriateIOControlOperation");
+ snprintf(message, MESSAGE_SIZE,
+ "inappropriate IO control operation: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_FILE_TOO_LARGE:
+ error_class = mrb_class_get_under(mrb, module, "FileTooLarge");
+ snprintf(message, MESSAGE_SIZE,
+ "file too large: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_SPACE_LEFT_ON_DEVICE:
+ error_class = mrb_class_get_under(mrb, module, "NoSpaceLeftOnDevice");
+ snprintf(message, MESSAGE_SIZE,
+ "no space left on device: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INVALID_SEEK:
+ error_class = mrb_class_get_under(mrb, module, "InvalidSeek");
+ snprintf(message, MESSAGE_SIZE,
+ "invalid seek: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_READ_ONLY_FILE_SYSTEM:
+ error_class = mrb_class_get_under(mrb, module, "ReadOnlyFileSystem");
+ snprintf(message, MESSAGE_SIZE,
+ "read only file system: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_MANY_LINKS:
+ error_class = mrb_class_get_under(mrb, module, "TooManyLinks");
+ snprintf(message, MESSAGE_SIZE,
+ "too many links: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_BROKEN_PIPE:
+ error_class = mrb_class_get_under(mrb, module, "BrokenPipe");
+ snprintf(message, MESSAGE_SIZE,
+ "broken pipe: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_DOMAIN_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "DomainError");
+ snprintf(message, MESSAGE_SIZE,
+ "domain error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RESULT_TOO_LARGE:
+ error_class = mrb_class_get_under(mrb, module, "ResultTooLarge");
+ snprintf(message, MESSAGE_SIZE,
+ "result too large: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RESOURCE_DEADLOCK_AVOIDED:
+ error_class = mrb_class_get_under(mrb, module, "ResourceDeadlockAvoided");
+ snprintf(message, MESSAGE_SIZE,
+ "resource deadlock avoided: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_MEMORY_AVAILABLE:
+ error_class = mrb_class_get_under(mrb, module, "NoMemoryAvailable");
+ snprintf(message, MESSAGE_SIZE,
+ "no memory available: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_FILENAME_TOO_LONG:
+ error_class = mrb_class_get_under(mrb, module, "FilenameTooLong");
+ snprintf(message, MESSAGE_SIZE,
+ "filename too long: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_LOCKS_AVAILABLE:
+ error_class = mrb_class_get_under(mrb, module, "NoLocksAvailable");
+ snprintf(message, MESSAGE_SIZE,
+ "no locks available: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_FUNCTION_NOT_IMPLEMENTED:
+ error_class = mrb_class_get_under(mrb, module, "FunctionNotImplemented");
+ snprintf(message, MESSAGE_SIZE,
+ "function not implemented: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_DIRECTORY_NOT_EMPTY:
+ error_class = mrb_class_get_under(mrb, module, "DirectoryNotEmpty");
+ snprintf(message, MESSAGE_SIZE,
+ "directory not empty: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_ILLEGAL_BYTE_SEQUENCE:
+ error_class = mrb_class_get_under(mrb, module, "IllegalByteSequence");
+ snprintf(message, MESSAGE_SIZE,
+ "illegal byte sequence: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_SOCKET_NOT_INITIALIZED:
+ error_class = mrb_class_get_under(mrb, module, "SocketNotInitialized");
+ snprintf(message, MESSAGE_SIZE,
+ "socket not initialized: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_OPERATION_WOULD_BLOCK:
+ error_class = mrb_class_get_under(mrb, module, "OperationWouldBlock");
+ snprintf(message, MESSAGE_SIZE,
+ "operation would block: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_ADDRESS_IS_NOT_AVAILABLE:
+ error_class = mrb_class_get_under(mrb, module, "AddressIsNotAvailable");
+ snprintf(message, MESSAGE_SIZE,
+ "address is not available: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NETWORK_IS_DOWN:
+ error_class = mrb_class_get_under(mrb, module, "NetworkIsDown");
+ snprintf(message, MESSAGE_SIZE,
+ "network is down: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NO_BUFFER:
+ error_class = mrb_class_get_under(mrb, module, "NoBuffer");
+ snprintf(message, MESSAGE_SIZE,
+ "no buffer: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_SOCKET_IS_ALREADY_CONNECTED:
+ error_class = mrb_class_get_under(mrb, module, "SocketIsAlreadyConnected");
+ snprintf(message, MESSAGE_SIZE,
+ "socket is already connected: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_SOCKET_IS_NOT_CONNECTED:
+ error_class = mrb_class_get_under(mrb, module, "SocketIsNotConnected");
+ snprintf(message, MESSAGE_SIZE,
+ "socket is not connected: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_SOCKET_IS_ALREADY_SHUTDOWNED:
+ error_class = mrb_class_get_under(mrb, module, "SocketIsAlreadyShutdowned");
+ snprintf(message, MESSAGE_SIZE,
+ "socket is already shutdowned: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_OPERATION_TIMEOUT:
+ error_class = mrb_class_get_under(mrb, module, "OperationTimeout");
+ snprintf(message, MESSAGE_SIZE,
+ "operation timeout: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_CONNECTION_REFUSED:
+ error_class = mrb_class_get_under(mrb, module, "ConnectionRefused");
+ snprintf(message, MESSAGE_SIZE,
+ "connection refused: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RANGE_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "RangeError");
+ snprintf(message, MESSAGE_SIZE,
+ "range error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOKENIZER_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "TokenizerError");
+ snprintf(message, MESSAGE_SIZE,
+ "tokenizer error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_FILE_CORRUPT:
+ error_class = mrb_class_get_under(mrb, module, "FileCorrupt");
+ snprintf(message, MESSAGE_SIZE,
+ "file corrupt: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INVALID_FORMAT:
+ error_class = mrb_class_get_under(mrb, module, "InvalidFormat");
+ snprintf(message, MESSAGE_SIZE,
+ "invalid format: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_OBJECT_CORRUPT:
+ error_class = mrb_class_get_under(mrb, module, "ObjectCorrupt");
+ snprintf(message, MESSAGE_SIZE,
+ "object corrupt: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_MANY_SYMBOLIC_LINKS:
+ error_class = mrb_class_get_under(mrb, module, "TooManySymbolicLinks");
+ snprintf(message, MESSAGE_SIZE,
+ "too many symbolic links: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NOT_SOCKET:
+ error_class = mrb_class_get_under(mrb, module, "NotSocket");
+ snprintf(message, MESSAGE_SIZE,
+ "not socket: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_OPERATION_NOT_SUPPORTED:
+ error_class = mrb_class_get_under(mrb, module, "OperationNotSupported");
+ snprintf(message, MESSAGE_SIZE,
+ "operation not supported: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_ADDRESS_IS_IN_USE:
+ error_class = mrb_class_get_under(mrb, module, "AddressIsInUse");
+ snprintf(message, MESSAGE_SIZE,
+ "address is in use: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_ZLIB_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "ZlibError");
+ snprintf(message, MESSAGE_SIZE,
+ "zlib error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_LZO_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "LzoError");
+ snprintf(message, MESSAGE_SIZE,
+ "LZO error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_STACK_OVER_FLOW:
+ error_class = mrb_class_get_under(mrb, module, "StackOverFlow");
+ snprintf(message, MESSAGE_SIZE,
+ "stack over flow: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_SYNTAX_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "SyntaxError");
+ snprintf(message, MESSAGE_SIZE,
+ "syntax error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_RETRY_MAX:
+ error_class = mrb_class_get_under(mrb, module, "RetryMax");
+ snprintf(message, MESSAGE_SIZE,
+ "retry max: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_INCOMPATIBLE_FILE_FORMAT:
+ error_class = mrb_class_get_under(mrb, module, "IncompatibleFileFormat");
+ snprintf(message, MESSAGE_SIZE,
+ "incompatible file format: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_UPDATE_NOT_ALLOWED:
+ error_class = mrb_class_get_under(mrb, module, "UpdateNotAllowed");
+ snprintf(message, MESSAGE_SIZE,
+ "update not allowed: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_SMALL_OFFSET:
+ error_class = mrb_class_get_under(mrb, module, "TooSmallOffset");
+ snprintf(message, MESSAGE_SIZE,
+ "too small offset: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_LARGE_OFFSET:
+ error_class = mrb_class_get_under(mrb, module, "TooLargeOffset");
+ snprintf(message, MESSAGE_SIZE,
+ "too large offset: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_TOO_SMALL_LIMIT:
+ error_class = mrb_class_get_under(mrb, module, "TooSmallLimit");
+ snprintf(message, MESSAGE_SIZE,
+ "too small limit: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_CAS_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "CASError");
+ snprintf(message, MESSAGE_SIZE,
+ "CAS error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_UNSUPPORTED_COMMAND_VERSION:
+ error_class = mrb_class_get_under(mrb, module, "UnsupportedCommandVersion");
+ snprintf(message, MESSAGE_SIZE,
+ "unsupported command version: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ case GRN_NORMALIZER_ERROR:
+ error_class = mrb_class_get_under(mrb, module, "NormalizerError");
+ snprintf(message, MESSAGE_SIZE,
+ "normalizer error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ default:
+ error_class = mrb_class_get_under(mrb, module, "Error");
+ snprintf(message, MESSAGE_SIZE,
+ "unsupported error: <%s>(%d)",
+ ctx->errbuf, ctx->rc);
+ break;
+ }
+#undef MESSAGE_SIZE
+
+ mrb_raise(mrb, error_class, message);
+}
+
+void
grn_mrb_ctx_init(grn_ctx *ctx)
{
grn_mrb_data *data = &(ctx->impl->mrb);
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h b/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h
index f620f941c93..5068d0d75e2 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_ctx.h
@@ -26,6 +26,9 @@ extern "C" {
#endif
void grn_mrb_ctx_init(grn_ctx *ctx);
+#ifdef GRN_WITH_MRUBY
+void grn_mrb_ctx_check(mrb_state *mrb);
+#endif
#ifdef __cplusplus
}
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.c b/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.c
new file mode 100644
index 00000000000..2f45cfc736e
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.c
@@ -0,0 +1,185 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2014 Brazil
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../ctx_impl.h"
+
+#ifdef GRN_WITH_MRUBY
+#include <mruby.h>
+
+#include "../mrb.h"
+#include "mrb_error.h"
+
+void
+grn_mrb_error_init(grn_ctx *ctx)
+{
+ grn_mrb_data *data = &(ctx->impl->mrb);
+ mrb_state *mrb = data->state;
+ struct RClass *module = data->module;
+ struct RClass *error_class;
+
+ error_class = mrb_define_class_under(mrb, module, "Error",
+ mrb->eStandardError_class);
+
+ mrb_define_class_under(mrb, module, "EndOfData",
+ error_class);
+ mrb_define_class_under(mrb, module, "UnknownError",
+ error_class);
+ mrb_define_class_under(mrb, module, "OperationNotPermitted",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoSuchFileOrDirectory",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoSuchProcess",
+ error_class);
+ mrb_define_class_under(mrb, module, "InterruptedFunctionCall",
+ error_class);
+ mrb_define_class_under(mrb, module, "InputOutputError",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoSuchDeviceOrAddress",
+ error_class);
+ mrb_define_class_under(mrb, module, "ArgListTooLong",
+ error_class);
+ mrb_define_class_under(mrb, module, "ExecFormatError",
+ error_class);
+ mrb_define_class_under(mrb, module, "BadFileDescriptor",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoChildProcesses",
+ error_class);
+ mrb_define_class_under(mrb, module, "ResourceTemporarilyUnavailable",
+ error_class);
+ mrb_define_class_under(mrb, module, "NotEnoughSpace",
+ error_class);
+ mrb_define_class_under(mrb, module, "PermissionDenied",
+ error_class);
+ mrb_define_class_under(mrb, module, "BadAddress",
+ error_class);
+ mrb_define_class_under(mrb, module, "ResourceBusy",
+ error_class);
+ mrb_define_class_under(mrb, module, "FileExists",
+ error_class);
+ mrb_define_class_under(mrb, module, "ImproperLink",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoSuchDevice",
+ error_class);
+ mrb_define_class_under(mrb, module, "NotDirectory",
+ error_class);
+ mrb_define_class_under(mrb, module, "IsDirectory",
+ error_class);
+ mrb_define_class_under(mrb, module, "InvalidArgument",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooManyOpenFilesInSystem",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooManyOpenFiles",
+ error_class);
+ mrb_define_class_under(mrb, module, "InappropriateIOControlOperation",
+ error_class);
+ mrb_define_class_under(mrb, module, "FileTooLarge",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoSpaceLeftOnDevice",
+ error_class);
+ mrb_define_class_under(mrb, module, "InvalidSeek",
+ error_class);
+ mrb_define_class_under(mrb, module, "ReadOnlyFileSystem",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooManyLinks",
+ error_class);
+ mrb_define_class_under(mrb, module, "BrokenPipe",
+ error_class);
+ mrb_define_class_under(mrb, module, "DomainError",
+ error_class);
+ mrb_define_class_under(mrb, module, "ResultTooLarge",
+ error_class);
+ mrb_define_class_under(mrb, module, "ResourceDeadlockAvoided",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoMemoryAvailable",
+ error_class);
+ mrb_define_class_under(mrb, module, "FilenameTooLong",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoLocksAvailable",
+ error_class);
+ mrb_define_class_under(mrb, module, "FunctionNotImplemented",
+ error_class);
+ mrb_define_class_under(mrb, module, "DirectoryNotEmpty",
+ error_class);
+ mrb_define_class_under(mrb, module, "IllegalByteSequence",
+ error_class);
+ mrb_define_class_under(mrb, module, "SocketNotInitialized",
+ error_class);
+ mrb_define_class_under(mrb, module, "OperationWouldBlock",
+ error_class);
+ mrb_define_class_under(mrb, module, "AddressIsNotAvailable",
+ error_class);
+ mrb_define_class_under(mrb, module, "NetworkIsDown",
+ error_class);
+ mrb_define_class_under(mrb, module, "NoBuffer",
+ error_class);
+ mrb_define_class_under(mrb, module, "SocketIsAlreadyConnected",
+ error_class);
+ mrb_define_class_under(mrb, module, "SocketIsNotConnected",
+ error_class);
+ mrb_define_class_under(mrb, module, "SocketIsAlreadyShutdowned",
+ error_class);
+ mrb_define_class_under(mrb, module, "OperationTimeout",
+ error_class);
+ mrb_define_class_under(mrb, module, "ConnectionRefused",
+ error_class);
+ mrb_define_class_under(mrb, module, "RangeError",
+ error_class);
+ mrb_define_class_under(mrb, module, "TokenizerError",
+ error_class);
+ mrb_define_class_under(mrb, module, "FileCorrupt",
+ error_class);
+ mrb_define_class_under(mrb, module, "InvalidFormat",
+ error_class);
+ mrb_define_class_under(mrb, module, "ObjectCorrupt",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooManySymbolicLinks",
+ error_class);
+ mrb_define_class_under(mrb, module, "NotSocket",
+ error_class);
+ mrb_define_class_under(mrb, module, "OperationNotSupported",
+ error_class);
+ mrb_define_class_under(mrb, module, "AddressIsInUse",
+ error_class);
+ mrb_define_class_under(mrb, module, "ZlibError",
+ error_class);
+ mrb_define_class_under(mrb, module, "LzoError",
+ error_class);
+ mrb_define_class_under(mrb, module, "StackOverFlow",
+ error_class);
+ mrb_define_class_under(mrb, module, "SyntaxError",
+ error_class);
+ mrb_define_class_under(mrb, module, "RetryMax",
+ error_class);
+ mrb_define_class_under(mrb, module, "IncompatibleFileFormat",
+ error_class);
+ mrb_define_class_under(mrb, module, "UpdateNotAllowed",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooSmallOffset",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooLargeOffset",
+ error_class);
+ mrb_define_class_under(mrb, module, "TooSmallLimit",
+ error_class);
+ mrb_define_class_under(mrb, module, "CASError",
+ error_class);
+ mrb_define_class_under(mrb, module, "UnsupportedCommandVersion",
+ error_class);
+ mrb_define_class_under(mrb, module, "NormalizerError",
+ error_class);
+}
+#endif
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.h b/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.h
new file mode 100644
index 00000000000..c59fabc12af
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_error.h
@@ -0,0 +1,34 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2014 Brazil
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef GRN_MRB_ERROR_H
+#define GRN_MRB_ERROR_H
+
+#include "../ctx.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void grn_mrb_error_init(grn_ctx *ctx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRN_MRB_ERROR_H */
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c b/storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c
index b9fb35020cb..3d0499c6b5c 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_expr.c
@@ -23,12 +23,14 @@
#include <mruby/class.h>
#include <mruby/variable.h>
#include <mruby/data.h>
+#include <mruby/string.h>
#include <mruby/array.h>
#include "../expr.h"
#include "../util.h"
#include "../mrb.h"
#include "mrb_accessor.h"
+#include "mrb_ctx.h"
#include "mrb_expr.h"
#include "mrb_converter.h"
@@ -231,6 +233,29 @@ mrb_grn_scan_info_get_max_interval(mrb_state *mrb, mrb_value self)
}
static mrb_value
+mrb_grn_scan_info_set_similarity_threshold(mrb_state *mrb, mrb_value self)
+{
+ scan_info *si;
+ int similarity_threshold;
+
+ mrb_get_args(mrb, "i", &similarity_threshold);
+ si = DATA_PTR(self);
+ grn_scan_info_set_similarity_threshold(si, similarity_threshold);
+ return self;
+}
+
+static mrb_value
+mrb_grn_scan_info_get_similarity_threshold(mrb_state *mrb, mrb_value self)
+{
+ scan_info *si;
+ int similarity_threshold;
+
+ si = DATA_PTR(self);
+ similarity_threshold = grn_scan_info_get_similarity_threshold(si);
+ return mrb_fixnum_value(similarity_threshold);
+}
+
+static mrb_value
mrb_grn_scan_info_get_arg(mrb_state *mrb, mrb_value self)
{
grn_ctx *ctx = (grn_ctx *)mrb->ud;
@@ -339,6 +364,51 @@ mrb_grn_expression_get_var_by_offset(mrb_state *mrb, mrb_value self)
return grn_mrb_value_from_grn_obj(mrb, var);
}
+static mrb_value
+mrb_grn_expression_take_object(mrb_state *mrb, mrb_value self)
+{
+ grn_ctx *ctx = (grn_ctx *)mrb->ud;
+ grn_obj *expr;
+ mrb_value mrb_object;
+ grn_obj *grn_object;
+
+ mrb_get_args(mrb, "o", &mrb_object);
+ expr = DATA_PTR(self);
+ grn_object = DATA_PTR(mrb_object);
+ grn_expr_take_obj(ctx, expr, grn_object);
+
+ return mrb_object;
+}
+
+static mrb_value
+mrb_grn_expression_allocate_constant(mrb_state *mrb, mrb_value self)
+{
+ grn_ctx *ctx = (grn_ctx *)mrb->ud;
+ grn_obj *expr;
+ mrb_value mrb_object;
+ grn_obj *grn_object;
+
+ mrb_get_args(mrb, "o", &mrb_object);
+ expr = DATA_PTR(self);
+
+ switch (mrb_type(mrb_object)) {
+ case MRB_TT_STRING:
+ grn_object = grn_expr_alloc_const(ctx, expr);
+ if (!grn_object) {
+ grn_mrb_ctx_check(mrb);
+ }
+ GRN_TEXT_INIT(grn_object, 0);
+ GRN_TEXT_SET(ctx, grn_object,
+ RSTRING_PTR(mrb_object), RSTRING_LEN(mrb_object));
+ break;
+ default:
+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "unsupported type: %S", mrb_object);
+ break;
+ }
+
+ return grn_mrb_value_from_grn_obj(mrb, grn_object);
+}
+
void
grn_mrb_expr_init(grn_ctx *ctx)
{
@@ -373,6 +443,10 @@ grn_mrb_expr_init(grn_ctx *ctx)
mrb_grn_scan_info_get_max_interval, MRB_ARGS_NONE());
mrb_define_method(mrb, klass, "max_interval=",
mrb_grn_scan_info_set_max_interval, MRB_ARGS_REQ(1));
+ mrb_define_method(mrb, klass, "similarity_threshold",
+ mrb_grn_scan_info_get_similarity_threshold, MRB_ARGS_NONE());
+ mrb_define_method(mrb, klass, "similarity_threshold=",
+ mrb_grn_scan_info_set_similarity_threshold, MRB_ARGS_REQ(1));
mrb_define_method(mrb, klass, "get_arg",
mrb_grn_scan_info_get_arg, MRB_ARGS_REQ(1));
mrb_define_method(mrb, klass, "push_arg",
@@ -400,6 +474,10 @@ grn_mrb_expr_init(grn_ctx *ctx)
mrb_grn_expression_codes, MRB_ARGS_NONE());
mrb_define_method(mrb, klass, "get_var_by_offset",
mrb_grn_expression_get_var_by_offset, MRB_ARGS_REQ(1));
+ mrb_define_method(mrb, klass, "take_object",
+ mrb_grn_expression_take_object, MRB_ARGS_REQ(1));
+ mrb_define_method(mrb, klass, "allocate_constant",
+ mrb_grn_expression_allocate_constant, MRB_ARGS_REQ(1));
grn_mrb_load(ctx, "expression.rb");
grn_mrb_load(ctx, "scan_info.rb");
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c b/storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c
index de3bf678c00..142a242b980 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c
+++ b/storage/mroonga/vendor/groonga/lib/mrb/mrb_obj.c
@@ -91,6 +91,26 @@ object_grn_inspect(mrb_state *mrb, mrb_value self)
return inspected;
}
+static mrb_value
+object_equal(mrb_state *mrb, mrb_value self)
+{
+ grn_obj *object, *other_object;
+ mrb_value mrb_other;
+
+ mrb_get_args(mrb, "o", &mrb_other);
+ if (!mrb_obj_is_kind_of(mrb, mrb_other, mrb_obj_class(mrb, self))) {
+ return mrb_false_value();
+ }
+
+ object = DATA_PTR(self);
+ other_object = DATA_PTR(mrb_other);
+ if (object == other_object) {
+ return mrb_true_value();
+ } else {
+ return mrb_false_value();
+ }
+}
+
void
grn_mrb_obj_init(grn_ctx *ctx)
{
@@ -108,6 +128,7 @@ grn_mrb_obj_init(grn_ctx *ctx)
object_find_index, MRB_ARGS_REQ(1));
mrb_define_method(mrb, klass, "grn_inspect",
object_grn_inspect, MRB_ARGS_NONE());
+ mrb_define_method(mrb, klass, "==", object_equal, MRB_ARGS_REQ(1));
grn_mrb_load(ctx, "index_info.rb");
}
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb
index 9977d9bd8d7..cf0056d7fd3 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb
+++ b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info.rb
@@ -16,6 +16,9 @@ module Groonga
if data.max_interval
self.max_interval = data.max_interval
end
+ if data.similarity_threshold
+ self.similarity_threshold = data.similarity_threshold
+ end
data.args.each do |arg|
push_arg(arg)
end
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb
index 0d88f4027aa..5e258e90e5a 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb
+++ b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_builder.rb
@@ -123,7 +123,7 @@ module Groonga
put_logical_op(@operator, n_codes)
end
- @data_list
+ optimize
end
private
@@ -239,5 +239,109 @@ module Groonga
end
end
end
+
+ def optimize
+ optimized_data_list = []
+ i = 0
+ n = @data_list.size
+ while i < n
+ data = @data_list[i]
+ next_data = @data_list[i + 1]
+ i += 1
+ if next_data.nil?
+ optimized_data_list << data
+ next
+ end
+ if range_operations?(data, next_data)
+ between_data = create_between_data(data, next_data)
+ optimized_data_list << between_data
+ i += 1
+ next
+ end
+ optimized_data_list << data
+ end
+ optimized_data_list
+ end
+
+ def range_operations?(data, next_data)
+ return false unless next_data.logical_op == Operator::AND
+
+ op, next_op = data.op, next_data.op
+ return false if !(lower_condition?(op) or lower_condition?(next_op))
+ return false if !(upper_condition?(op) or upper_condition?(next_op))
+
+ return false if data.args[0] != next_data.args[0]
+
+ data_indexes = data.indexes
+ return false if data_indexes.empty?
+
+ data_indexes == next_data.indexes
+ end
+
+ def lower_condition?(operator)
+ case operator
+ when Operator::GREATER, Operator::GREATER_EQUAL
+ true
+ else
+ false
+ end
+ end
+
+ def upper_condition?(operator)
+ case operator
+ when Operator::LESS, Operator::LESS_EQUAL
+ true
+ else
+ false
+ end
+ end
+
+ def create_between_data(data, next_data)
+ between_data = ScanInfoData.new(data.start)
+ between_data.end = next_data.end + 1
+ between_data.flags = data.flags
+ between_data.op = Operator::CALL
+ between_data.logical_op = data.logical_op
+ between_data.args = create_between_data_args(data, next_data)
+ between_data.indexes = data.indexes
+ between_data
+ end
+
+ def create_between_data_args(data, next_data)
+ between = Context.instance["between"]
+ @expression.take_object(between)
+ column = data.args[0]
+ op, next_op = data.op, next_data.op
+ if lower_condition?(op)
+ min = data.args[1]
+ min_operator = op
+ max = next_data.args[1]
+ max_operator = next_op
+ else
+ min = next_data.args[1]
+ min_operator = next_op
+ max = data.args[1]
+ max_operator = op
+ end
+ if min_operator == Operator::GREATER
+ min_border = "exclude"
+ else
+ min_border = "include"
+ end
+ if max_operator == Operator::LESS
+ max_border = "exclude"
+ else
+ max_border = "include"
+ end
+
+ [
+ between,
+ column,
+ min,
+ @expression.allocate_constant(min_border),
+ max,
+ @expression.allocate_constant(max_border),
+ ]
+ end
end
end
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb
index 87eb9ed4937..67d0bc3aef7 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb
+++ b/storage/mroonga/vendor/groonga/lib/mrb/scripts/scan_info_data.rb
@@ -9,6 +9,7 @@ module Groonga
attr_accessor :indexes
attr_accessor :flags
attr_accessor :max_interval
+ attr_accessor :similarity_threshold
def initialize(start)
@start = start
@end = 0
@@ -19,11 +20,14 @@ module Groonga
@indexes = []
@flags = ScanInfo::Flags::PUSH
@max_interval = nil
+ @similarity_threshold = nil
end
def match_resolve_index
if near_search?
match_near_resolve_index
+ elsif similar_search?
+ match_similar_resolve_index
else
match_generic_resolve_index
end
@@ -60,6 +64,29 @@ module Groonga
self.max_interval = @args[2].value
end
+ def similar_search?
+ @op == Operator::SIMILAR and @args.size == 3
+ end
+
+ def match_similar_resolve_index
+ arg = @args[0]
+ case arg
+ when Expression
+ match_resolve_index_expression(arg)
+ when Accessor
+ match_resolve_index_accessor(arg)
+ when Object
+ match_resolve_index_db_obj(arg)
+ else
+ message =
+ "The first argument of SIMILAR must be Expression, Accessor or Object: #{arg.class}"
+ raise message
+ end
+
+ self.query = @args[1]
+ self.similarity_threshold = @args[2].value
+ end
+
def match_generic_resolve_index
@args.each do |arg|
case arg
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/sources.am b/storage/mroonga/vendor/groonga/lib/mrb/sources.am
index 858b2205d4f..947607c7ecd 100644
--- a/storage/mroonga/vendor/groonga/lib/mrb/sources.am
+++ b/storage/mroonga/vendor/groonga/lib/mrb/sources.am
@@ -9,6 +9,8 @@ libgrnmrb_la_SOURCES = \
mrb_converter.h \
mrb_ctx.c \
mrb_ctx.h \
+ mrb_error.c \
+ mrb_error.h \
mrb_expr.c \
mrb_expr.h \
mrb_fixed_size_column.c \
diff --git a/storage/mroonga/vendor/groonga/lib/output.c b/storage/mroonga/vendor/groonga/lib/output.c
index 19bfd73819d..9b745c89a01 100644
--- a/storage/mroonga/vendor/groonga/lib/output.c
+++ b/storage/mroonga/vendor/groonga/lib/output.c
@@ -1411,6 +1411,7 @@ grn_output_obj(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
break;
case GRN_TABLE_HASH_KEY :
case GRN_TABLE_PAT_KEY :
+ case GRN_TABLE_DAT_KEY :
case GRN_TABLE_NO_KEY :
grn_output_table(ctx, outbuf, output_type, obj, format);
break;
diff --git a/storage/mroonga/vendor/groonga/lib/pat.c b/storage/mroonga/vendor/groonga/lib/pat.c
index 4ca2ffc42e0..5b03e6132e9 100644
--- a/storage/mroonga/vendor/groonga/lib/pat.c
+++ b/storage/mroonga/vendor/groonga/lib/pat.c
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009-2012 Brazil
+/* Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -432,6 +432,7 @@ _grn_pat_create(grn_ctx *ctx, grn_pat *pat,
pat->normalizer = NULL;
header->normalizer = GRN_ID_NIL;
}
+ GRN_PTR_INIT(&(pat->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
pat->io = io;
pat->header = header;
pat->key_size = key_size;
@@ -533,6 +534,7 @@ grn_pat_open(grn_ctx *ctx, const char *path)
} else {
pat->normalizer = grn_ctx_at(ctx, header->normalizer);
}
+ GRN_PTR_INIT(&(pat->token_filters), GRN_OBJ_VECTOR, GRN_ID_NIL);
pat->obj.header.flags = header->flags;
PAT_AT(pat, 0, node0);
if (!node0) {
@@ -552,6 +554,7 @@ grn_pat_close(grn_ctx *ctx, grn_pat *pat)
if ((rc = grn_io_close(ctx, pat->io))) {
ERR(rc, "grn_io_close failed");
} else {
+ GRN_OBJ_FIN(ctx, &(pat->token_filters));
if (pat->cache) { grn_pat_cache_disable(ctx, pat); }
GRN_FREE(pat);
}
diff --git a/storage/mroonga/vendor/groonga/lib/pat.h b/storage/mroonga/vendor/groonga/lib/pat.h
index 09e1fa87992..d2d10322c7c 100644
--- a/storage/mroonga/vendor/groonga/lib/pat.h
+++ b/storage/mroonga/vendor/groonga/lib/pat.h
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009 Brazil
+/* Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,7 @@ struct _grn_pat {
uint32_t value_size;
grn_obj *tokenizer;
grn_obj *normalizer;
+ grn_obj token_filters;
grn_id *cache;
uint32_t cache_size;
};
diff --git a/storage/mroonga/vendor/groonga/lib/plugin.c b/storage/mroonga/vendor/groonga/lib/plugin.c
index 26e4a3d5165..3483cc9a5b0 100644
--- a/storage/mroonga/vendor/groonga/lib/plugin.c
+++ b/storage/mroonga/vendor/groonga/lib/plugin.c
@@ -375,7 +375,6 @@ grn_plugin_get_system_plugins_dir(void)
if (!win32_plugins_dir) {
const char *base_dir;
const char *relative_path = GRN_RELATIVE_PLUGINS_DIR;
- char *path;
size_t base_dir_length;
base_dir = grn_win32_base_dir();
diff --git a/storage/mroonga/vendor/groonga/lib/proc.c b/storage/mroonga/vendor/groonga/lib/proc.c
index e1473472f55..37b7ae67d35 100644
--- a/storage/mroonga/vendor/groonga/lib/proc.c
+++ b/storage/mroonga/vendor/groonga/lib/proc.c
@@ -1102,6 +1102,12 @@ grn_parse_column_create_flags(grn_ctx *ctx, const char *nptr, const char *end)
} else if (!memcmp(nptr, "COLUMN_INDEX", 12)) {
flags |= GRN_OBJ_COLUMN_INDEX;
nptr += 12;
+ } else if (!memcmp(nptr, "COMPRESS_ZLIB", 13)) {
+ flags |= GRN_OBJ_COMPRESS_ZLIB;
+ nptr += 13;
+ } else if (!memcmp(nptr, "COMPRESS_LZO", 12)) {
+ flags |= GRN_OBJ_COMPRESS_LZO;
+ nptr += 12;
} else if (!memcmp(nptr, "WITH_SECTION", 12)) {
flags |= GRN_OBJ_WITH_SECTION;
nptr += 12;
@@ -1194,6 +1200,116 @@ grn_column_create_flags_to_text(grn_ctx *ctx, grn_obj *buf, grn_obj_flags flags)
}
}
+static grn_bool
+proc_table_create_set_token_filters_put(grn_ctx *ctx,
+ grn_obj *token_filters,
+ const char *token_filter_name,
+ int token_filter_name_length)
+{
+ grn_obj *token_filter;
+
+ token_filter = grn_ctx_get(ctx,
+ token_filter_name,
+ token_filter_name_length);
+ if (token_filter) {
+ GRN_PTR_PUT(ctx, token_filters, token_filter);
+ return GRN_TRUE;
+ } else {
+ ERR(GRN_INVALID_ARGUMENT,
+ "[table][create][token-filter] nonexistent token filter: <%.*s>",
+ token_filter_name_length, token_filter_name);
+ return GRN_FALSE;
+ }
+}
+
+static grn_bool
+proc_table_create_set_token_filters_fill(grn_ctx *ctx,
+ grn_obj *token_filters,
+ grn_obj *token_filter_names)
+{
+ const char *start, *current, *end;
+ const char *name_start, *name_end;
+ const char *last_name_end;
+
+ start = GRN_TEXT_VALUE(token_filter_names);
+ end = start + GRN_TEXT_LEN(token_filter_names);
+ current = start;
+ name_start = NULL;
+ name_end = NULL;
+ last_name_end = start;
+ while (current < end) {
+ switch (current[0]) {
+ case ' ' :
+ if (name_start && !name_end) {
+ name_end = current;
+ }
+ break;
+ case ',' :
+ if (!name_start) {
+ goto break_loop;
+ }
+ if (!name_end) {
+ name_end = current;
+ }
+ proc_table_create_set_token_filters_put(ctx,
+ token_filters,
+ name_start,
+ name_end - name_start);
+ last_name_end = name_end + 1;
+ name_start = NULL;
+ name_end = NULL;
+ break;
+ default :
+ if (!name_start) {
+ name_start = current;
+ }
+ break;
+ }
+ current++;
+ }
+
+break_loop:
+ if (!name_start) {
+ ERR(GRN_INVALID_ARGUMENT,
+ "[table][create][token-filter] empty token filter name: "
+ "<%.*s|%.*s|%.*s>",
+ (int)(last_name_end - start), start,
+ (int)(current - last_name_end), last_name_end,
+ (int)(end - current), current);
+ return GRN_FALSE;
+ }
+
+ if (!name_end) {
+ name_end = current;
+ }
+ proc_table_create_set_token_filters_put(ctx,
+ token_filters,
+ name_start,
+ name_end - name_start);
+
+ return GRN_TRUE;
+}
+
+static void
+proc_table_create_set_token_filters(grn_ctx *ctx,
+ grn_obj *table,
+ grn_obj *token_filter_names)
+{
+ grn_obj token_filters;
+
+ if (GRN_TEXT_LEN(token_filter_names) == 0) {
+ return;
+ }
+
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, 0);
+ if (proc_table_create_set_token_filters_fill(ctx,
+ &token_filters,
+ token_filter_names)) {
+ grn_obj_set_info(ctx, table, GRN_INFO_TOKEN_FILTERS, &token_filters);
+ }
+ grn_obj_unlink(ctx, &token_filters);
+}
+
static grn_obj *
proc_table_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
{
@@ -1251,6 +1367,7 @@ proc_table_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_d
GRN_TEXT_VALUE(normalizer_name),
GRN_TEXT_LEN(normalizer_name)));
}
+ proc_table_create_set_token_filters(ctx, table, VAR(6));
grn_obj_unlink(ctx, table);
}
} else {
@@ -1316,9 +1433,104 @@ exit:
return NULL;
}
+static grn_rc
+proc_column_create_resolve_source_name(grn_ctx *ctx,
+ grn_obj *table,
+ const char *source_name,
+ int source_name_length,
+ grn_obj *source_ids)
+{
+ grn_obj *column;
+
+ column = grn_obj_column(ctx, table, source_name, source_name_length);
+ if (!column) {
+ ERR(GRN_INVALID_ARGUMENT,
+ "[column][create] nonexistent source: <%.*s>",
+ source_name_length, source_name);
+ return ctx->rc;
+ }
+
+ if (column->header.type == GRN_ACCESSOR) {
+ if (strncmp(source_name, "_key", source_name_length) == 0) {
+ grn_id source_id = grn_obj_id(ctx, table);
+ GRN_UINT32_PUT(ctx, source_ids, source_id);
+ } else {
+ ERR(GRN_INVALID_ARGUMENT,
+ "[column][create] pseudo column except <_key> is invalid: <%.*s>",
+ source_name_length, source_name);
+ }
+ } else {
+ grn_id source_id = grn_obj_id(ctx, column);
+ GRN_UINT32_PUT(ctx, source_ids, source_id);
+ }
+ grn_obj_unlink(ctx, column);
+
+ return ctx->rc;
+}
+
+static grn_rc
+proc_column_create_resolve_source_names(grn_ctx *ctx,
+ grn_obj *table,
+ grn_obj *source_names,
+ grn_obj *source_ids)
+{
+ int i, names_length;
+ int start, source_name_length;
+ const char *names;
+
+ names = GRN_TEXT_VALUE(source_names);
+ start = 0;
+ source_name_length = 0;
+ names_length = GRN_TEXT_LEN(source_names);
+ for (i = 0; i < names_length; i++) {
+ switch (names[i]) {
+ case ' ' :
+ if (source_name_length == 0) {
+ start++;
+ }
+ break;
+ case ',' :
+ {
+ grn_rc rc;
+ const char *source_name = names + start;
+ rc = proc_column_create_resolve_source_name(ctx,
+ table,
+ source_name,
+ source_name_length,
+ source_ids);
+ if (rc) {
+ return rc;
+ }
+ start = i + 1;
+ source_name_length = 0;
+ }
+ break;
+ default :
+ source_name_length++;
+ break;
+ }
+ }
+
+ if (source_name_length > 0) {
+ grn_rc rc;
+ const char *source_name = names + start;
+ rc = proc_column_create_resolve_source_name(ctx,
+ table,
+ source_name,
+ source_name_length,
+ source_ids);
+ if (rc) {
+ return rc;
+ }
+ }
+
+ return GRN_SUCCESS;
+}
+
static grn_obj *
proc_column_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
{
+ grn_bool succeeded = GRN_TRUE;
grn_obj *column, *table = NULL, *type = NULL;
const char *rest;
grn_obj_flags flags = grn_atoi(GRN_TEXT_VALUE(VAR(2)),
@@ -1326,13 +1538,17 @@ proc_column_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_
if (GRN_TEXT_VALUE(VAR(2)) == rest) {
flags = grn_parse_column_create_flags(ctx, GRN_TEXT_VALUE(VAR(2)),
GRN_BULK_CURR(VAR(2)));
- if (ctx->rc) { goto exit; }
+ if (ctx->rc) {
+ succeeded = GRN_FALSE;
+ goto exit;
+ }
}
table = grn_ctx_get(ctx, GRN_TEXT_VALUE(VAR(0)), GRN_TEXT_LEN(VAR(0)));
if (!table) {
ERR(GRN_INVALID_ARGUMENT,
"[column][create] table doesn't exist: <%.*s>",
(int)GRN_TEXT_LEN(VAR(0)), GRN_TEXT_VALUE(VAR(0)));
+ succeeded = GRN_FALSE;
goto exit;
}
type = grn_ctx_get(ctx, GRN_TEXT_VALUE(VAR(3)),
@@ -1341,12 +1557,14 @@ proc_column_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_
ERR(GRN_INVALID_ARGUMENT,
"[column][create] type doesn't exist: <%.*s>",
(int)GRN_TEXT_LEN(VAR(3)), GRN_TEXT_VALUE(VAR(3))) ;
+ succeeded = GRN_FALSE;
goto exit;
}
if (GRN_TEXT_LEN(VAR(1))) {
flags |= GRN_OBJ_PERSISTENT;
} else {
ERR(GRN_INVALID_ARGUMENT, "[column][create] name is missing");
+ succeeded = GRN_FALSE;
goto exit;
}
column = grn_column_create(ctx, table,
@@ -1355,36 +1573,30 @@ proc_column_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_
NULL, flags, type);
if (column) {
if (GRN_TEXT_LEN(VAR(4))) {
- grn_obj sources, source_ids, **p, **pe;
- GRN_PTR_INIT(&sources, GRN_OBJ_VECTOR, GRN_ID_NIL);
+ grn_rc rc;
+ grn_obj source_ids;
GRN_UINT32_INIT(&source_ids, GRN_OBJ_VECTOR);
- grn_obj_columns(ctx, type,
- GRN_TEXT_VALUE(VAR(4)),
- GRN_TEXT_LEN(VAR(4)),
- &sources);
- p = (grn_obj **)GRN_BULK_HEAD(&sources);
- pe = (grn_obj **)GRN_BULK_CURR(&sources);
- for (; p < pe; p++) {
- grn_id source_id = grn_obj_id(ctx, *p);
- if ((*p)->header.type == GRN_ACCESSOR) {
- /* todo : if "_key" assigned */
- source_id = grn_obj_id(ctx, type);
- }
- if (source_id) {
- GRN_UINT32_PUT(ctx, &source_ids, source_id);
- }
- grn_obj_unlink(ctx, *p);
- }
- if (GRN_BULK_VSIZE(&source_ids)) {
+ rc = proc_column_create_resolve_source_names(ctx,
+ type,
+ VAR(4),
+ &source_ids);
+ if (!rc && GRN_BULK_VSIZE(&source_ids)) {
grn_obj_set_info(ctx, column, GRN_INFO_SOURCE, &source_ids);
+ rc = ctx->rc;
}
GRN_OBJ_FIN(ctx, &source_ids);
- GRN_OBJ_FIN(ctx, &sources);
+ if (rc) {
+ grn_obj_remove(ctx, column);
+ succeeded = GRN_FALSE;
+ goto exit;
+ }
}
grn_obj_unlink(ctx, column);
+ } else {
+ succeeded = GRN_FALSE;
}
exit:
- GRN_OUTPUT_BOOL(!ctx->rc);
+ GRN_OUTPUT_BOOL(succeeded);
if (table) { grn_obj_unlink(ctx, table); }
if (type) { grn_obj_unlink(ctx, type); }
return NULL;
@@ -2544,6 +2756,26 @@ dump_table(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table,
GRN_TEXT_PUTS(ctx, outbuf, " --normalizer ");
dump_obj_name(ctx, outbuf, normalizer);
}
+ if (table->header.type != GRN_TABLE_NO_KEY) {
+ grn_obj token_filters;
+ int n_token_filters;
+
+ GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, GRN_ID_NIL);
+ grn_obj_get_info(ctx, table, GRN_INFO_TOKEN_FILTERS, &token_filters);
+ n_token_filters = GRN_BULK_VSIZE(&token_filters) / sizeof(grn_obj *);
+ if (n_token_filters > 0) {
+ int i;
+ GRN_TEXT_PUTS(ctx, outbuf, " --token_filters ");
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter = GRN_PTR_VALUE_AT(&token_filters, i);
+ if (i > 0) {
+ GRN_TEXT_PUTC(ctx, outbuf, ',');
+ }
+ dump_obj_name(ctx, outbuf, token_filter);
+ }
+ }
+ GRN_OBJ_FIN(ctx, &token_filters);
+ }
GRN_TEXT_PUTC(ctx, outbuf, '\n');
@@ -3274,17 +3506,18 @@ static void
tokenize(grn_ctx *ctx, grn_hash *lexicon, grn_obj *string, grn_token_mode mode,
unsigned int flags, grn_obj *tokens)
{
- grn_token *token;
+ grn_token_cursor *token_cursor;
- token = grn_token_open(ctx, (grn_obj *)lexicon,
- GRN_TEXT_VALUE(string), GRN_TEXT_LEN(string),
- mode, flags);
- if (!token) {
+ token_cursor =
+ grn_token_cursor_open(ctx, (grn_obj *)lexicon,
+ GRN_TEXT_VALUE(string), GRN_TEXT_LEN(string),
+ mode, flags);
+ if (!token_cursor) {
return;
}
- while (token->status == GRN_TOKEN_DOING) {
- grn_id token_id = grn_token_next(ctx, token);
+ while (token_cursor->status == GRN_TOKEN_DOING) {
+ grn_id token_id = grn_token_cursor_next(ctx, token_cursor);
tokenize_token *current_token;
if (token_id == GRN_ID_NIL) {
continue;
@@ -3292,9 +3525,9 @@ tokenize(grn_ctx *ctx, grn_hash *lexicon, grn_obj *string, grn_token_mode mode,
grn_bulk_space(ctx, tokens, sizeof(tokenize_token));
current_token = ((tokenize_token *)(GRN_BULK_CURR(tokens))) - 1;
current_token->id = token_id;
- current_token->position = token->pos;
+ current_token->position = token_cursor->pos;
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
static grn_obj *
@@ -3348,15 +3581,16 @@ proc_tokenize(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
GRN_OBJ_FIN(ctx, &tokens);
} else if (MODE_NAME_EQUAL("GET")) {
{
- grn_token *token;
- token = grn_token_open(ctx, (grn_obj *)lexicon,
- GRN_TEXT_VALUE(string), GRN_TEXT_LEN(string),
- GRN_TOKEN_ADD, flags);
- if (token) {
- while (token->status == GRN_TOKEN_DOING) {
- grn_token_next(ctx, token);
+ grn_token_cursor *token_cursor;
+ token_cursor =
+ grn_token_cursor_open(ctx, (grn_obj *)lexicon,
+ GRN_TEXT_VALUE(string), GRN_TEXT_LEN(string),
+ GRN_TOKEN_ADD, flags);
+ if (token_cursor) {
+ while (token_cursor->status == GRN_TOKEN_DOING) {
+ grn_token_cursor_next(ctx, token_cursor);
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
}
@@ -5076,7 +5310,8 @@ grn_db_init_builtin_query(grn_ctx *ctx)
DEF_VAR(vars[3], "value_type");
DEF_VAR(vars[4], "default_tokenizer");
DEF_VAR(vars[5], "normalizer");
- DEF_COMMAND("table_create", proc_table_create, 6, vars);
+ DEF_VAR(vars[6], "token_filters");
+ DEF_COMMAND("table_create", proc_table_create, 7, vars);
DEF_VAR(vars[0], "name");
DEF_COMMAND("table_remove", proc_table_remove, 1, vars);
diff --git a/storage/mroonga/vendor/groonga/lib/snip.c b/storage/mroonga/vendor/groonga/lib/snip.c
index f5ed677b091..78c6ef54387 100644
--- a/storage/mroonga/vendor/groonga/lib/snip.c
+++ b/storage/mroonga/vendor/groonga/lib/snip.c
@@ -434,7 +434,7 @@ grn_snip_find_firstbyte(const char *string, grn_encoding encoding, size_t offset
offset += doffset;
break;
case GRN_ENC_UTF8:
- while (string[offset] <= (char)0xc0)
+ while ((signed char)string[offset] <= (signed char)0xc0)
offset += doffset;
break;
default:
diff --git a/storage/mroonga/vendor/groonga/lib/sources.am b/storage/mroonga/vendor/groonga/lib/sources.am
index 9e726b1607b..8b371081fe6 100644
--- a/storage/mroonga/vendor/groonga/lib/sources.am
+++ b/storage/mroonga/vendor/groonga/lib/sources.am
@@ -47,5 +47,6 @@ libgroonga_la_SOURCES = \
token.c \
token.h \
tokenizer.c \
+ token_filter.c \
util.c \
util.h
diff --git a/storage/mroonga/vendor/groonga/lib/store.c b/storage/mroonga/vendor/groonga/lib/store.c
index 041c01ec3f8..3649611a560 100644
--- a/storage/mroonga/vendor/groonga/lib/store.c
+++ b/storage/mroonga/vendor/groonga/lib/store.c
@@ -524,6 +524,7 @@ grn_ja_ref_raw(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *va
iw->size = 0;
iw->addr = NULL;
iw->pseg = pseg;
+ iw->value = NULL;
if (pseg != JA_ESEG_VOID) {
grn_ja_einfo *einfo = NULL;
GRN_IO_SEG_REF(ja->io, pseg, einfo);
@@ -556,9 +557,14 @@ grn_ja_ref_raw(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *va
grn_rc
grn_ja_unref(grn_ctx *ctx, grn_io_win *iw)
{
- if (!iw->addr) { return GRN_INVALID_ARGUMENT; }
- GRN_IO_SEG_UNREF(iw->io, iw->pseg);
- if (!iw->tiny_p) { grn_io_win_unmap2(iw); }
+ if (iw->value) {
+ GRN_FREE(iw->value);
+ iw->value = NULL;
+ } else {
+ if (!iw->addr) { return GRN_INVALID_ARGUMENT; }
+ GRN_IO_SEG_UNREF(iw->io, iw->pseg);
+ if (!iw->tiny_p) { grn_io_win_unmap2(iw); }
+ }
return GRN_SUCCESS;
}
@@ -858,6 +864,7 @@ grn_ja_alloc(grn_ctx *ctx, grn_ja *ja, grn_id id,
vp->seg = 0;
vp->pos = 0;
}
+ iw->value = NULL;
grn_io_unlock(ja->io);
return GRN_SUCCESS;
}
@@ -1176,12 +1183,11 @@ grn_ja_element_info(grn_ctx *ctx, grn_ja *ja, grn_id id,
static void *
grn_ja_ref_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *value_len)
{
- /* TODO: This function leaks a memory. The return value
- * must be freed. */
z_stream zstream;
- void *value, *zvalue;
+ void *zvalue;
uint32_t zvalue_len;
if (!(zvalue = grn_ja_ref_raw(ctx, ja, id, iw, &zvalue_len))) {
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
@@ -1190,29 +1196,33 @@ grn_ja_ref_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *v
zstream.zalloc = Z_NULL;
zstream.zfree = Z_NULL;
if (inflateInit2(&zstream, 15 /* windowBits */) != Z_OK) {
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
- if (!(value = GRN_MALLOC(*((uint64_t *)zvalue)))) {
+ if (!(iw->value = GRN_MALLOC(*((uint64_t *)zvalue)))) {
inflateEnd(&zstream);
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
- zstream.next_out = (Bytef *)value;
+ zstream.next_out = (Bytef *)iw->value;
zstream.avail_out = *(uint64_t *)zvalue;
if (inflate(&zstream, Z_FINISH) != Z_STREAM_END) {
inflateEnd(&zstream);
- GRN_FREE(value);
+ GRN_FREE(iw->value);
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
*value_len = zstream.total_out;
if (inflateEnd(&zstream) != Z_OK) {
- GRN_FREE(value);
+ GRN_FREE(iw->value);
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
- return value;
+ return iw->value;
}
#endif /* GRN_WITH_ZLIB */
@@ -1222,35 +1232,36 @@ grn_ja_ref_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *v
static void *
grn_ja_ref_lzo(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *value_len)
{
- /* TODO: This function leaks a memory. The return value
- * must be freed. */
- void *value, *lvalue;
+ void *lvalue;
uint32_t lvalue_len;
lzo_uint lout_len;
if (!(lvalue = grn_ja_ref_raw(ctx, ja, id, iw, &lvalue_len))) {
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
- if (!(value = GRN_MALLOC(*((uint64_t *)lvalue)))) {
+ if (!(iw->value = GRN_MALLOC(*((uint64_t *)lvalue)))) {
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
lout_len = *((uint64_t *)lvalue);
switch (lzo1x_decompress((lzo_bytep)(((uint64_t *)lvalue) + 1),
lvalue_len,
- (lzo_bytep)(value),
+ (lzo_bytep)(iw->value),
&lout_len,
NULL)) {
case LZO_E_OK :
case LZO_E_INPUT_NOT_CONSUMED :
break;
default :
- GRN_FREE(value);
+ GRN_FREE(iw->value);
+ iw->value = NULL;
*value_len = 0;
return NULL;
}
*value_len = lout_len;
- return value;
+ return iw->value;
}
#endif /* GRN_WITH_LZO */
diff --git a/storage/mroonga/vendor/groonga/lib/str.c b/storage/mroonga/vendor/groonga/lib/str.c
index 255f8020a7b..29e532a8021 100644
--- a/storage/mroonga/vendor/groonga/lib/str.c
+++ b/storage/mroonga/vendor/groonga/lib/str.c
@@ -2418,7 +2418,7 @@ grn_text_urlenc(grn_ctx *ctx, grn_obj *buf, const char *s, unsigned int len)
{
const char *e, c = '%';
for (e = s + len; s < e; s++) {
- if (*s < 0 || urlenc_tbl[(int)*s]) {
+ if ((signed char)*s < 0 || urlenc_tbl[(int)*s]) {
if (!grn_bulk_write(ctx, buf, &c, 1)) {
if (grn_text_itoh(ctx, buf, *s, 2)) {
GRN_BULK_INCR_LEN(buf, -1);
diff --git a/storage/mroonga/vendor/groonga/lib/token.c b/storage/mroonga/vendor/groonga/lib/token.c
index edce2edcb82..00b3de2ebdd 100644
--- a/storage/mroonga/vendor/groonga/lib/token.c
+++ b/storage/mroonga/vendor/groonga/lib/token.c
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
- Copyright(C) 2009-2012 Brazil
+ Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -495,32 +495,59 @@ grn_token_fin(void)
return GRN_SUCCESS;
}
-grn_token *
-grn_token_open(grn_ctx *ctx, grn_obj *table, const char *str, size_t str_len,
- grn_token_mode mode, unsigned int flags)
+static void
+grn_token_cursor_open_initialize_token_filters(grn_ctx *ctx,
+ grn_token_cursor *token_cursor)
{
- grn_token *token;
+ grn_obj *token_filters = token_cursor->token_filters;
+ unsigned int i, n_token_filters;
+
+ if (token_filters) {
+ n_token_filters = GRN_BULK_VSIZE(token_filters) / sizeof(grn_obj *);
+ } else {
+ n_token_filters = 0;
+ }
+
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter_object = GRN_PTR_VALUE_AT(token_filters, i);
+ grn_proc *token_filter = (grn_proc *)token_filter_object;
+
+ token_filter->user_data =
+ token_filter->callbacks.token_filter.init(ctx,
+ token_cursor->table,
+ token_cursor->mode);
+ }
+}
+
+grn_token_cursor *
+grn_token_cursor_open(grn_ctx *ctx, grn_obj *table,
+ const char *str, size_t str_len,
+ grn_token_mode mode, unsigned int flags)
+{
+ grn_token_cursor *token_cursor;
grn_encoding encoding;
grn_obj *tokenizer;
grn_obj *normalizer;
+ grn_obj *token_filters;
grn_obj_flags table_flags;
if (grn_table_get_info(ctx, table, &table_flags, &encoding, &tokenizer,
- &normalizer)) {
+ &normalizer, &token_filters)) {
return NULL;
}
- if (!(token = GRN_MALLOC(sizeof(grn_token)))) { return NULL; }
- token->table = table;
- token->mode = mode;
- token->encoding = encoding;
- token->tokenizer = tokenizer;
- token->orig = (const unsigned char *)str;
- token->orig_blen = str_len;
- token->curr = NULL;
- token->nstr = NULL;
- token->curr_size = 0;
- token->pos = -1;
- token->status = GRN_TOKEN_DOING;
- token->force_prefix = 0;
+ if (!(token_cursor = GRN_MALLOC(sizeof(grn_token_cursor)))) { return NULL; }
+ token_cursor->table = table;
+ token_cursor->mode = mode;
+ token_cursor->encoding = encoding;
+ token_cursor->tokenizer = tokenizer;
+ token_cursor->token_filters = token_filters;
+ token_cursor->orig = (const unsigned char *)str;
+ token_cursor->orig_blen = str_len;
+ token_cursor->curr = NULL;
+ token_cursor->nstr = NULL;
+ token_cursor->curr_size = 0;
+ token_cursor->pos = -1;
+ token_cursor->status = GRN_TOKEN_DOING;
+ token_cursor->force_prefix = 0;
if (tokenizer) {
grn_obj str_, flags_, mode_;
GRN_TEXT_INIT(&str_, GRN_OBJ_DO_SHALLOW_COPY);
@@ -529,104 +556,175 @@ grn_token_open(grn_ctx *ctx, grn_obj *table, const char *str, size_t str_len,
GRN_UINT32_SET(ctx, &flags_, flags);
GRN_UINT32_INIT(&mode_, 0);
GRN_UINT32_SET(ctx, &mode_, mode);
- token->pctx.caller = NULL;
- token->pctx.user_data.ptr = NULL;
- token->pctx.proc = (grn_proc *)tokenizer;
- token->pctx.hooks = NULL;
- token->pctx.currh = NULL;
- token->pctx.phase = PROC_INIT;
+ token_cursor->pctx.caller = NULL;
+ token_cursor->pctx.user_data.ptr = NULL;
+ token_cursor->pctx.proc = (grn_proc *)tokenizer;
+ token_cursor->pctx.hooks = NULL;
+ token_cursor->pctx.currh = NULL;
+ token_cursor->pctx.phase = PROC_INIT;
grn_ctx_push(ctx, &mode_);
grn_ctx_push(ctx, &str_);
grn_ctx_push(ctx, &flags_);
- ((grn_proc *)tokenizer)->funcs[PROC_INIT](ctx, 1, &table, &token->pctx.user_data);
+ ((grn_proc *)tokenizer)->funcs[PROC_INIT](ctx, 1, &table, &token_cursor->pctx.user_data);
grn_obj_close(ctx, &flags_);
grn_obj_close(ctx, &str_);
grn_obj_close(ctx, &mode_);
} else {
int nflags = 0;
- token->nstr = grn_string_open_(ctx, str, str_len,
- normalizer, nflags, token->encoding);
- if (token->nstr) {
+ token_cursor->nstr = grn_string_open_(ctx, str, str_len,
+ normalizer,
+ nflags,
+ token_cursor->encoding);
+ if (token_cursor->nstr) {
const char *normalized;
- grn_string_get_normalized(ctx, token->nstr,
- &normalized, &(token->curr_size), NULL);
- token->curr = (const unsigned char *)normalized;
+ grn_string_get_normalized(ctx, token_cursor->nstr,
+ &normalized, &(token_cursor->curr_size), NULL);
+ token_cursor->curr = (const unsigned char *)normalized;
} else {
- ERR(GRN_TOKENIZER_ERROR, "grn_string_open failed at grn_token_open");
+ ERR(GRN_TOKENIZER_ERROR,
+ "[token-cursor][open] failed to grn_string_open()");
}
}
+
+ grn_token_cursor_open_initialize_token_filters(ctx, token_cursor);
+
if (ctx->rc) {
- grn_token_close(ctx, token);
- token = NULL;
+ grn_token_cursor_close(ctx, token_cursor);
+ token_cursor = NULL;
+ }
+ return token_cursor;
+}
+
+static int
+grn_token_cursor_next_apply_token_filters(grn_ctx *ctx,
+ grn_token_cursor *token_cursor,
+ grn_obj *current_token_data,
+ grn_obj *status)
+{
+ grn_obj *token_filters = token_cursor->token_filters;
+ unsigned int i, n_token_filters;
+ grn_token current_token;
+ grn_token next_token;
+
+ if (token_filters) {
+ n_token_filters = GRN_BULK_VSIZE(token_filters) / sizeof(grn_obj *);
+ } else {
+ n_token_filters = 0;
+ }
+
+ GRN_TEXT_INIT(&(current_token.data), GRN_OBJ_DO_SHALLOW_COPY);
+ GRN_TEXT_SET(ctx, &(current_token.data),
+ GRN_TEXT_VALUE(current_token_data),
+ GRN_TEXT_LEN(current_token_data));
+ current_token.status = GRN_INT32_VALUE(status);
+ GRN_TEXT_INIT(&(next_token.data), GRN_OBJ_DO_SHALLOW_COPY);
+ GRN_TEXT_SET(ctx, &(next_token.data),
+ GRN_TEXT_VALUE(&(current_token.data)),
+ GRN_TEXT_LEN(&(current_token.data)));
+ next_token.status = current_token.status;
+
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter_object = GRN_PTR_VALUE_AT(token_filters, i);
+ grn_proc *token_filter = (grn_proc *)token_filter_object;
+
+#define SKIP_FLAGS\
+ (GRN_TOKENIZER_TOKEN_SKIP |\
+ GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION)
+ if (current_token.status & SKIP_FLAGS) {
+ break;
+ }
+#undef SKIP_FLAGS
+
+ token_filter->callbacks.token_filter.filter(ctx,
+ &current_token,
+ &next_token,
+ token_filter->user_data);
+ GRN_TEXT_SET(ctx, &(current_token.data),
+ GRN_TEXT_VALUE(&(next_token.data)),
+ GRN_TEXT_LEN(&(next_token.data)));
+ current_token.status = next_token.status;
}
- return token;
+
+ token_cursor->curr =
+ (const unsigned char *)GRN_TEXT_VALUE(&(current_token.data));
+ token_cursor->curr_size = GRN_TEXT_LEN(&(current_token.data));
+
+ return current_token.status;
}
grn_id
-grn_token_next(grn_ctx *ctx, grn_token *token)
+grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor)
{
int status;
grn_id tid = GRN_ID_NIL;
- grn_obj *table = token->table;
- grn_obj *tokenizer = token->tokenizer;
- while (token->status != GRN_TOKEN_DONE) {
+ grn_obj *table = token_cursor->table;
+ grn_obj *tokenizer = token_cursor->tokenizer;
+ while (token_cursor->status != GRN_TOKEN_DONE) {
if (tokenizer) {
grn_obj *curr_, *stat_;
- ((grn_proc *)tokenizer)->funcs[PROC_NEXT](ctx, 1, &table, &token->pctx.user_data);
+ ((grn_proc *)tokenizer)->funcs[PROC_NEXT](ctx, 1, &table, &token_cursor->pctx.user_data);
stat_ = grn_ctx_pop(ctx);
curr_ = grn_ctx_pop(ctx);
- token->curr = (const unsigned char *)GRN_TEXT_VALUE(curr_);
- token->curr_size = GRN_TEXT_LEN(curr_);
- status = GRN_UINT32_VALUE(stat_);
- token->status = ((status & GRN_TOKENIZER_TOKEN_LAST) ||
- (token->mode == GRN_TOKEN_GET &&
- (status & GRN_TOKENIZER_TOKEN_REACH_END)))
+ status = grn_token_cursor_next_apply_token_filters(ctx, token_cursor,
+ curr_, stat_);
+ token_cursor->status =
+ ((status & GRN_TOKENIZER_TOKEN_LAST) ||
+ (token_cursor->mode == GRN_TOKEN_GET &&
+ (status & GRN_TOKENIZER_TOKEN_REACH_END)))
? GRN_TOKEN_DONE : GRN_TOKEN_DOING;
- token->force_prefix = 0;
- if (status & GRN_TOKENIZER_TOKEN_SKIP) {
- token->pos++;
- continue;
- } else if (status & GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION) {
- continue;
+ token_cursor->force_prefix = 0;
+#define SKIP_FLAGS \
+ (GRN_TOKENIZER_TOKEN_SKIP | GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION)
+ if (status & SKIP_FLAGS) {
+ if (status & GRN_TOKENIZER_TOKEN_SKIP) {
+ token_cursor->pos++;
+ }
+ if (token_cursor->status == GRN_TOKEN_DONE && tid == GRN_ID_NIL) {
+ token_cursor->status = GRN_TOKEN_DONE_SKIP;
+ break;
+ } else {
+ continue;
+ }
}
- if (token->curr_size == 0) {
+#undef SKIP_FLAGS
+ if (token_cursor->curr_size == 0) {
char tokenizer_name[GRN_TABLE_MAX_KEY_SIZE];
int tokenizer_name_length;
tokenizer_name_length =
- grn_obj_name(ctx, token->tokenizer,
+ grn_obj_name(ctx, token_cursor->tokenizer,
tokenizer_name, GRN_TABLE_MAX_KEY_SIZE);
GRN_LOG(ctx, GRN_WARN,
"[token_next] ignore an empty token: <%.*s>: <%.*s>",
tokenizer_name_length, tokenizer_name,
- token->orig_blen, token->orig);
+ token_cursor->orig_blen, token_cursor->orig);
continue;
}
- if (token->curr_size > GRN_TABLE_MAX_KEY_SIZE) {
+ if (token_cursor->curr_size > GRN_TABLE_MAX_KEY_SIZE) {
GRN_LOG(ctx, GRN_WARN,
"[token_next] ignore too long token. "
"Token must be less than or equal to %d: <%d>(<%.*s>)",
GRN_TABLE_MAX_KEY_SIZE,
- token->curr_size,
- token->curr_size, token->curr);
+ token_cursor->curr_size,
+ token_cursor->curr_size, token_cursor->curr);
continue;
}
if (status & GRN_TOKENIZER_TOKEN_UNMATURED) {
if (status & GRN_TOKENIZER_TOKEN_OVERLAP) {
- if (token->mode == GRN_TOKEN_GET) { token->pos++; continue; }
+ if (token_cursor->mode == GRN_TOKEN_GET) { token_cursor->pos++; continue; }
} else {
- if (status & GRN_TOKENIZER_TOKEN_LAST) { token->force_prefix = 1; }
+ if (status & GRN_TOKENIZER_TOKEN_LAST) { token_cursor->force_prefix = 1; }
}
}
} else {
- token->status = GRN_TOKEN_DONE;
+ token_cursor->status = GRN_TOKEN_DONE;
}
- if (token->mode == GRN_TOKEN_ADD) {
+ if (token_cursor->mode == GRN_TOKEN_ADD) {
switch (table->header.type) {
case GRN_TABLE_PAT_KEY :
if (grn_io_lock(ctx, ((grn_pat *)table)->io, grn_lock_timeout)) {
tid = GRN_ID_NIL;
} else {
- tid = grn_pat_add(ctx, (grn_pat *)table, token->curr, token->curr_size,
+ tid = grn_pat_add(ctx, (grn_pat *)table, token_cursor->curr, token_cursor->curr_size,
NULL, NULL);
grn_io_unlock(((grn_pat *)table)->io);
}
@@ -635,7 +733,7 @@ grn_token_next(grn_ctx *ctx, grn_token *token)
if (grn_io_lock(ctx, ((grn_dat *)table)->io, grn_lock_timeout)) {
tid = GRN_ID_NIL;
} else {
- tid = grn_dat_add(ctx, (grn_dat *)table, token->curr, token->curr_size,
+ tid = grn_dat_add(ctx, (grn_dat *)table, token_cursor->curr, token_cursor->curr_size,
NULL, NULL);
grn_io_unlock(((grn_dat *)table)->io);
}
@@ -644,14 +742,14 @@ grn_token_next(grn_ctx *ctx, grn_token *token)
if (grn_io_lock(ctx, ((grn_hash *)table)->io, grn_lock_timeout)) {
tid = GRN_ID_NIL;
} else {
- tid = grn_hash_add(ctx, (grn_hash *)table, token->curr, token->curr_size,
+ tid = grn_hash_add(ctx, (grn_hash *)table, token_cursor->curr, token_cursor->curr_size,
NULL, NULL);
grn_io_unlock(((grn_hash *)table)->io);
}
break;
case GRN_TABLE_NO_KEY :
- if (token->curr_size == sizeof(grn_id)) {
- tid = *((grn_id *)token->curr);
+ if (token_cursor->curr_size == sizeof(grn_id)) {
+ tid = *((grn_id *)token_cursor->curr);
} else {
tid = GRN_ID_NIL;
}
@@ -660,44 +758,65 @@ grn_token_next(grn_ctx *ctx, grn_token *token)
} else {
switch (table->header.type) {
case GRN_TABLE_PAT_KEY :
- tid = grn_pat_get(ctx, (grn_pat *)table, token->curr, token->curr_size, NULL);
+ tid = grn_pat_get(ctx, (grn_pat *)table, token_cursor->curr, token_cursor->curr_size, NULL);
break;
case GRN_TABLE_DAT_KEY :
- tid = grn_dat_get(ctx, (grn_dat *)table, token->curr, token->curr_size, NULL);
+ tid = grn_dat_get(ctx, (grn_dat *)table, token_cursor->curr, token_cursor->curr_size, NULL);
break;
case GRN_TABLE_HASH_KEY :
- tid = grn_hash_get(ctx, (grn_hash *)table, token->curr, token->curr_size, NULL);
+ tid = grn_hash_get(ctx, (grn_hash *)table, token_cursor->curr, token_cursor->curr_size, NULL);
break;
case GRN_TABLE_NO_KEY :
- if (token->curr_size == sizeof(grn_id)) {
- tid = *((grn_id *)token->curr);
+ if (token_cursor->curr_size == sizeof(grn_id)) {
+ tid = *((grn_id *)token_cursor->curr);
} else {
tid = GRN_ID_NIL;
}
break;
}
}
- if (tid == GRN_ID_NIL && token->status != GRN_TOKEN_DONE) {
- token->status = GRN_TOKEN_NOT_FOUND;
+ if (tid == GRN_ID_NIL && token_cursor->status != GRN_TOKEN_DONE) {
+ token_cursor->status = GRN_TOKEN_NOT_FOUND;
}
- token->pos++;
+ token_cursor->pos++;
break;
}
return tid;
}
+static void
+grn_token_cursor_close_token_filters(grn_ctx *ctx,
+ grn_token_cursor *token_cursor)
+{
+ grn_obj *token_filters = token_cursor->token_filters;
+ unsigned int i, n_token_filters;
+
+ if (token_filters) {
+ n_token_filters = GRN_BULK_VSIZE(token_filters) / sizeof(grn_obj *);
+ } else {
+ n_token_filters = 0;
+ }
+ for (i = 0; i < n_token_filters; i++) {
+ grn_obj *token_filter_object = GRN_PTR_VALUE_AT(token_filters, i);
+ grn_proc *token_filter = (grn_proc *)token_filter_object;
+
+ token_filter->callbacks.token_filter.fin(ctx, token_filter->user_data);
+ }
+}
+
grn_rc
-grn_token_close(grn_ctx *ctx, grn_token *token)
+grn_token_cursor_close(grn_ctx *ctx, grn_token_cursor *token_cursor)
{
- if (token) {
- if (token->tokenizer) {
- ((grn_proc *)token->tokenizer)->funcs[PROC_FIN](ctx, 1, &token->table,
- &token->pctx.user_data);
+ if (token_cursor) {
+ if (token_cursor->tokenizer) {
+ ((grn_proc *)token_cursor->tokenizer)->funcs[PROC_FIN](ctx, 1, &token_cursor->table,
+ &token_cursor->pctx.user_data);
}
- if (token->nstr) {
- grn_obj_close(ctx, token->nstr);
+ grn_token_cursor_close_token_filters(ctx, token_cursor);
+ if (token_cursor->nstr) {
+ grn_obj_close(ctx, token_cursor->nstr);
}
- GRN_FREE(token);
+ GRN_FREE(token_cursor);
return GRN_SUCCESS;
} else {
return GRN_INVALID_ARGUMENT;
diff --git a/storage/mroonga/vendor/groonga/lib/token.h b/storage/mroonga/vendor/groonga/lib/token.h
index f69e30d3aaf..868930758ba 100644
--- a/storage/mroonga/vendor/groonga/lib/token.h
+++ b/storage/mroonga/vendor/groonga/lib/token.h
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009 Brazil
+/* Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -33,22 +33,24 @@
#include "str.h"
#endif /* GRN_STR_H */
+#include <groonga/tokenizer.h>
+
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
- GRN_TOKEN_GET = 0,
- GRN_TOKEN_ADD,
- GRN_TOKEN_DEL
-} grn_token_mode;
-
-typedef enum {
GRN_TOKEN_DOING = 0,
GRN_TOKEN_DONE,
+ GRN_TOKEN_DONE_SKIP,
GRN_TOKEN_NOT_FOUND
} grn_token_status;
+struct _grn_token {
+ grn_obj data;
+ grn_tokenizer_status status;
+};
+
typedef struct {
grn_obj *table;
const unsigned char *orig;
@@ -63,9 +65,10 @@ typedef struct {
grn_encoding encoding;
grn_obj *tokenizer;
grn_proc_ctx pctx;
+ grn_obj *token_filters;
uint32_t variant;
grn_obj *nstr;
-} grn_token;
+} grn_token_cursor;
extern grn_obj *grn_token_uvector;
@@ -74,12 +77,13 @@ grn_rc grn_token_fin(void);
#define GRN_TOKEN_ENABLE_TOKENIZED_DELIMITER (0x01L<<0)
-GRN_API grn_token *grn_token_open(grn_ctx *ctx, grn_obj *table, const char *str,
- size_t str_len, grn_token_mode mode,
- unsigned int flags);
+GRN_API grn_token_cursor *grn_token_cursor_open(grn_ctx *ctx, grn_obj *table,
+ const char *str, size_t str_len,
+ grn_token_mode mode,
+ unsigned int flags);
-GRN_API grn_id grn_token_next(grn_ctx *ctx, grn_token *ng);
-GRN_API grn_rc grn_token_close(grn_ctx *ctx, grn_token *ng);
+GRN_API grn_id grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor);
+GRN_API grn_rc grn_token_cursor_close(grn_ctx *ctx, grn_token_cursor *token_cursor);
grn_rc grn_db_init_mecab_tokenizer(grn_ctx *ctx);
grn_rc grn_db_init_builtin_tokenizers(grn_ctx *ctx);
diff --git a/storage/mroonga/vendor/groonga/lib/token_filter.c b/storage/mroonga/vendor/groonga/lib/token_filter.c
new file mode 100644
index 00000000000..910bb9a5715
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/lib/token_filter.c
@@ -0,0 +1,59 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2014 Brazil
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <string.h>
+
+#include "groonga_in.h"
+#include "db.h"
+#include <groonga/token_filter.h>
+
+grn_rc
+grn_token_filter_register(grn_ctx *ctx,
+ const char *plugin_name_ptr,
+ int plugin_name_length,
+ grn_token_filter_init_func *init,
+ grn_token_filter_filter_func *filter,
+ grn_token_filter_fin_func *fin)
+{
+ if (plugin_name_length == -1) {
+ plugin_name_length = strlen(plugin_name_ptr);
+ }
+
+ {
+ grn_obj *token_filter_object = grn_proc_create(ctx,
+ plugin_name_ptr,
+ plugin_name_length,
+ GRN_PROC_TOKENIZER,
+ NULL, NULL, NULL, 0, NULL);
+ if (token_filter_object == NULL) {
+ GRN_PLUGIN_ERROR(ctx, GRN_TOKEN_FILTER_ERROR,
+ "[token-filter][%.*s] failed to grn_proc_create()",
+ plugin_name_length, plugin_name_ptr);
+ return ctx->rc;
+ }
+
+ {
+ grn_proc *token_filter = (grn_proc *)token_filter_object;
+ token_filter->callbacks.token_filter.init = init;
+ token_filter->callbacks.token_filter.filter = filter;
+ token_filter->callbacks.token_filter.fin = fin;
+ }
+ }
+
+ return GRN_SUCCESS;
+}
diff --git a/storage/mroonga/vendor/groonga/lib/tokenizer.c b/storage/mroonga/vendor/groonga/lib/tokenizer.c
index 37d22789663..ac4628ba5de 100644
--- a/storage/mroonga/vendor/groonga/lib/tokenizer.c
+++ b/storage/mroonga/vendor/groonga/lib/tokenizer.c
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
- Copyright(C) 2012 Brazil
+ Copyright(C) 2012-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -148,7 +148,7 @@ grn_tokenizer_query_open(grn_ctx *ctx, int num_args, grn_obj **args,
return NULL;
}
grn_table_get_info(ctx, table, &table_flags, &table_encoding, NULL,
- &normalizer);
+ &normalizer, NULL);
{
grn_obj *normalized_query;
if (table_flags & GRN_OBJ_KEY_NORMALIZE) {
@@ -318,3 +318,59 @@ grn_tokenizer_register(grn_ctx *ctx, const char *plugin_name_ptr,
}
return GRN_SUCCESS;
}
+
+grn_obj *
+grn_token_get_data(grn_ctx *ctx, grn_token *token)
+{
+ GRN_API_ENTER;
+ if (!token) {
+ ERR(GRN_INVALID_ARGUMENT, "token must not be NULL");
+ GRN_API_RETURN(NULL);
+ }
+ GRN_API_RETURN(&(token->data));
+}
+
+grn_rc
+grn_token_set_data(grn_ctx *ctx,
+ grn_token *token,
+ const char *str_ptr,
+ int str_length)
+{
+ GRN_API_ENTER;
+ if (!token) {
+ ERR(GRN_INVALID_ARGUMENT, "token must not be NULL");
+ goto exit;
+ }
+ if (str_length == -1) {
+ str_length = strlen(str_ptr);
+ }
+ GRN_TEXT_SET(ctx, &(token->data), str_ptr, str_length);
+exit:
+ GRN_API_RETURN(ctx->rc);
+}
+
+grn_tokenizer_status
+grn_token_get_status(grn_ctx *ctx, grn_token *token)
+{
+ GRN_API_ENTER;
+ if (!token) {
+ ERR(GRN_INVALID_ARGUMENT, "token must not be NULL");
+ GRN_API_RETURN(GRN_TOKENIZER_TOKEN_CONTINUE);
+ }
+ GRN_API_RETURN(token->status);
+}
+
+grn_rc
+grn_token_set_status(grn_ctx *ctx,
+ grn_token *token,
+ grn_tokenizer_status status)
+{
+ GRN_API_ENTER;
+ if (!token) {
+ ERR(GRN_INVALID_ARGUMENT, "token must not be NULL");
+ goto exit;
+ }
+ token->status = status;
+exit:
+ GRN_API_RETURN(ctx->rc);
+}
diff --git a/storage/mroonga/vendor/groonga/lib/util.c b/storage/mroonga/vendor/groonga/lib/util.c
index 62794abb856..67f0ff32125 100644
--- a/storage/mroonga/vendor/groonga/lib/util.c
+++ b/storage/mroonga/vendor/groonga/lib/util.c
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2010-2013 Brazil
+/* Copyright(C) 2010-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -251,6 +251,9 @@ grn_proc_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
case GRN_PROC_NORMALIZER :
GRN_TEXT_PUTS(ctx, buf, "normalizer");
break;
+ case GRN_PROC_TOKEN_FILTER :
+ GRN_TEXT_PUTS(ctx, buf, "token-filter");
+ break;
}
GRN_TEXT_PUTS(ctx, buf, " ");
@@ -294,7 +297,7 @@ grn_vector_inspect(grn_ctx *ctx, grn_obj *buffer, grn_obj *vector)
grn_obj value_object;
GRN_OBJ_INIT(&value_object, GRN_BULK, GRN_OBJ_DO_SHALLOW_COPY,
section->domain);
- grn_bulk_write(ctx, &value_object, value_raw, section->length);
+ GRN_TEXT_SET(ctx, &value_object, value_raw, section->length);
grn_inspect(ctx, buffer, &value_object);
GRN_OBJ_FIN(ctx, &value_object);
}
diff --git a/storage/mroonga/vendor/groonga/nginx_version b/storage/mroonga/vendor/groonga/nginx_version
index 10c088013f8..de28578affc 100644
--- a/storage/mroonga/vendor/groonga/nginx_version
+++ b/storage/mroonga/vendor/groonga/nginx_version
@@ -1 +1 @@
-1.7.4
+1.7.6
diff --git a/storage/mroonga/vendor/groonga/packages/apt/Makefile.am b/storage/mroonga/vendor/groonga/packages/apt/Makefile.am
index 3a6a00a4628..484cb3f8fb6 100644
--- a/storage/mroonga/vendor/groonga/packages/apt/Makefile.am
+++ b/storage/mroonga/vendor/groonga/packages/apt/Makefile.am
@@ -1,8 +1,7 @@
REPOSITORIES_PATH = repositories
DISTRIBUTIONS = debian
-CHROOT_BASE = /var/lib/chroot
ARCHITECTURES = i386 amd64
-CODES = wheezy jessie unstable
+CODE_NAMES = wheezy
KEYRING_PACKAGE = groonga-keyring
KEYRING_VERSION = 2012.05.29
KEYRING_BASE_NAME = $(KEYRING_PACKAGE)-$(KEYRING_VERSION)
@@ -31,14 +30,14 @@ download: ensure-rsync-path
done
sign-packages:
- ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
update-repository:
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
- '$(ARCHITECTURES)' '$(CODES)'
+ '$(ARCHITECTURES)' '$(CODE_NAMES)'
sign-repository:
- ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
@@ -49,31 +48,51 @@ upload: ensure-rsync-path
build: build-package-deb build-keyring-deb
-build-package-deb: source
- ./build-in-chroot.sh \
- $(PACKAGE) $(VERSION) $(srcdir)/.. $(REPOSITORIES_PATH)/ \
- $(CHROOT_BASE) '$(ARCHITECTURES)' '$(CODES)'
+run-vagrant:
+ vagrant destroy --force
+ for architecture in $(ARCHITECTURES); do \
+ for code_name in $(CODE_NAMES); do \
+ id=debian-$$code_name-$$architecture; \
+ vagrant up $$id || exit 1; \
+ vagrant destroy --force $$id; \
+ done; \
+ done
+
+build-package-deb: prepare-build-package-deb
+ $(MAKE) run-vagrant
+
+prepare-build-package-deb: source env.sh
+ cp env.sh tmp/
+ rm -rf tmp/debian
+ cp -rp $(srcdir)/../debian/ tmp/
+
+source: tmp/$(PACKAGE)-$(VERSION).tar.gz
-build-keyring-deb: keyring-source
- ./build-in-chroot.sh \
- $(KEYRING_PACKAGE) $(KEYRING_VERSION) $(srcdir) \
- $(REPOSITORIES_PATH)/ $(CHROOT_BASE) \
- '$(ARCHITECTURES)' '$(CODES)'
+tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
+ mkdir -p tmp/
+ cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
-source: ../$(PACKAGE)-$(VERSION).tar.gz
-../$(PACKAGE)-$(VERSION).tar.gz:
- ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../
+build-keyring-deb: prepare-build-keyring-deb
+ $(MAKE) run-vagrant
-keyring-source: $(KEYRING_BASE_NAME).tar.gz
+keyring-source: tmp/$(KEYRING_BASE_NAME).tar.gz
ensure-public-key:
gpg --list-keys '$(GPG_UID)' > /dev/null || \
gpg --keyserver keyserver.ubuntu.com --recv-key '$(GPG_UID)'
-$(KEYRING_BASE_NAME).tar.gz: ensure-public-key
+tmp/$(KEYRING_BASE_NAME).tar.gz: ensure-public-key
rm -rf $(KEYRING_BASE_NAME)
mkdir -p $(KEYRING_BASE_NAME)
gpg --armor --export '$(GPG_UID)' > \
$(KEYRING_BASE_NAME)/groonga-keyring.gpg
- tar cvzf $(KEYRING_BASE_NAME).tar.gz $(KEYRING_BASE_NAME)
+ mkdir -p tmp/
+ tar cvzf tmp/$(KEYRING_BASE_NAME).tar.gz $(KEYRING_BASE_NAME)
+
+prepare-build-keyring-deb: keyring-source
+ echo "PACKAGE=$(KEYRING_PACKAGE)" > tmp/env.sh
+ echo "VERSION=$(KEYRING_VERSION)" >> tmp/env.sh
+ echo "DEPENDED_PACKAGES='gnupg'" >> tmp/env.sh
+ rm -rf tmp/debian
+ cp -a $(srcdir)/debian/ tmp/
diff --git a/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile b/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile
new file mode 100644
index 00000000000..e1c41785dd8
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile
@@ -0,0 +1,33 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ vms = [
+ {
+ :id => "debian-wheezy-i386",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6-i386_chef-provisionerless.box
+",
+ },
+ {
+ :id => "debian-wheezy-amd64",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6_chef-provisionerless.box",
+ },
+ ]
+
+ vms.each do |vm|
+ config.vm.define(vm[:id]) do |node|
+ node.vm.box = vm[:id]
+ node.vm.box_url = vm[:box_url]
+ hour_in_seconds = 60 * 60
+ node.vm.boot_timeout = 1 * hour_in_seconds
+ node.vm.provision(:shell, :privileged => false, :path => "build-deb.sh")
+ node.vm.provider("virtualbox") do |virtual_box|
+ virtual_box.memory = 512
+ virtual_box.customize ["modifyvm", :id, "--hwvirtex", "off"]
+ end
+ end
+ end
+end
diff --git a/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh b/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh
index 1f5a5b03985..ec6789e2be5 100755
--- a/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh
+++ b/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh
@@ -2,114 +2,50 @@
LANG=C
-PACKAGE=$(cat /tmp/build-package)
-USER_NAME=$(cat /tmp/build-user)
-VERSION=$(cat /tmp/build-version)
-DEPENDED_PACKAGES=$(cat /tmp/depended-packages)
-BUILD_SCRIPT=/tmp/build-deb-in-chroot.sh
-
run()
{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
+ "$@"
+ if test $? -ne 0; then
+ echo "Failed $@"
+ exit 1
+ fi
}
-if [ ! -x /usr/bin/lsb_release ]; then
- run apt-get update
- run apt-get install -y lsb-release
-fi
-
-distribution=$(lsb_release --id --short)
-code_name=$(lsb_release --codename --short)
-
-security_list=/etc/apt/sources.list.d/security.list
-if [ ! -f "${security_list}" ]; then
- case ${distribution} in
- Debian)
- if [ "${code_name}" = "sid" ]; then
- touch "${security_list}"
- else
- cat <<EOF > "${security_list}"
-deb http://security.debian.org/ ${code_name}/updates main
-deb-src http://security.debian.org/ ${code_name}/updates main
-EOF
- fi
- ;;
- Ubuntu)
- cat <<EOF > "${security_list}"
-deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
-deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
-EOF
- ;;
- esac
-fi
+. /vagrant/tmp/env.sh
-sources_list=/etc/apt/sources.list
-if [ "$distribution" = "Ubuntu" ] && \
- ! (grep '^deb' $sources_list | grep -q universe); then
- run sed -i'' -e 's/main$/main universe/g' $sources_list
-fi
+swap_file=/tmp/swap
+run sudo dd if=/dev/zero of="$swap_file" bs=1024 count=4096K
+run sudo mkswap "$swap_file"
+run sudo swapon "$swap_file"
-if [ ! -x /usr/bin/aptitude ]; then
- run apt-get update
- run apt-get install -y aptitude
-fi
-run aptitude update -V -D
-run aptitude safe-upgrade -V -D -y
+run sudo apt-get update
+run sudo apt-get install -y lsb-release
-run aptitude install -V -D -y ruby
-
-if aptitude show libmsgpack-dev > /dev/null 2>&1; then
- DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libmsgpack-dev"
-else
- ruby -i'' -ne 'print $_ unless /libmsgpack/' /tmp/${PACKAGE}-debian/control
-fi
-
-case $(lsb_release -s -c) in
- jessie|sid)
- DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libzmq3-dev"
- ;;
- *)
- DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libzmq-dev"
- ;;
+distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
+code_name=$(lsb_release --codename --short)
+case "${distribution}" in
+ debian)
+ component=main
+ ;;
+ ubuntu)
+ component=universe
+ ;;
esac
-if aptitude show libevent-dev > /dev/null 2>&1; then
- DEPENDED_PACKAGES="${DEPENDED_PACKAGES} libevent-dev"
-else
- ruby -i'' -ne 'print $_ unless /libevent/' /tmp/${PACKAGE}-debian/control
-fi
-
-if aptitude show liblzo2-dev > /dev/null 2>&1; then
- DEPENDED_PACKAGES="${DEPENDED_PACKAGES} liblzo2-dev"
-else
- ruby -i'' -ne 'print $_ unless /liblzo2-dev/' /tmp/${PACKAGE}-debian/control
-fi
-
-run aptitude install -V -D -y devscripts ${DEPENDED_PACKAGES}
-run aptitude clean
-
-if ! id $USER_NAME >/dev/null 2>&1; then
- run useradd -m $USER_NAME
-fi
-
-cat <<EOF > $BUILD_SCRIPT
-#!/bin/sh
-
-rm -rf build
-mkdir -p build
+run sudo apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
-cp /tmp/${PACKAGE}-${VERSION}.tar.gz build/${PACKAGE}_${VERSION}.orig.tar.gz
-cd build
-tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
-cd ${PACKAGE}-${VERSION}/
-cp -rp /tmp/${PACKAGE}-debian debian
+run mkdir -p build
+run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
+ build/${PACKAGE}_${VERSION}.orig.tar.gz
+run cd build
+run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
+run cd ${PACKAGE}-${VERSION}/
+run cp -rp /vagrant/tmp/debian debian
# export DEB_BUILD_OPTIONS=noopt
-debuild -us -uc
-EOF
+run debuild -us -uc
+run cd -
-run chmod +x $BUILD_SCRIPT
-run su - $USER_NAME $BUILD_SCRIPT
+package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
+pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
+run mkdir -p "${pool_dir}/"
+run cp *.tar.gz *.dsc *.deb "${pool_dir}/"
diff --git a/storage/mroonga/vendor/groonga/packages/apt/build-in-chroot.sh b/storage/mroonga/vendor/groonga/packages/apt/build-in-chroot.sh
deleted file mode 100755
index 9d97d42c077..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/build-in-chroot.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-
-if [ $# != 7 ]; then
- echo "Usage: $0 PACKAGE VERSION SOURCE_DIR DESTINATION CHROOT_BASE ARCHITECTURES CODES"
- echo " e.g.: $0 groonga 0.1.9 SOURCE_DIR repositories/ /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-PACKAGE=$1
-VERSION=$2
-SOURCE_DIR=$3
-DESTINATION=$4
-CHROOT_BASE=$5
-ARCHITECTURES=$6
-CODES=$7
-
-PATH=/usr/local/sbin:/usr/sbin:$PATH
-
-script_base_dir=`dirname $0`
-
-if test "$PARALLEL" = "yes"; then
- parallel="yes"
-else
- parallel="no"
-fi
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-run_sudo()
-{
- run sudo "$@"
-}
-
-build_chroot()
-{
- architecture=$1
- code_name=$2
-
- run_sudo debootstrap --arch $architecture $code_name $base_dir
-
- case $code_name in
- wheezy|jessie|unstable)
- run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list
- ;;
- *)
- run_sudo sed -i'' \
- -e 's,http://archive,http://jp.archive,' \
- -e 's/main$/main universe/' \
- $base_dir/etc/apt/sources.list
- ;;
- esac
-
- run_sudo sh -c "echo >> /etc/fstab"
- run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab"
- run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab"
- run_sudo mount ${base_dir}/sys
- run_sudo mount ${base_dir}/dev
- run_sudo mount ${base_dir}/dev/pts
- run_sudo mount ${base_dir}/proc
-}
-
-build()
-{
- architecture=$1
- code_name=$2
-
- target=${code_name}-${architecture}
- base_dir=${CHROOT_BASE}/${target}
- if [ ! -d $base_dir ]; then
- run build_chroot $architecture $code_name
- fi
-
- case ${code_name} in
- wheezy|jessie|unstable)
- distribution=debian
- component=main
- ;;
- *)
- distribution=ubuntu
- component=universe
- ;;
- esac
-
- source_dir=${SOURCE_DIR}
- build_user=${PACKAGE}-build
- build_user_dir=${base_dir}/home/$build_user
- build_dir=${build_user_dir}/build
- pool_base_dir=${DESTINATION}${distribution}/pool/${code_name}/${component}
- package_initial=$(echo ${PACKAGE} | sed -e 's/\(.\).*/\1/')
- pool_dir=${pool_base_dir}/${package_initial}/${PACKAGE}
- run cp $source_dir/${PACKAGE}-${VERSION}.tar.gz \
- ${CHROOT_BASE}/$target/tmp/
- run rm -rf ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run cp -rp $source_dir/debian/ \
- ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run echo $PACKAGE > ${CHROOT_BASE}/$target/tmp/build-package
- run echo $VERSION > ${CHROOT_BASE}/$target/tmp/build-version
- run echo $build_user > ${CHROOT_BASE}/$target/tmp/build-user
- run cp ${script_base_dir}/${PACKAGE}-depended-packages \
- ${CHROOT_BASE}/$target/tmp/depended-packages
- run cp ${script_base_dir}/build-deb.sh \
- ${CHROOT_BASE}/$target/tmp/
- run_sudo rm -rf $build_dir
- run_sudo su -c "/usr/sbin/chroot ${CHROOT_BASE}/$target /tmp/build-deb.sh"
- run mkdir -p $pool_dir
- for path in $build_dir/*; do
- [ -f $path ] && run cp -p $path $pool_dir/
- done
-}
-
-for architecture in $ARCHITECTURES; do
- for code_name in $CODES; do
- if test "$parallel" = "yes"; then
- build $architecture $code_name &
- else
- mkdir -p tmp
- build_log=tmp/build-$code_name-$architecture.log
- build $architecture $code_name 2>&1 | tee $build_log
- fi;
- done;
-done
-
-if test "$parallel" = "yes"; then
- wait
-fi
diff --git a/storage/mroonga/vendor/groonga/packages/apt/env.sh.in b/storage/mroonga/vendor/groonga/packages/apt/env.sh.in
new file mode 100644
index 00000000000..0b56e9fe38f
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/packages/apt/env.sh.in
@@ -0,0 +1,13 @@
+PACKAGE=@PACKAGE@
+VERSION=@VERSION@
+DEPENDED_PACKAGES="
+debhelper
+autotools-dev
+zlib1g-dev
+liblzo2-dev
+libmsgpack-dev
+libzmq-dev
+libevent-dev
+libmecab-dev
+libpcre3-dev
+"
diff --git a/storage/mroonga/vendor/groonga/packages/apt/groonga-depended-packages b/storage/mroonga/vendor/groonga/packages/apt/groonga-depended-packages
deleted file mode 100644
index 35d5f1e7cd8..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/groonga-depended-packages
+++ /dev/null
@@ -1,7 +0,0 @@
-debhelper
-autotools-dev
-pkg-config
-libmecab-dev
-ruby
-zlib1g-dev
-libpcre3-dev
diff --git a/storage/mroonga/vendor/groonga/packages/apt/groonga-keyring-depended-packages b/storage/mroonga/vendor/groonga/packages/apt/groonga-keyring-depended-packages
deleted file mode 100644
index a8ef4049b5d..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/groonga-keyring-depended-packages
+++ /dev/null
@@ -1 +0,0 @@
-gnupg
diff --git a/storage/mroonga/vendor/groonga/packages/debian/changelog b/storage/mroonga/vendor/groonga/packages/debian/changelog
index c4eccba77a4..d93665d12b7 100644
--- a/storage/mroonga/vendor/groonga/packages/debian/changelog
+++ b/storage/mroonga/vendor/groonga/packages/debian/changelog
@@ -1,6 +1,16 @@
+groonga (4.0.6-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Kouhei Sutou <kou@cozmixng.org> Mon, 29 Sep 2014 00:00:00 +0900
+
groonga (4.0.5-1) unstable; urgency=low
* New upstream release.
+ * debian/copyright
+ - Add missing copyright about bundled .js and .css
+ * debian/missing-sources
+ - Add missing-sources for bundled JavaScript.
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Aug 2014 00:00:00 +0900
diff --git a/storage/mroonga/vendor/groonga/packages/debian/copyright b/storage/mroonga/vendor/groonga/packages/debian/copyright
index e13db6c1670..ba15ed1193c 100644
--- a/storage/mroonga/vendor/groonga/packages/debian/copyright
+++ b/storage/mroonga/vendor/groonga/packages/debian/copyright
@@ -1,59 +1,88 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: Groonga Project
+Upstream-Name: Groonga
Upstream-Contact: Groonga Project <packages@groonga.org>
Source: http://packages.groonga.org/source/groonga/
Files: *
-Copyright: Copyright 2009-2013 Brazil, Inc.
+Copyright: 2009-2013 Brazil, Inc.
License: LGPL-2.1
Files: debian/*
-Copyright: Copyright 2011 Kouhei Sutou <kou@clear-code.com>
+Copyright: 2011 Kouhei Sutou <kou@clear-code.com>
+ HAYASHI Kentaro <hayashi@clear-code.com>
+ IWAI, Masaharu <iwaim.sub@gmail.com>
+ SATOH Fumiyasu <fumiyas@osstech.co.jp>
+ orangain <orangain@gmail.com>
License: LGPL-2.1
-Files: data/html/admin/css/redmond/*
-Copyright: Copyright 2011, Brandon Aaron
- Paul Bakaus (paulbakaus.com)
- David Bolter
- Rich Caloggero
- Chi Cheng (cloudream@gmail.com)
- Colin Clark (http://colin.atrc.utoronto.ca/)
- Michelle D'Souza
- Aaron Eisenberger (aaronchi@gmail.com)
- Ariel Flesler
- Bohdan Ganicky
- Scott González
- Marc Grabanski (m@marcgrabanski.com)
- Klaus Hartl (stilbuero.de)
- Scott Jehl
- Cody Lindley
- Eduardo Lundgren (eduardolundgren@gmail.com)
- Todd Parker
- John Resig
- Patty Toland
- Ca-Phun Ung (yelotofu.com)
- Keith Wood (kbwood@virginbroadband.com.au)
- Maggie Costello Wachs
- Richard D. Worth (rdworth.org)
- Jörn Zaefferer (bassistance.de)
+Files: data/html/admin/css/redmond/* examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css
+Copyright: 2011, Brandon Aaron
+ Paul Bakaus (paulbakaus.com)
+ David Bolter
+ Rich Caloggero
+ Chi Cheng (cloudream@gmail.com)
+ Colin Clark (http://colin.atrc.utoronto.ca/)
+ Michelle D'Souza
+ Aaron Eisenberger (aaronchi@gmail.com)
+ Ariel Flesler
+ Bohdan Ganicky
+ Scott González
+ Marc Grabanski (m@marcgrabanski.com)
+ Klaus Hartl (stilbuero.de)
+ Scott Jehl
+ Cody Lindley
+ Eduardo Lundgren (eduardolundgren@gmail.com)
+ Todd Parker
+ John Resig
+ Patty Toland
+ Ca-Phun Ung (yelotofu.com)
+ Keith Wood (kbwood@virginbroadband.com.au)
+ Maggie Costello Wachs
+ Richard D. Worth (rdworth.org)
+ Jörn Zaefferer (bassistance.de)
License: MIT or GPL-2
Files: data/html/admin/js/jquery.flot*
-Copyright: Copyright (c) 2007-2009 IOLA and Ole Laursen
+Copyright: 2007-2009 IOLA and Ole Laursen
License: MIT
Files: data/html/admin/js/jquery-1.7.2.min.js
-Copyright: Copyright 2011, John Resig
+Copyright: 2011, John Resig
License: MIT or GPL-2
Files: doc/locale/*/jquery.js
-Copyright: Copyright 2012 jQuery Foundation
+Copyright: 2012 jQuery Foundation
License: MIT
Files: doc/locale/*/underscore.js
-Copyright: Copyright 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
+Copyright: 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
License: MIT
+Files: doc/locale/*/doctools.js
+Copyright: 2007-2014 the Sphinx team
+License: BSD-2-clause
+
+Files: doc/locale/*/searchtools.js
+Copyright: 2007-2014 the Sphinx team
+License: BSD-2-clause
+
+Files: doc/locale/*/websupport.js
+Copyright: 2007-2014 the Sphinx team
+License: BSD-2-clause
+
+Files: doc/locale/*/basic.css doc/locale/*/pygments.css
+Copyright: 2007-2014 the Sphinx team
+License: BSD-2-clause
+
+License: BSD-2-clause
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ .
+ 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ .
+ 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
License: LGPL-2.1
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -107,3 +136,6 @@ License: GPL-2
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian systems, the complete text of the GNU General Public
+ License Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default
index b95fd7ee174..2d23f1e1552 100644
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default
+++ b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default
@@ -1,15 +1,5 @@
# Default
-#USER=groonga
-#GROUP=groonga
-#ADDRESS=127.0.0.1
-#PORT=10041
-#DATABASE=/var/lib/groonga/db/db
-#LOG_PATH=/var/log/groonga/groonga.log
-#QUERY_LOG_PATH=/var/log/groonga/query.log
-#PROTOCOL=http
-#GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
+#GROONGA_HTTPD_ARGS=""
TIMEOUT=3
# Comment out this to disable groonga-httpd daemon.
ENABLE=yes
-# Set "no" to disable to skip updating column for same value.
-GRN_JA_SKIP_SAME_VALUE_PUT=yes
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init
index ad8eb269afe..b3cba5968fa 100755
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init
+++ b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init
@@ -15,23 +15,16 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="a HTTP server for groonga which provides full-text search engine and column store"
+DESC="a HTTP server for Groonga which provides full-text search engine and column store"
NAME=groonga-httpd
DAEMON=/usr/sbin/$NAME
DAEMON_RESTART=/usr/sbin/$NAME-restart
-CURL=/usr/bin/curl
-USER=groonga
-GROUP=groonga
-ADDRESS=127.0.0.1
-PORT=10041
-PIDFILE=/var/run/groonga/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
-OPTION_ARGS=""
+GROONGA_HTTPD_ARGS=""
START_STOP_DAEMON_ARGS=""
ENABLE="no"
-TIMEOUT=5
-DEFAULT_FILE=/etc/default/groonga-httpd
+DEFAULT_FILE=/etc/default/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
@@ -41,25 +34,6 @@ DEFAULT_FILE=/etc/default/groonga-httpd
[ "$ENABLE" = "yes" ] || exit 0
-export GRN_JA_SKIP_SAME_VALUE_PUT="$GRN_JA_SKIP_SAME_VALUE_PUT"
-
-mkdir -p $(dirname ${PIDFILE})
-
-if [ -n "${USER}" ]; then
- if ! getent passwd | grep -q "^${USER}:"; then
- echo "$0: user for running groonga-httpd doesn't exist: ${USER}" >&2
- exit 1
- fi
-fi
-if [ -n "${GROUP}" ]; then
- if ! getent group | grep -q "^${GROUP}:"; then
- echo "$0: group for running groonga-httpd doesn't exist: ${GROUP}" >&2
- exit 1
- fi
-fi
-DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}"
-
-
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
@@ -67,15 +41,12 @@ DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}"
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
-send_command()
-{
- command=$1
- if [ "$command" = "status" ]; then
- $CURL --max-time $TIMEOUT "http://${ADDRESS}:${PORT}/d/${command}"
- else
- $CURL "http://${ADDRESS}:${PORT}/d/${command}"
- fi
-}
+if [ -z "$PID_FILE" ]; then
+ PID_FILE=$(grep '^\s*pid\s' /etc/nginx/nginx.conf | sed -re 's/^\s*pid\s+(.+);$/\1/g' | head -n1)
+ if [ -z "$PID_FILE" ]; then
+ PID_FILE=/run/groonga-httpd.pid
+ fi
+fi
#
# Function that starts the daemon/service
@@ -86,10 +57,10 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
+ start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} -- $DAEMON_ARGS || return 2
+ start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
+ ${START_STOP_DAEMON_ARGS} -- $GROONGA_HTTPD_ARGS || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
@@ -106,10 +77,8 @@ do_stop()
# 2 if daemon could not be stopped
# other if a failure occurred
- $DAEMON -s stop
-
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
- --pidfile $PIDFILE --name $NAME
+ --pidfile $PID_FILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
@@ -121,7 +90,7 @@ do_stop()
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
- rm -f $PIDFILE
+ rm -f $PID_FILE
return "$RETVAL"
}
@@ -134,12 +103,12 @@ do_reload() {
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --signal HUP --quiet --pidfile $PID_FILE --name $NAME
return 0
}
do_status() {
- send_command status
+ status_of_proc -p $PID_FILE "$DAEMON" "$NAME"
return $?
}
@@ -167,7 +136,7 @@ case "$1" in
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
- if [ -f ${PIDFILE} ]; then
+ if [ -f ${PID_FILE} ]; then
$DAEMON_RESTART
else
do_start
diff --git a/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install b/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install
index 880c9a196b3..803d4731df0 100644
--- a/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install
+++ b/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install
@@ -1,4 +1,5 @@
usr/lib/*/libgroonga*.so.*
usr/lib/*/groonga/plugins/table/*
usr/lib/*/groonga/plugins/query_expanders/*
+usr/lib/*/groonga/plugins/token_filters/*
etc/groonga/synonyms.tsv
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in b/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in
index 8d0eacde93d..de24a37fb60 100644
--- a/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in
+++ b/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in
@@ -305,8 +305,10 @@ fi
%dir %{_libdir}/groonga
%dir %{_libdir}/groonga/plugins
%dir %{_libdir}/groonga/plugins/tokenizers
+%dir %{_libdir}/groonga/plugins/token_filters
%{_libdir}/groonga/plugins/table/table.so
%{_libdir}/groonga/plugins/query_expanders/tsv.so
+%{_libdir}/groonga/plugins/token_filters/stop_word.so
%{_datadir}/groonga/
%config(noreplace) %{_sysconfdir}/groonga/synonyms.tsv
@@ -370,6 +372,9 @@ fi
%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/*
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.0.6-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.5-1
- new upstream release.
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in b/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in
index 7073c56236e..31cc1c150c7 100644
--- a/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in
+++ b/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in
@@ -345,8 +345,10 @@ fi
%dir %{_libdir}/groonga/plugins/suggest
%dir %{_libdir}/groonga/plugins/table
%dir %{_libdir}/groonga/plugins/tokenizers
+%dir %{_libdir}/groonga/plugins/token_filters
%{_libdir}/groonga/plugins/table/table.so
%{_libdir}/groonga/plugins/query_expanders/tsv.so
+%{_libdir}/groonga/plugins/token_filters/stop_word
%{_datadir}/groonga/
%config(noreplace) %{_sysconfdir}/groonga/synonyms.tsv
@@ -411,6 +413,9 @@ fi
%{php_extdir}/groonga.so
%changelog
+* Mon Sep 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.0.6-1
+- new upstream release.
+
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.5-1
- new upstream release.
diff --git a/storage/mroonga/vendor/groonga/packages/windows/Makefile.am b/storage/mroonga/vendor/groonga/packages/windows/Makefile.am
index a3b86c00958..fe8ce243b3c 100644
--- a/storage/mroonga/vendor/groonga/packages/windows/Makefile.am
+++ b/storage/mroonga/vendor/groonga/packages/windows/Makefile.am
@@ -39,7 +39,7 @@ build-groonga: source
done
LICENSE:
- @(echo "groonga"; \
+ @(echo "Groonga"; \
echo "======="; \
echo; \
echo "AUTHORS"; \
diff --git a/storage/mroonga/vendor/groonga/packages/windows/Rakefile b/storage/mroonga/vendor/groonga/packages/windows/Rakefile
index 490f8246403..ec95ad59779 100644
--- a/storage/mroonga/vendor/groonga/packages/windows/Rakefile
+++ b/storage/mroonga/vendor/groonga/packages/windows/Rakefile
@@ -1,6 +1,6 @@
# -*- coding: utf-8; mode: ruby -*-
#
-# Copyright (C) 2011-2012 Kouhei Sutou <kou@clear-code.com>
+# Copyright (C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -49,7 +49,7 @@ namespace :build do
download_dir = Pathname.new("tmp/download").expand_path
desc "Build MessagePack and install it into #{dist_dir}."
- task(:msgpack) do
+ task :msgpack do
tmp_dir = Pathname.new("tmp/msgpack")
rm_rf(tmp_dir)
mkdir_p(tmp_dir)
@@ -89,7 +89,7 @@ namespace :build do
end
desc "Build MeCab and install it into #{dist_dir}."
- task(:mecab) do
+ task :mecab do
tmp_dir = Pathname.new("tmp/mecab")
rm_rf(tmp_dir)
mkdir_p(tmp_dir)
@@ -133,7 +133,7 @@ namespace :build do
end
desc "Build MeCab dictionary and install it into #{dist_dir}."
- task(:mecab_dict) do
+ task :mecab_dict do
tmp_dir = Pathname.new("tmp/mecab_dict")
rm_rf(tmp_dir)
mkdir_p(tmp_dir)
@@ -175,7 +175,7 @@ namespace :build do
end
desc "Build groonga and install it into #{dist_dir}/."
- task(:groonga) do
+ task :groonga do
tmp_dir = Pathname.new("tmp/groonga")
rm_rf(tmp_dir)
mkdir_p(tmp_dir)
@@ -193,6 +193,8 @@ namespace :build do
"--disable-benchmark",
"--disable-groonga-httpd",
"--with-message-pack=#{binary_dir}",
+ "--enable-mruby",
+ "--enable-shared-onigmo",
]
if mecab_config.exist?
options << "--with-mecab-config=#{mecab_config}"
@@ -208,21 +210,41 @@ namespace :build do
mkdir_p(groonga_license_dir)
files = ["README.md", "COPYING"]
cp(files, groonga_license_dir)
+
+ mruby_license_dir = license_dir + "mruby"
+ mkdir_p(mruby_license_dir)
+ files = [
+ "vendor/mruby-source/README.md",
+ "vendor/mruby-source/AUTHORS",
+ "vendor/mruby-source/LEGAL",
+ "vendor/mruby-source/MITL",
+ ]
+ cp(files, mruby_license_dir)
+
+ onigmo_license_dir = license_dir + "onigmo"
+ mkdir_p(onigmo_license_dir)
+ files = [
+ "vendor/onigmo-source/README",
+ "vendor/onigmo-source/README",
+ "vendor/onigmo-source/AUTHORS",
+ "vendor/onigmo-source/COPYING",
+ ]
+ cp(files, onigmo_license_dir)
end
end
- task(:clean) do
+ task :clean do
rm_rf(dist_dir)
end
- task(:pre => :clean)
- task(:post)
+ task :pre => :clean
+ task :post
end
namespace :gcc do
namespace :dll do
desc "Bundle GCC related DLLs"
- task(:bundle) do
+ task :bundle do
dlls = ["libstdc++-6.dll", "libwinpthread-1.dll"]
if groonga_win32_x86_p
dlls << "libgcc_s_sjlj-1.dll"
@@ -237,12 +259,12 @@ namespace :gcc do
end
end
-task("build:post" => "gcc:dll:bundle")
+task "build:post" => "gcc:dll:bundle"
desc "Build MeCab and groonga and install them into #{dist_dir}/."
-task(:build => ["build:pre",
+task :build => ["build:pre",
"build:msgpack",
"build:mecab",
"build:mecab_dict",
"build:groonga",
- "build:post"])
+ "build:post"]
diff --git a/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile b/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile
index a0afb49dc26..97c2176dac0 100644
--- a/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile
+++ b/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile
@@ -32,9 +32,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define(vm[:id]) do |node|
node.vm.box = vm[:id]
node.vm.box_url = vm[:box_url]
- node.vm.provision(:shell, :path => "build-rpm.sh")
+ hour_in_seconds = 60 * 60
+ node.vm.boot_timeout = 1 * hour_in_seconds
+ node.vm.provision(:shell, :privileged => false, :path => "build-rpm.sh")
node.vm.provider("virtualbox") do |virtual_box|
- virtual_box.memory = 4096
+ virtual_box.memory = 512
+ virtual_box.customize ["modifyvm", :id, "--hwvirtex", "off"]
end
end
end
diff --git a/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh b/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh
index 2996aff7975..30b0135aa9b 100755
--- a/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh
+++ b/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh
@@ -13,6 +13,11 @@ rpmbuild_options=
. /vagrant/env.sh
+swap_file=/tmp/swap
+run sudo dd if=/dev/zero of="$swap_file" bs=1024 count=4096K
+run sudo /sbin/mkswap "$swap_file"
+run sudo /sbin/swapon "$swap_file"
+
distribution=$(cut -d " " -f 1 /etc/redhat-release | tr "A-Z" "a-z")
if grep -q Linux /etc/redhat-release; then
distribution_version=$(cut -d " " -f 4 /etc/redhat-release)
@@ -28,8 +33,8 @@ case "${architecture}" in
;;
esac
-run yum groupinstall -y "Development Tools"
-run yum install -y rpm-build rpmdevtools tar ${DEPENDED_PACKAGES}
+run sudo yum groupinstall -y "Development Tools"
+run sudo yum install -y rpm-build rpmdevtools tar ${DEPENDED_PACKAGES}
if [ -x /usr/bin/rpmdev-setuptree ]; then
rm -rf .rpmmacros
@@ -94,13 +99,13 @@ build_fedora_srpm()
;;
esac
- run rpm -Uvh rpmbuild/RPMS/*/*.rpm
+ run sudo rpm -Uvh rpmbuild/RPMS/*/*.rpm
run mv rpmbuild/RPMS/*/*.rpm "${rpm_dir}/"
run mv rpmbuild/SRPMS/*.rpm "${srpm_dir}/"
}
if ! rpm -q mecab-devel > /dev/null; then
- run yum install -y wget
+ run sudo yum install -y wget
for rpm in mecab-0.996-1.fc20.src.rpm \
mecab-ipadic-2.7.0.20070801-8.fc20.1.src.rpm \
diff --git a/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh b/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh
index 511fb3df0a4..b3a45afe7f5 100755
--- a/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh
+++ b/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh
@@ -28,6 +28,14 @@ unsigned_rpms()
done
}
+if ! gpg --list-keys "${GPG_UID}" > /dev/null 2>&1; then
+ run gpg --keyserver keyserver.ubuntu.com --recv-key "${GPG_UID}"
+fi
+run mkdir -p tmp
+run gpg --armor --export "${GPG_UID}" > tmp/sign-key
+run rpm --import tmp/sign-key
+run rm -rf tmp/sign-key
+
rpms=""
for distribution in ${DISTRIBUTIONS}; do
rpms="${rpms} $(find ${DESTINATION}${distribution} -name '*.rpm' | unsigned_rpms)"
diff --git a/storage/mroonga/vendor/groonga/plugins/CMakeLists.txt b/storage/mroonga/vendor/groonga/plugins/CMakeLists.txt
index a2a8f288d52..42a3045a415 100644
--- a/storage/mroonga/vendor/groonga/plugins/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/plugins/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright(C) 2012 Brazil
+# Copyright(C) 2012-2014 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -18,3 +18,4 @@ add_subdirectory(tokenizers)
add_subdirectory(table)
add_subdirectory(query_expanders)
add_subdirectory(ruby)
+add_subdirectory(token_filters)
diff --git a/storage/mroonga/vendor/groonga/plugins/Makefile.am b/storage/mroonga/vendor/groonga/plugins/Makefile.am
index 75a00597e06..1d1abf1dee9 100644
--- a/storage/mroonga/vendor/groonga/plugins/Makefile.am
+++ b/storage/mroonga/vendor/groonga/plugins/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS = \
suggest \
table \
query_expanders \
- ruby
+ ruby \
+ token_filters
EXTRA_DIST = \
CMakeLists.txt
diff --git a/storage/mroonga/vendor/groonga/plugins/suggest/suggest.c b/storage/mroonga/vendor/groonga/plugins/suggest/suggest.c
index ea7b6adbf6b..3e291b96d90 100644
--- a/storage/mroonga/vendor/groonga/plugins/suggest/suggest.c
+++ b/storage/mroonga/vendor/groonga/plugins/suggest/suggest.c
@@ -1,5 +1,5 @@
/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
-/* Copyright(C) 2010-2013 Brazil
+/* Copyright(C) 2010-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -888,14 +888,15 @@ learner_learn_for_suggest(grn_ctx *ctx, grn_suggest_learner *learner)
int keylen = grn_table_get_key(ctx, learner->items, learner->post_item_id,
keybuf, GRN_TABLE_MAX_KEY_SIZE);
unsigned int token_flags = 0;
- grn_token *token = grn_token_open(ctx, learner->items, keybuf, keylen,
- GRN_TOKEN_ADD, token_flags);
- if (token) {
+ grn_token_cursor *token_cursor =
+ grn_token_cursor_open(ctx, learner->items, keybuf, keylen,
+ GRN_TOKEN_ADD, token_flags);
+ if (token_cursor) {
grn_id tid;
grn_obj *pre_item = &(learner->pre_item);
grn_obj *post_item = learner->post_item;
grn_hash *token_ids = NULL;
- while ((tid = grn_token_next(ctx, token)) && tid != learner->post_item_id) {
+ while ((tid = grn_token_cursor_next(ctx, token_cursor)) && tid != learner->post_item_id) {
uint64_t key;
int added;
grn_id pair_id;
@@ -924,7 +925,7 @@ learner_learn_for_suggest(grn_ctx *ctx, grn_suggest_learner *learner)
if (token_ids) {
grn_hash_close(ctx, token_ids);
}
- grn_token_close(ctx, token);
+ grn_token_cursor_close(ctx, token_cursor);
}
}
diff --git a/storage/mroonga/vendor/groonga/plugins/token_filters/CMakeLists.txt b/storage/mroonga/vendor/groonga/plugins/token_filters/CMakeLists.txt
new file mode 100644
index 00000000000..9ffe53d2e8d
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/plugins/token_filters/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright(C) 2014 Brazil
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
+ )
+
+set(TOKEN_FILTERS_DIR "${GRN_RELATIVE_PLUGINS_DIR}/token_filters")
+
+read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/stop_word_sources.am
+ STOP_WORD_SOURCES)
+add_library(stop_word_token_filter MODULE ${STOP_WORD_SOURCES})
+set_source_files_properties(${STOP_WORD_SOURCES}
+ PROPERTIES
+ COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
+set_target_properties(stop_word_token_filter PROPERTIES
+ PREFIX ""
+ OUTPUT_NAME "stop_word")
+target_link_libraries(stop_word_token_filter libgroonga)
+if(NOT MRN_GROONGA_BUNDLED)
+ install(TARGETS stop_word_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
+endif()
diff --git a/storage/mroonga/vendor/groonga/plugins/token_filters/Makefile.am b/storage/mroonga/vendor/groonga/plugins/token_filters/Makefile.am
new file mode 100644
index 00000000000..8d77466f053
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/plugins/token_filters/Makefile.am
@@ -0,0 +1,20 @@
+EXTRA_DIST = \
+ CMakeLists.txt
+
+AM_CPPFLAGS = \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/lib
+
+AM_LDFLAGS = \
+ -avoid-version \
+ -module \
+ -no-undefined
+
+LIBS = \
+ $(top_builddir)/lib/libgroonga.la
+
+token_filter_plugins_LTLIBRARIES =
+token_filter_plugins_LTLIBRARIES += stop_word.la
+
+include stop_word_sources.am
diff --git a/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word.c b/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word.c
new file mode 100644
index 00000000000..21451f00b25
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word.c
@@ -0,0 +1,150 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+ Copyright(C) 2014 Brazil
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <str.h>
+
+#include <groonga.h>
+#include <groonga/token_filter.h>
+
+#include <string.h>
+
+#define COLUMN_NAME "is_stop_word"
+
+typedef struct {
+ grn_obj *table;
+ grn_token_mode mode;
+ grn_obj *column;
+ grn_obj value;
+ grn_tokenizer_token token;
+} grn_stop_word_token_filter;
+
+static void *
+stop_word_init(grn_ctx *ctx, grn_obj *table, grn_token_mode mode)
+{
+ grn_stop_word_token_filter *token_filter;
+
+ token_filter = GRN_PLUGIN_MALLOC(ctx, sizeof(grn_stop_word_token_filter));
+ if (!token_filter) {
+ GRN_PLUGIN_ERROR(ctx, GRN_NO_MEMORY_AVAILABLE,
+ "[token-filter][stop-word] "
+ "failed to allocate grn_stop_word_token_filter");
+ return NULL;
+ }
+
+ token_filter->table = table;
+ token_filter->mode = mode;
+ token_filter->column = grn_obj_column(ctx,
+ token_filter->table,
+ COLUMN_NAME,
+ strlen(COLUMN_NAME));
+ if (!token_filter->column) {
+ char table_name[GRN_TABLE_MAX_KEY_SIZE];
+ unsigned int table_name_size;
+
+ table_name_size = grn_obj_name(ctx,
+ token_filter->table,
+ table_name,
+ GRN_TABLE_MAX_KEY_SIZE);
+ GRN_PLUGIN_ERROR(ctx, GRN_TOKEN_FILTER_ERROR,
+ "[token-filter][stop-word] "
+ "column for judging stop word doesn't exit: <%.*s.%s>",
+ table_name_size,
+ table_name,
+ COLUMN_NAME);
+ GRN_PLUGIN_FREE(ctx, token_filter);
+ return NULL;
+ }
+
+ GRN_BOOL_INIT(&(token_filter->value), 0);
+ grn_tokenizer_token_init(ctx, &(token_filter->token));
+
+ return token_filter;
+}
+
+static void
+stop_word_filter(grn_ctx *ctx,
+ grn_token *current_token,
+ grn_token *next_token,
+ void *user_data)
+{
+ grn_stop_word_token_filter *token_filter = user_data;
+
+ if (token_filter->mode == GRN_TOKEN_GET) {
+ grn_id id;
+ grn_obj *data;
+
+ data = grn_token_get_data(ctx, current_token);
+ id = grn_table_get(ctx,
+ token_filter->table,
+ GRN_TEXT_VALUE(data),
+ GRN_TEXT_LEN(data));
+ if (id != GRN_ID_NIL) {
+ GRN_BULK_REWIND(&(token_filter->value));
+ grn_obj_get_value(ctx,
+ token_filter->column,
+ id,
+ &(token_filter->value));
+ if (GRN_BOOL_VALUE(&(token_filter->value))) {
+ grn_tokenizer_status status;
+ status = grn_token_get_status(ctx, current_token);
+ status |= GRN_TOKENIZER_TOKEN_SKIP;
+ grn_token_set_status(ctx, next_token, status);
+ }
+ }
+ }
+}
+
+static void
+stop_word_fin(grn_ctx *ctx, void *user_data)
+{
+ grn_stop_word_token_filter *token_filter = user_data;
+ if (!token_filter) {
+ return;
+ }
+
+ grn_tokenizer_token_fin(ctx, &(token_filter->token));
+ grn_obj_unlink(ctx, token_filter->column);
+ grn_obj_unlink(ctx, &(token_filter->value));
+ GRN_PLUGIN_FREE(ctx, token_filter);
+}
+
+grn_rc
+GRN_PLUGIN_INIT(grn_ctx *ctx)
+{
+ return ctx->rc;
+}
+
+grn_rc
+GRN_PLUGIN_REGISTER(grn_ctx *ctx)
+{
+ grn_rc rc;
+
+ rc = grn_token_filter_register(ctx,
+ "TokenFilterStopWord", -1,
+ stop_word_init,
+ stop_word_filter,
+ stop_word_fin);
+
+ return rc;
+}
+
+grn_rc
+GRN_PLUGIN_FIN(grn_ctx *ctx)
+{
+ return GRN_SUCCESS;
+}
diff --git a/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word_sources.am b/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word_sources.am
new file mode 100644
index 00000000000..bab89551826
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/plugins/token_filters/stop_word_sources.am
@@ -0,0 +1,2 @@
+stop_word_la_SOURCES = \
+ stop_word.c
diff --git a/storage/mroonga/vendor/groonga/src/groonga.c b/storage/mroonga/vendor/groonga/src/groonga.c
index b62c462c21e..9d1009d72da 100644
--- a/storage/mroonga/vendor/groonga/src/groonga.c
+++ b/storage/mroonga/vendor/groonga/src/groonga.c
@@ -2274,10 +2274,10 @@ show_version(void)
#ifdef GRN_WITH_MESSAGE_PACK
printf(",msgpack");
#endif
-#ifndef NO_ZLIB
+#ifdef GRN_WITH_ZLIB
printf(",zlib");
#endif
-#ifndef NO_LZO
+#ifdef GRN_WITH_LZO
printf(",lzo");
#endif
#ifdef USE_KQUEUE
diff --git a/storage/mroonga/vendor/groonga/vendor/Makefile.am b/storage/mroonga/vendor/groonga/vendor/Makefile.am
index 77ab6b3e31f..334b6fd8917 100644
--- a/storage/mroonga/vendor/groonga/vendor/Makefile.am
+++ b/storage/mroonga/vendor/groonga/vendor/Makefile.am
@@ -7,7 +7,8 @@ SUBDIRS = \
EXTRA_DIST = \
$(NGINX_DIR) \
CMakeLists.txt \
- plugins/CMakeLists.txt
+ plugins/CMakeLists.txt \
+ mruby/CMakeLists.txt
dist-hook:
GIT_DIR=$(srcdir)/mruby-source/.git git archive --format=tar HEAD | \
diff --git a/storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am b/storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am
index 870f1d3f9ab..41385bcd589 100644
--- a/storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am
+++ b/storage/mroonga/vendor/groonga/vendor/mruby/Makefile.am
@@ -8,40 +8,32 @@ DEFAULT_INCLUDES = \
if WITH_MRUBY
noinst_LTLIBRARIES = libmruby.la
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-I$(srcdir)/../onigmo-source
+if PLATFORM_WIN32
+AM_CPPFLAGS += \
+ -DMRB_BUILD_AS_DLL \
+ -DMRB_CORE
+endif
+
include sources.am
-BUILT_SOURCES =
+BUILT_SOURCES = \
+ parse.c \
+ mrblib.c \
+ mrbgems_init.c \
+ mruby_onig_regexp.c
+libmruby_la_SOURCES += $(BUILT_SOURCES)
-MRUBY_BUILD_DIR = $(abs_top_builddir)/vendor/mruby-build
-
-BUILT_SOURCES += parse.c
-libmruby_la_SOURCES += parse.c
parse.c: mruby-build.timestamp
- cp $(MRUBY_BUILD_DIR)/host/src/y.tab.c $@
-
-BUILT_SOURCES += mrblib.c
-libmruby_la_SOURCES += mrblib.c
mrblib.c: mruby-build.timestamp
- cp $(MRUBY_BUILD_DIR)/host/mrblib/mrblib.c $@
-
-BUILT_SOURCES += mrbgems_init.c
-libmruby_la_SOURCES += mrbgems_init.c
mrbgems_init.c: mruby-build.timestamp
- ( \
- cat $(MRUBY_BUILD_DIR)/host/mrbgems/gem_init.c; \
- cat $(MRUBY_BUILD_DIR)/host/mrbgems/*/gem_init.c; \
- ) > $@
-
-BUILT_SOURCES += mruby_onig_regexp.c
-libmruby_la_SOURCES += mruby_onig_regexp.c
-MRUBY_ONIG_REGEXP_DIR = $(MRUBY_BUILD_DIR)/mrbgems/mruby-onig-regexp
mruby_onig_regexp.c: mruby-build.timestamp
- cp $(MRUBY_ONIG_REGEXP_DIR)/src/mruby_onig_regexp.c $@
MRUBY_CONFIG = $(abs_srcdir)/build_config.rb
+MRUBY_BUILD_DIR = $(abs_top_builddir)/vendor/mruby-build
+MRUBY_ONIG_REGEXP_DIR = $(MRUBY_BUILD_DIR)/mrbgems/mruby-onig-regexp
mruby-build.timestamp: build_config.rb
rm -rf $(MRUBY_BUILD_DIR)
cd $(srcdir)/../mruby-source && \
@@ -49,8 +41,19 @@ mruby-build.timestamp: build_config.rb
MRUBY_BUILD_DIR=$(MRUBY_BUILD_DIR) \
MRUBY_CONFIG=$(MRUBY_CONFIG)
touch $@
+ cp $(MRUBY_BUILD_DIR)/host/src/y.tab.c parse.c
+ cp $(MRUBY_BUILD_DIR)/host/mrblib/mrblib.c ./
+ ( \
+ cat $(MRUBY_BUILD_DIR)/host/mrbgems/gem_init.c; \
+ cat $(MRUBY_BUILD_DIR)/host/mrbgems/*/gem_init.c; \
+ ) > mrbgems_init.c
+ cp $(MRUBY_ONIG_REGEXP_DIR)/src/mruby_onig_regexp.c ./
+
+EXTRA_DIST += \
+ mruby-build.timestamp
CLEANFILES = *.gcno *gcda
+MAINTAINERCLEANFILES = mruby-build.timestamp
endif
update:
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.c
deleted file mode 100644
index e548145ed73..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.c
+++ /dev/null
@@ -1,173 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ngx_thread_volatile ngx_event_t *ngx_posted_accept_events;
-ngx_thread_volatile ngx_event_t *ngx_posted_events;
-
-#if (NGX_THREADS)
-ngx_mutex_t *ngx_posted_events_mutex;
-#endif
-
-
-void
-ngx_event_process_posted(ngx_cycle_t *cycle,
- ngx_thread_volatile ngx_event_t **posted)
-{
- ngx_event_t *ev;
-
- for ( ;; ) {
-
- ev = (ngx_event_t *) *posted;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted event %p", ev);
-
- if (ev == NULL) {
- return;
- }
-
- ngx_delete_posted_event(ev);
-
- ev->handler(ev);
- }
-}
-
-
-#if (NGX_THREADS) && !(NGX_WIN32)
-
-void
-ngx_wakeup_worker_thread(ngx_cycle_t *cycle)
-{
- ngx_int_t i;
-#if 0
- ngx_uint_t busy;
- ngx_event_t *ev;
-
- busy = 1;
-
- if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) {
- return;
- }
-
- for (ev = (ngx_event_t *) ngx_posted_events; ev; ev = ev->next) {
- if (*(ev->lock) == 0) {
- busy = 0;
- break;
- }
- }
-
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
- if (busy) {
- return;
- }
-#endif
-
- for (i = 0; i < ngx_threads_n; i++) {
- if (ngx_threads[i].state == NGX_THREAD_FREE) {
- ngx_cond_signal(ngx_threads[i].cv);
- return;
- }
- }
-}
-
-
-ngx_int_t
-ngx_event_thread_process_posted(ngx_cycle_t *cycle)
-{
- ngx_event_t *ev;
-
- for ( ;; ) {
-
- ev = (ngx_event_t *) ngx_posted_events;
-
- for ( ;; ) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted event %p", ev);
-
- if (ev == NULL) {
- return NGX_OK;
- }
-
- if (ngx_trylock(ev->lock) == 0) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted event %p is busy", ev);
-
- ev = ev->next;
- continue;
- }
-
- if (ev->lock != ev->own_lock) {
- if (*(ev->own_lock)) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "the own lock of the posted event %p is busy", ev);
- ngx_unlock(ev->lock);
- ev = ev->next;
- continue;
- }
- *(ev->own_lock) = 1;
- }
-
- ngx_delete_posted_event(ev);
-
- ev->locked = 1;
-
- ev->ready |= ev->posted_ready;
- ev->timedout |= ev->posted_timedout;
- ev->pending_eof |= ev->posted_eof;
-#if (NGX_HAVE_KQUEUE)
- ev->kq_errno |= ev->posted_errno;
-#endif
- if (ev->posted_available) {
- ev->available = ev->posted_available;
- }
-
- ev->posted_ready = 0;
- ev->posted_timedout = 0;
- ev->posted_eof = 0;
-#if (NGX_HAVE_KQUEUE)
- ev->posted_errno = 0;
-#endif
- ev->posted_available = 0;
-
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
- ev->handler(ev);
-
- ngx_mutex_lock(ngx_posted_events_mutex);
-
- if (ev->locked) {
- ngx_unlock(ev->lock);
-
- if (ev->lock != ev->own_lock) {
- ngx_unlock(ev->own_lock);
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted event %p is done", ev);
-
- break;
- }
- }
-}
-
-#else
-
-void
-ngx_wakeup_worker_thread(ngx_cycle_t *cycle)
-{
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.h
deleted file mode 100644
index abd2e261dff..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_posted.h
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_POSTED_H_INCLUDED_
-#define _NGX_EVENT_POSTED_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_THREADS)
-extern ngx_mutex_t *ngx_posted_events_mutex;
-#endif
-
-
-#define ngx_locked_post_event(ev, queue) \
- \
- if (ev->prev == NULL) { \
- ev->next = (ngx_event_t *) *queue; \
- ev->prev = (ngx_event_t **) queue; \
- *queue = ev; \
- \
- if (ev->next) { \
- ev->next->prev = &ev->next; \
- } \
- \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "post event %p", ev); \
- \
- } else { \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
- "update posted event %p", ev); \
- }
-
-
-#define ngx_post_event(ev, queue) \
- \
- ngx_mutex_lock(ngx_posted_events_mutex); \
- ngx_locked_post_event(ev, queue); \
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
-
-#define ngx_delete_posted_event(ev) \
- \
- *(ev->prev) = ev->next; \
- \
- if (ev->next) { \
- ev->next->prev = ev->prev; \
- } \
- \
- ev->prev = NULL; \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
- "delete posted event %p", ev);
-
-
-
-void ngx_event_process_posted(ngx_cycle_t *cycle,
- ngx_thread_volatile ngx_event_t **posted);
-void ngx_wakeup_worker_thread(ngx_cycle_t *cycle);
-
-#if (NGX_THREADS)
-ngx_int_t ngx_event_thread_process_posted(ngx_cycle_t *cycle);
-#endif
-
-
-extern ngx_thread_volatile ngx_event_t *ngx_posted_accept_events;
-extern ngx_thread_volatile ngx_event_t *ngx_posted_events;
-
-
-#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES
index 5ff1c201df0..ddfb80014d9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES
@@ -1,4 +1,60 @@
+Changes with nginx 1.7.6 30 Sep 2014
+
+ *) Change: the deprecated "limit_zone" directive is not supported
+ anymore.
+
+ *) Feature: the "limit_conn_zone" and "limit_req_zone" directives now
+ can be used with combinations of multiple variables.
+
+ *) Bugfix: request body might be transmitted incorrectly when retrying a
+ FastCGI request to the next upstream server.
+
+ *) Bugfix: in logging to syslog.
+
+
+Changes with nginx 1.7.5 16 Sep 2014
+
+ *) Security: it was possible to reuse SSL sessions in unrelated contexts
+ if a shared SSL session cache or the same TLS session ticket key was
+ used for multiple "server" blocks (CVE-2014-3616).
+ Thanks to Antoine Delignat-Lavaud.
+
+ *) Change: now the "stub_status" directive does not require a parameter.
+
+ *) Feature: the "always" parameter of the "add_header" directive.
+
+ *) Feature: the "proxy_next_upstream_tries",
+ "proxy_next_upstream_timeout", "fastcgi_next_upstream_tries",
+ "fastcgi_next_upstream_timeout", "memcached_next_upstream_tries",
+ "memcached_next_upstream_timeout", "scgi_next_upstream_tries",
+ "scgi_next_upstream_timeout", "uwsgi_next_upstream_tries", and
+ "uwsgi_next_upstream_timeout" directives.
+
+ *) Bugfix: in the "if" parameter of the "access_log" directive.
+
+ *) Bugfix: in the ngx_http_perl_module.
+ Thanks to Piotr Sikora.
+
+ *) Bugfix: the "listen" directive of the mail proxy module did not allow
+ to specify more than two parameters.
+
+ *) Bugfix: the "sub_filter" directive did not work with a string to
+ replace consisting of a single character.
+
+ *) Bugfix: requests might hang if resolver was used and a timeout
+ occurred during a DNS request.
+
+ *) Bugfix: in the ngx_http_spdy_module when using with AIO.
+
+ *) Bugfix: a segmentation fault might occur in a worker process if the
+ "set" directive was used to change the "$http_...", "$sent_http_...",
+ or "$upstream_http_..." variables.
+
+ *) Bugfix: in memory allocation error handling.
+ Thanks to Markus Linnala and Feng Gu.
+
+
Changes with nginx 1.7.4 05 Aug 2014
*) Security: pipelined commands were not discarded after STARTTLS
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES.ru b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru
index 720180c01af..4eff3ccf929 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/CHANGES.ru
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru
@@ -1,4 +1,62 @@
+Изменения в nginx 1.7.6 30.09.2014
+
+ *) Изменение: устаревшая директива limit_zone больше не поддерживается.
+
+ *) Добавление: в директивах limit_conn_zone и limit_req_zone теперь
+ можно использовать комбинации нескольких переменных.
+
+ *) Исправление: при повторной отправке FastCGI-запроса на бэкенд тело
+ запроса могло передаваться неправильно.
+
+ *) Исправление: в логгировании в syslog.
+
+
+Изменения в nginx 1.7.5 16.09.2014
+
+ *) Безопасность: при использовании общего для нескольких блоков server
+ разделяемого кэша SSL-сессий или общего ключа для шифрования TLS
+ session tickets было возможно повторно использовать SSL-сессию в
+ контексте другого блока server (CVE-2014-3616).
+ Спасибо Antoine Delignat-Lavaud.
+
+ *) Изменение: директиву stub_status теперь можно указывать без
+ параметров.
+
+ *) Добавление: параметр always директивы add_header.
+
+ *) Добавление: директивы proxy_next_upstream_tries,
+ proxy_next_upstream_timeout, fastcgi_next_upstream_tries,
+ fastcgi_next_upstream_timeout, memcached_next_upstream_tries,
+ memcached_next_upstream_timeout, scgi_next_upstream_tries,
+ scgi_next_upstream_timeout, uwsgi_next_upstream_tries и
+ uwsgi_next_upstream_timeout.
+
+ *) Исправление: в параметре if директивы access_log.
+
+ *) Исправление: в модуле ngx_http_perl_module.
+ Спасибо Piotr Sikora.
+
+ *) Исправление: директива listen почтового прокси-сервера не позволяла
+ указать более двух параметров.
+
+ *) Исправление: директива sub_filter не работала с заменяемой строкой из
+ одного символа.
+
+ *) Исправление: запросы могли зависать, если использовался resolver и в
+ процессе обращения к DNS-серверу происходил таймаут.
+
+ *) Исправление: в модуле ngx_http_spdy_module при использовании
+ совместно с AIO.
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
+ если с помощью директивы set изменялись переменные "$http_...",
+ "$sent_http_..." или "$upstream_http_...".
+
+ *) Исправление: в обработке ошибок выделения памяти.
+ Спасибо Markus Linnala и Feng Gu.
+
+
Изменения в nginx 1.7.4 05.08.2014
*) Безопасность: pipelined-команды не отбрасывались после команды
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/LICENSE b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE
index 4ed7a6fc7c6..4ed7a6fc7c6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/LICENSE
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/README b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README
index 2f68e14e0d8..2f68e14e0d8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/README
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/acc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc
index 6baee672ad4..6baee672ad4 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/acc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc
index ec82e60fb13..ec82e60fb13 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/ccc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc
index c964045105d..c964045105d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/ccc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/clang b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang
index 25707b42db2..25707b42db2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/clang
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf
index edc6d74ddfa..edc6d74ddfa 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/gcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc
index 727f11e1dfc..727f11e1dfc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/gcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/icc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc
index 1d83ed37a03..1d83ed37a03 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/icc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc
index 393ba321499..393ba321499 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/name b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name
index 51a7ed92e1d..51a7ed92e1d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/name
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc
index a063aa34121..a063aa34121 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/owc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/sunc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc
index 8f12d7cd7fe..8f12d7cd7fe 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/cc/sunc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/define b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define
index b5a7622590d..b5a7622590d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/define
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/endianness b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness
index 93da2f80d99..93da2f80d99 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/endianness
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/feature b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature
index 1145f28684b..1145f28684b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/feature
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have
index f8e3751c5f0..f8e3751c5f0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have_headers b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers
index a3a75430aa4..a3a75430aa4 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/have_headers
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/headers b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers
index 5a2e6b9023f..5a2e6b9023f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/headers
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/include b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include
index e34dabdae1d..e34dabdae1d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/include
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/init b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init
index 910f5294b66..910f5294b66 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/init
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf
index e1e447557e9..e1e447557e9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/geoip/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf
index 53c274d54dc..53c274d54dc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/geoip/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/google-perftools/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf
index 5d5ddaef60d..5d5ddaef60d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/google-perftools/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf
index d1e484ab32e..d1e484ab32e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make
index c90318ea122..c90318ea122 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libatomic/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libgd/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf
index ff99054db68..ff99054db68 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libgd/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libxslt/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf
index bc19d83ddce..bc19d83ddce 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/libxslt/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make
index 58a84a34cac..58a84a34cac 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf
index eb5dfd1f236..eb5dfd1f236 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make
index 81f138ab671..81f138ab671 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc
index eb6fb624178..eb6fb624178 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc
index 90d62fac7f0..90d62fac7f0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc
index 78c1e61dde7..78c1e61dde7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/md5/makefile.owc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf
index a65815f6364..a65815f6364 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make
index e64acd973ec..e64acd973ec 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc
index 6a94ff74982..6a94ff74982 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc
index fc9e57864ae..fc9e57864ae 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/openssl/makefile.msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf
index 939f01b77a4..939f01b77a4 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make
index 0a27a112c11..0a27a112c11 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc
index 7a0f2beafc6..7a0f2beafc6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc
index 07fd9a2853a..07fd9a2853a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc
index 122fd5b27f2..122fd5b27f2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/pcre/makefile.owc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf
index 2a1a3fe3cf2..2a1a3fe3cf2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make
index d1c1b9e48c1..d1c1b9e48c1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/perl/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf
index fd69afda22b..fd69afda22b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make
index fc10aaef38b..fc10aaef38b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc
index b0685fa4512..b0685fa4512 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc
index 3cbd21b3dbd..3cbd21b3dbd 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc
index fc095cc980a..fc095cc980a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/sha1/makefile.owc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/test b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test
index ba943a29d40..ba943a29d40 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/test
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf
index 26db642ac90..26db642ac90 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make
index 7875ef67fe0..7875ef67fe0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc
index 97a30ea3951..97a30ea3951 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.bcc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc
index 6fbd6918c2f..6fbd6918c2f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.msvc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc
index 9e123be83e9..9e123be83e9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/lib/zlib/makefile.owc
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make
index 05b74543c53..05b74543c53 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/make
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/modules b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules
index 78859676357..78859676357 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/modules
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/nohave b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave
index dfb171837c5..dfb171837c5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/nohave
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/options b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options
index 0d296ac6027..0d296ac6027 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/options
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf
index fe720160ada..fe720160ada 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/darwin b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin
index b97518a6ea0..b97518a6ea0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/darwin
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/freebsd b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd
index 6aa823f9250..6aa823f9250 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/freebsd
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/linux b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux
index 19bf832ce3e..19bf832ce3e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/linux
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/solaris b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris
index d39df0bf713..d39df0bf713 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/solaris
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/win32 b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32
index 0b9b461875f..0b9b461875f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/os/win32
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/sources b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources
index 1287782ead8..1287782ead8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/sources
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/stubs b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs
index d8bc1f0e02a..d8bc1f0e02a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/stubs
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/summary b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary
index dcebec9f0fe..dcebec9f0fe 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/summary
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/sizeof b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof
index 9215a545fc4..9215a545fc4 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/sizeof
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/typedef b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef
index 8b5c3689ced..8b5c3689ced 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/typedef
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/uintptr_t b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t
index f3cdccb2274..f3cdccb2274 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/uintptr_t
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/value b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value
index ac88a3919ef..ac88a3919ef 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/types/value
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/unix b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix
index 9b4764c6d24..9b4764c6d24 100755
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/auto/unix
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi.conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf
index ac9ff92049f..ac9ff92049f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi.conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params
index 71e2c2e3bed..71e2c2e3bed 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/fastcgi_params
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf
index e7974ff6ad9..e7974ff6ad9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-utf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-win b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win
index 72afabe89b8..72afabe89b8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/koi-win
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/mime.types b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types
index 89be9a4cd63..89be9a4cd63 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/mime.types
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/nginx.conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf
index 29bc085f28c..29bc085f28c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/nginx.conf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/scgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params
index 47348ca381c..47348ca381c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/scgi_params
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/uwsgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params
index f539451b6f5..f539451b6f5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/uwsgi_params
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/win-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf
index ed8bc007a72..ed8bc007a72 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/conf/win-utf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/README b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README
index fec4b200863..fec4b200863 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/README
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/geo2nginx.pl b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl
index 29243ecf2b2..29243ecf2b2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/geo2nginx.pl
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/koi-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf
index 48853af9af9..48853af9af9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/koi-utf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/unicode-to-nginx.pl b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl
index daaf354a830..daaf354a830 100755
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/unicode-to-nginx.pl
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/win-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf
index af9f9aaa502..af9f9aaa502 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/unicode2nginx/win-utf
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/ftdetect/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim
index 3ae470d2494..3ae470d2494 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/ftdetect/nginx.vim
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/indent/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim
index 8601366854a..8601366854a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/indent/nginx.vim
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/syntax/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim
index 50d809bc460..50d809bc460 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/contrib/vim/syntax/nginx.vim
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/50x.html b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html
index f60f5e72d17..f60f5e72d17 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/50x.html
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/index.html b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html
index 2ca3b9543c0..2ca3b9543c0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/html/index.html
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/man/nginx.8 b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8
index f119a2327a8..f119a2327a8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/man/nginx.8
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_aio_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c
index c881319d179..c881319d179 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_aio_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_devpoll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c
index 0506103e616..5658e8620b2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_devpoll_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c
@@ -344,7 +344,8 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ngx_err_t err;
ngx_int_t i;
ngx_uint_t level, instance;
- ngx_event_t *rev, *wev, **queue;
+ ngx_event_t *rev, *wev;
+ ngx_queue_t *queue;
ngx_connection_t *c;
struct pollfd pfd;
struct dvpoll dvp;
@@ -404,8 +405,6 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for (i = 0; i < events; i++) {
fd = event_list[i].fd;
@@ -495,19 +494,13 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
rev = c->read;
if ((revents & POLLIN) && rev->active) {
-
- if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) {
- rev->posted_ready = 1;
-
- } else {
- rev->ready = 1;
- }
+ rev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (rev->accept ?
- &ngx_posted_accept_events : &ngx_posted_events);
+ queue = rev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- ngx_locked_post_event(rev, queue);
+ ngx_post_event(rev, queue);
} else {
instance = rev->instance;
@@ -523,16 +516,10 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
wev = c->write;
if ((revents & POLLOUT) && wev->active) {
-
- if (flags & NGX_POST_THREAD_EVENTS) {
- wev->posted_ready = 1;
-
- } else {
- wev->ready = 1;
- }
+ wev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- ngx_locked_post_event(wev, &ngx_posted_events);
+ ngx_post_event(wev, &ngx_posted_events);
} else {
wev->handler(wev);
@@ -540,8 +527,6 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
return NGX_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_epoll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c
index a098c1c00c7..2674d382b69 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_epoll_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c
@@ -568,7 +568,8 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
ngx_int_t instance, i;
ngx_uint_t level;
ngx_err_t err;
- ngx_event_t *rev, *wev, **queue;
+ ngx_event_t *rev, *wev;
+ ngx_queue_t *queue;
ngx_connection_t *c;
/* NGX_TIMER_INFINITE == INFTIM */
@@ -612,8 +613,6 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for (i = 0; i < events; i++) {
c = event_list[i].data.ptr;
@@ -674,18 +673,13 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
}
#endif
- if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) {
- rev->posted_ready = 1;
-
- } else {
- rev->ready = 1;
- }
+ rev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (rev->accept ?
- &ngx_posted_accept_events : &ngx_posted_events);
+ queue = rev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- ngx_locked_post_event(rev, queue);
+ ngx_post_event(rev, queue);
} else {
rev->handler(rev);
@@ -708,15 +702,10 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
continue;
}
- if (flags & NGX_POST_THREAD_EVENTS) {
- wev->posted_ready = 1;
-
- } else {
- wev->ready = 1;
- }
+ wev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- ngx_locked_post_event(wev, &ngx_posted_events);
+ ngx_post_event(wev, &ngx_posted_events);
} else {
wev->handler(wev);
@@ -724,8 +713,6 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
return NGX_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_eventport_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c
index 5f9cf4e35fb..a9d8a6246f1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_eventport_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c
@@ -414,7 +414,8 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ngx_err_t err;
ngx_int_t instance;
ngx_uint_t i, level;
- ngx_event_t *ev, *rev, *wev, **queue;
+ ngx_event_t *ev, *rev, *wev;
+ ngx_queue_t *queue;
ngx_connection_t *c;
struct timespec ts, *tp;
@@ -466,8 +467,6 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for (i = 0; i < events; i++) {
if (event_list[i].portev_source == PORT_SOURCE_TIMER) {
@@ -534,19 +533,13 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
wev->active = 0;
if (revents & POLLIN) {
-
- if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) {
- rev->posted_ready = 1;
-
- } else {
- rev->ready = 1;
- }
+ rev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (rev->accept ?
- &ngx_posted_accept_events : &ngx_posted_events);
+ queue = rev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- ngx_locked_post_event(rev, queue);
+ ngx_post_event(rev, queue);
} else {
rev->handler(rev);
@@ -574,16 +567,10 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
if (revents & POLLOUT) {
-
- if (flags & NGX_POST_THREAD_EVENTS) {
- wev->posted_ready = 1;
-
- } else {
- wev->ready = 1;
- }
+ wev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- ngx_locked_post_event(wev, &ngx_posted_events);
+ ngx_post_event(wev, &ngx_posted_events);
} else {
wev->handler(wev);
@@ -600,8 +587,6 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
return NGX_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_kqueue_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c
index 30e456c4da0..9e7a1bdb692 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_kqueue_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c
@@ -495,7 +495,8 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ngx_int_t i, instance;
ngx_uint_t level;
ngx_err_t err;
- ngx_event_t *ev, **queue;
+ ngx_event_t *ev;
+ ngx_queue_t *queue;
struct timespec ts, *tp;
if (ngx_threaded) {
@@ -573,8 +574,6 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for (i = 0; i < events; i++) {
ngx_kqueue_dump_event(cycle->log, &event_list[i]);
@@ -626,24 +625,6 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ev->active = 0;
}
-#if (NGX_THREADS)
-
- if ((flags & NGX_POST_THREAD_EVENTS) && !ev->accept) {
- ev->posted_ready = 1;
- ev->posted_available = event_list[i].data;
-
- if (event_list[i].flags & EV_EOF) {
- ev->posted_eof = 1;
- ev->posted_errno = event_list[i].fflags;
- }
-
- ngx_locked_post_event(ev, &ngx_posted_events);
-
- continue;
- }
-
-#endif
-
ev->available = event_list[i].data;
if (event_list[i].flags & EV_EOF) {
@@ -674,9 +655,10 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (ev->accept ? &ngx_posted_accept_events:
- &ngx_posted_events);
- ngx_locked_post_event(ev, queue);
+ queue = ev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
+
+ ngx_post_event(ev, queue);
continue;
}
@@ -684,8 +666,6 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
ev->handler(ev);
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
return NGX_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_poll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c
index 4d4521845a8..bad1a7d2a2d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_poll_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c
@@ -22,7 +22,7 @@ static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf);
static struct pollfd *event_list;
-static ngx_int_t nevents;
+static ngx_uint_t nevents;
static ngx_str_t poll_name = ngx_string("poll");
@@ -198,7 +198,7 @@ ngx_poll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
if (e == NULL || e->index == NGX_INVALID_INDEX) {
nevents--;
- if (ev->index < (ngx_uint_t) nevents) {
+ if (ev->index < nevents) {
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"index: copy event %ui to %i", nevents, ev->index);
@@ -212,11 +212,11 @@ ngx_poll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
"unexpected last event");
} else {
- if (c->read->index == (ngx_uint_t) nevents) {
+ if (c->read->index == nevents) {
c->read->index = ev->index;
}
- if (c->write->index == (ngx_uint_t) nevents) {
+ if (c->write->index == nevents) {
c->write->index = ev->index;
}
}
@@ -240,9 +240,9 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
{
int ready, revents;
ngx_err_t err;
- ngx_int_t i, nready;
- ngx_uint_t found, level;
- ngx_event_t *ev, **queue;
+ ngx_uint_t i, found, level;
+ ngx_event_t *ev;
+ ngx_queue_t *queue;
ngx_connection_t *c;
/* NGX_TIMER_INFINITE == INFTIM */
@@ -251,7 +251,7 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
if (cycle->log->log_level & NGX_LOG_DEBUG_ALL) {
for (i = 0; i < nevents; i++) {
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %d: fd:%d ev:%04Xd",
+ "poll: %ui: fd:%d ev:%04Xd",
i, event_list[i].fd, event_list[i].events);
}
}
@@ -268,7 +268,7 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
}
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll ready %d of %d", ready, nevents);
+ "poll ready %d of %ui", ready, nevents);
if (err) {
if (err == NGX_EINTR) {
@@ -298,22 +298,18 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
- nready = 0;
-
for (i = 0; i < nevents && ready; i++) {
revents = event_list[i].revents;
#if 1
ngx_log_debug4(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %d: fd:%d ev:%04Xd rev:%04Xd",
+ "poll: %ui: fd:%d ev:%04Xd rev:%04Xd",
i, event_list[i].fd, event_list[i].events, revents);
#else
if (revents) {
ngx_log_debug4(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %d: fd:%d ev:%04Xd rev:%04Xd",
+ "poll: %ui: fd:%d ev:%04Xd rev:%04Xd",
i, event_list[i].fd, event_list[i].events, revents);
}
#endif
@@ -375,31 +371,21 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
found = 1;
ev = c->read;
+ ev->ready = 1;
- if ((flags & NGX_POST_THREAD_EVENTS) && !ev->accept) {
- ev->posted_ready = 1;
-
- } else {
- ev->ready = 1;
- }
+ queue = ev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- queue = (ngx_event_t **) (ev->accept ? &ngx_posted_accept_events:
- &ngx_posted_events);
- ngx_locked_post_event(ev, queue);
+ ngx_post_event(ev, queue);
}
if ((revents & POLLOUT) && c->write->active) {
found = 1;
- ev = c->write;
- if (flags & NGX_POST_THREAD_EVENTS) {
- ev->posted_ready = 1;
-
- } else {
- ev->ready = 1;
- }
+ ev = c->write;
+ ev->ready = 1;
- ngx_locked_post_event(ev, &ngx_posted_events);
+ ngx_post_event(ev, &ngx_posted_events);
}
if (found) {
@@ -408,13 +394,11 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
if (ready != 0) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "poll ready != events");
}
- return nready;
+ return NGX_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_rtsig_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c
index b36230c7650..9e31afa1cef 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_rtsig_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c
@@ -307,7 +307,8 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
ngx_int_t instance;
ngx_err_t err;
siginfo_t si;
- ngx_event_t *rev, *wev, **queue;
+ ngx_event_t *rev, *wev;
+ ngx_queue_t *queue;
struct timespec ts, *tp;
struct sigaction sa;
ngx_connection_t *c;
@@ -404,10 +405,10 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
rev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (rev->accept ?
- &ngx_posted_accept_events : &ngx_posted_events);
+ queue = rev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- ngx_locked_post_event(rev, queue);
+ ngx_post_event(rev, queue);
} else {
rev->handler(rev);
@@ -421,7 +422,7 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
wev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- ngx_locked_post_event(wev, &ngx_posted_events);
+ ngx_post_event(wev, &ngx_posted_events);
} else {
wev->handler(wev);
@@ -480,7 +481,8 @@ ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
size_t len;
ngx_err_t err;
ngx_uint_t tested, n, i;
- ngx_event_t *rev, *wev, **queue;
+ ngx_event_t *rev, *wev;
+ ngx_queue_t *queue;
ngx_connection_t *c;
ngx_rtsig_conf_t *rtscf;
@@ -554,8 +556,6 @@ ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
continue;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for (i = 0; i < n; i++) {
c = cycle->files[overflow_list[i].fd];
@@ -573,18 +573,13 @@ ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
{
tested++;
- if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) {
- rev->posted_ready = 1;
-
- } else {
- rev->ready = 1;
- }
+ rev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- queue = (ngx_event_t **) (rev->accept ?
- &ngx_posted_accept_events : &ngx_posted_events);
+ queue = rev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
- ngx_locked_post_event(rev, queue);
+ ngx_post_event(rev, queue);
} else {
rev->handler(rev);
@@ -601,15 +596,10 @@ ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
{
tested++;
- if (flags & NGX_POST_THREAD_EVENTS) {
- wev->posted_ready = 1;
-
- } else {
- wev->ready = 1;
- }
+ wev->ready = 1;
if (flags & NGX_POST_EVENTS) {
- ngx_locked_post_event(wev, &ngx_posted_events);
+ ngx_post_event(wev, &ngx_posted_events);
} else {
wev->handler(wev);
@@ -617,8 +607,6 @@ ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
if (tested >= rtscf->overflow_test) {
if (ngx_linux_rtsig_max) {
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_select_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c
index 51690558e91..fa2d55ae2ac 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_select_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c
@@ -214,7 +214,8 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
int ready, nready;
ngx_err_t err;
ngx_uint_t i, found;
- ngx_event_t *ev, **queue;
+ ngx_event_t *ev;
+ ngx_queue_t *queue;
struct timeval tv, *tp;
ngx_connection_t *c;
@@ -227,7 +228,7 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "change max_fd: %d", max_fd);
+ "change max_fd: %i", max_fd);
}
#if (NGX_DEBUG)
@@ -240,7 +241,7 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
}
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "max_fd: %d", max_fd);
+ "max_fd: %i", max_fd);
}
#endif
@@ -305,8 +306,6 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
nready = 0;
for (i = 0; i < nevents; i++) {
@@ -332,16 +331,15 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
if (found) {
ev->ready = 1;
- queue = (ngx_event_t **) (ev->accept ? &ngx_posted_accept_events:
- &ngx_posted_events);
- ngx_locked_post_event(ev, queue);
+ queue = ev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
+
+ ngx_post_event(ev, queue);
nready++;
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
if (ready != nready) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"select ready != events: %d:%d", ready, nready);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_win32_select_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c
index eb5382d4e0b..be87ded247f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/modules/ngx_win32_select_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c
@@ -221,7 +221,8 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
int ready, nready;
ngx_err_t err;
ngx_uint_t i, found;
- ngx_event_t *ev, **queue;
+ ngx_event_t *ev;
+ ngx_queue_t *queue;
struct timeval tv, *tp;
ngx_connection_t *c;
@@ -296,8 +297,6 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
return NGX_ERROR;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
nready = 0;
for (i = 0; i < nevents; i++) {
@@ -323,16 +322,15 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
if (found) {
ev->ready = 1;
- queue = (ngx_event_t **) (ev->accept ? &ngx_posted_accept_events:
- &ngx_posted_events);
- ngx_locked_post_event(ev, queue);
+ queue = ev->accept ? &ngx_posted_accept_events
+ : &ngx_posted_events;
+
+ ngx_post_event(ev, queue);
nready++;
}
}
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
if (ready != nready) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"select ready != events: %d:%d", ready, nready);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c
index e2857f0c05c..26c3b971669 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c
@@ -252,9 +252,7 @@ ngx_process_events_and_timers(ngx_cycle_t *cycle)
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"timer delta: %M", delta);
- if (ngx_posted_accept_events) {
- ngx_event_process_posted(cycle, &ngx_posted_accept_events);
- }
+ ngx_event_process_posted(cycle, &ngx_posted_accept_events);
if (ngx_accept_mutex_held) {
ngx_shmtx_unlock(&ngx_accept_mutex);
@@ -264,17 +262,7 @@ ngx_process_events_and_timers(ngx_cycle_t *cycle)
ngx_event_expire_timers();
}
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted events %p", ngx_posted_events);
-
- if (ngx_posted_events) {
- if (ngx_threaded) {
- ngx_wakeup_worker_thread(cycle);
-
- } else {
- ngx_event_process_posted(cycle, &ngx_posted_events);
- }
- }
+ ngx_event_process_posted(cycle, &ngx_posted_events);
}
@@ -617,12 +605,8 @@ ngx_event_process_init(ngx_cycle_t *cycle)
#endif
-#if (NGX_THREADS)
- ngx_posted_events_mutex = ngx_mutex_init(cycle->log, 0);
- if (ngx_posted_events_mutex == NULL) {
- return NGX_ERROR;
- }
-#endif
+ ngx_queue_init(&ngx_posted_accept_events);
+ ngx_queue_init(&ngx_posted_events);
if (ngx_event_timer_init(cycle->log) == NGX_ERROR) {
return NGX_ERROR;
@@ -712,10 +696,6 @@ ngx_event_process_init(ngx_cycle_t *cycle)
for (i = 0; i < cycle->connection_n; i++) {
rev[i].closed = 1;
rev[i].instance = 1;
-#if (NGX_THREADS)
- rev[i].lock = &c[i].lock;
- rev[i].own_lock = &c[i].lock;
-#endif
}
cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n,
@@ -727,10 +707,6 @@ ngx_event_process_init(ngx_cycle_t *cycle)
wev = cycle->write_events;
for (i = 0; i < cycle->connection_n; i++) {
wev[i].closed = 1;
-#if (NGX_THREADS)
- wev[i].lock = &c[i].lock;
- wev[i].own_lock = &c[i].lock;
-#endif
}
i = cycle->connection_n;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h
index 530c9486c51..6531ec7add3 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h
@@ -74,9 +74,7 @@ struct ngx_event_s {
/* the pending eof reported by kqueue, epoll or in aio chain operation */
unsigned pending_eof:1;
-#if !(NGX_THREADS)
- unsigned posted_ready:1;
-#endif
+ unsigned posted:1;
#if (NGX_WIN32)
/* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was successful */
@@ -129,40 +127,15 @@ struct ngx_event_s {
ngx_rbtree_node_t timer;
+ /* the posted queue */
+ ngx_queue_t queue;
+
unsigned closed:1;
/* to test on worker exit */
unsigned channel:1;
unsigned resolver:1;
-#if (NGX_THREADS)
-
- unsigned locked:1;
-
- unsigned posted_ready:1;
- unsigned posted_timedout:1;
- unsigned posted_eof:1;
-
-#if (NGX_HAVE_KQUEUE)
- /* the pending errno reported by kqueue */
- int posted_errno;
-#endif
-
-#if (NGX_HAVE_KQUEUE) || (NGX_HAVE_IOCP)
- int posted_available;
-#else
- unsigned posted_available:1;
-#endif
-
- ngx_atomic_t *lock;
- ngx_atomic_t *own_lock;
-
-#endif
-
- /* the links of the posted queue */
- ngx_event_t *next;
- ngx_event_t **prev;
-
#if 0
@@ -519,7 +492,6 @@ extern ngx_atomic_t *ngx_stat_waiting;
#define NGX_UPDATE_TIME 1
#define NGX_POST_EVENTS 2
-#define NGX_POST_THREAD_EVENTS 4
extern sig_atomic_t ngx_event_timer_alarm;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_accept.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c
index 575ee4bdb03..6285baafba2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_accept.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c
@@ -262,13 +262,6 @@ ngx_event_accept(ngx_event_t *ev)
(void) ngx_atomic_fetch_add(ngx_stat_handled, 1);
#endif
-#if (NGX_THREADS)
- rev->lock = &c->lock;
- wev->lock = &c->lock;
- rev->own_lock = &c->lock;
- wev->own_lock = &c->lock;
-#endif
-
if (ls->addr_ntop) {
c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len);
if (c->addr_text.data == NULL) {
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c
index fdac0da8fd2..fdac0da8fd2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h
index 254c233e776..254c233e776 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_busy_lock.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c
index 5fcabcfd1fa..a09d2e5d704 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c
@@ -104,17 +104,6 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
-#if (NGX_THREADS)
-
- /* TODO: lock event when call completion handler */
-
- rev->lock = pc->lock;
- wev->lock = pc->lock;
- rev->own_lock = &c->lock;
- wev->own_lock = &c->lock;
-
-#endif
-
if (ngx_add_conn) {
if (ngx_add_conn(c) == NGX_ERROR) {
goto failed;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h
index 951c24f411c..e73825885fc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_connect.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h
@@ -42,6 +42,7 @@ struct ngx_peer_connection_s {
ngx_str_t *name;
ngx_uint_t tries;
+ ngx_msec_t start_time;
ngx_event_get_peer_pt get;
ngx_event_free_peer_pt free;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_mutex.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c
index 2bdfd5b4ecc..98efbb0d87e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_mutex.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c
@@ -62,7 +62,7 @@ ngx_int_t ngx_event_mutex_unlock(ngx_event_mutex_t *m, ngx_log_t *log)
ev = m->events;
m->events = ev->next;
- ev->next = (ngx_event_t *) ngx_posted_events;
+ ev->next = ngx_posted_events;
ngx_posted_events = ev;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c
index bb82143d3ed..975a8e00111 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c
@@ -33,6 +33,8 @@ static void ngx_ssl_connection_error(ngx_connection_t *c, int sslerr,
ngx_err_t err, char *text);
static void ngx_ssl_clear_error(ngx_log_t *log);
+static ngx_int_t ngx_ssl_session_id_context(ngx_ssl_t *ssl,
+ ngx_str_t *sess_ctx);
ngx_int_t ngx_ssl_session_cache_init(ngx_shm_zone_t *shm_zone, void *data);
static int ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn,
ngx_ssl_session_t *sess);
@@ -206,13 +208,23 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)
/* client side options */
+#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_MICROSOFT_SESS_ID_BUG);
+#endif
+
+#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_NETSCAPE_CHALLENGE_BUG);
+#endif
/* server side options */
+#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG);
+#endif
+
+#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
SSL_CTX_set_options(ssl->ctx, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER);
+#endif
#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING
/* this option allow a potential SSL 2.0 rollback (CAN-2005-2969) */
@@ -223,10 +235,17 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)
SSL_CTX_set_options(ssl->ctx, SSL_OP_SSLEAY_080_CLIENT_DH_BUG);
#endif
+#ifdef SSL_OP_TLS_D5_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_D5_BUG);
+#endif
+
+#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_BLOCK_PADDING_BUG);
+#endif
+#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
SSL_CTX_set_options(ssl->ctx, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
+#endif
SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_DH_USE);
@@ -1956,13 +1975,15 @@ ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
SSL_CTX_set_timeout(ssl->ctx, (long) timeout);
+ if (ngx_ssl_session_id_context(ssl, sess_ctx) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
if (builtin_session_cache == NGX_SSL_NO_SCACHE) {
SSL_CTX_set_session_cache_mode(ssl->ctx, SSL_SESS_CACHE_OFF);
return NGX_OK;
}
- SSL_CTX_set_session_id_context(ssl->ctx, sess_ctx->data, sess_ctx->len);
-
if (builtin_session_cache == NGX_SSL_NONE_SCACHE) {
/*
@@ -2019,6 +2040,96 @@ ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
}
+static ngx_int_t
+ngx_ssl_session_id_context(ngx_ssl_t *ssl, ngx_str_t *sess_ctx)
+{
+ int n, i;
+ X509 *cert;
+ X509_NAME *name;
+ EVP_MD_CTX md;
+ unsigned int len;
+ STACK_OF(X509_NAME) *list;
+ u_char buf[EVP_MAX_MD_SIZE];
+
+ /*
+ * Session ID context is set based on the string provided,
+ * the server certificate, and the client CA list.
+ */
+
+ EVP_MD_CTX_init(&md);
+
+ if (EVP_DigestInit_ex(&md, EVP_sha1(), NULL) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "EVP_DigestInit_ex() failed");
+ goto failed;
+ }
+
+ if (EVP_DigestUpdate(&md, sess_ctx->data, sess_ctx->len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "EVP_DigestUpdate() failed");
+ goto failed;
+ }
+
+ cert = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_certificate_index);
+
+ if (X509_digest(cert, EVP_sha1(), buf, &len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "X509_digest() failed");
+ goto failed;
+ }
+
+ if (EVP_DigestUpdate(&md, buf, len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "EVP_DigestUpdate() failed");
+ goto failed;
+ }
+
+ list = SSL_CTX_get_client_CA_list(ssl->ctx);
+
+ if (list != NULL) {
+ n = sk_X509_NAME_num(list);
+
+ for (i = 0; i < n; i++) {
+ name = sk_X509_NAME_value(list, i);
+
+ if (X509_NAME_digest(name, EVP_sha1(), buf, &len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "X509_NAME_digest() failed");
+ goto failed;
+ }
+
+ if (EVP_DigestUpdate(&md, buf, len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "EVP_DigestUpdate() failed");
+ goto failed;
+ }
+ }
+ }
+
+ if (EVP_DigestFinal_ex(&md, buf, &len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "EVP_DigestUpdate() failed");
+ goto failed;
+ }
+
+ EVP_MD_CTX_cleanup(&md);
+
+ if (SSL_CTX_set_session_id_context(ssl->ctx, buf, len) == 0) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
+ "SSL_CTX_set_session_id_context() failed");
+ return NGX_ERROR;
+ }
+
+ return NGX_OK;
+
+failed:
+
+ EVP_MD_CTX_cleanup(&md);
+
+ return NGX_ERROR;
+}
+
+
ngx_int_t
ngx_ssl_session_cache_init(ngx_shm_zone_t *shm_zone, void *data)
{
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h
index 40869403519..40869403519 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl_stapling.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c
index 2fa0673093e..2fa0673093e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_openssl_stapling.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c
index 64fb07bde42..64fb07bde42 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h
index f24e6d148f5..f24e6d148f5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_pipe.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c
new file mode 100644
index 00000000000..d851f3d14fc
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c
@@ -0,0 +1,35 @@
+
+/*
+ * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+ngx_queue_t ngx_posted_accept_events;
+ngx_queue_t ngx_posted_events;
+
+
+void
+ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted)
+{
+ ngx_queue_t *q;
+ ngx_event_t *ev;
+
+ while (!ngx_queue_empty(posted)) {
+
+ q = ngx_queue_head(posted);
+ ev = ngx_queue_data(q, ngx_event_t, queue);
+
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
+ "posted event %p", ev);
+
+ ngx_delete_posted_event(ev);
+
+ ev->handler(ev);
+ }
+}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h
new file mode 100644
index 00000000000..40ba1c1e02b
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h
@@ -0,0 +1,48 @@
+
+/*
+ * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
+ */
+
+
+#ifndef _NGX_EVENT_POSTED_H_INCLUDED_
+#define _NGX_EVENT_POSTED_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+#define ngx_post_event(ev, q) \
+ \
+ if (!ev->posted) { \
+ ev->posted = 1; \
+ ngx_queue_insert_tail(q, &ev->queue); \
+ \
+ ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "post event %p", ev); \
+ \
+ } else { \
+ ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
+ "update posted event %p", ev); \
+ }
+
+
+#define ngx_delete_posted_event(ev) \
+ \
+ ev->posted = 0; \
+ ngx_queue_remove(&ev->queue); \
+ \
+ ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
+ "delete posted event %p", ev);
+
+
+
+void ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted);
+
+
+extern ngx_queue_t ngx_posted_accept_events;
+extern ngx_queue_t ngx_posted_events;
+
+
+#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c
index 177ac1cf113..1075586497d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c
@@ -98,24 +98,6 @@ ngx_event_expire_timers(void)
if ((ngx_msec_int_t) (node->key - ngx_current_msec) <= 0) {
ev = (ngx_event_t *) ((char *) node - offsetof(ngx_event_t, timer));
-#if (NGX_THREADS)
-
- if (ngx_threaded && ngx_trylock(ev->lock) == 0) {
-
- /*
- * We cannot change the timer of the event that is being
- * handled by another thread. And we cannot easy walk
- * the rbtree to find next expired timer so we exit the loop.
- * However, it should be a rare case when the event that is
- * being handled has an expired timer.
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "event %p is busy in expire timers", ev);
- break;
- }
-#endif
-
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"event timer del: %d: %M",
ngx_event_ident(ev->data), ev->timer.key);
@@ -132,18 +114,6 @@ ngx_event_expire_timers(void)
ev->timer_set = 0;
-#if (NGX_THREADS)
- if (ngx_threaded) {
- ev->posted_timedout = 1;
-
- ngx_post_event(ev, &ngx_posted_events);
-
- ngx_unlock(ev->lock);
-
- continue;
- }
-#endif
-
ev->timedout = 1;
ev->handler(ev);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h
index ec9b316bdc8..ec9b316bdc8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/event/ngx_event_timer.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_access_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c
index c553e46106b..c553e46106b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_access_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_addition_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c
index db4970bf1d6..db4970bf1d6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_addition_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_basic_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c
index 8ec53295fba..8ec53295fba 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_basic_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_request_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c
index b4307be2e7d..b4307be2e7d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_auth_request_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_autoindex_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c
index f694df075db..f694df075db 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_autoindex_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_browser_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c
index 80da0d8fa86..80da0d8fa86 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_browser_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_charset_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c
index 4ea98184b26..4ea98184b26 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_charset_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_chunked_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c
index a7dc5bf4d4b..a7dc5bf4d4b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_chunked_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_dav_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c
index 529aba53341..529aba53341 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_dav_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_degradation_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c
index b9c65cdc9e0..b9c65cdc9e0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_degradation_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_empty_gif_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c
index 04114dc3f41..04114dc3f41 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_empty_gif_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_fastcgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c
index 8016f5b75ba..a49c93ca21e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_fastcgi_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c
@@ -442,6 +442,20 @@ static ngx_command_t ngx_http_fastcgi_commands[] = {
offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream),
&ngx_http_fastcgi_next_upstream_masks },
+ { ngx_string("fastcgi_next_upstream_tries"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_tries),
+ NULL },
+
+ { ngx_string("fastcgi_next_upstream_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_timeout),
+ NULL },
+
{ ngx_string("fastcgi_param"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
ngx_http_upstream_param_set_slot,
@@ -1115,6 +1129,7 @@ ngx_http_fastcgi_create_request(ngx_http_request_t *r)
} else {
b->pos = pos;
+ b->start = pos;
pos += 32 * 1024;
if (pos >= body->buf->last) {
@@ -2314,6 +2329,7 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.store = NGX_CONF_UNSET;
conf->upstream.store_access = NGX_CONF_UNSET_UINT;
+ conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
conf->upstream.buffering = NGX_CONF_UNSET;
conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
@@ -2322,6 +2338,7 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
+ conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
@@ -2387,6 +2404,9 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_uint_value(conf->upstream.store_access,
prev->upstream.store_access, 0600);
+ ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
+ prev->upstream.next_upstream_tries, 0);
+
ngx_conf_merge_value(conf->upstream.buffering,
prev->upstream.buffering, 1);
@@ -2405,6 +2425,9 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->upstream.read_timeout,
prev->upstream.read_timeout, 60000);
+ ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
+ prev->upstream.next_upstream_timeout, 0);
+
ngx_conf_merge_size_value(conf->upstream.send_lowat,
prev->upstream.send_lowat, 0);
@@ -2582,6 +2605,11 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
conf->cache_key = prev->cache_key;
}
+ if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "no \"fastcgi_cache_key\" for \"fastcgi_cache\"");
+ }
+
ngx_conf_merge_value(conf->upstream.cache_lock,
prev->upstream.cache_lock, 0);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_flv_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c
index cc2532027cc..cc2532027cc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_flv_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geo_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c
index 9b3c6cb9cea..9b3c6cb9cea 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geo_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geoip_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c
index 8e151aa8f20..8e151aa8f20 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_geoip_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gunzip_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c
index 70ec0aacea6..70ec0aacea6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gunzip_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c
index c57a4a3c7cc..c57a4a3c7cc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_static_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c
index 4d54090772b..4d54090772b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_gzip_static_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_headers_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c
index e33e7ce5271..f33cfb78e3d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_headers_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c
@@ -28,6 +28,7 @@ struct ngx_http_header_val_s {
ngx_str_t key;
ngx_http_set_header_pt handler;
ngx_uint_t offset;
+ ngx_uint_t always; /* unsigned always:1 */
};
@@ -98,7 +99,7 @@ static ngx_command_t ngx_http_headers_filter_commands[] = {
{ ngx_string("add_header"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE2,
+ |NGX_CONF_TAKE23,
ngx_http_headers_add,
NGX_HTTP_LOC_CONF_OFFSET,
0,
@@ -146,28 +147,38 @@ static ngx_int_t
ngx_http_headers_filter(ngx_http_request_t *r)
{
ngx_str_t value;
- ngx_uint_t i;
+ ngx_uint_t i, safe_status;
ngx_http_header_val_t *h;
ngx_http_headers_conf_t *conf;
conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_filter_module);
if ((conf->expires == NGX_HTTP_EXPIRES_OFF && conf->headers == NULL)
- || r != r->main
- || (r->headers_out.status != NGX_HTTP_OK
- && r->headers_out.status != NGX_HTTP_CREATED
- && r->headers_out.status != NGX_HTTP_NO_CONTENT
- && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT
- && r->headers_out.status != NGX_HTTP_MOVED_PERMANENTLY
- && r->headers_out.status != NGX_HTTP_MOVED_TEMPORARILY
- && r->headers_out.status != NGX_HTTP_SEE_OTHER
- && r->headers_out.status != NGX_HTTP_NOT_MODIFIED
- && r->headers_out.status != NGX_HTTP_TEMPORARY_REDIRECT))
+ || r != r->main)
{
return ngx_http_next_header_filter(r);
}
- if (conf->expires != NGX_HTTP_EXPIRES_OFF) {
+ switch (r->headers_out.status) {
+
+ case NGX_HTTP_OK:
+ case NGX_HTTP_CREATED:
+ case NGX_HTTP_NO_CONTENT:
+ case NGX_HTTP_PARTIAL_CONTENT:
+ case NGX_HTTP_MOVED_PERMANENTLY:
+ case NGX_HTTP_MOVED_TEMPORARILY:
+ case NGX_HTTP_SEE_OTHER:
+ case NGX_HTTP_NOT_MODIFIED:
+ case NGX_HTTP_TEMPORARY_REDIRECT:
+ safe_status = 1;
+ break;
+
+ default:
+ safe_status = 0;
+ break;
+ }
+
+ if (conf->expires != NGX_HTTP_EXPIRES_OFF && safe_status) {
if (ngx_http_set_expires(r, conf) != NGX_OK) {
return NGX_ERROR;
}
@@ -177,6 +188,10 @@ ngx_http_headers_filter(ngx_http_request_t *r)
h = conf->headers->elts;
for (i = 0; i < conf->headers->nelts; i++) {
+ if (!safe_status && !h[i].always) {
+ continue;
+ }
+
if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) {
return NGX_ERROR;
}
@@ -603,6 +618,7 @@ ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
hv->key = value[1];
hv->handler = ngx_http_add_header;
hv->offset = 0;
+ hv->always = 0;
set = ngx_http_set_headers;
for (i = 0; set[i].name.len; i++) {
@@ -631,5 +647,17 @@ ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
+ if (cf->args->nelts == 3) {
+ return NGX_CONF_OK;
+ }
+
+ if (ngx_strcmp(value[3].data, "always") != 0) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid parameter \"%V\"", &value[3]);
+ return NGX_CONF_ERROR;
+ }
+
+ hv->always = 1;
+
return NGX_CONF_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_image_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c
index c983b973b46..bd7a3097015 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_image_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c
@@ -1012,6 +1012,7 @@ transparent:
b->last_buf = 1;
ngx_http_image_length(r, b);
+ ngx_http_weak_etag(r);
return b;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_index_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c
index d3544db5bf5..d3544db5bf5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_index_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_conn_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c
index 7f0eea7ab00..4379311ca83 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_conn_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c
@@ -11,41 +11,40 @@
typedef struct {
- u_char color;
- u_char len;
- u_short conn;
- u_char data[1];
+ u_char color;
+ u_char len;
+ u_short conn;
+ u_char data[1];
} ngx_http_limit_conn_node_t;
typedef struct {
- ngx_shm_zone_t *shm_zone;
- ngx_rbtree_node_t *node;
+ ngx_shm_zone_t *shm_zone;
+ ngx_rbtree_node_t *node;
} ngx_http_limit_conn_cleanup_t;
typedef struct {
- ngx_rbtree_t *rbtree;
- ngx_int_t index;
- ngx_str_t var;
+ ngx_rbtree_t *rbtree;
+ ngx_http_complex_value_t key;
} ngx_http_limit_conn_ctx_t;
typedef struct {
- ngx_shm_zone_t *shm_zone;
- ngx_uint_t conn;
+ ngx_shm_zone_t *shm_zone;
+ ngx_uint_t conn;
} ngx_http_limit_conn_limit_t;
typedef struct {
- ngx_array_t limits;
- ngx_uint_t log_level;
- ngx_uint_t status_code;
+ ngx_array_t limits;
+ ngx_uint_t log_level;
+ ngx_uint_t status_code;
} ngx_http_limit_conn_conf_t;
static ngx_rbtree_node_t *ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree,
- ngx_http_variable_value_t *vv, uint32_t hash);
+ ngx_str_t *key, uint32_t hash);
static void ngx_http_limit_conn_cleanup(void *data);
static ngx_inline void ngx_http_limit_conn_cleanup_all(ngx_pool_t *pool);
@@ -54,18 +53,11 @@ static char *ngx_http_limit_conn_merge_conf(ngx_conf_t *cf, void *parent,
void *child);
static char *ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
-static char *ngx_http_limit_zone(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
static char *ngx_http_limit_conn(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static ngx_int_t ngx_http_limit_conn_init(ngx_conf_t *cf);
-static ngx_conf_deprecated_t ngx_conf_deprecated_limit_zone = {
- ngx_conf_deprecated, "limit_zone", "limit_conn_zone"
-};
-
-
static ngx_conf_enum_t ngx_http_limit_conn_log_levels[] = {
{ ngx_string("info"), NGX_LOG_INFO },
{ ngx_string("notice"), NGX_LOG_NOTICE },
@@ -89,13 +81,6 @@ static ngx_command_t ngx_http_limit_conn_commands[] = {
0,
NULL },
- { ngx_string("limit_zone"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE3,
- ngx_http_limit_zone,
- 0,
- 0,
- NULL },
-
{ ngx_string("limit_conn"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
ngx_http_limit_conn,
@@ -155,13 +140,13 @@ ngx_module_t ngx_http_limit_conn_module = {
static ngx_int_t
ngx_http_limit_conn_handler(ngx_http_request_t *r)
{
- size_t len, n;
+ size_t n;
uint32_t hash;
+ ngx_str_t key;
ngx_uint_t i;
ngx_slab_pool_t *shpool;
ngx_rbtree_node_t *node;
ngx_pool_cleanup_t *cln;
- ngx_http_variable_value_t *vv;
ngx_http_limit_conn_ctx_t *ctx;
ngx_http_limit_conn_node_t *lc;
ngx_http_limit_conn_conf_t *lccf;
@@ -178,41 +163,37 @@ ngx_http_limit_conn_handler(ngx_http_request_t *r)
for (i = 0; i < lccf->limits.nelts; i++) {
ctx = limits[i].shm_zone->data;
- vv = ngx_http_get_indexed_variable(r, ctx->index);
-
- if (vv == NULL || vv->not_found) {
- continue;
+ if (ngx_http_complex_value(r, &ctx->key, &key) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- len = vv->len;
-
- if (len == 0) {
+ if (key.len == 0) {
continue;
}
- if (len > 255) {
+ if (key.len > 255) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the value of the \"%V\" variable "
- "is more than 255 bytes: \"%v\"",
- &ctx->var, vv);
+ "the value of the \"%V\" key "
+ "is more than 255 bytes: \"%V\"",
+ &ctx->key.value, &key);
continue;
}
r->main->limit_conn_set = 1;
- hash = ngx_crc32_short(vv->data, len);
+ hash = ngx_crc32_short(key.data, key.len);
shpool = (ngx_slab_pool_t *) limits[i].shm_zone->shm.addr;
ngx_shmtx_lock(&shpool->mutex);
- node = ngx_http_limit_conn_lookup(ctx->rbtree, vv, hash);
+ node = ngx_http_limit_conn_lookup(ctx->rbtree, &key, hash);
if (node == NULL) {
n = offsetof(ngx_rbtree_node_t, color)
+ offsetof(ngx_http_limit_conn_node_t, data)
- + len;
+ + key.len;
node = ngx_slab_alloc_locked(shpool, n);
@@ -225,9 +206,9 @@ ngx_http_limit_conn_handler(ngx_http_request_t *r)
lc = (ngx_http_limit_conn_node_t *) &node->color;
node->key = hash;
- lc->len = (u_char) len;
+ lc->len = (u_char) key.len;
lc->conn = 1;
- ngx_memcpy(lc->data, vv->data, len);
+ ngx_memcpy(lc->data, key.data, key.len);
ngx_rbtree_insert(ctx->rbtree, node);
@@ -314,8 +295,7 @@ ngx_http_limit_conn_rbtree_insert_value(ngx_rbtree_node_t *temp,
static ngx_rbtree_node_t *
-ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree, ngx_http_variable_value_t *vv,
- uint32_t hash)
+ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree, ngx_str_t *key, uint32_t hash)
{
ngx_int_t rc;
ngx_rbtree_node_t *node, *sentinel;
@@ -340,8 +320,8 @@ ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree, ngx_http_variable_value_t *vv,
lcn = (ngx_http_limit_conn_node_t *) &node->color;
- rc = ngx_memn2cmp(vv->data, lcn->data,
- (size_t) vv->len, (size_t) lcn->len);
+ rc = ngx_memn2cmp(key->data, lcn->data, key->len, (size_t) lcn->len);
+
if (rc == 0) {
return node;
}
@@ -413,11 +393,16 @@ ngx_http_limit_conn_init_zone(ngx_shm_zone_t *shm_zone, void *data)
ctx = shm_zone->data;
if (octx) {
- if (ngx_strcmp(ctx->var.data, octx->var.data) != 0) {
+ if (ctx->key.value.len != octx->key.value.len
+ || ngx_strncmp(ctx->key.value.data, octx->key.value.data,
+ ctx->key.value.len)
+ != 0)
+ {
ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "limit_conn_zone \"%V\" uses the \"%V\" variable "
- "while previously it used the \"%V\" variable",
- &shm_zone->shm.name, &ctx->var, &octx->var);
+ "limit_conn_zone \"%V\" uses the \"%V\" key "
+ "while previously it used the \"%V\" key",
+ &shm_zone->shm.name, &ctx->key.value,
+ &octx->key.value);
return NGX_ERROR;
}
@@ -507,20 +492,35 @@ ngx_http_limit_conn_merge_conf(ngx_conf_t *cf, void *parent, void *child)
static char *
ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
- u_char *p;
- ssize_t size;
- ngx_str_t *value, name, s;
- ngx_uint_t i;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_conn_ctx_t *ctx;
+ u_char *p;
+ ssize_t size;
+ ngx_str_t *value, name, s;
+ ngx_uint_t i;
+ ngx_shm_zone_t *shm_zone;
+ ngx_http_limit_conn_ctx_t *ctx;
+ ngx_http_compile_complex_value_t ccv;
value = cf->args->elts;
- ctx = NULL;
+ ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t));
+ if (ctx == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
+
+ ccv.cf = cf;
+ ccv.value = &value[1];
+ ccv.complex_value = &ctx->key;
+
+ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
+
size = 0;
name.len = 0;
- for (i = 1; i < cf->args->nelts; i++) {
+ for (i = 2; i < cf->args->nelts; i++) {
if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {
@@ -556,26 +556,6 @@ ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
continue;
}
- if (value[i].data[0] == '$') {
-
- value[i].len--;
- value[i].data++;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->index = ngx_http_get_variable_index(cf, &value[i]);
- if (ctx->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- ctx->var = value[i];
-
- continue;
- }
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid parameter \"%V\"", &value[i]);
return NGX_CONF_ERROR;
@@ -588,13 +568,6 @@ ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- if (ctx == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "no variable is defined for %V \"%V\"",
- &cmd->name, &name);
- return NGX_CONF_ERROR;
- }
-
shm_zone = ngx_shared_memory_add(cf, &name, size,
&ngx_http_limit_conn_module);
if (shm_zone == NULL) {
@@ -605,78 +578,8 @@ ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ctx = shm_zone->data;
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%V \"%V\" is already bound to variable \"%V\"",
- &cmd->name, &name, &ctx->var);
- return NGX_CONF_ERROR;
- }
-
- shm_zone->init = ngx_http_limit_conn_init_zone;
- shm_zone->data = ctx;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_limit_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ssize_t n;
- ngx_str_t *value;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_conn_ctx_t *ctx;
-
- ngx_conf_deprecated(cf, &ngx_conf_deprecated_limit_zone, NULL);
-
- value = cf->args->elts;
-
- if (value[2].data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
-
- value[2].len--;
- value[2].data++;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->index = ngx_http_get_variable_index(cf, &value[2]);
- if (ctx->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- ctx->var = value[2];
-
- n = ngx_parse_size(&value[3]);
-
- if (n == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid size of limit_zone \"%V\"", &value[3]);
- return NGX_CONF_ERROR;
- }
-
- if (n < (ngx_int_t) (8 * ngx_pagesize)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "limit_zone \"%V\" is too small", &value[1]);
- return NGX_CONF_ERROR;
- }
-
-
- shm_zone = ngx_shared_memory_add(cf, &value[1], n,
- &ngx_http_limit_conn_module);
- if (shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (shm_zone->data) {
- ctx = shm_zone->data;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "limit_zone \"%V\" is already bound to variable \"%V\"",
- &value[1], &ctx->var);
+ "%V \"%V\" is already bound to key \"%V\"",
+ &cmd->name, &name, &ctx->key.value);
return NGX_CONF_ERROR;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_req_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c
index 74f7fdaa75f..5d5cbe94406 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_limit_req_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c
@@ -35,8 +35,7 @@ typedef struct {
ngx_slab_pool_t *shpool;
/* integer value, 1 corresponds to 0.001 r/s */
ngx_uint_t rate;
- ngx_int_t index;
- ngx_str_t var;
+ ngx_http_complex_value_t key;
ngx_http_limit_req_node_t *node;
} ngx_http_limit_req_ctx_t;
@@ -59,8 +58,7 @@ typedef struct {
static void ngx_http_limit_req_delay(ngx_http_request_t *r);
static ngx_int_t ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit,
- ngx_uint_t hash, u_char *data, size_t len, ngx_uint_t *ep,
- ngx_uint_t account);
+ ngx_uint_t hash, ngx_str_t *key, ngx_uint_t *ep, ngx_uint_t account);
static ngx_msec_t ngx_http_limit_req_account(ngx_http_limit_req_limit_t *limits,
ngx_uint_t n, ngx_uint_t *ep, ngx_http_limit_req_limit_t **limit);
static void ngx_http_limit_req_expire(ngx_http_limit_req_ctx_t *ctx,
@@ -158,12 +156,11 @@ ngx_module_t ngx_http_limit_req_module = {
static ngx_int_t
ngx_http_limit_req_handler(ngx_http_request_t *r)
{
- size_t len;
uint32_t hash;
+ ngx_str_t key;
ngx_int_t rc;
ngx_uint_t n, excess;
ngx_msec_t delay;
- ngx_http_variable_value_t *vv;
ngx_http_limit_req_ctx_t *ctx;
ngx_http_limit_req_conf_t *lrcf;
ngx_http_limit_req_limit_t *limit, *limits;
@@ -189,31 +186,27 @@ ngx_http_limit_req_handler(ngx_http_request_t *r)
ctx = limit->shm_zone->data;
- vv = ngx_http_get_indexed_variable(r, ctx->index);
-
- if (vv == NULL || vv->not_found) {
- continue;
+ if (ngx_http_complex_value(r, &ctx->key, &key) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- len = vv->len;
-
- if (len == 0) {
+ if (key.len == 0) {
continue;
}
- if (len > 65535) {
+ if (key.len > 65535) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the value of the \"%V\" variable "
- "is more than 65535 bytes: \"%v\"",
- &ctx->var, vv);
+ "the value of the \"%V\" key "
+ "is more than 65535 bytes: \"%V\"",
+ &ctx->key.value, &key);
continue;
}
- hash = ngx_crc32_short(vv->data, len);
+ hash = ngx_crc32_short(key.data, key.len);
ngx_shmtx_lock(&ctx->shpool->mutex);
- rc = ngx_http_limit_req_lookup(limit, hash, vv->data, len, &excess,
+ rc = ngx_http_limit_req_lookup(limit, hash, &key, &excess,
(n == lrcf->limits.nelts - 1));
ngx_shmtx_unlock(&ctx->shpool->mutex);
@@ -365,7 +358,7 @@ ngx_http_limit_req_rbtree_insert_value(ngx_rbtree_node_t *temp,
static ngx_int_t
ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
- u_char *data, size_t len, ngx_uint_t *ep, ngx_uint_t account)
+ ngx_str_t *key, ngx_uint_t *ep, ngx_uint_t account)
{
size_t size;
ngx_int_t rc, excess;
@@ -400,7 +393,7 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
lr = (ngx_http_limit_req_node_t *) &node->color;
- rc = ngx_memn2cmp(data, lr->data, len, (size_t) lr->len);
+ rc = ngx_memn2cmp(key->data, lr->data, key->len, (size_t) lr->len);
if (rc == 0) {
ngx_queue_remove(&lr->queue);
@@ -440,7 +433,7 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
size = offsetof(ngx_rbtree_node_t, color)
+ offsetof(ngx_http_limit_req_node_t, data)
- + len;
+ + key->len;
ngx_http_limit_req_expire(ctx, 1);
@@ -461,10 +454,10 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
lr = (ngx_http_limit_req_node_t *) &node->color;
- lr->len = (u_char) len;
+ lr->len = (u_short) key->len;
lr->excess = 0;
- ngx_memcpy(lr->data, data, len);
+ ngx_memcpy(lr->data, key->data, key->len);
ngx_rbtree_insert(&ctx->sh->rbtree, node);
@@ -632,11 +625,16 @@ ngx_http_limit_req_init_zone(ngx_shm_zone_t *shm_zone, void *data)
ctx = shm_zone->data;
if (octx) {
- if (ngx_strcmp(ctx->var.data, octx->var.data) != 0) {
+ if (ctx->key.value.len != octx->key.value.len
+ || ngx_strncmp(ctx->key.value.data, octx->key.value.data,
+ ctx->key.value.len)
+ != 0)
+ {
ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "limit_req \"%V\" uses the \"%V\" variable "
- "while previously it used the \"%V\" variable",
- &shm_zone->shm.name, &ctx->var, &octx->var);
+ "limit_req \"%V\" uses the \"%V\" key "
+ "while previously it used the \"%V\" key",
+ &shm_zone->shm.name, &ctx->key.value,
+ &octx->key.value);
return NGX_ERROR;
}
@@ -731,24 +729,39 @@ ngx_http_limit_req_merge_conf(ngx_conf_t *cf, void *parent, void *child)
static char *
ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
- u_char *p;
- size_t len;
- ssize_t size;
- ngx_str_t *value, name, s;
- ngx_int_t rate, scale;
- ngx_uint_t i;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_req_ctx_t *ctx;
+ u_char *p;
+ size_t len;
+ ssize_t size;
+ ngx_str_t *value, name, s;
+ ngx_int_t rate, scale;
+ ngx_uint_t i;
+ ngx_shm_zone_t *shm_zone;
+ ngx_http_limit_req_ctx_t *ctx;
+ ngx_http_compile_complex_value_t ccv;
value = cf->args->elts;
- ctx = NULL;
+ ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_req_ctx_t));
+ if (ctx == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
+
+ ccv.cf = cf;
+ ccv.value = &value[1];
+ ccv.complex_value = &ctx->key;
+
+ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
+
size = 0;
rate = 1;
scale = 1;
name.len = 0;
- for (i = 1; i < cf->args->nelts; i++) {
+ for (i = 2; i < cf->args->nelts; i++) {
if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {
@@ -808,26 +821,6 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
continue;
}
- if (value[i].data[0] == '$') {
-
- value[i].len--;
- value[i].data++;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_req_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->index = ngx_http_get_variable_index(cf, &value[i]);
- if (ctx->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- ctx->var = value[i];
-
- continue;
- }
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid parameter \"%V\"", &value[i]);
return NGX_CONF_ERROR;
@@ -840,13 +833,6 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- if (ctx == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "no variable is defined for %V \"%V\"",
- &cmd->name, &name);
- return NGX_CONF_ERROR;
- }
-
ctx->rate = rate * 1000 / scale;
shm_zone = ngx_shared_memory_add(cf, &name, size,
@@ -859,8 +845,8 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ctx = shm_zone->data;
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%V \"%V\" is already bound to variable \"%V\"",
- &cmd->name, &name, &ctx->var);
+ "%V \"%V\" is already bound to key \"%V\"",
+ &cmd->name, &name, &ctx->key.value);
return NGX_CONF_ERROR;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_log_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c
index bc660cdd6f8..cec77e74950 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_log_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c
@@ -1136,7 +1136,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_int_t gzip;
ngx_uint_t i, n;
ngx_msec_t flush;
- ngx_str_t *value, name, s, filter;
+ ngx_str_t *value, name, s;
ngx_http_log_t *log;
ngx_syslog_peer_t *peer;
ngx_http_log_buf_t *buffer;
@@ -1254,21 +1254,9 @@ process_formats:
return NGX_CONF_ERROR;
}
- if (log->syslog_peer != NULL) {
- if (cf->args->nelts > 3) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "parameter \"%V\" is not supported by syslog",
- &value[3]);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
size = 0;
flush = 0;
gzip = 0;
- filter.len = 0;
for (i = 3; i < cf->args->nelts; i++) {
@@ -1336,8 +1324,25 @@ process_formats:
}
if (ngx_strncmp(value[i].data, "if=", 3) == 0) {
- filter.len = value[i].len - 3;
- filter.data = value[i].data + 3;
+ s.len = value[i].len - 3;
+ s.data = value[i].data + 3;
+
+ ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
+
+ ccv.cf = cf;
+ ccv.value = &s;
+ ccv.complex_value = ngx_palloc(cf->pool,
+ sizeof(ngx_http_complex_value_t));
+ if (ccv.complex_value == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
+
+ log->filter = ccv.complex_value;
+
continue;
}
@@ -1361,6 +1366,12 @@ process_formats:
return NGX_CONF_ERROR;
}
+ if (log->syslog_peer) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "logs to syslog cannot be buffered");
+ return NGX_CONF_ERROR;
+ }
+
if (log->file->data) {
buffer = log->file->data;
@@ -1410,23 +1421,6 @@ process_formats:
log->file->data = buffer;
}
- if (filter.len) {
- log->filter = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (log->filter == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &filter;
- ccv.complex_value = log->filter;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
return NGX_CONF_OK;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_map_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c
index 3245e04132c..3245e04132c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_map_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_memcached_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c
index bda038da451..17f1d8e100a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_memcached_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c
@@ -102,6 +102,20 @@ static ngx_command_t ngx_http_memcached_commands[] = {
offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream),
&ngx_http_memcached_next_upstream_masks },
+ { ngx_string("memcached_next_upstream_tries"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream_tries),
+ NULL },
+
+ { ngx_string("memcached_next_upstream_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream_timeout),
+ NULL },
+
{ ngx_string("memcached_gzip_flag"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_conf_set_num_slot,
@@ -391,7 +405,7 @@ found:
p = line.data + line.len;
u->headers_in.content_length_n = ngx_atoof(start, p - start);
- if (u->headers_in.content_length_n == -1) {
+ if (u->headers_in.content_length_n == NGX_ERROR) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"memcached sent invalid length in response \"%V\" "
"for key \"%V\"",
@@ -583,9 +597,11 @@ ngx_http_memcached_create_loc_conf(ngx_conf_t *cf)
*/
conf->upstream.local = NGX_CONF_UNSET_PTR;
+ conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
+ conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
@@ -619,6 +635,9 @@ ngx_http_memcached_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_ptr_value(conf->upstream.local,
prev->upstream.local, NULL);
+ ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
+ prev->upstream.next_upstream_tries, 0);
+
ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
prev->upstream.connect_timeout, 60000);
@@ -628,6 +647,9 @@ ngx_http_memcached_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->upstream.read_timeout,
prev->upstream.read_timeout, 60000);
+ ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
+ prev->upstream.next_upstream_timeout, 0);
+
ngx_conf_merge_size_value(conf->upstream.buffer_size,
prev->upstream.buffer_size,
(size_t) ngx_pagesize);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_mp4_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c
index 8f439ba9239..980bf571917 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_mp4_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c
@@ -1840,7 +1840,7 @@ ngx_http_mp4_read_smhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
atom->pos = atom_header;
atom->last = atom_header + atom_size;
- trak->vmhd_size += atom_size;
+ trak->smhd_size += atom_size;
trak->out[NGX_HTTP_MP4_SMHD_ATOM].buf = atom;
ngx_mp4_atom_next(mp4, atom_data_size);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_not_modified_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c
index acc94ded31a..acc94ded31a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_not_modified_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_proxy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c
index 52c63e1381f..c8a80ef4811 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_proxy_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c
@@ -505,6 +505,20 @@ static ngx_command_t ngx_http_proxy_commands[] = {
offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream),
&ngx_http_proxy_next_upstream_masks },
+ { ngx_string("proxy_next_upstream_tries"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream_tries),
+ NULL },
+
+ { ngx_string("proxy_next_upstream_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream_timeout),
+ NULL },
+
{ ngx_string("proxy_pass_header"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_conf_set_str_array_slot,
@@ -2455,6 +2469,7 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf)
conf->upstream.store = NGX_CONF_UNSET;
conf->upstream.store_access = NGX_CONF_UNSET_UINT;
+ conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
conf->upstream.buffering = NGX_CONF_UNSET;
conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
@@ -2463,6 +2478,7 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf)
conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
+ conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
@@ -2543,6 +2559,9 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_uint_value(conf->upstream.store_access,
prev->upstream.store_access, 0600);
+ ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
+ prev->upstream.next_upstream_tries, 0);
+
ngx_conf_merge_value(conf->upstream.buffering,
prev->upstream.buffering, 1);
@@ -2561,6 +2580,9 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->upstream.read_timeout,
prev->upstream.read_timeout, 60000);
+ ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
+ prev->upstream.next_upstream_timeout, 0);
+
ngx_conf_merge_size_value(conf->upstream.send_lowat,
prev->upstream.send_lowat, 0);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_random_index_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c
index b0f0e080912..b0f0e080912 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_random_index_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_range_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c
index 6a65e48498d..6a65e48498d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_range_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_realip_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c
index 7a621180379..7a621180379 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_realip_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_referer_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c
index b417eb227b0..b417eb227b0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_referer_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_rewrite_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c
index 4081f877433..f24119645bb 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_rewrite_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c
@@ -930,7 +930,11 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (v->get_handler == NULL
&& ngx_strncasecmp(value[1].data, (u_char *) "http_", 5) != 0
&& ngx_strncasecmp(value[1].data, (u_char *) "sent_http_", 10) != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "upstream_http_", 14) != 0)
+ && ngx_strncasecmp(value[1].data, (u_char *) "upstream_http_", 14) != 0
+ && ngx_strncasecmp(value[1].data, (u_char *) "cookie_", 7) != 0
+ && ngx_strncasecmp(value[1].data, (u_char *) "upstream_cookie_", 16)
+ != 0
+ && ngx_strncasecmp(value[1].data, (u_char *) "arg_", 4) != 0)
{
v->get_handler = ngx_http_rewrite_var;
v->data = index;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_scgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c
index 0be5066ec2a..313f3b3ade9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_scgi_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c
@@ -299,6 +299,20 @@ static ngx_command_t ngx_http_scgi_commands[] = {
offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream),
&ngx_http_scgi_next_upstream_masks },
+ { ngx_string("scgi_next_upstream_tries"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream_tries),
+ NULL },
+
+ { ngx_string("scgi_next_upstream_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream_timeout),
+ NULL },
+
{ ngx_string("scgi_param"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
ngx_http_upstream_param_set_slot,
@@ -1074,6 +1088,7 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.store = NGX_CONF_UNSET;
conf->upstream.store_access = NGX_CONF_UNSET_UINT;
+ conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
conf->upstream.buffering = NGX_CONF_UNSET;
conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
@@ -1082,6 +1097,7 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
+ conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
@@ -1142,6 +1158,9 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_uint_value(conf->upstream.store_access,
prev->upstream.store_access, 0600);
+ ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
+ prev->upstream.next_upstream_tries, 0);
+
ngx_conf_merge_value(conf->upstream.buffering,
prev->upstream.buffering, 1);
@@ -1160,6 +1179,9 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->upstream.read_timeout,
prev->upstream.read_timeout, 60000);
+ ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
+ prev->upstream.next_upstream_timeout, 0);
+
ngx_conf_merge_size_value(conf->upstream.send_lowat,
prev->upstream.send_lowat, 0);
@@ -1248,7 +1270,8 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
}
if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size) {
+ && conf->upstream.max_temp_file_size < size)
+ {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"scgi_max_temp_file_size\" must be equal to zero to disable "
"temporary files usage or must be equal to or greater than "
@@ -1336,6 +1359,11 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
conf->cache_key = prev->cache_key;
}
+ if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "no \"scgi_cache_key\" for \"scgi_cache\"");
+ }
+
ngx_conf_merge_value(conf->upstream.cache_lock,
prev->upstream.cache_lock, 0);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_secure_link_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c
index 907ba6ef50c..907ba6ef50c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_secure_link_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_split_clients_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c
index 2f92c9e1a8f..2f92c9e1a8f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_split_clients_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c
index 8236320c295..8236320c295 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h
index 0bd01a06775..0bd01a06775 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssi_filter_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c
index 4c69091d60a..4c69091d60a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h
index 8e69e9e4d0d..8e69e9e4d0d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_ssl_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_static_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c
index 631eb17b267..631eb17b267 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_static_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_stub_status_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c
index f4f5888b6f2..dd683589803 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_stub_status_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c
@@ -21,7 +21,7 @@ static char *ngx_http_set_stub_status(ngx_conf_t *cf, ngx_command_t *cmd,
static ngx_command_t ngx_http_status_commands[] = {
{ ngx_string("stub_status"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+ NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS|NGX_CONF_TAKE1,
ngx_http_set_stub_status,
0,
0,
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_sub_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c
index 5e6e038bfe9..e6a34a763b9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_sub_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c
@@ -546,6 +546,14 @@ ngx_http_sub_parse(ngx_http_request_t *r, ngx_http_sub_ctx_t *ctx)
for ( ;; ) {
if (ch == match) {
+
+ if (ctx->match.len == 1) {
+ ctx->pos = p + 1;
+ ctx->copy_end = p;
+
+ return NGX_OK;
+ }
+
copy_end = p;
ctx->looked.data[0] = *p;
looked = 1;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_hash_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c
index 777e180a59f..777e180a59f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_hash_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_ip_hash_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c
index 148d73a8472..148d73a8472 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_keepalive_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c
index d07ed9edaf2..f738f0cc18e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_keepalive_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c
@@ -79,7 +79,7 @@ static char *ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
static ngx_command_t ngx_http_upstream_keepalive_commands[] = {
{ ngx_string("keepalive"),
- NGX_HTTP_UPS_CONF|NGX_CONF_TAKE12,
+ NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1,
ngx_http_upstream_keepalive,
NGX_HTTP_SRV_CONF_OFFSET,
0,
@@ -248,6 +248,7 @@ ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc, void *data)
"get keepalive peer: using connection %p", c);
c->idle = 0;
+ c->sent = 0;
c->log = pc->log;
c->read->log = pc->log;
c->write->log = pc->log;
@@ -485,7 +486,6 @@ ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_int_t n;
ngx_str_t *value;
- ngx_uint_t i;
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
@@ -514,23 +514,5 @@ ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
kcf->max_cached = n;
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "single") == 0) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "the \"single\" parameter is deprecated");
- continue;
- }
-
- goto invalid;
- }
-
return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
-
- return NGX_CONF_ERROR;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_least_conn_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c
index dbef95d4164..623bc9b1053 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_upstream_least_conn_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c
@@ -299,10 +299,6 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
lcp->rrp.tried[n] |= m;
lcp->conns[p]++;
- if (pc->tries == 1 && peers->next) {
- pc->tries += peers->next->number;
- }
-
return NGX_OK;
failed:
@@ -314,7 +310,6 @@ failed:
lcp->conns += peers->number;
lcp->rrp.peers = peers->next;
- pc->tries = lcp->rrp.peers->number;
n = (lcp->rrp.peers->number + (8 * sizeof(uintptr_t) - 1))
/ (8 * sizeof(uintptr_t));
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_userid_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c
index 1487c091eee..1487c091eee 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_userid_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_uwsgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c
index a613b684a30..9556aa4a062 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_uwsgi_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c
@@ -354,6 +354,20 @@ static ngx_command_t ngx_http_uwsgi_commands[] = {
offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream),
&ngx_http_uwsgi_next_upstream_masks },
+ { ngx_string("uwsgi_next_upstream_tries"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_tries),
+ NULL },
+
+ { ngx_string("uwsgi_next_upstream_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_timeout),
+ NULL },
+
{ ngx_string("uwsgi_param"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
ngx_http_upstream_param_set_slot,
@@ -1254,6 +1268,7 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.store = NGX_CONF_UNSET;
conf->upstream.store_access = NGX_CONF_UNSET_UINT;
+ conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
conf->upstream.buffering = NGX_CONF_UNSET;
conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
@@ -1262,6 +1277,7 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
+ conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
@@ -1329,6 +1345,9 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_uint_value(conf->upstream.store_access,
prev->upstream.store_access, 0600);
+ ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
+ prev->upstream.next_upstream_tries, 0);
+
ngx_conf_merge_value(conf->upstream.buffering,
prev->upstream.buffering, 1);
@@ -1347,6 +1366,9 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->upstream.read_timeout,
prev->upstream.read_timeout, 60000);
+ ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
+ prev->upstream.next_upstream_timeout, 0);
+
ngx_conf_merge_size_value(conf->upstream.send_lowat,
prev->upstream.send_lowat, 0);
@@ -1435,7 +1457,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
}
if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size) {
+ && conf->upstream.max_temp_file_size < size)
+ {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"uwsgi_max_temp_file_size\" must be equal to zero to disable "
"temporary files usage or must be equal to or greater than "
@@ -1523,6 +1546,11 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
conf->cache_key = prev->cache_key;
}
+ if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "no \"uwsgi_cache_key\" for \"uwsgi_cache\"");
+ }
+
ngx_conf_merge_value(conf->upstream.cache_lock,
prev->upstream.cache_lock, 0);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_xslt_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c
index 315081e47bd..315081e47bd 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/ngx_http_xslt_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/Makefile.PL b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL
index 03348b555fc..03348b555fc 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/Makefile.PL
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.pm b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm
index e3f73611025..e3f73611025 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.pm
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.xs b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs
index 71f17a8bb45..71f17a8bb45 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/nginx.xs
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c
index bf4d1fe9ad7..6a8894cc3b1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c
@@ -577,7 +577,7 @@ ngx_http_perl_create_interpreter(ngx_conf_t *cf,
n = (pmcf->modules != NGX_CONF_UNSET_PTR) ? pmcf->modules->nelts * 2 : 0;
- embedding = ngx_palloc(cf->pool, (4 + n) * sizeof(char *));
+ embedding = ngx_palloc(cf->pool, (5 + n) * sizeof(char *));
if (embedding == NULL) {
goto fail;
}
@@ -595,6 +595,7 @@ ngx_http_perl_create_interpreter(ngx_conf_t *cf,
embedding[n++] = "-Mnginx";
embedding[n++] = "-e";
embedding[n++] = "0";
+ embedding[n] = NULL;
n = perl_parse(perl, ngx_http_perl_xs_init, n, embedding, NULL);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h
index 5e60b031ec2..5e60b031ec2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/ngx_http_perl_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/typemap b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap
index e2f1a4c6af6..e2f1a4c6af6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/modules/perl/typemap
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c
index 31577f9a28e..9c8d6cba48e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c
@@ -2005,7 +2005,7 @@ ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[i].data, type[n].key.data) == 0) {
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
"duplicate MIME type \"%V\"", &value[i]);
- continue;
+ goto next;
}
}
@@ -2017,6 +2017,10 @@ ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
type->key = value[i];
type->key_hash = hash;
type->value = (void *) 4;
+
+ next:
+
+ continue;
}
return NGX_CONF_OK;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h
index 0acc234942c..0acc234942c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c
index 3b4b28c8b32..3b4b28c8b32 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h
index c676382f29d..c676382f29d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_busy_lock.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_cache.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h
index 1cfd9fe845f..1cfd9fe845f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_cache.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h
index 2208c601b96..2208c601b96 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_copy_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c
index 3ad27b0425b..3ad27b0425b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_copy_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c
index 4071b612649..3b36f4a1920 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c
@@ -1837,6 +1837,7 @@ ngx_http_set_etag(ngx_http_request_t *r)
etag->value.data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN + NGX_TIME_T_LEN + 3);
if (etag->value.data == NULL) {
+ etag->hash = 0;
return NGX_ERROR;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h
index 285120de7ba..fc2c3d49bf3 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_core_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h
@@ -554,7 +554,7 @@ extern ngx_str_t ngx_http_core_get_method;
r->headers_out.content_length->hash = 0; \
r->headers_out.content_length = NULL; \
}
- \
+
#define ngx_http_clear_accept_ranges(r) \
\
r->allow_ranges = 0; \
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_file_cache.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c
index 71e6e36c235..2eebc3068ef 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_file_cache.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c
@@ -145,6 +145,8 @@ ngx_http_file_cache_init(ngx_shm_zone_t *shm_zone, void *data)
ngx_sprintf(cache->shpool->log_ctx, " in cache keys zone \"%V\"%Z",
&shm_zone->shm.name);
+ cache->shpool->log_nomem = 0;
+
return NGX_OK;
}
@@ -698,6 +700,8 @@ ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
fcn = ngx_slab_calloc_locked(cache->shpool,
sizeof(ngx_http_file_cache_node_t));
if (fcn == NULL) {
+ ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
+ "could not allocate node%s", cache->shpool->log_ctx);
rc = NGX_ERROR;
goto failed;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_header_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c
index 507dc939c78..507dc939c78 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_header_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c
index b60f41bb6a3..b60f41bb6a3 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse_time.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c
index 985af31725b..985af31725b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_parse_time.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_postpone_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c
index e893b836488..e893b836488 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_postpone_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c
index 845ada322e3..2b932dee436 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c
@@ -2656,6 +2656,12 @@ ngx_http_writer(ngx_http_request_t *r)
if (r->buffered || r->postponed || (r == r->main && c->buffered)) {
+#if (NGX_HTTP_SPDY)
+ if (r->spdy_stream) {
+ return;
+ }
+#endif
+
if (!wev->delayed) {
ngx_add_timer(wev, clcf->send_timeout);
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h
index f6ea6fb56e7..f6ea6fb56e7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request_body.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c
index bbf16fd2576..bbf16fd2576 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_request_body.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c
index 02e2be3bb80..02e2be3bb80 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h
index 46592ab0155..46592ab0155 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_script.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c
index 478036979f3..3c57882a6ad 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c
@@ -3372,7 +3372,7 @@ ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc)
ngx_del_timer(ev);
}
- if (ev->prev) {
+ if (ev->posted) {
ngx_delete_posted_event(ev);
}
@@ -3387,7 +3387,7 @@ ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc)
ngx_del_timer(ev);
}
- if (ev->prev) {
+ if (ev->posted) {
ngx_delete_posted_event(ev);
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h
index df24495a14e..df24495a14e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c
index 82405d9a1ee..d1406a665b0 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c
@@ -1141,6 +1141,11 @@ ngx_http_spdy_handle_stream(ngx_http_spdy_connection_t *sc,
wev = stream->request->connection->write;
+ /*
+ * This timer can only be set if the stream was delayed because of rate
+ * limit. In that case the event should be triggered by the timer.
+ */
+
if (!wev->timer_set) {
wev->delayed = 0;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c
index 5178a36f239..5178a36f239 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h
index 5242322b3d6..5242322b3d6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_spdy_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_special_response.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c
index 546400539ba..546400539ba 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_special_response.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c
index 18b04f775f0..d547ca74e3f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c
@@ -519,6 +519,11 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
return;
}
+ if (rc == NGX_ERROR) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ return;
+ }
+
if (rc != NGX_DECLINED) {
ngx_http_finalize_request(r, rc);
return;
@@ -693,6 +698,14 @@ found:
return;
}
+ u->peer.start_time = ngx_current_msec;
+
+ if (u->conf->next_upstream_tries
+ && u->peer.tries > u->conf->next_upstream_tries)
+ {
+ u->peer.tries = u->conf->next_upstream_tries;
+ }
+
ngx_http_upstream_connect(r, u);
}
@@ -1557,6 +1570,7 @@ done:
static ngx_int_t
ngx_http_upstream_reinit(ngx_http_request_t *r, ngx_http_upstream_t *u)
{
+ off_t file_pos;
ngx_chain_t *cl;
if (u->reinit_request(r) != NGX_OK) {
@@ -1578,9 +1592,17 @@ ngx_http_upstream_reinit(ngx_http_request_t *r, ngx_http_upstream_t *u)
/* reinit the request chain */
+ file_pos = 0;
+
for (cl = u->request_bufs; cl; cl = cl->next) {
cl->buf->pos = cl->buf->start;
- cl->buf->file_pos = 0;
+
+ /* there is at most one file */
+
+ if (cl->buf->in_file) {
+ cl->buf->file_pos = file_pos;
+ file_pos = cl->buf->file_last;
+ }
}
/* reinit the subrequest's ngx_output_chain() context */
@@ -3416,6 +3438,7 @@ static void
ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
ngx_uint_t ft_type)
{
+ ngx_msec_t timeout;
ngx_uint_t status, state;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -3485,9 +3508,12 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
if (status) {
u->state->status = status;
+ timeout = u->conf->next_upstream_timeout;
- if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) {
-
+ if (u->peer.tries == 0
+ || !(u->conf->next_upstream & ft_type)
+ || (timeout && ngx_current_msec - u->peer.start_time >= timeout))
+ {
#if (NGX_HTTP_CACHE)
if (u->cache_status == NGX_HTTP_CACHE_EXPIRED
@@ -4973,7 +4999,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strncmp(value[i].data, "weight=", 7) == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_WEIGHT)) {
- goto invalid;
+ goto not_supported;
}
weight = ngx_atoi(&value[i].data[7], value[i].len - 7);
@@ -4988,7 +5014,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strncmp(value[i].data, "max_fails=", 10) == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_MAX_FAILS)) {
- goto invalid;
+ goto not_supported;
}
max_fails = ngx_atoi(&value[i].data[10], value[i].len - 10);
@@ -5003,7 +5029,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strncmp(value[i].data, "fail_timeout=", 13) == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_FAIL_TIMEOUT)) {
- goto invalid;
+ goto not_supported;
}
s.len = value[i].len - 13;
@@ -5021,7 +5047,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[i].data, "backup") == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_BACKUP)) {
- goto invalid;
+ goto not_supported;
}
us->backup = 1;
@@ -5032,7 +5058,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[i].data, "down") == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_DOWN)) {
- goto invalid;
+ goto not_supported;
}
us->down = 1;
@@ -5072,6 +5098,14 @@ invalid:
"invalid parameter \"%V\"", &value[i]);
return NGX_CONF_ERROR;
+
+not_supported:
+
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "balancing method does not support parameter \"%V\"",
+ &value[i]);
+
+ return NGX_CONF_ERROR;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h
index dafb5a319b8..2ee899d8332 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h
@@ -136,6 +136,7 @@ typedef struct {
ngx_msec_t send_timeout;
ngx_msec_t read_timeout;
ngx_msec_t timeout;
+ ngx_msec_t next_upstream_timeout;
size_t send_lowat;
size_t buffer_size;
@@ -153,6 +154,7 @@ typedef struct {
ngx_uint_t ignore_headers;
ngx_uint_t next_upstream;
ngx_uint_t store_access;
+ ngx_uint_t next_upstream_tries;
ngx_flag_t buffering;
ngx_flag_t pass_request_headers;
ngx_flag_t pass_request_body;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c
index b39eeae5046..2d0649b7f73 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c
@@ -10,6 +10,10 @@
#include <ngx_http.h>
+#define ngx_http_upstream_tries(p) ((p)->number \
+ + ((p)->next ? (p)->next->number : 0))
+
+
static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer(
ngx_http_upstream_rr_peer_data_t *rrp);
@@ -255,7 +259,7 @@ ngx_http_upstream_init_round_robin_peer(ngx_http_request_t *r,
r->upstream->peer.get = ngx_http_upstream_get_round_robin_peer;
r->upstream->peer.free = ngx_http_upstream_free_round_robin_peer;
- r->upstream->peer.tries = rrp->peers->number;
+ r->upstream->peer.tries = ngx_http_upstream_tries(rrp->peers);
#if (NGX_HTTP_SSL)
r->upstream->peer.set_session =
ngx_http_upstream_set_round_robin_peer_session;
@@ -374,7 +378,7 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
r->upstream->peer.get = ngx_http_upstream_get_round_robin_peer;
r->upstream->peer.free = ngx_http_upstream_free_round_robin_peer;
- r->upstream->peer.tries = rrp->peers->number;
+ r->upstream->peer.tries = ngx_http_upstream_tries(rrp->peers);
#if (NGX_HTTP_SSL)
r->upstream->peer.set_session = ngx_http_upstream_empty_set_session;
r->upstream->peer.save_session = ngx_http_upstream_empty_save_session;
@@ -432,10 +436,6 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
/* ngx_unlock_mutex(peers->mutex); */
- if (pc->tries == 1 && peers->next) {
- pc->tries += peers->next->number;
- }
-
return NGX_OK;
failed:
@@ -447,7 +447,6 @@ failed:
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, "backup servers");
rrp->peers = peers->next;
- pc->tries = rrp->peers->number;
n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1))
/ (8 * sizeof(uintptr_t));
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h
index 9db82a63c0d..9db82a63c0d 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_upstream_round_robin.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c
index 1b61c39d46f..738f2237ac7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c
@@ -2511,8 +2511,7 @@ ngx_http_variables_init_vars(ngx_conf_t *cf)
av = key[n].value;
- if (av->get_handler
- && v[i].name.len == key[n].key.len
+ if (v[i].name.len == key[n].key.len
&& ngx_strncmp(v[i].name.data, key[n].key.data, v[i].name.len)
== 0)
{
@@ -2524,6 +2523,10 @@ ngx_http_variables_init_vars(ngx_conf_t *cf)
av->index = i;
+ if (av->get_handler == NULL) {
+ break;
+ }
+
goto next;
}
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h
index 829fab31e64..829fab31e64 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_variables.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_write_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c
index 83cb1fa1e98..83cb1fa1e98 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/http/ngx_http_write_filter_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c
index 350d2cdf90b..5a7cb6bf67e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c
@@ -131,8 +131,7 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
/*
- * create the main_conf's, the null srv_conf's, and the null loc_conf's
- * of the all mail modules
+ * create the main_conf's and the null srv_conf's of the all mail modules
*/
for (m = 0; ngx_modules[m]; m++) {
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h
index dc39f1e1375..dc39f1e1375 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_auth_http_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c
index eb7531c80a3..eb7531c80a3 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_auth_http_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_core_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c
index 4ee7c8dc3d7..a5388c8470e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_core_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c
@@ -41,7 +41,7 @@ static ngx_command_t ngx_mail_core_commands[] = {
NULL },
{ ngx_string("listen"),
- NGX_MAIL_SRV_CONF|NGX_CONF_TAKE12,
+ NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
ngx_mail_core_listen,
NGX_MAIL_SRV_CONF_OFFSET,
0,
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c
index 784111f6e80..57b69b564d7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_handler.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c
@@ -121,6 +121,8 @@ ngx_mail_init_connection(ngx_connection_t *c)
return;
}
+ s->signature = NGX_MAIL_MODULE;
+
s->main_conf = addr_conf->ctx->main_conf;
s->srv_conf = addr_conf->ctx->srv_conf;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c
index 57e2fb77daa..57e2fb77daa 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_handler.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c
index dc80b4fb4c1..dc80b4fb4c1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h
index 131b44597f8..131b44597f8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_imap_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_parse.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c
index b158f5a0fba..b158f5a0fba 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_parse.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c
index 51bc257a595..51bc257a595 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_handler.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c
index b59747290e2..b59747290e2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h
index 86947a77251..86947a77251 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_pop3_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_proxy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c
index 41cbcf6e312..41cbcf6e312 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_proxy_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c
index 46d703e2ce9..46d703e2ce9 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_handler.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c
index 02bbf1fb9d8..02bbf1fb9d8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h
index 04ffab60ade..04ffab60ade 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_smtp_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c
index f864d991060..f864d991060 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h
index 987d029ef73..987d029ef73 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/mail/ngx_mail_ssl_module.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_cpp_test_module.cpp b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp
index 5d2f08d3967..5d2f08d3967 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_cpp_test_module.cpp
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_google_perftools_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c
index f2f8221b560..f2f8221b560 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/misc/ngx_google_perftools_module.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c
index 7849881730f..7849881730f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c
index 8c831b95129..8c831b95129 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_read_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c
index f0d93918e3b..f0d93918e3b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c
index b0c25085d1f..b0c25085d1f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_aio_write_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c
index 5c2f7870256..5c2f7870256 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h
index 655db257f41..655db257f41 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_alloc.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_atomic.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h
index 417cd86ff29..417cd86ff29 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_atomic.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c
index 8e9069660f4..1efa0667cb8 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c
@@ -216,13 +216,6 @@ ngx_add_channel_event(ngx_cycle_t *cycle, ngx_fd_t fd, ngx_int_t event,
rev->log = cycle->log;
wev->log = cycle->log;
-#if (NGX_THREADS)
- rev->lock = &c->lock;
- wev->lock = &c->lock;
- rev->own_lock = &c->lock;
- wev->own_lock = &c->lock;
-#endif
-
rev->channel = 1;
wev->channel = 1;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h
index d7a9f6b54c5..d7a9f6b54c5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_channel.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_daemon.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c
index ab672110838..ab672110838 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_daemon.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h
index 4d01b26ea54..4d01b26ea54 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h
index bbad977cb6c..bbad977cb6c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c
index 1bc7520cade..1bc7520cade 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_init.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c
index ee44e1d58e1..dd574e5ac90 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_darwin_sendfile_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c
@@ -27,15 +27,6 @@
*/
-#if (IOV_MAX > 64)
-#define NGX_HEADERS 64
-#define NGX_TRAILERS 64
-#else
-#define NGX_HEADERS IOV_MAX
-#define NGX_TRAILERS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
@@ -43,14 +34,16 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
u_char *prev;
off_t size, send, prev_send, aligned, sent, fprev;
off_t header_size, file_size;
- ngx_uint_t eintr, complete;
+ ngx_uint_t eintr;
ngx_err_t err;
ngx_buf_t *file;
ngx_array_t header, trailer;
ngx_event_t *wev;
ngx_chain_t *cl;
struct sf_hdtr hdtr;
- struct iovec *iov, headers[NGX_HEADERS], trailers[NGX_TRAILERS];
+ struct iovec *iov;
+ struct iovec headers[NGX_IOVS_PREALLOCATE];
+ struct iovec trailers[NGX_IOVS_PREALLOCATE];
wev = c->write;
@@ -79,12 +72,12 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
header.elts = headers;
header.size = sizeof(struct iovec);
- header.nalloc = NGX_HEADERS;
+ header.nalloc = NGX_IOVS_PREALLOCATE;
header.pool = c->pool;
trailer.elts = trailers;
trailer.size = sizeof(struct iovec);
- trailer.nalloc = NGX_TRAILERS;
+ trailer.nalloc = NGX_IOVS_PREALLOCATE;
trailer.pool = c->pool;
for ( ;; ) {
@@ -92,7 +85,6 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
file_size = 0;
header_size = 0;
eintr = 0;
- complete = 0;
prev_send = send;
header.nelts = 0;
@@ -285,7 +277,7 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
rc = writev(c->fd, header.elts, header.nelts);
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "writev: %d of %uz", rc, send);
+ "writev: %d of %O", rc, header_size);
if (rc == -1) {
err = ngx_errno;
@@ -311,54 +303,15 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
sent = rc > 0 ? rc : 0;
}
- if (send - prev_send == sent) {
- complete = 1;
- }
-
c->sent += sent;
- for ( /* void */ ; in; in = in->next) {
-
- if (ngx_buf_special(in->buf)) {
- continue;
- }
-
- if (sent == 0) {
- break;
- }
-
- size = ngx_buf_size(in->buf);
-
- if (sent >= size) {
- sent -= size;
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos = in->buf->last;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos = in->buf->file_last;
- }
-
- continue;
- }
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos += (size_t) sent;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos += sent;
- }
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
if (eintr) {
continue;
}
- if (!complete) {
+ if (send - prev_send != sent) {
wev->ready = 0;
return in;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c
index e787b2377ed..e787b2377ed 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h
index 16cafda3107..16cafda3107 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_errno.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_file_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c
index 0bb383de551..0bb383de551 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_file_aio_read.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c
index c3ae47fdbf6..c3ae47fdbf6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h
index a78ec961365..a78ec961365 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_files.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h
index 4f93da55cd2..4f93da55cd2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h
index 92b2928c8b5..92b2928c8b5 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c
index c4c12dd741c..c4c12dd741c 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_init.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c
index e92f9a9fdd7..e92f9a9fdd7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h
index ff160449dad..ff160449dad 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_rfork_thread.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c
index 6491e928fe5..f5d0f3a8aa1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -29,15 +29,6 @@
*/
-#if (IOV_MAX > 64)
-#define NGX_HEADERS 64
-#define NGX_TRAILERS 64
-#else
-#define NGX_HEADERS IOV_MAX
-#define NGX_TRAILERS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
@@ -45,14 +36,16 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
u_char *prev;
off_t size, send, prev_send, aligned, sent, fprev;
size_t header_size, file_size;
- ngx_uint_t eintr, eagain, complete;
+ ngx_uint_t eintr, eagain;
ngx_err_t err;
ngx_buf_t *file;
ngx_array_t header, trailer;
ngx_event_t *wev;
ngx_chain_t *cl;
struct sf_hdtr hdtr;
- struct iovec *iov, headers[NGX_HEADERS], trailers[NGX_TRAILERS];
+ struct iovec *iov;
+ struct iovec headers[NGX_IOVS_PREALLOCATE];
+ struct iovec trailers[NGX_IOVS_PREALLOCATE];
wev = c->write;
@@ -83,12 +76,12 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
header.elts = headers;
header.size = sizeof(struct iovec);
- header.nalloc = NGX_HEADERS;
+ header.nalloc = NGX_IOVS_PREALLOCATE;
header.pool = c->pool;
trailer.elts = trailers;
trailer.size = sizeof(struct iovec);
- trailer.nalloc = NGX_TRAILERS;
+ trailer.nalloc = NGX_IOVS_PREALLOCATE;
trailer.pool = c->pool;
for ( ;; ) {
@@ -96,7 +89,6 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
file_size = 0;
header_size = 0;
eintr = 0;
- complete = 0;
prev_send = send;
header.nelts = 0;
@@ -362,48 +354,9 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
sent = rc > 0 ? rc : 0;
}
- if (send - prev_send == sent) {
- complete = 1;
- }
-
c->sent += sent;
- for ( /* void */ ; in; in = in->next) {
-
- if (ngx_buf_special(in->buf)) {
- continue;
- }
-
- if (sent == 0) {
- break;
- }
-
- size = ngx_buf_size(in->buf);
-
- if (sent >= size) {
- sent -= size;
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos = in->buf->last;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos = in->buf->file_last;
- }
-
- continue;
- }
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos += (size_t) sent;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos += sent;
- }
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
#if (NGX_HAVE_AIO_SENDFILE)
if (c->busy_sendfile) {
@@ -428,7 +381,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
continue;
}
- if (!complete) {
+ if (send - prev_send != sent) {
wev->ready = 0;
return in;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_amd64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h
index 159a2974270..159a2974270 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_amd64.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_ppc.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h
index 45afc4b9eac..45afc4b9eac 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_ppc.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_sparc64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h
index a84db354482..a84db354482 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_sparc64.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_x86.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h
index 54e01aebf0b..54e01aebf0b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_gcc_atomic_x86.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h
index 1b8bdac51a4..1b8bdac51a4 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c
index 8273c13f960..8273c13f960 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_aio_read.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h
index c6c02c93e5f..c6c02c93e5f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c
index b910380d7ce..b910380d7ce 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_init.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c
index 16395f94337..1060852a0cd 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c
@@ -27,13 +27,6 @@
#define NGX_SENDFILE_MAXSIZE 2147483647L
-#if (IOV_MAX > 64)
-#define NGX_HEADERS 64
-#else
-#define NGX_HEADERS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
@@ -43,11 +36,11 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
size_t file_size;
ngx_err_t err;
ngx_buf_t *file;
- ngx_uint_t eintr, complete;
+ ngx_uint_t eintr;
ngx_array_t header;
ngx_event_t *wev;
ngx_chain_t *cl;
- struct iovec *iov, headers[NGX_HEADERS];
+ struct iovec *iov, headers[NGX_IOVS_PREALLOCATE];
#if (NGX_HAVE_SENDFILE64)
off_t offset;
#else
@@ -72,14 +65,13 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
header.elts = headers;
header.size = sizeof(struct iovec);
- header.nalloc = NGX_HEADERS;
+ header.nalloc = NGX_IOVS_PREALLOCATE;
header.pool = c->pool;
for ( ;; ) {
file = NULL;
file_size = 0;
eintr = 0;
- complete = 0;
prev_send = send;
header.nelts = 0;
@@ -319,54 +311,15 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent);
}
- if (send - prev_send == sent) {
- complete = 1;
- }
-
c->sent += sent;
- for ( /* void */ ; in; in = in->next) {
-
- if (ngx_buf_special(in->buf)) {
- continue;
- }
-
- if (sent == 0) {
- break;
- }
-
- size = ngx_buf_size(in->buf);
-
- if (sent >= size) {
- sent -= size;
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos = in->buf->last;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos = in->buf->file_last;
- }
-
- continue;
- }
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos += (size_t) sent;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos += sent;
- }
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
if (eintr) {
continue;
}
- if (!complete) {
+ if (send - prev_send != sent) {
wev->ready = 0;
return in;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_os.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h
index c646e2aa5a8..1033d88251e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_os.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h
@@ -56,6 +56,13 @@ ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
#endif
+#if (IOV_MAX > 64)
+#define NGX_IOVS_PREALLOCATE 64
+#else
+#define NGX_IOVS_PREALLOCATE IOV_MAX
+#endif
+
+
extern ngx_os_io_t ngx_os_io;
extern ngx_int_t ngx_ncpu;
extern ngx_int_t ngx_max_sockets;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h
index d725659dfac..d725659dfac 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c
index 9a4de022d6d..bf3a310aa3b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_posix_init.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c
@@ -40,7 +40,9 @@ ngx_os_init(ngx_log_t *log)
}
#endif
- ngx_init_setproctitle(log);
+ if (ngx_init_setproctitle(log) != NGX_OK) {
+ return NGX_ERROR;
+ }
ngx_pagesize = getpagesize();
ngx_cacheline_size = NGX_CPU_CACHE_LINE;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c
index 6f3f38556ab..6f3f38556ab 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h
index 7b5e8c0c25e..7b5e8c0c25e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c
index 3205aa5554c..6c84ba8bd89 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c
@@ -1214,7 +1214,6 @@ ngx_wakeup_worker_threads(ngx_cycle_t *cycle)
/* STUB */
ngx_done_events(cycle);
ngx_mutex_destroy(ngx_event_timer_mutex);
- ngx_mutex_destroy(ngx_posted_events_mutex);
return;
}
@@ -1265,20 +1264,18 @@ ngx_worker_thread_cycle(void *data)
return (ngx_thread_value_t) 1;
}
- ngx_mutex_lock(ngx_posted_events_mutex);
-
for ( ;; ) {
thr->state = NGX_THREAD_FREE;
+#if 0
if (ngx_cond_wait(thr->cv, ngx_posted_events_mutex) == NGX_ERROR) {
return (ngx_thread_value_t) 1;
}
+#endif
if (ngx_terminate) {
thr->state = NGX_THREAD_EXIT;
- ngx_mutex_unlock(ngx_posted_events_mutex);
-
ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0,
"thread " NGX_TID_T_FMT " is done",
ngx_thread_self());
@@ -1288,6 +1285,7 @@ ngx_worker_thread_cycle(void *data)
thr->state = NGX_THREAD_BUSY;
+#if 0
if (ngx_event_thread_process_posted(cycle) == NGX_ERROR) {
return (ngx_thread_value_t) 1;
}
@@ -1295,6 +1293,7 @@ ngx_worker_thread_cycle(void *data)
if (ngx_event_thread_process_posted(cycle) == NGX_ERROR) {
return (ngx_thread_value_t) 1;
}
+#endif
if (ngx_process_changes) {
if (ngx_process_changes(cycle, 1) == NGX_ERROR) {
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h
index 94747b85d55..94747b85d55 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_process_cycle.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_pthread_thread.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c
index 1cf31c3bc2b..1cf31c3bc2b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_pthread_thread.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_readv_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c
index e4eb5ff3281..3cba80cccc6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_readv_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c
@@ -10,15 +10,6 @@
#include <ngx_event.h>
-#if (IOV_MAX > 64)
-#define NGX_IOVS 64
-#else
-#define NGX_IOVS IOV_MAX
-#endif
-
-
-#if (NGX_HAVE_KQUEUE)
-
ssize_t
ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
{
@@ -27,10 +18,12 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
ngx_err_t err;
ngx_array_t vec;
ngx_event_t *rev;
- struct iovec *iov, iovs[NGX_IOVS];
+ struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
rev = c->read;
+#if (NGX_HAVE_KQUEUE)
+
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
"readv: eof:%d, avail:%d, err:%d",
@@ -58,6 +51,8 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
}
}
+#endif
+
prev = NULL;
iov = NULL;
size = 0;
@@ -65,7 +60,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
vec.elts = iovs;
vec.nelts = 0;
vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
+ vec.nalloc = NGX_IOVS_PREALLOCATE;
vec.pool = c->pool;
/* coalesce the neighbouring bufs */
@@ -96,12 +91,13 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"readv: %d, last:%d", vec.nelts, iov->iov_len);
- rev = c->read;
-
do {
n = readv(c->fd, (struct iovec *) vec.elts, vec.nelts);
if (n >= 0) {
+
+#if (NGX_HAVE_KQUEUE)
+
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
rev->available -= n;
@@ -141,6 +137,8 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
return n;
}
+#endif /* NGX_HAVE_KQUEUE */
+
if (n < size && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) {
rev->ready = 0;
}
@@ -174,98 +172,3 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
return n;
}
-
-#else /* ! NGX_HAVE_KQUEUE */
-
-ssize_t
-ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
-{
- u_char *prev;
- ssize_t n, size;
- ngx_err_t err;
- ngx_array_t vec;
- ngx_event_t *rev;
- struct iovec *iov, iovs[NGX_IOVS];
-
- prev = NULL;
- iov = NULL;
- size = 0;
-
- vec.elts = iovs;
- vec.nelts = 0;
- vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
- vec.pool = c->pool;
-
- /* coalesce the neighbouring bufs */
-
- while (chain) {
- if (prev == chain->buf->last) {
- iov->iov_len += chain->buf->end - chain->buf->last;
-
- } else {
- if (vec.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&vec);
- if (iov == NULL) {
- return NGX_ERROR;
- }
-
- iov->iov_base = (void *) chain->buf->last;
- iov->iov_len = chain->buf->end - chain->buf->last;
- }
-
- size += chain->buf->end - chain->buf->last;
- prev = chain->buf->end;
- chain = chain->next;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "readv: %d:%d", vec.nelts, iov->iov_len);
-
- rev = c->read;
-
- do {
- n = readv(c->fd, (struct iovec *) vec.elts, vec.nelts);
-
- if (n == 0) {
- rev->ready = 0;
- rev->eof = 1;
-
- return n;
-
- } else if (n > 0) {
-
- if (n < size && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) {
- rev->ready = 0;
- }
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "readv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "readv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- c->read->error = 1;
- }
-
- return n;
-}
-
-#endif /* NGX_HAVE_KQUEUE */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_recv.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c
index 86675dfdd8f..86675dfdd8f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_recv.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_send.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c
index 80995ab3a50..80995ab3a50 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_send.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c
index 8f6cf35948a..8f6cf35948a 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h
index 33f5835dee6..33f5835dee6 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setaffinity.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c
index 91afa519142..91afa519142 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h
index 2323408c46e..c3636628bb7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_setproctitle.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h
@@ -13,7 +13,7 @@
/* FreeBSD, NetBSD, OpenBSD */
-#define ngx_init_setproctitle(log)
+#define ngx_init_setproctitle(log) NGX_OK
#define ngx_setproctitle(title) setproctitle("%s", title)
@@ -39,7 +39,7 @@ void ngx_setproctitle(char *title);
#else
-#define ngx_init_setproctitle(log)
+#define ngx_init_setproctitle(log) NGX_OK
#define ngx_setproctitle(title)
#endif /* OSes */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c
index 3ec7cbf1fd3..3ec7cbf1fd3 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h
index 566a7d3300b..566a7d3300b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_shmem.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c
index 3978f655c04..3978f655c04 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h
index fcc51533568..fcc51533568 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_socket.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h
index 7b167d830ab..7b167d830ab 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h
index ddfd984577e..ddfd984577e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_config.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c
index f2f3600dab1..f2f3600dab1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_init.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_sendfilev_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c
index 37bb09d961a..ba328c810da 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_solaris_sendfilev_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c
@@ -35,12 +35,7 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
#endif
-#if (IOV_MAX > 64)
-#define NGX_SENDFILEVECS 64
-#else
-#define NGX_SENDFILEVECS IOV_MAX
-#endif
-
+#define NGX_SENDFILEVECS NGX_IOVS_PREALLOCATE
ngx_chain_t *
@@ -51,7 +46,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
off_t size, send, prev_send, aligned, fprev;
size_t sent;
ssize_t n;
- ngx_int_t eintr, complete;
+ ngx_int_t eintr;
ngx_err_t err;
sendfilevec_t *sfv, sfvs[NGX_SENDFILEVECS];
ngx_array_t vec;
@@ -89,7 +84,6 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
fprev = 0;
sfv = NULL;
eintr = 0;
- complete = 0;
sent = 0;
prev_send = send;
@@ -201,54 +195,15 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"sendfilev: %z %z", n, sent);
- if (send - prev_send == (off_t) sent) {
- complete = 1;
- }
-
c->sent += sent;
- for ( /* void */ ; in; in = in->next) {
-
- if (ngx_buf_special(in->buf)) {
- continue;
- }
-
- if (sent == 0) {
- break;
- }
-
- size = ngx_buf_size(in->buf);
-
- if ((off_t) sent >= size) {
- sent = (size_t) ((off_t) sent - size);
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos = in->buf->last;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos = in->buf->file_last;
- }
-
- continue;
- }
-
- if (ngx_buf_in_memory(in->buf)) {
- in->buf->pos += sent;
- }
-
- if (in->buf->in_file) {
- in->buf->file_pos += sent;
- }
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
if (eintr) {
continue;
}
- if (!complete) {
+ if (send - prev_send != (off_t) sent) {
wev->ready = 0;
return in;
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_amd64.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il
index dc454b20b2f..dc454b20b2f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_amd64.il
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_atomic_sparc64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h
index 5f280553c9e..5f280553c9e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_atomic_sparc64.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_sparc64.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il
index bdeef612507..bdeef612507 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_sparc64.il
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_x86.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il
index fd1cc00492e..fd1cc00492e 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_sunpro_x86.il
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_thread.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h
index 49c5d5656a7..49c5d5656a7 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_thread.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c
index cc760b2eb01..cc760b2eb01 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h
index c128c9aa043..c128c9aa043 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_time.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_udp_recv.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c
index 1c807a08bb2..1c807a08bb2 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_udp_recv.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c
index 7a71203cb8f..7a71203cb8f 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h
index 6e82204f4d1..6e82204f4d1 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_user.h
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_writev_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c
index 805982d6558..95af2da7a34 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/ngx_writev_chain.c
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c
@@ -10,25 +10,18 @@
#include <ngx_event.h>
-#if (IOV_MAX > 64)
-#define NGX_IOVS 64
-#else
-#define NGX_IOVS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
u_char *prev;
ssize_t n, size, sent;
off_t send, prev_send;
- ngx_uint_t eintr, complete;
+ ngx_uint_t eintr;
ngx_err_t err;
ngx_array_t vec;
ngx_chain_t *cl;
ngx_event_t *wev;
- struct iovec *iov, iovs[NGX_IOVS];
+ struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
wev = c->write;
@@ -57,14 +50,13 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
vec.elts = iovs;
vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
+ vec.nalloc = NGX_IOVS_PREALLOCATE;
vec.pool = c->pool;
for ( ;; ) {
prev = NULL;
iov = NULL;
eintr = 0;
- complete = 0;
prev_send = send;
vec.nelts = 0;
@@ -137,49 +129,21 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
- if (send - prev_send == sent) {
- complete = 1;
- }
-
c->sent += sent;
- for (cl = in; cl; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
- if (sent == 0) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (sent >= size) {
- sent -= size;
- cl->buf->pos = cl->buf->last;
-
- continue;
- }
-
- cl->buf->pos += sent;
-
- break;
- }
+ in = ngx_handle_sent_chain(in, sent);
if (eintr) {
continue;
}
- if (!complete) {
+ if (send - prev_send != sent) {
wev->ready = 0;
- return cl;
+ return in;
}
- if (send >= limit || cl == NULL) {
- return cl;
+ if (send >= limit || in == NULL) {
+ return in;
}
-
- in = cl;
}
}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/rfork_thread.S b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S
index e570349f93b..e570349f93b 100644
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.4/src/os/unix/rfork_thread.S
+++ b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S
diff --git a/storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am b/storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am
index 40ccc1d73db..772bfb420c6 100644
--- a/storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am
+++ b/storage/mroonga/vendor/groonga/vendor/onigmo/Makefile.am
@@ -5,9 +5,13 @@ CONFIGURE_DEPENDENCIES = \
configure
ALL_DEPEND_TARGETS =
+INSTALL_DEPEND_TARGETS =
CLEAN_DEPEND_TARGETS =
if WITH_MRUBY
ALL_DEPEND_TARGETS += onigmo-all
+if WITH_SHARED_ONIGMO
+INSTALL_DEPEND_TARGETS += onigmo-install
+endif
CLEAN_DEPEND_TARGETS += onigmo-clean
endif
@@ -16,6 +20,11 @@ onigmo-all:
all: $(ALL_DEPEND_TARGETS)
+onigmo-install:
+ cd ../onigmo-source && $(MAKE) install
+
+install: $(INSTALL_DEPEND_TARGETS)
+
onigmo-clean:
cd ../onigmo-source && $(MAKE) clean
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac
index a2e71e465db..effb5884f93 100644
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/configure.ac
@@ -150,6 +150,7 @@ AC_CONFIG_FILES([
normalizers/Makefile
packages/Makefile
packages/apt/Makefile
+ packages/apt/env.sh
packages/ubuntu/Makefile
packages/rpm/Makefile
packages/rpm/centos/Makefile
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am
index 22fd7a1bc5d..cb257b9293b 100644
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Makefile.am
@@ -1,11 +1,7 @@
REPOSITORIES_PATH = repositories
-DISTRIBUTIONS = debian ubuntu
-CHROOT_BASE = /var/lib/chroot
+DISTRIBUTIONS = debian
ARCHITECTURES = i386 amd64
-CODES = wheezy jessie unstable precise quantal saucy trusty
-KEYRING_PACKAGE = groonga-keyring
-KEYRING_VERSION = 2012.05.29
-KEYRING_BASE_NAME = $(KEYRING_PACKAGE)-$(KEYRING_VERSION)
+CODE_NAMES = wheezy
all:
@@ -31,14 +27,14 @@ download: ensure-rsync-path
done
sign-packages:
- ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
update-repository:
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
- '$(ARCHITECTURES)' '$(CODES)'
+ '$(ARCHITECTURES)' '$(CODE_NAMES)'
sign-repository:
- ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)'
+ ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
@@ -49,12 +45,23 @@ upload: ensure-rsync-path
build: build-package-deb
-build-package-deb: source
- ./build-in-chroot.sh \
- $(PACKAGE) $(VERSION) $(srcdir)/.. $(REPOSITORIES_PATH)/ \
- $(CHROOT_BASE) '$(ARCHITECTURES)' '$(CODES)'
+build-package-deb: prepare-build-package-deb
+ vagrant destroy --force
+ for architecture in $(ARCHITECTURES); do \
+ for code_name in $(CODE_NAMES); do \
+ id=debian-$$code_name-$$architecture; \
+ vagrant up $$id || exit 1; \
+ vagrant destroy --force $$id; \
+ done; \
+ done
+
+prepare-build-package-deb: source env.sh
+ cp env.sh tmp/
+ rm -rf tmp/debian
+ cp -rp $(srcdir)/../debian tmp/
-source: ../$(PACKAGE)-$(VERSION).tar.gz
+source: tmp/$(PACKAGE)-$(VERSION).tar.gz
-../$(PACKAGE)-$(VERSION).tar.gz:
- ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../
+tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
+ mkdir -p tmp
+ cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Vagrantfile b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Vagrantfile
new file mode 100644
index 00000000000..97ba2496071
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/Vagrantfile
@@ -0,0 +1,27 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ vms = [
+ {
+ :id => "debian-wheezy-i386",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6-i386_chef-provisionerless.box
+",
+ },
+ {
+ :id => "debian-wheezy-amd64",
+ :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6_chef-provisionerless.box",
+ },
+ ]
+
+ vms.each do |vm|
+ config.vm.define(vm[:id]) do |node|
+ node.vm.box = vm[:id]
+ node.vm.box_url = vm[:box_url]
+ node.vm.provision(:shell, :path => "build-deb.sh")
+ end
+ end
+end
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh
index 28ee6284fae..fdfc8f52f03 100755
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-deb.sh
@@ -2,85 +2,56 @@
LANG=C
-PACKAGE=$(cat /tmp/build-package)
-USER_NAME=$(cat /tmp/build-user)
-VERSION=$(cat /tmp/build-version)
-DEPENDED_PACKAGES=$(cat /tmp/depended-packages)
-BUILD_SCRIPT=/tmp/build-deb-in-chroot.sh
-
run()
{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
+ "$@"
+ if test $? -ne 0; then
+ echo "Failed $@"
+ exit 1
+ fi
}
-if [ ! -x /usr/bin/lsb_release ]; then
- run apt-get update
- run apt-get install -y lsb-release
-fi
+. /vagrant/tmp/env.sh
-distribution=$(lsb_release --id --short)
-code_name=$(lsb_release --codename --short)
+run apt-get update
+run apt-get install -y lsb-release
-security_list=/etc/apt/sources.list.d/security.list
-if [ ! -f "${security_list}" ]; then
- case ${distribution} in
- Debian)
- if [ "${code_name}" = "sid" ]; then
- touch "${security_list}"
- else
- cat <<EOF > "${security_list}"
-deb http://security.debian.org/ ${code_name}/updates main
-deb-src http://security.debian.org/ ${code_name}/updates main
-EOF
- fi
- ;;
- Ubuntu)
- cat <<EOF > "${security_list}"
-deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
-deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
+distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
+code_name=$(lsb_release --codename --short)
+case "${distribution}" in
+ debian)
+ component=main
+ run cat <<EOF > /etc/apt/sources.list.d/groonga.list
+deb http://packages.groonga.org/debian/ wheezy main
+deb-src http://packages.groonga.org/debian/ wheezy main
EOF
- ;;
- esac
-fi
-
-sources_list=/etc/apt/sources.list
-if [ "$distribution" = "Ubuntu" ] && \
- ! (grep '^deb' $sources_list | grep -q universe); then
- run sed -i'' -e 's/main$/main universe/g' $sources_list
-fi
-
-if [ ! -x /usr/bin/aptitude ]; then
run apt-get update
- run apt-get install -y aptitude
-fi
-run aptitude update -V -D
-run aptitude safe-upgrade -V -D -y
-
-run aptitude install -V -D -y devscripts ${DEPENDED_PACKAGES}
-run aptitude clean
-
-if ! id $USER_NAME >/dev/null 2>&1; then
- run useradd -m $USER_NAME
-fi
-
-cat <<EOF > $BUILD_SCRIPT
-#!/bin/sh
-
-rm -rf build
-mkdir -p build
-
-cp /tmp/${PACKAGE}-${VERSION}.tar.gz build/${PACKAGE}_${VERSION}.orig.tar.gz
-cd build
-tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
-cd ${PACKAGE}-${VERSION}/
-cp -rp /tmp/${PACKAGE}-debian debian
+ run apt-get install -y --allow-unauthenticated groonga-keyring
+ run apt-get update
+ ;;
+ ubuntu)
+ component=universe
+ run apt-get -y install software-properties-common
+ run add-apt-repository -y universe
+ run add-apt-repository -y ppa:groonga/ppa
+ run apt-get update
+ ;;
+esac
+
+run apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
+
+run mkdir -p build
+run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
+ build/${PACKAGE}_${VERSION}.orig.tar.gz
+run cd build
+run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
+run cd ${PACKAGE}-${VERSION}/
+run cp -rp /vagrant/tmp/debian debian
# export DEB_BUILD_OPTIONS=noopt
-debuild -us -uc
-EOF
+run debuild -us -uc
+run cd -
-run chmod +x $BUILD_SCRIPT
-run su - $USER_NAME $BUILD_SCRIPT
+package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
+pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
+run mkdir -p "${pool_dir}/"
+run cp *.tar.gz *.dsc *.deb "${pool_dir}/"
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-in-chroot.sh b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-in-chroot.sh
deleted file mode 100755
index 6697b1e9d9d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/build-in-chroot.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-
-if [ $# != 7 ]; then
- echo "Usage: $0 PACKAGE VERSION SOURCE_DIR DESTINATION CHROOT_BASE ARCHITECTURES CODES"
- echo " e.g.: $0 groonga 0.1.9 SOURCE_DIR repositories/ /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-PACKAGE=$1
-VERSION=$2
-SOURCE_DIR=$3
-DESTINATION=$4
-CHROOT_BASE=$5
-ARCHITECTURES=$6
-CODES=$7
-
-PATH=/usr/local/sbin:/usr/sbin:$PATH
-
-script_base_dir=`dirname $0`
-
-if test "$PARALLEL" = "yes"; then
- parallel="yes"
-else
- parallel="no"
-fi
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-run_sudo()
-{
- run sudo "$@"
-}
-
-build_chroot()
-{
- architecture=$1
- code_name=$2
-
- run_sudo debootstrap --arch $architecture $code_name $base_dir
-
- case $code_name in
- lenny|squeeze|wheezy|unstable)
- run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list
- ;;
- *)
- run_sudo sed -i'' \
- -e 's,http://archive,http://jp.archive,' \
- -e 's/main$/main universe/' \
- $base_dir/etc/apt/sources.list
- ;;
- esac
-
- run_sudo sh -c "echo >> /etc/fstab"
- run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab"
- run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab"
- run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab"
- run_sudo mount ${base_dir}/sys
- run_sudo mount ${base_dir}/dev
- run_sudo mount ${base_dir}/dev/pts
- run_sudo mount ${base_dir}/proc
-}
-
-build()
-{
- architecture=$1
- code_name=$2
-
- target=${code_name}-${architecture}
- base_dir=${CHROOT_BASE}/${target}
- if [ ! -d $base_dir ]; then
- run build_chroot $architecture $code_name
- fi
-
- case ${code_name} in
- squeeze|wheezy|jessie|unstable)
- distribution=debian
- component=main
- ;;
- *)
- distribution=ubuntu
- component=universe
- ;;
- esac
-
- source_dir=${SOURCE_DIR}
- build_user=${PACKAGE}-build
- build_user_dir=${base_dir}/home/$build_user
- build_dir=${build_user_dir}/build
- pool_base_dir=${DESTINATION}${distribution}/pool/${code_name}/${component}
- package_initial=$(echo ${PACKAGE} | sed -e 's/\(.\).*/\1/')
- pool_dir=${pool_base_dir}/${package_initial}/${PACKAGE}
- run cp $source_dir/${PACKAGE}-${VERSION}.tar.gz \
- ${CHROOT_BASE}/$target/tmp/
- run rm -rf ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run cp -rp $source_dir/debian/ \
- ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian
- run echo $PACKAGE > ${CHROOT_BASE}/$target/tmp/build-package
- run echo $VERSION > ${CHROOT_BASE}/$target/tmp/build-version
- run echo $build_user > ${CHROOT_BASE}/$target/tmp/build-user
- run cp ${script_base_dir}/${PACKAGE}-depended-packages \
- ${CHROOT_BASE}/$target/tmp/depended-packages
- run cp ${script_base_dir}/build-deb.sh \
- ${CHROOT_BASE}/$target/tmp/
- run_sudo rm -rf $build_dir
- run_sudo su -c "/usr/sbin/chroot ${CHROOT_BASE}/$target /tmp/build-deb.sh"
- run mkdir -p $pool_dir
- for path in $build_dir/*; do
- [ -f $path ] && run cp -p $path $pool_dir/
- done
-}
-
-for architecture in $ARCHITECTURES; do
- for code_name in $CODES; do
- if test "$parallel" = "yes"; then
- build $architecture $code_name &
- else
- mkdir -p tmp
- build_log=tmp/build-$code_name-$architecture.log
- build $architecture $code_name 2>&1 | tee $build_log
- fi;
- done;
-done
-
-if test "$parallel" = "yes"; then
- wait
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/env.sh.in b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/env.sh.in
new file mode 100644
index 00000000000..6fb3e8407a1
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/env.sh.in
@@ -0,0 +1,8 @@
+PACKAGE=@PACKAGE@
+VERSION=@VERSION@
+DEPENDED_PACKAGES="
+debhelper
+autotools-dev
+pkg-config
+libgroonga-dev
+"
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/groonga-normalizer-mysql-depended-packages b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/groonga-normalizer-mysql-depended-packages
deleted file mode 100644
index 5bc35c391c3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/packages/apt/groonga-normalizer-mysql-depended-packages
+++ /dev/null
@@ -1,4 +0,0 @@
-debhelper
-autotools-dev
-pkg-config
-libgroonga-dev
diff --git a/storage/mroonga/version b/storage/mroonga/version
index e69cf02a547..b0372476047 100644
--- a/storage/mroonga/version
+++ b/storage/mroonga/version
@@ -1 +1 @@
-4.05 \ No newline at end of file
+4.06 \ No newline at end of file
diff --git a/storage/mroonga/version_in_hex b/storage/mroonga/version_in_hex
index c1f0bc81d7b..6f503be55dd 100644
--- a/storage/mroonga/version_in_hex
+++ b/storage/mroonga/version_in_hex
@@ -1 +1 @@
-0x0405 \ No newline at end of file
+0x0406 \ No newline at end of file
diff --git a/storage/mroonga/version_micro b/storage/mroonga/version_micro
index 7813681f5b4..62f9457511f 100644
--- a/storage/mroonga/version_micro
+++ b/storage/mroonga/version_micro
@@ -1 +1 @@
-5 \ No newline at end of file
+6 \ No newline at end of file