更新text字段時出現Row size too large報錯應付措施建
導讀:1建站知識起因: 團購開發報告說更新時出錯。 更新SQL如下: 復制代碼 代碼如下: UPDATE table_name d SET d.column_name=aaaa建設網站企業網站建設。
起因:
團購開發報告說更新時出錯。
更新SQL如下:
復制代碼 代碼如下:
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
建設網站公司
疑惑:&網站推廣優化seonbsp;
更新字段只涉及 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中優化了報錯提示。相關建設網站企業網站建設。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-24 ,文章更新text字段時出現Row size too large報錯應付措施建主要講述報錯,字段,更新text字段時出現Row size too網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_6274.html