fulltext_cache.test
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. #
  2. # Bugreport due to Roy Nasser <roy@vem.ca>
  3. #
  4. drop table if exists t1, t2;
  5. CREATE TABLE t1 (
  6.   id int(10) unsigned NOT NULL auto_increment,
  7.   q varchar(255) default NULL,
  8.   PRIMARY KEY (id)
  9. );
  10. INSERT INTO t1 VALUES (1,'aaaaaaaaa dsaass de');
  11. INSERT INTO t1 VALUES (2,'ssde df s fsda sad er');
  12. CREATE TABLE t2 (
  13.   id int(10) unsigned NOT NULL auto_increment,
  14.   id2 int(10) unsigned default NULL,
  15.   item varchar(255) default NULL,
  16.   PRIMARY KEY (id),
  17.   FULLTEXT KEY item(item)
  18. );
  19. INSERT INTO t2 VALUES (1,1,'sushi');
  20. INSERT INTO t2 VALUES (2,1,'Bolo de Chocolate');
  21. INSERT INTO t2 VALUES (3,1,'Feijoada');
  22. INSERT INTO t2 VALUES (4,1,'Mousse de Chocolate');
  23. INSERT INTO t2 VALUES (5,2,'um copo de Vodka');
  24. INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
  25. INSERT INTO t2 VALUES (7,1,'Bife');
  26. INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
  27. SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t1, t2
  28. WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
  29. SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') as x FROM t2, t1
  30. WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
  31. drop table t1, t2;