MCPcopy Create free account
hub / github.com/MariaDB/server / AllocateBuffers

Method AllocateBuffers

storage/connect/tabodbc.cpp:1008–1028  ·  view source on GitHub ↗

/ 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. */ /

Source from the content-addressed store, hash-verified

1006/* for the ending null character. */
1007/***********************************************************************/
1008void 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. */

Callers 2

BindParametersMethod · 0.80
OpenDBMethod · 0.80

Calls 4

PlugSubAllocFunction · 0.85
AllocValBlockFunction · 0.85
GetValPointerMethod · 0.80
GetScaleFunction · 0.70

Tested by

no test coverage detected