[Groonga-mysql-commit] mroonga/mroonga [master] [storage][test] split insert into test for fulltext index table.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 9月 25日 (日) 09:52:31 JST


Kouhei Sutou	2011-09-25 00:52:31 +0000 (Sun, 25 Sep 2011)

  New Revision: 69a47ddaec977ec79b499a6069c667700741c356

  Log:
    [storage][test] split insert into test for fulltext index table.

  Added files:
    test/sql/groonga_storage/r/fulltext_insert_select.result
  Copied files:
    test/sql/groonga_storage/t/fulltext_insert_select.test
      (from test/sql/groonga_storage/t/fulltext.test)
  Modified files:
    test/sql/groonga_storage/r/fulltext.result
    test/sql/groonga_storage/t/fulltext.test

  Modified: test/sql/groonga_storage/r/fulltext.result (+0 -65)
===================================================================
--- test/sql/groonga_storage/r/fulltext.result    2011-09-25 00:51:09 +0000 (3af006b)
+++ test/sql/groonga_storage/r/fulltext.result    2011-09-25 00:52:31 +0000 (859bf37)
@@ -1,69 +1,4 @@
 drop table if exists t1, t2, t3;
-create table t1 (c1 int primary key, c2 varchar(100), _score float, fulltext index(c2)) default charset utf8;
-create table t2 (c1 int primary key, c2 text, _score float, fulltext index(c2)) default charset utf8;
-insert into t1 values (1, "aa ii uu ee oo", null);
-insert into t1 values (2, "ka ki ku ke ko", null);
-insert into t1 values (3, "aa ii ii ii oo", null);
-insert into t1 values (4, "sa si su se so", null);
-insert into t1 values (5, "ta ti ii ii to", null);
-insert into t2 (c1,c2) select c1,c2 from t1;
-select * from t1;
-c1	c2	_score
-1	aa ii uu ee oo	0
-2	ka ki ku ke ko	0
-3	aa ii ii ii oo	0
-4	sa si su se so	0
-5	ta ti ii ii to	0
-select * from t2;
-c1	c2	_score
-1	aa ii uu ee oo	0
-2	ka ki ku ke ko	0
-3	aa ii ii ii oo	0
-4	sa si su se so	0
-5	ta ti ii ii to	0
-select * from t1 where c1=3;
-c1	c2	_score
-3	aa ii ii ii oo	0
-select * from t2 where c1=3;
-c1	c2	_score
-3	aa ii ii ii oo	0
-select * from t1 where c1>3 order by c1 desc;
-c1	c2	_score
-5	ta ti ii ii to	0
-4	sa si su se so	0
-select * from t2 where c1>3 order by c1 asc;
-c1	c2	_score
-4	sa si su se so	0
-5	ta ti ii ii to	0
-select * from t1 where c2>"s" order by c2 desc;
-c1	c2	_score
-5	ta ti ii ii to	0
-4	sa si su se so	0
-select * from t2 where c2>"s" order by c1 asc;
-c1	c2	_score
-4	sa si su se so	0
-5	ta ti ii ii to	0
-select * from t1 where match(c2) against("ii") order by _score desc;
-c1	c2	_score
-3	aa ii ii ii oo	3
-5	ta ti ii ii to	2
-1	aa ii uu ee oo	1
-select * from t2 where match(c2) against("ii") order by _score asc;
-c1	c2	_score
-1	aa ii uu ee oo	1
-5	ta ti ii ii to	2
-3	aa ii ii ii oo	3
-select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
-c1	c2	match(c2) against("ii")
-1	aa ii uu ee oo	-1
-3	aa ii ii ii oo	-1
-5	ta ti ii ii to	-1
-select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
-c1	c2	match(c2) against("ii")
-1	aa ii uu ee oo	-1
-3	aa ii ii ii oo	-1
-5	ta ti ii ii to	-1
-drop table t1,t2;
 create table t1 (c1 int primary key, c2 int, c3 text, _score float, fulltext index ft(c3));
 insert into t1 values(1,10,"aa ii uu ee oo",null);
 insert into t1 values(2,10,"ka ki ku ke ko",null);

  Added: test/sql/groonga_storage/r/fulltext_insert_select.result (+66 -0) 100644
