mysql 函数 GROUP_CONCAT 踩坑记录,日志:Row 244 was cut by GROUP_CONCAT()

结论:个人建议还是放在内存中拼接吧~

db日志信息:Row 244 was cut by GROUP_CONCAT())

根本原因:拼接的字符串长度超过 group_concat_max_len [默认长度1024] 被截断了

解决方案:

方案1:修改 GLOBAL 的 group_concat_max_len ,然后重启 mysql 和会话

SET GLOBAL group_concat_max_len = -1 # 如果设置为 -1 代表是最大值
SET GLOBAL group_concat_max_len = 1073741824

show variables like 'group_concat_max_len';

方案2:修改 SESSION 的 group_concat_max_len,无需重启 mysql,但仅适用于当前会话

是一个临时的、会话范围的设置。它仅适用于当前会话。

SET SESSION
"message": "\r\n### Error querying database. Cause: java.sql.SQLException: Row 304 was cut by GROUP_CONCAT()\r\n### The error may exist in io/dataease/ext/ExtVAuthModelMapper.xml\r\n### The error may involve defaultParameterMap\r\n### The error occurred while setting parameters\r\n### SQL: SELECT v_auth_model.id, v_auth_model.name, v_auth_model.label, v_auth_model.pid, v_auth_model.node_type, v_auth_model.model_type, v_auth_model.model_inner_type, v_auth_model.auth_type, v_auth_model.create_by, v_auth_model.level, v_auth_model.mode, v_auth_model.data_source_id, authInfo.PRIVILEGES AS `privileges` FROM ( SELECT GET_V_AUTH_MODEL_ID_P_USE ( ?, ? ) cids ) t, v_auth_model LEFT JOIN ( SELECT auth_source, group_concat( DISTINCT sys_auth_detail.privilege_extend ) AS `privileges` FROM ( `sys_auth` LEFT JOIN `sys_auth_detail` ON (( `sys_auth`.`id` = `sys_auth_detail`.`auth_id` ))) WHERE sys_auth_detail.privilege_value = 1 AND sys_auth.auth_source_type = ? AND ( ( sys_auth.auth_target_type = 'dept' AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = ? ) ) OR ( sys_auth.auth_target_type = 'user' AND sys_auth.auth_target = ? ) OR ( sys_auth.auth_target_type = 'role' AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = ? ) ) ) GROUP BY `sys_auth`.`auth_source` ) authInfo ON v_auth_model.id = authInfo.auth_source WHERE FIND_IN_SET( v_auth_model.id, cids ) and v_auth_model.model_type = ? ORDER BY v_auth_model.node_type desc, CONVERT(v_auth_model.label using gbk) asc\r\n### Cause: java.sql.SQLException: Row 304 was cut by GROUP_CONCAT()\n; uncategorized SQLException; SQL state [HY000]; error code [1260]; Row 304 was cut by GROUP_CONCAT(); nested exception is java.sql.SQLException: Row 304 was cut by GROUP_CONCAT()",
03-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值