Skip to content

Implement COM_STMT_SEND_LONG_DATA #1579

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

Merged
merged 16 commits into from
Jul 22, 2025
Merged

Conversation

djeman
Copy link
Contributor

@djeman djeman commented Jul 18, 2025

Hi,

I work for a company that has very old software running on 32-bit systems, which stores documents in a MySQL database as BLOBs. In this context, which we are trying to evolve but it takes time, we are facing the memory limit available for an x86 process when storing large documents.

To address this issue with the latest unupdated software, we have tried your implementation of the COM_STMT_SEND_LONG_DATA command for using streams and avoiding memory overload. After several months of testing, we can confirm that it works as intended; memory is no longer impacted by the size of the documents.

Would it be possible to integrate this into your project?

@bgrainger
Copy link
Member

Relates to #943.

@bgrainger
Copy link
Member

Related to this comment: #943 (comment)

memory is no longer impacted by the size of the documents

How do you retrieve these BLOB columns from the MySQL server?

@djeman
Copy link
Contributor Author

djeman commented Jul 18, 2025

To retrieve the blob I use MySqlDataReader.GetStream inside a loop with a substring request.
$"SELECT SUBSTRING({column},@begin,@size) FROM {basename}.{tablename} WHERE {rubrique}=@id"

I will make the suggested changes, thank you for your promptness.

Signed-off-by: Bradley Grainger <[email protected]>
Signed-off-by: Bradley Grainger <[email protected]>
This will let us test if the blob is stored and retrieved exactly as-is.

Signed-off-by: Bradley Grainger <[email protected]>
It just writes "IntegrationTests.ChunkStream" to the column.

Signed-off-by: Bradley Grainger <[email protected]>
@bgrainger bgrainger merged commit fd8fb0f into mysql-net:master Jul 22, 2025
23 checks passed
@djeman
Copy link
Contributor Author

djeman commented Jul 23, 2025

Wow it's impressive, thanks for all.
I will put the new version on my development branch to try it.

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

Successfully merging this pull request may close these issues.

2 participants