summaryrefslogtreecommitdiff
path: root/sql/sql_error.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_error.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_error.cc')
-rw-r--r--sql/sql_error.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index e6dcfed0412..c38ecfff6e6 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -783,7 +783,7 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
const Sql_condition *err;
SELECT_LEX *sel= thd->lex->first_select_lex();
SELECT_LEX_UNIT *unit= &thd->lex->unit;
- ulonglong idx= 0;
+ ha_rows idx;
Protocol *protocol=thd->protocol;
DBUG_ENTER("mysqld_show_warnings");
@@ -808,14 +808,14 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
Diagnostics_area::Sql_condition_iterator it=
thd->get_stmt_da()->sql_conditions();
- while ((err= it++))
+ for (idx= 1; (err= it++) ; idx++)
{
/* Skip levels that the user is not interested in */
if (!(levels_to_show & ((ulong) 1 << err->get_level())))
continue;
- if (++idx <= unit->offset_limit_cnt)
- continue;
- if (idx > unit->select_limit_cnt)
+ if (unit->lim.check_and_move_offset())
+ continue; // using limit offset,count
+ if (idx > unit->lim.get_select_limit())
break;
protocol->prepare_for_resend();
protocol->store(warning_level_names[err->get_level()].str,