[rt-users] 3.6.0rc3/mysql: reinserting image attachments into the DB?

Ole Craig ocraig at stillsecure.com
Thu Jun 8 14:43:45 EDT 2006


On Tue, 2006-06-06 at 23:13 -0700, Joshua Colson wrote:
> > My question: I still have all the emails from which those image
> > attachments were culled. Does anyone have a suggestion for how to
> > reinsert the uncorrupted images into the database in place of the
> > useless blobs currently residing there? (I'm no DBA at the best of
> > times, and I've never needed to work with non-textual data in mysql
> > before; I'm feeling a bit lost...)
> 
> RT does not store attachments as BLOBs. All binary attachments are
> converted to base64 encoding before insertion into the database. 
[...]

        Interesting. Before I'd read your message, I tried the
following:

mysql> update Attachments set Content=LOAD_FILE('/tmp/Outlook.jpg') where id=323;

        ...which seems to have achieved the desired results at least as
far as that particular attachment is concerned. (I.e. it now displays
correctly in the ticket.) I noticed (belatedly) that the type for
Attachments.Content is "longtext" -- does mysql have an autoconversion
feature for binary data that happens to DTRT? Or is RT robust enough to
handle the fact that the DB object is not base64? I don't see any errors
in the RT log pertaining to this...

        Thanks for the SQL, by the way -- since I had less than 10
images in the system, I was going to go the BFMI route for finding the
relevant attachment numbers, but your way is much more elegant.

(BFMI == "Brute force, massive ignorance" :-)
-- 
/Ole Craig
Security Engineer

303-381-3802 (main support hotline)
303-381-3824 (my direct line)
303-381-3801 (fax)

www.stillsecure.com
. . .



More information about the rt-users mailing list