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 304130 Details for
Bug 443564
FEAT: Match the new db schema of bz3.0 [#8 TABLE namedqueries]
[?]
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.
[patch]
Patch Improve:
a.patch (text/plain), 14.65 KB, created by
XINSUN
on 2008-04-29 15:29:08 UTC
(
hide
)
Description:
Patch Improve:
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-04-29 15:29:08 UTC
Size:
14.65 KB
patch
obsolete
>Index: Bugzilla.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla.pm,v >retrieving revision 1.2 >diff -u -r1.2 Bugzilla.pm >--- Bugzilla.pm 3 Aug 2007 04:56:46 -0000 1.2 >+++ Bugzilla.pm 30 Jan 2008 10:45:23 -0000 >@@ -31,6 +31,13 @@ > use Bugzilla::DB; > use Bugzilla::Template; > use Bugzilla::User; >+use Bugzilla::RH; # Red Hat Extensions >+use Log::Log4perl; >+use Log::Log4perl::MDC; >+ >+sub logger { Log::Log4perl::get_logger(""); } >+ >+sub log_filename { Log::Log4perl::appender_by_name('LOGFILE')->filename; } > > my $_template; > sub template { >@@ -97,6 +104,11 @@ > # so it needs to be set. > $::COOKIE{'Bugzilla_login'} = $_user->login; > >+ >+ Log::Log4perl::MDC->put( userid => $_user->id ); >+ Log::Log4perl::MDC->put( username => $_user->name ); >+ Log::Log4perl::MDC->put( userlogin => $_user->login ); >+ > } else { > logout_request(); > } >Index: hwcert.pl >=================================================================== >RCS file: /cvs/qa/hwcert/hwcert.pl,v >retrieving revision 1.48 >diff -u -r1.48 hwcert.pl >--- hwcert.pl 21 Sep 2007 14:55:30 -0000 1.48 >+++ hwcert.pl 30 Jan 2008 10:46:12 -0000 >@@ -23,6 +23,7 @@ > > use strict; > >+use Bugzilla; > use Bugzilla::BugMail; > use Bugzilla::Bug; > use Bugzilla::Constants; >@@ -30,6 +31,9 @@ > > use vars qw($template $vars $userid); > >+# Add logger into hwcert. >+my $logger = Bugzilla->logger; >+ > my $logfile = "data/sqllog"; > sub Log { > my $string = shift; >@@ -191,13 +195,26 @@ > $testsref->{$i}{$type}{'sysreport'} = encode_base64($testsref->{$i}{$type}{'sysreport'}); > my $query = "INSERT INTO cert_hardware (test_id, hardware, sysreport) " . > "VALUES ($tid, " . SqlQuote($testsref->{$i}{$type}{'hardware'}) . ", " . SqlQuote($testsref->{$i}{$type}{'sysreport'}) . ")"; >+ >+ #This query will insert the hardware info into cert_hardware.The sysreport,hardware maybe are long,then log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > my $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > } elsif ($testsref->{$i}{$type}{'hardware'}) { > my $query = "INSERT INTO cert_hardware (test_id, hardware) " . > "VALUES ($tid, " . SqlQuote($testsref->{$i}{$type}{'hardware'}) . ")"; >+ >+ #This query will insert the hardware info into cert_hardware.The hardware maybe is long,then log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > my $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); > } > > >@@ -207,13 +224,27 @@ > $testsref->{$i}{$type}{'sound'} = encode_base64($testsref->{$i}{$type}{'sound'}); > my $query = "INSERT INTO cert_runs (test_id, results, test_wav) " . > "VALUES ($tid, " . SqlQuote($testsref->{$i}{$type}{'run'}) . ", " . SqlQuote($testsref->{$i}{$type}{'sound'}) . ")"; >+ >+ #This query will insert the test_run info into cert_runs.The results,test_wav maybe are long,then log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > my $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > } elsif ($testsref->{$i}{$type}{'run'}) { > my $query = "INSERT INTO cert_runs (test_id, results) " . > "VALUES ($tid, " . SqlQuote($testsref->{$i}{$type}{'run'}) . ")"; >+ >+ #This query will insert the test_run info into cert_runs.The results maybe is long,then log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > my $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > } > > # Check for any failures >@@ -250,8 +281,15 @@ > foreach my $run (@{$ref->{'runs'}}) { > my $query = "INSERT INTO cert_runs (test_id, results) " . > "VALUES ($tid, " . SqlQuote($run->{'results'}) . ")"; >+ >+ #This query will insert the test_run info into cert_runs.The results maybe is long,then log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > my $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > } > } > } >Index: list.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/list.cgi,v >retrieving revision 1.23 >diff -u -r1.23 list.cgi >--- list.cgi 13 Sep 2007 17:24:21 -0000 1.23 >+++ list.cgi 30 Jan 2008 10:46:39 -0000 >@@ -63,6 +63,11 @@ > > # Shut up misguided -w warnings about "used only once". For some reason, > # "use vars" chokes on me when I try it here. >+ >+# Add extra logging into hwcert. >+my $logger = Bugzilla->logger; >+$logger->debug("starting"); >+ > sub sillyness { > my $zz; > $zz = $::buffer; >@@ -82,6 +87,9 @@ > > my $cgi = Bugzilla->cgi; > >+#log CGI input parameters. >+$logger->debug("CGI input parameters: $::buffer"); >+ > ################################################################################ > # Data and Security Validation > ################################################################################ >@@ -662,9 +670,10 @@ > $::SIG{TERM} = 'DEFAULT'; > $::SIG{PIPE} = 'DEFAULT'; > >+$logger->debug("sql query before execution: [ $main_query ]"); > # Execute the query. > SendSQL($main_query); >- >+$logger->debug("sql query executed"); > > ################################################################################ > # Results Retrieval >@@ -804,8 +813,10 @@ > my $dbh = Bugzilla->dbh2; > my $query = "SELECT bug_id, upper(status), supported, exception_reason FROM cert_records " . > "WHERE cert_records.bug_id IN (" . join(',',@bugidlist) . ")"; >+ $logger->debug("sql query before execution: [ $query ]"); > my $sth = $dbh->prepare($query); > $sth->execute(); >+ $logger->debug("sql query executed"); > while (my ($bug_id, $status, $supported, $exception) = $sth->fetchrow_array()) { > $cert_records{$bug_id} = { status => $status, supported => $supported, exception => $exception }; > } >@@ -1022,3 +1033,5 @@ > ################################################################################ > > print $cgi->multipart_final() if $serverpush; >+ >+$logger->debug("ending"); >Index: post.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/post.cgi,v >retrieving revision 1.52 >diff -u -r1.52 post.cgi >--- post.cgi 21 Sep 2007 04:12:46 -0000 1.52 >+++ post.cgi 30 Jan 2008 10:47:05 -0000 >@@ -42,6 +42,10 @@ > my $scratchdir = Param("scratchdir"); # "/var/www/bugzilla/hwcert/data/scratch"; > my $tmpdir = Param("tmpdir"); # "/var/www/bugzilla/hwcert/data/tmp"; > >+# Add extra logging into hwcert. >+my $logger = Bugzilla->logger; >+$logger->debug("starting"); >+ > # Shut up misguided -w warnings about "used only once". For some reason, > # "use vars" chokes on me when I try it here. > sub sillyness { >@@ -363,6 +367,7 @@ > print $cgi->header(); > $template->process("bug/create/post_verify.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+ $logger->debug("ending"); > exit; > > } elsif ( $cgi->param('Not_Provided_Pkg') && ! $cgi->param('Not_Provided_Submit') ) { >@@ -424,6 +429,7 @@ > print $cgi->header(); > $template->process("bug/create/post_verify.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+ $logger->debug("ending"); > exit; > } > >@@ -475,6 +481,7 @@ > print $cgi->header(); > $template->process("bug/create/make-template.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+ $logger->debug("ending"); > exit; > } > >@@ -999,3 +1006,4 @@ > > $template->process("bug/create/created.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+$logger->debug("ending"); >Index: process.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/process.cgi,v >retrieving revision 1.25 >diff -u -r1.25 process.cgi >--- process.cgi 5 Nov 2007 21:13:07 -0000 1.25 >+++ process.cgi 30 Jan 2008 10:47:39 -0000 >@@ -60,6 +60,10 @@ > %legal_bug_status > ); > >+# Add extra logging into hwcert. >+my $logger = Bugzilla->logger; >+$logger->debug("starting"); >+ > my $user = Bugzilla->login(LOGIN_REQUIRED); > my $whoid = $user->id; > >@@ -83,6 +87,7 @@ > # named "id_x" where "x" is the bug number. > # For each bug being modified, make sure its ID is a valid bug number > # representing an existing bug that the user is authorized to access. >+ > my @idlist; > if (defined $::FORM{'id'}) { > $vars->{'nav_selected'} = "show"; >@@ -2572,9 +2577,12 @@ > $template->process("bug/process/next.html.tmpl", $vars) > || ThrowTemplateError($template->error()); > >+ $logger->debug("ending"); >+ > exit; > } > > # End the response page. > $template->process("global/footer.html.tmpl", $vars) > || ThrowTemplateError($template->error()); >+$logger->debug("ending"); >Index: show.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/show.cgi,v >retrieving revision 1.14 >diff -u -r1.14 show.cgi >--- show.cgi 4 Sep 2007 20:52:12 -0000 1.14 >+++ show.cgi 30 Jan 2008 10:48:40 -0000 >@@ -37,6 +37,10 @@ > > use Bugzilla::Bug; > >+# Add extra logging into hwcert. >+my $logger = Bugzilla->logger; >+$logger->debug("starting"); >+ > my $cgi = Bugzilla->cgi; > > if ($cgi->param('GoAheadAndLogIn')) { >@@ -57,6 +61,7 @@ > print Bugzilla->cgi->header(); > $template->process("bug/choose.html.tmpl", $vars) || > ThrowTemplateError($template->error()); >+ $logger->debug("ending"); > exit; > } > >@@ -90,6 +95,7 @@ > print Bugzilla->cgi->header(); > $template->process("bug/choose.html.tmpl", $vars) || > ThrowTemplateError($template->error()); >+ $logger->debug("ending"); > exit; > } > @bugs = @new_bug_list; >@@ -215,4 +221,5 @@ > > $template->process("$format->{'template'}", $vars) > || ThrowTemplateError($template->error()); >+$logger->debug("ending"); > >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/Bug.pm,v >retrieving revision 1.32 >diff -u -r1.32 Bug.pm >--- Bugzilla/Bug.pm 20 Sep 2007 20:31:03 -0000 1.32 >+++ Bugzilla/Bug.pm 30 Jan 2008 10:49:30 -0000 >@@ -34,6 +34,7 @@ > > use CGI::Carp qw(fatalsToBrowser); > >+use Bugzilla; > use Bugzilla::Attachment; > use Bugzilla::Config; > use Bugzilla::Constants; >@@ -43,6 +44,10 @@ > use Bugzilla::Util; > use Bugzilla::IssueTrackerList; > >+#Add logger into hwcert. >+my $logger = Bugzilla->logger; >+ >+ > sub fields { > # Keep this ordering in sync with bugzilla.dtd > my @fields = qw(bug_id alias creation_ts short_desc delta_ts >@@ -431,8 +436,15 @@ > $query = "SELECT id, " . > "(CASE WHEN sysreport IS NULL THEN NULL ELSE 1 END) as sysreport " . > "FROM cert_hardware WHERE test_id = $ref->{id} ORDER BY id"; >+ >+ # The sql may select sysreport,log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > while (my @row = $sth->fetchrow_array()) { > my %hwdata; > $hwdata{'id'} = shift @row; >@@ -449,8 +461,14 @@ > $query = "SELECT id, " . > "(CASE WHEN test_wav IS NULL THEN NULL ELSE 1 END) as test_wav " . > "FROM cert_runs WHERE test_id = $ref->{id} ORDER by id"; >+ # The sql may select test_wave,log it. >+ $logger->debug("sql query before execution: [ $query ]"); >+ > $sth = $dbh->prepare($query); > $sth->execute(); >+ >+ $logger->debug("sql query executed"); >+ > while (my @row = $sth->fetchrow_array()) { > my %run; > $run{'id'} = shift @row; >Index: Bugzilla/Constants.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/Constants.pm,v >retrieving revision 1.4 >diff -u -r1.4 Constants.pm >--- Bugzilla/Constants.pm 26 Jul 2007 14:44:49 -0000 1.4 >+++ Bugzilla/Constants.pm 30 Jan 2008 10:50:30 -0000 >@@ -147,4 +147,14 @@ > ENV_MAX => 32, > }; > >+# default log4perl config >+use constant LOG4PERL_DEFAULT_CONFIG => q( >+log4perl.rootLogger=DEBUG, LOGFILE >+log4perl.appender.LOGFILE=Log::Log4perl::Appender::File >+log4perl.appender.LOGFILE.filename=/tmp/bz.log >+log4perl.appender.LOGFILE.mode=append >+log4perl.appender.LOGFILE.layout=PatternLayout >+log4perl.appender.LOGFILE.layout.ConversionPattern=[%d.%r] [%H;%P] [%p] [%X{script}:%X{userid}:%X{username}:%X{userlogin}] [%l] - %m%n >+); >+ > 1; >Index: data/params >=================================================================== >RCS file: /cvs/qa/hwcert/data/params,v >retrieving revision 1.10 >diff -u -r1.10 params >--- data/params 7 Aug 2006 15:46:36 -0000 1.10 >+++ data/params 30 Jan 2008 10:51:45 -0000 >@@ -30,6 +30,8 @@ > 'commentonverify' => 0, > 'confirmuniqueusermatch' => 1, > 'cookiepath' => '/hwcert', >+ 'cookie_expire_days' => '3', >+ 'cookie_secure' => 0, > 'createemailregexp' => '.*', > 'cvsroot' => '', > 'cvsroot_get' => '', >@@ -39,6 +41,7 @@ > 'emailregexp' => '^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$', > 'emailregexpdesc' => 'A legal address must contain exactly one \'@\', and at least one \'.\' after the @.', > 'emailsuffix' => '', >+ 'enablemail' => 0, > 'enablequips' => 'off', > 'external_bugs' => 1, > 'fzdefaultquery' => 'format=ft&product=Feature+Tracker&component=New+Requests&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO&bug_status=MODIFIED', >@@ -46,10 +49,18 @@ > 'issuetracker_urlbase' => 'https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=', > 'languages' => 'en', > 'letsubmitterchoosepriority' => 0, >+ 'log4perl_config' => 'log4perl.rootLogger=DEBUG, LOGFILE >+log4perl.appender.LOGFILE=Log::Log4perl::Appender::File >+log4perl.appender.LOGFILE.filename=/tmp/bz.log >+log4perl.appender.LOGFILE.mode=append >+log4perl.appender.LOGFILE.layout=PatternLayout >+log4perl.appender.LOGFILE.layout.ConversionPattern=[%d.%r] [%H;%P] [%p] [%X{script}:%X{userid}:%X{username}:%X{userlogin}] [%l] - %m%n >+', > 'loginmethod' => 'DB', > 'loginnetmask' => '32', > 'lxr_root' => '', > 'lxr_url' => '', >+ 'mac_secret' => '5384cf6421fa6edd80d4ff3c4180c1435cd34435', > 'maintainer' => 'bugzilla-owner@redhat.com', > 'makeproductgroups' => 0, > 'maxattachmentsize' => '20000',
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 443564
:
303738
|
304100
|
304130