更新text字段时出现 Row size too large 报错
来源:互联网 发布:java调用文件管理器 编辑:程序博客网 时间:2024/05/14 11:36
起因:
开发报告说更新时出错。
更新SQL如下:
UPDATE table_name d SET d.column_name='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' WHERE d.ID=100976;
报错信息如下:
Error Code : 1118Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
疑惑:
更新字段只涉及 column_name字段,且该字段是TEXT类型。
个人之前理解是:
TEXT的内容在 Dynamic的table format下是存在off-page中的,不会占用row size的计算。
Barracuda 对应row_format ( dynamic, compress) ,其中 dynamic下text的所有内容都是off-page存放的 (点击查看)
Antelope 对应row_format (compact, redundant),其中compact下的text是存786B在row中,超过部分存在off-page
而服务器配置是 innodb_file_format = Barracuda
照理说所有table用的都是 dynamic 结构。
但是! 原因如下,摘自 文档:
To preserve compatibility with those prior versions, tables created with the InnoDB Plugin use the prefix format, unless one of ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED is specified (or implied) on the CREATE TABLE command.
也就是说,建表时不显示指定 row_format = dynamic ,即使 innodb_file_format = Barracuda 表的row-format还是 compact
所以总结为一句话就是:如果某个表的text字段很多建议建表时加上 row_format = dynamic
当然,回过头来MySQL的报错也是有误导性的,bug库中也对confirm了这个 bug(点击查看),并在5.1.61中优化了报错提示。
<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 更新text字段时出现 Row size too large 报错
- 更新text字段时出现 Row size too large 报错
- Row size too large
- Row size too large (> 8126)
- MySQL报错 Mysql Row Size too large (>8126) 和 Unknow Table Engine InnoDB 解决方案
- Mysql 出现Error 1118 Row size too large. The maximum row size is 65535 的解决办法
- MySql “Row size too large (> 8126)”
- Mysql MySQLSyntaxErrorException Row size too large
- Mysql Row size too large (> 8126)
- [MySQL]Row size too large错误
- mysql 1118 Row size too large 错误
- mysql 报错:Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65
- Row size too large (> 8126). Changing some columns to TEXT or BLOB ...
- hbase插入数据时,报错java.lang.IllegalArgumentException: KeyValue size too large
- mysql Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMI
- mysql创建表时,提示[Err] 1118 - Row size too large
- Mysql 导入psc 文件时,数据列过多,提示Row size too large(>8126)
- MySql 5.6异常处理: Row size too large (> 8126)
- java tcp 链接的简单代码(tcp sever and client)
- 黑马程序员——String类
- DSS Source Code Analyse (02) - select_waitevent
- 新浪微博表情效果
- hid-multitouch驱动源代码分析
- 更新text字段时出现 Row size too large 报错
- 一.Makefile文件
- 进程的创建与可执行程序的加载
- 算法小记之01--数组中取三个数等于定值
- js向jsp传中文出现乱码的解决方法
- JAVA面试题和笔试题总汇(含答案)-联想lenovo
- 华为笔试题
- 黑马程序员——StringBuffer&StringBuilder&Integer
- 图文详解YUV420数据格式