summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-07-04 14:41:01 +0500
committerunknown <ram@mysql.r18.ru>2003-07-04 14:41:01 +0500
commita7beff5e15801ffe7ce72b4f36c5f6026b48efb4 (patch)
treef2909bed431ba3880cf9f96efa9676f537d8f96f /sql/sql_handler.cc
parent3f810d0e906be42faeb407d1da140977725745af (diff)
downloadmariadb-git-a7beff5e15801ffe7ce72b4f36c5f6026b48efb4.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 7c07c08bcac..79d13039784 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -222,6 +222,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)
@@ -233,31 +235,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;
+ protocol->prepare_for_resend();
+ it.rewind();
+ while ((item=it++))
{
- String *packet = &thd->packet;
- Item *item;
- protocol->prepare_for_resend();
- it.rewind();
- while ((item=it++))
- {
- if (item->send(thd->protocol, &buffer))
- {
- protocol->free(); // Free used
- my_error(ER_OUT_OF_RESOURCES,MYF(0));
- goto err;
- }
- }
- protocol->write();
+ if (item->send(thd->protocol, &buffer))
+ {
+ protocol->free(); // Free used
+ my_error(ER_OUT_OF_RESOURCES,MYF(0));
+ goto err;
+ }
}
+ protocol->write();
}
num_rows++;
}