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 297560 Details for
Bug 435667
Bugzilla data cleanup - bugs.rep_platform 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.
change bugs.rep_platform's value from "PC" to "i386"
cleanup_rep_platform.pl (text/plainc), 2.43 KB, created by
Tony Fu
on 2008-03-11 05:14:59 UTC
(
hide
)
Description:
change bugs.rep_platform's value from "PC" to "i386"
Filename:
MIME Type:
Creator:
Tony Fu
Created:
2008-03-11 05:14:59 UTC
Size:
2.43 KB
patch
obsolete
>#!/usr/bin/env perl >use strict; >use warnings; > >################################################################################ ># script: cleanup_rep_platform.pl ># purpose: some bugs' rep_platform value is "PC", which is not a valid name ># in rep_platform table. ># This script change these bugs' rep_platform value to "i386" ># and update bugs_activity table accordingly. >################################################################################ > >use DBI; >use Carp; > > >############################################## ># variables of rep_platform values >############################################## >my $OLD_REP_PLATFORM = 'PC'; >my $NEW_REP_PLATFORM = 'i386'; > >############################################### ># 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 rep_platform's fieldid in fielddefs table >my $field_id = $dbh->selectall_arrayref( > "SELECT fieldid > FROM fielddefs > WHERE name='rep_platform'" >)->[0][0]; > >#get bug_id of the bugs whose rep_platform value is "PC" >my $sth = $dbh->prepare( >"SELECT bug_id FROM bugs > WHERE rep_platform='$OLD_REP_PLATFORM'"); >$sth->execute(); > >while ( my $bug_id = $sth->fetchrow_array() ) { > > #change rep_platform value to 'i386' > $dbh->do( > "UPDATE bugs SET rep_platform='$NEW_REP_PLATFORM' 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_REP_PLATFORM', > '$OLD_REP_PLATFORM', > $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
Flags:
dkl
: review+
Actions:
View
Attachments on
bug 435667
: 297560