提交 54708073 编写于 作者: H Hongze Cheng

more code

上级 da0c5d8e
...@@ -84,8 +84,9 @@ int32_t tBufferReserve(SBuffer *pBuffer, int64_t nData, void **ppData); ...@@ -84,8 +84,9 @@ int32_t tBufferReserve(SBuffer *pBuffer, int64_t nData, void **ppData);
#define COL_VAL_IS_VALUE(CV) ((CV)->flag == CV_FLAG_VALUE) #define COL_VAL_IS_VALUE(CV) ((CV)->flag == CV_FLAG_VALUE)
// SRow ================================ // SRow ================================
int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer); int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SRow **ppRow);
void tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal); void tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal);
void tRowDestroy(SRow *pRow);
// SRowIter ================================ // SRowIter ================================
int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter); int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter);
......
...@@ -95,7 +95,7 @@ typedef struct { ...@@ -95,7 +95,7 @@ typedef struct {
} \ } \
} while (0) } while (0)
int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) { int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SRow **ppRow) {
int32_t code = 0; int32_t code = 0;
ASSERT(taosArrayGetSize(aColVal) > 0); ASSERT(taosArrayGetSize(aColVal) > 0);
...@@ -196,9 +196,9 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) { ...@@ -196,9 +196,9 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
} }
// alloc -------------- // alloc --------------
SRow *pRow = NULL; code = tRealloc((uint8_t **)ppRow, nRow);
code = tBufferReserve(pBuffer, nRow, (void **)&pRow);
if (code) return code; if (code) return code;
SRow *pRow = *ppRow;
// build -------------- // build --------------
pColVal = (SColVal *)taosArrayGet(aColVal, 0); pColVal = (SColVal *)taosArrayGet(aColVal, 0);
...@@ -490,6 +490,8 @@ void tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) { ...@@ -490,6 +490,8 @@ void tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
} }
} }
void tRowDestroy(SRow *pRow) { tFree(pRow); }
// SRowIter ======================================== // SRowIter ========================================
struct SRowIter { struct SRowIter {
SRow *pRow; SRow *pRow;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册