提交 f020e4c3 编写于 作者: X Xiaoyu Wang

TD-13981 show databases rewrite

上级 4b2ab16e
......@@ -199,20 +199,27 @@ static SNodeptr createPrimaryKeyCol(SPhysiPlanContext* pCxt, uint64_t tableId) {
}
static int32_t createScanCols(SPhysiPlanContext* pCxt, SScanPhysiNode* pScanPhysiNode, SNodeList* pScanCols) {
pScanPhysiNode->pScanCols = nodesMakeList();
CHECK_ALLOC(pScanPhysiNode->pScanCols, TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, createPrimaryKeyCol(pCxt, pScanPhysiNode->uid)));
SNode* pNode;
FOREACH(pNode, pScanCols) {
if (PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pNode)->colId) {
SColumnNode* pCol = nodesListGetNode(pScanPhysiNode->pScanCols, 0);
strcpy(pCol->tableAlias, ((SColumnNode*)pNode)->tableAlias);
strcpy(pCol->colName, ((SColumnNode*)pNode)->colName);
continue;
if (QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN == nodeType(pScanPhysiNode)
|| QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN == nodeType(pScanPhysiNode)) {
pScanPhysiNode->pScanCols = nodesMakeList();
CHECK_ALLOC(pScanPhysiNode->pScanCols, TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, createPrimaryKeyCol(pCxt, pScanPhysiNode->uid)));
SNode* pNode;
FOREACH(pNode, pScanCols) {
if (PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pNode)->colId) {
SColumnNode* pCol = nodesListGetNode(pScanPhysiNode->pScanCols, 0);
strcpy(pCol->tableAlias, ((SColumnNode*)pNode)->tableAlias);
strcpy(pCol->colName, ((SColumnNode*)pNode)->colName);
continue;
}
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, nodesCloneNode(pNode)));
}
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, nodesCloneNode(pNode)));
} else {
pScanPhysiNode->pScanCols = nodesCloneList(pScanCols);
CHECK_ALLOC(pScanPhysiNode->pScanCols, TSDB_CODE_OUT_OF_MEMORY);
}
return TSDB_CODE_SUCCESS;
}
......
......@@ -24,8 +24,8 @@ endi
print ========== stop dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
print =============== create database
sql_error create database d1 vgroups 4
#print =============== create database
#sql_error create database d1 vgroups 4
print ========== start dnode2
system sh/exec.sh -n dnode2 -s start
......@@ -66,6 +66,7 @@ sql_error drop database d1
print ========== start dnode2
system sh/exec.sh -n dnode2 -s start
sleep 1000
print =============== re-create database
$x = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册