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

[feature] Support LOCAL INFILE #206

Closed
mirromutth opened this issue Jan 19, 2024 · 0 comments · Fixed by #215
Closed

[feature] Support LOCAL INFILE #206

mirromutth opened this issue Jan 19, 2024 · 0 comments · Fixed by #215
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mirromutth
Copy link
Contributor

mirromutth commented Jan 19, 2024

Is your feature request related to a problem? Please describe.

Currently, we have Capability.LOCAL_FILES marked as disabled, and it is not actually supported. The statement like following:

LOAD DATA LOCAL INFILE '/path/to/file' INTO TABLE `my_table`; 

After executing this statement (without error), the database server will immediately request the file content from the driver.

Note: MySQL 8.0+ has @@global.local_infiles disabled for security reasons, so this feature should be disabled by default.

Describe the solution you'd like

  • Add a LocalInfileRequest to package message.server, the header is 0xFB
  • Add a LocalInfileResponse to package message.client, each such message contains a file chunk or an empty chunk (means End-Of-File)
  • Add LOCAL INFILE support in message decoder
  • Add LOCAL INFILE support in QueryFlow, which should send file chunks and an empty chunk after receiving LocalInfileRequest
  • Maybe add an option for specifying the max size of file chunk

Additional context

See also MySQL and MariaDB docs

It is only supported in text protocol queries.

Reference from: mirromutth/r2dbc-mysql#110

@mirromutth mirromutth added the enhancement New feature or request label Jan 19, 2024
@mirromutth mirromutth self-assigned this Jan 19, 2024
@mirromutth mirromutth linked a pull request Jan 23, 2024 that will close this issue
5 tasks
@jchrys jchrys added this to the 1.1.0/0.10.0 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants