diff options
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index b878294bfef..0f218b73b16 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -551,14 +551,17 @@ int select_union_direct::send_data(List<Item> &items) { if (!limit) return false; - limit--; - if (offset) + if (!unit->offset_limit_cnt) { - offset--; - return false; + limit--; + if (offset) + { + offset--; + return false; + } + send_records++; } - send_records++; fill_record(thd, table, table->field, items, true, false); if (unlikely(thd->is_error())) return true; /* purecov: inspected */ |