Commit 5fadf192 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixed problem with make distcheck

Fixed bug in automatic repair of MyISAM tables where table cache was not locked properly
parent 842e8fca
......@@ -46935,7 +46935,8 @@ Fixed problem with @code{GROUP BY} on result with expression that created a
@item
Fixed problem with privilege tables when downgrading from 4.0.2 to 3.23.
@item
Fixed thread bug in @code{SLAVE START} and @code{SLAVE STOP}.
Fixed thread bug in @code{SLAVE START}, @code{SLAVE STOP} and automatic repair
of MyISAM tables that could cause table cache to be corrupted.
@item
Fixed possible thread related key-cache-corruption problem with
@code{OPTIMIZE TABLE} and @code{REPAIR TABLE}.
......@@ -44,6 +44,10 @@ link_sources:
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \
done; \
for f in $(mystringsgen); do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ ../strings/$$f $(srcdir)/$$f; \
done; \
for f in $$ds; do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../dbug/$$f $(srcdir)/$$f; \
......
......@@ -41,7 +41,8 @@ mystringsobjects = strmov.lo strxmov.lo strnmov.lo strmake.lo strend.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo \
ctype.lo $(LTCHARSET_OBJS)
mystringsextra= strto.c ctype_autoconf.c
mystringsextra= strto.c
mystringsgen= ctype_autoconf.c
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
mysysheaders = mysys_priv.h my_static.h
mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
......@@ -76,8 +77,8 @@ clean-local:
rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
$(mystringsextra) $(mysysheaders) ctype_extra_sources.c \
../linked_client_sources
$(mystringsextra) $(mystringsgen) $(mysysheaders) \
ctype_extra_sources.c ../linked_client_sources
ctype_extra_sources.c: conf_to_src
./conf_to_src $(top_srcdir) @CHARSETS_NEED_SOURCE@ > \
......
......@@ -33,7 +33,7 @@ TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
static int open_unireg_entry(THD *thd,TABLE *entry,const char *db,
const char *name, const char *alias, bool locked);
const char *name, const char *alias);
static bool insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
const char *table_name, List_iterator<Item> *it);
static void free_cache_entry(TABLE *entry);
......@@ -711,7 +711,7 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
pthread_mutex_lock(&LOCK_open);
if (open_unireg_entry(thd, table, db, table_name, table_name, 1) ||
if (open_unireg_entry(thd, table, db, table_name, table_name) ||
!(table->table_cache_key =memdup_root(&table->mem_root,(char*) key,
key_length)))
{
......@@ -847,7 +847,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(NULL);
}
if (open_unireg_entry(thd, table,db,table_name,alias,1) ||
if (open_unireg_entry(thd, table,db,table_name,alias) ||
!(table->table_cache_key=memdup_root(&table->mem_root,(char*) key,
key_length)))
{
......@@ -955,8 +955,7 @@ bool reopen_table(TABLE *table,bool locked)
if (!locked)
VOID(pthread_mutex_lock(&LOCK_open));
if (open_unireg_entry(current_thd,&tmp,db,table_name,table->table_name,
locked))
if (open_unireg_entry(current_thd,&tmp,db,table_name,table->table_name))
goto end;
free_io_cache(table);
......@@ -1258,7 +1257,7 @@ void abort_locked_tables(THD *thd,const char *db, const char *table_name)
*/
static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
const char *name, const char *alias, bool locked)
const char *name, const char *alias)
{
char path[FN_REFLEN];
int error;
......@@ -1278,21 +1277,15 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
table_list.db=(char*) db;
table_list.name=(char*) name;
table_list.next=0;
if (!locked)
pthread_mutex_lock(&LOCK_open);
if ((error=lock_table_name(thd,&table_list)))
{
if (error < 0)
{
if (!locked)
pthread_mutex_unlock(&LOCK_open);
goto err;
}
if (wait_for_locked_table_names(thd,&table_list))
{
unlock_table_name(thd,&table_list);
if (!locked)
pthread_mutex_unlock(&LOCK_open);
goto err;
}
}
......@@ -1322,9 +1315,9 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
thd->net.last_error[0]=0; // Clear error message
thd->net.last_errno=0;
}
if (locked)
pthread_mutex_lock(&LOCK_open); // Get back original lock
pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd,&table_list);
if (error)
goto err;
}
......
......@@ -44,7 +44,6 @@ noinst_PROGRAMS = conf_to_src
EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \
ctype-gb2312.c ctype-gbk.c ctype-sjis.c \
ctype-tis620.c ctype-ujis.c \
ctype_autoconf.c \
strto.c strings-x86.s \
longlong2str.c longlong2str-x86.s \
strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
......@@ -80,7 +79,7 @@ conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
strtoull.o: @CHARSET_OBJS@
clean-local:
rm -f ctype_extra_sources.c
rm -f ctype_extra_sources.c ctype_autoconf.c
if ASSEMBLER
# On Linux gcc can compile the assembly files
......
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