diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 102b7479be08027322f2d3a16f433affc1b856bd..c10ee5d98843bf352fd76f3148590046f9b9e563 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5899,15 +5899,15 @@ static int32_t checkCollectTopicTags(STranslateContext* pCxt, SCreateTopicStmt* nodesDestroyList(colCxt.pTags); return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "Columns are forbidden in where clause"); } - if (NULL == colCxt.pTags) { - for (int32_t i = 0; i < pMeta->tableInfo.numOfTags; ++i) { - SSchema* tag = &pMeta->schema[pMeta->tableInfo.numOfColumns + i]; + if (NULL == colCxt.pTags) { // put one column to select +// for (int32_t i = 0; i < pMeta->tableInfo.numOfColumns; ++i) { + SSchema* column = &pMeta->schema[0]; SColumnNode* col = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); - strcpy(col->colName, tag->name); + strcpy(col->colName, column->name); strcpy(col->node.aliasName, col->colName); strcpy(col->node.userAlias, col->colName); addTagList(&colCxt.pTags, (SNode*)col); - } +// } } *ppProjection = colCxt.pTags;