summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-07-19 18:17:29 +0500
committerunknown <hf@deer.(none)>2003-07-19 18:17:29 +0500
commit5aef292a075a49c75590e6cf8e2ffcbdd0b77ca8 (patch)
tree3f085dfe9c1a2e4205df93973faab0e2876a5155 /myisam
parent0fd6f4049de2f4ba2a4f4197a7ef596ec0598eb6 (diff)
downloadmariadb-git-5aef292a075a49c75590e6cf8e2ffcbdd0b77ca8.tar.gz
Fix for #712 with Serg's suggestions
myisam/mi_locking.c: Here we use F_EXTRA_LCK myisam/myisamchk.c: lines of "locking - emulation" replaced with mi_lock_database call myisam/myisamdef.h: no need for MI_TEMPORARY_TABLE sql/ha_myisam.cc: We use F_WRLCK instead MI_TEMPORARY_TABLE
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_locking.c2
-rw-r--r--myisam/myisamchk.c8
-rw-r--r--myisam/myisamdef.h1
3 files changed, 3 insertions, 8 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 648c447ae30..22772a3dd2e 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -39,7 +39,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
if (share->options & HA_OPTION_READ_ONLY_DATA ||
info->lock_type == lock_type)
DBUG_RETURN(0);
- if (lock_type == MI_TEMPORARY_TABLE)
+ if (lock_type == F_EXTRA_LCK)
{
++share->w_locks;
++share->tot_locks;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index a7df01e0169..17daab67522 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -878,10 +878,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
param->error_printed=0;
goto end2;
}
- share->w_locks++; /* Mark for writeinfo */
- share->tot_locks++;
- info->lock_type= F_EXTRA_LCK; /* Simulate as locked */
- info->tmp_lock_type=lock_type;
+ mi_lock_database(info, F_EXTRA_LCK);
datafile=info->dfile;
if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))
@@ -1057,8 +1054,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
VOID(lock_file(param, share->kfile,0L,F_UNLCK,"indexfile",filename));
info->update&= ~HA_STATE_CHANGED;
}
- share->w_locks--;
- share->tot_locks--;
+ mi_lock_database(info, F_UNLCK);
end2:
if (mi_close(info))
{
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 9c2f34990ed..7631b245b9b 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -101,7 +101,6 @@ typedef struct st_mi_state_info
#define MI_COLUMNDEF_SIZE (2*3+1)
#define MI_BASE_INFO_SIZE (5*8 + 8*4 + 4 + 4*2 + 16)
#define MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */
-#define MI_TEMPORARY_TABLE ((1 & ~F_RDLCK) | (2 & ~F_WRLCK) | (4 & ~F_UNLCK))
typedef struct st_mi_base_info
{