Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传大文件直接报错 #3

Open
0ps opened this issue Mar 19, 2020 · 2 comments
Open

上传大文件直接报错 #3

0ps opened this issue Mar 19, 2020 · 2 comments

Comments

@0ps
Copy link

0ps commented Mar 19, 2020

比如我上传一个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{}

@BitInit
Copy link
Owner

BitInit commented Mar 25, 2020

分块上传的时候,数据库里面文件大小字段是设置的int类型,占4字节,即2^31 - 1,所以只能文件最大只能是2G左右,最简单的方法是把web/java/resources/META-INFO下的两个sql文件里面的size字段改为 bigint 类型。

后面做功能更新提交代码的时候我会把该bug修复。

@0ps
Copy link
Author

0ps commented Mar 29, 2020

期待下一个版本,你方便在下一个版本稍微适应一下手机吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants