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?