diff options
author | mkanat%kerio.com <> | 2005-02-19 01:01:47 +0100 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-02-19 01:01:47 +0100 |
commit | 62eecf24480520e204ab0057f8f7845c13f37c13 (patch) | |
tree | 99252665b81610168701173d4b5ce272c378fda6 /attachment.cgi | |
parent | c720bf60573fdb92874056ffd07c3d6055df22af (diff) | |
download | bugzilla-62eecf24480520e204ab0057f8f7845c13f37c13.tar.gz bugzilla-62eecf24480520e204ab0057f8f7845c13f37c13.tar.xz |
Bug 280494: Replace "SELECT LAST_INSERT_ID()" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/attachment.cgi b/attachment.cgi index 5e10d8fee..3522f9e26 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -869,7 +869,8 @@ sub insert my ($data) = @_; # Insert a new attachment into the database. - + my $dbh = Bugzilla->dbh; + # Escape characters in strings that will be used in SQL statements. $filename = SqlQuote($filename); my $description = SqlQuote($::FORM{'description'}); @@ -886,8 +887,7 @@ sub insert VALUES ($::FORM{'bugid'}, $sql_timestamp, $filename, $description, $contenttype, $::FORM{'ispatch'}, $isprivate, $::userid, $thedata)"); # Retrieve the ID of the newly created attachment record. - SendSQL("SELECT LAST_INSERT_ID()"); - my $attachid = FetchOneColumn(); + my $attachid = $dbh->bz_last_key('attachments', 'attach_id'); # Insert a comment about the new attachment into the database. my $comment = "Created an attachment (id=$attachid)\n$::FORM{'description'}\n"; |