summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-07-04 17:15:16 +0500
committerunknown <ram@mysql.r18.ru>2003-07-04 17:15:16 +0500
commit30341167c50dd59ecdd11100b0d5e2fec14ca02b (patch)
tree342ce2825ff481ad0d90c2f76758b63b77613fc7 /sql/sql_handler.cc
parentb22a79763179f5929a0030da40e0c23f77f33c5a (diff)
downloadmariadb-git-30341167c50dd59ecdd11100b0d5e2fec14ca02b.tar.gz
fix and test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows
mysql-test/r/handler.result: test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows mysql-test/t/handler.test: test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows sql/sql_handler.cc: fix 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.cc39
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++;
}