Lost connection on alter table ... create index

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lfelicetti
Posts: 5
Joined: Tue 08 Mar 2005 12:07

Lost connection on alter table ... create index

Post by lfelicetti » Wed 13 Apr 2005 09:23

Hello, i've got a problem with mydac. I'm woking wih big tables and a need to reindex that. I suppose to use an alter table query for delete old index and add new one. MyDAC tell me a Lost Connection during query.

This is my query:
ALTER TABLE `mydb`.`a` DROP INDEX `a`,
ADD INDEX `a`(`a`),
DROP INDEX `b`,
ADD INDEX `b`(`b`),
DROP INDEX `c`,
ADD INDEX `c`(`c`)
, DROP INDEX `d`,
ADD INDEX `d`(`d`);

Rows on mydb.a: 617747

The query on my system takes about 25secs

Delphi 2005 update pack 2
MyDAC 3.50.0.18

Any suggestion?

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

Post by Ikar » Thu 14 Apr 2005 08:56

What value did you assign to CommandTimeout?

lfelicetti
Posts: 5
Joined: Tue 08 Mar 2005 12:07

Command Timeout

Post by lfelicetti » Thu 14 Apr 2005 09:53

the value 9999999

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

Post by Ikar » Thu 14 Apr 2005 11:29

Please try to set TMyConnection.Options.Direct to False.

lfelicetti
Posts: 5
Joined: Tue 08 Mar 2005 12:07

Post by lfelicetti » Thu 14 Apr 2005 15:03

Tried also. Doesn't work.

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

Post by Ikar » Thu 14 Apr 2005 15:28

> Tried also. Doesn't work.

Judging by these tests the error is somewhere in server settings. Try to learn MySQL Reference Manual, chapter A.2 Some Common Errors When Using MySQL (CR_SERVER_LOST)

Post Reply