let's say my_database has tbl1 tbl2 tbl3 like tables
I want to make an JSON_ARRAY with table names from my_database
I tried:
SET @bd = 'my_database';
SELECT GROUP_CONCAT(DISTINCT TABLE_NAME) INTO @my_tables
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = @bd;
SELECT JSON_ARRAY(@my_tables);
But I got a single element array
+-------------------+
| @my_tables |
+-------------------+
| ["tbl1,tbl2,tbl3"] |
+-------------------+
I'm looking for ["tbl1","tbl2","tbl3"]