我在mysql错误日志中不断收到以下错误。
2018-05-16T05:00:09.031837Z 624962 [Warning] InnoDB: Cannot add field `jobcontrac14__REPLACEMENT_PERIOD_319` in table `tmp`.`#sql_4c85_0` because after adding it, the row size is 8134 which is greater than maximum allowed size (8126) for a record on index leaf page.
以下是创建表日志和REPLACEMENT_PERIOD列中的数据长度。
此列中的数据长度为最大值8。
问)为什么我仍然得到关于行大小大于允许的最大错误日志?
问)从jobcontrac14__REPLACEMENT_PERIOD_319
,我可以知道它在谈论哪一行吗?所有日志中的文字_14
,_319
和tmp
。#sql_4c85_0
保持不变。
问:我怎么知道哪个查询导致了这个错误?
问)请指出有关如何阅读/理解mysql错误日志的任何文档。
| JOB_CONTRACTS | CREATE TABLE `JOB_CONTRACTS` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`REPLACEMENT_PERIOD` varchar(25) DEFAULT NULL,
`FEE_STRUCTURE` varchar(20) DEFAULT NULL,
`POTENTIAL_BILLING` varchar(20) DEFAULT NULL,
`INVOICE_AFTER_DAYS` varchar(10) DEFAULT NULL,
`OFFERED_COMPENSATION` double DEFAULT NULL,
`FLAT_FEE` varchar(10) DEFAULT NULL,
`JOB_ID` int(11) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `fk_JOB_ID_CONTRACTS_indx` (`JOB_ID`),
CONSTRAINT `fk_JOB_ID_CONTRACT_1` FOREIGN KEY (`JOB_ID`) REFERENCES `JOBS` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=4871 DEFAULT CHARSET=utf8 |
mysql> SELECT COUNT(*), REPLACEMENT_PERIOD, LENGTH(REPLACEMENT_PERIOD) FROM JOB_CONTRACTS GROUP BY REPLACEMENT_PERIOD;
+----------+--------------------+----------------------------+
| COUNT(*) | REPLACEMENT_PERIOD | LENGTH(REPLACEMENT_PERIOD) |
+----------+--------------------+----------------------------+
| 2 | 0 | 1 |
| 2 | 1 year | 6 |
| 249 | 120 | 3 |
| 5 | 120 days | 8 |
| 13 | 15 | 2 |
| 87 | 180 | 3 |
| 28 | 180 days | 8 |
| 127 | 30 | 2 |
| 24 | 30 days | 7 |
| 155 | 45 | 2 |
| 815 | 60 | 2 |
| 33 | 60 days | 7 |
| 5 | 75 | 2 |
| 2483 | 90 | 2 |
| 770 | 90 days | 7 |
| 2 | None | 4 |
| 3 | Other | 5 |
+----------+--------------------+----------------------------+
谢谢!
答案 0 :(得分:0)
您需要切换到MyISAM
引擎以获取临时表(在您的情况下,在group by
执行期间创建)
将此行添加到my.cnf
internal_tmp_disk_storage_engine=MyISAM