How many rows will be locked by SELECT … ORDER BY xxx LIMIT 1 FOR UPDATE?

后端 未结 4 1870
刺人心
刺人心 2020-12-04 18:14

I have a query with the following structure:

SELECT ..... WHERE status = \'QUEUED\' ORDER BY position ASC LIMIT 1 FOR UPDATE;

It\'s a singl

4条回答
  •  误落风尘
    2020-12-04 18:34

    There is a bug in some versions of MySQL: #67745 Too much row locks when using SELECT for UPDATE, LIMIT and ORDER BY.

    Version: 5.5.28, 5.5.30, 5.7.1

    Same bug on my local mysql 5.5.25 win64.

提交回复
热议问题