diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-06-01 21:52:20 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-06-01 21:52:20 +0200 |
commit | ffc8f62b08982cc1f2fabf8b4b38bd124c115a97 (patch) | |
tree | da42637b1ae9402a7436b715f9c0db57cdddc87a /sql/opt_range.h | |
parent | 6b157f6be3cb056a93eb925df3880098c871b32a (diff) | |
parent | 0fc39acb8125fae95062e7b680b022b075a308c3 (diff) | |
download | mariadb-git-ffc8f62b08982cc1f2fabf8b4b38bd124c115a97.tar.gz |
merge 5.1->5.2
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 6f7ef7842e7..ae02e19974d 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -280,6 +280,8 @@ class QUICK_RANGE_SELECT : public QUICK_SELECT_I { protected: bool next,dont_free,in_ror_merged_scan; + /* true if we enabled key only reads */ + bool doing_key_read; public: int error; protected: @@ -623,6 +625,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 */ @@ -714,7 +718,19 @@ class SQL_SELECT :public Sql_alloc { tmp.set_all(); return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 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); }; |