[Groonga-mysql-commit] mroonga/mroonga [master] [wrapper][multiple-column-index] support update. refs #1031

Back to archive index

null+****@clear***** null+****@clear*****
2011年 7月 22日 (金) 10:41:12 JST


Kouhei Sutou	2011-07-22 01:41:12 +0000 (Fri, 22 Jul 2011)

  New Revision: fb60ea6ffd2e7c97ff6e16257a27e2d994bc8b9f

  Log:
    [wrapper][multiple-column-index] support update. refs #1031

  Modified files:
    ha_mroonga.cc
    test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result
    test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test

  Modified: ha_mroonga.cc (+1 -1)
===================================================================
--- ha_mroonga.cc    2011-07-22 01:37:27 +0000 (f552b2e)
+++ ha_mroonga.cc    2011-07-22 01:41:12 +0000 (9629a07)
@@ -3025,7 +3025,7 @@ int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data)
       field->move_field_offset(-ptr_diff);
 
       grn_rc rc;
-      rc = grn_column_index_update(ctx, index_column, record_id, 1,
+      rc = grn_column_index_update(ctx, index_column, record_id, j + 1,
                                    &old_value, &new_value);
       if (rc) {
         error = ER_ERROR_ON_WRITE;

  Modified: test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result (+3 -3)
===================================================================
--- test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result    2011-07-22 01:37:27 +0000 (6a70c59)
+++ test/sql/groonga_wrapper/r/fulltext_multiple_column_index_update.result    2011-07-22 01:41:12 +0000 (e7ad8d3)
@@ -22,16 +22,16 @@ diaries	CREATE TABLE `diaries` (
 insert into diaries values(1, "Hello", "はじめました。");
 insert into diaries values(2, "天気", "明日の富士山の天気について");
 insert into diaries values(3, "富士山", "今日もきれい。");
-update diaries set title = "チョモランマと富士山" where id = 1;
 update diaries set title = "チョモランマ" where id = 3;
+update diaries set content = "チョモランマと富士山" where id = 1;
 select * from diaries where match(title, content) against("富士山");
 id	title	content
-1	チョモランマと富士山	はじめました。
+1	Hello	チョモランマと富士山
 2	天気	明日の富士山の天気について
 select * from diaries where match(title) against("富士山");
 id	title	content
-1	チョモランマと富士山	はじめました。
 select * from diaries where match(content) against("富士山");
 id	title	content
+1	Hello	チョモランマと富士山
 2	天気	明日の富士山の天気について
 drop table diaries;

  Modified: test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test (+1 -1)
===================================================================
--- test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test    2011-07-22 01:37:27 +0000 (1c896e2)
+++ test/sql/groonga_wrapper/t/fulltext_multiple_column_index_update.test    2011-07-22 01:41:12 +0000 (24079b4)
@@ -33,8 +33,8 @@ show create table diaries;
 insert into diaries values(1, "Hello", "はじめました。");
 insert into diaries values(2, "天気", "明日の富士山の天気について");
 insert into diaries values(3, "富士山", "今日もきれい。");
-update diaries set title = "チョモランマと富士山" where id = 1;
 update diaries set title = "チョモランマ" where id = 3;
+update diaries set content = "チョモランマと富士山" where id = 1;
 select * from diaries where match(title, content) against("富士山");
 select * from diaries where match(title) against("富士山");
 select * from diaries where match(content) against("富士山");




Groonga-mysql-commit メーリングリストの案内
Back to archive index