diff options
author | Sergey Glukhov <sergey.glukhov@oracle.com> | 2010-11-23 13:18:47 +0300 |
---|---|---|
committer | Sergey Glukhov <sergey.glukhov@oracle.com> | 2010-11-23 13:18:47 +0300 |
commit | cf0cc723aaa08bf6929c3b0bb0ccd3fdca626af0 (patch) | |
tree | 5a7ec422ba91a7e2059bf3660b7d0f191368bf23 /sql/opt_range.h | |
parent | 412f11418a409388b4ff24906853069c20c14d46 (diff) | |
download | mariadb-git-cf0cc723aaa08bf6929c3b0bb0ccd3fdca626af0.tar.gz |
Bug#56862 Execution of a query that uses index merge returns a wrong result
In case of low memory sort buffer QUICK_INDEX_MERGE_SELECT creates
temporary file where is stores row ids which meet QUICK_SELECT ranges
except of clustered pk range, clustered range is processed separately.
In init_read_record we check if temporary file is used and choose
appropriate record access method. It does not take into account that
temporary file contains partial result in case of QUICK_INDEX_MERGE_SELECT
with clustered pk range.
The fix is always to use rr_quick if QUICK_INDEX_MERGE_SELECT
with clustered pk range is used.
mysql-test/suite/innodb/r/innodb_mysql.result:
test case
mysql-test/suite/innodb/t/innodb_mysql.test:
test case
mysql-test/suite/innodb_plugin/r/innodb_mysql.result:
test case
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
test case
sql/opt_range.h:
added new method
sql/records.cc:
The fix is always to use rr_quick if QUICK_INDEX_MERGE_SELECT
with clustered pk range is used.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index c6e488cf14c..5f7a4fd3a2a 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -265,6 +265,7 @@ public: virtual bool reverse_sorted() = 0; virtual bool unique_key_range() { return false; } + virtual bool clustered_pk_range() { return false; } enum { QS_TYPE_RANGE = 0, @@ -533,6 +534,8 @@ public: THD *thd; int read_keys_and_merge(); + bool clustered_pk_range() { return test(pk_quick_select); } + /* used to get rows collected in Unique */ READ_RECORD read_record; }; |