Changes for --with-server-suffix

Fixed mutex bug in logging (crash on windows when doing SET PASSWORD=)
Changed MERGE  tables to not use FILE
This commit is contained in:
monty@donna.mysql.com 2001-01-21 16:30:16 +02:00
commit 62771338ca
26 changed files with 337 additions and 219 deletions

View file

@ -36,11 +36,12 @@ int mode;
int handle_locking;
{
int save_errno,i,errpos;
uint files,dir_length;
uint files,dir_length,length;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MRG_INFO info,*m_info;
FILE *file;
File fd;
IO_CACHE file;
N_INFO *isam,*last_isam;
DBUG_ENTER("mrg_open");
@ -48,15 +49,18 @@ int handle_locking;
isam=0;
errpos=files=0;
bzero((gptr) &info,sizeof(info));
if (!(file=my_fopen(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))))
bzero((char*) &file,sizeof(file));
if ((fd=my_open(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))) < 0 ||
init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0,
MYF(MY_WME | MY_NABP)))
goto err;
errpos=1;
dir_length=dirname_part(name_buff,name);
info.reclength=0;
while (fgets(buff,FN_REFLEN-1,file))
while ((length=my_b_gets(&file,buff,FN_REFLEN-1)))
{
if ((end=strend(buff))[-1] == '\n')
if ((end=buff+length)[-1] == '\n')
end[-1]='\0';
if (buff[0]) /* Skipp empty lines */
{
@ -113,7 +117,8 @@ int handle_locking;
m_info->end_table=m_info->open_tables+files;
m_info->last_used_table=m_info->open_tables;
VOID(my_fclose(file,MYF(0)));
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
m_info->open_list.data=(void*) m_info;
pthread_mutex_lock(&THR_LOCK_open);
mrg_open_list=list_add(mrg_open_list,&m_info->open_list);
@ -124,7 +129,8 @@ err:
save_errno=my_errno;
switch (errpos) {
case 1:
VOID(my_fclose(file,MYF(0)));
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
for (i=files ; i-- > 0 ; )
{
isam=last_isam;