From 238834c1a3c82574e578e2700d55672632fa4011 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 11 Jan 2011 18:38:06 +0000 Subject: [PATCH] update delEntries routine with delimitcols git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8614 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index a8862d093..1df5f3753 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -2998,7 +2998,6 @@ sub getAllAttribs sub delEntries { my $self = shift; - my $xcatcfg =get_xcatcfg(); if ($dbworkerpid) { return dbc_call($self,'delEntries',@_); } @@ -3033,15 +3032,9 @@ sub delEntries $qstring .= "("; foreach my $keypair (keys %{$keypairs}) { - if ($xcatcfg =~ /^mysql:/) { - $qstring .= q(`) . $keypair . q(`) . " = ? AND "; - } else { - if (($xcatcfg =~ /^DB2:/) || ($xcatcfg =~ /^Pg:/)) { - $qstring .= q(") . $keypair . q(") . " = ? AND "; - } else { # for other dbs - $qstring .= "$keypair = ? AND "; - } - } + # delimit the columns of the table + my $dkeypair= &delimitcol($keypair); + $qstring .= "$dkeypair = ? AND "; push @qargs, $keypairs->{$keypair}; } @@ -3073,15 +3066,8 @@ sub delEntries $delstring .= "("; foreach my $keypair (keys %{$keypairs}) { - if ($xcatcfg =~ /^mysql:/) { - $delstring .= q(`) . $keypair. q(`) . ' = ? AND '; - } else { - if (($xcatcfg =~ /^DB2:/) || ($xcatcfg =~ /^Pg:/)) { - $delstring .= q(") . $keypair. q(") . ' = ? AND '; - } else { # for other dbs - $delstring .= $keypair . ' = ? AND '; - } - } + my $dkeypair= &delimitcol($keypair); + $delstring .= $dkeypair . ' = ? AND '; if (ref($keypairs->{$keypair})) { #XML transformed data may come in mangled unreasonably into listrefs push @stargs, $keypairs->{$keypair}->[0];