Commit cbb0dc14 authored by unknown's avatar unknown

Fixed problem with make distcheck

Fixed bug in automatic repair of MyISAM tables where table cache was not locked properly


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