-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Feat/updateMultiTag #28925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/updateMultiTag #28925
Conversation
goto end; | ||
} | ||
cJSON* colValue = cJSON_CreateString(buf); | ||
RAW_NULL_CHECK(colValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 此处返回,buf 会泄露。 2. 另外,buf 在多个 tag 之间是否可以共用。
- 原来修改单个 tagVal 的逻辑: TSDB_ALTER_TABLE_UPDATE_TAG_VAL,有类似的泄漏风险问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 此处返回,buf 会泄露。 2. 另外,buf 在多个 tag 之间是否可以共用。
- 原来修改单个 tagVal 的逻辑: TSDB_ALTER_TABLE_UPDATE_TAG_VAL,有类似的泄漏风险问题。
- 确实有个这个问题,要改的话,整个函数都需要改,暂时先不改
- buf 共用的问题,这个之后可以优化下。
} | ||
cJSON* colValue = cJSON_CreateString(buf); | ||
RAW_NULL_CHECK(colValue); | ||
RAW_FALSE_CHECK(cJSON_AddItemToObject(member, "colValue", colValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
整个函数都没有处理这个异常跳出,导致内存泄露的问题,先不改了,主要是现在时间比较紧,我再其他PR中处理这个
} | ||
|
||
if (NULL == ctbEntry.ctbEntry.pTags) { | ||
metaError("meta/table: null tags, update tag val failed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- metaWLock 需要释放
- 另外,如果 ctbEntry.ctbEntry.pTags 为NULL,是不是就跳转至 _err了,这个分支根本就不存在。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- metaWLock 需要释放
- 另外,如果 ctbEntry.ctbEntry.pTags 为NULL,是不是就跳转至 _err了,这个分支根本就不存在。
这是个无效的逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有个跳转逻辑,metaWLock 需要释放。另外,感觉那个跳转逻辑,永远不会进去,是否有必要?
sql insert into $tb values(now, 1) | ||
sql_error alter table $mt set tag tgcol1 = 1,tagcol2 = 2, tag3 = 4 # set tag value on supertable | ||
sql_error alter table $ntable set tag f = 10 # set normal table value | ||
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # dumplicate tag name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dumplicate: typo -> duplicate
sql_error alter table $mt set tag tgcol1 = 1,tagcol2 = 2, tag3 = 4 # set tag value on supertable | ||
sql_error alter table $ntable set tag f = 10 # set normal table value | ||
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # dumplicate tag name | ||
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # not exist tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个列都是存在的,只是 duplicate。是否按注释说的,要增加一个列不存在,以及 列 为 NULL 值的 用例。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个列都是存在的,只是 duplicate。是否按注释说的,要增加一个列不存在,以及 列 为 NULL 值的 用例。
这个在整个脚本的最后有,有动态删除tag之后,然后设值的,不过这里可以修改下,放在一块
} | ||
if (c != 0) { | ||
tdbTbcClose(pUidIdxc); | ||
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: invalid
if (c != 0) { | ||
tdbTbcClose(pUidIdxc); | ||
tdbTbcClose(pTbDbc); | ||
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: invalid
|
Pull Request Checklist