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 |
|
|
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; |
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 |
// |
// |
2978 |
if ( IsDebug() ) printf(" here firstev is %i lastev is %i \n",firstev,lastev); |
if ( IsDebug() ) printf(" here firstev is %i lastev is %i \n",firstev,lastev); |
2979 |
// |
// |
2980 |
glrun->SetEV_FROM(firstev); |
glrun->SetEV_FROM(firstev); |
2981 |
|
glrun->SetEV_TO(lastev); // EM 10 RED ghost run bug |
2982 |
glrun->SetNEVENTS(lastev-firstev+1); |
glrun->SetNEVENTS(lastev-firstev+1); |
2983 |
// |
// |
2984 |
glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME()); |
glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME()); |
3174 |
}; |
}; |
3175 |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev); |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev); |
3176 |
// |
// |
3177 |
|
glrun->SetEV_FROM(firstev); // EM 10RED ghost run bug |
3178 |
glrun->SetEV_TO(lastev); |
glrun->SetEV_TO(lastev); |
3179 |
glrun->SetNEVENTS(lastev-firstev+1); |
glrun->SetNEVENTS(lastev-firstev+1); |
3180 |
glrun->SetPKT_COUNTER(glrun1->GetPKT_COUNTER()); |
glrun->SetPKT_COUNTER(glrun1->GetPKT_COUNTER()); |
4017 |
glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT()); |
glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT()); |
4018 |
// |
// |
4019 |
glrun->SetEV_FROM(firstev); |
glrun->SetEV_FROM(firstev); |
4020 |
|
glrun->SetEV_TO(lastev); // 10 RED ghost run bug |
4021 |
glrun->SetNEVENTS(lastev-firstev+1); |
glrun->SetNEVENTS(lastev-firstev+1); |
4022 |
// |
// |
4023 |
glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME()); |
glrun->SetRUNHEADER_TIME(glrun1->GetRUNHEADER_TIME()); |
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; |