I am beginner to mysql but little basics are cleared but I have some doubt about locking system of mysql. Row lock mechanism is provided by InnoDB engine in mysql and it improves table performance as compared to table lock. But my Question is little different, For 1st trasanction,
update table employee set userName = 'Kraven' from employee where userName='raj'
now , I guess it will lock row where userName = raj So,
- If I want to retrieve data employees having userName starting with R or r, will it give me 1 row less which is locked, Or will it hold lock because my locked row is part of query for other transaction?
- If I am searching for userName which are starting with K, will it escape rowlock of first transaction and miss the update caused by first transaction? Correct me if I am wrong, i just want to clear idea of rowlock.