diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-17 00:35:44 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-17 00:35:44 +0530 |
commit | 32eeed21297f0e5a2836daca058e38dbe3a82bc4 (patch) | |
tree | 12f1bd85b0f86dea352dea4d83b654c3b9d8e03b /sql/sql_select.cc | |
parent | 20011c8b14ad298fa028e0158b3fdbf1268b9c9c (diff) | |
download | mariadb-git-32eeed21297f0e5a2836daca058e38dbe3a82bc4.tar.gz |
MDEV-17676: Assertion `inited==NONE || (inited==RND && scan)' failed in handler::ha_rnd_init
While calculating distinct with the function remove_dup_with_compare, we don't have rnd_end calls
when we have completed the scan over the temporary table.
Added ha_rnd_end calls when we are done with the scan of the table.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1309c7bae0c..dc948ff676a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -22138,9 +22138,11 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, } file->extra(HA_EXTRA_NO_CACHE); + (void) file->ha_rnd_end(); DBUG_RETURN(0); err: file->extra(HA_EXTRA_NO_CACHE); + (void) file->ha_rnd_end(); if (error) file->print_error(error,MYF(0)); DBUG_RETURN(1); |