Hi, I'm GSoC 2022 contributor, I'm working on the MCOL-785.
Now I have a problem: The JSON Function result is truncated when the function is called based on LONGTEXT field.
Take the JSON_ARRAY as an example:
After debugging, I found that such difference is caused by overflow error.
First, the return type of args[n_arg]- >max_char_length() is uint32, the max value of uint32 is 4,294,967,295.
When called based on LONGTEXT, the result of args[n_arg]- >max_char_length() is 4,294,967,295(Maximum value of LONGTEXT). So args[n_arg]->max_char_length()+4 will be 3 due to overflow. And there is no overflow when calling based on TEXT.
I will make a patch to this issue. I would be very grateful if you can handle it soon.
same issues exist in JSON_OBJECT, JSON_ARRAY_APPEND(INSERT), JSON_INSERT(REPLACE|SET)