When I use JSON type with fieldname containing dash i get Invalid JSON path expression error
How to repeat:
create table tt (j1 json);
insert into tt values ('{"cache-size":10}'); <-- insert went fine
select JSON_EXTRACT(j1,"$.cache-size") from tt;
ERROR 3143 (42000): Invalid JSON path expression. The error is around character position 12.