Changeset: a9cafe4db708 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a9cafe4db708 Modified Files: clients/src/odbc/driver/ODBCStmt.h clients/src/odbc/driver/SQLExtendedFetch.c clients/src/odbc/driver/SQLFetch.c clients/src/odbc/driver/SQLFetchScroll.c clients/src/odbc/driver/SQLSetPos.c Branch: Jun2010 Log Message:
Attempt to deal with different unixODBC/Microsoft ODBC versions. With this fix the ODBC driver compiles on Debian Lenny again. diffs (137 lines): diff -r 7cd395014cc8 -r a9cafe4db708 clients/src/odbc/driver/ODBCStmt.h --- a/clients/src/odbc/driver/ODBCStmt.h Thu Jun 10 14:02:07 2010 +0200 +++ b/clients/src/odbc/driver/ODBCStmt.h Fri Jun 11 15:52:26 2010 +0200 @@ -80,9 +80,9 @@ set (0 based); rowSetSize is the number of rows in the current result set; currentRow is the row number of the current row within the current result set */ - SQLULEN currentRow; - SQLULEN startRow; - SQLULEN rowSetSize; + SQLROWOFFSET currentRow; + SQLROWOFFSET startRow; + SQLROWOFFSET rowSetSize; unsigned int currentCol; /* used by SQLGetData() */ SQLINTEGER retrieved; /* amount of data retrieved */ diff -r 7cd395014cc8 -r a9cafe4db708 clients/src/odbc/driver/SQLExtendedFetch.c --- a/clients/src/odbc/driver/SQLExtendedFetch.c Thu Jun 10 14:02:07 2010 +0200 +++ b/clients/src/odbc/driver/SQLExtendedFetch.c Fri Jun 11 15:52:26 2010 +0200 @@ -42,8 +42,8 @@ SQLRETURN SQL_API SQLExtendedFetch(SQLHSTMT hStmt, SQLUSMALLINT nOrientation, - SQLLEN nOffset, - SQLULEN *pnRowCount, + SQLROWOFFSET nOffset, + SQLROWSETSIZE *pnRowCount, SQLUSMALLINT *pRowStatusArray) { ODBCStmt *stmt = (ODBCStmt *) hStmt; @@ -51,7 +51,7 @@ SQLRETURN rc; #ifdef ODBCDEBUG - ODBCLOG("SQLExtendedFetch " PTRFMT " %d " LENFMT "\n", PTRFMTCAST hStmt, nOrientation, nOffset); + ODBCLOG("SQLExtendedFetch " PTRFMT " %d " LENFMT "\n", PTRFMTCAST hStmt, nOrientation, (SQLLEN) nOffset); #endif if (!isValidStmt(stmt)) diff -r 7cd395014cc8 -r a9cafe4db708 clients/src/odbc/driver/SQLFetch.c --- a/clients/src/odbc/driver/SQLFetch.c Thu Jun 10 14:02:07 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetch.c Fri Jun 11 15:52:26 2010 +0200 @@ -77,7 +77,7 @@ updating the SQL_DESC_ARRAY_STATUS_PTR */ stmt->rowSetSize = desc->sql_desc_array_size; - if (stmt->startRow + stmt->rowSetSize > stmt->rowcount) + if (stmt->startRow + stmt->rowSetSize > (SQLROWOFFSET) stmt->rowcount) stmt->rowSetSize = stmt->rowcount - stmt->startRow; if (stmt->rowSetSize <= 0) { @@ -85,7 +85,7 @@ return SQL_NO_DATA; } if (statusp) { - for (row = 0; row < stmt->rowSetSize; row++) + for (row = 0; (SQLROWOFFSET) row < stmt->rowSetSize; row++) *statusp++ = SQL_ROW_SUCCESS; for (; row < desc->sql_desc_array_size; row++) *statusp++ = SQL_ROW_NOROW; diff -r 7cd395014cc8 -r a9cafe4db708 clients/src/odbc/driver/SQLFetchScroll.c --- a/clients/src/odbc/driver/SQLFetchScroll.c Thu Jun 10 14:02:07 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetchScroll.c Fri Jun 11 15:52:26 2010 +0200 @@ -45,7 +45,7 @@ SQLRETURN SQLFetchScroll_(ODBCStmt *stmt, SQLSMALLINT FetchOrientation, - SQLLEN FetchOffset) + SQLROWOFFSET FetchOffset) { assert(stmt->hdl); @@ -62,7 +62,7 @@ switch (FetchOrientation) { case SQL_FETCH_NEXT: - if (stmt->currentRow >= stmt->rowcount) { + if (stmt->currentRow >= (SQLROWOFFSET) stmt->rowcount) { stmt->State = FETCHED; return SQL_NO_DATA; } @@ -84,7 +84,7 @@ stmt->State = FETCHED; return SQL_NO_DATA; } - if (stmt->startRow < RowSetSize) { + if (stmt->startRow < (SQLROWOFFSET) RowSetSize) { /* Attempt to fetch before the result set returned the first rowset */ addStmtError(stmt, "01S06", NULL, 0); @@ -94,7 +94,7 @@ break; case SQL_FETCH_RELATIVE: if ((stmt->currentRow != 0 || FetchOffset <= 0) && - (stmt->currentRow != stmt->rowcount || FetchOffset >= 0)) { + (stmt->currentRow != (SQLROWOFFSET) stmt->rowcount || FetchOffset >= 0)) { if ((stmt->currentRow == 0 && FetchOffset <= 0) || (stmt->startRow == 0 && FetchOffset < 0) || (stmt->startRow > 0 && @@ -114,8 +114,8 @@ addStmtError(stmt, "01S06", NULL, 0); break; } - if (stmt->startRow + FetchOffset >= stmt->rowcount || - stmt->currentRow == stmt->rowcount) { + if (stmt->startRow + FetchOffset >= (SQLROWOFFSET) stmt->rowcount || + stmt->currentRow == (SQLROWOFFSET) stmt->rowcount) { stmt->startRow = stmt->rowcount; stmt->State = FETCHED; return SQL_NO_DATA; @@ -169,12 +169,12 @@ SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT hStmt, SQLSMALLINT FetchOrientation, - SQLLEN FetchOffset) + SQLROWOFFSET FetchOffset) { ODBCStmt *stmt = (ODBCStmt *) hStmt; #ifdef ODBCDEBUG - ODBCLOG("SQLFetchScroll " PTRFMT " %d " LENFMT "\n", PTRFMTCAST hStmt, FetchOrientation, FetchOffset); + ODBCLOG("SQLFetchScroll " PTRFMT " %d " LENFMT "\n", PTRFMTCAST hStmt, FetchOrientation, (SQLLEN) FetchOffset); #endif if (!isValidStmt(stmt)) diff -r 7cd395014cc8 -r a9cafe4db708 clients/src/odbc/driver/SQLSetPos.c --- a/clients/src/odbc/driver/SQLSetPos.c Thu Jun 10 14:02:07 2010 +0200 +++ b/clients/src/odbc/driver/SQLSetPos.c Fri Jun 11 15:52:26 2010 +0200 @@ -69,7 +69,7 @@ return SQL_ERROR; } - if (nRow > stmt->rowSetSize) { + if (nRow > (SQLSETPOSIROW) stmt->rowSetSize) { /* Row value out of range */ addStmtError(stmt, "HY107", NULL, 0); return SQL_ERROR; _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list