-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
order by
of json value is different with MySQL
#37506
Comments
Also, submitted a bug for MySQL https://bugs.mysql.com/bug.php?id=108344 |
order by and mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------------------------------------+
| Warning | 1235 | This version of MySQL doesn't yet support 'sorting of non-scalar JSON values' |
+---------+------+-------------------------------------------------------------------------------+ |
As described in https://bugs.mysql.com/bug.php?id=108344:
But in MySQL documents:
Non-scalar values are not supported in MySQL and give a warning. I think we'd better give a warning too 🤔 |
As suggested by @xiongjiwei, we could regard it as a feature TiDB has implemented, but not implemented by MySQL 🍻, then we can close this issue and the PR (which tried to add warning). If we'll make a different decision / someone expects a different decision in the future, feel free to reopen the issue and PR 😸 |
Enhancement
Then consider the following two query:
The first line returns:
It indicates that
[5]
is the smallest one. However, the second one returns:It shows no one is greater than
[5]
. It's not consistent 😢 .For TiDB, it follows the json order, and returns:
For the first selection.
The text was updated successfully, but these errors were encountered: