BLOB Fields over 1MB

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GHill
Posts: 12
Joined: Thu 02 Jun 2005 14:19

BLOB Fields over 1MB

Post by GHill » Tue 09 May 2006 18:42

I am using Delphi7 and MyDAC 4.30.0.12 14.04.06 to store sound files in a LONGBLOB field. The code is below:
--------------------------------------------------------------------------
q := 'insert into tblsound (dtbegintime,dtendtime,szsector,sFacid,blobsound) ';
q := q + 'VALUES ';
q := q + '(:pdtbegintime,:pdtendtime,:pszsector,:psFacid,:pblobsound) ';
newsoundcommand.SQL.Text := q;
newsoundcommand.ParamByName('psFacid').Asstring := lfacEdit.text;
newsoundcommand.ParamByName('pszsector').Asstring := sectorcombobox1.text;
newsoundcommand.ParamByName('pdtbegintime').Asdatetime := G_StartTime;
newsoundcommand.ParamByName('pdtendtime').Asdatetime := G_EndTime;
newsoundcommand.ParamByName('pblobsound').DataType := ftBlob;
newsoundcommand.ParamByName('pblobsound').LoadFromfile(Mypath + '7Minutes.wma', ftBlob);
newsoundcommand.Execute;

--------------------------------------------------------------------
The 7Minutes.wma file is just over a 1Meg.

This code will Immediatly generate a error EMYSQLException ..."Lost Connection to Mysql server during query".... Socket Error on Write...WASGetLastError Return 10054....

I can use the same code with the file 6Minutes.wma (about 900K) and it works fine.

This code runs after the MySQLConnection is made.

I have set the MAX_ALLOWED_PACKET to 1GB in the MySQL Server and it still does not help


I sure could use some help on this

Thanks

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Tue 09 May 2006 21:32

I don't know if MAX_ALLOWED_PACKET 1GB is a valid value, but i'm sure with MAX_ALLOWED_PACKET = 16MB will work.

Bernhard Geyer
Posts: 20
Joined: Fri 30 Sep 2005 14:13

Re: BLOB Fields over 1MB

Post by Bernhard Geyer » Fri 12 May 2006 06:38

GHill wrote:I have set the MAX_ALLOWED_PACKET to 1GB in the MySQL Server and it still does not help
Have you checked this parameter if MySQL uses this value (SHOW VARIABLES)?

Post Reply