summaryrefslogtreecommitdiff
path: root/myisammrg/myrg_open.c
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-21 01:58:38 +0300
committerunknown <monty@donna.mysql.com>2000-09-21 01:58:38 +0300
commit43044b685f765718f5f90ac26fa3e2317b5749e9 (patch)
treee2dd869fb38dfdf7e26817e7b0f7a7a6add22758 /myisammrg/myrg_open.c
parent73826420c3114dad809c2c051ba60a6e3f50ee20 (diff)
downloadmariadb-git-43044b685f765718f5f90ac26fa3e2317b5749e9.tar.gz
Fix for SAFE_MUTEX + MERGE tables
Docs/manual.texi: Fix for release include/my_pthread.h: Fix for SAFE_MUTEX for windows include/myisammrg.h: Fix for empty MERGE tables myisam/ft_stopwords.c: Free used memory myisammrg/myrg_open.c: Fix for empty MERGE tables myisammrg/myrg_queue.c: Fix for empty MERGE tables myisammrg/myrg_rfirst.c: cleanup myisammrg/myrg_rkey.c: cleanup mysys/my_thr_init.c: Fix SAFE_MUTEX for windows mysys/my_winthread.c: Fix SAFE_MUTEX for windows mysys/thr_mutex.c: Fix SAFE_MUTEX for windows sql/ha_myisammrg.cc: Fix for empty MERGE tables sql/mysqld.cc: Fix type
Diffstat (limited to 'myisammrg/myrg_open.c')
-rw-r--r--myisammrg/myrg_open.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 7f80a88dddc..9159b4edb0f 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -86,6 +86,7 @@ int handle_locking;
*m_info=info;
m_info->open_tables=(MYRG_TABLE *) (m_info+1);
m_info->tables=files;
+ errpos=2;
for (i=files ; i-- > 0 ; )
{
@@ -104,16 +105,21 @@ int handle_locking;
m_info->open_tables[i].file_offset=(my_off_t) file_offset;
file_offset+=m_info->open_tables[i].table->state->data_file_length;
}
- errpos=2;
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
{
my_errno=HA_ERR_RECORD_FILE_FULL;
goto err;
}
/* Allocate memory for queue */
- if (m_info->open_tables->table->s->base.keys &&
- _myrg_init_queue(m_info,0,HA_READ_KEY_EXACT))
- goto err;
+ m_info->keys=0;
+ if (files)
+ {
+ if ((m_info->keys=m_info->open_tables->table->s->base.keys) &&
+ _myrg_init_queue(m_info,0,HA_READ_KEY_EXACT))
+ goto err;
+ }
+ else
+ bzero((char*) &m_info->by_key,sizeof(m_info->by_key));
m_info->end_table=m_info->open_tables+files;
m_info->last_used_table=m_info->open_tables;