svnno****@sourc*****
svnno****@sourc*****
2008年 8月 4日 (月) 19:42:35 JST
Revision: 165 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=165 Author: mir Date: 2008-08-04 19:42:35 +0900 (Mon, 04 Aug 2008) Log Message: ----------- fixed bug for 2ind (appea****@trito*****) bug#13078 Ticket Links: :----------- http://sourceforge.jp/projects/tritonn/tracker/detail/13078 Modified Paths: -------------- tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/r/senna_2ind.result tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/t/senna_2ind.test tags/tritonn-1.0.11-mysql-5.0.51a/sql/sql_select.cc -------------- next part -------------- Modified: tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/r/senna_2ind.result =================================================================== --- tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/r/senna_2ind.result 2008-08-04 08:33:51 UTC (rev 164) +++ tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/r/senna_2ind.result 2008-08-04 10:42:35 UTC (rev 165) @@ -18,3 +18,30 @@ select sum(c1) from t1 where match(c2) against("a"); sum(c1) 3 +drop table t1; +drop table if exists test; +Warnings: +Note 1051 Unknown table 'test' +create table test ( +id int not null, +title varchar(200) not null, +primary key (id), +fulltext key fkey1 using ngram, normalize, 512 (title) +) engine=myisam default charset=utf8; +INSERT INTO test (id, title) VALUES(1, "今日の天気は晴れです。"); +INSERT INTO test (id, title) VALUES(2, "明日の天気は雨です。"); +set session senna_2ind=ON; +SELECT * FROM test WHERE MATCH(title) AGAINST("晴れ"); +id title +1 今日の天気は晴れです。 +SELECT * FROM test WHERE MATCH(title) AGAINST("雨"); +id title +2 明日の天気は雨です。 +SET SESSION senna_2ind=OFF; +SELECT * FROM test WHERE MATCH(title) AGAINST("晴れ"); +id title +1 今日の天気は晴れです。 +SELECT * FROM test WHERE MATCH(title) AGAINST("雨"); +id title +2 明日の天気は雨です。 +drop table test; Modified: tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/t/senna_2ind.test =================================================================== --- tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/t/senna_2ind.test 2008-08-04 08:33:51 UTC (rev 164) +++ tags/tritonn-1.0.11-mysql-5.0.51a/mysql-test/suite/senna/t/senna_2ind.test 2008-08-04 10:42:35 UTC (rev 165) @@ -19,3 +19,22 @@ select sum(c1) from t1 where match(c2) against("a"); set senna_2ind=ON; select sum(c1) from t1 where match(c2) against("a"); +drop table t1; + +# bufgix for 2ind match select +drop table if exists test; +create table test ( + id int not null, + title varchar(200) not null, + primary key (id), + fulltext key fkey1 using ngram, normalize, 512 (title) +) engine=myisam default charset=utf8; +INSERT INTO test (id, title) VALUES(1, "今日の天気は晴れです。"); +INSERT INTO test (id, title) VALUES(2, "明日の天気は雨です。"); +set session senna_2ind=ON; +SELECT * FROM test WHERE MATCH(title) AGAINST("晴れ"); +SELECT * FROM test WHERE MATCH(title) AGAINST("雨"); +SET SESSION senna_2ind=OFF; +SELECT * FROM test WHERE MATCH(title) AGAINST("晴れ"); +SELECT * FROM test WHERE MATCH(title) AGAINST("雨"); +drop table test; Modified: tags/tritonn-1.0.11-mysql-5.0.51a/sql/sql_select.cc =================================================================== --- tags/tritonn-1.0.11-mysql-5.0.51a/sql/sql_select.cc 2008-08-04 08:33:51 UTC (rev 164) +++ tags/tritonn-1.0.11-mysql-5.0.51a/sql/sql_select.cc 2008-08-04 10:42:35 UTC (rev 165) @@ -10457,9 +10457,10 @@ static void decide_read_or_skip(JOIN *join,JOIN_TAB *join_tab,bool needs_record) { - if (needs_record || (my_thread_var->sen_flags & (SENNA_DISTINCT | SENNA_FIRST_CALL)) || - (*join->sum_funcs && (*join->sum_funcs)->sum_func() != Item_sum::COUNT_FUNC && - !join->unit->offset_limit_cnt && + if ((needs_record) || (my_thread_var->sen_flags & (SENNA_DISTINCT | SENNA_FIRST_CALL)) || + (((*join->sum_funcs && (*join->sum_funcs)->sum_func() != Item_sum::COUNT_FUNC) || + join_tab->next_select != end_send_group) + && !join->unit->offset_limit_cnt && join->send_records < join->unit->select_limit_cnt)) { DEBUG_2IND(my_thread_var->sen_flags |= SENNA_IF_READ_RECORD); } else {