[MDEV-12782] Malformed packet / LOAD DATA LOCAL / mysql_real_connect Created: 2017-05-11  Updated: 2017-12-16

Status: Open
Project: MariaDB Server
Component/s: Data Manipulation - Insert, Scripts & Clients
Affects Version/s: 10.1.22
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Stuart Belcher Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 10


Attachments: Text File LoadData.txt     File RealConnect.dpr     Text File output.txt    

 Description   

Running with libmysql.dll from packaged 10.1.22.0 win32 distribution.

Using mysql_real_connect twice (example code did this after credentials failure) - documentation does not specify any use conditions around this. All OK until performing LOAD DATA LOCAL INFILE, when the error Malformed Packet is given.

Workaround (or intended use?) is to call mysql_close and mysql_init between calls to mysql_real_connect.



 Comments   
Comment by Elena Stepanova [ 2017-05-13 ]

Could you please provide a full code sample? I don't seem to be able to repeat this.
As I understand, basically the sequence of events is this:

mysql_init
mysql_options // to set MYSQL_OPT_LOCAL_INFILE
mysql_real_connect // with wrong credentials, causes "access denied"
mysql_real_connect // with good credentials
// some mysql_query's (I did DROP TABLE IF EXISTS and CREATE TABLE)
mysql_query // with LOAD DATA LOCAL INFILE -- supposed to return an error -- it does not

Comment by Stuart Belcher [ 2017-05-15 ]

Code sample attached - Delphi rather than C. MySQL client library unit not attached - is just statically linked to the C functions in LibMySQL.dll (the names are mapped - should be obvious which is which).

Calls to functions are:

mysql_init
mysql_real_connect // Bad credentials; Supply CLIENT_LOCAL_FILES flag
mysql_real_connect // Good credentials; Supply CLIENT_LOCAL_FILES flag
// Execute some statements (see project file)
mysql_real_query // with LOAD DATA LOCAL INFILE

Error executing query: Malformed packet user 'foo'@'localhost' (using password: YES) (2)
See output.txt related to having loaded LoadData.txt - looks like the original credentials are being retained somehow.

LoadData.txt output.txt RealConnect.dpr

Comment by Elena Stepanova [ 2017-09-19 ]

alice,
Could you please try to reproduce this?

Generated at Thu Feb 08 08:00:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.