Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 304248 Details for
Bug 443458
FEAT: Match the new db schema of bz3.0 [TABLE attachments]
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch Improve:
attachment.patch (text/plain), 11.21 KB, created by
XINSUN
on 2008-04-30 15:31:47 UTC
(
hide
)
Description:
Patch Improve:
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-04-30 15:31:47 UTC
Size:
11.21 KB
patch
obsolete
>Index: Bugzilla/Attachment.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/Attachment.pm,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 Attachment.pm >--- Bugzilla/Attachment.pm 16 Nov 2004 16:42:36 -0000 1.1.1.1 >+++ Bugzilla/Attachment.pm 29 Apr 2008 14:36:53 -0000 >@@ -76,10 +76,20 @@ > # Retrieve a list of attachments for this bug and write them into an array > # of hashes in which each hash represents a single attachment. > &::SendSQL(" >- SELECT attach_id, " . Bugzilla::DB::DateFormat('creation_ts', '%Y.%m.%d %H:%i:%s') . ", >- mimetype, description, ispatch, isobsolete, isprivate, >- submitter_id, " . Bugzilla::DB::Length('thedata') . " >- FROM attachments WHERE bug_id = $bugid ORDER BY attach_id >+ SELECT attachments.attach_id, " >+ . Bugzilla::DB::DateFormat('attachments.creation_ts', '%Y.%m.%d %H:%i:%s') . ", >+ attachments.mimetype, >+ attachments.description, >+ attachments.ispatch, >+ attachments.isobsolete, >+ attachments.isprivate, >+ attachments.submitter_id, " >+ . Bugzilla::DB::Length('attach_data.thedata') . " >+ FROM attachments, >+ attach_data >+ WHERE attachments.bug_id = $bugid >+ AND attachments.attach_id = attach_data.id >+ ORDER BY attach_id > "); > my @attachments = (); > while (&::MoreSQLData()) { >Index: attachment.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/attachment.cgi,v >retrieving revision 1.10 >diff -u -r1.10 attachment.cgi >--- attachment.cgi 15 Feb 2008 21:53:11 -0000 1.10 >+++ attachment.cgi 29 Apr 2008 14:36:53 -0000 >@@ -523,7 +523,12 @@ > # Display an attachment. > > # Retrieve the attachment content and its content type from the database. >- my $query="SELECT mimetype, filename, thedata FROM attachments WHERE attach_id = $::FORM{'id'}"; >+ my $query="SELECT attachments.mimetype, >+ attachments.filename, >+ attach_data.thedata >+ FROM attachments,attach_data >+ WHERE attachments.attach_id = attach_data.id >+ AND attachments.attach_id = $::FORM{'id'}"; > $logger->debug("sql query before execution: [ $query ]"); > SendSQL($query); > my ($contenttype, $filename, $thedata) = FetchSQLData(); >@@ -628,7 +633,13 @@ > require File::Temp; > > # Get the patch >- SendSQL("SELECT bug_id, description, ispatch, thedata FROM attachments WHERE attach_id = $id"); >+ SendSQL("SELECT attachments.bug_id, >+ attachments.description, >+ attachments.ispatch, >+ attach_data.thedata >+ FROM attachments,attach_data >+ WHERE attachments.attach_id = attach_data.id >+ AND attach_id = $id"); > my ($bugid, $description, $ispatch, $thedata) = FetchSQLData(); > if (!$ispatch) { > $vars->{'attach_id'} = $id; >@@ -761,7 +772,13 @@ > sub diff > { > # Get patch data >- SendSQL("SELECT bug_id, description, ispatch, thedata FROM attachments WHERE attach_id = $::FORM{'id'}"); >+ SendSQL("SELECT attachments.bug_id, >+ attachments.description, >+ attachments.ispatch, >+ attach_data.thedata >+ FROM attachments,attach_data >+ WHERE attachments.attach_id = attach_data.id >+ AND attach_id = $::FORM{'id'}"); > my ($bugid, $description, $ispatch, $thedata) = FetchSQLData(); > > # If it is not a patch, view normally >@@ -830,10 +847,17 @@ > if (Param("insidergroup") && !(UserInGroup(Param("insidergroup")))) { > $privacy = "AND isprivate < 1 "; > } >- SendSQL("SELECT attach_id, " . Bugzilla::DB::DateFormat('creation_ts', '%Y.%m.%d %H:%i') . ", >- mimetype, description, ispatch, isobsolete, isprivate, " . >- Bugzilla::DB::Length('thedata', 'base64') . " >- FROM attachments WHERE bug_id = $::FORM{'bugid'} $privacy >+ SendSQL("SELECT attachments.attach_id, " >+ . Bugzilla::DB::DateFormat('attachments.creation_ts', '%Y.%m.%d %H:%i') . ", >+ attachments.mimetype, >+ attachments.description, >+ attachments.ispatch, >+ attachments.isobsolete, >+ attachments.isprivate, " . >+ Bugzilla::DB::Length('attach_data.thedata', 'base64') . " >+ FROM attachments, attach_data >+ WHERE attachments.attach_id = attach_data.id >+ AND bug_id = $::FORM{'bugid'} $privacy > ORDER BY attach_id"); > my @attachments; # the attachments array > while (MoreSQLData()) >@@ -942,16 +965,22 @@ > trick_taint($thedata); > > # Insert the attachment into the database. >- my $query="INSERT INTO attachments (bug_id, creation_ts, filename, description, mimetype, ispatch, isprivate, submitter_id, thedata) >- VALUES ($::FORM{'bugid'}, now(), $sqlfilename, $description, $contenttype, $::FORM{'ispatch'}, $isprivate, $::userid, ?)"; >+ my $query="INSERT INTO attachments (bug_id, creation_ts, filename, description, mimetype, ispatch, isprivate, submitter_id) >+ VALUES ($::FORM{'bugid'}, now(), $sqlfilename, $description, $contenttype, $::FORM{'ispatch'}, $isprivate, $::userid)"; > > $logger->debug("sql query before execution: [ $query ]"); >- SendSQL($query, $thedata); >+ SendSQL($query); > $logger->debug("sql query executed"); > > # Retrieve the ID of the newly created attachment record. > SendSQL(Bugzilla::DB::LastKey('attachments', 'attach_id')); > my $attachid = FetchOneColumn(); >+ >+ # Insert thedata related to the new attachment into attach_data table. >+ $query="INSERT INTO attach_data (id,thedata) VALUES ($attachid," . SqlQuote($thedata) . ")"; >+ $logger->debug("sql query before execution: [ $query ]"); >+ SendSQL($query); >+ $logger->debug("sql query executed"); > > # Insert a comment about the new attachment into the database. > my $comment = "Created an attachment (id=$attachid) $filename\n"; >@@ -1064,8 +1092,17 @@ > # Users cannot edit the content of the attachment itself. > > # Retrieve the attachment from the database. >- SendSQL("SELECT description, mimetype, filename, bug_id, ispatch, isobsolete, isprivate, " . Bugzilla::DB::Length('thedata', 'base64') . " >- FROM attachments WHERE attach_id = $::FORM{'id'}"); >+ SendSQL("SELECT attachments.description, >+ attachments.mimetype, >+ attachments.filename, >+ attachments.bug_id, >+ attachments.ispatch, >+ attachments.isobsolete, >+ attachments.isprivate, " >+ . Bugzilla::DB::Length('attach_data.thedata', 'base64') . " >+ FROM attachments,attach_data >+ WHERE attachments.attach_id = attach_data.id >+ AND attach_id = $::FORM{'id'}"); > my ($description, $contenttype, $filename, $bugid, $ispatch, $isobsolete, $isprivate, $datasize) = FetchSQLData(); > > my $displaycontenttype; >@@ -1146,7 +1182,7 @@ > > # Lock database tables in preparation for updating the attachment. > Bugzilla::DB::LockTables( >- "LOCK TABLES attachments WRITE , flags WRITE , " . >+ "LOCK TABLES attachments WRITE , attach_data WRITE , flags WRITE , " . > "flagtypes READ , fielddefs READ , bugs_activity WRITE, " . > "flaginclusions AS i READ, flagexclusions AS e READ, " . > # cc, bug_group_map, user_group_map, and groups are in here so we >Index: process.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/process.cgi,v >retrieving revision 1.28 >diff -u -r1.28 process.cgi >--- process.cgi 29 Feb 2008 11:58:23 -0000 1.28 >+++ process.cgi 29 Apr 2008 14:36:53 -0000 >@@ -1465,7 +1465,7 @@ > "flaginclusions AS i READ, flagexclusions AS e READ, " . > # we need write on attachments so CertifySystem can > # mark the packages private. >- "keyworddefs READ, groups READ, attachments $write, " . >+ "keyworddefs READ, groups READ, attachments $write, attach_data $write," . > "group_control_map AS oldcontrolmap READ, " . > "group_control_map AS newcontrolmap READ, " . > "group_control_map READ, external_bugzilla READ, " . >Index: post.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/post.cgi,v >retrieving revision 1.53 >diff -u -r1.53 post.cgi >--- post.cgi 6 Feb 2008 21:31:40 -0000 1.53 >+++ post.cgi 29 Apr 2008 14:36:53 -0000 >@@ -784,12 +784,22 @@ > $contenttype = SqlQuote($contenttype); > > # Insert the attachment into the database. >- SendSQL("INSERT INTO attachments (bug_id, creation_ts, filename, description, mimetype, ispatch, isprivate, submitter_id, thedata) >- VALUES ($id, now(), $sqlfilename, $description, $contenttype, $ispatch , $isprivate, $::userid, $thedata)"); >+ my $query="INSERT INTO attachments (bug_id, creation_ts, filename, description, mimetype, ispatch, isprivate, submitter_id) >+ VALUES ($id, now(), $sqlfilename, $description, $contenttype, $ispatch , $isprivate, $::userid)"; >+ >+ $logger->debug("sql query before execution: [ $query ]"); >+ SendSQL($query); >+ $logger->debug("sql query executed"); > > # Retrieve the ID of the newly created attachment record. > SendSQL(Bugzilla::DB::LastKey('attachments', 'attach_id')); > $attachid = FetchOneColumn(); >+ >+ # Insert thedata related to the new attachment into attach_data table. >+ $query="INSERT INTO attach_data (id,thedata) VALUES ($attachid,$thedata)"; >+ $logger->debug("sql query before execution: [ $query ]"); >+ SendSQL($query); >+ $logger->debug("sql query executed"); > > } > > >Index: quicksearch.js >=================================================================== >RCS file: /cvs/qa/hwcert/quicksearch.js,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 quicksearch.js >--- quicksearch.js 16 Nov 2004 16:42:36 -0000 1.1.1.1 >+++ quicksearch.js 30 Apr 2008 15:25:26 -0000 >@@ -151,8 +151,8 @@ > add_mapping("attachment", "attachments.description"); > add_mapping("attachmentdesc", "attachments.description"); > add_mapping("attachdesc", "attachments.description"); >-add_mapping("attachmentdata", "attachments.thedata"); >-add_mapping("attachdata", "attachments.thedata"); >+add_mapping("attachmentdata", "attach_data.thedata"); >+add_mapping("attachdata", "attach_data.thedata"); > add_mapping("attachmentmimetype", "attachments.mimetype"); > add_mapping("attachmimetype", "attachments.mimetype"); > >Index: quicksearchhack.html >=================================================================== >RCS file: /cvs/qa/hwcert/quicksearchhack.html,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 quicksearchhack.html >--- quicksearchhack.html 16 Nov 2004 16:42:36 -0000 1.1.1.1 >+++ quicksearchhack.html 30 Apr 2008 15:25:26 -0000 >@@ -233,7 +233,7 @@ > <td> </td> > <td><tt>attachmentdata</tt></td> > <td><tt>attachdata</tt></td> >- <td>Attachment Data <i>("attachments.thedata")</i></td> >+ <td>Attachment Data <i>("attach_data.thedata")</i></td> > </tr> > <tr> > <td> </td>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 443458
:
303412
|
304124
| 304248