提交 2b927cb7 编写于 作者: H hzcheng

fix some error

上级 532d4a26
...@@ -3,34 +3,32 @@ ...@@ -3,34 +3,32 @@
#include "dataformat.h" #include "dataformat.h"
int32_t tdGetMaxDataRowSize(SSchema *pSchema) { int32_t tdGetMaxDataRowSize(SSchema *pSchema) {
int32_t nbytes = 0; int32_t nbytes = 0;
for (int32_t i = 0; i < TD_SCHEMA_NCOLS(pSchema); i++) for (int32_t i = 0; i < TD_SCHEMA_NCOLS(pSchema); i++) {
{ SColumn * pCol = TD_SCHEMA_COLUMN_AT(pSchema, i);
SColumn *pCol = TD_SCHEMA_COLUMN_AT(pSchema, i); td_datatype_t type = TD_COLUMN_TYPE(pCol);
td_datatype_t type = TD_COLUMN_TYPE(pCol);
nbytes += rowDataLen[type];
nbytes += rowDataLen[type];
switch (type) {
switch (type) case TD_DATATYPE_VARCHAR:
{ nbytes += TD_COLUMN_BYTES(pCol);
case TD_DATATYPE_VARCHAR: break;
nbytes += TD_COLUMN_BYTES(pCol); case TD_DATATYPE_NCHAR:
break; nbytes += 4 * TD_COLUMN_BYTES(pCol);
case TD_DATATYPE_NCHAR: break;
nbytes += 4 * TD_COLUMN_BYTES(pCol); case TD_DATATYPE_BINARY:
break; nbytes += TD_COLUMN_BYTES(pCol);
case TD_DATATYPE_BINARY: break;
nbytes += TD_COLUMN_BYTES(pCol); default:
break; break;
}
} }
}
nbytes += TD_DATA_ROW_HEADER_SIZE; nbytes += TD_DATA_ROW_HEADER_SIZE;
return nbytes; return nbytes;
} }
SDataRow tdSDataRowDup(SDataRow rdata) { SDataRow tdSDataRowDup(SDataRow rdata) { return NULL; }
return NULL; \ No newline at end of file
}
\ No newline at end of file
#include <stdlib.h>
#include "tsdbFile.h" #include "tsdbFile.h"
char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type){ char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type) {
// char *suffix = tsdbFileSuffix[type]; // TODO
// TODO return NULL;
} }
\ No newline at end of file
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
#define TSDB_MAX_TABLES 100000 #define TSDB_MAX_TABLES 100000
#define TSDB_DEFAULT_NSTABLES 10 #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 int tsdbFreeTable(STable *pTable);
static int32_t tsdbCheckTableCfg(STableCfg *pCfg); static int32_t tsdbCheckTableCfg(STableCfg *pCfg);
static STable *tsdbGetTableByUid(int64_t uid); static STable *tsdbGetTableByUid(int64_t uid);
static int tsdbAddTable(STsdbMeta *pMeta, STable *pTable); static int tsdbAddTable(STsdbMeta *pMeta, STable *pTable);
static int tsdbAddTableIntoMap(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) { STsdbMeta *tsdbCreateMeta(int32_t maxTables) {
if (!IS_VALID_MAX_TABLES(maxTables)) return NULL; if (!IS_VALID_MAX_TABLES(maxTables)) return NULL;
...@@ -176,7 +176,7 @@ static int tsdbAddTableIntoMap(STsdbMeta *pMeta, STable *pTable) { ...@@ -176,7 +176,7 @@ static int tsdbAddTableIntoMap(STsdbMeta *pMeta, STable *pTable) {
// TODO: add the table to the map // TODO: add the table to the map
return 0; return 0;
} }
static int tsdbAddTableIntoIndex(pMeta, pTable) { static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable) {
// TODO // TODO
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册