[MDEV-22306] Support for LOAD DATA FROM/INTO STREAM Created: 2020-04-19 Updated: 2023-12-22 Resolved: 2022-04-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Protocol |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Georg Richter | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
| Comments |
| Comment by Sergei Golubchik [ 2020-04-21 ] | |||||
|
a couple of thoughts:
| |||||
| Comment by Diego Dupin [ 2020-04-24 ] | |||||
|
wlad point out a problem here: in term of protocol, load local data infile is the only command that need more than one 'ping-pong' after connection. Example:
if load local infile is not permit, driver will send 2 COM_QUERY, then wait for the 2 results. This feature is not possible when there is command that must have many exchanges. It would be better to send data with one dedicated command COM_STREAM, and have an OK_Packet or ERR_packet as a result. | |||||
| Comment by Sergei Golubchik [ 2020-08-16 ] | |||||
|
This "load from stream" solves it, because it forces the user to provide the data. This could be a client-side setting, like conn.load_from_stream=1; After that you can always send two COM_QUERY from your example together. If the first will happen to be LOAD DATA LOCAL, the user will get packet out of order no matter whether you wait or not. The correct code could look something like
that is, if the user has provided the data to insert, then you should expect the server asking for it. If the user haven't — you don't. For this to work, as I mentioned above, you should never just send the filename that server asked for. Which is a good security practice too. | |||||
| Comment by Georg Richter [ 2020-09-18 ] | |||||
|
Another idea: COM_PREPARE: “LOAD DATA FROM STREAM ? INTO ……” |