Forums

'SKIP LOCKED' not working only when running MySQL command in PythonAnywhere

Hi all.

I'm trying to get object locking set up to work between multiple processes running in parallel, though there seems to be a discrepancy between the MySQL command on my home PC and PythonAnywhere.


Here is the command I'm trying to use:

SELECT * FROM task WHERE session_id=257 AND status='queued' ORDER BY created ASC, id ASC LIMIT 1 FOR UPDATE SKIP LOCKED;

This command works fine on my home PC, though fails when run in PythonAnywhere.

As long as I remove the SKIP LOCKED command, PythonAnywhere is able to run the command just fine.

This is why I imagine it's this command which is causing the issue.


I'm running 8.0.29 MySQL on my home PC.

The console on PythonAnywhere shows as 8.0.25 when using mysql -V.

I can't seem to find why adding 'SKIP LOCKED' fails the SQL command between these two versions.

'SKIP LOCKED' was added in 8.0.1, so in theory it should work in both versions.


Is there anything I'm overlooking here?

tl;dr: SKIP LOCKED not working when run via PythonAnywhere. How do I fix this?

Nevermind; in the MySQL console, when using SELECT VERSION();, the version shows as 5.7.34-log.

It's odd how this is different when run in the regular console.

Is there any way to update this?

One is the version of the client and the other is the version of server. We do not have MySQL 8 server running yet.

Thank you fjl, that makes sense.

I expect you have a whole bunch of other things on your plate to deal with, though is there any ETA for when you expect to move over to the newer MySQL versions? That would be really helpful.

We do not have an ETA for that.