Merge branch 'enh/TD-26532-3.0' of github.com:taosdata/TDengine into enh/TD-26532-3.0
This commit is contained in:
commit
dbfd282b13
|
@ -1,7 +1,7 @@
|
||||||
# curl
|
# curl
|
||||||
ExternalProject_Add(curl
|
ExternalProject_Add(curl
|
||||||
URL https://curl.se/download/curl-8.2.1.tar.gz
|
URL https://curl.se/download/curl-8.2.1.tar.gz
|
||||||
URL_HASH MD5 b25588a43556068be05e1624e0e74d41
|
URL_HASH MD5=b25588a43556068be05e1624e0e74d41
|
||||||
DOWNLOAD_NO_PROGRESS 1
|
DOWNLOAD_NO_PROGRESS 1
|
||||||
DOWNLOAD_DIR "${TD_CONTRIB_DIR}/deps-download"
|
DOWNLOAD_DIR "${TD_CONTRIB_DIR}/deps-download"
|
||||||
#GIT_REPOSITORY https://github.com/curl/curl.git
|
#GIT_REPOSITORY https://github.com/curl/curl.git
|
||||||
|
|
|
@ -47,7 +47,7 @@ void mndUserFreeObj(SUserObj *pUser);
|
||||||
|
|
||||||
int64_t mndGetIpWhiteVer(SMnode *pMnode);
|
int64_t mndGetIpWhiteVer(SMnode *pMnode);
|
||||||
|
|
||||||
void mndUpdateIpWhite(SMnode *pMnode, char *user, char *fqdn, int8_t type, int8_t lock);
|
void mndUpdateIpWhiteForAllUser(SMnode *pMnode, char *user, char *fqdn, int8_t type, int8_t lock);
|
||||||
|
|
||||||
int32_t mndRefreshUserIpWhiteList(SMnode *pMnode);
|
int32_t mndRefreshUserIpWhiteList(SMnode *pMnode);
|
||||||
|
|
||||||
|
|
|
@ -294,6 +294,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
|
||||||
pOld->cfg.daysToKeep0 = pNew->cfg.daysToKeep0;
|
pOld->cfg.daysToKeep0 = pNew->cfg.daysToKeep0;
|
||||||
pOld->cfg.daysToKeep1 = pNew->cfg.daysToKeep1;
|
pOld->cfg.daysToKeep1 = pNew->cfg.daysToKeep1;
|
||||||
pOld->cfg.daysToKeep2 = pNew->cfg.daysToKeep2;
|
pOld->cfg.daysToKeep2 = pNew->cfg.daysToKeep2;
|
||||||
|
pOld->cfg.keepTimeOffset = pNew->cfg.keepTimeOffset;
|
||||||
pOld->cfg.walFsyncPeriod = pNew->cfg.walFsyncPeriod;
|
pOld->cfg.walFsyncPeriod = pNew->cfg.walFsyncPeriod;
|
||||||
pOld->cfg.walLevel = pNew->cfg.walLevel;
|
pOld->cfg.walLevel = pNew->cfg.walLevel;
|
||||||
pOld->cfg.walRetentionPeriod = pNew->cfg.walRetentionPeriod;
|
pOld->cfg.walRetentionPeriod = pNew->cfg.walRetentionPeriod;
|
||||||
|
|
|
@ -147,7 +147,7 @@ static int32_t mndCreateDefaultDnode(SMnode *pMnode) {
|
||||||
|
|
||||||
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
||||||
code = 0;
|
code = 0;
|
||||||
mndUpdateIpWhite(pMnode, TSDB_DEFAULT_USER, dnodeObj.fqdn, IP_WHITE_ADD, 1);
|
mndUpdateIpWhiteForAllUser(pMnode, TSDB_DEFAULT_USER, dnodeObj.fqdn, IP_WHITE_ADD, 1);
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
|
@ -752,7 +752,7 @@ static int32_t mndCreateDnode(SMnode *pMnode, SRpcMsg *pReq, SCreateDnodeReq *pC
|
||||||
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
mndUpdateIpWhite(pMnode, TSDB_DEFAULT_USER, dnodeObj.fqdn, IP_WHITE_ADD, 1);
|
mndUpdateIpWhiteForAllUser(pMnode, TSDB_DEFAULT_USER, dnodeObj.fqdn, IP_WHITE_ADD, 1);
|
||||||
_OVER:
|
_OVER:
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
sdbFreeRaw(pRaw);
|
sdbFreeRaw(pRaw);
|
||||||
|
@ -1045,7 +1045,7 @@ static int32_t mndDropDnode(SMnode *pMnode, SRpcMsg *pReq, SDnodeObj *pDnode, SM
|
||||||
|
|
||||||
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
|
||||||
|
|
||||||
mndUpdateIpWhite(pMnode, TSDB_DEFAULT_USER, pDnode->fqdn, IP_WHITE_DROP, 1);
|
mndUpdateIpWhiteForAllUser(pMnode, TSDB_DEFAULT_USER, pDnode->fqdn, IP_WHITE_DROP, 1);
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
|
|
|
@ -103,7 +103,8 @@ int32_t ipWhiteMgtUpdate(SMnode *pMnode, char *user, SIpWhiteList *pNew) {
|
||||||
|
|
||||||
for (int i = 0; i < taosArrayGetSize(fqdns); i++) {
|
for (int i = 0; i < taosArrayGetSize(fqdns); i++) {
|
||||||
char *fqdn = taosArrayGetP(fqdns, i);
|
char *fqdn = taosArrayGetP(fqdns, i);
|
||||||
mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, TSDB_DEFAULT_USER, fqdn, IP_WHITE_ADD);
|
update |= mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, TSDB_DEFAULT_USER, fqdn, IP_WHITE_ADD);
|
||||||
|
update |= mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, user, fqdn, IP_WHITE_ADD);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < taosArrayGetSize(fqdns); i++) {
|
for (int i = 0; i < taosArrayGetSize(fqdns); i++) {
|
||||||
|
@ -117,7 +118,6 @@ int32_t ipWhiteMgtUpdate(SMnode *pMnode, char *user, SIpWhiteList *pNew) {
|
||||||
// }
|
// }
|
||||||
// taosArrayDestroy(pUserNames);
|
// taosArrayDestroy(pUserNames);
|
||||||
|
|
||||||
|
|
||||||
if (update) ipWhiteMgt.ver++;
|
if (update) ipWhiteMgt.ver++;
|
||||||
|
|
||||||
taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
||||||
|
@ -302,7 +302,7 @@ int32_t mndRefreshUserIpWhiteList(SMnode *pMnode) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void mndUpdateIpWhite(SMnode *pMnode, char *user, char *fqdn, int8_t type, int8_t lock) {
|
void mndUpdateIpWhiteForAllUser(SMnode *pMnode, char *user, char *fqdn, int8_t type, int8_t lock) {
|
||||||
if (lock) {
|
if (lock) {
|
||||||
taosThreadRwlockWrlock(&ipWhiteMgt.rw);
|
taosThreadRwlockWrlock(&ipWhiteMgt.rw);
|
||||||
if (ipWhiteMgt.ver == 0) {
|
if (ipWhiteMgt.ver == 0) {
|
||||||
|
@ -313,6 +313,20 @@ void mndUpdateIpWhite(SMnode *pMnode, char *user, char *fqdn, int8_t type, int8_
|
||||||
}
|
}
|
||||||
|
|
||||||
bool update = mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, user, fqdn, type);
|
bool update = mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, user, fqdn, type);
|
||||||
|
|
||||||
|
void *pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, NULL);
|
||||||
|
while (pIter) {
|
||||||
|
size_t klen = 0;
|
||||||
|
char *key = taosHashGetKey(pIter, &klen);
|
||||||
|
|
||||||
|
char *keyDup = taosMemoryCalloc(1, klen + 1);
|
||||||
|
memcpy(keyDup, key, klen);
|
||||||
|
update |= mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, keyDup, fqdn, type);
|
||||||
|
taosMemoryFree(keyDup);
|
||||||
|
|
||||||
|
pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
if (update) ipWhiteMgt.ver++;
|
if (update) ipWhiteMgt.ver++;
|
||||||
|
|
||||||
if (lock) taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
if (lock) taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
||||||
|
|
|
@ -8018,9 +8018,29 @@ static int32_t insertCondIntoSelectStmt(SSelectStmt* pSelect, SNode* pCond) {
|
||||||
if (pSelect->pWhere == NULL) {
|
if (pSelect->pWhere == NULL) {
|
||||||
pSelect->pWhere = pCond;
|
pSelect->pWhere = pCond;
|
||||||
} else {
|
} else {
|
||||||
SNode* pWhere = NULL;
|
SNodeList* pLogicCondListWhere = NULL;
|
||||||
createLogicCondNode(pSelect->pWhere, pCond, &pWhere, LOGIC_COND_TYPE_AND);
|
SNodeList* pLogicCondList2 = NULL;
|
||||||
pSelect->pWhere = pWhere;
|
if (nodeType(pSelect->pWhere) == QUERY_NODE_LOGIC_CONDITION &&
|
||||||
|
((SLogicConditionNode*)pSelect->pWhere)->condType == LOGIC_COND_TYPE_AND) {
|
||||||
|
pLogicCondListWhere = ((SLogicConditionNode*)pSelect->pWhere)->pParameterList;
|
||||||
|
} else {
|
||||||
|
nodesListMakeAppend(&pLogicCondListWhere, pSelect->pWhere);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodeType(pCond) == QUERY_NODE_LOGIC_CONDITION &&
|
||||||
|
((SLogicConditionNode*)pCond)->condType == LOGIC_COND_TYPE_AND) {
|
||||||
|
pLogicCondList2 = ((SLogicConditionNode*)pCond)->pParameterList;
|
||||||
|
} else {
|
||||||
|
nodesListMakeAppend(&pLogicCondList2, pCond);
|
||||||
|
}
|
||||||
|
|
||||||
|
nodesListAppendList(pLogicCondListWhere, pLogicCondList2);
|
||||||
|
|
||||||
|
SLogicConditionNode* pWhere = (SLogicConditionNode*)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION);
|
||||||
|
pWhere->condType = LOGIC_COND_TYPE_AND;
|
||||||
|
pWhere->pParameterList = pLogicCondListWhere;
|
||||||
|
|
||||||
|
pSelect->pWhere = (SNode*)pWhere;
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,4 +94,14 @@ print $rows
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
sql show child db2.tables like '%'
|
||||||
|
print $rows
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql show normal db2.tables like '%'
|
||||||
|
print $rows
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue