Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
61c46977
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
61c46977
编写于
12月 22, 2021
作者:
D
dapan1121
提交者:
GitHub
12月 22, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9239 from taosdata/fix/TD-12342
<fix>[TD-12342] give error tips if group by ts order by tag
上级
3066f8b4
a83df555
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
17 deletion
+3
-17
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+3
-4
tests/system-test/2-query/0-aggregate/TD-12340-12342.py
tests/system-test/2-query/0-aggregate/TD-12340-12342.py
+0
-13
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
61c46977
...
...
@@ -6319,7 +6319,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
const
char
*
msg0
=
"only one column allowed in orderby"
;
const
char
*
msg1
=
"invalid column name in orderby clause"
;
const
char
*
msg2
=
"too many order by columns"
;
const
char
*
msg3
=
"only primary timestamp,
first
tag/tbname in groupby clause allowed as order column"
;
const
char
*
msg3
=
"only primary timestamp, tag/tbname in groupby clause allowed as order column"
;
const
char
*
msg4
=
"only tag in groupby clause allowed in order clause"
;
const
char
*
msg5
=
"only primary timestamp/column in top/bottom function allowed as order column"
;
const
char
*
msg6
=
"only primary timestamp allowed as the second order column"
;
...
...
@@ -6341,8 +6341,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
SArray
*
pSortOrder
=
pSqlNode
->
pSortOrder
;
/*
* for table query, there is only one or none order option is allowed, which is the
* ts or values(top/bottom) order is supported.
* for table query, there is only one or none order option is allowed
*
* for super table query, the order option must be less than 3 and the second must be ts.
*
...
...
@@ -6417,7 +6416,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
return
invalidOperationMsg
(
pMsgBuf
,
msg4
);
}
SColIndex
*
pColIndex
=
taosArrayGet
(
pQueryInfo
->
groupbyExpr
.
columnInfo
,
0
);
if
(
relTagIndex
==
pColIndex
->
colIndex
)
{
if
(
relTagIndex
==
pColIndex
->
colIndex
&&
pColIndex
->
flag
==
TSDB_COL_TAG
)
{
if
(
tscGetColumnSchemaById
(
pTableMetaInfo
->
pTableMeta
,
pColIndex
->
colId
)
->
type
==
TSDB_DATA_TYPE_JSON
){
if
(
!
pItem
->
isJsonExp
){
return
invalidOperationMsg
(
pMsgBuf
,
msg14
);
...
...
tests/system-test/2-query/0-aggregate/TD-12340-12342.py
浏览文件 @
61c46977
...
...
@@ -47,18 +47,6 @@ class TDTestCase:
pass
def
check_td12340
(
self
):
# this case expect return two column when using "group by ts"
tdSql
.
query
(
"select count(*) from stb1 group by ts"
)
try
:
tdSql
.
checkCols
(
2
)
self
.
curret_case
+=
1
tdLog
.
printNoPrefix
(
"the case1: td-12340 run passed"
)
except
:
self
.
err_case
+=
1
tdLog
.
printNoPrefix
(
"the case1: td-12340 run failed"
)
pass
def
check_td12342
(
self
):
# this case expect return err when using "group by ts order by first-tag"
try
:
...
...
@@ -73,7 +61,6 @@ class TDTestCase:
def
run
(
self
):
self
.
create_stb
()
self
.
check_td12340
()
self
.
check_td12342
()
if
self
.
err_case
>
0
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录