From a69cede0ab53fd61e36e5cea999726ed5465e32c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 2 Jun 2021 19:59:54 +0800 Subject: [PATCH] [td-255] update sim test. --- src/client/src/tscSQLParser.c | 2 +- tests/script/general/parser/nestquery.sim | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index f2558086ed..15e40d5918 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -3890,7 +3890,7 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql } SSchema* pSchema = tscGetTableColumnSchema(pTableMeta, index.columnIndex); - if (pSchema->colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) { // query on time range + if (pSchema->type == TSDB_DATA_TYPE_TIMESTAMP && index.columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX) { // query on time range if (!validateJoinExprNode(pCmd, pQueryInfo, *pExpr, &index)) { return TSDB_CODE_TSC_INVALID_OPERATION; } diff --git a/tests/script/general/parser/nestquery.sim b/tests/script/general/parser/nestquery.sim index ee0f7fd0fe..16d190d3fe 100644 --- a/tests/script/general/parser/nestquery.sim +++ b/tests/script/general/parser/nestquery.sim @@ -124,12 +124,27 @@ if $rows != 2 then return -1 endi -sql select * from (select count(*) a from nest_mt0 group by tbname) t where t.a<0 +sql select * from (select count(*) a, tbname f1 from nest_mt0 group by tbname) t where t.a<0 and f1 = 'nest_tb0'; if $rows != 0 then return -1 endi +sql select * from (select count(*) a, tbname f1 from nest_mt0 group by tbname) t where t.a>0 and f1 = 'nest_tb0'; +if $rows != 1 then + return -1 +endi + +if $data00 != 10000 then + return -1 +endi + +if $data01 != @nest_tb0@ then + return -1 +endi +if $data02 != @nest_tb0@ then + return -1 +endi print ===================> nest query interval -- GitLab