From 0b3db181bf58e7d7b083eb6c790859d1975aece2 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Thu, 14 Jul 2005 15:19:26 +0000 Subject: Fix for BUG#11869: In Item_func_match::fix_index() handle the case when there is no source table present (this happens for ORDER BY after UNION) --- mysql-test/t/fulltext_order_by.test | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) (limited to 'mysql-test/t/fulltext_order_by.test') diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test index 5c1b4127d8c..6894f63fa77 100644 --- a/mysql-test/t/fulltext_order_by.test +++ b/mysql-test/t/fulltext_order_by.test @@ -54,3 +54,84 @@ SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1; SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel,a; drop table t1; +# BUG#11869 +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + thread int(11) NOT NULL default '0', + beitrag longtext NOT NULL, + PRIMARY KEY (id), + KEY thread (thread), + FULLTEXT KEY beitrag (beitrag) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7923 ; + +CREATE TABLE t2 ( + id int(11) NOT NULL auto_increment, + text varchar(100) NOT NULL default '', + PRIMARY KEY (id), + KEY text (text) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=63 ; + +CREATE TABLE t3 ( + id int(11) NOT NULL auto_increment, + forum int(11) NOT NULL default '0', + betreff varchar(70) NOT NULL default '', + PRIMARY KEY (id), + KEY forum (forum), + FULLTEXT KEY betreff (betreff) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=996 ; + +--error 1109 +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(b.betreff) against ('+abc' in boolean mode) +group by a.text, b.id, b.betreff +union +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(c.beitrag) against ('+abc' in boolean mode) +group by + a.text, b.id, b.betreff +order by + match(b.betreff) against ('+abc' in boolean mode) desc; + +--error 1109 +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(b.betreff) against ('+abc' in boolean mode) +union +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(c.beitrag) against ('+abc' in boolean mode) +order by + match(b.betreff) against ('+abc' in boolean mode) desc; + +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(b.betreff) against ('+abc' in boolean mode) +union +select a.text, b.id, b.betreff +from + t2 a inner join t3 b on a.id = b.forum inner join + t1 c on b.id = c.thread +where + match(c.beitrag) against ('+abc' in boolean mode) +order by + match(betreff) against ('+abc' in boolean mode) desc; + +drop table t1,t2,t3; + -- cgit v1.2.1