,COLUMNS_RADIX
,COLUMNS_NULLABLE
,COLUMNS_REMARKS
+ ,COLUMNS_COLUMN_DEF /* ODBC 3.0 but always use it */
#if (ODBCVER >= 0x0300)
- ,COLUMNS_COLUMN_DEF
,COLUMNS_SQL_DATA_TYPE
,COLUMNS_SQL_DATETIME_SUB
,COLUMNS_CHAR_OCTET_LENGTH
case SQL_CONVERT_VARBINARY: /* ODBC 1.0 */
case SQL_CONVERT_CHAR:
case SQL_CONVERT_LONGVARCHAR:
-#ifdef UNICODE_SUPPORT
+#if defined(UNICODE_SUPPORT) && (ODBCVER >= 0x0300)
case SQL_CONVERT_WCHAR:
case SQL_CONVERT_WLONGVARCHAR:
case SQL_CONVERT_WVARCHAR:
case SQL_QUALIFIER_USAGE: /* ODBC 2.0 */
len = 4;
+#if (ODBCVER >= 0x0300)
if (CurrCat(conn))
value = SQL_CU_DML_STATEMENTS;
else
+#endif /* ODBCVER */
value = 0;
break;
*/
/* make_string mallocs memory */
tableType = make_string(szTableType, cbTableType, NULL, 0);
+#if (ODBCVER >= 0x0300)
if (search_pattern &&
escTableName && '\0' == escTableName[0] &&
escCatName && escSchemaName)
stricmp(escSchemaName, SQL_ALL_SCHEMAS) == 0)
list_schemas = TRUE;
}
+#endif /* ODBCVER */
list_some = (list_cat || list_schemas || list_table_types);
tables_query[0] = '\0';
show_regular_tables = TRUE;
show_views = TRUE;
}
+#if (ODBCVER >= 0x0300)
else if (list_some || stricmp(tableType, SQL_ALL_TABLE_TYPES) == 0)
{
show_regular_tables = TRUE;
show_views = TRUE;
}
+#endif /* ODBCVER */
else
{
strcpy(table_types, tableType);
qst, NativeError, mtxt, buflen, &tlen);
if (qst)
utf8_to_ucs2(qst, strlen(qst), Sqlstate, 5);
- if (TextLength)
- *TextLength = utf8_to_ucs2(mtxt, tlen, MessageText, BufferLength);
- free(qst);
- if (mtxt)
+ if (NULL != mtxt)
+ {
+ SQLULEN tulen = utf8_to_ucs2(mtxt, tlen, MessageText, BufferLength);
+ if (NULL != TextLength)
+ *TextLength = tulen;
free(mtxt);
+ }
+ if (qst)
+ free(qst);
return ret;
}
return basetype;
}
-#if (ODBCVER >= 0x0300)
#define MONTH_BIT (1 << 17)
#define YEAR_BIT (1 << 18)
#define DAY_BIT (1 << 19)
#define MINUTE_BIT (1 << 27)
#define SECOND_BIT (1 << 28)
+#if (ODBCVER >= 0x0300)
static SQLSMALLINT
get_interval_type(Int4 atttypmod, const char **name)
{
mylog("%s: type=%d, atttypmod=%d\n", __FUNCTION__, type, atttypmod);
ttl = leading_precision;
+#if (ODBCVER >= 0x0300)
switch (get_interval_type(atttypmod, NULL))
{
case SQL_INTERVAL_DAY_TO_SECOND:
ttl += 3;
break;
}
+#else
+ ttl += 9;
+#endif /* ODBCVER */
scale = getIntervalDecimalDigits(type, atttypmod);
return (scale > 0) ? ttl + 1 + scale : ttl;
}
*
* Comments: See "notice.txt" for copyright and license information.
*
- * $Id: psqlodbc.h,v 1.134 2010/01/24 07:56:13 hinoue Exp $
+ * $Id: psqlodbc.h,v 1.135 2011/06/19 12:27:30 hinoue Exp $
*
*/
#define FORMAT_INT4 "%d" /* Int4 */
#define FORMAT_UINT4 "%u" /* UInt4 */
+#ifndef SQL_TRUE
+#define SQL_TRUE TRUE
+#endif /* SQL_TRUE */
+#ifndef SQL_FALSE
+#define SQL_FALSE FALSE
+#endif /* SQL_FALSE */
+
#ifdef WIN32
#ifndef SSIZE_T_DEFINED
#define ssize_t SSIZE_T
return SQL_ERROR;
}
+#if (ODBCVER >= 0x0300)
if (SQL_ARD_TYPE == fCType)
{
ARDFields *opts;
}
}
else
+#endif /* ODBCVER */
target_type = fCType;
if (icol == 0)
{
#define POSTGRESDRIVERVERSION "09.00.0301"
#define POSTGRES_RESOURCE_VERSION "09.00.0301\0"
#define PG_DRVFILE_VERSION 9,0,03,01
-#define PG_BUILD_VERSION "201106190003"
+#define PG_BUILD_VERSION "201106190004"
#endif