diff options
author | Kentoku SHIBA <kentokushiba@gmail.com> | 2015-04-30 04:44:30 +0900 |
---|---|---|
committer | Kentoku SHIBA <kentokushiba@gmail.com> | 2015-04-30 04:44:30 +0900 |
commit | a0fdb258a435290980993ae025a7fc19c09d2cdb (patch) | |
tree | 67023cf51c542ed78443d68e9c61b28b39583245 /storage/mroonga/mysql-test | |
parent | 060ec5b6b9384456695b6fc903ccfeb8c7ccd298 (diff) | |
download | mariadb-git-a0fdb258a435290980993ae025a7fc19c09d2cdb.tar.gz |
Update Mroonga to the latest version on 2015-04-30T04:44:30+0900
Diffstat (limited to 'storage/mroonga/mysql-test')
177 files changed, 3940 insertions, 552 deletions
diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc index b59a981d822..b78e79558d7 100644 --- a/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/check_version.inc @@ -1,4 +1,4 @@ -# Copyright(C) 2012-2013 Kouhei Sutou <kou@clear-code.com> +# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -20,9 +20,11 @@ let $version_major_minor = let $version_55 = `SELECT $version_major_minor = 5.5`; let $version_56 = `SELECT $version_major_minor = 5.6`; +let $version_57 = `SELECT $version_major_minor = 5.7`; let $version_100 = `SELECT $version_major_minor = 10.0`; let $version_55_or_later = `SELECT $version_major_minor >= 5.5`; let $version_56_or_later = `SELECT $version_major_minor >= 5.6`; +let $version_57_or_later = `SELECT $version_major_minor >= 5.7`; let $version_100_or_later = `SELECT $version_major_minor >= 10.0`; --enable_query_log diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc new file mode 100644 index 00000000000..1ab664ed6a8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/have_version_57.inc @@ -0,0 +1,21 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc + +if (!$version_57) { + skip This test is for MySQL version 5.7.x; +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc new file mode 100644 index 00000000000..8c9f76cd45f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mariadb_100_or_later.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($version_100_or_later) { + if ($mariadb) { + skip This test is not for MariaDB 10.x; + } +} diff --git a/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc new file mode 100644 index 00000000000..f1b1651a0b1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/include/mroonga/skip_mysql_57.inc @@ -0,0 +1,24 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/check_version.inc +--source ../../include/mroonga/check_mariadb.inc + +if ($version_57) { + if (!$mariadb) { + skip This test is not for MySQL 5.7.x; + } +} diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result index 1bc15c6efe2..e441df32c92 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_flags.result @@ -2,8 +2,8 @@ CREATE TABLE tags ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ) DEFAULT CHARSET=utf8; ALTER TABLE tags ADD COLUMN name VARCHAR(64) COMMENT 'flags "COLUMN_VECTOR"'; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create tags TABLE_PAT_KEY UInt32 column_create tags id COLUMN_SCALAR UInt32 column_create tags name COLUMN_VECTOR ShortText diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result index 6ff92ec8e99..b4c3044c7d5 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_column_with_type.result @@ -5,12 +5,14 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY ) DEFAULT CHARSET=utf8; ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'type "tags"'; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create tags TABLE_PAT_KEY UInt32 column_create tags id COLUMN_SCALAR UInt32 + table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 + column_create bugs name COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result index e0449e3e54b..21784decb88 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_index_token_filters_one_token_filter.result @@ -5,15 +5,13 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText + table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord + 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_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_primary_key.result new file mode 100644 index 00000000000..439684ac5d6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_add_primary_key.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT NOT NULL +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +ALTER TABLE ids ADD PRIMARY KEY (id); +SHOW CREATE TABLE ids; +Table Create Table +ids CREATE TABLE `ids` ( + `id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +SELECT * FROM ids WHERE id = 2; +id +2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result index 5046dc8e142..1c96236230b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_change_token_filter.result @@ -10,23 +10,39 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText +ALTER TABLE memos DISABLE KEYS; +ALTER TABLE memos ENABLE KEYS; +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") +table_create memos TABLE_PAT_KEY Int32 +column_create memos content COLUMN_SCALAR LongText +column_create memos id COLUMN_SCALAR Int32 + +table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord +column_create terms is_stop_word COLUMN_SCALAR Int8 +column_create terms term COLUMN_SCALAR ShortText + +column_create terms content COLUMN_INDEX|WITH_POSITION memos content DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result index c7051127946..ba6cf6c24ed 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_disable_keys_fulltext_table.result @@ -8,20 +8,24 @@ id int PRIMARY KEY, content text NOT NULL, FULLTEXT INDEX content_index (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content ALTER TABLE memos DISABLE KEYS; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 -DROP TABLE memos, terms; +DROP TABLE memos; +DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result new file mode 100644 index 00000000000..cbcf9a69b56 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_drop_primary_key.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +ALTER TABLE ids DROP PRIMARY KEY; +SHOW CREATE TABLE ids; +Table Create Table +ids CREATE TABLE `ids` ( + `id` int(11) NOT NULL +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +SELECT * FROM ids WHERE id = 2; +id +2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result index 97d2be3f8d5..452caa574f9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_enable_keys_fulltext_table.result @@ -9,20 +9,24 @@ content text NOT NULL, FULLTEXT INDEX content_index (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; ALTER TABLE memos DISABLE KEYS; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 ALTER TABLE memos ENABLE KEYS; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + column_create terms content_index COLUMN_INDEX|WITH_POSITION memos content -DROP TABLE memos, terms; +DROP TABLE memos; +DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result index d8ed80a157d..ed36927e7b9 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/alter_table_spatial.result @@ -6,115 +6,115 @@ location GEOMETRY NOT NULL ); INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', -GeomFromText('POINT(139.762573 35.720253)')); +ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', -GeomFromText('POINT(139.715591 35.712521)')); +ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', -GeomFromText('POINT(139.659088 35.683712)')); +ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', -GeomFromText('POINT(139.706207 35.721516)')); +ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', -GeomFromText('POINT(139.685608 35.714844)')); +ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); +ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', -GeomFromText('POINT(139.817154 35.700516)')); +ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', -GeomFromText('POINT(139.81105 35.698254)')); +ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', -GeomFromText('POINT(139.638611 35.705517)')); +ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', -GeomFromText('POINT(139.637115 35.703938)')); +ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', -GeomFromText('POINT(139.537323 35.644539)')); +ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', -GeomFromText('POINT(139.695755 35.628922)')); +ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', -GeomFromText('POINT(139.638657 35.665501)')); +ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', -GeomFromText('POINT(139.76857 35.680912)')); +ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', -GeomFromText('POINT(139.647598 35.700817)')); +ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', -GeomFromText('POINT(139.652573 35.722736)')); +ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', -GeomFromText('POINT(139.796234 35.730061)')); +ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', -GeomFromText('POINT(139.704834 35.650345)')); +ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', -GeomFromText('POINT(139.770599 35.681461)')); +ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', -GeomFromText('POINT(139.783981 35.685341)')); +ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', -GeomFromText('POINT(139.794846 35.716969)')); +ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', -GeomFromText('POINT(139.560913 35.698601)')); +ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', -GeomFromText('POINT(139.652817 35.642601)')); +ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', -GeomFromText('POINT(139.727356 35.627346)')); +ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', -GeomFromText('POINT(139.737381 35.640556)')); +ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', -GeomFromText('POINT(139.760895 35.673508)')); +ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', -GeomFromText('POINT(139.676071 35.680603)')); +ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', -GeomFromText('POINT(139.668106 35.608021)')); +ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', -GeomFromText('POINT(139.673203 35.64151)')); +ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', -GeomFromText('POINT(139.796829 35.712013)')); +ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', -GeomFromText('POINT(139.712524 35.616199)')); +ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', -GeomFromText('POINT(139.665833 35.609039)')); +ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', -GeomFromText('POINT(139.770721 35.66592)')); +ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', -GeomFromText('POINT(139.780273 35.672626)')); +ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', -GeomFromText('POINT(139.774628 35.671825)')); +ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', -GeomFromText('POINT(139.711517 35.647701)')); +ST_GeomFromText('POINT(139.711517 35.647701)')); ALTER TABLE shops ADD SPATIAL KEY location_index (location); -SELECT id, name, AsText(location) AS location_text FROM shops -WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) ORDER BY id; id name location_text 14 tetsuji POINT(139.76857 35.680911944444446) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result new file mode 100644 index 00000000000..b9e22da4e2d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_french.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8mb4; +CREATE TABLE diaries ( +content varchar(256) COLLATE utf8mb4_unicode_520_ci, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; +INSERT INTO diaries VALUES ("Je suis un garçon."); +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("+garcon" IN BOOLEAN MODE); +content +Je suis un garçon. +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result new file mode 100644 index 00000000000..29e55b7d9d5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/collation_utf8_unicode_520_ci_japanese.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES utf8mb4; +CREATE TABLE diaries ( +content varchar(256) COLLATE utf8mb4_unicode_520_ci, +FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; +INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。"); +SELECT * FROM diaries +WHERE MATCH (content) AGAINST ("+かたかな" IN BOOLEAN MODE); +content +ひらがなとカタカナを覚えました。 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result index 6ac2e1937fe..724d20edd62 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_fulltext_vector_other_table.result @@ -12,26 +12,17 @@ tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"', FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"' ) DEFAULT CHARSET=utf8; INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit column_create tags name COLUMN_SCALAR ShortText + table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 + column_create bugs tags COLUMN_VECTOR tags + column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags -load --table tags -[ -["_key","name"], -["Linux",""], -["MySQL",""], -["groonga",""] -] -load --table bugs -[ -["_key","id","tags"], -[1,1,["Linux","MySQL","groonga"]] -] SELECT *, MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score FROM bugs WHERE MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE); diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result index e46ed71d0fe..aa7735ef780 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_groonga_index_int_other_table.result @@ -13,28 +13,17 @@ INDEX bugs_priority_index (priority) COMMENT 'table "priorities"' INSERT INTO bugs (id, priority) VALUES (1, 10); INSERT INTO bugs (id, priority) VALUES (2, 3); INSERT INTO bugs (id, priority) VALUES (3, -2); -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); +mroonga_command("dump --dump_plugins no --dump_records no") table_create priorities TABLE_PAT_KEY Int32 column_create priorities id COLUMN_SCALAR Int32 + table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 + column_create bugs priority COLUMN_SCALAR priorities + column_create priorities bugs_priority_index COLUMN_INDEX|WITH_POSITION bugs priority -load --table priorities -[ -["_key","id"], -[-2,0], -[3,0], -[10,0] -] -load --table bugs -[ -["_key","id","priority"], -[1,1,10], -[2,2,3], -[3,3,-2] -] SELECT * FROM bugs WHERE priority = 3; 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 e14c67291cd..9302037b7e1 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 @@ -3,8 +3,8 @@ name VARCHAR(64) PRIMARY KEY ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='default_tokenizer "TokenDelimit"'; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit column_create tags name COLUMN_SCALAR ShortText DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result new file mode 100644 index 00000000000..c9283db72bb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_none.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL, +FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos-content index COLUMN_INDEX memos content +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_with_position_and_with_weight.result new file mode 100644 index 00000000000..853845d5c15 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_with_position_and_with_weight.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL, +FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' +) DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos content +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_primary_key_table_comment_with_using_hash.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_primary_key_table_comment_with_using_hash.result new file mode 100644 index 00000000000..5e4f4afa377 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_normalizer_primary_key_table_comment_with_using_hash.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS memos; +DROP TABLE IF EXISTS terms; +SET NAMES utf8; +CREATE TABLE terms ( +term VARCHAR(64) NOT NULL, +PRIMARY KEY (term) USING HASH +) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8; +CREATE TABLE memos ( +id INT NOT NULL PRIMARY KEY, +content TEXT NOT NULL, +FULLTEXT INDEX (content) COMMENT 'table "terms"' +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍"); +SELECT * FROM memos +WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE); +id content +1 1日の消費㌍は約2000㌔㌍ +DROP TABLE memos; +DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result index 68a6bc8012f..dc3f39d286e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_reference_type.result @@ -5,12 +5,14 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, tag VARCHAR(64) COMMENT 'type "tags"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create tags TABLE_PAT_KEY ShortText column_create tags name COLUMN_SCALAR ShortText + table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 + column_create bugs tag COLUMN_SCALAR tags DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_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 index 7d762258e6f..785c5d785b9 100644 --- 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 @@ -6,10 +6,12 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText + table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord + 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 index 6cc89a7b941..9ce60054300 100644 --- 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 @@ -6,10 +6,12 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_NO_KEY column_create memos content COLUMN_SCALAR ShortText + table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord + 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 index fe7e0059250..de1946e9214 100644 --- 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 @@ -10,14 +10,16 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + 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 index fe855b60f38..f3349980db1 100644 --- 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 @@ -10,14 +10,16 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord column_create terms is_stop_word COLUMN_SCALAR Int8 column_create terms term COLUMN_SCALAR ShortText + table_create memos TABLE_PAT_KEY Int32 column_create memos content COLUMN_SCALAR LongText column_create memos id COLUMN_SCALAR Int32 + 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 561a266598f..af3c19e9bb0 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 @@ -2,8 +2,8 @@ CREATE TABLE bugs ( id INT UNSIGNED PRIMARY KEY, tags TEXT COMMENT 'flags "COLUMN_VECTOR"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); -mroonga_command("dump") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create bugs TABLE_PAT_KEY UInt32 column_create bugs id COLUMN_SCALAR UInt32 column_create bugs tags COLUMN_VECTOR LongText diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result new file mode 100644 index 00000000000..c8270bc3dde --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_boolean_mode_pragma_all.result @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS memos; +SET NAMES utf8; +CREATE TABLE memos ( +id INT PRIMARY KEY, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; +INSERT INTO memos VALUES(1, "Groonga", "Groonga is fast."); +INSERT INTO memos VALUES(2, "Mroonga", "Mroonga is also fast."); +INSERT INTO memos VALUES(3, "Rroonga", "Rroonga is also fast."); +SELECT *, +MATCH(title, content) +AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE) AS score +FROM memos +WHERE MATCH(title, content) +AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE); +id title content score +1 Groonga Groonga is fast. 12 +2 Mroonga Mroonga is also fast. 12 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result index 6c268ff7641..c337bfcb8db 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_insert_select.result @@ -43,24 +43,4 @@ select * from t2 where c2>"s" order by c1 asc; c1 c2 4 sa si su se so 5 ta ti ii ii to -select * from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; -c1 c2 -3 aa ii ii ii oo -5 ta ti ii ii to -1 aa ii uu ee oo -select * from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; -c1 c2 -1 aa ii uu ee oo -5 ta ti ii ii to -3 aa ii ii ii oo -select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); -c1 c2 match(c2) against("ii") -1 aa ii uu ee oo 174763 -3 aa ii ii ii oo 524289 -5 ta ti ii ii to 349526 -select c1,c2,match(c2) against("ii") from t2 where match(c2) against("ii"); -c1 c2 match(c2) against("ii") -1 aa ii uu ee oo 174763 -3 aa ii ii ii oo 524289 -5 ta ti ii ii to 349526 drop table t1,t2; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_against.result new file mode 100644 index 00000000000..d1f0d6bc0ab --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_against.result @@ -0,0 +1,23 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga mroonga" IN BOOLEAN MODE) +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start mroonga 0 +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_match.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_match.result new file mode 100644 index 00000000000..b4a07cd0b66 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_different_match.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +body TEXT, +FULLTEXT KEY (title), +FULLTEXT KEY (body) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga", "I read groonga's tutorial."); +INSERT INTO diaries VALUES("Start mroonga", "I read mroonga's tutorial."); +INSERT INTO diaries VALUES("Start groonga and Ruby", "I installed rroonga."); +SELECT * FROM diaries; +title body +Start groonga I read groonga's tutorial. +Start mroonga I read mroonga's tutorial. +Start groonga and Ruby I installed rroonga. +SELECT *, MATCH(body) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) +ORDER BY MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); +title body score +Start groonga and Ruby I installed rroonga. 0 +Start groonga I read groonga's tutorial. 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_no_where.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_no_where.result new file mode 100644 index 00000000000..125b35fb96e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_no_where.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start mroonga 0 +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_same_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_same_match_against.result new file mode 100644 index 00000000000..a3a668c4445 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_boolean_mode_same_match_against.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SET NAMES UTF8; +CREATE TABLE diaries( +title TEXT, +FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); +SELECT * FROM diaries; +title +Start groonga +Start mroonga +Start groonga and Ruby +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score +FROM diaries +WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) +ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); +title score +Start groonga 1 +Start groonga and Ruby 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result new file mode 100644 index 00000000000..7f0934d3094 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_asc.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); +SELECT * FROM logs; +message +Error Error Error +Warning Warning Warning +Error Error +Warning Warning +Error +Warning +Error Error Error Error +Warning Warning Warning Warning +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score +FROM logs +WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) +ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) ASC; +message score +Error 174763 +Error Error 349526 +Error Error Error 524289 +Error Error Error Error 699052 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result new file mode 100644 index 00000000000..fa577b17f83 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_desc.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); +SELECT * FROM logs; +message +Error Error Error +Warning Warning Warning +Error Error +Warning Warning +Error +Warning +Error Error Error Error +Warning Warning Warning Warning +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score +FROM logs +WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) +ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) DESC; +message score +Error Error Error Error 699052 +Error Error Error 524289 +Error Error 349526 +Error 174763 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result new file mode 100644 index 00000000000..958883e5841 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_against.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); +SELECT * FROM logs; +message +Error Error Error +Warning Warning Warning +Error Error +Warning Warning +Error +Warning +Error Error Error Error +Warning Warning Warning Warning +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score +FROM logs +WHERE MATCH(message) AGAINST("Error Warning" IN NATURAL LANGUAGE MODE) +ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); +message score +Error 174763 +Error Error 349526 +Error Error Error 524289 +Error Error Error Error 699052 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result new file mode 100644 index 00000000000..76abb660c19 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_different_match.result @@ -0,0 +1,36 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +host TEXT, +FULLTEXT KEY (message), +FULLTEXT KEY (host) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error", "host1"); +INSERT INTO logs VALUES("Warning Warning Warning", "host1"); +INSERT INTO logs VALUES("Error Error", "host2"); +INSERT INTO logs VALUES("Warning Warning", "host2"); +INSERT INTO logs VALUES("Error", "host2"); +INSERT INTO logs VALUES("Warning", "host2"); +INSERT INTO logs VALUES("Error Error Error Error", "host2"); +INSERT INTO logs VALUES("Warning Warning Warning Warning", "host2"); +SELECT * FROM logs; +message host +Error Error Error host1 +Warning Warning Warning host1 +Error Error host2 +Warning Warning host2 +Error host2 +Warning host2 +Error Error Error Error host2 +Warning Warning Warning Warning host2 +SELECT *, MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE) AS score +FROM logs +WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) +ORDER BY MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE); +message host score +Error Error Error host1 0 +Error Error host2 116509 +Error host2 116509 +Error Error Error Error host2 116509 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result new file mode 100644 index 00000000000..30130e6c85b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_no_where.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); +SELECT * FROM logs; +message +Error Error Error +Warning Warning Warning +Error Error +Warning Warning +Error +Warning +Error Error Error Error +Warning Warning Warning Warning +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score +FROM logs +ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); +message score +Warning Warning Warning 0 +Warning Warning 0 +Warning 0 +Warning Warning Warning Warning 0 +Error 174763 +Error Error 349526 +Error Error Error 524289 +Error Error Error Error 699052 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result new file mode 100644 index 00000000000..ac2e7522db7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/fulltext_order_natural_language_mode_same_match_against.result @@ -0,0 +1,34 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs( +message TEXT, +FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); +SELECT * FROM logs; +message +Error Error Error +Warning Warning Warning +Error Error +Warning Warning +Error +Warning +Error Error Error Error +Warning Warning Warning Warning +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score +FROM logs +WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) +ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); +message score +Error 174763 +Error Error 349526 +Error Error Error 524289 +Error Error Error Error 699052 +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result index 2e9314db109..5e831860c5e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null.result @@ -6,8 +6,8 @@ INSERT INTO shops VALUES (NULL), (NULL); Warnings: Warning 1048 Column 'location' cannot be null Warning 1048 Column 'location' cannot be null -SELECT AsText(location) FROM shops; -AsText(location) +SELECT ST_AsText(location) FROM shops; +ST_AsText(location) POINT(0 0) POINT(0 0) DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result new file mode 100644 index 00000000000..271cf922fd5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_bulk_insert_null_57.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS shops; +CREATE TABLE shops ( +location GEOMETRY NOT NULL +); +SET SESSION sql_mode = ''; +INSERT INTO shops VALUES (NULL), (NULL); +Warnings: +Warning 1048 Column 'location' cannot be null +SET SESSION sql_mode = default; +SELECT ST_AsText(location) FROM shops; +ST_AsText(location) +POINT(0 0) +POINT(0 0) +DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result index e88402a10b4..29fd989b4f4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/geometry_contains.result @@ -16,113 +16,113 @@ shops CREATE TABLE `shops` ( ) ENGINE=Mroonga DEFAULT CHARSET=latin1 INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', -GeomFromText('POINT(139.762573 35.720253)')); +ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', -GeomFromText('POINT(139.715591 35.712521)')); +ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', -GeomFromText('POINT(139.659088 35.683712)')); +ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', -GeomFromText('POINT(139.706207 35.721516)')); +ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', -GeomFromText('POINT(139.685608 35.714844)')); +ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); +ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', -GeomFromText('POINT(139.817154 35.700516)')); +ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', -GeomFromText('POINT(139.81105 35.698254)')); +ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', -GeomFromText('POINT(139.638611 35.705517)')); +ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', -GeomFromText('POINT(139.637115 35.703938)')); +ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', -GeomFromText('POINT(139.537323 35.644539)')); +ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', -GeomFromText('POINT(139.695755 35.628922)')); +ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', -GeomFromText('POINT(139.638657 35.665501)')); +ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', -GeomFromText('POINT(139.76857 35.680912)')); +ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', -GeomFromText('POINT(139.647598 35.700817)')); +ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', -GeomFromText('POINT(139.652573 35.722736)')); +ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', -GeomFromText('POINT(139.796234 35.730061)')); +ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', -GeomFromText('POINT(139.704834 35.650345)')); +ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', -GeomFromText('POINT(139.770599 35.681461)')); +ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', -GeomFromText('POINT(139.783981 35.685341)')); +ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', -GeomFromText('POINT(139.794846 35.716969)')); +ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', -GeomFromText('POINT(139.560913 35.698601)')); +ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', -GeomFromText('POINT(139.652817 35.642601)')); +ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', -GeomFromText('POINT(139.727356 35.627346)')); +ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', -GeomFromText('POINT(139.737381 35.640556)')); +ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', -GeomFromText('POINT(139.760895 35.673508)')); +ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', -GeomFromText('POINT(139.676071 35.680603)')); +ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', -GeomFromText('POINT(139.668106 35.608021)')); +ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', -GeomFromText('POINT(139.673203 35.64151)')); +ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', -GeomFromText('POINT(139.796829 35.712013)')); +ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', -GeomFromText('POINT(139.712524 35.616199)')); +ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', -GeomFromText('POINT(139.665833 35.609039)')); +ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', -GeomFromText('POINT(139.770721 35.66592)')); +ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', -GeomFromText('POINT(139.780273 35.672626)')); +ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', -GeomFromText('POINT(139.774628 35.671825)')); +ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', -GeomFromText('POINT(139.711517 35.647701)')); -SELECT id, name, AsText(location) AS location_text FROM shops; +ST_GeomFromText('POINT(139.711517 35.647701)')); +SELECT id, name, ST_AsText(location) AS location_text FROM shops; id name location_text 1 nezu-no-taiyaki POINT(139.76257305555555 35.72025305555556) 2 taiyaki-kataoka POINT(139.7155911111111 35.712521111111116) @@ -160,8 +160,8 @@ id name location_text 34 shigeta POINT(139.78027305555557 35.67262611111111) 35 nishimi-ya POINT(139.77462805555555 35.671825) 36 hiiragi POINT(139.71151694444444 35.64770111111111) -SELECT id, name, AsText(location) AS location_text FROM shops -WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) ORDER BY id; id name location_text 14 tetsuji POINT(139.76857 35.680911944444446) diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result new file mode 100644 index 00000000000..c2adc1cde2d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_asc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value > 10 ORDER BY value ASC LIMIT 3; +id value +3 30 +1 50 +2 70 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result new file mode 100644 index 00000000000..715d299d608 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_desc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value > 10 ORDER BY value DESC LIMIT 3; +id value +4 90 +2 70 +1 50 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result new file mode 100644 index 00000000000..d562fbbb644 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_asc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value >= 30 ORDER BY value ASC LIMIT 3; +id value +3 30 +1 50 +2 70 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result new file mode 100644 index 00000000000..5ecb4699fac --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_greater_than_or_equal_desc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value >= 30 ORDER BY value DESC LIMIT 3; +id value +4 90 +2 70 +1 50 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result new file mode 100644 index 00000000000..45b3fbe122a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_asc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value < 90 ORDER BY value ASC LIMIT 3; +id value +5 10 +3 30 +1 50 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result new file mode 100644 index 00000000000..2e896e5e650 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_desc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value < 90 ORDER BY value DESC LIMIT 3; +id value +2 70 +1 50 +3 30 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result new file mode 100644 index 00000000000..d5313c9d0f4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_asc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value <= 70 ORDER BY value ASC LIMIT 3; +id value +5 10 +3 30 +1 50 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result new file mode 100644 index 00000000000..c56a4332f1f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_normal_less_than_or_equal_desc.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, +value INT(10), +INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); +SELECT id, value FROM ids WHERE value <= 70 ORDER BY value DESC LIMIT 3; +id value +2 70 +1 50 +3 30 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result new file mode 100644 index 00000000000..1ca4b145f54 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id > 1 ORDER BY ids.id ASC LIMIT 3; +id +2 +3 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_desc.result new file mode 100644 index 00000000000..80dcb25ffe6 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_desc.result @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id > 3 ORDER BY ids.id DESC LIMIT 3; +id +5 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_asc.result new file mode 100644 index 00000000000..4c1ff997d79 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id >= 2 ORDER BY ids.id ASC LIMIT 3; +id +2 +3 +4 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_desc.result new file mode 100644 index 00000000000..4998725aef5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_greater_than_or_equal_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id >= 3 ORDER BY ids.id DESC LIMIT 3; +id +5 +4 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_asc.result new file mode 100644 index 00000000000..8b142f30610 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id ASC LIMIT 3; +id +1 +2 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_desc.result new file mode 100644 index 00000000000..eaf5b87e62c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id DESC LIMIT 3; +id +3 +2 +1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_asc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_asc.result new file mode 100644 index 00000000000..e1e96c9ca8b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_asc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id ASC LIMIT 3; +id +1 +2 +3 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_desc.result b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_desc.result new file mode 100644 index 00000000000..e8124ca14c0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/index_range_primary_less_than_or_equal_desc.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS ids; +SET NAMES UTF8; +CREATE TABLE ids ( +id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id DESC LIMIT 3; +id +4 +3 +2 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result new file mode 100644 index 00000000000..b66801094bd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_TODO_SPLIT_ME.result @@ -0,0 +1,106 @@ +drop table if exists t1, t2, t3; +flush status; +create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3)); +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,20,"ka ki ku ke ko"); +insert into t1 values(3,30,"sa si su se so"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ee oo"); +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +select * from t1; +c1 c2 c3 +1 10 aa ii uu ee oo +2 20 ka ki ku ke ko +3 30 sa si su se so +4 40 ta ti tu te to +5 50 aa ii uu ee oo +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +select count(*) from t1; +count(*) +5 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +select * from t1 force index(primary) where c1 between 2 and 4; +c1 c2 c3 +2 20 ka ki ku ke ko +3 30 sa si su se so +4 40 ta ti tu te to +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +select count(*) from t1 force index(primary) where c1 between 2 and 4; +count(*) +3 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +select c1 from t1 force index(primary) where c1 < 3; +c1 +1 +2 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +select count(c1) from t1 force index(primary) where c1 < 3; +count(c1) +2 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +select 1 from t1 force index(primary) where c1 > 3; +1 +1 +1 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +select count(1) from t1 force index(primary) where c1 > 3; +count(1) +2 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 2 +select * from t1 where match(c3) against("su"); +c1 c2 c3 +3 30 sa si su se so +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 2 +select count(*) from t1 where match(c3) against("su"); +count(*) +1 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 3 +select * from t1 where match(c3) against("+su" in boolean mode); +c1 c2 c3 +3 30 sa si su se so +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 3 +select count(*) from t1 where match(c3) against("+su" in boolean mode); +count(*) +1 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 4 +select * from t1 force index(idx1) where c2 between 20 and 40; +c1 c2 c3 +2 20 ka ki ku ke ko +3 30 sa si su se so +4 40 ta ti tu te to +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 4 +select count(*) from t1 force index(idx1) where c2 between 20 and 40; +count(*) +3 +show status like 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 5 +drop table t1; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result new file mode 100644 index 00000000000..c09ec340ccb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX ft(title) +); +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_single_thread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_single_thread.result new file mode 100644 index 00000000000..c09ec340ccb --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_single_thread.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +CREATE TABLE diaries ( +title TEXT, +FULLTEXT INDEX ft(title) +); +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +COUNT(*) +1 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 1 +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result new file mode 100644 index 00000000000..9971d21e386 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_disabled.result @@ -0,0 +1,32 @@ +DROP TABLE IF EXISTS diaries; +FLUSH STATUS; +SET NAMES UTF8; +CREATE TABLE diaries ( +id INT UNSIGNED NOT NULL, +title VARCHAR(255), +content TEXT, +FULLTEXT INDEX(content) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(10) unsigned NOT NULL, + `title` varchar(255) DEFAULT NULL, + `content` text, + FULLTEXT KEY `content` (`content`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, "はれ", "天気がよいのは今日までみたい。"); +SET mroonga_enable_optimization=FALSE; +SELECT COUNT(*) FROM diaries +WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE); +COUNT(*) +4 +SHOW STATUS LIKE 'mroonga_count_skip'; +Variable_name Value +Mroonga_count_skip 0 +SET mroonga_enable_optimization=TRUE; +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result new file mode 100644 index 00000000000..407347a4fa2 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_view.result @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS diaries, users; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +user_id INT NOT NULL, +title VARCHAR(45) NOT NULL, +KEY (user_id), +FULLTEXT INDEX title_index (title) +) DEFAULT CHARSET=UTF8; +CREATE TABLE users ( +id INT PRIMARY KEY AUTO_INCREMENT, +name VARCHAR(45) NOT NULL, +INDEX (name) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8; +INSERT INTO users (id, name) VALUES (1, "Alice"), (2, "Bob"); +INSERT INTO diaries (user_id, title) VALUES (1, "survey"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (1)"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (2)"); +CREATE VIEW articles AS +SELECT diaries.user_id AS user_id, +diaries.title AS title, +users.name AS name +FROM diaries, users +WHERE diaries.user_id = users.id; +SELECT COUNT(*) FROM articles WHERE name = 'Bob'; +COUNT(*) +2 +DROP VIEW articles; +DROP TABLE diaries, users; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result new file mode 100644 index 00000000000..9ea8ea40093 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_order_limit_optimized_duplicated_order_by_columns.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS ids; +FLUSH STATUS; +SET NAMES utf8mb4; +CREATE TABLE ids ( +id int PRIMARY KEY, +text varchar(32), +FULLTEXT INDEX (text) +) DEFAULT CHARSET=utf8mb4; +INSERT INTO ids VALUES (1, 'first'); +SELECT * FROM ids +WHERE MATCH(text) AGAINST('+first' IN BOOLEAN MODE) +ORDER BY id, id +LIMIT 1; +id text +1 first +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result new file mode 100644 index 00000000000..8d8208f81a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/partition_update.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS logs; +SET NAMES UTF8; +CREATE TABLE logs ( +timestamp DATETIME, +message TEXT +) DEFAULT CHARSET=UTF8 +PARTITION BY RANGE (TO_DAYS(timestamp)) ( +PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')), +PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')), +PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')), +PARTITION pfuture VALUES LESS THAN MAXVALUE +); +SHOW CREATE TABLE logs; +Table Create Table +logs CREATE TABLE `logs` ( + `timestamp` datetime DEFAULT NULL, + `message` text +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +/*!50100 PARTITION BY RANGE (TO_DAYS(timestamp)) +(PARTITION p201501 VALUES LESS THAN (735995) ENGINE = Mroonga, + PARTITION p201502 VALUES LESS THAN (736023) ENGINE = Mroonga, + PARTITION p201503 VALUES LESS THAN (736054) ENGINE = Mroonga, + PARTITION pfuture VALUES LESS THAN MAXVALUE ENGINE = Mroonga) */ +INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start'); +SELECT * FROM logs ORDER BY timestamp; +timestamp message +2015-01-01 00:00:00 Start +2015-02-01 00:00:00 Start +2015-03-01 00:00:00 Start +2015-04-01 00:00:00 Start +UPDATE logs +SET message = 'Started' + WHERE timestamp < '2015-03-01 00:00:00'; +SELECT * FROM logs ORDER BY timestamp; +timestamp message +2015-01-01 00:00:00 Started +2015-02-01 00:00:00 Started +2015-03-01 00:00:00 Start +2015-04-01 00:00:00 Start +DROP TABLE logs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result new file mode 100644 index 00000000000..0812fc1089b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/repair_table_no_index_file.result @@ -0,0 +1,40 @@ +CREATE DATABASE repair_test; +USE repair_test; +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +title TEXT, +body TEXT, +FULLTEXT INDEX body_index (body) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` text, + `body` text, + PRIMARY KEY (`id`), + FULLTEXT KEY `body_index` (`body`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 +INSERT INTO diaries (title, body) VALUES ("survey", "will start Groonga!"); +INSERT INTO diaries (title, body) VALUES ("Groonga (1)", "starting Groonga..."); +INSERT INTO diaries (title, body) VALUES ("Groonga (2)", "started Groonga."); +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); +id title body +2 Groonga (1) starting Groonga... +FLUSH TABLES; +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); +ERROR HY000: syscall error 'repair_test.mrn.000010A.c' (No such file or directory) +REPAIR TABLE diaries; +Table Op Msg_type Msg_text +repair_test.diaries repair status OK +SELECT * FROM diaries; +id title body +1 survey will start Groonga! +2 Groonga (1) starting Groonga... +3 Groonga (2) started Groonga. +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); +id title body +2 Groonga (1) starting Groonga... +DROP TABLE diaries; +DROP DATABASE repair_test; +USE test; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result b/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result index 94bd5167dbc..e88a799fe2f 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/replace_geometry.result @@ -5,19 +5,19 @@ geo GEOMETRY NOT NULL, PRIMARY KEY(id) ) DEFAULT CHARSET=utf8; INSERT INTO geo_replace VALUES(1, POINT(100,100)); -SELECT id, ASTEXT(geo) FROM geo_replace; -id ASTEXT(geo) +SELECT id, ST_AsText(geo) FROM geo_replace; +id ST_AsText(geo) 1 POINT(100 100) REPLACE INTO geo_replace VALUES(1, POINT(100,200)); -SELECT id, ASTEXT(geo) FROM geo_replace; -id ASTEXT(geo) +SELECT id, ST_AsText(geo) FROM geo_replace; +id ST_AsText(geo) 1 POINT(100 200) INSERT INTO geo_replace VALUES(1, POINT(200,200)) ON DUPLICATE KEY UPDATE geo = POINT(200,200); -SELECT id, ASTEXT(geo) FROM geo_replace; -id ASTEXT(geo) +SELECT id, ST_AsText(geo) FROM geo_replace; +id ST_AsText(geo) 1 POINT(200 200) UPDATE geo_replace SET geo = POINT(200,300); -SELECT id, ASTEXT(geo) FROM geo_replace; -id ASTEXT(geo) +SELECT id, ST_AsText(geo) FROM geo_replace; +id ST_AsText(geo) 1 POINT(200 300) DROP TABLE geo_replace; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result index 4536dded9d7..beca93b62ad 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_database_path_prefix.result @@ -13,5 +13,5 @@ id 1 DROP TABLE counts; DROP DATABASE clean_test; -USE test; SET GLOBAL mroonga_database_path_prefix = NULL; +USE test; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result new file mode 100644 index 00000000000..0181fe02d84 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); +SET GLOBAL mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index +SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result new file mode 100644 index 00000000000..aca9d75c20f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_session.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); +SET mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index +SET mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test index c93ae13a19e..96c99612190 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_flags.test @@ -30,7 +30,7 @@ CREATE TABLE tags ( ALTER TABLE tags ADD COLUMN name VARCHAR(64) COMMENT 'flags "COLUMN_VECTOR"'; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test index 2f39d52777a..dd05765585d 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_column_with_type.test @@ -34,7 +34,7 @@ CREATE TABLE bugs ( ALTER TABLE bugs ADD COLUMN name VARCHAR(64) COMMENT 'type "tags"'; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE bugs; DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test index aee355fdfc1..9c01dc27e3e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_index_token_filters_one_token_filter.test @@ -31,11 +31,9 @@ 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"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test new file mode 100644 index 00000000000..3dbfe5e24f0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_add_primary_key.test @@ -0,0 +1,37 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT NOT NULL +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); + +ALTER TABLE ids ADD PRIMARY KEY (id); +SHOW CREATE TABLE ids; + +SELECT * FROM ids WHERE id = 2; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test index fd47d2a60f0..7ec047818e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_change_token_filter.test @@ -36,11 +36,16 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); ALTER TABLE terms COMMENT='default_tokenizer "TokenBigram", token_filters "TokenFilterStopWord"'; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); + +ALTER TABLE memos DISABLE KEYS; +ALTER TABLE memos ENABLE KEYS; + +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; DROP TABLE terms; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test index d0c1313c784..97d2d2ed5ec 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_disable_keys_fulltext_table.test @@ -35,11 +35,12 @@ CREATE TABLE memos ( FULLTEXT INDEX content_index (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); ALTER TABLE memos DISABLE KEYS; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); -DROP TABLE memos, terms; +DROP TABLE memos; +DROP TABLE terms; --source ../../include/mroonga/unload_mroonga_functions.inc --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test new file mode 100644 index 00000000000..87de166cbfd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_drop_primary_key.test @@ -0,0 +1,37 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); + +ALTER TABLE ids DROP PRIMARY KEY; +SHOW CREATE TABLE ids; + +SELECT * FROM ids WHERE id = 2; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test index b05fa6aa116..4ff4af63534 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_enable_keys_fulltext_table.test @@ -36,11 +36,12 @@ CREATE TABLE memos ( ) DEFAULT CHARSET=utf8; ALTER TABLE memos DISABLE KEYS; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); ALTER TABLE memos ENABLE KEYS; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); -DROP TABLE memos, terms; +DROP TABLE memos; +DROP TABLE terms; --source ../../include/mroonga/unload_mroonga_functions.inc --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test index 8a41792bdae..9072d837a83 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/alter_table_spatial.test @@ -16,6 +16,7 @@ --source include/not_embedded.inc --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -30,117 +31,117 @@ CREATE TABLE shops ( INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', - GeomFromText('POINT(139.762573 35.720253)')); + ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', - GeomFromText('POINT(139.715591 35.712521)')); + ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', - GeomFromText('POINT(139.659088 35.683712)')); + ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', - GeomFromText('POINT(139.706207 35.721516)')); + ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', - GeomFromText('POINT(139.685608 35.714844)')); + ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); + ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', - GeomFromText('POINT(139.817154 35.700516)')); + ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', - GeomFromText('POINT(139.81105 35.698254)')); + ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', - GeomFromText('POINT(139.638611 35.705517)')); + ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', - GeomFromText('POINT(139.637115 35.703938)')); + ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', - GeomFromText('POINT(139.537323 35.644539)')); + ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', - GeomFromText('POINT(139.695755 35.628922)')); + ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', - GeomFromText('POINT(139.638657 35.665501)')); + ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', - GeomFromText('POINT(139.76857 35.680912)')); + ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', - GeomFromText('POINT(139.647598 35.700817)')); + ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', - GeomFromText('POINT(139.652573 35.722736)')); + ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', - GeomFromText('POINT(139.796234 35.730061)')); + ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', - GeomFromText('POINT(139.704834 35.650345)')); + ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', - GeomFromText('POINT(139.770599 35.681461)')); + ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', - GeomFromText('POINT(139.783981 35.685341)')); + ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', - GeomFromText('POINT(139.794846 35.716969)')); + ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', - GeomFromText('POINT(139.560913 35.698601)')); + ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', - GeomFromText('POINT(139.652817 35.642601)')); + ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', - GeomFromText('POINT(139.727356 35.627346)')); + ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', - GeomFromText('POINT(139.737381 35.640556)')); + ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', - GeomFromText('POINT(139.760895 35.673508)')); + ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', - GeomFromText('POINT(139.676071 35.680603)')); + ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', - GeomFromText('POINT(139.668106 35.608021)')); + ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', - GeomFromText('POINT(139.673203 35.64151)')); + ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', - GeomFromText('POINT(139.796829 35.712013)')); + ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', - GeomFromText('POINT(139.712524 35.616199)')); + ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', - GeomFromText('POINT(139.665833 35.609039)')); + ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', - GeomFromText('POINT(139.770721 35.66592)')); + ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', - GeomFromText('POINT(139.780273 35.672626)')); + ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', - GeomFromText('POINT(139.774628 35.671825)')); + ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', - GeomFromText('POINT(139.711517 35.647701)')); + ST_GeomFromText('POINT(139.711517 35.647701)')); ALTER TABLE shops ADD SPATIAL KEY location_index (location); -SELECT id, name, AsText(location) AS location_text FROM shops - WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) ORDER BY id; SHOW CREATE TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test new file mode 100644 index 00000000000..204b1f416ad --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_french.test @@ -0,0 +1,36 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8mb4; +CREATE TABLE diaries ( + content varchar(256) COLLATE utf8mb4_unicode_520_ci, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; + +INSERT INTO diaries VALUES ("Je suis un garçon."); + +SELECT * FROM diaries WHERE MATCH (content) AGAINST ("+garcon" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test new file mode 100644 index 00000000000..a6a18dc4846 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/collation_utf8_unicode_520_ci_japanese.test @@ -0,0 +1,37 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES utf8mb4; +CREATE TABLE diaries ( + content varchar(256) COLLATE utf8mb4_unicode_520_ci, + FULLTEXT INDEX (content) +) DEFAULT CHARSET=utf8mb4; + +INSERT INTO diaries VALUES ("ひらがなとカタカナを覚えました。"); + +SELECT * FROM diaries + WHERE MATCH (content) AGAINST ("+かたかな" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test index 86ef09cc8bb..e9c9bb9b5ee 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_fulltext_vector_other_table.test @@ -39,7 +39,7 @@ CREATE TABLE bugs ( INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga"); -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); SELECT *, MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score FROM bugs diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test index 91f204133dd..27cf85033cb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_groonga_index_int_other_table.test @@ -40,7 +40,7 @@ INSERT INTO bugs (id, priority) VALUES (1, 10); INSERT INTO bugs (id, priority) VALUES (2, 3); INSERT INTO bugs (id, priority) VALUES (3, -2); -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no --dump_records no"); SELECT * FROM bugs 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 7c8cd3f32a0..30b53f8eee0 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 @@ -30,7 +30,7 @@ CREATE TABLE tags ( COLLATE=utf8_bin COMMENT='default_tokenizer "TokenDelimit"'; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE tags; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test new file mode 100644 index 00000000000..039c518e673 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_none.test @@ -0,0 +1,38 @@ +# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE memos ( + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_with_position_and_with_weight.test new file mode 100644 index 00000000000..9a67644d2c5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_with_position_and_with_weight.test @@ -0,0 +1,38 @@ +# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log + +SET NAMES utf8; + +CREATE TABLE memos ( + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' +) DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_primary_key_table_comment_with_using_hash.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_primary_key_table_comment_with_using_hash.test new file mode 100644 index 00000000000..14b9ea9ab87 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_normalizer_primary_key_table_comment_with_using_hash.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 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 (term) USING HASH +) COMMENT='default_tokenizer "TokenBigram", normalizer "NormalizerAuto"' DEFAULT CHARSET=utf8; + +CREATE TABLE memos ( + id INT NOT NULL PRIMARY KEY, + content TEXT NOT NULL, + FULLTEXT INDEX (content) COMMENT 'table "terms"' +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES (1, "1日の消費㌍は約2000㌔㌍"); + +SELECT * FROM memos + WHERE MATCH (content) AGAINST ("+カロリー" IN BOOLEAN MODE); + +DROP TABLE memos; +DROP TABLE terms; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test index eb1095e75a7..0a1340d24d1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_reference_type.test @@ -33,7 +33,7 @@ CREATE TABLE bugs ( tag VARCHAR(64) COMMENT 'type "tags"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE bugs; DROP TABLE tags; 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 index 66bf9cef699..18a2607fa0b 100644 --- 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 @@ -32,7 +32,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; 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 index 49a23ec6b74..20df762d31b 100644 --- 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 @@ -32,7 +32,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; 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 index 7d890aff9d3..e4d7d8618fa 100644 --- 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 @@ -36,7 +36,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; DROP TABLE terms; 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 index f391647a538..905181175d0 100644 --- 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 @@ -36,7 +36,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'table "terms"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; DROP TABLE terms; 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 8707ce0e34b..2d5498c99c8 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 @@ -29,7 +29,7 @@ CREATE TABLE bugs ( tags TEXT COMMENT 'flags "COLUMN_VECTOR"' ) DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE bugs; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test new file mode 100644 index 00000000000..b94172c1c72 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_boolean_mode_pragma_all.test @@ -0,0 +1,44 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +SET NAMES utf8; +CREATE TABLE memos ( + id INT PRIMARY KEY, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX (title, content) +) DEFAULT CHARSET=utf8; + +INSERT INTO memos VALUES(1, "Groonga", "Groonga is fast."); +INSERT INTO memos VALUES(2, "Mroonga", "Mroonga is also fast."); +INSERT INTO memos VALUES(3, "Rroonga", "Rroonga is also fast."); + +SELECT *, + MATCH(title, content) + AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE) AS score + FROM memos + WHERE MATCH(title, content) + AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE); + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test index 641bbc3c4bd..3dffb2fb458 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_insert_select.test @@ -36,10 +36,6 @@ select * from t1 where c1>3 order by c1 desc; select * from t2 where c1>3 order by c1 asc; select * from t1 where c2>"s" order by c2 desc; select * from t2 where c2>"s" order by c1 asc; -select * from t1 where match(c2) against("ii") order by match(c2) against("ii") desc; -select * from t2 where match(c2) against("ii") order by match(c2) against("ii") asc; -select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii"); -select c1,c2,match(c2) against("ii") from t2 where match(c2) against("ii"); drop table t1,t2; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test new file mode 100644 index 00000000000..f2859f99dba --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_against.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga mroonga" IN BOOLEAN MODE) + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test new file mode 100644 index 00000000000..dc97db87487 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_different_match.test @@ -0,0 +1,44 @@ +# Copyright(C) 2012 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + body TEXT, + FULLTEXT KEY (title), + FULLTEXT KEY (body) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga", "I read groonga's tutorial."); +INSERT INTO diaries VALUES("Start mroonga", "I read mroonga's tutorial."); +INSERT INTO diaries VALUES("Start groonga and Ruby", "I installed rroonga."); + +SELECT * FROM diaries; + +SELECT *, MATCH(body) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) + ORDER BY MATCH(body) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test new file mode 100644 index 00000000000..50dd652e2d0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_no_where.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test new file mode 100644 index 00000000000..0873849a1e7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_boolean_mode_same_match_against.test @@ -0,0 +1,42 @@ +# Copyright(C) 2012 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE diaries( + title TEXT, + FULLTEXT KEY (title) +) DEFAULT CHARSET=utf8; + +INSERT INTO diaries VALUES("Start groonga"); +INSERT INTO diaries VALUES("Start mroonga"); +INSERT INTO diaries VALUES("Start groonga and Ruby"); + +SELECT * FROM diaries; + +SELECT *, MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) AS score + FROM diaries + WHERE MATCH(title) AGAINST("groonga" IN BOOLEAN MODE) + ORDER BY MATCH(title) AGAINST("groonga" IN BOOLEAN MODE); + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test new file mode 100644 index 00000000000..1b29b5b9284 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_asc.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) ASC; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test new file mode 100644 index 00000000000..761c7259057 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_desc.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) DESC; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test new file mode 100644 index 00000000000..eef4e08c5d1 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_against.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error Warning" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test new file mode 100644 index 00000000000..42b621f4401 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_different_match.test @@ -0,0 +1,49 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + host TEXT, + FULLTEXT KEY (message), + FULLTEXT KEY (host) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error", "host1"); +INSERT INTO logs VALUES("Warning Warning Warning", "host1"); +INSERT INTO logs VALUES("Error Error", "host2"); +INSERT INTO logs VALUES("Warning Warning", "host2"); +INSERT INTO logs VALUES("Error", "host2"); +INSERT INTO logs VALUES("Warning", "host2"); +INSERT INTO logs VALUES("Error Error Error Error", "host2"); +INSERT INTO logs VALUES("Warning Warning Warning Warning", "host2"); + +SELECT * FROM logs; + +SELECT *, MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(host) AGAINST("host2" IN NATURAL LANGUAGE MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test new file mode 100644 index 00000000000..2078e59f042 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_no_where.test @@ -0,0 +1,46 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test new file mode 100644 index 00000000000..9a8c93c3470 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/fulltext_order_natural_language_mode_same_match_against.test @@ -0,0 +1,47 @@ +# Copyright(C) 2015 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs( + message TEXT, + FULLTEXT KEY (message) +) DEFAULT CHARSET=utf8; + +INSERT INTO logs VALUES("Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning"); +INSERT INTO logs VALUES("Error Error"); +INSERT INTO logs VALUES("Warning Warning"); +INSERT INTO logs VALUES("Error"); +INSERT INTO logs VALUES("Warning"); +INSERT INTO logs VALUES("Error Error Error Error"); +INSERT INTO logs VALUES("Warning Warning Warning Warning"); + +SELECT * FROM logs; + +SELECT *, MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) AS score + FROM logs + WHERE MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE) + ORDER BY MATCH(message) AGAINST("Error" IN NATURAL LANGUAGE MODE); + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test index 39462257f9d..a5f42e2c9f3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null.test @@ -15,6 +15,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc +--source ../../include/mroonga/skip_mysql_57.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -27,7 +29,7 @@ CREATE TABLE shops ( INSERT INTO shops VALUES (NULL), (NULL); -SELECT AsText(location) FROM shops; +SELECT ST_AsText(location) FROM shops; DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test new file mode 100644 index 00000000000..84ce595621e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_bulk_insert_null_57.test @@ -0,0 +1,38 @@ +# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com> +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_geometry.inc +--source ../../include/mroonga/have_version_57.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS shops; +--enable_warnings + +CREATE TABLE shops ( + location GEOMETRY NOT NULL +); + +SET SESSION sql_mode = ''; +INSERT INTO shops VALUES (NULL), (NULL); +SET SESSION sql_mode = default; + +SELECT ST_AsText(location) FROM shops; + +DROP TABLE shops; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test index c8ec649f181..2fcf7ec5e4b 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/geometry_contains.test @@ -15,6 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -31,116 +32,116 @@ SHOW CREATE TABLE shops; INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', - GeomFromText('POINT(139.762573 35.720253)')); + ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', - GeomFromText('POINT(139.715591 35.712521)')); + ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', - GeomFromText('POINT(139.659088 35.683712)')); + ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', - GeomFromText('POINT(139.706207 35.721516)')); + ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', - GeomFromText('POINT(139.685608 35.714844)')); + ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); + ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', - GeomFromText('POINT(139.817154 35.700516)')); + ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', - GeomFromText('POINT(139.81105 35.698254)')); + ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', - GeomFromText('POINT(139.638611 35.705517)')); + ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', - GeomFromText('POINT(139.637115 35.703938)')); + ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', - GeomFromText('POINT(139.537323 35.644539)')); + ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', - GeomFromText('POINT(139.695755 35.628922)')); + ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', - GeomFromText('POINT(139.638657 35.665501)')); + ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', - GeomFromText('POINT(139.76857 35.680912)')); + ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', - GeomFromText('POINT(139.647598 35.700817)')); + ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', - GeomFromText('POINT(139.652573 35.722736)')); + ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', - GeomFromText('POINT(139.796234 35.730061)')); + ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', - GeomFromText('POINT(139.704834 35.650345)')); + ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', - GeomFromText('POINT(139.770599 35.681461)')); + ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', - GeomFromText('POINT(139.783981 35.685341)')); + ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', - GeomFromText('POINT(139.794846 35.716969)')); + ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', - GeomFromText('POINT(139.560913 35.698601)')); + ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', - GeomFromText('POINT(139.652817 35.642601)')); + ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', - GeomFromText('POINT(139.727356 35.627346)')); + ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', - GeomFromText('POINT(139.737381 35.640556)')); + ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', - GeomFromText('POINT(139.760895 35.673508)')); + ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', - GeomFromText('POINT(139.676071 35.680603)')); + ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', - GeomFromText('POINT(139.668106 35.608021)')); + ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', - GeomFromText('POINT(139.673203 35.64151)')); + ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', - GeomFromText('POINT(139.796829 35.712013)')); + ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', - GeomFromText('POINT(139.712524 35.616199)')); + ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', - GeomFromText('POINT(139.665833 35.609039)')); + ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', - GeomFromText('POINT(139.770721 35.66592)')); + ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', - GeomFromText('POINT(139.780273 35.672626)')); + ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', - GeomFromText('POINT(139.774628 35.671825)')); + ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', - GeomFromText('POINT(139.711517 35.647701)')); + ST_GeomFromText('POINT(139.711517 35.647701)')); -SELECT id, name, AsText(location) AS location_text FROM shops; -SELECT id, name, AsText(location) AS location_text FROM shops - WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) +SELECT id, name, ST_AsText(location) AS location_text FROM shops; +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location) ORDER BY id; DROP TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test new file mode 100644 index 00000000000..6bab6708ba7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_asc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value > 10 ORDER BY value ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test new file mode 100644 index 00000000000..e1bbd5b338c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_desc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value > 10 ORDER BY value DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test new file mode 100644 index 00000000000..680a4d624a7 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_asc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value >= 30 ORDER BY value ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test new file mode 100644 index 00000000000..25260c48c4b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_greater_than_or_equal_desc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value >= 30 ORDER BY value DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test new file mode 100644 index 00000000000..6c183ddec21 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_asc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value < 90 ORDER BY value ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test new file mode 100644 index 00000000000..aa1ba7602ee --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_desc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value < 90 ORDER BY value DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test new file mode 100644 index 00000000000..e083afdf4f5 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_asc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value <= 70 ORDER BY value ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test new file mode 100644 index 00000000000..155a51506a9 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_normal_less_than_or_equal_desc.test @@ -0,0 +1,41 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, + value INT(10), + INDEX (value) +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(1, 50); +INSERT INTO ids VALUES(2, 70); +INSERT INTO ids VALUES(3, 30); +INSERT INTO ids VALUES(4, 90); +INSERT INTO ids VALUES(5, 10); + +SELECT id, value FROM ids WHERE value <= 70 ORDER BY value DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test new file mode 100644 index 00000000000..a622dfbf70d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id > 1 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test new file mode 100644 index 00000000000..63dc820ccfd --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id > 3 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test new file mode 100644 index 00000000000..a51e6c5da47 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id >= 2 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test new file mode 100644 index 00000000000..ea5c150bf0f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_greater_than_or_equal_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id >= 3 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test new file mode 100644 index 00000000000..12761c0f4d8 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test new file mode 100644 index 00000000000..a4f4a781ead --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id < 4 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test new file mode 100644 index 00000000000..2fba0d13f5f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_asc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id ASC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test new file mode 100644 index 00000000000..e4661fc7047 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/index_range_primary_less_than_or_equal_desc.test @@ -0,0 +1,39 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +SET NAMES UTF8; + +CREATE TABLE ids ( + id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT +) ENGINE=Mroonga DEFAULT CHARSET=utf8; + +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); +INSERT INTO ids VALUES(); + +SELECT * FROM ids WHERE ids.id <= 4 ORDER BY ids.id DESC LIMIT 3; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test new file mode 100644 index 00000000000..669868c6c7f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_TODO_SPLIT_ME.test @@ -0,0 +1,61 @@ +# Copyright(C) 2010 Kentoku SHIBA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings + +flush status; +create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3)); +insert into t1 values(1,10,"aa ii uu ee oo"); +insert into t1 values(2,20,"ka ki ku ke ko"); +insert into t1 values(3,30,"sa si su se so"); +insert into t1 values(4,40,"ta ti tu te to"); +insert into t1 values(5,50,"aa ii uu ee oo"); +show status like 'mroonga_count_skip'; +select * from t1; +show status like 'mroonga_count_skip'; +select count(*) from t1; +show status like 'mroonga_count_skip'; +select * from t1 force index(primary) where c1 between 2 and 4; +show status like 'mroonga_count_skip'; +select count(*) from t1 force index(primary) where c1 between 2 and 4; +show status like 'mroonga_count_skip'; +select c1 from t1 force index(primary) where c1 < 3; +show status like 'mroonga_count_skip'; +select count(c1) from t1 force index(primary) where c1 < 3; +show status like 'mroonga_count_skip'; +select 1 from t1 force index(primary) where c1 > 3; +show status like 'mroonga_count_skip'; +select count(1) from t1 force index(primary) where c1 > 3; +show status like 'mroonga_count_skip'; +select * from t1 where match(c3) against("su"); +show status like 'mroonga_count_skip'; +select count(*) from t1 where match(c3) against("su"); +show status like 'mroonga_count_skip'; +select * from t1 where match(c3) against("+su" in boolean mode); +show status like 'mroonga_count_skip'; +select count(*) from t1 where match(c3) against("+su" in boolean mode); +show status like 'mroonga_count_skip'; +select * from t1 force index(idx1) where c2 between 20 and 40; +show status like 'mroonga_count_skip'; +select count(*) from t1 force index(idx1) where c2 between 20 and 40; +show status like 'mroonga_count_skip'; +drop table t1; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test new file mode 100644 index 00000000000..bca2311ffbc --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_multithread.test @@ -0,0 +1,45 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX ft(title) +); + +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); + +CONNECT (thread2, localhost, root, ,); +CONNECTION thread2; +INSERT INTO diaries VALUES("Happy birthday!"); +DISCONNECT thread2; +CONNECTION default; + +SHOW STATUS LIKE 'mroonga_count_skip'; +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test new file mode 100644 index 00000000000..fa960be850f --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_after_insert_single_thread.test @@ -0,0 +1,40 @@ +# Copyright(C) 2012 Kentoku SHIBA +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; +CREATE TABLE diaries ( + title TEXT, + FULLTEXT INDEX ft(title) +); + +INSERT INTO diaries VALUES("Hello mroonga!"); +INSERT INTO diaries VALUES("It's funny."); +INSERT INTO diaries VALUES("Happy birthday!"); + +SHOW STATUS LIKE 'mroonga_count_skip'; +SELECT COUNT(*) FROM diaries WHERE MATCH(title) AGAINST("mroonga" IN BOOLEAN MODE); +SHOW STATUS LIKE 'mroonga_count_skip'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test new file mode 100644 index 00000000000..e94702e8159 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_disabled.test @@ -0,0 +1,51 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +FLUSH STATUS; + +SET NAMES UTF8; +CREATE TABLE diaries ( + id INT UNSIGNED NOT NULL, + title VARCHAR(255), + content TEXT, + FULLTEXT INDEX(content) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries VALUES(1, "Hello", "今日からはじめました。"); +INSERT INTO diaries VALUES(2, "天気", "明日の富士山の天気について"); +INSERT INTO diaries VALUES(3, "富士山", "今日も天気がよくてきれいに見える。"); +INSERT INTO diaries VALUES(4, "帰り道", "今日は天気がよくてよかった。"); +INSERT INTO diaries VALUES(5, "はれ", "天気がよいのは今日までみたい。"); + +SET mroonga_enable_optimization=FALSE; + +SELECT COUNT(*) FROM diaries + WHERE MATCH(content) AGAINST("今日" IN BOOLEAN MODE); + +SHOW STATUS LIKE 'mroonga_count_skip'; + +SET mroonga_enable_optimization=TRUE; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test new file mode 100644 index 00000000000..11457b1e05a --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_count_skip_index_view.test @@ -0,0 +1,56 @@ +# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries, users; +--enable_warnings + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + user_id INT NOT NULL, + title VARCHAR(45) NOT NULL, + KEY (user_id), + FULLTEXT INDEX title_index (title) +) DEFAULT CHARSET=UTF8; + +CREATE TABLE users ( + id INT PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(45) NOT NULL, + INDEX (name) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8; + +INSERT INTO users (id, name) VALUES (1, "Alice"), (2, "Bob"); +INSERT INTO diaries (user_id, title) VALUES (1, "survey"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (1)"); +INSERT INTO diaries (user_id, title) VALUES (2, "groonga (2)"); + +CREATE VIEW articles AS + SELECT diaries.user_id AS user_id, + diaries.title AS title, + users.name AS name + FROM diaries, users + WHERE diaries.user_id = users.id; + + +SELECT COUNT(*) FROM articles WHERE name = 'Bob'; + +DROP VIEW articles; +DROP TABLE diaries, users; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test new file mode 100644 index 00000000000..832c1c5cb27 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/optimization_order_limit_optimized_duplicated_order_by_columns.test @@ -0,0 +1,45 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# Copyright(C) 2015 GMO Media, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +FLUSH STATUS; + +SET NAMES utf8mb4; + +CREATE TABLE ids ( + id int PRIMARY KEY, + text varchar(32), + FULLTEXT INDEX (text) +) DEFAULT CHARSET=utf8mb4; + +INSERT INTO ids VALUES (1, 'first'); + +SELECT * FROM ids + WHERE MATCH(text) AGAINST('+first' IN BOOLEAN MODE) + ORDER BY id, id + LIMIT 1; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test index 219c3440d69..fdd45ecc3a3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_insert.test @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +--source ../../include/mroonga/skip_mariadb_100_or_later.inc +--source include/have_partition.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test new file mode 100644 index 00000000000..8ec55268b38 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/partition_update.test @@ -0,0 +1,53 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/skip_mariadb_100_or_later.inc +--source include/have_partition.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS logs; +--enable_warnings + +SET NAMES UTF8; +CREATE TABLE logs ( + timestamp DATETIME, + message TEXT +) DEFAULT CHARSET=UTF8 + PARTITION BY RANGE (TO_DAYS(timestamp)) ( + PARTITION p201501 VALUES LESS THAN (TO_DAYS('2015-02-01')), + PARTITION p201502 VALUES LESS THAN (TO_DAYS('2015-03-01')), + PARTITION p201503 VALUES LESS THAN (TO_DAYS('2015-04-01')), + PARTITION pfuture VALUES LESS THAN MAXVALUE +); +SHOW CREATE TABLE logs; + +INSERT INTO logs VALUES('2015-01-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-02-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-03-01 00:00:00', 'Start'); +INSERT INTO logs VALUES('2015-04-01 00:00:00', 'Start'); + +SELECT * FROM logs ORDER BY timestamp; + +UPDATE logs + SET message = 'Started' + WHERE timestamp < '2015-03-01 00:00:00'; + +SELECT * FROM logs ORDER BY timestamp; + +DROP TABLE logs; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test new file mode 100644 index 00000000000..bdbcfefcd85 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/repair_table_no_index_file.test @@ -0,0 +1,57 @@ +# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/have_mroonga_helper.inc + +CREATE DATABASE repair_test; +USE repair_test; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + title TEXT, + body TEXT, + FULLTEXT INDEX body_index (body) +) DEFAULT CHARSET UTF8; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (title, body) VALUES ("survey", "will start Groonga!"); +INSERT INTO diaries (title, body) VALUES ("Groonga (1)", "starting Groonga..."); +INSERT INTO diaries (title, body) VALUES ("Groonga (2)", "started Groonga."); + +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); + +--remove_file $MYSQLD_DATADIR/repair_test.mrn.000010A.c + +FLUSH TABLES; + +# Error ER_CANT_OPEN_FILE syscall error 'repair_test.mrn.000010A.c' (No such file or directory) +--error ER_CANT_OPEN_FILE +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); + +REPAIR TABLE diaries; + +SELECT * FROM diaries; + +SELECT * FROM diaries WHERE MATCH(body) AGAINST("+starting" IN BOOLEAN MODE); + +DROP TABLE diaries; + +DROP DATABASE repair_test; +USE test; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test index 5f160af239f..65144ecc9e3 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/replace_geometry.test @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +--source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -26,13 +28,13 @@ CREATE TABLE geo_replace ( PRIMARY KEY(id) ) DEFAULT CHARSET=utf8; INSERT INTO geo_replace VALUES(1, POINT(100,100)); -SELECT id, ASTEXT(geo) FROM geo_replace; +SELECT id, ST_AsText(geo) FROM geo_replace; REPLACE INTO geo_replace VALUES(1, POINT(100,200)); -SELECT id, ASTEXT(geo) FROM geo_replace; +SELECT id, ST_AsText(geo) FROM geo_replace; INSERT INTO geo_replace VALUES(1, POINT(200,200)) ON DUPLICATE KEY UPDATE geo = POINT(200,200); -SELECT id, ASTEXT(geo) FROM geo_replace; +SELECT id, ST_AsText(geo) FROM geo_replace; UPDATE geo_replace SET geo = POINT(200,300); -SELECT id, ASTEXT(geo) FROM geo_replace; +SELECT id, ST_AsText(geo) FROM geo_replace; DROP TABLE geo_replace; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test index 11ca867d82c..b2cdf053bdb 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_column.test @@ -14,6 +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 +# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. +--source ../../include/mroonga/have_mysql.inc + --source ../../include/mroonga/have_mroonga.inc SET @mroonga_boolean_mode_syntax_flags_backup = diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test index 665682fde6e..08afc2cb39e 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_leading_not.test @@ -14,6 +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 +# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. +--source ../../include/mroonga/have_mysql.inc + --source ../../include/mroonga/have_mroonga.inc SET @mroonga_boolean_mode_syntax_flags_backup = diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test index 8a55c0fb0f7..4987dbe2b7a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_allow_update.test @@ -14,6 +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 +# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. +--source ../../include/mroonga/have_mysql.inc + --source ../../include/mroonga/have_mroonga.inc SET @mroonga_boolean_mode_syntax_flags_backup = diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test index 0ff2d8aed43..84cac40b16a 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_query.test @@ -14,6 +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 +# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. +--source ../../include/mroonga/have_mysql.inc + --source ../../include/mroonga/have_mroonga.inc SET @mroonga_boolean_mode_syntax_flags_backup = diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test index 61d5daa63d9..dea8212bda1 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_boolean_mode_syntax_flags_syntax_script.test @@ -14,6 +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 +# TODO: Remove the check after MariaDB 5.5.42 and MariaDB 10.0.17 are released. +--source ../../include/mroonga/have_mysql.inc + --source ../../include/mroonga/have_mroonga.inc SET @mroonga_boolean_mode_syntax_flags_backup = diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test index c7b2094906b..7a0c70a53b7 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_database_path_prefix.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -35,8 +35,10 @@ SELECT * FROM counts; DROP TABLE counts; DROP DATABASE clean_test; +SET GLOBAL mroonga_database_path_prefix = NULL; + USE test; -SET GLOBAL mroonga_database_path_prefix = NULL; +--rmdir $MYSQLD_DATADIR/test/mroonga.data --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result new file mode 100644 index 00000000000..0181fe02d84 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS ids; +CREATE TABLE ids ( +id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); +SET GLOBAL mroonga_max_n_records_for_estimate = 1; +EXPLAIN SELECT * FROM ids WHERE id > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index +SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; +DROP TABLE ids; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test new file mode 100644 index 00000000000..264bf95fd22 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_global.test @@ -0,0 +1,55 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); + + +SET GLOBAL mroonga_max_n_records_for_estimate = 1; + +CONNECT (new_connection, localhost, root, ,); +CONNECTION new_connection; + +EXPLAIN SELECT * FROM ids WHERE id > 5; + +CONNECTION default; +DISCONNECT new_connection; + +SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT; + + +DROP TABLE ids; + + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test new file mode 100644 index 00000000000..3abc3c532d3 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_max_n_records_for_estimate_session.test @@ -0,0 +1,46 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS ids; +--enable_warnings + +CREATE TABLE ids ( + id INT PRIMARY KEY AUTO_INCREMENT +) DEFAULT CHARSET=UTF8; + +INSERT INTO ids VALUES (1); +INSERT INTO ids VALUES (2); +INSERT INTO ids VALUES (3); +INSERT INTO ids VALUES (4); +INSERT INTO ids VALUES (5); +INSERT INTO ids VALUES (6); +INSERT INTO ids VALUES (7); +INSERT INTO ids VALUES (8); +INSERT INTO ids VALUES (9); +INSERT INTO ids VALUES (10); + +SET mroonga_max_n_records_for_estimate = 1; + +EXPLAIN SELECT * FROM ids WHERE id > 5; + +SET mroonga_max_n_records_for_estimate = DEFAULT; + +DROP TABLE ids; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result index fc38afc72d8..0e2f4c3bcca 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/alter_table_spatial.result @@ -6,115 +6,115 @@ location GEOMETRY NOT NULL ) COMMENT = 'ENGINE "InnoDB"'; INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', -GeomFromText('POINT(139.762573 35.720253)')); +ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', -GeomFromText('POINT(139.715591 35.712521)')); +ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', -GeomFromText('POINT(139.659088 35.683712)')); +ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', -GeomFromText('POINT(139.706207 35.721516)')); +ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', -GeomFromText('POINT(139.685608 35.714844)')); +ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); +ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', -GeomFromText('POINT(139.817154 35.700516)')); +ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', -GeomFromText('POINT(139.81105 35.698254)')); +ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', -GeomFromText('POINT(139.638611 35.705517)')); +ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', -GeomFromText('POINT(139.637115 35.703938)')); +ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', -GeomFromText('POINT(139.537323 35.644539)')); +ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', -GeomFromText('POINT(139.695755 35.628922)')); +ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', -GeomFromText('POINT(139.638657 35.665501)')); +ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', -GeomFromText('POINT(139.76857 35.680912)')); +ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', -GeomFromText('POINT(139.647598 35.700817)')); +ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', -GeomFromText('POINT(139.652573 35.722736)')); +ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', -GeomFromText('POINT(139.796234 35.730061)')); +ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', -GeomFromText('POINT(139.704834 35.650345)')); +ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', -GeomFromText('POINT(139.770599 35.681461)')); +ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', -GeomFromText('POINT(139.783981 35.685341)')); +ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', -GeomFromText('POINT(139.794846 35.716969)')); +ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', -GeomFromText('POINT(139.560913 35.698601)')); +ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', -GeomFromText('POINT(139.652817 35.642601)')); +ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', -GeomFromText('POINT(139.727356 35.627346)')); +ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', -GeomFromText('POINT(139.737381 35.640556)')); +ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', -GeomFromText('POINT(139.760895 35.673508)')); +ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', -GeomFromText('POINT(139.676071 35.680603)')); +ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', -GeomFromText('POINT(139.668106 35.608021)')); +ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', -GeomFromText('POINT(139.673203 35.64151)')); +ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', -GeomFromText('POINT(139.796829 35.712013)')); +ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', -GeomFromText('POINT(139.712524 35.616199)')); +ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', -GeomFromText('POINT(139.665833 35.609039)')); +ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', -GeomFromText('POINT(139.770721 35.66592)')); +ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', -GeomFromText('POINT(139.780273 35.672626)')); +ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', -GeomFromText('POINT(139.774628 35.671825)')); +ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', -GeomFromText('POINT(139.711517 35.647701)')); +ST_GeomFromText('POINT(139.711517 35.647701)')); ALTER TABLE shops ADD SPATIAL KEY location_index (location); -SELECT id, name, AsText(location) AS location_text FROM shops -WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +SELECT id, name, ST_AsText(location) AS location_text FROM shops +WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); id name location_text 14 tetsuji POINT(139.76857 35.680912) 19 daruma POINT(139.770599 35.681461) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result index 6b29be5edb7..a6d2f7862af 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/count_star_with_index.result @@ -1,5 +1,3 @@ -DROP TABLE IF EXISTS diaries_innodb; -DROP TABLE IF EXISTS diaries_mroonga; CREATE TABLE diaries_innodb ( id INT PRIMARY KEY AUTO_INCREMENT, body TEXT, diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result new file mode 100644 index 00000000000..08bdd72ee03 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_none.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL PRIMARY KEY, +FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos-content index COLUMN_INDEX memos +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result new file mode 100644 index 00000000000..a5ac716d38e --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_index_flags_with_position_and_with_weight.result @@ -0,0 +1,9 @@ +SET NAMES utf8; +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL PRIMARY KEY, +FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos-content index COLUMN_INDEX|WITH_WEIGHT|WITH_POSITION memos +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_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 index 0c0af7a9db2..68319844df8 100644 --- 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 @@ -7,9 +7,11 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_HASH_KEY ShortText + table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord,TokenFilterStopWord + 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 index aef34c0bc26..fa3012705ad 100644 --- 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 @@ -7,9 +7,11 @@ 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") +SELECT mroonga_command("dump --dump_plugins no"); +mroonga_command("dump --dump_plugins no") table_create memos TABLE_HASH_KEY ShortText + table_create memos-content TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerMySQLGeneralCI --token_filters TokenFilterStopWord + column_create memos-content index COLUMN_INDEX|WITH_POSITION memos DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result index 29163384e6a..b3f5bee27d7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_contains.result @@ -16,113 +16,113 @@ shops CREATE TABLE `shops` ( ) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('nezu-no-taiyaki', -GeomFromText('POINT(139.762573 35.720253)')); +ST_GeomFromText('POINT(139.762573 35.720253)')); insert into shops (name, location) values ('taiyaki-kataoka', -GeomFromText('POINT(139.715591 35.712521)')); +ST_GeomFromText('POINT(139.715591 35.712521)')); insert into shops (name, location) values ('soba-taiyaki-ku', -GeomFromText('POINT(139.659088 35.683712)')); +ST_GeomFromText('POINT(139.659088 35.683712)')); insert into shops (name, location) values ('kuruma', -GeomFromText('POINT(139.706207 35.721516)')); +ST_GeomFromText('POINT(139.706207 35.721516)')); insert into shops (name, location) values ('hirose-ya', -GeomFromText('POINT(139.685608 35.714844)')); +ST_GeomFromText('POINT(139.685608 35.714844)')); insert into shops (name, location) values ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); +ST_GeomFromText('POINT(139.685043 35.714653)')); insert into shops (name, location) values ('omede-taiyaki', -GeomFromText('POINT(139.817154 35.700516)')); +ST_GeomFromText('POINT(139.817154 35.700516)')); insert into shops (name, location) values ('onaga-ya', -GeomFromText('POINT(139.81105 35.698254)')); +ST_GeomFromText('POINT(139.81105 35.698254)')); insert into shops (name, location) values ('shiro-ya', -GeomFromText('POINT(139.638611 35.705517)')); +ST_GeomFromText('POINT(139.638611 35.705517)')); insert into shops (name, location) values ('fuji-ya', -GeomFromText('POINT(139.637115 35.703938)')); +ST_GeomFromText('POINT(139.637115 35.703938)')); insert into shops (name, location) values ('miyoshi', -GeomFromText('POINT(139.537323 35.644539)')); +ST_GeomFromText('POINT(139.537323 35.644539)')); insert into shops (name, location) values ('juju-ya', -GeomFromText('POINT(139.695755 35.628922)')); +ST_GeomFromText('POINT(139.695755 35.628922)')); insert into shops (name, location) values ('tatsumi-ya', -GeomFromText('POINT(139.638657 35.665501)')); +ST_GeomFromText('POINT(139.638657 35.665501)')); insert into shops (name, location) values ('tetsuji', -GeomFromText('POINT(139.76857 35.680912)')); +ST_GeomFromText('POINT(139.76857 35.680912)')); insert into shops (name, location) values ('gazuma-ya', -GeomFromText('POINT(139.647598 35.700817)')); +ST_GeomFromText('POINT(139.647598 35.700817)')); insert into shops (name, location) values ('honma-mon', -GeomFromText('POINT(139.652573 35.722736)')); +ST_GeomFromText('POINT(139.652573 35.722736)')); insert into shops (name, location) values ('naniwa-ya', -GeomFromText('POINT(139.796234 35.730061)')); +ST_GeomFromText('POINT(139.796234 35.730061)')); insert into shops (name, location) values ('kuro-dai', -GeomFromText('POINT(139.704834 35.650345)')); +ST_GeomFromText('POINT(139.704834 35.650345)')); insert into shops (name, location) values ('daruma', -GeomFromText('POINT(139.770599 35.681461)')); +ST_GeomFromText('POINT(139.770599 35.681461)')); insert into shops (name, location) values ('yanagi-ya', -GeomFromText('POINT(139.783981 35.685341)')); +ST_GeomFromText('POINT(139.783981 35.685341)')); insert into shops (name, location) values ('sharaku', -GeomFromText('POINT(139.794846 35.716969)')); +ST_GeomFromText('POINT(139.794846 35.716969)')); insert into shops (name, location) values ('takane', -GeomFromText('POINT(139.560913 35.698601)')); +ST_GeomFromText('POINT(139.560913 35.698601)')); insert into shops (name, location) values ('chiyoda', -GeomFromText('POINT(139.652817 35.642601)')); +ST_GeomFromText('POINT(139.652817 35.642601)')); insert into shops (name, location) values ('da-ka-po', -GeomFromText('POINT(139.727356 35.627346)')); +ST_GeomFromText('POINT(139.727356 35.627346)')); insert into shops (name, location) values ('matsushima-ya', -GeomFromText('POINT(139.737381 35.640556)')); +ST_GeomFromText('POINT(139.737381 35.640556)')); insert into shops (name, location) values ('kazuya', -GeomFromText('POINT(139.760895 35.673508)')); +ST_GeomFromText('POINT(139.760895 35.673508)')); insert into shops (name, location) values ('furuya-kogane-an', -GeomFromText('POINT(139.676071 35.680603)')); +ST_GeomFromText('POINT(139.676071 35.680603)')); insert into shops (name, location) values ('hachi-no-ie', -GeomFromText('POINT(139.668106 35.608021)')); +ST_GeomFromText('POINT(139.668106 35.608021)')); insert into shops (name, location) values ('azuki-chan', -GeomFromText('POINT(139.673203 35.64151)')); +ST_GeomFromText('POINT(139.673203 35.64151)')); insert into shops (name, location) values ('kuriko-an', -GeomFromText('POINT(139.796829 35.712013)')); +ST_GeomFromText('POINT(139.796829 35.712013)')); insert into shops (name, location) values ('yume-no-aru-machi-no-taiyaki-ya-san', -GeomFromText('POINT(139.712524 35.616199)')); +ST_GeomFromText('POINT(139.712524 35.616199)')); insert into shops (name, location) values ('naze-ya', -GeomFromText('POINT(139.665833 35.609039)')); +ST_GeomFromText('POINT(139.665833 35.609039)')); insert into shops (name, location) values ('sanoki-ya', -GeomFromText('POINT(139.770721 35.66592)')); +ST_GeomFromText('POINT(139.770721 35.66592)')); insert into shops (name, location) values ('shigeta', -GeomFromText('POINT(139.780273 35.672626)')); +ST_GeomFromText('POINT(139.780273 35.672626)')); insert into shops (name, location) values ('nishimi-ya', -GeomFromText('POINT(139.774628 35.671825)')); +ST_GeomFromText('POINT(139.774628 35.671825)')); insert into shops (name, location) values ('hiiragi', -GeomFromText('POINT(139.711517 35.647701)')); -select id, name, AsText(location) as location_text from shops; +ST_GeomFromText('POINT(139.711517 35.647701)')); +select id, name, ST_AsText(location) as location_text from shops; id name location_text 1 nezu-no-taiyaki POINT(139.762573 35.720253) 2 taiyaki-kataoka POINT(139.715591 35.712521) @@ -160,8 +160,8 @@ id name location_text 34 shigeta POINT(139.780273 35.672626) 35 nishimi-ya POINT(139.774628 35.671825) 36 hiiragi POINT(139.711517 35.647701) -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); id name location_text 14 tetsuji POINT(139.76857 35.680912) 19 daruma POINT(139.770599 35.681461) diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result index 53aa00ecbab..28b981f9c7b 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_delete.result @@ -16,16 +16,16 @@ shops CREATE TABLE `shops` ( ) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +ST_GeomFromText('POINT(139.685043 35.714653)')); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); id name location_text 1 sazare POINT(139.685043 35.714653) delete from shops -where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); id name location_text -select id, name, AsText(location) as location_text from shops; +select id, name, ST_AsText(location) as location_text from shops; id name location_text drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result index e982e0b95ce..20de4a32cfa 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result @@ -16,21 +16,21 @@ shops CREATE TABLE `shops` ( ) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"' insert into shops (name, location) values ('sazare', -GeomFromText('POINT(139.685043 35.714653)')); -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +ST_GeomFromText('POINT(139.685043 35.714653)')); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); id name location_text 1 sazare POINT(139.685043 35.714653) -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); id name location_text -update shops set location = GeomFromText('POINT(139.66116 35.57566)') +update shops set location = ST_GeomFromText('POINT(139.66116 35.57566)') where name = 'sazare'; -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); id name location_text -select id, name, AsText(location) as location_text from shops -where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); +select id, name, ST_AsText(location) as location_text from shops +where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); id name location_text 1 sazare POINT(139.66116 35.57566) drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result index 5f43aee6997..660700602b7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_TODO_SPLIT_ME.result @@ -12,20 +12,6 @@ insert into t1 values(2,20,"ka ki ku ke ko"); insert into t1 values(3,30,"ii si ii se ii"); insert into t1 values(4,40,"ta ti tu te to"); insert into t1 values(5,50,"aa ii uu ii oo"); -select *, match(c3) against("ii") from t1 -where match(c3) against("ii") order by c1 desc limit 1; -c1 c2 c3 match(c3) against("ii") -5 50 aa ii uu ii oo 349526 -show status like 'mroonga_fast_order_limit'; -Variable_name Value -Mroonga_fast_order_limit 0 -select *, match(c3) against("ii") from t1 -where match(c3) against("ii") order by c1 limit 1; -c1 c2 c3 match(c3) against("ii") -1 10 aa ii uu ee oo 174763 -show status like 'mroonga_fast_order_limit'; -Variable_name Value -Mroonga_fast_order_limit 0 select c3, match(c3) against("ii") from t1 where match(c3) against("ii") order by match(c3) against("ii") desc; c3 match(c3) against("ii") diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result new file mode 100644 index 00000000000..9dd3e6eaa1b --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_no_direction.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +CREATE TABLE memos ( +id int PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) COMMENT = 'engine "InnoDB"'; +INSERT INTO memos VALUES(1, "Groonga is fast"); +INSERT INTO memos VALUES(2, "Mroonga is fast"); +INSERT INTO memos VALUES(3, "Mroonga is easy"); +INSERT INTO memos VALUES(4, "Mroonga is useful"); +INSERT INTO memos VALUES(5, "Mroonga is great"); +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +SELECT id, content +FROM memos +WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE) +ORDER BY id +LIMIT 2; +id content +2 Mroonga is fast +3 Mroonga is easy +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result new file mode 100644 index 00000000000..eb5e04fcc0c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/optimization_order_limit_order_by_primary_key.result @@ -0,0 +1,27 @@ +DROP TABLE IF EXISTS memos; +FLUSH STATUS; +CREATE TABLE memos ( +id int PRIMARY KEY, +content TEXT, +FULLTEXT INDEX (content) +) COMMENT = 'engine "InnoDB"'; +INSERT INTO memos VALUES(1, "Mroonga is fast"); +INSERT INTO memos VALUES(2, "Mroonga is easy"); +INSERT INTO memos VALUES(3, "Mroonga is useful"); +INSERT INTO memos VALUES(4, "Mroonga is great"); +INSERT INTO memos VALUES(5, "Groonga is fast"); +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 0 +SELECT id, content +FROM memos +WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE) +ORDER BY id DESC +LIMIT 2; +id content +4 Mroonga is great +3 Mroonga is useful +SHOW STATUS LIKE 'mroonga_fast_order_limit'; +Variable_name Value +Mroonga_fast_order_limit 1 +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result new file mode 100644 index 00000000000..c9af869f20c --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/performance_schema.result @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS diaries; +SHOW VARIABLES LIKE 'performance_schema'; +Variable_name Value +performance_schema ON +CREATE TABLE diaries ( +id INT PRIMARY KEY AUTO_INCREMENT, +content VARCHAR(255), +FULLTEXT INDEX (content) +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; +Table Create Table +diaries CREATE TABLE `diaries` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `content` (`content`) +) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); +SHOW TABLES FROM performance_schema LIKE 'threads'; +Tables_in_performance_schema (threads) +threads +DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_files.result index 61c8e18b17d..e330fa18c89 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 @@ -1,7 +1,5 @@ -DROP DATABASE IF EXISTS repair_test; CREATE DATABASE repair_test; USE repair_test; -DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result index 140b5a92b75..a5012384889 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/repair_table_no_index_file.result @@ -1,7 +1,5 @@ -DROP DATABASE IF EXISTS repair_test; CREATE DATABASE repair_test; USE repair_test; -DROP TABLE IF EXISTS diaries; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, @@ -25,7 +23,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.0000104' (No such file or directory) +ERROR HY000: syscall error 'repair_test.mrn.0000106' (No such file or directory) REPAIR TABLE diaries; Table Op Msg_type Msg_text repair_test.diaries repair status OK diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result index 0cf3d49c3c3..c98847cb50a 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result @@ -1,5 +1,4 @@ DROP TABLE IF EXISTS diaries; -SET GLOBAL mroonga_match_escalation_threshold = -1; CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, @@ -17,17 +16,12 @@ diaries CREATE TABLE `diaries` ( ) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); -id title tags -1 Hello groonga! groonga install -2 Hello mroonga! mroonga install -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); -id title tags -SET GLOBAL mroonga_match_escalation_threshold = 0; SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); id title tags -SET mroonga_match_escalation_threshold = 0; +1 Hello groonga! groonga install +SET GLOBAL mroonga_match_escalation_threshold = -1; +USE test; SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); id title tags -1 Hello groonga! groonga install +SET GLOBAL mroonga_match_escalation_threshold = DEFAULT; DROP TABLE diaries; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test index 37ea8aaf149..6a62ae312b2 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/alter_table_spatial.test @@ -17,6 +17,7 @@ --source include/have_innodb.inc --source include/not_embedded.inc --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -31,117 +32,117 @@ CREATE TABLE shops ( INSERT INTO shops (name, location) VALUES ('nezu-no-taiyaki', - GeomFromText('POINT(139.762573 35.720253)')); + ST_GeomFromText('POINT(139.762573 35.720253)')); INSERT INTO shops (name, location) VALUES ('taiyaki-kataoka', - GeomFromText('POINT(139.715591 35.712521)')); + ST_GeomFromText('POINT(139.715591 35.712521)')); INSERT INTO shops (name, location) VALUES ('soba-taiyaki-ku', - GeomFromText('POINT(139.659088 35.683712)')); + ST_GeomFromText('POINT(139.659088 35.683712)')); INSERT INTO shops (name, location) VALUES ('kuruma', - GeomFromText('POINT(139.706207 35.721516)')); + ST_GeomFromText('POINT(139.706207 35.721516)')); INSERT INTO shops (name, location) VALUES ('hirose-ya', - GeomFromText('POINT(139.685608 35.714844)')); + ST_GeomFromText('POINT(139.685608 35.714844)')); INSERT INTO shops (name, location) VALUES ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); + ST_GeomFromText('POINT(139.685043 35.714653)')); INSERT INTO shops (name, location) VALUES ('omede-taiyaki', - GeomFromText('POINT(139.817154 35.700516)')); + ST_GeomFromText('POINT(139.817154 35.700516)')); INSERT INTO shops (name, location) VALUES ('onaga-ya', - GeomFromText('POINT(139.81105 35.698254)')); + ST_GeomFromText('POINT(139.81105 35.698254)')); INSERT INTO shops (name, location) VALUES ('shiro-ya', - GeomFromText('POINT(139.638611 35.705517)')); + ST_GeomFromText('POINT(139.638611 35.705517)')); INSERT INTO shops (name, location) VALUES ('fuji-ya', - GeomFromText('POINT(139.637115 35.703938)')); + ST_GeomFromText('POINT(139.637115 35.703938)')); INSERT INTO shops (name, location) VALUES ('miyoshi', - GeomFromText('POINT(139.537323 35.644539)')); + ST_GeomFromText('POINT(139.537323 35.644539)')); INSERT INTO shops (name, location) VALUES ('juju-ya', - GeomFromText('POINT(139.695755 35.628922)')); + ST_GeomFromText('POINT(139.695755 35.628922)')); INSERT INTO shops (name, location) VALUES ('tatsumi-ya', - GeomFromText('POINT(139.638657 35.665501)')); + ST_GeomFromText('POINT(139.638657 35.665501)')); INSERT INTO shops (name, location) VALUES ('tetsuji', - GeomFromText('POINT(139.76857 35.680912)')); + ST_GeomFromText('POINT(139.76857 35.680912)')); INSERT INTO shops (name, location) VALUES ('gazuma-ya', - GeomFromText('POINT(139.647598 35.700817)')); + ST_GeomFromText('POINT(139.647598 35.700817)')); INSERT INTO shops (name, location) VALUES ('honma-mon', - GeomFromText('POINT(139.652573 35.722736)')); + ST_GeomFromText('POINT(139.652573 35.722736)')); INSERT INTO shops (name, location) VALUES ('naniwa-ya', - GeomFromText('POINT(139.796234 35.730061)')); + ST_GeomFromText('POINT(139.796234 35.730061)')); INSERT INTO shops (name, location) VALUES ('kuro-dai', - GeomFromText('POINT(139.704834 35.650345)')); + ST_GeomFromText('POINT(139.704834 35.650345)')); INSERT INTO shops (name, location) VALUES ('daruma', - GeomFromText('POINT(139.770599 35.681461)')); + ST_GeomFromText('POINT(139.770599 35.681461)')); INSERT INTO shops (name, location) VALUES ('yanagi-ya', - GeomFromText('POINT(139.783981 35.685341)')); + ST_GeomFromText('POINT(139.783981 35.685341)')); INSERT INTO shops (name, location) VALUES ('sharaku', - GeomFromText('POINT(139.794846 35.716969)')); + ST_GeomFromText('POINT(139.794846 35.716969)')); INSERT INTO shops (name, location) VALUES ('takane', - GeomFromText('POINT(139.560913 35.698601)')); + ST_GeomFromText('POINT(139.560913 35.698601)')); INSERT INTO shops (name, location) VALUES ('chiyoda', - GeomFromText('POINT(139.652817 35.642601)')); + ST_GeomFromText('POINT(139.652817 35.642601)')); INSERT INTO shops (name, location) VALUES ('da-ka-po', - GeomFromText('POINT(139.727356 35.627346)')); + ST_GeomFromText('POINT(139.727356 35.627346)')); INSERT INTO shops (name, location) VALUES ('matsushima-ya', - GeomFromText('POINT(139.737381 35.640556)')); + ST_GeomFromText('POINT(139.737381 35.640556)')); INSERT INTO shops (name, location) VALUES ('kazuya', - GeomFromText('POINT(139.760895 35.673508)')); + ST_GeomFromText('POINT(139.760895 35.673508)')); INSERT INTO shops (name, location) VALUES ('furuya-kogane-an', - GeomFromText('POINT(139.676071 35.680603)')); + ST_GeomFromText('POINT(139.676071 35.680603)')); INSERT INTO shops (name, location) VALUES ('hachi-no-ie', - GeomFromText('POINT(139.668106 35.608021)')); + ST_GeomFromText('POINT(139.668106 35.608021)')); INSERT INTO shops (name, location) VALUES ('azuki-chan', - GeomFromText('POINT(139.673203 35.64151)')); + ST_GeomFromText('POINT(139.673203 35.64151)')); INSERT INTO shops (name, location) VALUES ('kuriko-an', - GeomFromText('POINT(139.796829 35.712013)')); + ST_GeomFromText('POINT(139.796829 35.712013)')); INSERT INTO shops (name, location) VALUES ('yume-no-aru-machi-no-taiyaki-ya-san', - GeomFromText('POINT(139.712524 35.616199)')); + ST_GeomFromText('POINT(139.712524 35.616199)')); INSERT INTO shops (name, location) VALUES ('naze-ya', - GeomFromText('POINT(139.665833 35.609039)')); + ST_GeomFromText('POINT(139.665833 35.609039)')); INSERT INTO shops (name, location) VALUES ('sanoki-ya', - GeomFromText('POINT(139.770721 35.66592)')); + ST_GeomFromText('POINT(139.770721 35.66592)')); INSERT INTO shops (name, location) VALUES ('shigeta', - GeomFromText('POINT(139.780273 35.672626)')); + ST_GeomFromText('POINT(139.780273 35.672626)')); INSERT INTO shops (name, location) VALUES ('nishimi-ya', - GeomFromText('POINT(139.774628 35.671825)')); + ST_GeomFromText('POINT(139.774628 35.671825)')); INSERT INTO shops (name, location) VALUES ('hiiragi', - GeomFromText('POINT(139.711517 35.647701)')); + ST_GeomFromText('POINT(139.711517 35.647701)')); ALTER TABLE shops ADD SPATIAL KEY location_index (location); -SELECT id, name, AsText(location) AS location_text FROM shops - WHERE MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); +SELECT id, name, ST_AsText(location) AS location_text FROM shops + WHERE MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); SHOW CREATE TABLE shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test index f8b77becdde..70c176b5116 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/count_star_with_index.test @@ -1,4 +1,4 @@ -# Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com> +# Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -18,10 +18,11 @@ --source ../../include/mroonga/have_fulltext_index_comment.inc --source ../../include/mroonga/have_mroonga.inc ---disable_warnings -DROP TABLE IF EXISTS diaries_innodb; -DROP TABLE IF EXISTS diaries_mroonga; ---enable_warnings +--disable_query_log +DROP DATABASE test; +CREATE DATABASE test; +USE test; +--enable_query_log CREATE TABLE diaries_innodb ( id INT PRIMARY KEY AUTO_INCREMENT, diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test new file mode 100644 index 00000000000..da1e5e736ea --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_none.test @@ -0,0 +1,39 @@ +# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 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 + +SET NAMES utf8; + +CREATE TABLE memos ( + content VARCHAR(64) NOT NULL PRIMARY KEY, + FULLTEXT INDEX (content) COMMENT 'index_flags "NONE"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test new file mode 100644 index 00000000000..8d0d585d56d --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_index_flags_with_position_and_with_weight.test @@ -0,0 +1,39 @@ +# Copyright(C) 2015 Naoya Murakami <naoya@createfield.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 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 + +SET NAMES utf8; + +CREATE TABLE memos ( + content VARCHAR(64) NOT NULL PRIMARY KEY, + FULLTEXT INDEX (content) COMMENT 'index_flags "WITH_POSITION|WITH_WEIGHT"' +) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/create_table_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 index 9ba941f8701..9ff8e4448d9 100644 --- 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 @@ -34,7 +34,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord,TokenFilterStopWord"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; 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 index 91ac84c04d5..eee08309f76 100644 --- 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 @@ -34,7 +34,7 @@ CREATE TABLE memos ( FULLTEXT INDEX (content) COMMENT 'token_filters "TokenFilterStopWord"' ) COMMENT='engine "InnoDB"' DEFAULT CHARSET=utf8; -SELECT mroonga_command("dump"); +SELECT mroonga_command("dump --dump_plugins no"); DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test index 4676fc61331..af6242a9ad1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_contains.test @@ -16,6 +16,7 @@ --source include/have_innodb.inc --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -31,115 +32,115 @@ create table shops ( show create table shops; insert into shops (name, location) values ('nezu-no-taiyaki', - GeomFromText('POINT(139.762573 35.720253)')); + ST_GeomFromText('POINT(139.762573 35.720253)')); insert into shops (name, location) values ('taiyaki-kataoka', - GeomFromText('POINT(139.715591 35.712521)')); + ST_GeomFromText('POINT(139.715591 35.712521)')); insert into shops (name, location) values ('soba-taiyaki-ku', - GeomFromText('POINT(139.659088 35.683712)')); + ST_GeomFromText('POINT(139.659088 35.683712)')); insert into shops (name, location) values ('kuruma', - GeomFromText('POINT(139.706207 35.721516)')); + ST_GeomFromText('POINT(139.706207 35.721516)')); insert into shops (name, location) values ('hirose-ya', - GeomFromText('POINT(139.685608 35.714844)')); + ST_GeomFromText('POINT(139.685608 35.714844)')); insert into shops (name, location) values ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); + ST_GeomFromText('POINT(139.685043 35.714653)')); insert into shops (name, location) values ('omede-taiyaki', - GeomFromText('POINT(139.817154 35.700516)')); + ST_GeomFromText('POINT(139.817154 35.700516)')); insert into shops (name, location) values ('onaga-ya', - GeomFromText('POINT(139.81105 35.698254)')); + ST_GeomFromText('POINT(139.81105 35.698254)')); insert into shops (name, location) values ('shiro-ya', - GeomFromText('POINT(139.638611 35.705517)')); + ST_GeomFromText('POINT(139.638611 35.705517)')); insert into shops (name, location) values ('fuji-ya', - GeomFromText('POINT(139.637115 35.703938)')); + ST_GeomFromText('POINT(139.637115 35.703938)')); insert into shops (name, location) values ('miyoshi', - GeomFromText('POINT(139.537323 35.644539)')); + ST_GeomFromText('POINT(139.537323 35.644539)')); insert into shops (name, location) values ('juju-ya', - GeomFromText('POINT(139.695755 35.628922)')); + ST_GeomFromText('POINT(139.695755 35.628922)')); insert into shops (name, location) values ('tatsumi-ya', - GeomFromText('POINT(139.638657 35.665501)')); + ST_GeomFromText('POINT(139.638657 35.665501)')); insert into shops (name, location) values ('tetsuji', - GeomFromText('POINT(139.76857 35.680912)')); + ST_GeomFromText('POINT(139.76857 35.680912)')); insert into shops (name, location) values ('gazuma-ya', - GeomFromText('POINT(139.647598 35.700817)')); + ST_GeomFromText('POINT(139.647598 35.700817)')); insert into shops (name, location) values ('honma-mon', - GeomFromText('POINT(139.652573 35.722736)')); + ST_GeomFromText('POINT(139.652573 35.722736)')); insert into shops (name, location) values ('naniwa-ya', - GeomFromText('POINT(139.796234 35.730061)')); + ST_GeomFromText('POINT(139.796234 35.730061)')); insert into shops (name, location) values ('kuro-dai', - GeomFromText('POINT(139.704834 35.650345)')); + ST_GeomFromText('POINT(139.704834 35.650345)')); insert into shops (name, location) values ('daruma', - GeomFromText('POINT(139.770599 35.681461)')); + ST_GeomFromText('POINT(139.770599 35.681461)')); insert into shops (name, location) values ('yanagi-ya', - GeomFromText('POINT(139.783981 35.685341)')); + ST_GeomFromText('POINT(139.783981 35.685341)')); insert into shops (name, location) values ('sharaku', - GeomFromText('POINT(139.794846 35.716969)')); + ST_GeomFromText('POINT(139.794846 35.716969)')); insert into shops (name, location) values ('takane', - GeomFromText('POINT(139.560913 35.698601)')); + ST_GeomFromText('POINT(139.560913 35.698601)')); insert into shops (name, location) values ('chiyoda', - GeomFromText('POINT(139.652817 35.642601)')); + ST_GeomFromText('POINT(139.652817 35.642601)')); insert into shops (name, location) values ('da-ka-po', - GeomFromText('POINT(139.727356 35.627346)')); + ST_GeomFromText('POINT(139.727356 35.627346)')); insert into shops (name, location) values ('matsushima-ya', - GeomFromText('POINT(139.737381 35.640556)')); + ST_GeomFromText('POINT(139.737381 35.640556)')); insert into shops (name, location) values ('kazuya', - GeomFromText('POINT(139.760895 35.673508)')); + ST_GeomFromText('POINT(139.760895 35.673508)')); insert into shops (name, location) values ('furuya-kogane-an', - GeomFromText('POINT(139.676071 35.680603)')); + ST_GeomFromText('POINT(139.676071 35.680603)')); insert into shops (name, location) values ('hachi-no-ie', - GeomFromText('POINT(139.668106 35.608021)')); + ST_GeomFromText('POINT(139.668106 35.608021)')); insert into shops (name, location) values ('azuki-chan', - GeomFromText('POINT(139.673203 35.64151)')); + ST_GeomFromText('POINT(139.673203 35.64151)')); insert into shops (name, location) values ('kuriko-an', - GeomFromText('POINT(139.796829 35.712013)')); + ST_GeomFromText('POINT(139.796829 35.712013)')); insert into shops (name, location) values ('yume-no-aru-machi-no-taiyaki-ya-san', - GeomFromText('POINT(139.712524 35.616199)')); + ST_GeomFromText('POINT(139.712524 35.616199)')); insert into shops (name, location) values ('naze-ya', - GeomFromText('POINT(139.665833 35.609039)')); + ST_GeomFromText('POINT(139.665833 35.609039)')); insert into shops (name, location) values ('sanoki-ya', - GeomFromText('POINT(139.770721 35.66592)')); + ST_GeomFromText('POINT(139.770721 35.66592)')); insert into shops (name, location) values ('shigeta', - GeomFromText('POINT(139.780273 35.672626)')); + ST_GeomFromText('POINT(139.780273 35.672626)')); insert into shops (name, location) values ('nishimi-ya', - GeomFromText('POINT(139.774628 35.671825)')); + ST_GeomFromText('POINT(139.774628 35.671825)')); insert into shops (name, location) values ('hiiragi', - GeomFromText('POINT(139.711517 35.647701)')); -select id, name, AsText(location) as location_text from shops; -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); + ST_GeomFromText('POINT(139.711517 35.647701)')); +select id, name, ST_AsText(location) as location_text from shops; +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.7727 35.6684, 139.7038 35.7121)'), location); drop table shops; --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test index 25814635b22..9f3589a66d1 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_delete.test @@ -16,6 +16,7 @@ --source include/have_innodb.inc --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -32,16 +33,16 @@ show create table shops; insert into shops (name, location) values ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); + ST_GeomFromText('POINT(139.685043 35.714653)')); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); delete from shops - where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); + where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); -select id, name, AsText(location) as location_text from shops; +select id, name, ST_AsText(location) as location_text from shops; drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test index c6bb8a1d4e6..aff5c52c786 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/geometry_update.test @@ -16,6 +16,7 @@ --source include/have_innodb.inc --source include/have_geometry.inc +--source ../../include/mroonga/have_version_56_or_later.inc --source ../../include/mroonga/have_mroonga.inc --disable_warnings @@ -32,18 +33,18 @@ show create table shops; insert into shops (name, location) values ('sazare', - GeomFromText('POINT(139.685043 35.714653)')); -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); + ST_GeomFromText('POINT(139.685043 35.714653)')); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); -update shops set location = GeomFromText('POINT(139.66116 35.57566)') +update shops set location = ST_GeomFromText('POINT(139.66116 35.57566)') where name = 'sazare'; -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); -select id, name, AsText(location) as location_text from shops - where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location); +select id, name, ST_AsText(location) as location_text from shops + where MBRContains(ST_GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location); drop table shops; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test index 39772e5d78d..776fd27a2f2 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_TODO_SPLIT_ME.test @@ -36,14 +36,6 @@ insert into t1 values(3,30,"ii si ii se ii"); insert into t1 values(4,40,"ta ti tu te to"); insert into t1 values(5,50,"aa ii uu ii oo"); -select *, match(c3) against("ii") from t1 - where match(c3) against("ii") order by c1 desc limit 1; -show status like 'mroonga_fast_order_limit'; - -select *, match(c3) against("ii") from t1 - where match(c3) against("ii") order by c1 limit 1; -show status like 'mroonga_fast_order_limit'; - select c3, match(c3) against("ii") from t1 where match(c3) against("ii") order by match(c3) against("ii") desc; show status like 'mroonga_fast_order_limit'; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test new file mode 100644 index 00000000000..69be84e2619 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_no_direction.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE memos ( + id int PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) COMMENT = 'engine "InnoDB"'; + +INSERT INTO memos VALUES(1, "Groonga is fast"); +INSERT INTO memos VALUES(2, "Mroonga is fast"); +INSERT INTO memos VALUES(3, "Mroonga is easy"); +INSERT INTO memos VALUES(4, "Mroonga is useful"); +INSERT INTO memos VALUES(5, "Mroonga is great"); + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +SELECT id, content + FROM memos + WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE) + ORDER BY id + LIMIT 2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test new file mode 100644 index 00000000000..f7b858e75f0 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/optimization_order_limit_order_by_primary_key.test @@ -0,0 +1,50 @@ +# Copyright(C) 2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS memos; +--enable_warnings + +FLUSH STATUS; + +CREATE TABLE memos ( + id int PRIMARY KEY, + content TEXT, + FULLTEXT INDEX (content) +) COMMENT = 'engine "InnoDB"'; + +INSERT INTO memos VALUES(1, "Mroonga is fast"); +INSERT INTO memos VALUES(2, "Mroonga is easy"); +INSERT INTO memos VALUES(3, "Mroonga is useful"); +INSERT INTO memos VALUES(4, "Mroonga is great"); +INSERT INTO memos VALUES(5, "Groonga is fast"); + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +SELECT id, content + FROM memos + WHERE MATCH(content) AGAINST("+Mroonga" IN BOOLEAN MODE) + ORDER BY id DESC + LIMIT 2; + +SHOW STATUS LIKE 'mroonga_fast_order_limit'; + +DROP TABLE memos; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt new file mode 100644 index 00000000000..611d08f0c78 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema-master.opt @@ -0,0 +1 @@ +--performance-schema diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test new file mode 100644 index 00000000000..31c3e0a26ff --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/performance_schema.test @@ -0,0 +1,41 @@ +# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source ../../include/mroonga/have_mroonga.inc + +--disable_warnings +DROP TABLE IF EXISTS diaries; +--enable_warnings + +SHOW VARIABLES LIKE 'performance_schema'; + +CREATE TABLE diaries ( + id INT PRIMARY KEY AUTO_INCREMENT, + content VARCHAR(255), + FULLTEXT INDEX (content) +) DEFAULT CHARSET UTF8 COMMENT = 'ENGINE "InnoDB"'; +SHOW CREATE TABLE diaries; + +INSERT INTO diaries (content) VALUES ("Tommorow will be shiny day!"); + +SHOW TABLES FROM performance_schema LIKE 'threads'; + +DROP TABLE diaries; + +--source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_files.test index b333991d27e..8f0d01d52fb 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 @@ -19,14 +19,9 @@ --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_mroonga_helper.inc ---disable_warnings -DROP DATABASE IF EXISTS repair_test; CREATE DATABASE repair_test; USE repair_test; -DROP TABLE IF EXISTS diaries; ---enable_warnings - CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, @@ -44,10 +39,10 @@ SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); --remove_file $MYSQLD_DATADIR/repair_test.mrn --remove_file $MYSQLD_DATADIR/repair_test.mrn.001 --remove_file $MYSQLD_DATADIR/repair_test.mrn.0000000 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000103 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000104 --remove_file $MYSQLD_DATADIR/repair_test.mrn.0000105 ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000105.c +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000106 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000107 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000107.c FLUSH TABLES; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test index ce6e1d23280..147d9672eae 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/repair_table_no_index_file.test @@ -19,14 +19,9 @@ --source ../../include/mroonga/have_mroonga.inc --source ../../include/mroonga/have_mroonga_helper.inc ---disable_warnings -DROP DATABASE IF EXISTS repair_test; CREATE DATABASE repair_test; USE repair_test; -DROP TABLE IF EXISTS diaries; ---enable_warnings - CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, @@ -41,7 +36,7 @@ INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); SELECT * FROM diaries WHERE MATCH(body) AGAINST("starting"); ---remove_file $MYSQLD_DATADIR/repair_test.mrn.0000104 +--remove_file $MYSQLD_DATADIR/repair_test.mrn.0000106 FLUSH TABLES; diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test index b272649c732..065b78d44a7 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_global.test @@ -1,4 +1,4 @@ -# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com> +# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -22,12 +22,6 @@ DROP TABLE IF EXISTS diaries; --enable_warnings -# MySQL <= 5.5 reports wrong a warning. :< -# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. ---disable_warnings -SET GLOBAL mroonga_match_escalation_threshold = -1; ---enable_warnings - CREATE TABLE diaries ( id INT PRIMARY KEY AUTO_INCREMENT, title TEXT, @@ -40,17 +34,23 @@ INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install"); INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install"); -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); - SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); -SET GLOBAL mroonga_match_escalation_threshold = 0; -SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +# MySQL <= 5.5 reports a wrong warning. :< +# It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. +--disable_warnings +SET GLOBAL mroonga_match_escalation_threshold = -1; +--enable_warnings -SET mroonga_match_escalation_threshold = 0; +CONNECT(search_connection, localhost, root); +USE test; SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); +DISCONNECT search_connection; +CONNECTION default; +SET GLOBAL mroonga_match_escalation_threshold = DEFAULT; DROP TABLE diaries; + --source ../../include/mroonga/have_mroonga_deinit.inc diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test index bf22001bb10..b47dcef3967 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test +++ b/storage/mroonga/mysql-test/mroonga/wrapper/t/variable_match_escalation_threshold_session.test @@ -38,7 +38,7 @@ SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE); SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE); -# MySQL <= 5.5 reports wrong a warning. :< +# MySQL <= 5.5 reports a wrong warning. :< # It has been fixed in MySQL >= 5.6 and MariaDB >= 5.3. --disable_warnings SET mroonga_match_escalation_threshold = -1; |