diff --git a/storage/connect/global.h b/storage/connect/global.h index acd8b47ae9d..3b8e11d34d5 100644 --- a/storage/connect/global.h +++ b/storage/connect/global.h @@ -143,7 +143,7 @@ typedef unsigned char BYTE; typedef char *LPSTR; typedef char *PSZ; #if !defined(NODW) -typedef int DWORD; +typedef unsigned int DWORD; #endif // !NODW #undef HANDLE typedef int HANDLE; diff --git a/storage/connect/sqlutil.h b/storage/connect/sqlutil.h deleted file mode 100644 index bc1f1e5569e..00000000000 --- a/storage/connect/sqlutil.h +++ /dev/null @@ -1,30 +0,0 @@ -#define SQL_UNKNOWN_TYPE 0 -#define SQL_CHAR 1 -#define SQL_NUMERIC 2 -#define SQL_DECIMAL 3 -#define SQL_INTEGER 4 -#define SQL_SMALLINT 5 -#define SQL_FLOAT 6 -#define SQL_REAL 7 -#define SQL_DOUBLE 8 -#define SQL_DATETIME 9 -#define SQL_VARCHAR 12 -#define SQL_TYPE_NULL 0 -#define SQL_DATE 9 -#define SQL_INTERVAL 10 -#define SQL_TIME 10 -#define SQL_TIMESTAMP 11 -#define SQL_LONGVARCHAR (-1) -#define SQL_BINARY (-2) -#define SQL_VARBINARY (-3) -#define SQL_LONGVARBINARY (-4) -#define SQL_BIGINT (-5) -#define SQL_TINYINT (-6) -#define SQL_BIT (-7) -#define SQL_GUID (-11) -#define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */ -#define SQL_C_LONG SQL_INTEGER /* INTEGER */ -#define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */ -#define SQL_C_FLOAT SQL_REAL /* REAL */ -#define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */ -#define SQL_C_TIMESTAMP SQL_TIMESTAMP diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 5f892d9fc9b..3eea691f659 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -32,15 +32,17 @@ #include "my_global.h" #if defined(WIN32) //#include -#include -#include #else // !WIN32 #include -#include "sqlutil.h" #endif // !WIN32 #include +#ifdef ODBC_SUPPORT +#include +#include +#endif + #undef DOMAIN // Was defined in math.h /***********************************************************************/ @@ -198,6 +200,7 @@ int GetDBType(int type) return tp; } // end of GetPLGType +#if ODBC_SUPPORT /***********************************************************************/ /* GetSQLType: returns the SQL_TYPE corresponding to a PLG type. */ /***********************************************************************/ @@ -235,6 +238,8 @@ int GetSQLCType(int type) return tp; } // end of GetSQLCType +#endif /* ODBC_SUPPORT */ + /***********************************************************************/ /* GetFormatType: returns the FORMAT character(s) according to type. */ @@ -274,6 +279,7 @@ int GetFormatType(char c) return type; } // end of GetFormatType +#ifdef ODBC_SUPPORT /***********************************************************************/ /* TranslateSQLType: translate a SQL Type to a PLG type. */ /***********************************************************************/ @@ -338,6 +344,7 @@ int TranslateSQLType(int stp, int prec, int& len) return type; } // end of TranslateSQLType +#endif ODBC_SUPPORT /***********************************************************************/ /* IsTypeChar: returns true for character type(s). */ diff --git a/storage/connect/value.h b/storage/connect/value.h index c1ed3865a5e..7570deb2283 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -39,14 +39,18 @@ typedef struct _datpar *PDTP; // For DTVAL /* Utilities used to test types and to allocated values. */ /***********************************************************************/ int GetPLGType(int); +#ifdef ODBC_SUPPORT short GetSQLType(int); int GetSQLCType(int); +#endif PVAL AllocateValue(PGLOBAL, void *, short); // Exported functions DllExport PSZ GetTypeName(int); DllExport int GetTypeSize(int, int); +#ifdef ODBC_SUPPORT DllExport int TranslateSQLType(int stp, int prec, int& len); +#endif DllExport char *GetFormatType(int); DllExport int GetFormatType(char); DllExport int GetDBType(int);