IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35870


Ignore:
Timestamp:
Aug 2, 2013, 10:43:15 AM (13 years ago)
Author:
eugene
Message:

delete the dvoDetectionFull table before inserting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/Ohana/src/dvopsps/src/insert_detections_dvopsps.c

    r35777 r35870  
    182182  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    183183    int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
     184    if (VERBOSE) fprintf (stderr, "done reading remote tables, status: %d\n", status);
    184185    if (!status) return FALSE;
    185186  }
     
    198199    }
    199200
     201    // explicitly delete all entries
     202    char query[256];
     203    sprintf (query, "delete from dvoDetectionFull");
     204    if (mysql_query (mysql, query)) {
     205      fprintf (stderr, "failed to delete existing entries\n");
     206      fprintf (stderr, "%s\n", mysql_error (mysql));
     207      return FALSE;
     208    }
     209    if (VERBOSE) fprintf (stderr, "deleted existing entries\n");
     210   
    200211    for (i = 0; i < table->Nhosts; i++) {
    201212      if ((detections = DetectionsLoad (table->hosts[i].results, &Ndetections)) == NULL) {
     
    205216        return FALSE;
    206217      }
     218      if (VERBOSE) fprintf (stderr, "read %d detections from %s\n", Ndetections, table->hosts[i].hostname);
    207219      free (table->hosts[i].results);
    208220      table->hosts[i].results = NULL;
Note: See TracChangeset for help on using the changeset viewer.