1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

fix and test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows

This commit is contained in:
ram@mysql.r18.ru
2003-07-04 17:15:16 +05:00
parent ede742b630
commit 15346c8a66
3 changed files with 51 additions and 22 deletions

View File

@ -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++;
}