Fabian K
Fabian K

Reputation: 59

Nested json object from mysql: error 'missing a closing quotation mark in string' even with static values

I'm attempting to generate a nested, hierarchical JSON from MySQL.

I keep getting the error message:

Error Code: 3141. Invalid JSON text in argument 1 to function cast_as_json: "Missing a closing quotation mark in string." at position 1026.

I have attempted the following and always got the same error:

The following tests made the problem disappear but they're obviously not an option:

I've googled for hours and really don't know any further.

The question closely follows the pattern described in How do I generate nested json objects using mysql native json functions?

Thanks for any ideas!

Cheers F

Upvotes: 3

Views: 5720

Answers (1)

Husein Nashr
Husein Nashr

Reputation: 81

Are you using GROUP_CONCAT? if so, there's a chance that it cuts your string out because it's too long resulting in invalid JSON string.

Try changing the group_concat_max_len for ex 100000 characters length:

SET SESSION group_concat_max_len = 100000;

I know it's a bit too late :)

Upvotes: 8

Related Questions