From: <sfr...@us...> - 2010-10-07 17:26:04
|
Revision: 758 http://treebase.svn.sourceforge.net/treebase/?rev=758&view=rev Author: sfrgpiel Date: 2010-10-07 17:25:58 +0000 (Thu, 07 Oct 2010) Log Message: ----------- Fixed the code to ensure that all nodes get deleted Modified Paths: -------------- trunk/treebase-core/db/cleaning/2010-10-06_delete_treeblock/delete_treeblock.pl Modified: trunk/treebase-core/db/cleaning/2010-10-06_delete_treeblock/delete_treeblock.pl =================================================================== --- trunk/treebase-core/db/cleaning/2010-10-06_delete_treeblock/delete_treeblock.pl 2010-10-07 01:00:23 UTC (rev 757) +++ trunk/treebase-core/db/cleaning/2010-10-06_delete_treeblock/delete_treeblock.pl 2010-10-07 17:25:58 UTC (rev 758) @@ -56,17 +56,17 @@ print "Lets attempt to do this ". int($totRec/$sets) ." times in sets of $sets records\n"; $statement = "DELETE FROM phylotreenode WHERE phylotree_id IN ( - SELECT phylotree_id FROM phylotree WHERE treeblock_id = ? LIMIT $sets + SELECT phylotree_id FROM phylotree WHERE treeblock_id = ? LIMIT ? )"; my $delete_phylonodes = $dbh->prepare("$statement"); foreach my $cnt (1 .. int($totRec/$sets) ) { - $delete_phylonodes->execute( $treeblock_id ); + $delete_phylonodes->execute( $treeblock_id, $sets ); print "Deletion $cnt for batch of $sets phylotreenode records \n"; } # one more for good measure - $delete_phylonodes->execute( $treeblock_id ); + $delete_phylonodes->execute( $treeblock_id, $totRec ); # taxonlabels are referenced by nodes, matrix rows, taxon blocks *and* submissions # let's remove the connection to submissions. This assumes that there are no matrices This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |