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

MySQL | Longtext data type support #1513

Closed
eheredia42 opened this issue Oct 25, 2021 · 4 comments
Closed

MySQL | Longtext data type support #1513

eheredia42 opened this issue Oct 25, 2021 · 4 comments
Labels
bug db:mysql Related to MySQL

Comments

@eheredia42
Copy link

Is MysQL longtext data type support planned?

@eheredia42
Copy link
Author

MySQL provides four TEXT types: TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT.

  • TINYTEXT = 255 characters
  • TEXT = 64kB (65,535 characters)
  • MEDIUMTEXT = 16MB (16,777,215 characters)
  • LONGTEXT = 4GB (4,294,967,295 characters)

sqlx fails when trying to read a LONGTEXT field with more than 16 MB of content.

@abonander
Copy link
Collaborator

@eheredia42 what is the error you get when trying to decode more than 16 MB of content? It's likely a bug as LONGTEXT should already be supported.

@abonander
Copy link
Collaborator

Also, what version of MySQL are you using?

@abonander abonander added bug db:mysql Related to MySQL labels Nov 9, 2021
@abonander
Copy link
Collaborator

Ah, this is not a LONGTEXT bug. This is because we don't currently handle split packets: https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html

This is unfortunately a duplicate of #189 which is a very old issue. We might get to it at some point.

I suggest avoiding pulling the full content of the column in one query, or otherwise restructuring your query to split the data across multiple rows which should work around the error. It should be possible with a recursive common table expression: https://dev.mysql.com/doc/refman/8.0/en/with.html#common-table-expressions-recursive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug db:mysql Related to MySQL
Projects
None yet
Development

No branches or pull requests

2 participants