asyncer-io / r2dbc-mysql

Reactive Relational Database Connectivity for MySQL. The official successor to mirromutth/r2dbc-mysql(dev.miku:r2dbc-mysql).
https://r2dbc.io
Apache License 2.0
196 stars 21 forks source link

[feature] Support `LOCAL INFILE` #206

Closed mirromutth closed 8 months ago

mirromutth commented 8 months ago

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

Additional context

See also MySQL and MariaDB docs

It is only supported in text protocol queries.

Reference from: mirromutth/r2dbc-mysql#110