mysql> show create table test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE `test` (
`body` text,
FULLTEXT KEY `body` USING NGRAM, NORMALIZE, 512 (`body`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> show senna status\G
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
1 row in set (0.00 sec)
mysql> grant all on test.* to danjou@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
Bye
$ mysql test
mysql> show senna status\G
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
1 row in set (0.00 sec)
mysql> exit
Bye
$ /usr/local/mysql/bin/mysql -S /var/lib/mysql/mysql.sock test -udanjou -e 'show senna status\G'
$ /usr/local/mysql/bin/mysql -S /var/lib/mysql/mysql.sock test -uroot -e 'show senna status\G'
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
$
- rootユーザーであればインタラクティブモード、-eでの実行ともに結果が帰ってくる
- 一般ユーザーではインタラクティブモードでは結果が帰ってくる
- 一般ユーザーで-eで実行すると結果が帰ってこない
- perl-DBI経由でも同様に一般ユーザーでは結果が帰ってこない(rootユーザーでは結果が帰ってくる)
以下ログです。
$ /usr/local/mysql/bin/mysql -S /var/lib/mysql/mysql.sock -uroot test
mysql> show senna status;
Empty set (0.00 sec)
mysql> create table test(body text, fulltext using ngram (`body`));
Query OK, 0 rows affected (0.01 sec)
mysql> show create table test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE `test` (
`body` text,
FULLTEXT KEY `body` USING NGRAM, NORMALIZE, 512 (`body`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> show senna status\G
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
1 row in set (0.00 sec)
mysql> grant all on test.* to danjou@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
Bye
$ mysql test
mysql> show senna status\G
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
1 row in set (0.00 sec)
mysql> exit
Bye
$ /usr/local/mysql/bin/mysql -S /var/lib/mysql/mysql.sock test -udanjou -e 'show senna status\G'
$ /usr/local/mysql/bin/mysql -S /var/lib/mysql/mysql.sock test -uroot -e 'show senna status\G'
*************************** 1. row ***************************
Table: test
Key_name: body
Column_name: body
Encoding: latin1
Index_type: NGRAM
Sectionalize: OFF
Normalize: ON
Split_alpha: OFF
Split_digit: OFF
Split_symbol: OFF
Initial_n_segments: 512
Senna_keys_size: 0
Senna_keys_file_size: 4268032
Senna_lexicon_size: 0
Senna_lexicon_file_size: 4268032
Senna_inv_seg_size: 167936
Senna_inv_chunk_size: 135168
$