From de8dce11f1838ef4fbac3157cd3915ceeba5ccbd Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Mon, 25 Aug 2008 23:34:47 +0000 Subject: [PATCH] Fixed a couple of Postgres issues git-svn-id: svn://10.0.0.236/trunk@253832 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm | 6 ++++++ mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm | 2 +- .../testopia/extensions/testopia/code/install-update_db.pl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index 793c58d6bb3..68987d1da3b 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -1642,10 +1642,16 @@ sub init { my $query; if ($self->{'fields'}){ $query = "SELECT $distinct". join(",", @{$self->{'fields'}}); + foreach my $qfield (@{$self->{'fields'}}){ + push @groupby, $qfield unless $qfield == '42217354'; + } } else { $query = "SELECT $distinct test_". $obj ."s.". $obj. "_id"; } + if (scalar @orderby){ + $query .= ',' . join(',', @orderby); + } $query .= " FROM $suppstring"; $query .= " WHERE " . join(' AND ', (@wherepart, @andlist)); if ($obj eq 'case_run' && $cgi->param('addcases')){ diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index 7542b531275..364bca7e66f 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -302,7 +302,7 @@ sub _check_alias { sub _check_time{ my ($invocant, $time) = @_; $time = trim($time); - return 0 unless $time; + return '0:0:0' unless $time; $time =~ m/^(\d+)[:\s](\d+)[:\s](\d+)$/; ThrowUserError('testopia-format-error', {'field' => 'Estimated Time' }) unless (defined $1 && defined $2 && $2 < 60 && defined $3 && $3 < 60); diff --git a/mozilla/webtools/testopia/extensions/testopia/code/install-update_db.pl b/mozilla/webtools/testopia/extensions/testopia/code/install-update_db.pl index 3638f309d9f..5bf0f121348 100644 --- a/mozilla/webtools/testopia/extensions/testopia/code/install-update_db.pl +++ b/mozilla/webtools/testopia/extensions/testopia/code/install-update_db.pl @@ -319,7 +319,7 @@ sub populateMiscTables { $dbh->do("INSERT INTO test_fielddefs (name, description, table_name) VALUES ('target_completion', 'Target Completion Rate', 'test_runs')") if ! $dbh->selectrow_array("SELECT COUNT(*) FROM test_fielddefs WHERE name = ?", undef, 'target_completion'); - return if $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_run_status"); + return if $dbh->selectrow_array("SELECT COUNT(*) FROM test_case_status"); print "Populating test_case_run_status table ...\n"; print "Populating test_case_status table ...\n";