summaryrefslogtreecommitdiff
path: root/storage/myisam/mi_check.c
diff options
context:
space:
mode:
authorArun Kuruvila <arun.kuruvila@oracle.com>2018-05-21 08:42:45 +0530
committerArun Kuruvila <arun.kuruvila@oracle.com>2018-05-21 08:42:45 +0530
commitbd5ca6acece65858591c2bf54f86ff34aeea2821 (patch)
tree94f95da457ffd9c1ad802b3105d8463bdec9bffd /storage/myisam/mi_check.c
parentbbc2e37fe4e0ca3a7cfa1437a763dc43829e98e2 (diff)
downloadmariadb-git-bd5ca6acece65858591c2bf54f86ff34aeea2821.tar.gz
Bug#25541037: MYSQL BUG ON DELETE
Description:- MyISAM table gets corrupted with concurrent executions of INSERT, DELETE statements in a particular sequence. Analysis:- Due to the inappropriate manipulation of w_lock and r_lock associated with a MyISAM table, there arises a scenario where the table's state information becomes invalid. Fix:- A lock is introduced to resolve this issue.
Diffstat (limited to 'storage/myisam/mi_check.c')
-rw-r--r--storage/myisam/mi_check.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index fe0d4c9c30b..7134cfc265a 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2018, 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
@@ -4474,6 +4474,10 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
int error;
uint r_locks=share->r_locks,w_locks=share->w_locks;
share->r_locks= share->w_locks= share->tot_locks= 0;
+
+ DBUG_EXECUTE_IF("simulate_incorrect_share_wlock_value",
+ DEBUG_SYNC_C("after_share_wlock_set_to_0"););
+
error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK);
share->r_locks=r_locks;
share->w_locks=w_locks;