rebuild index at tag0
This commit is contained in:
parent
3067417ea3
commit
1447d1d55c
|
@ -32,6 +32,8 @@ void taosSeedRand(uint32_t seed);
|
||||||
uint32_t taosRand(void);
|
uint32_t taosRand(void);
|
||||||
uint32_t taosRandR(uint32_t* pSeed);
|
uint32_t taosRandR(uint32_t* pSeed);
|
||||||
void taosRandStr(char* str, int32_t size);
|
void taosRandStr(char* str, int32_t size);
|
||||||
|
void taosRandStr2(char* str, int32_t size);
|
||||||
|
|
||||||
uint32_t taosSafeRand(void);
|
uint32_t taosSafeRand(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -866,8 +866,10 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea
|
||||||
mInfo("trans:%d, used to create stb:%s", pTrans->id, pCreate->name);
|
mInfo("trans:%d, used to create stb:%s", pTrans->id, pCreate->name);
|
||||||
if (mndBuildStbFromReq(pMnode, &stbObj, pCreate, pDb) != 0) goto _OVER;
|
if (mndBuildStbFromReq(pMnode, &stbObj, pCreate, pDb) != 0) goto _OVER;
|
||||||
|
|
||||||
|
char randStr[16] = {0};
|
||||||
|
taosRandStr2(randStr, tListLen(randStr) - 1);
|
||||||
SSchema *pSchema = &(stbObj.pTags[0]);
|
SSchema *pSchema = &(stbObj.pTags[0]);
|
||||||
sprintf(fullIdxName, "%s.%s_default", pDb->name, pSchema->name);
|
sprintf(fullIdxName, "%s.%s_%s", pDb->name, pSchema->name, randStr);
|
||||||
|
|
||||||
SSIdx idx = {0};
|
SSIdx idx = {0};
|
||||||
if (mndAcquireGlobalIdx(pMnode, fullIdxName, SDB_IDX, &idx) == 0 && idx.pIdx != NULL) {
|
if (mndAcquireGlobalIdx(pMnode, fullIdxName, SDB_IDX, &idx) == 0 && idx.pIdx != NULL) {
|
||||||
|
|
|
@ -84,3 +84,12 @@ void taosRandStr(char* str, int32_t size) {
|
||||||
str[i] = set[taosRand() % len];
|
str[i] = set[taosRand() % len];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void taosRandStr2(char* str, int32_t size) {
|
||||||
|
const char* set = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
int32_t len = 36;
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
|
str[i] = set[taosRand() % len];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue