summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2001-02-18 00:03:37 +0200
committerunknown <monty@donna.mysql.com>2001-02-18 00:03:37 +0200
commitf8509fecdb9a6453230e1418907a0923f002201d (patch)
treee430180603a3dd86bed056e15a90ce368911ca5a /mysys
parent456102115c2f70982e600e40e34a10afde72c703 (diff)
downloadmariadb-git-f8509fecdb9a6453230e1418907a0923f002201d.tar.gz
Added locks needed for Innobase
Fixed mutex problem when doing automatic repair of MyISAM tables Docs/manual.texi: changelog include/thr_lock.h: Added TL_READ_WITH_SHARED_LOCKS for Innobase mysql-test/r/update.result: Added 'select' to verify update results mysql-test/t/update.test: Better code coverage mysys/getvar.c: Allow space in to --set-variable mysys/thr_lock.c: Added TL_READ_WITH_SHARED_LOCKS sql/ha_myisam.cc: Added comment sql/lock.cc: Added missing broadcast sql/sql_base.cc: Fixed some mutex problem when doing automatic repair of MyISAM tables sql/sql_update.cc: Purecoverage
Diffstat (limited to 'mysys')
-rw-r--r--mysys/getvar.c14
-rw-r--r--mysys/thr_lock.c3
2 files changed, 13 insertions, 4 deletions
diff --git a/mysys/getvar.c b/mysys/getvar.c
index 1d452002490..a86215ea56b 100644
--- a/mysys/getvar.c
+++ b/mysys/getvar.c
@@ -52,11 +52,17 @@ my_bool set_changeable_var(my_string str,CHANGEABLE_VAR *vars)
fprintf(stderr,"Can't find '=' in expression '%s' to option -O\n",str);
else
{
- uint length=(uint) (end-str),found_count=0;
- CHANGEABLE_VAR *var,*found;
+ uint length,found_count=0;
+ CHANGEABLE_VAR *var,*found, *var_end;
const char *name;
long num;
+ /* Skip end space from variable */
+ for (var_end=end ; end > str && is_space(end[-1]) ; end--) ;
+ length=(uint) (var_end-str);
+ /* Skip start space from argument */
+ for (end++ ; is_space(*end) ; end++) ;
+
for (var=vars,found=0 ; (name=var->name) ; var++)
{
if (!my_casecmp(name,str,length))
@@ -80,11 +86,13 @@ my_bool set_changeable_var(my_string str,CHANGEABLE_VAR *vars)
DBUG_RETURN(1);
}
- num=(long) atol(end+1); endchar=strend(end+1)[-1];
+ num=(long) atol(end); endchar=strend(end)[-1];
if (endchar == 'k' || endchar == 'K')
num*=1024;
else if (endchar == 'm' || endchar == 'M')
num*=1024L*1024L;
+ else if (endchar == 'g' || endchar == 'G')
+ num*=1024L*1024L*1024L;
else if (!isdigit(endchar))
{
fprintf(stderr,"Unknown prefix used for variable value '%s'\n",str);
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 2e20d3e24c0..2cd920245e2 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -27,6 +27,7 @@ Locks are prioritized according to:
The current lock types are:
TL_READ # Low priority read
+TL_READ_WITH_SHARED_LOCKS
TL_READ_HIGH_PRIORITY # High priority read
TL_READ_NO_INSERT # Read without concurrent inserts
TL_WRITE_ALLOW_WRITE # Write lock that allows other writers
@@ -667,7 +668,7 @@ void thr_unlock(THR_LOCK_DATA *data)
/* Release write-locks with TL_WRITE or TL_WRITE_ONLY priority first */
if (data &&
(data->type != TL_WRITE_LOW_PRIORITY || !lock->read_wait.data ||
- lock->read_wait.data->type == TL_READ))
+ lock->read_wait.data->type < TL_READ_HIGH_PRIORITY))
{
if (lock->write_lock_count++ > max_write_lock_count)
{