summaryrefslogtreecommitdiff
path: root/sql/sql_profile.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-09-26 09:49:50 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-10-13 09:40:41 +0200
commiteb0804ef5e7eeb059bb193c3c6787e8a4188d34d (patch)
tree7a159b51f5ddd8d936185cb61b66a3c1c535e2d0 /sql/sql_profile.cc
parent833637144178dcae60e7bb732dd373679f32d853 (diff)
downloadmariadb-git-eb0804ef5e7eeb059bb193c3c6787e8a4188d34d.tar.gz
MDEV-18553: MDEV-16327 pre-requisits part 1: isolation of LIMIT/OFFSET handling
Diffstat (limited to 'sql/sql_profile.cc')
-rw-r--r--sql/sql_profile.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 5949287ea8d..40e7908ac1d 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -402,7 +402,7 @@ bool PROFILING::show_profiles()
MEM_ROOT *mem_root= thd->mem_root;
SELECT_LEX *sel= thd->lex->first_select_lex();
SELECT_LEX_UNIT *unit= &thd->lex->unit;
- ha_rows idx= 0;
+ ha_rows idx;
Protocol *protocol= thd->protocol;
void *iterator;
DBUG_ENTER("PROFILING::show_profiles");
@@ -426,9 +426,9 @@ bool PROFILING::show_profiles()
unit->set_limit(sel);
- for (iterator= history.new_iterator();
+ for (iterator= history.new_iterator(), idx= 1;
iterator != NULL;
- iterator= history.iterator_next(iterator))
+ iterator= history.iterator_next(iterator), idx++)
{
prof= history.iterator_value(iterator);
@@ -436,9 +436,9 @@ bool PROFILING::show_profiles()
double query_time_usecs= prof->m_end_time_usecs - prof->m_start_time_usecs;
- if (++idx <= unit->offset_limit_cnt)
+ if (unit->lim.check_and_move_offset())
continue;
- if (idx > unit->select_limit_cnt)
+ if (idx > unit->lim.get_select_limit())
break;
protocol->prepare_for_resend();