mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	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
This commit is contained in:
		@@ -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);
 | 
			
		||||
   } 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user