diff --git a/src/getdata.cpp b/src/getdata.cpp index 14f60005..c401a35a 100644 --- a/src/getdata.cpp +++ b/src/getdata.cpp @@ -535,30 +535,30 @@ static PyObject* GetDataTimestamp(Cursor* cur, Py_ssize_t iCol) switch (cur->colinfos[iCol].sql_type) { - case SQL_TYPE_TIME: - { - int micros = (int)(value.fraction / 1000); // nanos --> micros - return PyTime_FromTime(value.hour, value.minute, value.second, micros); - } + case SQL_TYPE_TIME: + { + int micros = (int)(value.fraction / 1000); // nanos --> micros + return PyTime_FromTime(value.hour, value.minute, value.second, micros); + } - case SQL_TYPE_DATE: + case SQL_TYPE_DATE: case SQL_DATE: - return PyDate_FromDate(value.year, value.month, value.day); + return PyDate_FromDate(value.year, value.month, value.day); - case SQL_TYPE_TIMESTAMP: + case SQL_TYPE_TIMESTAMP: case SQL_TIMESTAMP: - { - if (value.year < 1) - { - value.year = 1; - } - else if (value.year > 9999) - { - value.year = 9999; - } - } + { + if (value.year < 1) + { + value.year = 1; + } + else if (value.year > 9999) + { + value.year = 9999; + } + } } - + int micros = (int)(value.fraction / 1000); // nanos --> micros @@ -779,7 +779,7 @@ PyObject *GetData_SqlVariant(Cursor *cur, Py_ssize_t iCol) { // the ODBC driver read the sql_variant header which contains the underlying data type pBuff = 0; indicator = 0; - retcode = SQLGetData(cur->hstmt, static_cast(iCol + 1), SQL_C_BINARY, + retcode = SQLGetData(cur->hstmt, static_cast(iCol + 1), SQL_C_BINARY, &pBuff, 0, &indicator); if (!SQL_SUCCEEDED(retcode)) return RaiseErrorFromHandle(cur->cnxn, "SQLGetData", cur->cnxn->hdbc, cur->hstmt); diff --git a/src/pyodbc.h b/src/pyodbc.h index 9ef2bd77..febcc677 100644 --- a/src/pyodbc.h +++ b/src/pyodbc.h @@ -121,7 +121,7 @@ inline void DebugTrace(const char* szFmt, ...) { UNUSED(szFmt); } // issue #880: entry missing from iODBC sqltypes.h #ifndef BYTE - typedef unsigned char BYTE; + typedef unsigned char BYTE; #endif bool PyMem_Realloc(BYTE** pp, size_t newlen); // A wrapper around realloc with a safer interface. If it is successful, *pp is updated to the