Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.33a-galera, 5.5.34-galera
-
None
Description
There is a problem that is consistently causing deadlocks when trying to INSERT or DELETE a row with a NULL value in a column that 1) can be NULL and 2) has a UNIQUE index.
I've tested this on MariaDB 5.5.34 and it has this problem. On MySQL 5.5.34 it does NOT seem to have the problem. I narrowed this down to a very simple table setup to reproduce. Simply create a table with the following:
CREATE TABLE `deadlock_test` ( |
`buggy_column` int(11) DEFAULT NULL, |
UNIQUE KEY `buggy_column` (`buggy_column`) |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
Note that the column type does not matter. It can be VARCHAR or whatever else, so long as it can be NULL and it has a UNIQUE index.
Observations:
1) If you try to insert a row with the column value set to NULL it will deadlock.
2) If you insert a row with a value in the column it works. You can then UPDATE the column to NULL and it works fine.
3) If, while the column is NULL you try to DELETE the row, it deadlocks. You can, however, update it to have a value and then DELETE without a problem.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
There is a problem that is consistently causing deadlocks when trying to INSERT or DELETE a row with a NULL value in a column that 1) can be NULL and 2) has a UNIQUE index. I've tested this on MariaDB 5.5.34 and it has this problem. On MySQL 5.5.34 it does NOT seem to have the problem. I narrowed this down to a very simple table setup to reproduce. Simply create a table with the following: CREATE TABLE `deadlock_test` ( `buggy_column` int(11) DEFAULT NULL, UNIQUE KEY `buggy_column` (`buggy_column`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Note that the column type does not matter. It can be VARCHAR or whatever else, so long as it can be NULL and it has a UNIQUE index. Observations: 1) If you try to insert a row with the column value set to NULL it will deadlock. 2) If you insert a row with a value in the column it works. You can then UPDATE the column to NULL and it works fine. 3) If, while the column is NULL you try to DELETE the row, it deadlocks. You can, however, update it to have a value and then DELETE without a problem. |
There is a problem that is consistently causing deadlocks when trying to INSERT or DELETE a row with a NULL value in a column that 1) can be NULL and 2) has a UNIQUE index. I've tested this on MariaDB 5.5.34 and it has this problem. On MySQL 5.5.34 it does NOT seem to have the problem. I narrowed this down to a very simple table setup to reproduce. Simply create a table with the following: {code:sql} CREATE TABLE `deadlock_test` ( `buggy_column` int(11) DEFAULT NULL, UNIQUE KEY `buggy_column` (`buggy_column`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; {code} Note that the column type does not matter. It can be VARCHAR or whatever else, so long as it can be NULL and it has a UNIQUE index. Observations: 1) If you try to insert a row with the column value set to NULL it will deadlock. 2) If you insert a row with a value in the column it works. You can then UPDATE the column to NULL and it works fine. 3) If, while the column is NULL you try to DELETE the row, it deadlocks. You can, however, update it to have a value and then DELETE without a problem. |
Due Date | 2014-02-28 |
Affects Version/s | 5.5.34 [ 13700 ] | |
Affects Version/s | 5.5.34-galera [ 13900 ] |
Assignee | Elena Stepanova [ elenst ] |
Attachment | config_dump [ 26102 ] | |
Attachment | my.cnf [ 26103 ] | |
Attachment | conf.d.tar [ 26104 ] |
Affects Version/s | 5.5.33a-galera [ 13600 ] | |
Affects Version/s | 5.5.34-galera [ 13900 ] | |
Affects Version/s | 5.5.34 [ 13700 ] |
Fix Version/s | 5.5.35-galera [ 14300 ] | |
Assignee | Elena Stepanova [ elenst ] | Nirbhay Choubey [ nirbhay_c ] |
Due Date | 2014-02-28 |
Labels | galera |
Fix Version/s | 5.5.36-galera [ 14801 ] | |
Fix Version/s | 5.5.35-galera [ 14300 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | defaullt [ 33712 ] | MariaDB v2 [ 42904 ] |
Workflow | MariaDB v2 [ 42904 ] | MariaDB v3 [ 61932 ] |
Workflow | MariaDB v3 [ 61932 ] | MariaDB v4 [ 147425 ] |
Are you using galera? You've selected 5.5.34-galera as your "affected version", was it intentional, or you've meant 5.5.34 without galera?
I've tried the following test case:
And saw no deadlock. Please provide a full test case, not only a table definition.