Skip to content
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

Prevent Indexing JSON Fields #6064

Closed
jycor opened this issue May 31, 2023 · 2 comments · Fixed by dolthub/go-mysql-server#2469
Closed

Prevent Indexing JSON Fields #6064

jycor opened this issue May 31, 2023 · 2 comments · Fixed by dolthub/go-mysql-server#2469
Labels
bug Something isn't working good repro Easily reproducible bugs json sql Issue with SQL

Comments

@jycor
Copy link
Contributor

jycor commented May 31, 2023

In MySQL, creating SECONDARY indexes over a JSON column results in this error

mysql> create table t (i int primary key, j json);
Query OK, 0 rows affected (0.0148 sec)
mysql> create index test on t (j);
ERROR: 3152: JSON column 'j' supports indexing only via generated columns on a specified JSON path.

In dolt, an index is formed directly referencing the BLOB data.
Some MySQL docs for context: https://dev.mysql.com/doc/refman/8.0/en/create-table-secondary-indexes.html

@nicktobey
Copy link
Contributor

Do we do it correctly though? If this is a feature we already have working I see no reason to disable it just to match 1:1 with MySql

@timsehn
Copy link
Sponsor Contributor

timsehn commented May 31, 2023

Do we do it correctly though? If this is a feature we already have working I see no reason to disable it just to match 1:1 with MySql

We definitely do not do it correctly :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good repro Easily reproducible bugs json sql Issue with SQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants