summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2001-09-21 18:38:17 +0200
committerunknown <serg@serg.mysql.com>2001-09-21 18:38:17 +0200
commit51c261ff2393476110d2914bec5f8a1f057555be (patch)
tree08ca15f4fbe3a0f6cdb2dc71820764685495c906 /sql/item_func.h
parent2204fbea330b5877a104d64a62f2fa6535833fce (diff)
downloadmariadb-git-51c261ff2393476110d2914bec5f8a1f057555be.tar.gz
Initial checkin of the new boolean fulltext search code
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index ac4c230f312..293ef17b82d 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -863,30 +863,40 @@ public:
uint key;
bool join_key;
Item_func_match *master;
- FT_DOCLIST *ft_handler;
+ void * ft_handler;
Item_func_match(List<Item> &a, Item *b): Item_real_func(b),
- fields(a), table(0), join_key(0), master(0), ft_handler(0) {}
+ fields(a), table(0), join_key(0), master(0), ft_handler(0) {}
~Item_func_match()
{
- if (!master)
+ if (!master && ft_handler)
{
- if (ft_handler)
- {
- ft_close_search(ft_handler);
- if(join_key)
- table->file->ft_handler=0;
- }
+ ft_handler_close();
+ if(join_key)
+ table->file->ft_handler=0;
}
}
- const char *func_name() const { return "match"; }
+ virtual int ft_handler_init(const byte *key, uint keylen, bool presort)
+ { return 1; }
+ virtual int ft_handler_close() { return 1; }
enum Functype functype() const { return FT_FUNC; }
void update_used_tables() {}
bool fix_fields(THD *thd,struct st_table_list *tlist);
bool eq(const Item *) const;
- double val();
longlong val_int() { return val()!=0.0; }
bool fix_index();
void init_search(bool no_order);
};
+
+class Item_func_match_nl :public Item_func_match
+{
+public:
+ Item_func_match_nl(List<Item> &a, Item *b): Item_func_match(a,b) {}
+ const char *func_name() const { return "match_NL"; }
+ double val();
+ int ft_handler_init(const byte *query, uint querylen, bool presort)
+ { ft_handler=table->file->ft_init_ext(key, query, querylen, presort); }
+ int ft_handler_close() { ft_close_search(ft_handler); ft_handler=0; }
+};
+