Malformed Packet error

Xojo 2017 R1.1 (and earlier versions)
MySQL 5.7.18 Community Server running on Windows Server 2012R2.

I get database error 2027 Malformed Packet frequently. Not every query, but most. Sometimes a slight change to the query (like adding WHERE 1=1) makes the problem go away temporarily.

Works OK on Windows, seems like a Mac only issue.

I’m baffled, appreciate any suggestions.

Have you checked the usual suspects for that error? Could be an encoding issue, or some other specific config issue.

If none of the standard suggestions you can find by searching the error on google help, the next thing I would do is probably fire up wireshark or a similar tool and take a look at some packets. If you capture on the server side you should be able to get a set of packets from both platforms and compare.

Problem solved, but the solution doesn’t make much sense. So I’m posting what I did, maybe it will help someone in the future.

I commented out the following from my code:

db.Host = ConnectInfo(1)
db.Port = Val(ConnectInfo(2))
db.Username = ConnectInfo(3)
db.Password = ConnectInfo(4)
db.DatabaseName = ConnectInfo(5)

Note: db is MySQLCommunityServer, ConnectInfo is a String() filled by reading a INI file then using Split to “parse” it.

Ran the program, which of course was unhappy without it’s database connection.
Then put the code back in, run again, and now it’s all good.

My best guess: maybe some corruption in the .xojo_binary_project file?