Closed chulkilee closed 3 years ago
What happens if you pass the query_type: :text option?
MyXQL.query(pid, query, [], query_type: :text)
MyXQL.query(pid, query, [], query_type: :text)
{:error,
%MyXQL.Error{
connection_id: 104,
message: "(1290) (ER_OPTION_PREVENTS_STATEMENT) The MySQL server is running with the --secure-file-priv option so it cannot execute this statement",
mysql: %{code: 1290, name: :ER_OPTION_PREVENTS_STATEMENT},
statement: "LOAD DATA INFILE 'foo.csv' INTO TABLE posts\n FIELDS TERMINATED BY ',' ENCLOSED BY '\"'\n LINES TERMINATED BY '\\r\\n'\n"
}}
Yeah! That works. I'll create a MR to add that info to typespec...
Closing it as it works. LOAD DATA LOCAL
could be separate github issue for tracking..
I tested just
LOAD DATA
- and it failed as myxql is using prepared statement protocol.It fails with following error:
I tried to pass
prepare: :unamed
on start_link or query, but it didn't work, since apparently it still uses prepared statment protocol.Server version: 5.7.31 Homebrew
Also there is
LOAD DATA LOCAL
which requires more work by client side - actually I'm not sure whether that's feasible to implement it though.https://dev.mysql.com/doc/refman/8.0/en/load-data.html
So.. this requires lots of work on client side.
mariaex does not support it - https://github.com/xerions/mariaex/issues/34
Feel free to close it as "won't fix" for now - just trying to make it for the record :)