GET_LOCK query with alias #307
-
I have got a SQL query to obtain an advisory lock. Following is how the query looks like. SELECT GET_LOCK('foo', 0) as lock_status; In MySQL it returns the result where the column name is the alias However, with Planetscale, the alias is not entertained. Again, the screenshot for reference. Is it by design? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @thetutlage, Thank you for reporting this to us! Is the column alias a blocking issue within your project or is it able to be worked around using an alternative option for checking the return value in your application code? The behavior definitely doesn't match what you are observing directly within MySQL and I was able to confirm the same incorrect behavior myself too so I have submitted an internal issue report with the details you've shared here, plus a few other details I collected, so this can be reviewed/corrected. The issue is likely occurring within the Vitess layer that sits on top of MySQL for PlanetScale databases. I hope this is helpful and that in the meanwhile you may be able to use a workaround due to the alias not being correctly respected in this case for your returned result set until a proper fix is available. |
Beta Was this translation helpful? Give feedback.
Hello @thetutlage,
Thank you for reporting this to us!
Is the column alias a blocking issue within your project or is it able to be worked around using an alternative option for checking the return value in your application code?
The behavior definitely doesn't match what you are observing directly within MySQL and I was able to confirm the same incorrect behavior myself too so I have submitted an internal issue report with the details you've shared here, plus a few other details I collected, so this can be reviewed/corrected. The issue is likely occurring within the Vitess layer that sits on top of MySQL for PlanetScale databases.
I hope this is helpful and that in the meanwhile you may …