[Groonga-mysql-commit] mroonga/mroonga [master] Fix return 0 count at using count skip. refs #1318

アーカイブの一覧に戻る

null+****@clear***** null+****@clear*****
2012年 3月 28日 (水) 02:01:27 JST


Kentoku	2012-03-28 02:01:27 +0900 (Wed, 28 Mar 2012)

  New Revision: bec259c5af0942d75f3913959b8408212ab4bf63

  Log:
    Fix return 0 count at using count skip. refs #1318

  Added files:
    test/sql/suite/mroonga_storage/r/optimization_skip_count_bug1318.result
    test/sql/suite/mroonga_storage/t/optimization_skip_count_bug1318.test
  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+1 -1)
===================================================================
--- ha_mroonga.cc    2012-03-28 00:36:04 +0900 (181a6cc)
+++ ha_mroonga.cc    2012-03-28 02:01:27 +0900 (29d23de)
@@ -6559,6 +6559,7 @@ int ha_mroonga::storage_ft_init()
 {
   MRN_DBUG_ENTER_METHOD();
   int error = generic_ft_init();
+  record_id = GRN_ID_NIL;
   DBUG_RETURN(error);
 }
 
@@ -8948,7 +8949,6 @@ void ha_mroonga::storage_encode_multiple_column_key_double(volatile double value
 {
   MRN_DBUG_ENTER_METHOD();
   int n_bits = (data_size * 8 - 1);
-  volatile double double_value = value;
   volatile long long int *long_long_value_pointer = (long long int *)(&value);
   volatile long long int long_long_value = *long_long_value_pointer;
   if (!decode)

  Added: test/sql/suite/mroonga_storage/r/optimization_skip_count_bug1318.result (+28 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/r/optimization_skip_count_bug1318.result    2012-03-28 02:01:27 +0900 (43d99e9)
@@ -0,0 +1,28 @@
+drop table if exists t1, t2, t3;
+flush status;
+create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3));
+insert into t1 values(1,10,"aa ii uu ee oo");
+insert into t1 values(2,20,"ka ki ku ke ko");
+insert into t1 values(3,30,"sa si su se so");
+insert into t1 values(4,40,"ta ti tu te to");
+insert into t1 values(5,50,"aa ii uu ee oo");
+show status like 'mroonga_count_skip';
+Variable_name	Value
+mroonga_count_skip	0
+select count(*) from t1 where match(c3) against("+su" in boolean mode);
+count(*)
+1
+show status like 'mroonga_count_skip';
+Variable_name	Value
+mroonga_count_skip	1
+insert into t1 values(6,60,"");
+show status like 'mroonga_count_skip';
+Variable_name	Value
+mroonga_count_skip	1
+select count(*) from t1 where match(c3) against("+su" in boolean mode);
+count(*)
+1
+show status like 'mroonga_count_skip';
+Variable_name	Value
+mroonga_count_skip	2
+drop table t1;

  Added: test/sql/suite/mroonga_storage/t/optimization_skip_count_bug1318.test (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/suite/mroonga_storage/t/optimization_skip_count_bug1318.test    2012-03-28 02:01:27 +0900 (6e43051)
@@ -0,0 +1,43 @@
+# Copyright(C) 2010 Kentoku SHIBA
+#
+# 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/have_mroonga.inc
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+
+flush status;
+create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3));
+insert into t1 values(1,10,"aa ii uu ee oo");
+insert into t1 values(2,20,"ka ki ku ke ko");
+insert into t1 values(3,30,"sa si su se so");
+insert into t1 values(4,40,"ta ti tu te to");
+insert into t1 values(5,50,"aa ii uu ee oo");
+show status like 'mroonga_count_skip';
+select count(*) from t1 where match(c3) against("+su" in boolean mode);
+show status like 'mroonga_count_skip';
+connect (thread2, localhost, root,,);
+connection thread2;
+insert into t1 values(6,60,"");
+disconnect thread2;
+connection default;
+show status like 'mroonga_count_skip';
+select count(*) from t1 where match(c3) against("+su" in boolean mode);
+show status like 'mroonga_count_skip';
+drop table t1;
+
+--source include/have_mroonga_deinit.inc




Groonga-mysql-commit メーリングリストの案内
アーカイブの一覧に戻る