diff options
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 42cfcb51377..e685ea3a059 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -219,6 +219,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, goto err; } + if (err == HA_ERR_RECORD_DELETED) + continue; if (err) { if (err != HA_ERR_KEY_NOT_FOUND && err != HA_ERR_END_OF_FILE) @@ -230,31 +232,24 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, } goto ok; } - if (cond) + if (cond && !cond->val_int()) + continue; + if (!err && num_rows >= offset_limit) { - err=err; - if (!cond->val_int()) - continue; - } - if (num_rows>=offset_limit) - { - if (!err) + String *packet = &thd->packet; + Item *item; + packet->length(0); + it.rewind(); + while ((item=it++)) { - String *packet = &thd->packet; - Item *item; - packet->length(0); - it.rewind(); - while ((item=it++)) - { - if (item->send(thd,packet)) - { - packet->free(); // Free used - my_error(ER_OUT_OF_RESOURCES,MYF(0)); - goto err; - } - } - my_net_write(&thd->net, (char*)packet->ptr(), packet->length()); + if (item->send(thd,packet)) + { + packet->free(); // Free used + my_error(ER_OUT_OF_RESOURCES,MYF(0)); + goto err; + } } + my_net_write(&thd->net, (char*)packet->ptr(), packet->length()); } num_rows++; } |