/ AllocateBuffers: allocate the extended buffer for SQLExtendedFetch */ or Fetch. Note: we use Long+1 here because ODBC must have space */ for the ending null character. */ /
| 1006 | /* for the ending null character. */ |
| 1007 | /***********************************************************************/ |
| 1008 | void ODBCCOL::AllocateBuffers(PGLOBAL g, int rows) |
| 1009 | { |
| 1010 | if (Buf_Type == TYPE_DATE) |
| 1011 | Sqlbuf = (TIMESTAMP_STRUCT*)PlugSubAlloc(g, NULL, |
| 1012 | sizeof(TIMESTAMP_STRUCT)); |
| 1013 | |
| 1014 | if (!rows) |
| 1015 | return; |
| 1016 | |
| 1017 | if (Buf_Type == TYPE_DATE) |
| 1018 | Bufp = PlugSubAlloc(g, NULL, rows * sizeof(TIMESTAMP_STRUCT)); |
| 1019 | else { |
| 1020 | Blkp = AllocValBlock(g, NULL, Buf_Type, rows, GetBuflen(), |
| 1021 | GetScale(), true, false, false); |
| 1022 | Bufp = Blkp->GetValPointer(); |
| 1023 | } // endelse |
| 1024 | |
| 1025 | if (rows > 1) |
| 1026 | StrLen = (SQLLEN *)PlugSubAlloc(g, NULL, rows * sizeof(SQLLEN)); |
| 1027 | |
| 1028 | } // end of AllocateBuffers |
| 1029 | |
| 1030 | /***********************************************************************/ |
| 1031 | /* Returns the buffer to use for Fetch or Extended Fetch. */ |
no test coverage detected