change gen first tag name

This commit is contained in:
yihaoDeng 2023-10-20 09:42:11 +08:00
parent e2250b0150
commit 9f6dd2b405
2 changed files with 4 additions and 2 deletions

View File

@ -868,6 +868,9 @@ static int32_t mndGenIdxNameForFirstTag(char *fullname, char *dbname, char *tagn
int8_t end = left >= 24 ? 24 : left - 1;
// gen rand str len [base:end]
// note: ignore rand performance issues
taosSeedRand(taosSafeRand());
int64_t len = taosRand() % (end - start + 1) + start;
taosRandStr2(randStr, len);
sprintf(fullname, "%s.%s_%s", dbname, tagname, randStr);

View File

@ -86,8 +86,7 @@ void taosRandStr(char* str, int32_t size) {
}
void taosRandStr2(char* str, int32_t size) {
const char* set = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@";
const char* set = "abcdefghijklmnopqrstuvwxyz0123456789@";
int32_t len = strlen(set);
for (int32_t i = 0; i < size; ++i) {