EMySQLException: "ReceiveHeader: Net packets out of order: received[6], expected[1]".

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Perry
Posts: 7
Joined: Mon 20 Feb 2006 20:17
Location: California

EMySQLException: "ReceiveHeader: Net packets out of order: received[6], expected[1]".

Post by Perry » Mon 20 Feb 2006 22:15

I get an error when opening a Stored Procedure that returns a result set. The error only happens on second call to Open(). This happens when I "do the right thing" by calling Prepare() first. The help file specifically says I'll get faster execution by calling Prepare() myself (which seems really odd to me because Stored Procedures are already prepared on the Server side). If I don't call Prepare() then I get no error, but then I am really being nagged inside my head that I am yielding a slower execution. Here's the error returned:

EMySQLException: "ReceiveHeader: Net packets out of order: received[6], expected[1]"

My question is... is MyDAC the only client library that requires the programmer to call Prepare() for speedier Stored Procedure executions or is this help file in error? I am an extreme performance junkie. To the extreme. If there is a faster way to execute something then by golly, I'm going to opt for that routine. At this point though, I am thinking that Prepare() is irrelevent to Stored Procedures, plus help file is in error, plus actually calling Prepare() exposes a bug. But not sure about this.

Anyone with some experience on this?

Thanks,

Perry

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 21 Feb 2006 13:36

Please specify some details:
- what component do you use for executing stored procedures (MyStoredProc, MyQuery etc);
- what version of MyDAC do you use. You can see it in About sheet of TMyConnection Editor;
- does the behaviour change when you change Direct option of MyConnection;
- when the error happens (when you call Prepare, Execute, etc);
- MySQL Server version.

Perry
Posts: 7
Joined: Mon 20 Feb 2006 20:17
Location: California

Post by Perry » Tue 21 Feb 2006 18:50

Antaeus wrote:Please specify some details:
- what component do you use for executing stored procedures (MyStoredProc, MyQuery etc);
- what version of MyDAC do you use. You can see it in About sheet of TMyConnection Editor;
- does the behaviour change when you change Direct option of MyConnection;
- when the error happens (when you call Prepare, Execute, etc);
- MySQL Server version.
Hi Antaeus,

I used TMyStoredProc to open procedure.

Version of MyDAC is.. 4.3.0.10 trial for Delphi 6

Regarding "Direct" option, I don't know.. I did not save my source code of problem. I would have to recreate it to tell you, but this is simple for you to do too. I know there is a problem with calling Prepare. So I will now stay away from calling Prepare in the future. Help file must be in error (why would someone need to Prepare a stored procedure using a stored procedure component? What exactly IS there to prepare? Nothing! It is already prepared on server, right?), and calling Prepare with TMyStoredProc exposes a bug somewhere in inherited class which probably is same class as for TMyQuery. So I don't do this now. But Help file should note this, and it doesn't, or.. perhaps you override TMyStoredProc.Prepare and have it do nothing instead of call Inherited Prepare();

MySQL Server version is 5.0.18-nt running on Win2000 Server.


Perry

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 22 Feb 2006 10:14

The stored procedure is prepared on the server. You can check performance of executing procedures before and after preparation. But you should remember that calling Prepare method forces additional roundtrip to server. Every user should decide himself about using preparation.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 22 Feb 2006 14:06

We checked the problem. It's source is MySQL protocol bug. As result you can't use Prepare for Stored Procedures that return resultsets.

Post Reply