fix for bug 3091008: special case for DB2 SQL statement
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7928 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
8dd55fccbe
commit
c760a04d27
@ -1756,7 +1756,12 @@ sub setAttribsWhere
|
||||
#update the rows
|
||||
for my $col (keys %$elems)
|
||||
{
|
||||
$cols = $cols . $col . " = ?,";
|
||||
my $DBname = xCAT::Utils->get_DBName;
|
||||
if ($DBname =~ /^DB2/) {
|
||||
$cols = $cols . "\"$col\"" . " = ?,";
|
||||
} else {
|
||||
$cols = $cols . $col . " = ?,";
|
||||
}
|
||||
push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col});
|
||||
}
|
||||
chop($cols);
|
||||
|
@ -636,7 +636,16 @@ sub setNodeStatusAttributes {
|
||||
if (@$nodes > 0) {
|
||||
$updates{'status'} = $_;
|
||||
$updates{'statustime'} = $currtime;
|
||||
my $where_clause="node in ('" . join("','", @$nodes) . "')";
|
||||
my $where_clause;
|
||||
my $DBname = xCAT::Utils->get_DBName;
|
||||
if ($DBname =~ /^DB2/) {
|
||||
foreach my $nd (@$nodes) {
|
||||
$where_clause .= "\"node\" LIKE \'$nd\' OR"
|
||||
}
|
||||
$where_clause =~ s/OR$//;
|
||||
} else {
|
||||
$where_clause="node in ('" . join("','", @$nodes) . "')";
|
||||
}
|
||||
$tab->setAttribsWhere($where_clause, \%updates );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user