You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by ry...@apache.org on 2016/07/26 04:08:08 UTC

[4/5] incubator-trafodion git commit: Change Driver manager to map type code based on app runtime version as Selva commented. This is the right behavior

Change Driver manager to map type code based on app runtime version as Selva commented. This is the right behavior


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/569b369a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/569b369a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/569b369a

Branch: refs/heads/master
Commit: 569b369a7dc5713e7b6c01c5a54fcdc32e4078e9
Parents: 304a7ca 3b147b9
Author: ryzuo <jo...@gmail.com>
Authored: Thu Jul 21 04:11:07 2016 +0000
Committer: ryzuo <jo...@gmail.com>
Committed: Thu Jul 21 04:11:07 2016 +0000

----------------------------------------------------------------------
 .../unixcli/DrvrManager/drvrmanager.cpp         | 52 +++++++++++---------
 1 file changed, 28 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/569b369a/core/conn/unixodbc/odbc/odbcclient/unixcli/DrvrManager/drvrmanager.cpp
----------------------------------------------------------------------
diff --cc core/conn/unixodbc/odbc/odbcclient/unixcli/DrvrManager/drvrmanager.cpp
index 97bdbd1,21ff250..9bc0763
--- a/core/conn/unixodbc/odbc/odbcclient/unixcli/DrvrManager/drvrmanager.cpp
+++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/DrvrManager/drvrmanager.cpp
@@@ -3836,34 -3832,34 +3836,38 @@@ SQLRETURN SQL_API SQLColAttribute_commo
  	rc = NeoColAttribute(StatementHandle,ColumnNumber,FieldIdentifier,CharacterAttributePtr,BufferLength,StringLengthPtr,NumericAttributePtr,isWideCall);
  	if (rc == SQL_SUCCESS && FieldIdentifier == SQL_DESC_CONCISE_TYPE)
  	{
--#if (ODBCVER >= 0x0300)
--        switch((SQLINTEGER)*(SQLINTEGER*)NumericAttributePtr)
++        SQLINTEGER ODBCAppVersion = pstmt->getODBCAppVersion();
++        if (ODBCAppVersion >= SQL_OV_ODBC3)
          {
--            case SQL_DATE:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_DATE;
--                break;
--            case SQL_TIME:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_TIME;
--                break;
--            case SQL_TIMESTAMP:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_TIMESTAMP;
--                break;
++            switch((SQLINTEGER)*(SQLINTEGER*)NumericAttributePtr)
++            {
++                case SQL_DATE:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_DATE;
++                    break;
++                case SQL_TIME:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_TIME;
++                    break;
++                case SQL_TIMESTAMP:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_TYPE_TIMESTAMP;
++                    break;
++            }
          }
--#else
--        switch((SQLINTEGER)*(SQLINTEGER*)NumericAttributePtr)
++        else
          {
--            case SQL_TYPE_DATE:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_DATE;
--                break;
--            case SQL_TYPE_TIME:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_TIME;
--                break;
--            case SQL_TYPE_TIMESTAMP:
--                *(SQLINTEGER*)NumericAttributePtr = SQL_TIMESTAMP;
--                break;
++            switch((SQLINTEGER)*(SQLINTEGER*)NumericAttributePtr)
++            {
++                case SQL_TYPE_DATE:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_DATE;
++                    break;
++                case SQL_TYPE_TIME:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_TIME;
++                    break;
++                case SQL_TYPE_TIMESTAMP:
++                    *(SQLINTEGER*)NumericAttributePtr = SQL_TIMESTAMP;
++                    break;
++            }
          }
--#endif
--	}
++    }
  	/* state transition */
  	if (pstmt->asyn_on == en_ColAttribute)
      {