diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2010-06-26 14:05:41 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2010-06-26 14:05:41 +0400 |
commit | 27f9fc063c54ad8c9c0e35e78bbbb14a3e2419af (patch) | |
tree | af692374b15c7e8186406a1009e678cfedc3e78b /sql/opt_range.h | |
parent | 7754be7f4c19d442564d8fef6853e711aa0e3cec (diff) | |
parent | 50cc6c9d8a7d68ace0802702f3bc10cb2afb3730 (diff) | |
download | mariadb-git-27f9fc063c54ad8c9c0e35e78bbbb14a3e2419af.tar.gz |
MariaDB 5.2 -> MariaDB 5.3 merge
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index 98968080912..5abad749b58 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -304,6 +304,8 @@ uint quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range); class QUICK_RANGE_SELECT : public QUICK_SELECT_I { protected: + /* true if we enabled key only reads */ + bool doing_key_read; handler *file; /* Members to deal with case when this quick select is a ROR-merged scan */ @@ -659,6 +661,8 @@ private: bool have_min; /* Specify whether we are computing */ bool have_max; /* a MIN, a MAX, or both. */ bool seen_first_key; /* Denotes whether the first key was retrieved.*/ + bool doing_key_read; /* true if we enabled key only reads */ + KEY_PART_INFO *min_max_arg_part; /* The keypart of the only argument field */ /* of all MIN/MAX functions. */ uint min_max_arg_len; /* The length of the MIN/MAX argument field */ @@ -752,7 +756,19 @@ class SQL_SELECT :public Sql_alloc { tmp.set_all(); return test_quick_select(thd, tmp, 0, limit, force_quick_range, FALSE) < 0; } - inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; } + /* + RETURN + 0 if record must be skipped <-> (cond && cond->val_int() == 0) + -1 if error + 1 otherwise + */ + inline int skip_record(THD *thd) + { + int rc= test(!cond || cond->val_int()); + if (thd->is_error()) + rc= -1; + return rc; + } int test_quick_select(THD *thd, key_map keys, table_map prev_tables, ha_rows limit, bool force_quick_range, bool ordered_output); |