Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL query JSON result is cut off

When doing:

mysql -u case -p < MyQuery.sql

with the query being:

SELECT JSON_ARRAYAGG(JSON_OBJECT('field1', field1, ...)) FROM db.table

the printed output is cut off at a random point, halfway a JSON tag. But it does end with ].

Apparently my 8000+ records are too much to handle for JSON_ARRAYAGG?

How can I work around this?

like image 400
meaning-matters Avatar asked Oct 15 '25 04:10

meaning-matters


1 Answers

Although it's not documented, apparently the setting group_concat_max_len also limits the size of the results of JSON_xxxAGG() functions. Increase this to allow larger results.

like image 170
Barmar Avatar answered Oct 18 '25 08:10

Barmar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!