Hi,
After more investigation it shows that mysql_send_query() for LOAD
DATA LOCAL INFILE is executed without errors. But, then it blocks
waiting in read_query_result() and finally times out. During the wait,
on the remote server the target table for LOAD DATA LOCAL INFILE is
locked, until the query fails.
I still can't understand why the query is failing when it is executed
from a background thread in MySQL (it does work fine in a small
test-program). If I replace the query by a "normal" insert-statement
in the background, everything works fine. It seems that in the context
of this background thread, it is impossible to use the command LOAD
DATA LOCAL INFILE. The one thing that is different for this query is
that it sends the contents of a file (specified in it's argument) to
the server. It looks like the remote server is waiting for this file,
but it is never coming. And then finally it times out and the query
fails.
Please help!
Andrej