2400L****@mcea*****
2400L****@mcea*****
2015年 1月 8日 (木) 11:59:15 JST
加藤と申します。
設定ファイルでmroonga_database_path_prefixを指定した場合にmroonga_commandを
使用すると以下のエラーが発生します。
2015-01-08 11:45:39.351000|e|00001304|syscall error 'test.mrn' (unknown
error)
mroonga_database_path_prefixを設定した場合はmroonga_commandは使用できないの
でしょうか?
環境は以下のとおりです。
・Windows7
・MariaDB-10.0.9-Win32
なお、Linux上でmroonga4.0.2を使用した場合も同様でした。
検証手順
1. my.iniの[mysqld]に以下を追加
default_storage_engine = mroonga
mroonga_database_path_prefix = 'groonga_data/'
2. テーブル作成
CREATE TABLE books (
`id` INTEGER AUTO_INCREMENT,
`title` text,
`comment` text,
PRIMARY KEY(`id`),
FULLTEXT INDEX content_index (title, comment)
) default charset utf8;
3. データ登録
INSERT INTO books (title, comment) VALUES ('[groonga入門]', 'groongaの初歩
的な内容のみ。');
INSERT INTO books (title, comment) VALUES ('[mroonga入門]', 'mroongaの初歩
的な内容のみ。groongaについても触れている。');
4. SQL構文で検索
SELECT * FROM books WHERE MATCH (title,comment) AGAINST ('+groonga' IN
BOOLEAN MODE);
→ 2 rows in set (0.18 sec)
5. mroonga_commandで検索
SELECT mroonga_command("select books --match_columns title,comment
--query groonga");
→ ERROR 1123 (HY000): Can't initialize function 'mroonga_command'; mroong
a_command(): failed to open database: syscall error 'test.mrn' (unknown er
ログファイル
2015-01-08 11:45:39.351000|e|00001304|syscall error 'test.mrn' (unknown
error)
6. test.mrnをmysqlのデータディレクトリに手動コピーして再検索
SELECT mroonga_command("select books --match_columns title,comment
--query groonga");
→ ERROR 1123 (HY000): Can't initialize function 'mroonga_command'; mroong
a_command(): failed to open database: syscall error 'test.mrn.0000000' (un
ログファイル
2015-01-08 11:54:26.073000|e|00000df4|syscall error 'test.mrn.0000000'
(unknown error)
上記エラーの対象ファイルが変わっていることから、データディレクトリ直下を参照
していると思われます。