web/modules/rhn/RHN/DB/SatInstall.pm | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
New commits:
commit 5961a136300b6dfd7390fa4117b97181b73728a4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 5 16:20:04 2010 +0200
Instead of checking user_objects which is not portable, just attempt to select from
PXTSESSIONS directly.
diff --git a/web/modules/rhn/RHN/DB/SatInstall.pm b/web/modules/rhn/RHN/DB/SatInstall.pm
index 05cdb66..e65f789 100644
--- a/web/modules/rhn/RHN/DB/SatInstall.pm
+++ b/web/modules/rhn/RHN/DB/SatInstall.pm
@@ -37,17 +37,17 @@ sub test_db_schema {
my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
+ return eval {
+ my $sth = $dbh->prepare(<<EOQ) or return;
SELECT 1
- FROM user_objects
- WHERE object_name = 'PXTSESSIONS'
+ FROM PXTSESSIONS
+ WHERE 1 = 0
EOQ
- $sth->execute;
- my ($row) = $sth->fetchrow;
+ $sth->execute() or return;
$sth->finish;
-
- return $row ? 1 : 0;
+ return 1;
+ };
}
sub get_nls_database_parameters {
commit 8ba1710040c03632580b1e1cb17a5f8f47550881
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 5 15:14:37 2010 +0200
We first check if there is some object not named PLAN_TABLE, and then if there is some
object named PXTSESSIONS. Just drop the first check.
diff --git a/web/modules/rhn/RHN/DB/SatInstall.pm b/web/modules/rhn/RHN/DB/SatInstall.pm
index fc1deec..05cdb66 100644
--- a/web/modules/rhn/RHN/DB/SatInstall.pm
+++ b/web/modules/rhn/RHN/DB/SatInstall.pm
@@ -38,25 +38,13 @@ sub test_db_schema {
my $dbh = RHN::DB->connect;
my $sth = $dbh->prepare(<<EOQ);
-SELECT object_name
- FROM user_objects
- WHERE NOT object_name = 'PLAN_TABLE'
-EOQ
-
- $sth->execute;
- my ($row) = $sth->fetchrow;
- $sth->finish;
-
- return 0 unless $row;
-
- $sth = $dbh->prepare(<<EOQ);
SELECT 1
FROM user_objects
WHERE object_name = 'PXTSESSIONS'
EOQ
$sth->execute;
- ($row) = $sth->fetchrow;
+ my ($row) = $sth->fetchrow;
$sth->finish;
return $row ? 1 : 0;
Show replies by date