add create_tag_index msg
This commit is contained in:
parent
92707c50b1
commit
30b1378bde
|
@ -2764,6 +2764,23 @@ typedef struct {
|
|||
int32_t tSerializeSMDropSmaReq(void* buf, int32_t bufLen, SMDropSmaReq* pReq);
|
||||
int32_t tDeserializeSMDropSmaReq(void* buf, int32_t bufLen, SMDropSmaReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
char dbFName[TSDB_DB_FNAME_LEN];
|
||||
char stbName[TSDB_TABLE_NAME_LEN];
|
||||
char colName[TSDB_COL_NAME_LEN];
|
||||
char idxName[TSDB_COL_NAME_LEN];
|
||||
int8_t idxType;
|
||||
} SCreateTagIndexReq;
|
||||
|
||||
int32_t tSerializeSCreateTagIdxReq(void* buf, int32_t bufLen, SCreateTagIndexReq* pReq);
|
||||
int32_t tDeserializeSCreateTagIdxReq(void* buf, int32_t bufLen, SCreateTagIndexReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
char dbFName[TSDB_DB_FNAME_LEN];
|
||||
char stb[TSDB_TABLE_FNAME_LEN];
|
||||
int8_t indexType;
|
||||
} SDropTagIndexReq;
|
||||
|
||||
typedef struct {
|
||||
int8_t version; // for compatibility(default 0)
|
||||
int8_t intervalUnit; // MACRO: TIME_UNIT_XXX
|
||||
|
|
|
@ -295,7 +295,7 @@ typedef struct SShowTableTagsStmt {
|
|||
SNodeList* pTags;
|
||||
} SShowTableTagsStmt;
|
||||
|
||||
typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT } EIndexType;
|
||||
typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT, INDEX_TYPE_NORMAL } EIndexType;
|
||||
|
||||
typedef struct SIndexOptions {
|
||||
ENodeType type;
|
||||
|
|
|
@ -104,6 +104,7 @@ extern const int32_t TYPE_BYTES[16];
|
|||
|
||||
#define TSDB_INDEX_TYPE_SMA "SMA"
|
||||
#define TSDB_INDEX_TYPE_FULLTEXT "FULLTEXT"
|
||||
#define TSDB_INDEX_TYPE_NORMAL "NORMAL"
|
||||
|
||||
#define TSDB_INS_USER_STABLES_DBNAME_COLID 2
|
||||
|
||||
|
|
|
@ -918,6 +918,39 @@ int32_t tDeserializeSMDropSmaReq(void *buf, int32_t bufLen, SMDropSmaReq *pReq)
|
|||
tDecoderClear(&decoder);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t tSerializeSCreateTagIdxReq(void *buf, int32_t bufLen, SCreateTagIndexReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
if (tStartEncode(&encoder) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->dbFName) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->stbName) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->colName) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->idxName) < 0) return -1;
|
||||
if (tEncodeI8(&encoder, pReq->idxType) < 0) return -1;
|
||||
|
||||
tEndEncode(&encoder);
|
||||
|
||||
int32_t tlen = encoder.pos;
|
||||
tEncoderClear(&encoder);
|
||||
return tlen;
|
||||
}
|
||||
int32_t tDeserializeSCreateTagIdxReq(void *buf, int32_t bufLen, SCreateTagIndexReq *pReq) {
|
||||
SDecoder decoder = {0};
|
||||
tDecoderInit(&decoder, buf, bufLen);
|
||||
|
||||
if (tStartDecode(&decoder) < 0) return -1;
|
||||
|
||||
if (tDecodeCStrTo(&decoder, pReq->dbFName) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->stbName) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->colName) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->idxName) < 0) return -1;
|
||||
if (tDecodeI8(&decoder, &pReq->idxType) < 0) return -1;
|
||||
|
||||
tEndDecode(&decoder);
|
||||
tDecoderClear(&decoder);
|
||||
return 0;
|
||||
}
|
||||
int32_t tSerializeSMCreateFullTextReq(void *buf, int32_t bufLen, SMCreateFullTextReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
|
Loading…
Reference in New Issue