Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from naoa/add-server-variable-for-vector-delim…
…iter Support vector column delimiter change as experimental feature Patch by Naoya Murakami. Thanks!!!
- Loading branch information
Showing
3 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
mysql-test/mroonga/storage/variable/r/vector_column_delimiter.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| DROP TABLE IF EXISTS document; | ||
| DROP TABLE IF EXISTS category; | ||
| CREATE TABLE category ( | ||
| category CHAR(10) PRIMARY KEY | ||
| ) DEFAULT CHARSET=utf8 | ||
| COMMENT='default_tokenizer "TokenDelimit"'; | ||
| CREATE TABLE document ( | ||
| id INT NOT NULL, | ||
| title TEXT, | ||
| categories TEXT COMMENT 'flags "COLUMN_VECTOR", type "category"', | ||
| PRIMARY KEY(id) | ||
| ) DEFAULT CHARSET=utf8; | ||
| SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; | ||
| Variable_name Value | ||
| mroonga_vector_column_delimiter | ||
| INSERT INTO document VALUES(1, "Mroonga is the fastest search engine", "it database fulltext"); | ||
| SELECT id, title, categories FROM document; | ||
| id title categories | ||
| 1 Mroonga is the fastest search engine IT DATABASE FULLTEXT | ||
| SET GLOBAL mroonga_vector_column_delimiter = ';'; | ||
| SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; | ||
| Variable_name Value | ||
| mroonga_vector_column_delimiter ; | ||
| SELECT id, title, categories FROM document; | ||
| id title categories | ||
| 1 Mroonga is the fastest search engine IT;DATABASE;FULLTEXT | ||
| DROP TABLE document; | ||
| DROP TABLE category; | ||
| SET GLOBAL mroonga_vector_column_delimiter = ' '; |
54 changes: 54 additions & 0 deletions
54
mysql-test/mroonga/storage/variable/t/vector_column_delimiter.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Copyright(C) 2014 Naoya Murakami <naoya@createfield.com> | ||
| # | ||
| # This library is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public | ||
| # License as published by the Free Software Foundation; either | ||
| # version 2.1 of the License, or (at your option) any later version. | ||
| # | ||
| # This library is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with this library; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
|
|
||
| --source include/not_embedded.inc | ||
| --source ../../../include/mroonga/have_mroonga.inc | ||
| --source ../../../include/mroonga/have_mroonga_helper.inc | ||
|
|
||
| --disable_warnings | ||
| DROP TABLE IF EXISTS document; | ||
| DROP TABLE IF EXISTS category; | ||
| --enable_warnings | ||
|
|
||
| CREATE TABLE category ( | ||
| category CHAR(10) PRIMARY KEY | ||
| ) DEFAULT CHARSET=utf8 | ||
| COMMENT='default_tokenizer "TokenDelimit"'; | ||
|
|
||
| CREATE TABLE document ( | ||
| id INT NOT NULL, | ||
| title TEXT, | ||
| categories TEXT COMMENT 'flags "COLUMN_VECTOR", type "category"', | ||
| PRIMARY KEY(id) | ||
| ) DEFAULT CHARSET=utf8; | ||
|
|
||
| SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; | ||
|
|
||
| INSERT INTO document VALUES(1, "Mroonga is the fastest search engine", "it database fulltext"); | ||
| SELECT id, title, categories FROM document; | ||
|
|
||
| SET GLOBAL mroonga_vector_column_delimiter = ';'; | ||
|
|
||
| SHOW GLOBAL VARIABLES LIKE 'mroonga_vector_column_delimiter'; | ||
|
|
||
| SELECT id, title, categories FROM document; | ||
|
|
||
| DROP TABLE document; | ||
| DROP TABLE category; | ||
|
|
||
| SET GLOBAL mroonga_vector_column_delimiter = ' '; | ||
|
|
||
| --source ../../../include/mroonga/have_mroonga_deinit.inc |