summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-08-21 22:04:22 +0300
committermonty@hundin.mysql.fi <>2002-08-21 22:04:22 +0300
commit03b0179af9f3492c4682dbc85542529215010a7c (patch)
tree75f29bea26c7fd21a45f22fd906c7a1545aaee91 /mysys
parenta5edb200421018ee967045903b2802c2d5c1bd75 (diff)
downloadmariadb-git-03b0179af9f3492c4682dbc85542529215010a7c.tar.gz
Use our version of RWLOCKS on UNIXWARE 7
More DBUG info for replication Better error messages from replication Fixed bug in replication code when connecting to 'localhost' (time was not released properly) Block ALARM signal on Linux for signal handler thread (Fixes problem with running mysqld with --debug) Removed warning when setting an AUTO_INCREMENT field to NULL
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c5
-rw-r--r--mysys/mf_iocache2.c2
-rw-r--r--mysys/thr_alarm.c23
-rw-r--r--mysys/thr_mutex.c4
4 files changed, 21 insertions, 13 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 6f7fb907ad5..43b3d30915f 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -392,8 +392,8 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
if ((read_length=my_read(info->file,Buffer,(uint) length,info->myflags))
!= (uint) length)
{
- info->error= read_length == (uint) -1 ? -1 :
- (int) (read_length+left_length);
+ info->error= (read_length == (uint) -1 ? -1 :
+ (int) (read_length+left_length));
DBUG_RETURN(1);
}
Count-=length;
@@ -422,6 +422,7 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
{
if (length != (uint) -1)
memcpy(Buffer,info->buffer,(size_t) length);
+ info->pos_in_file= pos_in_file;
info->error= length == (uint) -1 ? -1 : (int) (length+left_length);
info->read_pos=info->read_end=info->buffer;
DBUG_RETURN(1);
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 21979b99285..344b7ac2251 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -220,7 +220,7 @@ my_off_t my_b_filelength(IO_CACHE *info)
}
else
{
- info->seek_not_done=0;
+ info->seek_not_done=1;
return my_seek(info->file,0L,MY_SEEK_END,MYF(0));
}
}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index c75b43ad0fc..902b8212cca 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -223,7 +223,8 @@ void thr_end_alarm(thr_alarm_t *alarmed)
printf("Warning: Didn't find alarm %lx in queue of %d alarms\n",
(long) *alarmed, alarm_queue.elements);
#endif
- DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",*alarmed));
+ DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",
+ (long) *alarmed));
}
if (alarm_aborted && !alarm_queue.elements)
delete_queue(&alarm_queue);
@@ -244,8 +245,10 @@ sig_handler process_alarm(int sig __attribute__((unused)))
{
sigset_t old_mask;
ALARM *alarm_data;
- DBUG_ENTER("process_alarm");
- DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+
+/*
+ This must be first as we can't call DBUG inside an alarm for a normal thread
+*/
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
if (!pthread_equal(pthread_self(),alarm_thread))
@@ -256,17 +259,20 @@ sig_handler process_alarm(int sig __attribute__((unused)))
#ifdef DONT_REMEMBER_SIGNAL
sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
#endif
- DBUG_VOID_RETURN;
+ return;
}
#endif
-
-#if defined(MAIN) && !defined(__bsdi__)
- printf("process_alarm\n"); fflush(stdout);
-#endif
+ {
#ifndef USE_ALARM_THREAD
pthread_sigmask(SIG_SETMASK,&full_signal_set,&old_mask);
pthread_mutex_lock(&LOCK_alarm);
#endif
+ DBUG_ENTER("process_alarm");
+ DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+
+#if defined(MAIN) && !defined(__bsdi__)
+ printf("process_alarm\n"); fflush(stdout);
+#endif
if (alarm_queue.elements)
{
if (alarm_aborted)
@@ -335,6 +341,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_VOID_RETURN;
+ }
}
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 4493c54069f..6de96f0a24a 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -53,8 +53,8 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
pthread_mutex_lock(&mp->global);
if (mp->count > 0 && pthread_equal(pthread_self(),mp->thread))
{
- fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d\n",
- file,line,mp->file,mp->line);
+ fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d in thread %s\n",
+ file,line,mp->file, mp->line, my_thread_name());
fflush(stderr);
abort();
}