home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / fulltext_cache.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  1.1 KB  |  36 lines  |  [TEXT/ttxt]

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