[tbase-1328]
This commit is contained in:
parent
992a449ed6
commit
38d377b421
|
@ -784,14 +784,15 @@ int mgmtRetrieveMetersFromMetric(SMetricMetaMsg* pMsg, int32_t tableIndex, tQuer
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo refactor!!!!!
|
// todo refactor!!!!!
|
||||||
static char* getTagValueFromMeter(STabObj* pMeter, int32_t offset, void* param) {
|
static char* getTagValueFromMeter(STabObj* pMeter, int32_t offset, int32_t len, char* param) {
|
||||||
if (offset == TSDB_TBNAME_COLUMN_INDEX) {
|
if (offset == TSDB_TBNAME_COLUMN_INDEX) {
|
||||||
extractMeterName(pMeter->meterId, param);
|
extractMeterName(pMeter->meterId, param);
|
||||||
return param;
|
|
||||||
} else {
|
} else {
|
||||||
char* tags = pMeter->pTagData + TSDB_METER_ID_LEN; // tag start position
|
char* tags = pMeter->pTagData + offset + TSDB_METER_ID_LEN; // tag start position
|
||||||
return (tags + offset);
|
memcpy(param, tags, len); // make sure the value is null-terminated string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return param;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tSkipListNodeFilterCallback(const void* pNode, void* param) {
|
bool tSkipListNodeFilterCallback(const void* pNode, void* param) {
|
||||||
|
@ -799,8 +800,9 @@ bool tSkipListNodeFilterCallback(const void* pNode, void* param) {
|
||||||
tQueryInfo* pInfo = (tQueryInfo*)param;
|
tQueryInfo* pInfo = (tQueryInfo*)param;
|
||||||
STabObj* pMeter = (STabObj*)(((tSkipListNode*)pNode)->pData);
|
STabObj* pMeter = (STabObj*)(((tSkipListNode*)pNode)->pData);
|
||||||
|
|
||||||
char name[TSDB_METER_NAME_LEN + 1] = {0};
|
char buf[TSDB_MAX_TAGS_LEN] = {0};
|
||||||
char* val = getTagValueFromMeter(pMeter, pInfo->offset, name);
|
|
||||||
|
char* val = getTagValueFromMeter(pMeter, pInfo->offset, pInfo->sch.bytes, buf);
|
||||||
int8_t type = pInfo->sch.type;
|
int8_t type = pInfo->sch.type;
|
||||||
|
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
|
|
Loading…
Reference in New Issue