Commit de2c4f0a authored by Martin Hansson's avatar Martin Hansson

merge

parents 7d244411 33723996
......@@ -2044,13 +2044,15 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
}
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);
......
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment