From 2b927cb78a832a2ff93c62ba11f2e26b95f7973e Mon Sep 17 00:00:00 2001 From: hzcheng Date: Wed, 4 Mar 2020 03:14:13 +0000 Subject: [PATCH] fix some error --- src/vnode/common/src/dataformat.c | 50 ++++++++++++++---------------- src/vnode/tsdb/src/tsdbFileStore.c | 8 +++-- src/vnode/tsdb/src/tsdbMeta.c | 6 ++-- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/vnode/common/src/dataformat.c b/src/vnode/common/src/dataformat.c index 18b78a4129..1f2dfc7dad 100644 --- a/src/vnode/common/src/dataformat.c +++ b/src/vnode/common/src/dataformat.c @@ -3,34 +3,32 @@ #include "dataformat.h" int32_t tdGetMaxDataRowSize(SSchema *pSchema) { - int32_t nbytes = 0; - - for (int32_t i = 0; i < TD_SCHEMA_NCOLS(pSchema); i++) - { - SColumn *pCol = TD_SCHEMA_COLUMN_AT(pSchema, i); - td_datatype_t type = TD_COLUMN_TYPE(pCol); - - nbytes += rowDataLen[type]; - - switch (type) - { - case TD_DATATYPE_VARCHAR: - nbytes += TD_COLUMN_BYTES(pCol); - break; - case TD_DATATYPE_NCHAR: - nbytes += 4 * TD_COLUMN_BYTES(pCol); - break; - case TD_DATATYPE_BINARY: - nbytes += TD_COLUMN_BYTES(pCol); - break; - } + int32_t nbytes = 0; + + for (int32_t i = 0; i < TD_SCHEMA_NCOLS(pSchema); i++) { + SColumn * pCol = TD_SCHEMA_COLUMN_AT(pSchema, i); + td_datatype_t type = TD_COLUMN_TYPE(pCol); + + nbytes += rowDataLen[type]; + + switch (type) { + case TD_DATATYPE_VARCHAR: + nbytes += TD_COLUMN_BYTES(pCol); + break; + case TD_DATATYPE_NCHAR: + nbytes += 4 * TD_COLUMN_BYTES(pCol); + break; + case TD_DATATYPE_BINARY: + nbytes += TD_COLUMN_BYTES(pCol); + break; + default: + break; } + } - nbytes += TD_DATA_ROW_HEADER_SIZE; + nbytes += TD_DATA_ROW_HEADER_SIZE; - return nbytes; + return nbytes; } -SDataRow tdSDataRowDup(SDataRow rdata) { - return NULL; -} \ No newline at end of file +SDataRow tdSDataRowDup(SDataRow rdata) { return NULL; } \ No newline at end of file diff --git a/src/vnode/tsdb/src/tsdbFileStore.c b/src/vnode/tsdb/src/tsdbFileStore.c index a47f2eb1e4..79e6e6170a 100644 --- a/src/vnode/tsdb/src/tsdbFileStore.c +++ b/src/vnode/tsdb/src/tsdbFileStore.c @@ -1,6 +1,8 @@ +#include + #include "tsdbFile.h" -char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type){ - // char *suffix = tsdbFileSuffix[type]; - // TODO +char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type) { + // TODO + return NULL; } \ No newline at end of file diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/vnode/tsdb/src/tsdbMeta.c index 72781810e1..eb348fafae 100644 --- a/src/vnode/tsdb/src/tsdbMeta.c +++ b/src/vnode/tsdb/src/tsdbMeta.c @@ -10,14 +10,14 @@ #define TSDB_MAX_TABLES 100000 #define TSDB_DEFAULT_NSTABLES 10 -#define IS_VALID_MAX_TABLES(maxTables) (((maxTables) >= TSDB_MIN_TABLES) && ((maxTables) >= TSDB_MAX_TABLES)) +#define IS_VALID_MAX_TABLES(maxTables) (((maxTables) >= TSDB_MIN_TABLES) && ((maxTables) <= TSDB_MAX_TABLES)) static int tsdbFreeTable(STable *pTable); static int32_t tsdbCheckTableCfg(STableCfg *pCfg); static STable *tsdbGetTableByUid(int64_t uid); static int tsdbAddTable(STsdbMeta *pMeta, STable *pTable); static int tsdbAddTableIntoMap(STsdbMeta *pMeta, STable *pTable); -static int tsdbAddTableIntoIndex(pMeta, pTable); +static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable); STsdbMeta *tsdbCreateMeta(int32_t maxTables) { if (!IS_VALID_MAX_TABLES(maxTables)) return NULL; @@ -176,7 +176,7 @@ static int tsdbAddTableIntoMap(STsdbMeta *pMeta, STable *pTable) { // TODO: add the table to the map return 0; } -static int tsdbAddTableIntoIndex(pMeta, pTable) { +static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable) { // TODO return 0; } \ No newline at end of file -- GitLab