summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-07-14 12:40:58 +0500
committerunknown <hf@deer.(none)>2003-07-14 12:40:58 +0500
commit02808985ddbd3102a51fe7a008d9f31a3ed169e2 (patch)
tree68da54f595c64ddbe52b1d77fcc1a9febbe0b56b /myisam
parentc4381bb0c61a3e51320830d7f00c8bb67c889fae (diff)
downloadmariadb-git-02808985ddbd3102a51fe7a008d9f31a3ed169e2.tar.gz
Proposed bugfix for #712
Monty revoked any locks for temporary tables in ha_myisam::external_lock() But further code bans using write cache on nonlocked tables this makes operations much slower myisam/mi_locking.c: Handling of MI_TEMPORARY_TABLE lock myisam/myisamdef.h: defining of MI_TEMPORARY_TABLE sql/ha_myisam.cc: now we lock temporary tables using MI_TEMPORARY_TABLE lock
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_locking.c8
-rw-r--r--myisam/myisamdef.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index cbde05d31f5..648c447ae30 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -39,6 +39,14 @@ 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)
+ {
+ ++share->w_locks;
+ ++share->tot_locks;
+ info->lock_type= lock_type;
+ DBUG_RETURN(0);
+ }
+
flag=error=0;
pthread_mutex_lock(&share->intern_lock);
if (share->kfile >= 0) /* May only be false on windows */
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 7631b245b9b..9c2f34990ed 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -101,6 +101,7 @@ 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
{