TMySQLStatement.cxx

Go to the documentation of this file.
00001 // @(#)root/mysql:$Id: TMySQLStatement.cxx 35527 2010-09-21 12:27:01Z brun $
00002 // Author: Sergey Linev   6/02/2006
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 //  SQL statement class for MySQL                                       //
00015 //                                                                      //
00016 //  See TSQLStatement class documentation for more details.             //
00017 //                                                                      //
00018 //////////////////////////////////////////////////////////////////////////
00019 
00020 #include "TMySQLStatement.h"
00021 #include "TMySQLServer.h"
00022 #include "TDataType.h"
00023 #include "TDatime.h"
00024 #include <stdlib.h>
00025 
00026 ClassImp(TMySQLStatement)
00027 
00028 ULong64_t TMySQLStatement::fgAllocSizeLimit = 0x8000000; // 128 Mb
00029 
00030 #if MYSQL_VERSION_ID >= 40100
00031 
00032 //______________________________________________________________________________
00033 TMySQLStatement::TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout) :
00034    TSQLStatement(errout),
00035    fStmt(stmt),
00036    fNumBuffers(0),
00037    fBind(0),
00038    fBuffer(0),
00039    fWorkingMode(0),
00040    fIterationCount(-1),
00041    fNeedParBind(kFALSE)
00042 {
00043    // Normal constructor.
00044    // Checks if statement contains parameters tags.
00045 
00046    ULong_t paramcount = mysql_stmt_param_count(fStmt);
00047 
00048    if (paramcount>0) {
00049       fWorkingMode = 1;
00050       SetBuffersNumber(paramcount);
00051       fNeedParBind = kTRUE;
00052       fIterationCount = -1;
00053    }
00054 }
00055 
00056 //______________________________________________________________________________
00057 TMySQLStatement::~TMySQLStatement()
00058 {
00059    // Destructor.
00060 
00061    Close();
00062 }
00063 
00064 //______________________________________________________________________________
00065 void TMySQLStatement::Close(Option_t *)
00066 {
00067    // Close statement.
00068 
00069    if (fStmt)
00070       mysql_stmt_close(fStmt);
00071 
00072    fStmt = 0;
00073 
00074    FreeBuffers();
00075 }
00076 
00077 
00078 // Reset error and check that statement exists
00079 #define CheckStmt(method, res)                          \
00080    {                                                    \
00081       ClearError();                                     \
00082       if (fStmt==0) {                                   \
00083          SetError(-1,"Statement handle is 0",method);   \
00084          return res;                                    \
00085       }                                                 \
00086    }
00087 
00088 // check last mysql statement error code
00089 #define CheckErrNo(method, force, res)                  \
00090    {                                                    \
00091       unsigned int stmterrno = mysql_stmt_errno(fStmt);     \
00092       if ((stmterrno!=0) || force) {                        \
00093          const char* stmterrmsg = mysql_stmt_error(fStmt);  \
00094          if (stmterrno==0) { stmterrno = 11111; stmterrmsg = "MySQL statement error"; } \
00095          SetError(stmterrno, stmterrmsg, method);               \
00096          return res;                                    \
00097       }                                                 \
00098    }
00099 
00100 
00101 // check last mysql statement error code
00102 #define CheckGetField(method, res)                      \
00103    {                                                    \
00104       ClearError();                                     \
00105       if (!IsResultSetMode()) {                         \
00106          SetError(-1,"Cannot get statement parameters",method); \
00107          return res;                                    \
00108       }                                                 \
00109       if ((npar<0) || (npar>=fNumBuffers)) {            \
00110          SetError(-1,Form("Invalid parameter number %d", npar),method); \
00111          return res;                                    \
00112       }                                                 \
00113    }
00114 
00115 //______________________________________________________________________________
00116 Bool_t TMySQLStatement::Process()
00117 {
00118    // Process statement.
00119 
00120    CheckStmt("Process",kFALSE);
00121 
00122    // if parameters was set, processing just means of closing parameters and variables
00123    if (IsSetParsMode()) {
00124       if (fIterationCount>=0)
00125          if (!NextIteration()) return kFALSE;
00126       fWorkingMode = 0;
00127       fIterationCount = -1;
00128       FreeBuffers();
00129       return kTRUE;
00130    }
00131 
00132    if (mysql_stmt_execute(fStmt))
00133       CheckErrNo("Process",kTRUE, kFALSE);
00134 
00135    return kTRUE;
00136 }
00137 
00138 //______________________________________________________________________________
00139 Int_t TMySQLStatement::GetNumAffectedRows()
00140 {
00141    // Return number of affected rows after statement is processed.
00142 
00143    CheckStmt("Process", -1);
00144 
00145    my_ulonglong res = mysql_stmt_affected_rows(fStmt);
00146 
00147    if (res == (my_ulonglong) -1)
00148       CheckErrNo("GetNumAffectedRows", kTRUE, -1);
00149 
00150    return (Int_t) res;
00151 }
00152 
00153 //______________________________________________________________________________
00154 Int_t TMySQLStatement::GetNumParameters()
00155 {
00156    // Return number of statement parameters.
00157 
00158    CheckStmt("GetNumParameters", -1);
00159 
00160    Int_t res = mysql_stmt_param_count(fStmt);
00161 
00162    CheckErrNo("GetNumParameters", kFALSE, -1);
00163 
00164    return res;
00165 }
00166 
00167 //______________________________________________________________________________
00168 Bool_t TMySQLStatement::StoreResult()
00169 {
00170    // Store result of statement processing to access them
00171    // via GetInt(), GetDouble() and so on methods.
00172 
00173    CheckStmt("StoreResult", kFALSE);
00174    if (fWorkingMode!=0) {
00175       SetError(-1,"Cannot store result for that statement","StoreResult");
00176       return kFALSE;
00177    }
00178 
00179    if (mysql_stmt_store_result(fStmt))
00180       CheckErrNo("StoreResult",kTRUE, kFALSE);
00181 
00182    // allocate memeory for data reading from query
00183    MYSQL_RES* meta = mysql_stmt_result_metadata(fStmt);
00184    if (meta) {
00185       int count = mysql_num_fields(meta);
00186 
00187       SetBuffersNumber(count);
00188 
00189       MYSQL_FIELD *fields = mysql_fetch_fields(meta);
00190 
00191       for (int n=0;n<count;n++) {
00192          SetSQLParamType(n, fields[n].type, (fields[n].flags & UNSIGNED_FLAG) == 0, fields[n].length);
00193          if (fields[n].name!=0) {
00194             fBuffer[n].fFieldName = new char[strlen(fields[n].name)+1];
00195             strcpy(fBuffer[n].fFieldName, fields[n].name);
00196          }
00197       }
00198 
00199       mysql_free_result(meta);
00200    }
00201 
00202    if (fBind==0) return kFALSE;
00203 
00204    /* Bind the buffers */
00205    if (mysql_stmt_bind_result(fStmt, fBind))
00206       CheckErrNo("StoreResult",kTRUE, kFALSE);
00207 
00208    fWorkingMode = 2;
00209 
00210    return kTRUE;
00211 }
00212 
00213 //______________________________________________________________________________
00214 Int_t TMySQLStatement::GetNumFields()
00215 {
00216    // Return number of fields in result set.
00217 
00218    return IsResultSetMode() ? fNumBuffers : -1;
00219 }
00220 
00221 //______________________________________________________________________________
00222 const char* TMySQLStatement::GetFieldName(Int_t nfield)
00223 {
00224    // Returns field name in result set.
00225 
00226    if (!IsResultSetMode() || (nfield<0) || (nfield>=fNumBuffers)) return 0;
00227 
00228    return fBuffer[nfield].fFieldName;
00229 }
00230 
00231 //______________________________________________________________________________
00232 Bool_t TMySQLStatement::NextResultRow()
00233 {
00234    // Shift cursor to nect row in result set.
00235 
00236    if ((fStmt==0) || !IsResultSetMode()) return kFALSE;
00237 
00238    Bool_t res = !mysql_stmt_fetch(fStmt);
00239 
00240    if (!res) {
00241       fWorkingMode = 0;
00242       FreeBuffers();
00243    }
00244 
00245    return res;
00246 }
00247 
00248 //______________________________________________________________________________
00249 Bool_t TMySQLStatement::NextIteration()
00250 {
00251    // Increment iteration counter for statement, where parameter can be set.
00252    // Statement with parameters of previous iteration
00253    // automatically will be applied to database.
00254 
00255    ClearError();
00256 
00257    if (!IsSetParsMode() || (fBind==0)) {
00258       SetError(-1,"Cannot call for that statement","NextIteration");
00259       return kFALSE;
00260    }
00261 
00262    fIterationCount++;
00263 
00264    if (fIterationCount==0) return kTRUE;
00265 
00266    if (fNeedParBind) {
00267       fNeedParBind = kFALSE;
00268       if (mysql_stmt_bind_param(fStmt, fBind))
00269          CheckErrNo("NextIteration",kTRUE, kFALSE);
00270    }
00271 
00272    if (mysql_stmt_execute(fStmt))
00273       CheckErrNo("NextIteration", kTRUE, kFALSE);
00274 
00275    return kTRUE;
00276 }
00277 
00278 //______________________________________________________________________________
00279 void TMySQLStatement::FreeBuffers()
00280 {
00281    // Release all buffers, used by statement.
00282 
00283    if (fBuffer) {
00284       for (Int_t n=0; n<fNumBuffers;n++) {
00285          free(fBuffer[n].fMem);
00286          if (fBuffer[n].fStrBuffer)
00287             delete[] fBuffer[n].fStrBuffer;
00288          if (fBuffer[n].fFieldName)
00289             delete[] fBuffer[n].fFieldName;
00290       }
00291       delete[] fBuffer;
00292    }
00293 
00294    if (fBind)
00295       delete[] fBind;
00296 
00297    fBuffer = 0;
00298    fBind = 0;
00299    fNumBuffers = 0;
00300 }
00301 
00302 //______________________________________________________________________________
00303 void TMySQLStatement::SetBuffersNumber(Int_t numpars)
00304 {
00305    // Allocate buffers for statement parameters/ result fields.
00306 
00307    FreeBuffers();
00308    if (numpars<=0) return;
00309 
00310    fNumBuffers = numpars;
00311 
00312    fBind = new MYSQL_BIND[fNumBuffers];
00313    memset(fBind, 0, sizeof(MYSQL_BIND)*fNumBuffers);
00314 
00315    fBuffer = new TParamData[fNumBuffers];
00316    memset(fBuffer, 0, sizeof(TParamData)*fNumBuffers);
00317 }
00318 
00319 //______________________________________________________________________________
00320 const char* TMySQLStatement::ConvertToString(Int_t npar)
00321 {
00322    // Convert field value to string.
00323 
00324    if (fBuffer[npar].fResNull) return 0;
00325 
00326    void* addr = fBuffer[npar].fMem;
00327    bool sig = fBuffer[npar].fSign;
00328 
00329    if (addr==0) return 0;
00330 
00331    if ((fBind[npar].buffer_type==MYSQL_TYPE_STRING) ||
00332       (fBind[npar].buffer_type==MYSQL_TYPE_VAR_STRING))
00333       return (const char*) addr;
00334 
00335    if (fBuffer[npar].fStrBuffer==0)
00336       fBuffer[npar].fStrBuffer = new char[100];
00337 
00338    char* buf = fBuffer[npar].fStrBuffer;
00339 
00340    switch(fBind[npar].buffer_type) {
00341       case MYSQL_TYPE_LONG:
00342          if (sig) snprintf(buf,100,"%d",*((int*) addr));
00343              else snprintf(buf,100,"%u",*((unsigned int*) addr));
00344          break;
00345       case MYSQL_TYPE_LONGLONG:
00346          if (sig) snprintf(buf,100,"%lld",*((long long*) addr)); else
00347                   snprintf(buf,100,"%llu",*((unsigned long long*) addr));
00348          break;
00349       case MYSQL_TYPE_SHORT:
00350          if (sig) snprintf(buf,100,"%hd",*((short*) addr)); else
00351                   snprintf(buf,100,"%hu",*((unsigned short*) addr));
00352          break;
00353       case MYSQL_TYPE_TINY:
00354          if (sig) snprintf(buf,100,"%d",*((char*) addr)); else
00355                   snprintf(buf,100,"%u",*((unsigned char*) addr));
00356          break;
00357       case MYSQL_TYPE_FLOAT:
00358          snprintf(buf, 100, TSQLServer::GetFloatFormat(), *((float*) addr));
00359          break;
00360       case MYSQL_TYPE_DOUBLE:
00361          snprintf(buf, 100, TSQLServer::GetFloatFormat(), *((double*) addr));
00362          break;
00363       case MYSQL_TYPE_DATETIME:
00364       case MYSQL_TYPE_TIMESTAMP: {
00365          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00366          snprintf(buf,100,"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d",
00367                   tm->year, tm->month,  tm->day,
00368                   tm->hour, tm->minute, tm->second);
00369          break;
00370       }
00371       case MYSQL_TYPE_TIME: {
00372          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00373          snprintf(buf,100,"%2.2d:%2.2d:%2.2d",
00374                   tm->hour, tm->minute, tm->second);
00375          break;
00376       }
00377       case MYSQL_TYPE_DATE: {
00378          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00379          snprintf(buf,100,"%4.4d-%2.2d-%2.2d",
00380                   tm->year, tm->month,  tm->day);
00381          break;
00382       }
00383       default:
00384          return 0;
00385    }
00386    return buf;
00387 }
00388 
00389 //______________________________________________________________________________
00390 long double TMySQLStatement::ConvertToNumeric(Int_t npar)
00391 {
00392    // Convert field to numeric value.
00393 
00394    if (fBuffer[npar].fResNull) return 0;
00395 
00396    void* addr = fBuffer[npar].fMem;
00397    bool sig = fBuffer[npar].fSign;
00398 
00399    if (addr==0) return 0;
00400 
00401    switch(fBind[npar].buffer_type) {
00402       case MYSQL_TYPE_LONG:
00403          if (sig) return *((int*) addr); else
00404                   return *((unsigned int*) addr);
00405          break;
00406       case MYSQL_TYPE_LONGLONG:
00407          if (sig) return *((long long*) addr); else
00408                   return *((unsigned long long*) addr);
00409          break;
00410       case MYSQL_TYPE_SHORT:
00411          if (sig) return *((short*) addr); else
00412                   return *((unsigned short*) addr);
00413          break;
00414       case MYSQL_TYPE_TINY:
00415          if (sig) return *((char*) addr); else
00416                   return *((unsigned char*) addr);
00417          break;
00418       case MYSQL_TYPE_FLOAT:
00419          return *((float*) addr);
00420          break;
00421       case MYSQL_TYPE_DOUBLE:
00422          return *((double*) addr);
00423          break;
00424 #if MYSQL_VERSION_ID >= 50022
00425       case MYSQL_TYPE_NEWDECIMAL /* new MYSQL_TYPE fixed precision decimal */:
00426 #endif
00427       case MYSQL_TYPE_STRING:
00428       case MYSQL_TYPE_VAR_STRING:
00429       case MYSQL_TYPE_BLOB: {
00430          char* str = (char*) addr;
00431          ULong_t len = fBuffer[npar].fResLength;
00432          if ((str==0) || (*str==0) || (len==0)) return 0;
00433          Int_t size = fBuffer[npar].fSize;
00434          if (1.*len<size)
00435             str[len] = 0;
00436          else
00437             str[size-1] = 0;
00438          long double buf = 0;
00439          sscanf(str,"%Lf",&buf);
00440          return buf;
00441          break;
00442       }
00443       case MYSQL_TYPE_DATETIME:
00444       case MYSQL_TYPE_TIMESTAMP: {
00445          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00446          TDatime rtm(tm->year, tm->month,  tm->day,
00447                   tm->hour, tm->minute, tm->second);
00448          return rtm.Get();
00449          break;
00450       }
00451       case MYSQL_TYPE_DATE: {
00452          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00453          TDatime rtm(tm->year, tm->month,  tm->day, 0, 0, 0);
00454          return rtm.GetDate();
00455          break;
00456       }
00457       case MYSQL_TYPE_TIME: {
00458          MYSQL_TIME* tm = (MYSQL_TIME*) addr;
00459          TDatime rtm(2000, 1, 1, tm->hour, tm->minute, tm->second);
00460          return rtm.GetTime();
00461          break;
00462       }
00463 
00464       default:
00465          return 0;
00466    }
00467 
00468    return 0;
00469 }
00470 
00471 //______________________________________________________________________________
00472 Bool_t TMySQLStatement::IsNull(Int_t npar)
00473 {
00474    // Checks if field value is null.
00475 
00476    CheckGetField("IsNull", kTRUE);
00477 
00478    return fBuffer[npar].fResNull;
00479 }
00480 
00481 //______________________________________________________________________________
00482 Int_t TMySQLStatement::GetInt(Int_t npar)
00483 {
00484    // Return field value as integer.
00485 
00486    CheckGetField("GetInt", 0);
00487 
00488    if ((fBuffer[npar].fSqlType==MYSQL_TYPE_LONG) && fBuffer[npar].fSign)
00489      return (Int_t) *((int*) fBuffer[npar].fMem);
00490 
00491    return (Int_t) ConvertToNumeric(npar);
00492 }
00493 
00494 //______________________________________________________________________________
00495 UInt_t TMySQLStatement::GetUInt(Int_t npar)
00496 {
00497    // Return field value as unsigned integer.
00498 
00499    CheckGetField("GetUInt", 0);
00500 
00501    if ((fBuffer[npar].fSqlType==MYSQL_TYPE_LONG) && !fBuffer[npar].fSign)
00502      return (UInt_t) *((unsigned int*) fBuffer[npar].fMem);
00503 
00504    return (UInt_t) ConvertToNumeric(npar);
00505 }
00506 
00507 //______________________________________________________________________________
00508 Long_t TMySQLStatement::GetLong(Int_t npar)
00509 {
00510    // Return field value as long integer.
00511 
00512    CheckGetField("GetLong", 0);
00513 
00514    if ((fBuffer[npar].fSqlType==MYSQL_TYPE_LONG) && fBuffer[npar].fSign)
00515      return (Long_t) *((int*) fBuffer[npar].fMem);
00516 
00517    return (Long_t) ConvertToNumeric(npar);
00518 }
00519 
00520 //______________________________________________________________________________
00521 Long64_t TMySQLStatement::GetLong64(Int_t npar)
00522 {
00523    // Return field value as 64-bit integer.
00524 
00525    CheckGetField("GetLong64", 0);
00526 
00527    if ((fBuffer[npar].fSqlType==MYSQL_TYPE_LONGLONG) && fBuffer[npar].fSign)
00528      return (Long64_t) *((long long*) fBuffer[npar].fMem);
00529 
00530    return (Long64_t) ConvertToNumeric(npar);
00531 }
00532 
00533 //______________________________________________________________________________
00534 ULong64_t TMySQLStatement::GetULong64(Int_t npar)
00535 {
00536    // Return field value as unsigned 64-bit integer.
00537 
00538    CheckGetField("GetULong64", 0);
00539 
00540    if ((fBuffer[npar].fSqlType==MYSQL_TYPE_LONGLONG) && !fBuffer[npar].fSign)
00541      return (ULong64_t) *((unsigned long long*) fBuffer[npar].fMem);
00542 
00543    return (ULong64_t) ConvertToNumeric(npar);
00544 }
00545 
00546 //______________________________________________________________________________
00547 Double_t TMySQLStatement::GetDouble(Int_t npar)
00548 {
00549    // Return field value as double.
00550 
00551    CheckGetField("GetDouble", 0);
00552 
00553    if (fBuffer[npar].fSqlType==MYSQL_TYPE_DOUBLE)
00554      return (Double_t) *((double*) fBuffer[npar].fMem);
00555 
00556    return (Double_t) ConvertToNumeric(npar);
00557 }
00558 
00559 //______________________________________________________________________________
00560 const char *TMySQLStatement::GetString(Int_t npar)
00561 {
00562    // Return field value as string.
00563 
00564    CheckGetField("GetString", 0);
00565 
00566    if ((fBind[npar].buffer_type==MYSQL_TYPE_STRING)
00567       || (fBind[npar].buffer_type==MYSQL_TYPE_BLOB)
00568       || (fBind[npar].buffer_type==MYSQL_TYPE_VAR_STRING)
00569 #if MYSQL_VERSION_ID >= 50022
00570       || (fBuffer[npar].fSqlType==MYSQL_TYPE_NEWDECIMAL)
00571 #endif
00572        ) {
00573          if (fBuffer[npar].fResNull) return 0;
00574          char* str = (char*) fBuffer[npar].fMem;
00575          ULong_t len = fBuffer[npar].fResLength;
00576          Int_t size = fBuffer[npar].fSize;
00577          if (1.*len<size) str[len] = 0; else
00578                           str[size-1] = 0;
00579          return str;
00580       }
00581 
00582    return ConvertToString(npar);
00583 }
00584 
00585 //______________________________________________________________________________
00586 Bool_t TMySQLStatement::GetBinary(Int_t npar, void* &mem, Long_t& size)
00587 {
00588    // Return field value as binary array.
00589 
00590    mem = 0;
00591    size = 0;
00592 
00593    CheckGetField("GetBinary", kFALSE);
00594 
00595    if ((fBind[npar].buffer_type==MYSQL_TYPE_STRING) ||
00596        (fBind[npar].buffer_type==MYSQL_TYPE_VAR_STRING) ||
00597        (fBind[npar].buffer_type==MYSQL_TYPE_BLOB) ||
00598        (fBind[npar].buffer_type==MYSQL_TYPE_TINY_BLOB) ||
00599        (fBind[npar].buffer_type==MYSQL_TYPE_MEDIUM_BLOB) ||
00600        (fBind[npar].buffer_type==MYSQL_TYPE_LONG_BLOB)) {
00601          if (fBuffer[npar].fResNull) return kTRUE;
00602          mem = fBuffer[npar].fMem;
00603          size = fBuffer[npar].fResLength;
00604          return kTRUE;
00605       }
00606 
00607    return kFALSE;
00608 }
00609 
00610 //______________________________________________________________________________
00611 Bool_t TMySQLStatement::GetDate(Int_t npar, Int_t& year, Int_t& month, Int_t& day)
00612 {
00613    // Return field value as date.
00614 
00615    CheckGetField("GetDate", kFALSE);
00616 
00617    if (fBuffer[npar].fResNull) return kFALSE;
00618 
00619    switch(fBind[npar].buffer_type) {
00620       case MYSQL_TYPE_DATETIME:
00621       case MYSQL_TYPE_TIMESTAMP:
00622       case MYSQL_TYPE_DATE: {
00623          MYSQL_TIME* tm = (MYSQL_TIME*) fBuffer[npar].fMem;
00624          if (tm==0) return kFALSE;
00625          year = tm->year;
00626          month = tm->month;
00627          day = tm->day;
00628          break;
00629       }
00630       default:
00631          return kFALSE;
00632    }
00633    return kTRUE;
00634 }
00635 
00636 //______________________________________________________________________________
00637 Bool_t TMySQLStatement::GetTime(Int_t npar, Int_t& hour, Int_t& min, Int_t& sec)
00638 {
00639    // Return field value as time.
00640 
00641    CheckGetField("GetTime", kFALSE);
00642 
00643    if (fBuffer[npar].fResNull) return kFALSE;
00644 
00645    switch(fBind[npar].buffer_type) {
00646       case MYSQL_TYPE_DATETIME:
00647       case MYSQL_TYPE_TIMESTAMP:
00648       case MYSQL_TYPE_TIME: {
00649          MYSQL_TIME* tm = (MYSQL_TIME*) fBuffer[npar].fMem;
00650          if (tm==0) return kFALSE;
00651          hour = tm->hour;
00652          min = tm->minute;
00653          sec = tm->second;
00654          break;
00655       }
00656       default:
00657          return kFALSE;
00658    }
00659    return kTRUE;
00660 }
00661 
00662 //______________________________________________________________________________
00663 Bool_t TMySQLStatement::GetDatime(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec)
00664 {
00665    // Return field value as date & time.
00666 
00667    CheckGetField("GetDatime", kFALSE);
00668 
00669    if (fBuffer[npar].fResNull) return kFALSE;
00670 
00671    switch(fBind[npar].buffer_type) {
00672       case MYSQL_TYPE_DATETIME:
00673       case MYSQL_TYPE_TIMESTAMP: {
00674          MYSQL_TIME* tm = (MYSQL_TIME*) fBuffer[npar].fMem;
00675          if (tm==0) return kFALSE;
00676          year = tm->year;
00677          month = tm->month;
00678          day = tm->day;
00679          hour = tm->hour;
00680          min = tm->minute;
00681          sec = tm->second;
00682          break;
00683       }
00684       default:
00685          return kFALSE;
00686    }
00687    return kTRUE;
00688 }
00689 
00690 //______________________________________________________________________________
00691 Bool_t TMySQLStatement::GetTimestamp(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec, Int_t& frac)
00692 {
00693    // Return field value as time stamp.
00694 
00695    CheckGetField("GetTimstamp", kFALSE);
00696 
00697    if (fBuffer[npar].fResNull) return kFALSE;
00698 
00699    switch(fBind[npar].buffer_type) {
00700       case MYSQL_TYPE_DATETIME:
00701       case MYSQL_TYPE_TIMESTAMP: {
00702          MYSQL_TIME* tm = (MYSQL_TIME*) fBuffer[npar].fMem;
00703          if (tm==0) return kFALSE;
00704          year = tm->year;
00705          month = tm->month;
00706          day = tm->day;
00707          hour = tm->hour;
00708          min = tm->minute;
00709          sec = tm->second;
00710          frac = 0;
00711          break;
00712       }
00713       default:
00714          return kFALSE;
00715    }
00716    return kTRUE;
00717 }
00718 
00719 //______________________________________________________________________________
00720 Bool_t TMySQLStatement::SetSQLParamType(Int_t npar, int sqltype, bool sig, unsigned long sqlsize)
00721 {
00722    // Set parameter type to be used as buffer.
00723    // Used in both setting data to database and retriving data from data base.
00724    // Initialize proper MYSQL_BIND structure and allocate required buffers.
00725 
00726    if ((npar<0) || (npar>=fNumBuffers)) return kFALSE;
00727 
00728    fBuffer[npar].fMem = 0;
00729    fBuffer[npar].fSize = 0;
00730    fBuffer[npar].fResLength = 0;
00731    fBuffer[npar].fResNull = false;
00732    fBuffer[npar].fStrBuffer = 0;
00733 
00734    ULong64_t allocsize = 0;
00735 
00736    bool doreset = false;
00737 
00738    switch (sqltype) {
00739       case MYSQL_TYPE_LONG:     allocsize = sizeof(int);  break;
00740       case MYSQL_TYPE_LONGLONG: allocsize = sizeof(long long); break;
00741       case MYSQL_TYPE_SHORT:    allocsize = sizeof(short); break;
00742       case MYSQL_TYPE_TINY:     allocsize = sizeof(char); break;
00743       case MYSQL_TYPE_FLOAT:    allocsize = sizeof(float); break;
00744       case MYSQL_TYPE_DOUBLE:   allocsize = sizeof(double); break;
00745 #if MYSQL_VERSION_ID >= 50022
00746       case MYSQL_TYPE_NEWDECIMAL /* new MYSQL_TYPE fixed precision decimal */:
00747 #endif
00748       case MYSQL_TYPE_STRING:   allocsize = sqlsize > 256 ? sqlsize : 256; break;
00749       case MYSQL_TYPE_VAR_STRING: allocsize = sqlsize > 256 ? sqlsize : 256; break;
00750       case MYSQL_TYPE_MEDIUM_BLOB:
00751       case MYSQL_TYPE_LONG_BLOB:
00752       case MYSQL_TYPE_BLOB:     allocsize = sqlsize >= 65525 ? sqlsize : 65535; break;
00753       case MYSQL_TYPE_TINY_BLOB:   allocsize = sqlsize > 255 ? sqlsize : 255; break;
00754       case MYSQL_TYPE_TIME:
00755       case MYSQL_TYPE_DATE:
00756       case MYSQL_TYPE_TIMESTAMP:
00757       case MYSQL_TYPE_DATETIME: allocsize = sizeof(MYSQL_TIME); doreset = true; break;
00758       default: SetError(-1,"Nonsupported SQL type","SetSQLParamType"); return kFALSE;
00759    }
00760 
00761    if (allocsize > fgAllocSizeLimit) allocsize = fgAllocSizeLimit;
00762 
00763    fBuffer[npar].fMem = malloc(allocsize);
00764    fBuffer[npar].fSize = allocsize;
00765    fBuffer[npar].fSqlType = sqltype;
00766    fBuffer[npar].fSign = sig;
00767 
00768    if ((allocsize>0) && fBuffer[npar].fMem && doreset)
00769       memset(fBuffer[npar].fMem, 0, allocsize);
00770 
00771    fBind[npar].buffer_type = enum_field_types(sqltype);
00772    fBind[npar].buffer = fBuffer[npar].fMem;
00773    fBind[npar].buffer_length = allocsize;
00774    fBind[npar].is_null= &(fBuffer[npar].fResNull);
00775    fBind[npar].length = &(fBuffer[npar].fResLength);
00776    fBind[npar].is_unsigned = !sig;
00777 
00778    return kTRUE;
00779 }
00780 
00781 //______________________________________________________________________________
00782 void *TMySQLStatement::BeforeSet(const char* method, Int_t npar, Int_t sqltype, Bool_t sig, unsigned long size)
00783 {
00784    // Check boundary condition before setting value of parameter.
00785    // Return address of parameter buffer.
00786 
00787    ClearError();
00788 
00789    if (!IsSetParsMode()) {
00790       SetError(-1,"Cannot set parameter for statement", method);
00791       return 0;
00792    }
00793 
00794    if ((npar<0) || (npar>=fNumBuffers)) {
00795       SetError(-1,Form("Invalid parameter number %d",npar), method);
00796       return 0;
00797    }
00798 
00799    if ((fIterationCount==0) && (fBuffer[npar].fSqlType==0))
00800       if (!SetSQLParamType(npar, sqltype, sig, size)) {
00801          SetError(-1,"Cannot initialize parameter buffer", method);
00802          return 0;
00803       }
00804 
00805    if ((fBuffer[npar].fSqlType!=sqltype) ||
00806       (fBuffer[npar].fSign != sig)) return 0;
00807 
00808    fBuffer[npar].fResNull = false;
00809 
00810    return fBuffer[npar].fMem;
00811 }
00812 
00813 //______________________________________________________________________________
00814 Bool_t TMySQLStatement::SetNull(Int_t npar)
00815 {
00816    // Set NULL as parameter value.
00817    // If NULL should be set for statement parameter during first iteration,
00818    // one should call before proper Set... method to identify type of argument for
00819    // the future. For instance, if one suppose to have double as type of parameter,
00820    // code should look like:
00821    //    stmt->SetDouble(2, 0.);
00822    //    stmt->SetNull(2);
00823 
00824    void* addr = BeforeSet("SetNull", npar, MYSQL_TYPE_LONG);
00825 
00826    if (addr!=0)
00827       *((int*) addr) = 0;
00828 
00829    if ((npar>=0) && (npar<fNumBuffers))
00830       fBuffer[npar].fResNull = true;
00831 
00832    return kTRUE;
00833 }
00834 
00835 //______________________________________________________________________________
00836 Bool_t TMySQLStatement::SetInt(Int_t npar, Int_t value)
00837 {
00838    // Set parameter value as integer.
00839 
00840    void* addr = BeforeSet("SetInt", npar, MYSQL_TYPE_LONG);
00841 
00842    if (addr!=0)
00843       *((int*) addr) = value;
00844 
00845    return (addr!=0);
00846 }
00847 
00848 //______________________________________________________________________________
00849 Bool_t TMySQLStatement::SetUInt(Int_t npar, UInt_t value)
00850 {
00851    // Set parameter value as unsigned integer.
00852 
00853    void* addr = BeforeSet("SetUInt", npar, MYSQL_TYPE_LONG, kFALSE);
00854 
00855    if (addr!=0)
00856       *((unsigned int*) addr) = value;
00857 
00858    return (addr!=0);
00859 }
00860 
00861 //______________________________________________________________________________
00862 Bool_t TMySQLStatement::SetLong(Int_t npar, Long_t value)
00863 {
00864    // Set parameter value as long integer.
00865 
00866    void* addr = BeforeSet("SetLong", npar, MYSQL_TYPE_LONG);
00867 
00868    if (addr!=0)
00869       *((int*) addr) = value;
00870 
00871    return (addr!=0);
00872 }
00873 
00874 //______________________________________________________________________________
00875 Bool_t TMySQLStatement::SetLong64(Int_t npar, Long64_t value)
00876 {
00877    // Set parameter value as 64-bit integer.
00878 
00879    void* addr = BeforeSet("SetLong64", npar, MYSQL_TYPE_LONGLONG);
00880 
00881    if (addr!=0)
00882       *((long long*) addr) = value;
00883 
00884    return (addr!=0);
00885 }
00886 
00887 //______________________________________________________________________________
00888 Bool_t TMySQLStatement::SetULong64(Int_t npar, ULong64_t value)
00889 {
00890    // Set parameter value as unsigned 64-bit integer.
00891 
00892    void* addr = BeforeSet("SetULong64", npar, MYSQL_TYPE_LONGLONG, kFALSE);
00893 
00894    if (addr!=0)
00895       *((unsigned long long*) addr) = value;
00896 
00897    return (addr!=0);
00898 }
00899 
00900 //______________________________________________________________________________
00901 Bool_t TMySQLStatement::SetDouble(Int_t npar, Double_t value)
00902 {
00903    // Set parameter value as double.
00904 
00905    void* addr = BeforeSet("SetDouble", npar, MYSQL_TYPE_DOUBLE, kFALSE);
00906 
00907    if (addr!=0)
00908       *((double*) addr) = value;
00909 
00910    return (addr!=0);
00911 }
00912 
00913 //______________________________________________________________________________
00914 Bool_t TMySQLStatement::SetString(Int_t npar, const char* value, Int_t maxsize)
00915 {
00916    // Set parameter value as string.
00917 
00918    Int_t len = value ? strlen(value) : 0;
00919 
00920    void* addr = BeforeSet("SetString", npar, MYSQL_TYPE_STRING, true, maxsize);
00921 
00922    if (addr==0) return kFALSE;
00923 
00924    if (len >= fBuffer[npar].fSize) {
00925       free(fBuffer[npar].fMem);
00926 
00927       fBuffer[npar].fMem = malloc(len+1);
00928       fBuffer[npar].fSize = len + 1;
00929 
00930       fBind[npar].buffer = fBuffer[npar].fMem;
00931       fBind[npar].buffer_length = fBuffer[npar].fSize;
00932 
00933       addr = fBuffer[npar].fMem;
00934       fNeedParBind = kTRUE;
00935    }
00936 
00937    strcpy((char*) addr, value);
00938 
00939    fBuffer[npar].fResLength = len;
00940 
00941    return kTRUE;
00942 }
00943 
00944 //______________________________________________________________________________
00945 Bool_t TMySQLStatement::SetBinary(Int_t npar, void* mem, Long_t size, Long_t maxsize)
00946 {
00947    // Set parameter value as binary data.
00948 
00949    if (size>=maxsize) maxsize = size + 1;
00950 
00951    int bin_type = MYSQL_TYPE_BLOB;
00952    if (maxsize > 65525) bin_type = MYSQL_TYPE_MEDIUM_BLOB;
00953    if (maxsize > 16777205) bin_type = MYSQL_TYPE_LONG_BLOB;
00954 
00955    void* addr = BeforeSet("SetBinary", npar, bin_type, true, maxsize);
00956 
00957    if (addr==0) return kFALSE;
00958 
00959    if (size >= fBuffer[npar].fSize) {
00960       free(fBuffer[npar].fMem);
00961 
00962       fBuffer[npar].fMem = malloc(size+1);
00963       fBuffer[npar].fSize = size + 1;
00964 
00965       fBind[npar].buffer = fBuffer[npar].fMem;
00966       fBind[npar].buffer_length = fBuffer[npar].fSize;
00967 
00968       addr = fBuffer[npar].fMem;
00969       fNeedParBind = kTRUE;
00970    }
00971 
00972    memcpy(addr, mem, size);
00973 
00974    fBuffer[npar].fResLength = size;
00975 
00976    return kTRUE;
00977 }
00978 
00979 //______________________________________________________________________________
00980 Bool_t TMySQLStatement::SetDate(Int_t npar, Int_t year, Int_t month, Int_t day)
00981 {
00982    // Set parameter value as date.
00983 
00984    MYSQL_TIME* addr = (MYSQL_TIME*) BeforeSet("SetDate", npar, MYSQL_TYPE_DATE);
00985 
00986    if (addr!=0) {
00987       addr->year = year;
00988       addr->month = month;
00989       addr->day = day;
00990    }
00991 
00992    return (addr!=0);
00993 }
00994 
00995 //______________________________________________________________________________
00996 Bool_t TMySQLStatement::SetTime(Int_t npar, Int_t hour, Int_t min, Int_t sec)
00997 {
00998    // Set parameter value as time.
00999 
01000    MYSQL_TIME* addr = (MYSQL_TIME*) BeforeSet("SetTime", npar, MYSQL_TYPE_TIME);
01001 
01002    if (addr!=0) {
01003       addr->hour = hour;
01004       addr->minute = min;
01005       addr->second = sec;
01006    }
01007 
01008    return (addr!=0);
01009 }
01010 
01011 //______________________________________________________________________________
01012 Bool_t TMySQLStatement::SetDatime(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec)
01013 {
01014    // Set parameter value as date & time.
01015 
01016    MYSQL_TIME* addr = (MYSQL_TIME*) BeforeSet("SetDatime", npar, MYSQL_TYPE_DATETIME);
01017 
01018    if (addr!=0) {
01019       addr->year = year;
01020       addr->month = month;
01021       addr->day = day;
01022       addr->hour = hour;
01023       addr->minute = min;
01024       addr->second = sec;
01025    }
01026 
01027    return (addr!=0);
01028 }
01029 
01030 //______________________________________________________________________________
01031 Bool_t TMySQLStatement::SetTimestamp(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec, Int_t)
01032 {
01033    // Set parameter value as timestamp.
01034 
01035    MYSQL_TIME* addr = (MYSQL_TIME*) BeforeSet("SetTimestamp", npar, MYSQL_TYPE_TIMESTAMP);
01036 
01037    if (addr!=0) {
01038       addr->year = year;
01039       addr->month = month;
01040       addr->day = day;
01041       addr->hour = hour;
01042       addr->minute = min;
01043       addr->second = sec;
01044    }
01045 
01046    return (addr!=0);
01047 }
01048 
01049 #else
01050 
01051 //______________________________________________________________________________
01052 TMySQLStatement::TMySQLStatement(MYSQL_STMT*, Bool_t)
01053 {
01054    // Normal constructor.
01055    // For MySQL version < 4.1 no statement is supported
01056 }
01057 
01058 //______________________________________________________________________________
01059 TMySQLStatement::~TMySQLStatement()
01060 {
01061    // Destructor.
01062 }
01063 
01064 //______________________________________________________________________________
01065 void TMySQLStatement::Close(Option_t *)
01066 {
01067    // Close statement
01068 }
01069 
01070 //______________________________________________________________________________
01071 Bool_t TMySQLStatement::Process()
01072 {
01073    // Process statement.
01074 
01075    return kFALSE;
01076 }
01077 
01078 //______________________________________________________________________________
01079 Int_t TMySQLStatement::GetNumAffectedRows()
01080 {
01081    // Return number of affected rows after statement is processed.
01082 
01083    return 0;
01084 }
01085 
01086 //______________________________________________________________________________
01087 Int_t TMySQLStatement::GetNumParameters()
01088 {
01089    // Return number of statement parameters.
01090 
01091    return 0;
01092 }
01093 
01094 //______________________________________________________________________________
01095 Bool_t TMySQLStatement::StoreResult()
01096 {
01097    // Store result of statement processing to access them
01098    // via GetInt(), GetDouble() and so on methods.
01099 
01100    return kFALSE;
01101 }
01102 
01103 //______________________________________________________________________________
01104 Int_t TMySQLStatement::GetNumFields()
01105 {
01106    // Return number of fields in result set.
01107 
01108    return 0;
01109 }
01110 
01111 //______________________________________________________________________________
01112 const char* TMySQLStatement::GetFieldName(Int_t)
01113 {
01114    // Returns field name in result set.
01115 
01116    return 0;
01117 }
01118 
01119 //______________________________________________________________________________
01120 Bool_t TMySQLStatement::NextResultRow()
01121 {
01122    // Shift cursor to nect row in result set.
01123 
01124    return kFALSE;
01125 }
01126 
01127 
01128 //______________________________________________________________________________
01129 Bool_t TMySQLStatement::NextIteration()
01130 {
01131    // Increment iteration counter for statement, where parameter can be set.
01132    // Statement with parameters of previous iteration
01133    // automatically will be applied to database.
01134 
01135    return kFALSE;
01136 }
01137 
01138 //______________________________________________________________________________
01139 void TMySQLStatement::FreeBuffers()
01140 {
01141    // Release all buffers, used by statement.
01142 }
01143 
01144 //______________________________________________________________________________
01145 void TMySQLStatement::SetBuffersNumber(Int_t)
01146 {
01147    // Allocate buffers for statement parameters/ result fields.
01148 }
01149 
01150 //______________________________________________________________________________
01151 const char* TMySQLStatement::ConvertToString(Int_t)
01152 {
01153    // Convert field value to string.
01154 
01155    return 0;
01156 }
01157 
01158 //______________________________________________________________________________
01159 long double TMySQLStatement::ConvertToNumeric(Int_t)
01160 {
01161    // Convert field to numeric value.
01162 
01163    return 0;
01164 }
01165 
01166 //______________________________________________________________________________
01167 Bool_t TMySQLStatement::IsNull(Int_t)
01168 {
01169    // Checks if field value is null.
01170 
01171    return kTRUE;
01172 }
01173 
01174 //______________________________________________________________________________
01175 Int_t TMySQLStatement::GetInt(Int_t)
01176 {
01177    // Return field value as integer.
01178 
01179    return 0;
01180 }
01181 
01182 //______________________________________________________________________________
01183 UInt_t TMySQLStatement::GetUInt(Int_t)
01184 {
01185    // Return field value as unsigned integer.
01186 
01187    return 0;
01188 }
01189 
01190 //______________________________________________________________________________
01191 Long_t TMySQLStatement::GetLong(Int_t)
01192 {
01193    // Return field value as long integer.
01194 
01195    return 0;
01196 }
01197 
01198 //______________________________________________________________________________
01199 Long64_t TMySQLStatement::GetLong64(Int_t)
01200 {
01201    // Return field value as 64-bit integer.
01202 
01203    return 0;
01204 }
01205 
01206 //______________________________________________________________________________
01207 ULong64_t TMySQLStatement::GetULong64(Int_t)
01208 {
01209    // Return field value as unsigned 64-bit integer.
01210 
01211    return 0;
01212 }
01213 
01214 //______________________________________________________________________________
01215 Double_t TMySQLStatement::GetDouble(Int_t)
01216 {
01217    // Return field value as double.
01218 
01219    return 0.;
01220 }
01221 
01222 //______________________________________________________________________________
01223 const char *TMySQLStatement::GetString(Int_t)
01224 {
01225    // Return field value as string.
01226 
01227    return 0;
01228 }
01229 
01230 //______________________________________________________________________________
01231 Bool_t TMySQLStatement::GetBinary(Int_t, void* &, Long_t&)
01232 {
01233    // Return field value as binary array.
01234 
01235    return kFALSE;
01236 }
01237 
01238 
01239 //______________________________________________________________________________
01240 Bool_t TMySQLStatement::GetDate(Int_t, Int_t&, Int_t&, Int_t&)
01241 {
01242    // Return field value as date.
01243 
01244    return kFALSE;
01245 }
01246 
01247 //______________________________________________________________________________
01248 Bool_t TMySQLStatement::GetTime(Int_t, Int_t&, Int_t&, Int_t&)
01249 {
01250    // Return field value as time.
01251 
01252    return kFALSE;
01253 }
01254 
01255 //______________________________________________________________________________
01256 Bool_t TMySQLStatement::GetDatime(Int_t, Int_t&, Int_t&, Int_t&, Int_t&, Int_t&, Int_t&)
01257 {
01258    // Return field value as date & time.
01259 
01260    return kFALSE;
01261 }
01262 
01263 //______________________________________________________________________________
01264 Bool_t TMySQLStatement::GetTimestamp(Int_t, Int_t&, Int_t&, Int_t&, Int_t&, Int_t&, Int_t&, Int_t&)
01265 {
01266    // Return field value as time stamp.
01267 
01268    return kFALSE;
01269 }
01270 
01271 //______________________________________________________________________________
01272 Bool_t TMySQLStatement::SetSQLParamType(Int_t, int, bool, unsigned long)
01273 {
01274    // Set parameter type to be used as buffer.
01275    // Used in both setting data to database and retriving data from data base.
01276    // Initialize proper MYSQL_BIND structure and allocate required buffers.
01277 
01278    return kFALSE;
01279 }
01280 
01281 //______________________________________________________________________________
01282 void *TMySQLStatement::BeforeSet(const char*, Int_t, Int_t, Bool_t, unsigned long)
01283 {
01284    // Check boundary condition before setting value of parameter.
01285    // Return address of parameter buffer.
01286 
01287    return 0;
01288 }
01289 
01290 //______________________________________________________________________________
01291 Bool_t TMySQLStatement::SetNull(Int_t)
01292 {
01293    // Set NULL as parameter value.
01294    // If NULL should be set for statement parameter during first iteration,
01295    // one should call before proper Set... method to identify type of argument for
01296    // the future. For instance, if one suppose to have double as type of parameter,
01297    // code should look like:
01298    //    stmt->SetDouble(2, 0.);
01299    //    stmt->SetNull(2);
01300 
01301    return kFALSE;
01302 }
01303 
01304 //______________________________________________________________________________
01305 Bool_t TMySQLStatement::SetInt(Int_t, Int_t)
01306 {
01307    // Set parameter value as integer.
01308 
01309    return kFALSE;
01310 }
01311 
01312 //______________________________________________________________________________
01313 Bool_t TMySQLStatement::SetUInt(Int_t, UInt_t)
01314 {
01315    // Set parameter value as unsigned integer.
01316 
01317    return kFALSE;
01318 }
01319 
01320 //______________________________________________________________________________
01321 Bool_t TMySQLStatement::SetLong(Int_t, Long_t)
01322 {
01323    // Set parameter value as long integer.
01324 
01325    return kFALSE;
01326 }
01327 
01328 //______________________________________________________________________________
01329 Bool_t TMySQLStatement::SetLong64(Int_t, Long64_t)
01330 {
01331    // Set parameter value as 64-bit integer.
01332 
01333    return kFALSE;
01334 }
01335 
01336 //______________________________________________________________________________
01337 Bool_t TMySQLStatement::SetULong64(Int_t, ULong64_t)
01338 {
01339    // Set parameter value as unsigned 64-bit integer.
01340 
01341    return kFALSE;
01342 }
01343 
01344 //______________________________________________________________________________
01345 Bool_t TMySQLStatement::SetDouble(Int_t, Double_t)
01346 {
01347    // Set parameter value as double.
01348 
01349    return kFALSE;
01350 }
01351 
01352 //______________________________________________________________________________
01353 Bool_t TMySQLStatement::SetString(Int_t, const char*, Int_t)
01354 {
01355    // Set parameter value as string.
01356 
01357    return kFALSE;
01358 }
01359 
01360 //______________________________________________________________________________
01361 Bool_t TMySQLStatement::SetBinary(Int_t, void*, Long_t, Long_t)
01362 {
01363    // Set parameter value as binary data.
01364 
01365    return kFALSE;
01366 }
01367 
01368 //______________________________________________________________________________
01369 Bool_t TMySQLStatement::SetDate(Int_t, Int_t, Int_t, Int_t)
01370 {
01371    // Set parameter value as date.
01372 
01373    return kFALSE;
01374 }
01375 
01376 //______________________________________________________________________________
01377 Bool_t TMySQLStatement::SetTime(Int_t, Int_t, Int_t, Int_t)
01378 {
01379    // Set parameter value as time.
01380 
01381    return kFALSE;
01382 }
01383 
01384 //______________________________________________________________________________
01385 Bool_t TMySQLStatement::SetDatime(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
01386 {
01387    // Set parameter value as date & time.
01388 
01389    return kFALSE;
01390 }
01391 
01392 //______________________________________________________________________________
01393 Bool_t TMySQLStatement::SetTimestamp(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
01394 {
01395    // Set parameter value as timestamp.
01396 
01397    return kFALSE;
01398 }
01399 
01400 #endif // MYSQL_VERSION_ID > 40100

Generated on Tue Jul 5 15:14:38 2011 for ROOT_528-00b_version by  doxygen 1.5.1