This commit is contained in:
Martin Hansson 2009-04-29 20:52:37 +02:00
commit de2c4f0ad0
3 changed files with 11 additions and 4 deletions

View file

@ -2044,13 +2044,15 @@ restart:
}
else
{
size_t block_mem_offset;
/* There are some never used blocks, take first of them */
DBUG_ASSERT(keycache->blocks_used <
(ulong) keycache->disk_blocks);
block= &keycache->block_root[keycache->blocks_used];
block_mem_offset=
((size_t) keycache->blocks_used) * keycache->key_cache_block_size;
block->buffer= ADD_TO_PTR(keycache->block_mem,
((ulong) keycache->blocks_used*
keycache->key_cache_block_size),
block_mem_offset,
uchar*);
keycache->blocks_used++;
DBUG_ASSERT(!block->next_used);

View file

@ -174,7 +174,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
data[size + 3]= MAGICEND3;
irem->filename= (char *) filename;
irem->linenum= lineno;
irem->datasize= (uint32) size;
irem->datasize= size;
irem->prev= NULL;
/* Add this remember structure to the linked list */

View file

@ -898,6 +898,8 @@ int ha_ibmdb2i::index_init(uint idx, bool sorted)
releaseIndexFile(idx);
}
rrnAssocHandle= 0;
DBUG_RETURN(rc);
}
@ -1154,6 +1156,8 @@ int ha_ibmdb2i::rnd_init(bool scan)
releaseDataFile();
}
rrnAssocHandle= 0;
DBUG_RETURN(0); // MySQL sometimes does not check the return code, causing
// an assert in ha_rnd_end later on if we return a non-zero
// value here.
@ -1251,7 +1255,8 @@ int ha_ibmdb2i::rnd_pos(uchar * buf, uchar *pos)
int rc = 0;
if (activeHandle != rrnAssocHandle)
if (rrnAssocHandle &&
(activeHandle != rrnAssocHandle))
{
if (activeHandle) releaseActiveHandle();
rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);