diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index e630adccc3deb63229805cd4bee62dfc7ad61ec8..ed33d8a1002ba40cdf9ad44b19ad6868d4584f63 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1881,7 +1881,7 @@ static void addProjectQueryCol(SQueryInfo* pQueryInfo, int32_t startPos, SColumn ids.num = 1; ids.ids[0] = *pIndex; - if (pIndex->columnIndex == TSDB_TBNAME_COLUMN_INDEX || pIndex->columnIndex == TSDB_UD_COLUMN_INDEX || + if (pIndex->columnIndex == TSDB_TBNAME_COLUMN_INDEX || pIndex->columnIndex <= TSDB_UD_COLUMN_INDEX || pIndex->columnIndex >= tscGetNumOfColumns(pTableMeta)) { ids.num = 0; } diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 333b856d11323874f10d1bba9d4567d4b8799d72..b31d6357d16573089f2156a3fbccd9316a2a9e32 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -8150,8 +8150,8 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp // it is a user-defined constant value column assert(pExprs[i].base.functionId == TSDB_FUNC_PRJ); - type = pExprs[i].base.param[1].nType; - bytes = pExprs[i].base.param[1].nLen; + type = pExprs[i].base.param[0].nType; + bytes = pExprs[i].base.param[0].nLen; if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) { bytes += VARSTR_HEADER_SIZE; }