国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

更新text字段時出現(xiàn)Row size too large報錯應(yīng)付措施

2024-07-24 12:42:09
字體:
供稿:網(wǎng)友
起因
團(tuán)購開發(fā)報告說更新時出錯。

更新SQL如下
復(fù)制代碼 代碼如下:www.survivalescaperooms.com

UPDATE table_name d SET d.column_name='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
WHERE d.ID=100976;

報錯信息如下
Error Code : 1118
Row 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的內(nèi)容在 Dynamic的table format下是存在off-page中的,不會占用row size的計算。
Barracuda 對應(yīng)row_format ( dynamic, compress) ,其中dynamic下text的所有內(nèi)容都是off-page存放的 (點(diǎn)擊查看)
Antelope 對應(yīng)row_format (compact, redundant),其中compact下的text是存786B在row中,超過部分存在off-page
而服務(wù)器配置是 innodb_file_format = Barracuda
照理說所有table用的都是 dynamic 結(jié)構(gòu)。
但是! 原因如下,摘自文檔:
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

所以總結(jié)為一句話就是:如果某個表的text字段很多建議建表時加上 row_format = dynamic
當(dāng)然,回過頭來MySQL的報錯也是有誤導(dǎo)性的,bug庫中也對confirm了這個bug(點(diǎn)擊查看),并在5.1.61中優(yōu)化了報錯提示。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 丹东市| 平塘县| 黄平县| 启东市| 水城县| 万山特区| 全椒县| 西昌市| 泸水县| 巴里| 合水县| 辰溪县| 楚雄市| 孝感市| 博兴县| 溧阳市| 永安市| 呼图壁县| 衡南县| 广水市| 成安县| 望奎县| 儋州市| 沙田区| 湟源县| 江口县| 定安县| 西城区| 昌吉市| 洮南市| 响水县| 察雅县| 宜丰县| 萝北县| 延安市| 青浦区| 晋城| 盐亭县| 渭源县| 元朗区| 饶平县|