/[PAMELA software]/chewbacca/YodaProfiler/src/PamelaDBOperations.cpp
ViewVC logotype

Diff of /chewbacca/YodaProfiler/src/PamelaDBOperations.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by mocchiut, Fri Oct 10 13:00:12 2014 UTC revision 1.40 by mocchiut, Tue Oct 14 13:19:32 2014 UTC
# Line 1366  void PamelaDBOperations::CheckConnection Line 1366  void PamelaDBOperations::CheckConnection
1366    stringstream oss;    stringstream oss;
1367    //      //  
1368    oss.str("");    oss.str("");
1369    oss << "SET time_zone='+0:00'; SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';";    oss << "SET time_zone='+0:00';";
1370    TSQLResult *result = 0;    TSQLResult *result = 0;
1371    result = conn->Query(oss.str().c_str());    result = conn->Query(oss.str().c_str());
1372    if ( !result ) throw -10;    if ( !result ) throw -10;
1373    oss.str("");    oss.str("");
1374    oss << "SET wait_timeout=173000;";    oss << "SET wait_timeout=173000;";
1375    conn->Query(oss.str().c_str());    conn->Query(oss.str().c_str());
1376      delete conn->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
1377    //    //
1378  }  }
1379    
# Line 1658  Int_t PamelaDBOperations::insertPamelaRa Line 1659  Int_t PamelaDBOperations::insertPamelaRa
1659  Int_t PamelaDBOperations::insertPamelaGL_TIMESYNC(){  Int_t PamelaDBOperations::insertPamelaGL_TIMESYNC(){
1660    //    //
1661    Int_t signal = 0;    Int_t signal = 0;
1662    UInt_t idresof = 0;    //  UInt_t idresof = 0;
1663      idresof = 0;
1664    stringstream   oss;    stringstream   oss;
1665    TSQLResult *result = 0;    TSQLResult *result = 0;
1666    TSQLRow *row = 0;    TSQLRow *row = 0;
# Line 1972  Int_t PamelaDBOperations::insertPamelaRo Line 1974  Int_t PamelaDBOperations::insertPamelaRo
1974      //      //
1975      if ( chewbacca ){      if ( chewbacca ){
1976          oss.str("");          oss.str("");
1977          oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" limit 1;";          oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" and ID_RESURS_OFFSET="<< idresof <<" limit 1;"; // 10RED BUG!!!! without 'and ID_RESURS_OFFSET="<< idresof ' this query is not enough to ensure finding the correct line in GL_TIMSYNC...
1978          if ( debug ) printf(" %s \n",oss.str().c_str());          if ( debug ) printf(" %s \n",oss.str().c_str());
1979          result = conn->Query(oss.str().c_str());          result = conn->Query(oss.str().c_str());
1980          //          //
# Line 5745  Int_t PamelaDBOperations::insertTRK_CALI Line 5747  Int_t PamelaDBOperations::insertTRK_CALI
5747                // ---------------------------------------------------------------------                // ---------------------------------------------------------------------
5748                UInt_t idtimesync = 0;                UInt_t idtimesync = 0;
5749                oss.str("");                oss.str("");
5750                oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" limit 1;";                oss << " SELECT ID FROM GL_TIMESYNC where TIMESYNC="<<chlastts<<" AND OBT0="<<chobtts*1000<<" and ID_RESURS_OFFSET="<< idresof <<" limit 1;"; // 10RED BUG!!!! without 'and ID_RESURS_OFFSET="<< idresof ' this query is not enough to ensure finding the correct line in GL_TIMSYNC...
5751                if ( debug ) printf(" %s \n",oss.str().c_str());                if ( debug ) printf(" %s \n",oss.str().c_str());
5752                result = conn->Query(oss.str().c_str());                result = conn->Query(oss.str().c_str());
5753                if ( !result ) throw -3;                if ( !result ) throw -3;

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.23