Hotfix/sangshuduo/td 4918 taosdemo sub afterconsume (#6685)
* [TD-4918]<fix>: taosdemo subscribe endAfterResume. * fix mask length. * fix heap use-after-free.
This commit is contained in:
parent
2771246403
commit
1be31a62a8
|
@ -7469,7 +7469,6 @@ static void *specifiedSubscribe(void *sarg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taos_free_result(g_queryInfo.specifiedQueryInfo.res[pThreadInfo->threadID]);
|
taos_free_result(g_queryInfo.specifiedQueryInfo.res[pThreadInfo->threadID]);
|
||||||
taos_unsubscribe(g_queryInfo.specifiedQueryInfo.tsub[pThreadInfo->querySeq], 0);
|
|
||||||
taos_close(pThreadInfo->taos);
|
taos_close(pThreadInfo->taos);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1060,7 +1060,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
|
||||||
pStable->info.tableId = strdup(pCreate->tableName);
|
pStable->info.tableId = strdup(pCreate->tableName);
|
||||||
pStable->info.type = TSDB_SUPER_TABLE;
|
pStable->info.type = TSDB_SUPER_TABLE;
|
||||||
pStable->createdTime = taosGetTimestampMs();
|
pStable->createdTime = taosGetTimestampMs();
|
||||||
int64_t x = (us&0x000000FFFFFFFFFF);
|
uint64_t x = (us&0x000000FFFFFFFFFF);
|
||||||
x = x<<24;
|
x = x<<24;
|
||||||
pStable->uid = x + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
pStable->uid = x + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
||||||
pStable->sversion = 0;
|
pStable->sversion = 0;
|
||||||
|
@ -2010,7 +2010,9 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) {
|
||||||
} else {
|
} else {
|
||||||
if (pTable->info.type == TSDB_SUPER_TABLE) {
|
if (pTable->info.type == TSDB_SUPER_TABLE) {
|
||||||
int64_t us = taosGetTimestampUs();
|
int64_t us = taosGetTimestampUs();
|
||||||
pTable->uid = (us << 24) + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
uint64_t x = (us&0x000000FFFFFFFFFF);
|
||||||
|
x = x<<24;
|
||||||
|
pTable->uid = x + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
||||||
} else {
|
} else {
|
||||||
pTable->uid = (((uint64_t)pTable->vgId) << 48) + ((((uint64_t)pTable->tid) & ((1ul << 24) - 1ul)) << 24) +
|
pTable->uid = (((uint64_t)pTable->vgId) << 48) + ((((uint64_t)pTable->tid) & ((1ul << 24) - 1ul)) << 24) +
|
||||||
((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul));
|
||||||
|
|
Loading…
Reference in New Issue