diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-11 12:26:15 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-13 09:40:41 +0200 |
commit | 1ae02f0e0d28bfca037ec35c4fda5b01c853b09f (patch) | |
tree | 13af954bcd05c91a9a937d675c28f2e16e9ef9af /sql/sql_error.cc | |
parent | eb0804ef5e7eeb059bb193c3c6787e8a4188d34d (diff) | |
download | mariadb-git-1ae02f0e0d28bfca037ec35c4fda5b01c853b09f.tar.gz |
MDEV-18553: MDEV-16327 pre-requisits part 2: uniform of LIMIT/OFFSET handling
Now both offset and limit are stored and do not chenged during execution
(offset is decreased during processing in versions before 10.5).
(Big part of this changes made by Monty)
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index c38ecfff6e6..92a1adb8ab7 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -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(); - for (idx= 1; (err= it++) ; idx++) + for (idx= 0; (err= it++) ; idx++) { /* Skip levels that the user is not interested in */ if (!(levels_to_show & ((ulong) 1 << err->get_level()))) continue; - if (unit->lim.check_and_move_offset()) + if (unit->lim.check_offset(idx)) continue; // using limit offset,count - if (idx > unit->lim.get_select_limit()) + if (idx >= unit->lim.get_select_limit()) break; protocol->prepare_for_resend(); protocol->store(warning_level_names[err->get_level()].str, |