Closed byron-roots closed 7 months ago
JSON_ARRAY_LENGTH
works fine for me on MySQL 8.0.32 - which version of MySQL are you using?
Since I've not heard back from you in the last few weeks, I'm going to close this issue now.
Hi Duncan,
I just encountered the exact same issue.
select * from 'users' where 'orders' is not null ORDER BY (SELECT JSON_ARRAY_LENGTH('orders')) DESC LIMIT 5
results in an error:
FUNCTION [database name].JSON_ARRAY_LENGTH does not exist.
I think JSON_LENGTH does the same?
MySQL 8.0.33 is my version on OSX.
Mark
Unfortunately, JSON_LENGTH
doesn't exist in SQLite so we can't do that (unless there's a way to figure out which database engine is being used).
I'm still confused as to why JSON_ARRAY_LENGTH
works for me on MySQL 8.0.32 but not on MySQL 8.0.33 for you.
I cannot find this in the official documentation: https://dev.mysql.com/doc/search/?d=201&p=1&q=JSON_ARRAY_LENGTH
Did you maybe install a plugin for this?
I haven't installed anything on top of mysql
from Homebrew. I'll do some research and take a look at this when I have time.
In the meantime, you can disable the "Top Customers" widget on the Overview page.
Thanks @duncanmcclean
I've just tagged a release which should hopefully fix this for you (PR: #977). I've replaced JSON_ARRAY_LENGTH
with JSON_LENGTH
so hopefully it'll work for you both now.
Thanks @duncanmcclean!
Description
The top customers widget on the overview page is erroring out on the SQL query, which also causes the page to show a widget that is stuck loading.
The current query builder in
Overview.php L:205
looks likeChanging
to
Fixes the issue for MySQL, but wouldn't know how it would affect other databases
Steps to reproduce
Environment