>>>>> "Gerrit" == Gerrit Hiddink <hiddinkg@stripped> writes:
Gerrit> sinisa@stripped wrote:
>> > >> mysql> insert into blobs values (1,
>> > >> mysql> select a_blob from blobs where id=1 into outfile
>> You can not do it that way.
>> Instead of doing that, you must make a small app that will fetch mpeg
>> into memory and then simply write it in it's binary form on disk.
Gerrit> In that case I'd like to suggest adding a function that does precisely
Gerrit> the opposite of load_file, eg. dump_file, that allows me to load
Gerrit> and dump blobs at will. If MySQL supports loading blobs from file into
Gerrit> a table, then it should also support dumping them from a table back
Gerrit> into a file. Unmodified. A user simply expects these kind of things to
Gerrit> be symmetrical. At least, I did.
Gerrit> The advantage of dumping it into a file is that the blob (typically
Gerrit> can be written in, for example, a WWW server's directory, so that it is
Gerrit> ready to be served on the WWW. If I have to extract it via a client
Gerrit> then the blob gets copied from the database into a socket, gets copied
Gerrit> from the socket buffer into the client buffer, then into my own buffer,
Gerrit> and then gets copied into a file. That's a lot of copies, reducing
Gerrit> performance dramatically if the blobs are really large.
Gerrit> I've seen other DBMS'es that supported blobs, and I think MySQL is
Gerrit> getting there, slowly. But it still needs some more support for blobs.
Gerrit> That's just my humble opinion.
I shall add this to our TODO.
PS: Sinisa, can you take a look at DUMP_FILE(), while I am away...