oxmysql icon indicating copy to clipboard operation
oxmysql copied to clipboard

SELECT json_extract query crashes server

Open mcNuggets1 opened this issue 8 months ago • 2 comments

Issue checklist

MySQL.scalar.await("SELECT users JSON_EXTRACT(accounts, '$."..accountName.."') AS money WHERE identifier = ?", {money, identifier})

crashes my server without a trace. Just closes. It's wrong syntax which I didn't realise, but still shouldnt crash. It might also crash, because the arguments mismatch.

  • [x] I am using the latest release
  • [ ] I have referenced previously reported issues
  • [ ] I have referenced available documentation and cannot resolve the issue
  • [ ] I'm certain this is an issue with oxymysql, and not with my resource

Describe the bug Crash

Screenshots https://i.imgur.com/IAb4iBZ.png Printed myself the query in front

Code MySQL.scalar.await("SELECT users JSON_EXTRACT(accounts, '$."..accountName.."') AS money WHERE identifier = ?", {money, identifier})

Expected behavior An error and no crash

Additional context Add any other context about the problem here.

Server details

  • Newest artifact
  • Linux

Database details

  • MariaDB
  • 11

mcNuggets1 avatar Apr 24 '25 09:04 mcNuggets1

Feel free to ask the Ctrl:V devs over at Cfx.re to fix the billion issues causing crashes when using the node22 scrt, otherwise downgrade oxmysql so you get the expected error or resolve the error in your query.

thelindat avatar Apr 24 '25 10:04 thelindat

SELECT JSON_EXTRACT(accounts, '$.bank') FROM users WHERE identifier = ? This query is actually causing it. Whenever JSON_EXTRACT is used, it crashes.

But UPDATE querys work for me.

The cfx devs are a joke tbh, latest updates are more broken than ever.

mcNuggets1 avatar Apr 24 '25 10:04 mcNuggets1