/[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.35 by mocchiut, Wed Apr 10 08:54:28 2013 UTC revision 1.36 by mocchiut, Wed Apr 10 11:29:38 2013 UTC
# Line 226  void PamelaDBOperations::OpenL0File(TStr Line 226  void PamelaDBOperations::OpenL0File(TStr
226                qu.str("");                qu.str("");
227                //            qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<10000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<7200 group by BOOT_NUMBER order by BOOT_NUMBER asc;";                //            qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<10000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<7200 group by BOOT_NUMBER order by BOOT_NUMBER asc;";
228                //            qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<40000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<40000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // relax conditions... 090112 [8RED: error -29]                //            qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<40000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<40000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // relax conditions... 090112 [8RED: error -29]
229                qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< chlastts <<")<50000 AND ABS(REAL_TIME_INIT-"<< row2->GetField(10) <<")<50000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // even more relaxed conditions... 091214 [9REDtest3: error -29]                qu << "SELECT BOOT_NUMBER from ROOT_TABLE where BOOT_NUMBER!=0 AND ABS(LAST_TIME_SYNC_INFO-"<< (float)chlastts <<")<50000 AND ABS(REAL_TIME_INIT-"<< atof(row2->GetField(10)) <<")<50000 group by BOOT_NUMBER order by BOOT_NUMBER asc;"; // even more relaxed conditions... 091214 [9REDtest3: error -29] // 10RED MYSQL operators BUG:
230                  /*
231    
232    mysql> select CAST(1322000646 AS UNSIGNED INTEGER)-1322017203.;
233    +--------------------------------------------------+
234    | CAST(1322000646 AS UNSIGNED INTEGER)-1322017203. |
235    +--------------------------------------------------+
236    |                                           -16557 |
237    +--------------------------------------------------+
238    1 row in set (0.06 sec)
239    
240    mysql> select CAST(1322000646 AS UNSIGNED INTEGER)-1322017203;
241    +-------------------------------------------------+
242    | CAST(1322000646 AS UNSIGNED INTEGER)-1322017203 |
243    +-------------------------------------------------+
244    |                            18446744073709535059 |
245    +-------------------------------------------------+
246    1 row in set (0.02 sec)
247    
248                  */
249                if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());                if ( debug ) printf(" chewbacca: query is %s \n",qu.str().c_str());
250                result3 = conn->Query(qu.str().c_str());                result3 = conn->Query(qu.str().c_str());
251                if ( result3 ){                if ( result3 ){
# Line 2162  Int_t PamelaDBOperations::assignBOOT_NUM Line 2181  Int_t PamelaDBOperations::assignBOOT_NUM
2181      UInt_t lowerts = tsync-(obt0/1000)-5;      UInt_t lowerts = tsync-(obt0/1000)-5;
2182      if ( chewbacca ){      if ( chewbacca ){
2183        oss.str("");        oss.str("");
2184        oss << "select BOOT_NUMBER from ROOT_TABLE where LAST_TIME_SYNC_INFO-(OBT_TIME_SYNC)<"        oss << "select BOOT_NUMBER from ROOT_TABLE where CAST((LAST_TIME_SYNC_INFO-(OBT_TIME_SYNC)) AS SIGNED INT)<" // 10RED MYSQL OPERATORS BUG
2185            << upperts            << upperts
2186            << " AND LAST_TIME_SYNC_INFO-(OBT_TIME_SYNC)>"            << " AND CAST((LAST_TIME_SYNC_INFO-(OBT_TIME_SYNC)) AS SIGNED INT)>" // 10RED MYSQL OPERATORS BUG
2187            << lowerts            << lowerts
2188            << " AND BOOT_NUMBER>1;";            << " AND BOOT_NUMBER>1;";
2189      } else {      } else {
2190        oss.str("");        oss.str("");
2191        oss << "select GL_RAW.BOOT_NUMBER from GL_TIMESYNC LEFT JOIN GL_RAW ON GL_RAW.ID = GL_TIMESYNC.ID_RAW where TIMESYNC-(OBT0/1000)<"        oss << "select GL_RAW.BOOT_NUMBER from GL_TIMESYNC LEFT JOIN GL_RAW ON GL_RAW.ID = GL_TIMESYNC.ID_RAW where CAST((TIMESYNC-(OBT0/1000)) AS SIGNED INT)<" // 10RED MYSQL OPERATORS BUG
2192            << upperts            << upperts
2193            << " AND TIMESYNC-(OBT0/1000)>"            << " AND CAST((TIMESYNC-(OBT0/1000)) AS SIGNED INT)>" // 10RED MYSQL OPERATORS BUG
2194            << lowerts            << lowerts
2195            << " AND GL_RAW.BOOT_NUMBER>0 GROUP BY GL_TIMESYNC.OBT0;";            << " AND GL_RAW.BOOT_NUMBER>0 GROUP BY GL_TIMESYNC.OBT0;";
2196      };      };
# Line 6156  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 6175  Int_t PamelaDBOperations::CleanGL_RUN_FR
6175            while ( anr ){            while ( anr ){
6176              //              //
6177              oss.str("");              oss.str("");
6178              oss << "SELECT ID,RUNTRAILER_TIME,RUNTRAILER_PKT,BOOT_NUMBER FROM GL_RUN_FRAGMENTS WHERE BOOT_NUMBER=" << mbo << " AND RUNHEADER_PKT=" << mrhp <<  "+1 AND ABS(RUNHEADER_TIME-"<< mrht <<")<=1 AND INSERT_TIME <= '" << clean_time->AsSQLString() << "' order BY RUNHEADER_TIME asc;";              oss << "SELECT ID,RUNTRAILER_TIME,RUNTRAILER_PKT,BOOT_NUMBER FROM GL_RUN_FRAGMENTS WHERE BOOT_NUMBER=" << mbo << " AND RUNHEADER_PKT=" << mrhp <<  "+1 AND ABS(RUNHEADER_TIME-"<< (float)mrht <<")<=1 AND INSERT_TIME <= '" << clean_time->AsSQLString() << "' order BY RUNHEADER_TIME asc;"; // 10RED MYSQL OPERATOR BUG
6179              if ( IsDebug() ) printf(" In the loop searching for fragmented runs : query is \n %s \n",oss.str().c_str());              if ( IsDebug() ) printf(" In the loop searching for fragmented runs : query is \n %s \n",oss.str().c_str());
6180              //              //
6181              nresult1 = conn->Query(oss.str().c_str());              nresult1 = conn->Query(oss.str().c_str());

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.23