Commit 70ed3160 authored by unknown's avatar unknown
Browse files

backport Serg's fix of FT interface (BUG#6523)


mysql-test/r/subselect.result:
  subqueries with full text search
mysql-test/t/subselect.test:
  subqueries with full text search
sql/ha_myisam.h:
  backport Serg's fix of FT interface
sql/handler.h:
  backport Serg's fix of FT interface
sql/opt_range.h:
  backport Serg's fix of FT interface
sql/sql_select.cc:
  comment for previous patch
parent dd93baa0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2003,3 +2003,11 @@ a b (select max(b) from t2 where t1.b=t2.a)
2	4	NULL
2	5	NULL
drop table t1, t2;
create table t1 (id int);
create table t2 (id int, body text, fulltext (body));
insert into t1 values(1),(2),(3);
insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test');
select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode));
count(distinct id)
1
drop table t2,t1;
+10 −0
Original line number Diff line number Diff line
@@ -1299,3 +1299,13 @@ insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
insert into t2 values (1,3),(2,1);
select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b;
drop table t1, t2;

#
# subqueries with full text search
#
create table t1 (id int);
create table t2 (id int, body text, fulltext (body));
insert into t1 values(1),(2),(3);
insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test');
select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode));
drop table t2,t1;
+0 −1
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ class ha_myisam: public handler
  int index_first(byte * buf);
  int index_last(byte * buf);
  int index_next_same(byte *buf, const byte *key, uint keylen);
  int index_end() { ft_handler=NULL; return 0; }
  int ft_init()
  {
    if (!ft_handler)
+1 −0
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ class handler :public Sql_alloc
  virtual int read_range_next();
  int compare_key(key_range *range);
  virtual int ft_init() { return HA_ERR_WRONG_COMMAND; }
  void ft_end() { ft_handler=NULL; }
  virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key,
                               uint keylen)
    { return NULL; }
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ class FT_SELECT: public QUICK_SELECT {
public:
  FT_SELECT(THD *thd, TABLE *table, uint key):
    QUICK_SELECT (thd, table, key, 1) { init(); }

  ~FT_SELECT() { file->ft_end(); }
  int init() { return error= file->ft_init(); }
  int get_next() { return error= file->ft_read(record); }
};
Loading