Changeset 4e9b5ad in tol


Ignore:
Timestamp:
Dec 3, 2010, 11:07:28 AM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
76a56bf
Parents:
1121f7d
Message:

fixes #1027, libtolodbc should check for constants returned by ODBC 3.0

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2743 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/dbdrivers/libtolodbc.c

    r1121f7d r4e9b5ad  
    362362
    363363  dbd->typeList[nfield] = pfSqlType;
     364  //printf( "pfSqlType=%d\n", pfSqlType );
    364365  switch (pfSqlType)
    365366    {
    … …  
    377378      }
    378379    case SQL_DATE: case SQL_TIME: case SQL_TIMESTAMP:
     380#if (ODBCVER >= 0x0300)
     381    case SQL_TYPE_DATE: case SQL_TYPE_TIME: case SQL_TYPE_TIMESTAMP:
     382#endif
    379383      {
    380384        ret = TypeDBDate;
    … …  
    618622    {
    619623    case SQL_DATE:
     624#if (ODBCVER >= 0x0300)
     625    case SQL_TYPE_DATE:
     626#endif
    620627      size   = sizeof(struct tagDATE_STRUCT);
    621628      x_date = (struct tagDATE_STRUCT *)malloc(size);
    … …  
    624631      break;
    625632    case SQL_TIME:
     633#if (ODBCVER >= 0x0300)
     634    case SQL_TYPE_TIME:
     635#endif
    626636      size   = sizeof(struct tagTIME_STRUCT);
    627637      x_time = (struct tagTIME_STRUCT *)malloc(size);
    … …  
    630640      break;
    631641    case SQL_TIMESTAMP:
     642#if (ODBCVER >= 0x0300)
     643    case SQL_TYPE_TIMESTAMP:
     644#endif
    632645      size        = sizeof(struct tagTIMESTAMP_STRUCT);
    633646      x_timestamp = (struct tagTIMESTAMP_STRUCT *)malloc(size);
    … …  
    665678    {
    666679    case SQL_DATE:
     680#if (ODBCVER >= 0x0300)
     681    case SQL_TYPE_DATE:
     682#endif
    667683      (*dateval)->year  = (unsigned short)(x_date->year);
    668684      (*dateval)->month = (unsigned short)(x_date->month);
    … …  
    670686      break;
    671687    case SQL_TIME:
     688#if (ODBCVER >= 0x0300)
     689    case SQL_TYPE_TIME:
     690#endif
    672691      (*dateval)->hour    = (unsigned short)(x_time->hour);
    673692      (*dateval)->minute  = (unsigned short)(x_time->minute);
    … …  
    675694      break;
    676695    case SQL_TIMESTAMP:
     696#if (ODBCVER >= 0x0300)
     697    case SQL_TYPE_TIMESTAMP:
     698#endif
    677699      (*dateval)->year    = (unsigned short)(x_timestamp->year);
    678700      (*dateval)->month   = (unsigned short)(x_timestamp->month);
Note: See TracChangeset for help on using the changeset viewer.