你看看我的测试案例
表DDL
- greatsql> show create table t2\G
- *************************** 1. row ***************************
- Table: t2
- Create Table: CREATE TABLE `t2` (
- `id` int NOT NULL,
- `addr` varchar(10) DEFAULT NULL,
- `ui` json DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB
复制代码
数据库版本
- greatsql> \s
- ...
- Server version: 8.0.25-17 GreatSQL, Release 17, Revision 4733775f703
复制代码
查看相应配置参数
- greatsql> show global variables like '%net_buffe%len%';
- +-------------------+-------+
- | Variable_name | Value |
- +-------------------+-------+
- | net_buffer_length | 16384 |
- +-------------------+-------+
- 1 row in set (0.00 sec)
- greatsql> show global variables like '%max%allow%pa%';
- +---------------------------+------------+
- | Variable_name | Value |
- +---------------------------+------------+
- | max_allowed_packet | 67108864 |
- | mysqlx_max_allowed_packet | 67108864 |
- | slave_max_allowed_packet | 1073741824 |
- +---------------------------+------------+
- 3 rows in set (0.00 sec)
- greatsql> show global variables like '%group%concat%';
- +----------------------+-------+
- | Variable_name | Value |
- +----------------------+-------+
- | group_concat_max_len | 1024 |
- +----------------------+-------+
复制代码
生成测试数据
- #初始化sql文件
- $ cat /tmp/t2.sql
- truncate table t2;
- insert into t2 values(1,'xxx','{"0":"[
- #生成50万个INT
- for i in $(seq 1 500000);do echo -n "$i,"; done >> /tmp/t2.sql
- #将这50万个INT拼凑到sql中,结果sql内容类似这样
- truncate table t2;
- insert into t2 values(1,'xxx','{"0":"[1,2,3,4,5...
- 499997,499998,499999,500000]"}');
复制代码
执行SQL,并不会报错
- greatsql> source /tmp/t2.sql;
- Query OK, 0 rows affected (0.03 sec)
- Query OK, 1 row affected (0.17 sec)
- greatsql> select length(ui), char_length(ui) from t2;
- +------------+-----------------+
- | length(ui) | char_length(ui) |
- +------------+-----------------+
- | 3388905 | 3388905 |
- +------------+-----------------+
复制代码 |