List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:July 13 2005 9:54pm
Subject:bk commit into 4.1 tree (sergefp:1.2341) BUG#11869
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2341 05/07/13 19:54:00 sergefp@stripped +3 -0
  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)

  sql/item_func.cc
    1.252 05/07/13 19:53:58 sergefp@stripped +3 -0
    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
    1.16 05/07/13 19:53:58 sergefp@stripped +81 -0
    Testcase for BUG#11869

  mysql-test/r/fulltext_order_by.result
    1.15 05/07/13 19:53:58 sergefp@stripped +74 -0
    Testcase for BUG#11869

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	sergefp
# Host:	newbox.mylan
# Root:	/home/psergey/mysql-4.1-bug11869

--- 1.251/sql/item_func.cc	2005-06-05 17:38:40 +00:00
+++ 1.252/sql/item_func.cc	2005-07-13 19:53:58 +00:00
@@ -3196,6 +3196,9 @@
 
   if (key == NO_SUCH_KEY)
     return 0;
+  
+  if (!table) 
+    goto err;
 
   for (keynr=0 ; keynr < table->keys ; keynr++)
   {

--- 1.14/mysql-test/r/fulltext_order_by.result	2005-03-08 18:45:48 +00:00
+++ 1.15/mysql-test/r/fulltext_order_by.result	2005-07-13 19:53:58 +00:00
@@ -86,3 +86,77 @@
 1	1
 2	2
 drop table t1;
+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 ;
+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 42S02: Unknown table 'b' in order clause
+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;
+ERROR 42S02: Unknown table 'b' in order clause
+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;
+text	id	betreff
+drop table t1,t2,t3;

--- 1.15/mysql-test/t/fulltext_order_by.test	2005-03-08 18:45:48 +00:00
+++ 1.16/mysql-test/t/fulltext_order_by.test	2005-07-13 19:53:58 +00:00
@@ -54,3 +54,84 @@
 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;
+
Thread
bk commit into 4.1 tree (sergefp:1.2341) BUG#11869Sergey Petrunia13 Jul