summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-06 22:20:11 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-06 22:20:11 +0300
commitcbb0dc14ccd3ff932edf5a29aa6af0ac210be4b9 (patch)
treec1cde424f5333f37da341972b63a2e9c323f4f39
parent95417c335edf9c5aec9d85e0693ee7012ae001d1 (diff)
downloadmariadb-git-cbb0dc14ccd3ff932edf5a29aa6af0ac210be4b9.tar.gz
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
-rw-r--r--Docs/manual.texi3
-rw-r--r--libmysql/Makefile.am4
-rw-r--r--libmysql/Makefile.shared7
-rw-r--r--sql/sql_base.cc21
-rw-r--r--strings/Makefile.am3
5 files changed, 18 insertions, 20 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index a9eef29f11a..52c1887a13e 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -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}.
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 68c2022223e..85bca62d19c 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -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; \
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 76d37c149c9..d1271173b24 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -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@ > \
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index cba64418355..31d6f16ef72 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -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;
}
diff --git a/strings/Makefile.am b/strings/Makefile.am
index d3bb4b54dcf..ca3188db1a4 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -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