pnd
pnd copied to clipboard
上传大文件直接报错
比如我上传一个iso镜像,2,3个G。直接错误。
Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'total_size' at row 1
The error may exist in site/bitinit/pnd/web/dao/ResourceChunkMapper.xml
The error may involve site.bitinit.pnd.web.dao.ResourceChunkMapper.save-Inline
The error occurred while setting parameters
SQL: INSERT INTO resource_chunk (chunk_number, chunk_size, current_chunk_size, total_size, identifier, filename, relative_path, total_chunks, create_time, update_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'total_size' at row 1
; Data truncation: Out of range value for column 'total_size' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'total_size' at row 1{}
分块上传的时候,数据库里面文件大小字段是设置的int类型,占4字节,即2^31 - 1,所以只能文件最大只能是2G左右,最简单的方法是把web/java/resources/META-INFO下的两个sql文件里面的size字段改为 bigint 类型。
后面做功能更新提交代码的时候我会把该bug修复。
期待下一个版本,你方便在下一个版本稍微适应一下手机吗