diff options
author | ram@mysql.r18.ru <> | 2003-07-04 17:15:16 +0500 |
---|---|---|
committer | ram@mysql.r18.ru <> | 2003-07-04 17:15:16 +0500 |
commit | 15346c8a6675e5dc57fea1e804e9cba786e6931f (patch) | |
tree | 342ce2825ff481ad0d90c2f76758b63b77613fc7 /sql/sql_handler.cc | |
parent | ede742b6303e5ceebee56ec550d943ebdcf172f3 (diff) | |
download | mariadb-git-15346c8a6675e5dc57fea1e804e9cba786e6931f.tar.gz |
fix and test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows
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++; } |