From f473040ca5cff9de58dc93cea684a2246b2ff114 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 6 Apr 2010 13:34:11 +0000 Subject: [PATCH] add support for DB2 in Where clause git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5684 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tabutils.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index f8afbfa42..cc8935c17 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -722,12 +722,19 @@ sub tabprune_recid { my $cb = shift; my $recid = shift; my $rc=0; + # check which database so can build the correct Where clause + my $DBname = xCAT::Utils->get_DBName; my $tab = xCAT::Table->new($table, -create => 1, -autocommit => 0); unless ($tab) { $cb->({error => "Unable to open $table",errorcode=>4}); return 1; } - my @ents=$tab->getAllAttribsWhere("recid<$recid", 'recid'); + my @ents; + if ($DBname =~ /^DB2/) { + @ents=$tab->getAllAttribsWhere("\"recid\"<$recid", 'recid'); + } else { + @ents=$tab->getAllAttribsWhere("recid<$recid", 'recid'); + } foreach my $rid (@ents) { $tab->delEntries($rid); }