Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 296972 Details for
Bug 431957
Bugzilla data cleanup - bugs.resolution data cleanup
[?]
New
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.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
cleanup_resolution.pl (text/plain), 2.33 KB, created by
Tony Fu
on 2008-03-06 01:11:33 UTC
(
hide
)
Description:
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
Filename:
MIME Type:
Creator:
Tony Fu
Created:
2008-03-06 01:11:33 UTC
Size:
2.33 KB
patch
obsolete
>#!/usr/bin/env perl >use strict; >use warnings; > >################################################################################ ># script: cleanup_resolution.pl ># purpose: some bugs still have "FIXED" as the value of bugs.resolution, but ># "FIXED" is an obsolete resolution value ># This script maps "FIXED" to a valid resolution value- "CURRENTRELEASE", ># and update bugs_activity table to record this change. >################################################################################ > >use DBI; >use Carp; > >my $OLD_RESOLUTION = "FIXED"; >my $NEW_RESOLUTION = "CURRENTRELEASE"; > >############################################### ># variables of accessing pg db >############################################### > >my $user = 'bugs'; >my $pass = ''; >my $host = 'localhost'; >my $dsn = "dbi:mysql:dbname=bugs;host=$host"; > >my $dbh > = DBI->connect( $dsn, $user, $pass, { RaiseError => 1, PrintError => 0 } ) > or croak "Couldn't connect database: " . DBI->errstr; > ># bug_activity prepartion 1: ># get Admin User profiles.userid. Used in writing bug_activity >my $login_name = $dbh->quote('bugzilla@redhat.com'); >my $admin_user_id = $dbh->selectall_arrayref( > "SELECT userid > FROM profiles > WHERE login_name = $login_name" >)->[0][0]; > ># bug_activity prepartion 2: ># get RESOLUTION's fieldid in fielddefs table >my $field_id = $dbh->selectall_arrayref( > "SELECT id > FROM fielddefs > WHERE name='resolution'" >)->[0][0]; > >#get bug_id of the bugs whose resolution is "FIXED"; >my $sth = $dbh->prepare( > "SELECT bug_id FROM bugs WHERE resolution='$OLD_RESOLUTION'"); >$sth->execute(); >while ( my $bug_id = $sth->fetchrow_array() ) { > > #change resolution "FIXED" to "CURRENTLEASE" > $dbh->do( > "UPDATE bugs SET resolution='$NEW_RESOLUTION' WHERE bug_id=$bug_id" ); > > #update bugs_activity table > $dbh->do( > "INSERT INTO bugs_activity (who, > bug_when, > fieldid, > added, > removed, > bug_id) > VALUES ( $admin_user_id, > NOW(), > $field_id, > '$NEW_RESOLUTION', > '$OLD_RESOLUTION', > $bug_id )" > ); > >} >
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 Raw
Actions:
View
Attachments on
bug 431957
:
294298
|
296857
|
296972
|
297027