summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_context.c13
-rw-r--r--mysys/my_wincond.c24
-rw-r--r--mysys/thr_lock.c16
3 files changed, 18 insertions, 35 deletions
diff --git a/mysys/my_context.c b/mysys/my_context.c
index 4d9f1a1a12f..60c0014b3b9 100644
--- a/mysys/my_context.c
+++ b/mysys/my_context.c
@@ -727,33 +727,36 @@ my_context_continue(struct my_context *c)
#ifdef MY_CONTEXT_DISABLE
int
-my_context_continue(struct my_context *c)
+my_context_continue(struct my_context *c __attribute__((unused)))
{
return -1;
}
int
-my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
+my_context_spawn(struct my_context *c __attribute__((unused)),
+ void (*f)(void *) __attribute__((unused)),
+ void *d __attribute__((unused)))
{
return -1;
}
int
-my_context_yield(struct my_context *c)
+my_context_yield(struct my_context *c __attribute__((unused)))
{
return -1;
}
int
-my_context_init(struct my_context *c, size_t stack_size)
+my_context_init(struct my_context *c __attribute__((unused)),
+ size_t stack_size __attribute__((unused)))
{
return -1; /* Out of memory */
}
void
-my_context_destroy(struct my_context *c)
+my_context_destroy(struct my_context *c __attribute__((unused)))
{
}
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 6674a5d394d..c761064dd96 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -328,26 +328,4 @@ int pthread_attr_destroy(pthread_attr_t *connect_att)
return 0;
}
-/****************************************************************************
-** Fix localtime_r() to be a bit safer
-****************************************************************************/
-
-struct tm *localtime_r(const time_t *timep,struct tm *tmp)
-{
- if (*timep == (time_t) -1) /* This will crash win32 */
- {
- bzero(tmp,sizeof(*tmp));
- }
- else
- {
- struct tm *res=localtime(timep);
- if (!res) /* Wrong date */
- {
- bzero(tmp,sizeof(*tmp)); /* Keep things safe */
- return 0;
- }
- *tmp= *res;
- }
- return tmp;
-}
#endif /* __WIN__ */
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 20af094f711..1782aecd4df 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -325,7 +325,7 @@ static void check_locks(THR_LOCK *lock, const char *where,
found_errors++;
fprintf(stderr,
"Warning at '%s': Write lock %d waiting while no exclusive read locks\n",where,(int) lock->write_wait.data->type);
- DBUG_PRINT("warning", ("Warning at '%s': Write lock %d waiting while no exclusive read locks\n",where,(int) lock->write_wait.data->type));
+ DBUG_PRINT("warning", ("Warning at '%s': Write lock %d waiting while no exclusive read locks",where,(int) lock->write_wait.data->type));
}
}
}
@@ -345,7 +345,7 @@ static void check_locks(THR_LOCK *lock, const char *where,
fprintf(stderr,
"Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d\n",
where, data->type);
- DBUG_PRINT("warning", ("Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d\n",
+ DBUG_PRINT("warning", ("Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d",
where, data->type));
break;
}
@@ -361,7 +361,7 @@ static void check_locks(THR_LOCK *lock, const char *where,
fprintf(stderr,
"Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock\n",
where);
- DBUG_PRINT("warning", ("Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock\n",
+ DBUG_PRINT("warning", ("Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock",
where));
}
@@ -384,7 +384,7 @@ static void check_locks(THR_LOCK *lock, const char *where,
"Warning at '%s' for lock: %d: Found lock of type %d that is write and read locked. Read_no_write_count: %d\n",
where, (int) type, lock->write.data->type,
lock->read_no_write_count);
- DBUG_PRINT("warning",("At '%s' for lock %d: Found lock of type %d that is write and read locked\n",
+ DBUG_PRINT("warning",("At '%s' for lock %d: Found lock of type %d that is write and read locked",
where, (int) type,
lock->write.data->type));
}
@@ -800,7 +800,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
The idea is to allow us to get a lock at once if we already have
a write lock or if there is no pending write locks and if all
write locks are of the same type and are either
- TL_WRITE_ALLOW_WRITE or TL_WRITE_CONCURRENT_INSERT
+ TL_WRITE_ALLOW_WRITE or TL_WRITE_CONCURRENT_INSERT and
+ there is no TL_READ_NO_INSERT lock.
Note that, since lock requests for the same table are sorted in
such way that requests with higher thr_lock_type value come first
@@ -817,7 +818,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
situation.
**) The exceptions are situations when:
- when old lock type is TL_WRITE_DELAYED
- But these should never happen within MySQL.
+ But these should never happen within MariaDB.
Therefore it is OK to allow acquiring write lock on the table if
this thread already holds some write lock on it.
@@ -836,7 +837,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
lock->allow_multiple_concurrent_insert &&
!lock->read_no_write_count)) &&
! lock->write_wait.data &&
- lock->write.data->type == lock_type) ||
+ lock->write.data->type == lock_type &&
+ ! lock->read_no_write_count) ||
has_old_lock(lock->write.data, data->owner))
{
DBUG_PRINT("info", ("write_wait.data: 0x%lx old_type: %d",