Merge pull request #11431 from taosdata/feature/filter_tag
fix compile error
This commit is contained in:
commit
27c05997b6
|
@ -2016,6 +2016,7 @@ typedef struct {
|
||||||
static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema) {
|
static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema) {
|
||||||
int32_t tlen = 0;
|
int32_t tlen = 0;
|
||||||
tlen += taosEncodeFixedI8(buf, pSchema->type);
|
tlen += taosEncodeFixedI8(buf, pSchema->type);
|
||||||
|
tlen += taosEncodeFixedI8(buf, pSchema->index);
|
||||||
tlen += taosEncodeFixedI32(buf, pSchema->bytes);
|
tlen += taosEncodeFixedI32(buf, pSchema->bytes);
|
||||||
tlen += taosEncodeFixedI16(buf, pSchema->colId);
|
tlen += taosEncodeFixedI16(buf, pSchema->colId);
|
||||||
tlen += taosEncodeString(buf, pSchema->name);
|
tlen += taosEncodeString(buf, pSchema->name);
|
||||||
|
@ -2024,6 +2025,7 @@ static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema
|
||||||
|
|
||||||
static FORCE_INLINE void* taosDecodeSSchema(void* buf, SSchema* pSchema) {
|
static FORCE_INLINE void* taosDecodeSSchema(void* buf, SSchema* pSchema) {
|
||||||
buf = taosDecodeFixedI8(buf, &pSchema->type);
|
buf = taosDecodeFixedI8(buf, &pSchema->type);
|
||||||
|
buf = taosDecodeFixedI8(buf, &pSchema->index);
|
||||||
buf = taosDecodeFixedI32(buf, &pSchema->bytes);
|
buf = taosDecodeFixedI32(buf, &pSchema->bytes);
|
||||||
buf = taosDecodeFixedI16(buf, &pSchema->colId);
|
buf = taosDecodeFixedI16(buf, &pSchema->colId);
|
||||||
buf = taosDecodeStringTo(buf, pSchema->name);
|
buf = taosDecodeStringTo(buf, pSchema->name);
|
||||||
|
@ -2032,6 +2034,7 @@ static FORCE_INLINE void* taosDecodeSSchema(void* buf, SSchema* pSchema) {
|
||||||
|
|
||||||
static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSchema) {
|
static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSchema) {
|
||||||
if (tEncodeI8(pEncoder, pSchema->type) < 0) return -1;
|
if (tEncodeI8(pEncoder, pSchema->type) < 0) return -1;
|
||||||
|
if (tEncodeI8(pEncoder, pSchema->index) < 0) return -1;
|
||||||
if (tEncodeI32(pEncoder, pSchema->bytes) < 0) return -1;
|
if (tEncodeI32(pEncoder, pSchema->bytes) < 0) return -1;
|
||||||
if (tEncodeI16(pEncoder, pSchema->colId) < 0) return -1;
|
if (tEncodeI16(pEncoder, pSchema->colId) < 0) return -1;
|
||||||
if (tEncodeCStr(pEncoder, pSchema->name) < 0) return -1;
|
if (tEncodeCStr(pEncoder, pSchema->name) < 0) return -1;
|
||||||
|
@ -2040,6 +2043,7 @@ static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSch
|
||||||
|
|
||||||
static FORCE_INLINE int32_t tDecodeSSchema(SCoder* pDecoder, SSchema* pSchema) {
|
static FORCE_INLINE int32_t tDecodeSSchema(SCoder* pDecoder, SSchema* pSchema) {
|
||||||
if (tDecodeI8(pDecoder, &pSchema->type) < 0) return -1;
|
if (tDecodeI8(pDecoder, &pSchema->type) < 0) return -1;
|
||||||
|
if (tDecodeI8(pDecoder, &pSchema->index) < 0) return -1;
|
||||||
if (tDecodeI32(pDecoder, &pSchema->bytes) < 0) return -1;
|
if (tDecodeI32(pDecoder, &pSchema->bytes) < 0) return -1;
|
||||||
if (tDecodeI16(pDecoder, &pSchema->colId) < 0) return -1;
|
if (tDecodeI16(pDecoder, &pSchema->colId) < 0) return -1;
|
||||||
if (tDecodeCStrTo(pDecoder, pSchema->name) < 0) return -1;
|
if (tDecodeCStrTo(pDecoder, pSchema->name) < 0) return -1;
|
||||||
|
|
|
@ -25,18 +25,18 @@ typedef struct SPoolMem {
|
||||||
static SPoolMem *openPool();
|
static SPoolMem *openPool();
|
||||||
static void clearPool(SPoolMem *pPool);
|
static void clearPool(SPoolMem *pPool);
|
||||||
static void closePool(SPoolMem *pPool);
|
static void closePool(SPoolMem *pPool);
|
||||||
static void *poolMalloc(void *arg, size_t size);
|
static void * poolMalloc(void *arg, size_t size);
|
||||||
static void poolFree(void *arg, void *ptr);
|
static void poolFree(void *arg, void *ptr);
|
||||||
|
|
||||||
struct SMetaDB {
|
struct SMetaDB {
|
||||||
TXN txn;
|
TXN txn;
|
||||||
TENV *pEnv;
|
TENV * pEnv;
|
||||||
TDB *pTbDB;
|
TDB * pTbDB;
|
||||||
TDB *pSchemaDB;
|
TDB * pSchemaDB;
|
||||||
TDB *pNameIdx;
|
TDB * pNameIdx;
|
||||||
TDB *pStbIdx;
|
TDB * pStbIdx;
|
||||||
TDB *pNtbIdx;
|
TDB * pNtbIdx;
|
||||||
TDB *pCtbIdx;
|
TDB * pCtbIdx;
|
||||||
SPoolMem *pPool;
|
SPoolMem *pPool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ typedef struct __attribute__((__packed__)) {
|
||||||
} SSchemaDbKey;
|
} SSchemaDbKey;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char * name;
|
||||||
tb_uid_t uid;
|
tb_uid_t uid;
|
||||||
} SNameIdxKey;
|
} SNameIdxKey;
|
||||||
|
|
||||||
|
@ -205,14 +205,14 @@ void metaCloseDB(SMeta *pMeta) {
|
||||||
|
|
||||||
int metaSaveTableToDB(SMeta *pMeta, STbCfg *pTbCfg) {
|
int metaSaveTableToDB(SMeta *pMeta, STbCfg *pTbCfg) {
|
||||||
tb_uid_t uid;
|
tb_uid_t uid;
|
||||||
SMetaDB *pMetaDb;
|
SMetaDB * pMetaDb;
|
||||||
void *pKey;
|
void * pKey;
|
||||||
void *pVal;
|
void * pVal;
|
||||||
int kLen;
|
int kLen;
|
||||||
int vLen;
|
int vLen;
|
||||||
int ret;
|
int ret;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
void *pBuf;
|
void * pBuf;
|
||||||
SCtbIdxKey ctbIdxKey;
|
SCtbIdxKey ctbIdxKey;
|
||||||
SSchemaDbKey schemaDbKey;
|
SSchemaDbKey schemaDbKey;
|
||||||
SSchemaWrapper schemaWrapper;
|
SSchemaWrapper schemaWrapper;
|
||||||
|
@ -329,11 +329,11 @@ int metaRemoveTableFromDb(SMeta *pMeta, tb_uid_t uid) {
|
||||||
STbCfg *metaGetTbInfoByUid(SMeta *pMeta, tb_uid_t uid) {
|
STbCfg *metaGetTbInfoByUid(SMeta *pMeta, tb_uid_t uid) {
|
||||||
int ret;
|
int ret;
|
||||||
SMetaDB *pMetaDb = pMeta->pDB;
|
SMetaDB *pMetaDb = pMeta->pDB;
|
||||||
void *pKey;
|
void * pKey;
|
||||||
void *pVal;
|
void * pVal;
|
||||||
int kLen;
|
int kLen;
|
||||||
int vLen;
|
int vLen;
|
||||||
STbCfg *pTbCfg;
|
STbCfg * pTbCfg;
|
||||||
|
|
||||||
// Fetch
|
// Fetch
|
||||||
pKey = &uid;
|
pKey = &uid;
|
||||||
|
@ -385,14 +385,14 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_t sver, bool isinline, bool isGetEx) {
|
static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_t sver, bool isinline, bool isGetEx) {
|
||||||
void *pKey;
|
void * pKey;
|
||||||
void *pVal;
|
void * pVal;
|
||||||
int kLen;
|
int kLen;
|
||||||
int vLen;
|
int vLen;
|
||||||
int ret;
|
int ret;
|
||||||
SSchemaDbKey schemaDbKey;
|
SSchemaDbKey schemaDbKey;
|
||||||
SSchemaWrapper *pSchemaWrapper;
|
SSchemaWrapper *pSchemaWrapper;
|
||||||
void *pBuf;
|
void * pBuf;
|
||||||
|
|
||||||
// fetch
|
// fetch
|
||||||
schemaDbKey.uid = uid;
|
schemaDbKey.uid = uid;
|
||||||
|
@ -419,9 +419,9 @@ STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {
|
||||||
tb_uid_t quid;
|
tb_uid_t quid;
|
||||||
SSchemaWrapper *pSW;
|
SSchemaWrapper *pSW;
|
||||||
STSchemaBuilder sb;
|
STSchemaBuilder sb;
|
||||||
SSchemaEx *pSchema;
|
SSchemaEx * pSchema;
|
||||||
STSchema *pTSchema;
|
STSchema * pTSchema;
|
||||||
STbCfg *pTbCfg;
|
STbCfg * pTbCfg;
|
||||||
|
|
||||||
pTbCfg = metaGetTbInfoByUid(pMeta, uid);
|
pTbCfg = metaGetTbInfoByUid(pMeta, uid);
|
||||||
if (pTbCfg->type == META_CHILD_TABLE) {
|
if (pTbCfg->type == META_CHILD_TABLE) {
|
||||||
|
@ -452,7 +452,7 @@ struct SMTbCursor {
|
||||||
|
|
||||||
SMTbCursor *metaOpenTbCursor(SMeta *pMeta) {
|
SMTbCursor *metaOpenTbCursor(SMeta *pMeta) {
|
||||||
SMTbCursor *pTbCur = NULL;
|
SMTbCursor *pTbCur = NULL;
|
||||||
SMetaDB *pDB = pMeta->pDB;
|
SMetaDB * pDB = pMeta->pDB;
|
||||||
|
|
||||||
pTbCur = (SMTbCursor *)taosMemoryCalloc(1, sizeof(*pTbCur));
|
pTbCur = (SMTbCursor *)taosMemoryCalloc(1, sizeof(*pTbCur));
|
||||||
if (pTbCur == NULL) {
|
if (pTbCur == NULL) {
|
||||||
|
@ -474,12 +474,12 @@ void metaCloseTbCursor(SMTbCursor *pTbCur) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *metaTbCursorNext(SMTbCursor *pTbCur) {
|
char *metaTbCursorNext(SMTbCursor *pTbCur) {
|
||||||
void *pKey = NULL;
|
void * pKey = NULL;
|
||||||
void *pVal = NULL;
|
void * pVal = NULL;
|
||||||
int kLen;
|
int kLen;
|
||||||
int vLen;
|
int vLen;
|
||||||
int ret;
|
int ret;
|
||||||
void *pBuf;
|
void * pBuf;
|
||||||
STbCfg tbCfg;
|
STbCfg tbCfg;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -503,17 +503,17 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SMCtbCursor {
|
struct SMCtbCursor {
|
||||||
TDBC *pCur;
|
TDBC * pCur;
|
||||||
tb_uid_t suid;
|
tb_uid_t suid;
|
||||||
void *pKey;
|
void * pKey;
|
||||||
void *pVal;
|
void * pVal;
|
||||||
int kLen;
|
int kLen;
|
||||||
int vLen;
|
int vLen;
|
||||||
};
|
};
|
||||||
|
|
||||||
SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid) {
|
SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid) {
|
||||||
SMCtbCursor *pCtbCur = NULL;
|
SMCtbCursor *pCtbCur = NULL;
|
||||||
SMetaDB *pDB = pMeta->pDB;
|
SMetaDB * pDB = pMeta->pDB;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
|
pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
|
||||||
|
@ -621,6 +621,7 @@ static int metaEncodeSchema(void **buf, SSchemaWrapper *pSW) {
|
||||||
for (int i = 0; i < pSW->nCols; i++) {
|
for (int i = 0; i < pSW->nCols; i++) {
|
||||||
pSchema = pSW->pSchema + i;
|
pSchema = pSW->pSchema + i;
|
||||||
tlen += taosEncodeFixedI8(buf, pSchema->type);
|
tlen += taosEncodeFixedI8(buf, pSchema->type);
|
||||||
|
tlen += taosEncodeFixedI8(buf, pSchema->index);
|
||||||
tlen += taosEncodeFixedI16(buf, pSchema->colId);
|
tlen += taosEncodeFixedI16(buf, pSchema->colId);
|
||||||
tlen += taosEncodeFixedI32(buf, pSchema->bytes);
|
tlen += taosEncodeFixedI32(buf, pSchema->bytes);
|
||||||
tlen += taosEncodeString(buf, pSchema->name);
|
tlen += taosEncodeString(buf, pSchema->name);
|
||||||
|
@ -637,6 +638,7 @@ static void *metaDecodeSchema(void *buf, SSchemaWrapper *pSW) {
|
||||||
for (int i = 0; i < pSW->nCols; i++) {
|
for (int i = 0; i < pSW->nCols; i++) {
|
||||||
pSchema = pSW->pSchema + i;
|
pSchema = pSW->pSchema + i;
|
||||||
buf = taosDecodeFixedI8(buf, &pSchema->type);
|
buf = taosDecodeFixedI8(buf, &pSchema->type);
|
||||||
|
buf = taosSkipFixedLen(buf, sizeof(int8_t));
|
||||||
buf = taosDecodeFixedI16(buf, &pSchema->colId);
|
buf = taosDecodeFixedI16(buf, &pSchema->colId);
|
||||||
buf = taosDecodeFixedI32(buf, &pSchema->bytes);
|
buf = taosDecodeFixedI32(buf, &pSchema->bytes);
|
||||||
buf = taosDecodeStringTo(buf, pSchema->name);
|
buf = taosDecodeStringTo(buf, pSchema->name);
|
||||||
|
@ -781,7 +783,7 @@ static void closePool(SPoolMem *pPool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *poolMalloc(void *arg, size_t size) {
|
static void *poolMalloc(void *arg, size_t size) {
|
||||||
void *ptr = NULL;
|
void * ptr = NULL;
|
||||||
SPoolMem *pPool = (SPoolMem *)arg;
|
SPoolMem *pPool = (SPoolMem *)arg;
|
||||||
SPoolMem *pMem;
|
SPoolMem *pMem;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue