summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.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/opt_subselect.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/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 44cb524d1b8..516730e25d3 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -5714,11 +5714,8 @@ int select_value_catcher::send_data(List<Item> &items)
DBUG_ASSERT(!assigned);
DBUG_ASSERT(items.elements == n_elements);
- if (unit->offset_limit_cnt)
- { // Using limit offset,count
- unit->offset_limit_cnt--;
- DBUG_RETURN(0);
- }
+ if (unit->lim.check_and_move_offset())
+ DBUG_RETURN(0); // Using limit offset,count
Item *val_item;
List_iterator_fast<Item> li(items);
@@ -6574,7 +6571,7 @@ bool JOIN::choose_subquery_plan(table_map join_tables)
Set the limit of this JOIN object as well, because normally its being
set in the beginning of JOIN::optimize, which was already done.
*/
- select_limit= in_subs->unit->select_limit_cnt;
+ select_limit= in_subs->unit->lim.get_select_limit();
}
else if (in_subs->test_strategy(SUBS_IN_TO_EXISTS))
{