User: sits
Date: 07/02/15 13:41:47
Modified: lib/Codestriker/Model Metrics.pm Topic.pm
Log:
Avoid nested queries so that deleting a topic works on SQL Server.
Index: Metrics.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Metrics.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Metrics.pm 21 Dec 2004 23:02:58 -0000 1.11
+++ Metrics.pm 15 Feb 2007 21:41:46 -0000 1.12
@@ -183,7 +183,7 @@
my @actual_user_list = ();
foreach my $user ( @$actual_user_list_ref ) {
- push @actual_user_list,$user->[0] if $user->[0] ne "";
+ push @actual_user_list,$user->[0] if defined $user->[0] &&
$user->[0] ne "";
}
# Close the connection, and check for any database errors.
Index: Topic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- Topic.pm 21 Jun 2006 04:58:49 -0000 1.46
+++ Topic.pm 15 Feb 2007 21:41:46 -0000 1.47
@@ -1018,13 +1018,14 @@
# Now do the deed.
$success &&= $select->execute($self->{topicid});
if ($success) {
- while (my ($commentstateid) = $select->fetchrow_array()) {
+ foreach my $commentstate (@{$select->fetchall_arrayref()}) {
+ my $commentstateid = $commentstate->[0];
$success &&= $delete_comments->execute($commentstateid);
$success &&= $commentstate_history->execute($commentstateid);
$success &&=
$delete_commentstate_metric->execute($commentstateid);
- }
- $success &&= $select->finish();
+ }
}
+
$success &&= $delete_commentstate->execute($self->{topicid});
$success &&= $delete_topic->execute($self->{topicid});
$success &&= $delete_comments->execute($self->{topicid});
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits