JSON_STORAGE_FREE(json_val)

For a JSON column value, this function shows how much storage space was
freed in its binary representation after it was updated in place using
JSON_SET(), JSON_REPLACE(), or JSON_REMOVE(). The argument can also be
a valid JSON document or a string which can be parsed as one---either
as a literal value or as the value of a user variable---in which case
the function returns 0. It returns a positive, nonzero value if the
argument is a JSON column value which has been updated as described
previously, such that its binary representation takes up less space
than it did prior to the update. For a JSON column which has been
updated such that its binary representation is the same as or larger
than before, or if the update was not able to take advantage of a
partial update, it returns 0; it returns NULL if the argument is NULL.

If json_val is not NULL, and neither is a valid JSON document nor can
be successfully parsed as one, an error results.

URL: https://dev.mysql.com/doc/refman/8.4/en/json-utility-functions.html

