diff options
author | Igor Babaev <igor@askmonty.org> | 2014-06-10 10:34:58 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2014-06-10 10:34:58 -0700 |
commit | d42e6d3a9966803336a3edbb356d344647b31b98 (patch) | |
tree | 74728dba9f9d41d5f02e9ada395dff534d962777 /sql/sql_join_cache.h | |
parent | 216fbe2af3c8dc81f492af79dee61d6a3d333678 (diff) | |
download | mariadb-git-d42e6d3a9966803336a3edbb356d344647b31b98.tar.gz |
Fixed bug mdev-6071.
The method JOIN_CACHE::init may fail (return 1) if some conditions on the
used join buffer is not satisfied. For example it fails if join_buffer_size
is greater than join_buffer_space_limit. The conditions should be checked
when running the EXPLAIN command for the query. That's why the method
JOIN_CACHE::init has to be called for EXPLAIN commands as well.
Diffstat (limited to 'sql/sql_join_cache.h')
-rw-r--r-- | sql/sql_join_cache.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index 568cc91ecf7..a3e69f92e34 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -99,6 +99,9 @@ private: /* Size of the offset of a field within a record in the cache */ uint size_of_fld_ofs; + /* This structure is used only for explain, not for execution */ + bool for_explain_only; + protected: /* 3 functions below actually do not use the hidden parameter 'this' */ @@ -595,7 +598,7 @@ public: JOIN_CACHE *next_cache; /* Shall initialize the join cache structure */ - virtual int init(); + virtual int init(bool for_explain); /* Get the current size of the cache join buffer */ size_t get_join_buffer_size() { return buff_size; } @@ -991,7 +994,7 @@ protected: public: /* Initialize a hashed join cache */ - int init(); + int init(bool for_explain); /* Reset the buffer of a hashed join cache for reading/writing */ void reset(bool for_writing); @@ -1127,7 +1130,7 @@ public: :JOIN_CACHE(j, tab, prev) {} /* Initialize the BNL cache */ - int init(); + int init(bool for_explain); enum Join_algorithm get_join_alg() { return BNL_JOIN_ALG; } @@ -1194,7 +1197,7 @@ public: : JOIN_CACHE_HASHED(j, tab, prev) {} /* Initialize the BNLH cache */ - int init(); + int init(bool for_explain); enum Join_algorithm get_join_alg() { return BNLH_JOIN_ALG; } @@ -1325,7 +1328,7 @@ public: uchar **get_curr_association_ptr() { return &curr_association; } /* Initialize the BKA cache */ - int init(); + int init(bool for_explain); enum Join_algorithm get_join_alg() { return BKA_JOIN_ALG; } @@ -1421,7 +1424,7 @@ public: uchar **get_curr_association_ptr() { return &curr_matching_chain; } /* Initialize the BKAH cache */ - int init(); + int init(bool for_explain); enum Join_algorithm get_join_alg() { return BKAH_JOIN_ALG; } |