===================================================================
--- /dev/null
+++ test/sql/groonga_storage/r/fulltext_insert_select.result    2011-09-25 00:52:31 +0000 (a96e470)
@@ -0,0 +1,66 @@
+drop table if exists t1, t2, t3;
+create table t1 (c1 int primary key, c2 varchar(100), _score float, fulltext index(c2)) default charset utf8;
+create table t2 (c1 int primary key, c2 text, _score float, fulltext index(c2)) default charset utf8;
+insert into t1 values (1, "aa ii uu ee oo", null);
+insert into t1 values (2, "ka ki ku ke ko", null);
+insert into t1 values (3, "aa ii ii ii oo", null);
+insert into t1 values (4, "sa si su se so", null);
+insert into t1 values (5, "ta ti ii ii to", null);
+insert into t2 (c1,c2) select c1,c2 from t1;
+select * from t1;
+c1	c2	_score
+1	aa ii uu ee oo	0
+2	ka ki ku ke ko	0
+3	aa ii ii ii oo	0
+4	sa si su se so	0
+5	ta ti ii ii to	0
+select * from t2;
+c1	c2	_score
+1	aa ii uu ee oo	0
+2	ka ki ku ke ko	0
+3	aa ii ii ii oo	0
+4	sa si su se so	0
+5	ta ti ii ii to	0
+select * from t1 where c1=3;
+c1	c2	_score
+3	aa ii ii ii oo	0
+select * from t2 where c1=3;
+c1	c2	_score
+3	aa ii ii ii oo	0
+select * from t1 where c1>3 order by c1 desc;
+c1	c2	_score
+5	ta ti ii ii to	0
+4	sa si su se so	0
+select * from t2 where c1>3 order by c1 asc;
+c1	c2	_score
+4	sa si su se so	0
+5	ta ti ii ii to	0
+select * from t1 where c2>"s" order by c2 desc;
+c1	c2	_score
+5	ta ti ii ii to	0
+4	sa si su se so	0
+select * from t2 where c2>"s" order by c1 asc;
+c1	c2	_score
+4	sa si su se so	0
+5	ta ti ii ii to	0
+select * from t1 where match(c2) against("ii") order by _score desc;
+c1	c2	_score
+3	aa ii ii ii oo	3
+5	ta ti ii ii to	2
+1	aa ii uu ee oo	1
+select * from t2 where match(c2) against("ii") order by _score asc;
+c1	c2	_score
+1	aa ii uu ee oo	1
+5	ta ti ii ii to	2
+3	aa ii ii ii oo	3
+select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
+c1	c2	match(c2) against("ii")
+1	aa ii uu ee oo	-1
+3	aa ii ii ii oo	-1
+5	ta ti ii ii to	-1
+select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
+c1	c2	match(c2) against("ii")
+1	aa ii uu ee oo	-1
+3	aa ii ii ii oo	-1
+5	ta ti ii ii to	-1
+drop table t1,t2;

  Modified: test/sql/groonga_storage/t/fulltext.test (+0 -22)
===================================================================
--- test/sql/groonga_storage/t/fulltext.test    2011-09-25 00:51:09 +0000 (20c0114)
+++ test/sql/groonga_storage/t/fulltext.test    2011-09-25 00:52:31 +0000 (19cb38f)
@@ -20,28 +20,6 @@
 drop table if exists t1, t2, t3;
 --enable_warnings
 
-create table t1 (c1 int primary key, c2 varchar(100), _score float, fulltext index(c2)) default charset utf8;
-create table t2 (c1 int primary key, c2 text, _score float, fulltext index(c2)) default charset utf8;
-insert into t1 values (1, "aa ii uu ee oo", null);
-insert into t1 values (2, "ka ki ku ke ko", null);
-insert into t1 values (3, "aa ii ii ii oo", null);
-insert into t1 values (4, "sa si su se so", null);
-insert into t1 values (5, "ta ti ii ii to", null);
-insert into t2 (c1,c2) select c1,c2 from t1;
-select * from t1;
-select * from t2;
-select * from t1 where c1=3;
-select * from t2 where c1=3;
-select * from t1 where c1>3 order by c1 desc;
-select * from t2 where c1>3 order by c1 asc;
-select * from t1 where c2>"s" order by c2 desc;
-select * from t2 where c2>"s" order by c1 asc;
-select * from t1 where match(c2) against("ii") order by _score desc;
-select * from t2 where match(c2) against("ii") order by _score asc;
-select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
-select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
-drop table t1,t2;
-
 # for "not match against"
 create table t1 (c1 int primary key, c2 int, c3 text, _score float, fulltext index ft(c3));
 insert into t1 values(1,10,"aa ii uu ee oo",null);

  Copied: test/sql/groonga_storage/t/fulltext_insert_select.test (+0 -23) 63%
===================================================================
--- test/sql/groonga_storage/t/fulltext.test    2011-09-25 00:51:09 +0000 (20c0114)
+++ test/sql/groonga_storage/t/fulltext_insert_select.test    2011-09-25 00:52:31 +0000 (d884abc)
@@ -42,27 +42,4 @@ select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
 select c1,c2,match(c2) against("ii") from t1 where match(c2) against("ii");
 drop table t1,t2;
 
-# for "not match against"
-create table t1 (c1 int primary key, c2 int, c3 text, _score float, fulltext index ft(c3));
-insert into t1 values(1,10,"aa ii uu ee oo",null);
-insert into t1 values(2,10,"ka ki ku ke ko",null);
-insert into t1 values(3,10,"aa ii uu ee oo",null);
-insert into t1 values(4,10,"ka ki ku ke ko",null);
-insert into t1 values(5,20,"aa ii uu ee oo",null);
-insert into t1 values(6,20,"ka ki ku ke ko",null);
-insert into t1 values(7,20,"aa ii uu ee oo",null);
-insert into t1 values(8,20,"ka ki ku ke ko",null);
-select * from t1;
-select * from t1 where match(c3) against("uu");
-select * from t1 where not match(c3) against("uu");
-select * from t1 where match(c3) against("dummy");
-select * from t1 where not match(c3) against("dummy");
-select * from t1 where c1 = 4 and not match(c3) against("uu");
-select * from t1 where c1 <= 4 and not match(c3) against("uu");
-select * from t1 where c1 > 4 and not match(c3) against("uu");
-select * from t1 where c2 = 10 and not match(c3) against("uu");
-select * from t1 where c2 >= 15 and not match(c3) against("uu");
-select * from t1 where c2 < 15 and not match(c3) against("uu");
-drop table t1;
-
 --source suite/groonga_include/groonga_deinit.inc




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