diff options
author | unknown <monty@narttu.mysql.fi> | 2003-08-25 17:19:44 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-08-25 17:19:44 +0300 |
commit | 413b57e14c23b42b1068fd6a95a5e1296029acd1 (patch) | |
tree | 28a19e92b8ac6f4ca2691bb1c3ae3056a65b006c /myisam | |
parent | e8007ae77b20a6c51daaa47da78c65fe0b0fdac8 (diff) | |
download | mariadb-git-413b57e14c23b42b1068fd6a95a5e1296029acd1.tar.gz |
Better fix for myisamchk --sort-index on windows
Fixed deadlock bug when doing resize of key buffer while key buffer was in active use
myisam/mi_locking.c:
Better fix for myisamchk --sort-index on windows
mysql-test/r/symlink.result:
Update results
mysql-test/t/symlink.test:
Update results
mysys/mf_keycache.c:
Fixed deadlock bug when doing resize of key buffer while key buffer was in active use
sql/ha_myisam.cc:
simple optimization
sql/sql_show.cc:
Fixed theoretical buffer overrun
Reset variable properly before calling update_create_info()
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_locking.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c index 19fd99779ba..18daebffa85 100644 --- a/myisam/mi_locking.c +++ b/myisam/mi_locking.c @@ -57,10 +57,8 @@ int mi_lock_database(MI_INFO *info, int lock_type) DBUG_PRINT("info", ("old lock: %d", info->lock_type)); if (info->lock_type == F_RDLCK) count= --share->r_locks; - else if (info->lock_type == F_WRLCK) - count= --share->w_locks; else - count= 1; /* F_EXTRA_LCK */ + count= --share->w_locks; --share->tot_locks; if (info->lock_type == F_WRLCK && !share->w_locks && !share->delay_key_write && flush_key_blocks(share->kfile,FLUSH_KEEP)) @@ -110,19 +108,22 @@ int mi_lock_database(MI_INFO *info, int lock_type) if (error) mi_mark_crashed(info); } - if (share->r_locks) - { /* Only read locks left */ - flag=1; - if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, - MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) - error=my_errno; - } - else if (!share->w_locks) - { /* No more locks */ - flag=1; - if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, - MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) - error=my_errno; + if (info->lock_type != F_EXTRA_LCK) + { + if (share->r_locks) + { /* Only read locks left */ + flag=1; + if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } + else if (!share->w_locks) + { /* No more locks */ + flag=1; + if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } } } info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); |