[MDEV-9421] LOAD DATA LOCAL INFILE with 64-bit libmysql.dll will have error 1148 Created: 2016-01-15 Updated: 2016-01-20 Resolved: 2016-01-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Update, Platform Windows |
| Affects Version/s: | 10.1.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Nick Au | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | delphi | ||
| Environment: |
Windows 8.1 64-bit, any software using 64-bit libmysql.dll |
||
| Attachments: |
|
| Description |
|
the libmysql.dll is downloaded from Using this dll to connect to MariaDB, and set
then execute any LOAD DATA LOCAL INFILE query will have error "1148 - The used command is not allowed with this MariaDB version" PS. 32-bit version libmysql.dll is working fine |
| Comments |
| Comment by Elena Stepanova [ 2016-01-16 ] | |||||||||||||||||||||||||||||||||||
|
Works fine for me. My test is below.
If it connects to a server with default local_infile server-side value, which is ON, it correctly complains about the missing data file etc. If I set local_infile=OFF on the server, or if I change the value of opt_local_infile to 0 in the test, then I get the error that you mentioned, which is expected. Please provide a test which allows to reproduce the problem on your side. | |||||||||||||||||||||||||||||||||||
| Comment by Nick Au [ 2016-01-18 ] | |||||||||||||||||||||||||||||||||||
|
Attached a small test. If using the libmysql.dll from mariadb-10.1.10-winx64, will have error "The used command is not allowed with this MySQL version". If replace the libmysql.dll with mysql-5.6.28-winx64 one, will complains about missing dmp file as expected. | |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-01-18 ] | |||||||||||||||||||||||||||||||||||
|
Please provide the source code. | |||||||||||||||||||||||||||||||||||
| Comment by Nick Au [ 2016-01-19 ] | |||||||||||||||||||||||||||||||||||
|
Attached the source code. It is Delphi. | |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-01-19 ] | |||||||||||||||||||||||||||||||||||
|
Thank you. While experimenting with your code, I encountered very confusing results First of all, the problem is reproducible as you described with the exact provided code – the query gets rejected on the reason that LOCAL INFILE is not allowed, with different MariaDB libraries (I tried 10.1 and 10.0, binary distribution and source builds), while it works all right with MySQL library you included into the archive. But then it gets weird. Issue 1 If you set LocalInfile := 0 instead of 1 in line 74, with otherwise the very same code, the problem gets reversed. Now, MariaDB library behaves correctly and the query gets rejected, while with MySQL library the value is ignored, and the query is still allowed. Issue 2 Restore the initial code, so LocalInfile := 1;.
while leaving everything else as is, it works fine with both MariaDB and MySQL libraries – in both cases the query is allowed. Issue 3 Restore the initial code, no extra symbols.
then again, it works correctly with both libraries – the query is allowed. Now, I don't know what magic there is behind this TMemo thing, maybe you'll tell us – I tried to get rid of it altogether and wasn't able to, – but it seems strange that the library behavior depends on it, it seems more likely that something already goes wrong by the time when the library is used. Since Delphi is your field, can you check it and confirm or rule it out, so we can proceed? | |||||||||||||||||||||||||||||||||||
| Comment by Nick Au [ 2016-01-20 ] | |||||||||||||||||||||||||||||||||||
|
Yes, you are right. The problem is... the enum mysql_option in Delphi is defined as 2 bytes (should be 4 bytes). |