Mysql (5.5) Innodb in this certain case is putting table lock rather than row locks.
And this is causing failure of other insert queries to the table. Also this is a part of a larger transaction.
Insert into table x(x1,x2)
Select y1,y2 from y
where 'big sql case based conditions'
Now the select query select only part of table (based on which user) and not full table.
But mysql innodb is putting table locks.
Is there any way I can avoid this? Any help will be appreciated.
Copyright Notice:Content Author:「amitchhajer」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20321407/mysql-table-lock-instead-of-row-locks