MariaDB [test_bug]> show create table test_large_table \G *************************** 1. row *************************** Table: test_large_table Create Table: CREATE TABLE `test_large_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2502001 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci 1 row in set (0.000 sec) MariaDB [test_bug]> ALTER TABLE test_large_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Query OK, 2501000 rows affected (2 min 45.770 sec) Records: 2501000 Duplicates: 0 Warnings: 0 MariaDB [test_bug]> show create table test_large_table \G *************************** 1. row *************************** Table: test_large_table Create Table: CREATE TABLE `test_large_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` mediumtext DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2502001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.000 sec) MariaDB [test_bug]> ALTER TABLE test_large_table ADD json_sample TEXT NOT NULL DEFAULT '{ '> "name": "John Smith","age": 35,"email": "john.smith@example.com","address": { '> "street": "123 Main St","city": "Anytown","state": "CA", '> "zip": "12345"},"phone_numbers": [ { "type": "home", "number": "555-1234" }, { "type": "work", "number": "555-5678" } ]}'; Query OK, 0 rows affected (0.017 sec) Records: 0 Duplicates: 0 Warnings: 0 -- We check that the column is JSON_VALID(): MariaDB [test_bug]> SELECT JSON_VALID(json_sample) FROM test_large_table LIMIT 15; +-------------------------+ | JSON_VALID(json_sample) | +-------------------------+ | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | +-------------------------+ 15 rows in set (0.001 sec) MariaDB [test_bug]> ALTER TABLE test_large_table MODIFY json_sample JSON, ALGORITHM=INSTANT, LOCK=NONE; ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY MariaDB [test_bug]> ALTER TABLE test_large_table MODIFY json_sample JSON, ALGORITHM=INPLACE, LOCK=NONE; ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY MariaDB [test_bug]> ALTER TABLE test_large_table MODIFY json_sample JSON, LOCK=NONE; ERROR 1846 (0A000): LOCK=NONE is not supported. Reason: Cannot change column type. Try LOCK=SHARED MariaDB [test_bug]> ALTER TABLE test_large_table MODIFY json_sample JSON; Stage: 1 of 2 'copy to tmp table' 99.5% of stage done ... MariaDB [test_bug]> ALTER TABLE test_large_table MODIFY json_sample JSON; Query OK, 2501000 rows affected (3 min 4.816 sec) Records: 2501000 Duplicates: 0 Warnings: 0 MariaDB [test_bug]> MariaDB [test_bug]> SHOW CREATE TABLE test_large_table \G *************************** 1. row *************************** Table: test_large_table Create Table: CREATE TABLE `test_large_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` mediumtext DEFAULT NULL, `json_sample` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`json_sample`)), PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2502001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.025 sec) [side notes] In MariaDB, the JSON data type is stored internally as a binary format called "Binary JSON" (BSON), which is a compact, optimized format for storing and querying JSON data. However, when you create a column with the JSON data type in a MariaDB table, the column is defined as a "LONGTEXT" data type in the data dictionary. The reason for this is that the JSON data type was introduced in MariaDB 10.2, which was released before the binary JSON storage engine was fully developed. To maintain compatibility with previous versions of MariaDB and MySQL, the JSON data type was implemented as a "wrapper" around the LONGTEXT data type. When you insert JSON data into a column with the JSON data type in MariaDB, the data is automatically converted to binary JSON format and stored in the table. Similarly, when you query the data, it is automatically converted back to JSON format and returned as a string. So while the JSON data type in MariaDB is technically stored as binary JSON, it is represented in the data dictionary as a LONGTEXT column, and you can manipulate it using the same SQL statements and functions as you would with a regular text column.