summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-08-27 17:34:12 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-08-27 17:58:13 +0530
commitf69cc26757733724254ee37aec5a092f520d230f (patch)
tree08f8ee76a48b3db5891a1ebc112409de08be2b66 /sql/sql_select.cc
parent62d1e3bf67a12eb6f48ac615bda119e2ed65cf16 (diff)
downloadmariadb-git-f69cc26757733724254ee37aec5a092f520d230f.tar.gz
MDEV-23596: Assertion `tab->ref.use_count' failed in join_read_key_unlock_rowbb-10.1-varun
The issue here was that the query was using ORDER BY LIMIT optimzation where the access method was changed from EQ_REF access to an index scan (index that would resolve the ORDER BY clause). But the parameter READ_RECORD::unlock_row was not reset to rr_unlock_row, which is used when the access method is not EQ_REF access.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4c6e87e4f27..e2e87bb1a86 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -21601,6 +21601,9 @@ check_reverse_order:
else if (select && select->quick)
select->quick->need_sorted_output();
+ tab->read_record.unlock_row= (tab->type == JT_EQ_REF) ?
+ join_read_key_unlock_row : rr_unlock_row;
+
} // QEP has been modified
/*