diff options
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index cd9664ba759..1b522421a01 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -89,9 +89,16 @@ public: QUICK_SELECT_I(); virtual ~QUICK_SELECT_I(){}; - - /**/ + /* + Call init() immediately after creation of quick select. if init() call + fails, reset() or get_next() must not be called. + */ virtual int init() = 0; + + /* + Call reset() before first get_next call. get_next must not be called if + reset() call fails. + */ virtual int reset(void) = 0; virtual int get_next() = 0; /* get next record to retrieve */ virtual bool reverse_sorted() = 0; @@ -430,14 +437,23 @@ class SQL_SELECT :public Sql_alloc { SQL_SELECT(); ~SQL_SELECT(); + void cleanup(); bool check_quick(THD *thd, bool force_quick_range, ha_rows limit) { return test_quick_select(thd, key_map(~0), 0, limit, force_quick_range) < 0; } - inline bool skipp_record() { return cond ? cond->val_int() == 0 : 0; } + inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; } int test_quick_select(THD *thd, key_map keys, table_map prev_tables, ha_rows limit, bool force_quick_range=0); }; -QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, - struct st_table_ref *ref); + +class FT_SELECT: public QUICK_RANGE_SELECT { +public: + FT_SELECT(THD *thd, TABLE *table, uint key) : + QUICK_RANGE_SELECT (thd, table, key, 1) { init(); } + + int init() { return error=file->ft_init(); } + int get_next() { return error=file->ft_read(record); } + int get_type() { return QS_TYPE_FULLTEXT; } +}; #endif |