From f5f31fc070588c2075dd13a0fbabe8117e3aad76 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Tue, 5 Apr 2005 04:52:03 +0000 Subject: Bug 286235: Implicit joins should be replaced by explicit joins - installment A Patch By Tomas Kopal r=joel, a=myk --- checksetup.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'checksetup.pl') diff --git a/checksetup.pl b/checksetup.pl index b4f9fb930..c46bcfec9 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -4090,7 +4090,7 @@ if (@admins) { my @groups = (); -$sth = $dbh->prepare("select id from groups"); +$sth = $dbh->prepare("SELECT id FROM groups"); $sth->execute(); while ( my @row = $sth->fetchrow_array() ) { push (@groups, $row[0]); @@ -4099,8 +4099,8 @@ while ( my @row = $sth->fetchrow_array() ) { # Prompt the user for the email address and name of an administrator. Create # that login, if it doesn't exist already, and make it a member of all groups. -$sth = $dbh->prepare("SELECT user_id FROM groups, user_group_map " . - "WHERE name = 'admin' AND id = group_id"); +$sth = $dbh->prepare("SELECT user_id FROM groups INNER JOIN user_group_map " . + "ON id = group_id WHERE name = 'admin'"); $sth->execute; # when we have no admin users, prompt for admin email address and password ... if ($sth->rows == 0) { @@ -4285,9 +4285,9 @@ if ($sth->rows == 0) { # Final checks... $sth = $dbh->prepare("SELECT user_id " . - "FROM groups, user_group_map " . - "WHERE groups.name = 'admin' " . - "AND groups.id = user_group_map.group_id"); + "FROM groups INNER JOIN user_group_map " . + "ON groups.id = user_group_map.group_id " . + "WHERE groups.name = 'admin'"); $sth->execute; my ($adminuid) = $sth->fetchrow_array; if (!$adminuid) { die "No administrator!" } # should never get here -- cgit v1.2.3-24-g4f1b