From bc7607c1c4e31b9583a6a772c41567c1b1928e6d Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sat, 27 Aug 2005 06:11:30 +0000 Subject: Bug 305333: Move attachments.thedata to its own table Patch by Joel Peshkin r=lpsolit, a=justdave --- contrib/gnatsparse/gnatsparse.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'contrib/gnatsparse/gnatsparse.py') diff --git a/contrib/gnatsparse/gnatsparse.py b/contrib/gnatsparse/gnatsparse.py index 5f7cde713..b317b240d 100755 --- a/contrib/gnatsparse/gnatsparse.py +++ b/contrib/gnatsparse/gnatsparse.py @@ -451,7 +451,7 @@ class Bugzillabug(object): print >>outfile, " %s, %s, %s, %s);" % (id, who, when, text) for name, data, who in self.attachments: print >>outfile, "\ninsert into attachments (" - print >>outfile, " bug_id, filename, description, mimetype, ispatch, submitter_id, thedata) values (" + print >>outfile, " bug_id, filename, description, mimetype, ispatch, submitter_id) values (" ftype = None # It's *magic*! if name.endswith(".ii") == 1: @@ -463,7 +463,10 @@ class Bugzillabug(object): if ftype is None: ftype = "application/octet-stream" - print >>outfile, "%s,%s,%s, %s,0, %s,%s);" %(self.bug_id, SqlQuote(name), SqlQuote(name), SqlQuote (ftype), who, SqlQuote(zlib.compress(data))) + print >>outfile, "%s,%s,%s, %s,0, %s,%s);" %(self.bug_id, SqlQuote(name), SqlQuote(name), SqlQuote (ftype), who) + print >>outfile, "\ninsert into attach_data (" + print >>outfile, "\n(id, thedata) values (last_insert_id()," + print >>outfile, "%s);" % (SqlQuote(zlib.compress(data))) for newstate, oldstate, fieldid, changedby, changedwhen in self.bug_activity: print >>outfile, "\ninsert into bugs_activity (" print >>outfile, " bug_id, who, bug_when, fieldid, added, removed) values (" -- cgit v1.2.3-24-g4f1b