I would like to execute a command like this :
Code: Select all
LOAD DATA LOCAL INFILE "//localhost/pipe/pipename" INTO TABLE test FIELDS TERMINATED BY ";" ENCLOSED BY '"' LINES TERMINATED BY "\r\n";Unfortunately, this does not work with MyDAC, because the code will ask the file size and the operating system will return 0 for a pipe... So the file is immediately closed and the server will return an error code.
This command works like a charm with the "mysql.exe" console program.
Could you modify the code so that MyDAC components could execute "LOAD DATA LOCAL INFILE" with pipes ?
Info: in the file MySqlSession.pas we can find the method TMySqlSession.ReadQueryResult
and the following code:
Code: Select all
c := f.Size;  // will return 0 for named pipes
while c > 0 do begin
  r := Min(c, Length(buf));
  f.ReadBuffer(buf[0], r);
  net.WriteBytes(buf, 0, r);
  net.Send;
  Dec(c, r);
end;
Code: Select all
c := f.ReadBuffer(buf[0], Length(buf));
while c > 0 do begin
  net.WriteBytes(buf, 0, c);
  net.Send;
  c := f.ReadBuffer(buf[0], Length(buf));
end;