[Groonga-mysql-commit] mroonga/mroonga [master] #446 add tests

Back to archive index

null+****@clear***** null+****@clear*****
2010年 10月 14日 (木) 12:06:12 JST


Kentoku SHIBA	2010-10-14 03:06:12 +0000 (Thu, 14 Oct 2010)

  New Revision: 82cafd3abde8f56cef53dfff3d012988b3c5c89f

  Log:
    #446 add tests

  Added files:
    test/sql/r/select_secondary_key.result
  Copied files:
    test/sql/t/select_secondary_key.test
      (from test/sql/t/count_performance.test)
  Modified files:
    test/sql/r/count_performance.result
    test/sql/t/count_performance.test

  Modified: test/sql/r/count_performance.result (+14 -0)
===================================================================
--- test/sql/r/count_performance.result    2010-10-13 16:40:32 +0000 (53c65e0)
+++ test/sql/r/count_performance.result    2010-10-14 03:06:12 +0000 (dd2fb64)
@@ -90,5 +90,19 @@ count(*)
 show status like 'grn_count_skip';
 Variable_name	Value
 grn_count_skip	4
+select * from t1 force index(idx1) where c2 between 20 and 40;
+c1	c2	c3
+2	20	ka ki ku ke ko
+3	30	sa si su se so
+4	40	ta ti tu te to
+show status like 'grn_count_skip';
+Variable_name	Value
+grn_count_skip	4
+select count(*) from t1 force index(idx1) where c2 between 20 and 40;
+count(*)
+3
+show status like 'grn_count_skip';
+Variable_name	Value
+grn_count_skip	5
 drop table t1;
 uninstall plugin groonga;

  Added: test/sql/r/select_secondary_key.result (+45 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/r/select_secondary_key.result    2010-10-14 03:06:12 +0000 (1e9e475)
@@ -0,0 +1,45 @@
+install plugin groonga soname 'ha_groonga.so';
+set storage_engine=groonga;
+drop table if exists t1, t2, t3;
+create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3))engine=groonga;
+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");
+select * from t1;
+c1	c2	c3
+1	10	aa ii uu ee oo
+2	20	ka ki ku ke ko
+3	30	sa si su se so
+4	40	ta ti tu te to
+5	50	aa ii uu ee oo
+select * from t1 force index(idx1) where c2 = 30;
+c1	c2	c3
+3	30	sa si su se so
+select * from t1 force index(idx1) where c2 = 20;
+c1	c2	c3
+2	20	ka ki ku ke ko
+drop table t1;
+create table t1 (c1 varchar(5) primary key, c2 varchar(5), c3 text, key idx1(c2), fulltext index ft(c3))engine=groonga;
+insert into t1 values('ab','ijk',"aa ii uu ee oo");
+insert into t1 values('bc','ghi',"ka ki ku ke ko");
+insert into t1 values('cd','efg',"sa si su se so");
+insert into t1 values('de','cde',"ta ti tu te to");
+insert into t1 values('ef','abc',"aa ii uu ee oo");
+select * from t1 force index(idx1) where c2 < 'e';
+c1	c2	c3
+ef	abc	aa ii uu ee oo
+de	cde	ta ti tu te to
+select * from t1 force index(idx1) where c2 > 'e';
+c1	c2	c3
+cd	efg	sa si su se so
+bc	ghi	ka ki ku ke ko
+ab	ijk	aa ii uu ee oo
+select * from t1 force index(idx1) where c2 between 'c' and 'h';
+c1	c2	c3
+de	cde	ta ti tu te to
+cd	efg	sa si su se so
+bc	ghi	ka ki ku ke ko
+drop table t1;
+uninstall plugin groonga;

  Modified: test/sql/t/count_performance.test (+4 -0)
===================================================================
--- test/sql/t/count_performance.test    2010-10-13 16:40:32 +0000 (6c61d46)
+++ test/sql/t/count_performance.test    2010-10-14 03:06:12 +0000 (b7ce61a)
@@ -51,6 +51,10 @@ select * from t1 where match(c3) against("+su" in boolean mode);
 show status like 'grn_count_skip';
 select count(*) from t1 where match(c3) against("+su" in boolean mode);
 show status like 'grn_count_skip';
+select * from t1 force index(idx1) where c2 between 20 and 40;
+show status like 'grn_count_skip';
+select count(*) from t1 force index(idx1) where c2 between 20 and 40;
+show status like 'grn_count_skip';
 drop table t1;
 
 --disable_warnings

  Copied: test/sql/t/select_secondary_key.test (+15 -25) 52%
===================================================================
--- test/sql/t/count_performance.test    2010-10-13 16:40:32 +0000 (6c61d46)
+++ test/sql/t/select_secondary_key.test    2010-10-14 03:06:12 +0000 (4f701b9)
@@ -20,37 +20,27 @@ set storage_engine=groonga;
 drop table if exists t1, t2, t3;
 --enable_warnings
 
-create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3));
+create table t1 (c1 int primary key, c2 int, c3 text, key idx1(c2), fulltext index ft(c3))engine=groonga;
 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 'grn_count_skip';
+
 select * from t1;
-show status like 'grn_count_skip';
-select count(*) from t1;
-show status like 'grn_count_skip';
-select * from t1 force index(primary) where c1 between 2 and 4;
-show status like 'grn_count_skip';
-select count(*) from t1 force index(primary) where c1 between 2 and 4;
-show status like 'grn_count_skip';
-select c1 from t1 force index(primary) where c1 < 3;
-show status like 'grn_count_skip';
-select count(c1) from t1 force index(primary) where c1 < 3;
-show status like 'grn_count_skip';
-select 1 from t1 force index(primary) where c1 > 3;
-show status like 'grn_count_skip';
-select count(1) from t1 force index(primary) where c1 > 3;
-show status like 'grn_count_skip';
-select * from t1 where match(c3) against("su");
-show status like 'grn_count_skip';
-select count(*) from t1 where match(c3) against("su");
-show status like 'grn_count_skip';
-select * from t1 where match(c3) against("+su" in boolean mode);
-show status like 'grn_count_skip';
-select count(*) from t1 where match(c3) against("+su" in boolean mode);
-show status like 'grn_count_skip';
+select * from t1 force index(idx1) where c2 = 30;
+select * from t1 force index(idx1) where c2 = 20;
+drop table t1;
+
+create table t1 (c1 varchar(5) primary key, c2 varchar(5), c3 text, key idx1(c2), fulltext index ft(c3))engine=groonga;
+insert into t1 values('ab','ijk',"aa ii uu ee oo");
+insert into t1 values('bc','ghi',"ka ki ku ke ko");
+insert into t1 values('cd','efg',"sa si su se so");
+insert into t1 values('de','cde',"ta ti tu te to");
+insert into t1 values('ef','abc',"aa ii uu ee oo");
+select * from t1 force index(idx1) where c2 < 'e';
+select * from t1 force index(idx1) where c2 > 'e';
+select * from t1 force index(idx1) where c2 between 'c' and 'h';
 drop table t1;
 
 --disable_warnings




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