[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 02 Oct 2003 14:11:36 -0000


matthew		Thu Oct  2 10:11:36 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Use 'INSERT IGNORE INTO' instead of 'INSERT INTO' so we don't bail on 
  all of a students data because something is redundant.  Not for 1.0.2.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.97 loncom/interface/loncoursedata.pm:1.98
--- loncom/interface/loncoursedata.pm:1.97	Wed Oct  1 16:50:13 2003
+++ loncom/interface/loncoursedata.pm	Thu Oct  2 10:11:36 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.97 2003/10/01 20:50:13 matthew Exp $
+# $Id: loncoursedata.pm,v 1.98 2003/10/02 14:11:36 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1149,7 +1149,7 @@
             # We can deal with 'timestamp' right away
             my @timestamp_storage = ($symb_id,$student_id,
                                      $transaction,$value);
-            my $store_command = 'INSERT INTO '.$fulldump_timestamp_table.
+            my $store_command = 'INSERT IGNORE INTO '.$fulldump_timestamp_table.
                 " VALUES ('".join("','",@timestamp_storage)."');";
             $dbh->do($store_command);
             if ($dbh->err()) {
@@ -1213,7 +1213,7 @@
     }
     ##
     ## Store the part data
-    my $store_command = 'INSERT INTO '.$fulldump_part_table.
+    my $store_command = 'INSERT IGNORE INTO '.$fulldump_part_table.
         ' VALUES '."\n";
     my $store_rows = 0;
     while (my ($symb_id,$hash1) = each (%$partdata)) {
@@ -1241,7 +1241,7 @@
     }
     ##
     ## Store the response data
-    $store_command = 'INSERT INTO '.$fulldump_response_table.
+    $store_command = 'INSERT IGNORE INTO '.$fulldump_response_table.
         ' VALUES '."\n";
     $store_rows = 0;
     while (my ($symb_id,$hash1) = each (%$respdata)) {
@@ -1381,10 +1381,10 @@
     my $starttime = Time::HiRes::time;
     my $elapsed = 0;
     my $rows_stored;
-    my $store_parameters_command  = 'INSERT INTO '.$parameters_table.
+    my $store_parameters_command  = 'INSERT IGNORE INTO '.$parameters_table.
         ' VALUES '."\n";
     my $num_parameters = 0;
-    my $store_performance_command = 'INSERT INTO '.$performance_table.
+    my $store_performance_command = 'INSERT IGNORE INTO '.$performance_table.
         ' VALUES '."\n";
     return ('error',undef) if (! defined($dbh));
     while (my ($current_symb,$param_hash) = each(%{$student_data})) {