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

The table column content/patch in issue/comment should be longtext #16656

Closed
1 of 4 tasks
wxiaoguang opened this issue Aug 9, 2021 · 5 comments
Closed
1 of 4 tasks

The table column content/patch in issue/comment should be longtext #16656

wxiaoguang opened this issue Aug 9, 2021 · 5 comments
Labels
type/enhancement An improvement of existing functionality

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 9, 2021

  • Gitea version (or commit ref): 1.15.0-rc3
  • Git version: N/A
  • Operating system: N/A
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

When migrating issues with long content, gitea may report error:

2021/08/09 17:53:26 modules/task/task.go:54:handle() [E] Run task failed: Error 1406: Data too long for column 'content' at row 1

Bypass Fix

alter table issue change content content longtext;
alter table `comment` change content content longtext;
alter table `comment` change patch patch longtext;
@wxiaoguang wxiaoguang changed the title The table issue.content should be longtext The table column issue.content should be longtext Aug 9, 2021
@wxiaoguang wxiaoguang changed the title The table column issue.content should be longtext The table column content/patch in issue/comment should be longtext Aug 9, 2021
@a1012112796
Copy link
Member

/cc @lunny

@lunny
Copy link
Member

lunny commented Aug 10, 2021

text column on mysql supports maxium 64K Bytes it seems it enough.

@wxiaoguang
Copy link
Contributor Author

Actually there are many issues in GitHub/GitLab have very long content, eg: issues with detail logs. And we can easily find large content issue in gitea's issue list, eg: https://github.com/go-gitea/gitea/issues/16581#issuecomment-890123001 the size is more than 10KB.

IMO there is no necessary to limit content size. ps: Bill Gates said that "640KB is enough for everyone" 😂

If gitea must have the 64KB limit, it's better to tell users who are migrating repositories the detailed failure reason and which issue causes the failure. Otherwise end users have no knowledge how to deal this the unclear error message and can never complete the migration.

@wxiaoguang
Copy link
Contributor Author

I proposed a PR: #16765

When using TEXT type, only MySQL has 64KB limitation, pgSQL/MSSQL/SQLite don't have such limitation.

I think is good to eliminate the limitation across databases.

@noerw noerw added the type/enhancement An improvement of existing functionality label Aug 23, 2021
@noerw
Copy link
Member

noerw commented Aug 23, 2021

implemented in #16765

@noerw noerw closed this as completed Aug 23, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants