Page 1 of 1
Storing files in Blob Field
Posted: 05.04.2007, 21:52
by waheed
I'm trying to store a 2,737,152 bytes file in a MidiumBlob column. But after loading and then I post the record I get "SQL Error: MySQL Server has gone away." and the record is not saved.
I don't know where it went!!
But really why did it go away?
BTW: I'm able to save size with less that 1M files, even when I change the field to LongBlob it didn't work.
MySQL 5.0.20a
Posted: 08.04.2007, 09:06
by mdaems
Two possibilities I can imagine.
- Mysql bug/incompatibility with your DLL version and server version. Very difficult to find that.
- Something wrong in our blob handling. It's possible we do some wrong function calls when passing the blob's to the dll. Maybe we have to pass smaller parts to the server, or something like that.
I would appreciate if you could make the smallest possible project which causes your server to run away in fear and zip everything together in a bug report on zeosbugs.firmos.at . Please include everything : table create, blob data and project. Don't forget to mention if you are using the dll in the zeos distribution or the one belonging to your server distribution.
Mark
Posted: 09.04.2007, 13:39
by waheed
Solution was simplerer.
MySQL max_allowed_packet variable was set to 1MB. I changed it to 3MB and the problem was solved.
Thanks
Posted: 09.04.2007, 16:54
by mdaems
Waheed,
I'm not a big 'blobber'. Do you think this is the definite solution or could we change our blob handling to take smaller packet size limits into account? eg by checking max_allowed_package size first time a blob is sent to a server?
I suppose your solution implies setting the max_allowed_packet variable to the maximum blob size you expect? Or is it just that the maximum packet size we use is somewhere between 1 and 3 MB?
Mark
Posted: 09.04.2007, 17:02
by waheed
The max_allowed_packet can be any number. But it needs a server restart to be effective.
As for changing your components to handle large packets, I don't know if it would worth the effort, but it would be better.
Thanks