--- psqlodbc-08.01.0200.orig/debian/patches/psqlodbc-413534.diff +++ psqlodbc-08.01.0200/debian/patches/psqlodbc-413534.diff @@ -0,0 +1,135 @@ +diff -ur psqlodbc-08.01.0200.orig/convert.c psqlodbc-08.01.0200/convert.c +--- psqlodbc-08.01.0200.orig/convert.c 2007-03-07 12:10:01.000000000 -0500 ++++ psqlodbc-08.01.0200/convert.c 2007-03-07 12:10:17.000000000 -0500 +@@ -379,14 +379,14 @@ + + SC_set_current_col(stmt, -1); + return copy_and_convert_field(stmt, field_type, value, (Int2) bic->returntype, (PTR) (bic->buffer + offset), +- (SDWORD) bic->buflen, (bic->used + (offset >> 2))); ++ bic->buflen, (bic->used + (offset >> 2))); + } + + + /* This is called by SQLGetData() */ + int + copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, +- PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue) ++ PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) + { + CSTR func = "copy_and_convert_field"; + ARDFields *opts = SC_get_ARDF(stmt); +@@ -454,7 +454,7 @@ + pcbValueOffset = rgbValueOffset = (bind_size * bind_row); + else + { +- pcbValueOffset = bind_row * sizeof(SDWORD); ++ pcbValueOffset = bind_row * sizeof(SQLLEN); + rgbValueOffset = bind_row * cbValueMax; + } + /* +@@ -486,7 +486,7 @@ + */ + if (pcbValue) + { +- *((SDWORD *) pcbValueBindRow) = SQL_NULL_DATA; ++ *((SQLLEN *) pcbValueBindRow) = SQL_NULL_DATA; + return COPY_OK; + } + else +@@ -663,7 +663,7 @@ + + /* There is no corresponding fCType for this. */ + if (pcbValue) +- *((SDWORD *) pcbValueBindRow) = len; ++ *((SQLLEN *) pcbValueBindRow) = len; + + return COPY_OK; /* dont go any further or the data will be + * trashed */ +@@ -675,13 +675,13 @@ + */ + case PG_TYPE_LO_UNDEFINED: + +- return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SDWORD *) pcbValueBindRow); ++ return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SQLLEN *) pcbValueBindRow); + + default: + + if (field_type == stmt->hdbc->lobj_type) /* hack until permanent + * type available */ +- return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SDWORD *) pcbValueBindRow); ++ return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, (SQLLEN *) pcbValueBindRow); + } + + /* Change default into something useable */ +@@ -956,13 +956,13 @@ + { + char *str = strdup(rgbValueBindRow); + UInt4 ucount = utf8_to_ucs2(str, len, (SQLWCHAR *) rgbValueBindRow, cbValueMax / WCLEN); +- if (cbValueMax < (SDWORD) (WCLEN * ucount)) ++ if (cbValueMax < WCLEN * ucount) + result = COPY_RESULT_TRUNCATED; + free(str); + } + else + { +- if ((SDWORD) (len + WCLEN) <= cbValueMax) ++ if (len + WCLEN <= cbValueMax) + { + result = COPY_OK; + } +@@ -1263,7 +1263,7 @@ + if (neut_str) + len = strlen(neut_str); + if (pcbValue) +- *((SDWORD *) pcbValueBindRow) = len; ++ *((SQLLEN *) pcbValueBindRow) = len; + if (len > 0 && cbValueMax > 0) + { + memcpy(rgbValueBindRow, neut_str, len < cbValueMax ? len : cbValueMax); +@@ -1282,7 +1282,7 @@ + + inolog("SQL_C_VARBOOKMARK value=%d\n", ival); + if (pcbValue) +- *((SDWORD *) pcbValueBindRow) = sizeof(ival); ++ *((SQLLEN *) pcbValueBindRow) = sizeof(ival); + if (cbValueMax >= sizeof(ival)) + { + memcpy(rgbValueBindRow, &ival, sizeof(ival)); +@@ -1381,7 +1381,7 @@ + + /* store the length of what was copied, if there's a place for it */ + if (pcbValue) +- *((SDWORD *) pcbValueBindRow) = len; ++ *((SQLLEN *) pcbValueBindRow) = len; + + if (result == COPY_OK && stmt->current_col >= 0) + gdata->gdata[stmt->current_col].data_left = 0; +@@ -3873,7 +3873,7 @@ + */ + int + convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue, +- SDWORD cbValueMax, SDWORD *pcbValue) ++ SQLLEN cbValueMax, SQLLEN *pcbValue) + { + Oid oid; + int retval, +diff -ur psqlodbc-08.01.0200.orig/convert.h psqlodbc-08.01.0200/convert.h +--- psqlodbc-08.01.0200.orig/convert.h 2007-03-07 12:10:01.000000000 -0500 ++++ psqlodbc-08.01.0200/convert.h 2007-03-07 12:10:17.000000000 -0500 +@@ -37,7 +37,7 @@ + + int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col); + int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, +- PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue); ++ PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue); + + int copy_statement_with_parameters(StatementClass *stmt, BOOL); + BOOL convert_money(const char *s, char *sout, size_t soutmax); +@@ -52,6 +52,6 @@ + void encode(const char *in, char *out); + void decode(const char *in, char *out); + int convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue, +- SDWORD cbValueMax, SDWORD *pcbValue); ++ SQLLEN cbValueMax, SQLLEN *pcbValue); + + #endif --- psqlodbc-08.01.0200.orig/debian/patches/psqlodbc-358949.diff +++ psqlodbc-08.01.0200/debian/patches/psqlodbc-358949.diff @@ -0,0 +1,570 @@ +--- psqlodbc-08.01.0200.orig/qresult.c 2005-11-04 07:17:49.000000000 -0800 ++++ psqlodbc-08.01.0200/qresult.c 2006-04-09 02:08:11.000000000 -0700 +@@ -763,7 +763,7 @@ + if (field_lf >= effective_cols) + { + if (field_lf == effective_cols) +- sscanf(buffer, "(%lu,%hu)", ++ sscanf(buffer, "(%u,%hu)", + &this_keyset->blocknum, &this_keyset->offset); + else + this_keyset->oid = strtoul(buffer, NULL, 10); +--- psqlodbc-08.01.0200.orig/odbcapi30.c ++++ psqlodbc-08.01.0200/odbcapi30.c +@@ -70,9 +70,9 @@ + RETCODE SQL_API + SQLBindParam(HSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, +- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, PTR ParameterValue, +- SQLINTEGER *StrLen_or_Ind) ++ SQLLEN *StrLen_or_Ind) + { + RETCODE ret; + int BufferLength = 512; /* Is it OK ? */ +@@ -162,7 +162,7 @@ + /* SQLExtendedFetch -> SQLFetchScroll */ + RETCODE SQL_API + SQLFetchScroll(HSTMT StatementHandle, +- SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset) ++ SQLSMALLINT FetchOrientation, SQLROWOFFSET FetchOffset) + { + CSTR func = "SQLFetchScroll"; + StatementClass *stmt = (StatementClass *) StatementHandle; +@@ -252,7 +252,7 @@ + SQLSMALLINT RecNumber, SQLCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLSMALLINT *Type, SQLSMALLINT *SubType, +- SQLINTEGER *Length, SQLSMALLINT *Precision, ++ SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) + { + mylog("[[SQLGetDescRec]]\n"); +@@ -397,10 +397,10 @@ + RETCODE SQL_API + SQLSetDescRec(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT Type, +- SQLSMALLINT SubType, SQLINTEGER Length, ++ SQLSMALLINT SubType, SQLLEN Length, + SQLSMALLINT Precision, SQLSMALLINT Scale, +- PTR Data, SQLINTEGER *StringLength, +- SQLINTEGER *Indicator) ++ PTR Data, SQLLEN *StringLength, ++ SQLLEN *Indicator) + { + mylog("[[SQLSetDescRec]]\n"); + mylog("Error not implemented\n"); +--- psqlodbc-08.01.0200.orig/statement.c ++++ psqlodbc-08.01.0200/statement.c +@@ -1053,7 +1053,7 @@ + SC_set_current_col(self, -1); + result = copy_and_convert_field(self, 0, buf, SQL_C_ULONG, + bookmark->buffer + offset, 0, +- (SDWORD *) (bookmark->used ? bookmark->used + (offset >> 2) : NULL)); ++ (bookmark->used ? bookmark->used + (offset >> 2) : NULL)); + } + + if (self->options.retrieve_data == SQL_RD_OFF) /* data isn't required */ +@@ -1383,7 +1383,7 @@ + apdopts->parameters[0].CType, + apdopts->parameters[0].buffer, + apdopts->parameters[0].buflen, +- (SDWORD *) apdopts->parameters[0].used); ++ apdopts->parameters[0].used); + if (ret != SQL_SUCCESS) + { + SC_set_error(self, STMT_EXEC_ERROR, "GetData to Procedure return failed."); +--- psqlodbc-08.01.0200.orig/dlg_specific.c ++++ psqlodbc-08.01.0200/dlg_specific.c +@@ -206,12 +206,12 @@ + unfoldCXAttribute(ConnInfo *ci, const char *value) + { + int count; +- UInt4 flag; ++ unsigned long flag; + + if (strlen(value) < 2) + { + count = 3; +- sscanf(value, "%lx", (long unsigned int *) &flag); ++ sscanf(value, "%lx", &flag); + } + else + { +@@ -219,7 +219,7 @@ + memcpy(cnt, value, 2); + cnt[2] = '\0'; + sscanf(cnt, "%x", &count); +- sscanf(value + 2, "%lx", (long unsigned int *) &flag); ++ sscanf(value + 2, "%lx", &flag); + } + ci->disallow_premature = (char)((flag & BIT_DISALLOWPREMATURE) != 0); + ci->allow_keyset = (char)((flag & BIT_UPDATABLECURSORS) != 0); +--- psqlodbc-08.01.0200.orig/convert.c ++++ psqlodbc-08.01.0200/convert.c +@@ -379,14 +379,14 @@ + + SC_set_current_col(stmt, -1); + return copy_and_convert_field(stmt, field_type, value, (Int2) bic->returntype, (PTR) (bic->buffer + offset), +- (SDWORD) bic->buflen, (SDWORD *) (bic->used + (offset >> 2))); ++ (SDWORD) bic->buflen, (bic->used + (offset >> 2))); + } + + + /* This is called by SQLGetData() */ + int + copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, +- PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue) ++ PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue) + { + CSTR func = "copy_and_convert_field"; + ARDFields *opts = SC_get_ARDF(stmt); +--- psqlodbc-08.01.0200.orig/convert.h ++++ psqlodbc-08.01.0200/convert.h +@@ -37,7 +37,7 @@ + + int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col); + int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, +- PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue); ++ PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue); + + int copy_statement_with_parameters(StatementClass *stmt, BOOL); + BOOL convert_money(const char *s, char *sout, size_t soutmax); +--- psqlodbc-08.01.0200.orig/bind.c ++++ psqlodbc-08.01.0200/bind.c +@@ -34,11 +34,11 @@ + SQLSMALLINT fParamType, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, +- SQLUINTEGER cbColDef, ++ SQLULEN cbColDef, + SQLSMALLINT ibScale, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue) ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue) + { + StatementClass *stmt = (StatementClass *) hstmt; + CSTR func = "PGAPI_BindParameter"; +@@ -71,7 +71,7 @@ + /* store the given info */ + apdopts->parameters[ipar].buflen = cbValueMax; + apdopts->parameters[ipar].buffer = rgbValue; +- apdopts->parameters[ipar].used = (Int4 *) pcbValue; ++ apdopts->parameters[ipar].used = pcbValue; + apdopts->parameters[ipar].CType = fCType; + ipdopts->parameters[ipar].SQLType = fSqlType; + ipdopts->parameters[ipar].paramType = fParamType; +@@ -139,8 +139,8 @@ + SQLUSMALLINT icol, + SQLSMALLINT fCType, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue) ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue) + { + StatementClass *stmt = (StatementClass *) hstmt; + CSTR func = "PGAPI_BindCol"; +@@ -198,7 +198,7 @@ + + bookmark = ARD_AllocBookmark(opts); + bookmark->buffer = rgbValue; +- bookmark->used = (Int4 *) pcbValue; ++ bookmark->used = pcbValue; + bookmark->buflen = cbValueMax; + bookmark->returntype = fCType; + } +@@ -250,7 +250,7 @@ + /* ok, bind that column */ + opts->bindings[icol].buflen = cbValueMax; + opts->bindings[icol].buffer = rgbValue; +- opts->bindings[icol].used = (Int4 *) pcbValue; ++ opts->bindings[icol].used = pcbValue; + opts->bindings[icol].returntype = fCType; + + if (SQL_C_NUMERIC == fCType) +@@ -278,7 +278,7 @@ + PGAPI_DescribeParam(HSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, +- SQLUINTEGER *pcbColDef, ++ SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable) + { +@@ -331,8 +331,8 @@ + /* Sets multiple values (arrays) for the set of parameter markers. */ + RETCODE SQL_API + PGAPI_ParamOptions(HSTMT hstmt, +- SQLUINTEGER crow, +- SQLUINTEGER *pirow) ++ SQLULEN crow, ++ SQLULEN *pirow) + { + CSTR func = "PGAPI_ParamOptions"; + StatementClass *stmt = (StatementClass *) hstmt; +--- psqlodbc-08.01.0200.orig/bind.h ++++ psqlodbc-08.01.0200/bind.h +@@ -19,7 +19,7 @@ + { + Int4 buflen; /* size of buffer */ + char *buffer; /* pointer to the buffer */ +- Int4 *used; /* used space in the buffer (for strings ++ SQLLEN *used; /* used space in the buffer (for strings + * not counting the '\0') */ + Int2 returntype; /* kind of conversion to be applied when + * returning (SQL_C_DEFAULT, +@@ -45,7 +45,7 @@ + { + Int4 buflen; + char *buffer; +- Int4 *used; ++ SQLLEN *used; + Int2 CType; + Int2 precision; /* the precision for numeric or timestamp type */ + Int2 scale; /* the scale for numeric type */ +--- psqlodbc-08.01.0200.orig/odbcapiw.c ++++ psqlodbc-08.01.0200/odbcapiw.c +@@ -175,7 +175,7 @@ + RETCODE SQL_API SQLDescribeColW(HSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLWCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, +- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, ++ SQLSMALLINT *DataType, SQLULEN *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { + RETCODE ret; +--- psqlodbc-08.01.0200.orig/execute.c ++++ psqlodbc-08.01.0200/execute.c +@@ -561,7 +561,7 @@ + } + for (i = 0; i < param_count; i++) + { +- Int4 *pcVal = apdopts->parameters[i].used; ++ SQLLEN *pcVal = apdopts->parameters[i].used; + + apdopts->parameters[i].data_at_exec = FALSE; + if (pcVal) +--- psqlodbc-08.01.0200.orig/info.c ++++ psqlodbc-08.01.0200/info.c +@@ -2488,7 +2488,7 @@ + char isunique[10], + isclustered[10], + ishash[MAX_INFO_STRING]; +- SDWORD index_name_len, ++ SQLLEN index_name_len, + fields_vector_len; + TupleNode *row; + int i; +@@ -2498,7 +2498,7 @@ + table_qualifier[MAX_INFO_STRING], + relhasrules[10]; + char **column_names = NULL; +- SQLINTEGER column_name_len; ++ SQLLEN column_name_len; + int total_columns = 0; + ConnInfo *ci; + char buf[256]; +@@ -2950,7 +2950,7 @@ + StatementClass *tbl_stmt; + char tables_query[INFO_INQUIRY_LEN]; + char attname[MAX_INFO_STRING]; +- SDWORD attname_len; ++ SQLLEN attname_len; + char *pktab; + char pkscm[TABLE_NAME_STORAGE_LEN + 1]; + Int2 result_cols; +--- psqlodbc-08.01.0200.orig/options.c ++++ psqlodbc-08.01.0200/options.c +@@ -279,13 +279,13 @@ + if (stmt) + { + SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Unknown statement option (Set)"); +- sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam); ++ sprintf(option, "fOption=%d, vParam=%d", fOption, vParam); + SC_log_error(func, option, stmt); + } + if (conn) + { + CC_set_error(conn, STMT_NOT_IMPLEMENTED_ERROR, "Unknown statement option (Set)"); +- sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam); ++ sprintf(option, "fOption=%d, vParam=%d", fOption, vParam); + CC_log_error(func, option, conn); + } + +--- psqlodbc-08.01.0200.orig/odbcapi.c ++++ psqlodbc-08.01.0200/odbcapi.c +@@ -78,8 +78,8 @@ + RETCODE SQL_API + SQLBindCol(HSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, +- PTR TargetValue, SQLINTEGER BufferLength, +- SQLINTEGER *StrLen_or_Ind) ++ PTR TargetValue, SQLLEN BufferLength, ++ SQLLEN *StrLen_or_Ind) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) StatementHandle; +@@ -253,7 +253,7 @@ + SQLDescribeCol(HSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, +- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, ++ SQLSMALLINT *DataType, SQLULEN *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { + RETCODE ret; +@@ -381,8 +381,8 @@ + RETCODE SQL_API + SQLGetData(HSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, +- PTR TargetValue, SQLINTEGER BufferLength, +- SQLINTEGER *StrLen_or_Ind) ++ PTR TargetValue, SQLLEN BufferLength, ++ SQLLEN *StrLen_or_Ind) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) StatementHandle; +@@ -511,7 +511,7 @@ + + RETCODE SQL_API + SQLPutData(HSTMT StatementHandle, +- PTR Data, SQLINTEGER StrLen_or_Ind) ++ PTR Data, SQLLEN StrLen_or_Ind) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) StatementHandle; +@@ -526,7 +526,7 @@ + + RETCODE SQL_API + SQLRowCount(HSTMT StatementHandle, +- SQLINTEGER *RowCount) ++ SQLLEN *RowCount) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) StatementHandle; +@@ -557,9 +557,9 @@ + RETCODE SQL_API + SQLSetParam(HSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, +- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, PTR ParameterValue, +- SQLINTEGER *StrLen_or_Ind) ++ SQLLEN *StrLen_or_Ind) + { + mylog("[SQLSetParam]"); + SC_clear_error((StatementClass *) StatementHandle); +@@ -835,7 +835,7 @@ + HSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, +- SQLUINTEGER *pcbParamDef, ++ SQLULEN *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable) + { +@@ -855,8 +855,8 @@ + SQLExtendedFetch( + HSTMT hstmt, + SQLUSMALLINT fFetchType, +- SQLINTEGER irow, +- SQLUINTEGER *pcrow, ++ SQLROWOFFSET irow, ++ SQLROWSETSIZE *pcrow, + SQLUSMALLINT *rgfRowStatus) + { + RETCODE ret; +@@ -1021,8 +1021,8 @@ + RETCODE SQL_API + SQLParamOptions( + HSTMT hstmt, +- SQLUINTEGER crow, +- SQLUINTEGER *pirow) ++ SQLULEN crow, ++ SQLULEN *pirow) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) hstmt; +@@ -1238,7 +1238,7 @@ + RETCODE SQL_API + SQLSetPos( + HSTMT hstmt, +- SQLUSMALLINT irow, ++ SQLSETPOSIROW irow, + SQLUSMALLINT fOption, + SQLUSMALLINT fLock) + { +@@ -1323,11 +1323,11 @@ + SQLSMALLINT fParamType, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, +- SQLUINTEGER cbColDef, ++ SQLULEN cbColDef, + SQLSMALLINT ibScale, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue) ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue) + { + RETCODE ret; + StatementClass *stmt = (StatementClass *) hstmt; +--- psqlodbc-08.01.0200.orig/pgapifunc.h ++++ psqlodbc-08.01.0200/pgapifunc.h +@@ -29,8 +29,8 @@ + SQLUSMALLINT icol, + SQLSMALLINT fCType, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue); ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue); + RETCODE SQL_API PGAPI_Cancel(HSTMT StatementHandle); + RETCODE SQL_API PGAPI_Columns(HSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +@@ -58,7 +58,7 @@ + RETCODE SQL_API PGAPI_DescribeCol(HSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, +- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, ++ SQLSMALLINT *DataType, SQLULEN *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); + RETCODE SQL_API PGAPI_Disconnect(HDBC ConnectionHandle); + RETCODE SQL_API PGAPI_Error(HENV henv, +@@ -113,8 +113,8 @@ + SQLUSMALLINT icol, + SQLSMALLINT fCType, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue); ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue); + RETCODE SQL_API PGAPI_GetFunctions(HDBC ConnectionHandle, + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); + RETCODE SQL_API PGAPI_GetFunctions30(HDBC ConnectionHandle, +@@ -140,7 +140,7 @@ + PTR rgbValue, + SQLINTEGER cbValue); + RETCODE SQL_API PGAPI_RowCount(HSTMT hstmt, +- SQLINTEGER *pcrow); ++ SQLLEN *pcrow); + RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc, + SQLUSMALLINT fOption, + SQLPOINTER vParam); +@@ -193,7 +193,7 @@ + RETCODE SQL_API PGAPI_DescribeParam(HSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, +- SQLUINTEGER *pcbColDef, ++ SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + RETCODE SQL_API PGAPI_ExtendedFetch(HSTMT hstmt, +@@ -230,8 +230,8 @@ + HSTMT hstmt, + SQLSMALLINT *pcpar); + RETCODE SQL_API PGAPI_ParamOptions(HSTMT hstmt, +- SQLUINTEGER crow, +- SQLUINTEGER *pirow); ++ SQLULEN crow, ++ SQLULEN *pirow); + RETCODE SQL_API PGAPI_PrimaryKeys( + HSTMT hstmt, + SQLCHAR *szCatalogName, +@@ -278,11 +278,11 @@ + SQLSMALLINT fParamType, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, +- SQLUINTEGER cbColDef, ++ SQLULEN cbColDef, + SQLSMALLINT ibScale, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue); ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue); + RETCODE SQL_API PGAPI_SetScrollOptions( + HSTMT hstmt, + UWORD fConcurrency, +--- psqlodbc-08.01.0200.orig/results.c ++++ psqlodbc-08.01.0200/results.c +@@ -35,7 +35,7 @@ + + RETCODE SQL_API + PGAPI_RowCount(HSTMT hstmt, +- SQLINTEGER *pcrow) ++ SQLLEN *pcrow) + { + CSTR func = "PGAPI_RowCount"; + StatementClass *stmt = (StatementClass *) hstmt; +@@ -162,7 +162,7 @@ + SWORD cbColNameMax, + SWORD FAR * pcbColName, + SWORD FAR * pfSqlType, +- UDWORD FAR * pcbColDef, ++ SQLULEN FAR * pcbColDef, + SWORD FAR * pibScale, + SWORD FAR * pfNullable) + { +@@ -763,8 +763,8 @@ + SQLUSMALLINT icol, + SQLSMALLINT fCType, + PTR rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue) ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue) + { + CSTR func = "PGAPI_GetData"; + QResultClass *res; +@@ -2394,7 +2394,8 @@ + RETCODE ret; + UInt4 oid, offset, blocknum; + UInt2 pgoffset; +- Int4 *used, bind_size = opts->bind_size; ++ SQLLEN *used; ++ Int4 bind_size = opts->bind_size; + + s.stmt = stmt; + s.irow = irow; +@@ -2496,7 +2497,7 @@ + (SQLSMALLINT) fi[i]->decimal_digits, + bindings[i].buffer, + bindings[i].buflen, +- (SQLINTEGER *) bindings[i].used); ++ (SQLLEN *) bindings[i].used); + } + } + } +@@ -2676,7 +2677,7 @@ + bookmark->returntype, + bookmark->buffer + offset, + bookmark->buflen, +- (SDWORD *) (bookmark->used ++ (bookmark->used + ? (bookmark->used + (offset >> 2)) + : NULL)); + } +@@ -2766,7 +2767,8 @@ + char addstr[4096]; + RETCODE ret; + UInt4 offset; +- Int4 *used, bind_size = opts->bind_size; ++ SQLLEN *used; ++ Int4 bind_size = opts->bind_size; + Int4 fieldtype; + + mylog("POS ADD fi=%x ti=%x\n", fi, stmt->ti); +@@ -2832,7 +2834,7 @@ + (SQLSMALLINT) fi[i]->decimal_digits, + bindings[i].buffer, + bindings[i].buflen, +- (SQLINTEGER *) bindings[i].used); ++ (SQLLEN *) bindings[i].used); + } + } + else --- psqlodbc-08.01.0200.orig/debian/watch +++ psqlodbc-08.01.0200/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-(.*).tar.gz --- psqlodbc-08.01.0200.orig/debian/control +++ psqlodbc-08.01.0200/debian/control @@ -0,0 +1,34 @@ +Source: psqlodbc +Priority: optional +Section: libs +Maintainer: Peter Eisentraut +Build-Depends: cdbs (>= 0.4.37), debhelper (>= 5), libpq-dev, unixodbc-dev (>= 2.2.11-13) +Standards-Version: 3.6.2 + +Package: odbc-postgresql +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: unixodbc-bin +Enhances: unixodbc +Description: ODBC driver for PostgreSQL + This package provides a driver that allows ODBC-enabled applications to + access PostgreSQL databases. ODBC is an abstraction layer that allows + applications written for that layer to access databases in an manner + that is relatively independent of the particular database management + system. PostgreSQL is an open-source SQL database management system, + which can be accessed using this driver. + . + You need to install this package if you want to use an application that + provides database access through ODBC and you want that application to + access a PostgreSQL database. This package would need to be installed + on the same machine as that client application; the PostgreSQL database + server can be on a different machine and does not need any additional + software to accept ODBC clients. + . + If you want to write software that can access a database through the + ODBC abstraction layer, you need to install the unixODBC driver manager + development package unixodbc-dev, and possibly additional packages for + language bindings. This driver package is only used at run time. + . + Web site: http://odbc.postgresql.org/ --- psqlodbc-08.01.0200.orig/debian/rules +++ psqlodbc-08.01.0200/debian/rules @@ -0,0 +1,34 @@ +#!/usr/bin/make -f + +tempdir = debian/temp +# (not debian/tmp, which dh_clean removes too automatically) + +ifndef VARIANT + +build build-arch build-indep binary binary-arch binary-indep clean:: + debian/rules VARIANT=A $@ + debian/rules VARIANT=W $@ + +clean:: + rm -rf $(tempdir) build-A build-W + +else # VARIANT + +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_BUILDDIR = build-$(VARIANT) +DEB_DESTDIR = $(CURDIR)/$(tempdir) +DEB_DH_INSTALL_SOURCEDIR = $(tempdir) + +DEB_CONFIGURE_EXTRA_FLAGS = --libdir=/usr/lib/odbc --with-unixodbc + +ifeq ($(VARIANT),A) +DEB_CONFIGURE_EXTRA_FLAGS += --disable-unicode +endif + +install/odbc-postgresql:: + install -D -m 644 debian/odbcinst.ini.template $(DEB_DESTDIR)/usr/share/psqlodbc/odbcinst.ini.template + +endif # VARIANT --- psqlodbc-08.01.0200.orig/debian/changelog +++ psqlodbc-08.01.0200/debian/changelog @@ -0,0 +1,118 @@ +psqlodbc (1:08.01.0200-2.1) unstable; urgency=high + + * Non-maintainer upload. + * High-urgency upload for RC bugfix. + * Fix the signature of SQLGetData on 64-bit architectures. + + -- Steve Langasek Mon, 5 Mar 2007 22:28:19 -0800 + +psqlodbc (1:08.01.0200-2) unstable; urgency=low + + * Fix to build on 64-bit architectures (closes: #358949) + (patch by Steve Langasek) + + -- Peter Eisentraut Mon, 10 Apr 2006 13:58:05 +0200 + +psqlodbc (1:08.01.0200-1) unstable; urgency=low + + * New upstream release + * Fixed watch file + * Updated download location + * Changed build system to build ANSI and Unicode variants; odbcinst + template changed accordingly + * Dropped legacy driver location /usr/lib/postgresql/lib + * Updated README.Debian + + -- Peter Eisentraut Wed, 22 Feb 2006 15:11:00 +0100 + +psqlodbc (1:08.01.0102-1) unstable; urgency=low + + * New upstream release + * Changed to debhelper level 5 + * Removed old FSF address from copyright file + * Installed new documentation + + -- Peter Eisentraut Mon, 16 Jan 2006 19:17:55 +0100 + +psqlodbc (1:08.01.0005-1) experimental; urgency=low + + * New upstream version + - Includes IPv6 support (closes: #312983) + * Updated standards version + * Changed watch file to track snapshot releases + * Added build dependency on libpq-dev + + -- Peter Eisentraut Thu, 20 Oct 2005 11:48:42 +0200 + +psqlodbc (1:08.00.0101-2) unstable; urgency=low + + * First upload of this upstream version to unstable (closes: #292311) + * Changed maintainer address + * Revised README.Debian + + -- Peter Eisentraut Wed, 1 Jun 2005 15:49:19 +0200 + +psqlodbc (1:08.00.0101-1) experimental; urgency=low + + * New upstream release (closes: #292311) + - Obsoletes patches 10_psqlodbc-makestring, 20_psqlodbc-64bit + * Converted to CDBS + + -- Peter Eisentraut Tue, 22 Mar 2005 12:38:48 +0100 + +psqlodbc (1:07.03.0200-5) unstable; urgency=low + + * Corrected license to old LGPL 2 + * Big debian/rules modernization + * Moved odbc.ini.template to examples directory + * Converted to dpatch + * Added update of config.{guess,sub} + * Renamed unixodbc.HOWTO to README.Debian; revised + * Moved installation to /usr/lib/odbc; added symlink to old location + for compatibility + * Dropped postgresql-dev dependency + + -- Peter Eisentraut Sun, 14 Nov 2004 16:12:31 +0100 + +psqlodbc (1:07.03.0200-4) unstable; urgency=low + + * New maintainer (closes: #228073) + * Removed suggestion of libiodbc2, because this driver is unixODBC + only at this time; upgraded unixodbc to recommendation + * Removed suggestion of postgresql, because clients don't need to + suggest their servers + * Revised description (closes: #252686) + * Fixed several misguided assumptions that sizeof(long)==4; based + on patch installed upstream on 2004-07-01 (closes: #254847) + * Added watch file + + -- Peter Eisentraut Sun, 11 Jul 2004 10:38:13 +0200 + +psqlodbc (1:07.03.0200-3) unstable; urgency=high + + * urgency high since this is a security related bug and no other changes + were made + * misc.c: added target buffer size parameter to make_string() to prevent + buffer overflows and corrected all calls to it (closes: #247306) + + -- Martin Pitt Thu, 13 May 2004 10:47:36 +0200 + +psqlodbc (1:07.03.0200-2) unstable; urgency=high + + * removed dependency to postgresql again since there are users who want only + the driver without a full postgresql installation (closes: #233113) + * urgency high because I did not change anything apart from the dependency, + the previous revision is already in sarge and this seems to be a real + hassle for testing users + + -- Martin Pitt Wed, 18 Feb 2004 08:29:20 +0100 + +psqlodbc (1:07.03.0200-1) unstable; urgency=low + + * separated out of postgresql source package; thus a new epoch had to be + created, postgresql is already at 7.4.1 + * added depencendy postgresql since this package does not make sense + without it + * corrected path to odbc.sql in unixodbc.HOWTO (closes: #194653) + + -- Martin Pitt Fri, 16 Jan 2004 22:54:37 +0100 --- psqlodbc-08.01.0200.orig/debian/compat +++ psqlodbc-08.01.0200/debian/compat @@ -0,0 +1 @@ +5 --- psqlodbc-08.01.0200.orig/debian/odbc.ini.template +++ psqlodbc-08.01.0200/debian/odbc.ini.template @@ -0,0 +1,16 @@ +[PostgreSQL test] +Description = PostgreSQL +Driver = PostgreSQL ANSI +Trace = No +TraceFile = /tmp/psqlodbc.log +Database = template1 +Servername = localhost +UserName = +Password = +Port = +ReadOnly = Yes +RowVersioning = No +ShowSystemTables = No +ShowOidColumn = No +FakeOidIndex = No +ConnSettings = --- psqlodbc-08.01.0200.orig/debian/odbcinst.ini.template +++ psqlodbc-08.01.0200/debian/odbcinst.ini.template @@ -0,0 +1,13 @@ +[PostgreSQL ANSI] +Description = PostgreSQL ODBC driver (ANSI version) +Driver = /usr/lib/odbc/psqlodbca.so +Setup = /usr/lib/odbc/libodbcpsqlS.so +Debug = 0 +CommLog = 1 + +[PostgreSQL Unicode] +Description = PostgreSQL ODBC driver (Unicode version) +Driver = /usr/lib/odbc/psqlodbcw.so +Setup = /usr/lib/odbc/libodbcpsqlS.so +Debug = 0 +CommLog = 1 --- psqlodbc-08.01.0200.orig/debian/copyright +++ psqlodbc-08.01.0200/debian/copyright @@ -0,0 +1,33 @@ +This package was debianized by Martin Pitt on +Thu, 22 Jan 2004 14:50:11 +0100. Since 11 Jul 2004 it has been +maintained by Peter Eisentraut . + + +It was downloaded from: ftp://ftp.postgresql.org/pub/odbc/ + + +Upstream authors: PostgreSQL ODBC team + + +Copyright: + + Copyright (C) 1998 Insight Distribution Systems + Copyright (C) 1998 - 2005 The PostgreSQL Global Development Group + + Multibyte support was added by Sankyo Unyu Service, (C) 2001. + + The code contained in this library is based on code written by + Christian Czezatke and Dan McGuirk, (C) 1996. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in '/usr/share/common-licenses/LGPL-2'. --- psqlodbc-08.01.0200.orig/debian/README.Debian +++ psqlodbc-08.01.0200/debian/README.Debian @@ -0,0 +1,101 @@ +PostgreSQL ODBC Driver on Debian +================================ + +This package contains the PostgreSQL ODBC driver. Applications wishing +to make use of it need to go through an ODBC driver manager. On Debian, +this normally means that they have a dependency on the package +"libiodbc2" or "unixodbc". + + +ANSI vs. Unicode +---------------- + +This package actually contains two drivers, one ANSI variant (psqlodbca) +and one Unicode variant (psqlodbcw). The Unicode variant works with +Unicode and ASCII clients, the ANSI variant should work with any client +encoding provided that the database encoding matches. The specifics +depend on the application and the driver manager; experimentation may be +necessary in some cases. + + +Registering the Driver +---------------------- + +To register the PostgreSQL ODBC drivers in /etc/odbcinst.ini, run the +following command as root: + +# odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template + +You can also edit /etc/odbcinst.ini by hand, but the above command is +generally the safest and most convenient way if you don't have special +requirements. + + +Creating Data Sources +--------------------- + +To be able to access a particular database via ODBC you need to register +it as an ODBC data source. Data sources are registered globally in +/etc/odbc.ini or for each user in ~/.odbc.ini. An example entry is +included in this package. You can install it like this: + +$ cat /usr/share/doc/odbc-postgresql/examples/odbc.ini.template >> ~/.odbc.ini + +This entry will give you read-only access to the template1 database on +the PostgreSQL server on localhost under the data source name (DSN) +"PostgreSQL test". + +You should edit ~/.odbc.ini or /etc/odbc.ini as required, to add extra +databases, change the read only status, and so on. The program +ODBCConfig in the package unixodbc-bin can be used as a graphical +editing frontend. + + +Testing Connectivity +-------------------- + +To test the connectivity, you can use the program isql from the +package unixodbc: + +$ isql 'PostgreSQL test' username + +The first argument is the name of the data source, inserted above into +.odbc.ini. If this command doesn't produce an error, you should be +able to enter SQL queries and see the results. (Note that the example +data source is read-only and to template1, so you shouldn't issue +write commands.) + +Alternatively, the program DataManager from the package unixodbc-bin can +be used to test the connectivity and browse the database. + +At this point, you should be able to use the ODBC access features of any +application to connect to any of the listed data sources. For example, +in the OpenOffice.org Base application's "Database Wizard", choose +"Connect to an existing database", "ODBC", press Next, choose "Browse", +then select your data source. + + +Accessing Schemas +----------------- + +If you have schemas that are not in the default search path ($user, +public) you have to set the search path in the connection settings of +the odbc.ini file. Here's an example, where the search path is set to +prod, public: + + [Production] + Description = Production control + Driver = PostgreSQL + Trace = No + TraceFile = /tmp/psqlodbc.log + Database = companydb + Servername = localhost + UserName = userme + Password = + Port = + ReadOnly = No + RowVersioning = Yes + ShowSystemTables = No + ShowOidColumn = No + FakeOidIndex = No + ConnSettings = SET search_path TO prod, public --- psqlodbc-08.01.0200.orig/debian/examples +++ psqlodbc-08.01.0200/debian/examples @@ -0,0 +1 @@ +debian/odbc.ini.template --- psqlodbc-08.01.0200.orig/debian/install +++ psqlodbc-08.01.0200/debian/install @@ -0,0 +1,2 @@ +usr/lib/odbc +usr/share/psqlodbc --- psqlodbc-08.01.0200.orig/debian/docs +++ psqlodbc-08.01.0200/debian/docs @@ -0,0 +1 @@ +docs/ --- psqlodbc-08.01.0200.orig/debian/NEWS +++ psqlodbc-08.01.0200/debian/NEWS @@ -0,0 +1,9 @@ +psqlodbc (1:08.01.0200-1) unstable; urgency=low + + The names of the driver libraries and default data source names have + changed in this release. The package now provides an ANSI and a Unicode + version, named psqlodbca.so and psqlodbcw.so, respectively. Please + review the documentation to see which one you need and adjust your data + sources accordingly. + + -- Peter Eisentraut Thu, 16 Feb 2006 16:10:16 +0100