fix some error
This commit is contained in:
parent
532d4a26b7
commit
2b927cb78a
|
@ -3,34 +3,32 @@
|
|||
#include "dataformat.h"
|
||||
|
||||
int32_t tdGetMaxDataRowSize(SSchema *pSchema) {
|
||||
int32_t nbytes = 0;
|
||||
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);
|
||||
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];
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
SDataRow tdSDataRowDup(SDataRow rdata) { return NULL; }
|
|
@ -1,6 +1,8 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#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;
|
||||
}
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue