Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Cherenkov effect
TDengine
提交
37f485a9
T
TDengine
项目概览
Cherenkov effect
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
37f485a9
编写于
11月 05, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-1875]<fix>: disable group by in join query.
上级
a1fc9d80
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
14 deletion
+19
-14
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+5
-0
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+14
-14
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
37f485a9
...
...
@@ -2758,6 +2758,7 @@ int32_t parseGroupbyClause(SQueryInfo* pQueryInfo, tVariantList* pList, SSqlCmd*
const
char
*
msg1
=
"too many columns in group by clause"
;
const
char
*
msg2
=
"invalid column name in group by clause"
;
const
char
*
msg3
=
"columns from one table allowed as group by columns"
;
const
char
*
msg4
=
"join query does not support group by"
;
const
char
*
msg7
=
"not support group by expression"
;
const
char
*
msg8
=
"not allowed column type for group by"
;
const
char
*
msg9
=
"tags not allowed for table query"
;
...
...
@@ -2778,6 +2779,10 @@ int32_t parseGroupbyClause(SQueryInfo* pQueryInfo, tVariantList* pList, SSqlCmd*
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
if
(
pQueryInfo
->
numOfTables
>
1
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg4
);
}
STableMeta
*
pTableMeta
=
NULL
;
SSchema
*
pSchema
=
NULL
;
SSchema
s
=
tscGetTbnameColumnSchema
();
...
...
src/query/tests/tsBufTest.cpp
浏览文件 @
37f485a9
...
...
@@ -42,7 +42,7 @@ void simpleTest() {
EXPECT_EQ
(
pTSBuf
->
tsData
.
len
,
sizeof
(
int64_t
)
*
num
);
EXPECT_EQ
(
tVariantCompare
(
&
pTSBuf
->
block
.
tag
,
&
t
),
0
);
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
1
);
tsBufFlush
(
pTSBuf
);
EXPECT_EQ
(
pTSBuf
->
tsData
.
len
,
0
);
...
...
@@ -69,7 +69,7 @@ void largeTSTest() {
// the data has been flush to disk, no data in cache
EXPECT_EQ
(
pTSBuf
->
tsData
.
len
,
0
);
EXPECT_EQ
(
tVariantCompare
(
&
pTSBuf
->
block
.
tag
,
&
t
),
0
);
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
1
);
EXPECT_EQ
(
pTSBuf
->
tsOrder
,
TSDB_ORDER_ASC
);
tsBufFlush
(
pTSBuf
);
...
...
@@ -105,7 +105,7 @@ void multiTagsTest() {
EXPECT_EQ
(
pTSBuf
->
tsData
.
len
,
num
*
sizeof
(
int64_t
));
EXPECT_EQ
(
pTSBuf
->
block
.
tag
.
i64Key
,
numOfTags
-
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
1
);
tsBufFlush
(
pTSBuf
);
EXPECT_EQ
(
pTSBuf
->
tsData
.
len
,
0
);
...
...
@@ -139,7 +139,7 @@ void multiVnodeTagsTest() {
start
+=
step
*
num
;
}
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
j
+
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
j
+
1
);
}
EXPECT_EQ
(
pTSBuf
->
tsOrder
,
TSDB_ORDER_ASC
);
...
...
@@ -184,7 +184,7 @@ void loadDataTest() {
start
+=
step
*
num
;
}
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
j
+
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
j
+
1
);
}
EXPECT_EQ
(
pTSBuf
->
tsOrder
,
TSDB_ORDER_ASC
);
...
...
@@ -203,7 +203,7 @@ void loadDataTest() {
// create from exists file
STSBuf
*
pNewBuf
=
tsBufCreateFromFile
(
pTSBuf
->
path
,
false
);
EXPECT_EQ
(
pNewBuf
->
tsOrder
,
pTSBuf
->
tsOrder
);
EXPECT_EQ
(
pNewBuf
->
numOf
Vnode
s
,
numOfVnode
);
EXPECT_EQ
(
pNewBuf
->
numOf
Group
s
,
numOfVnode
);
EXPECT_EQ
(
pNewBuf
->
fileSize
,
pTSBuf
->
fileSize
);
EXPECT_EQ
(
pNewBuf
->
pData
[
0
].
info
.
offset
,
pTSBuf
->
pData
[
0
].
info
.
offset
);
...
...
@@ -269,7 +269,7 @@ void TSTraverse() {
start
+=
step
*
num
;
}
EXPECT_EQ
(
pTSBuf
->
numOf
Vnode
s
,
j
+
1
);
EXPECT_EQ
(
pTSBuf
->
numOf
Group
s
,
j
+
1
);
}
tsBufResetPos
(
pTSBuf
);
...
...
@@ -304,7 +304,7 @@ void TSTraverse() {
int32_t
totalOutput
=
10
;
while
(
1
)
{
STSElem
elem
=
tsBufGetElem
(
pTSBuf
);
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
vnode
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
id
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
if
(
!
tsBufNextPos
(
pTSBuf
))
{
break
;
...
...
@@ -352,7 +352,7 @@ void TSTraverse() {
totalOutput
=
10
;
while
(
1
)
{
STSElem
elem
=
tsBufGetElem
(
pTSBuf
);
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
vnode
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
id
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
if
(
!
tsBufNextPos
(
pTSBuf
))
{
break
;
...
...
@@ -427,7 +427,7 @@ void mergeDiffVnodeBufferTest() {
tsBufFlush
(
pTSBuf2
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
);
EXPECT_EQ
(
pTSBuf1
->
numOf
Vnode
s
,
2
);
EXPECT_EQ
(
pTSBuf1
->
numOf
Group
s
,
2
);
EXPECT_EQ
(
pTSBuf1
->
numOfTotal
,
numOfTags
*
2
*
num
);
tsBufDisplay
(
pTSBuf1
);
...
...
@@ -472,7 +472,7 @@ void mergeIdenticalVnodeBufferTest() {
tsBufFlush
(
pTSBuf2
);
tsBufMerge
(
pTSBuf1
,
pTSBuf2
);
EXPECT_EQ
(
pTSBuf1
->
numOf
Vnode
s
,
2
);
EXPECT_EQ
(
pTSBuf1
->
numOf
Group
s
,
2
);
EXPECT_EQ
(
pTSBuf1
->
numOfTotal
,
numOfTags
*
2
*
num
);
tsBufResetPos
(
pTSBuf1
);
...
...
@@ -482,12 +482,12 @@ void mergeIdenticalVnodeBufferTest() {
STSElem
elem
=
tsBufGetElem
(
pTSBuf1
);
if
(
count
++
<
numOfTags
*
num
)
{
EXPECT_EQ
(
elem
.
vnode
,
12
);
EXPECT_EQ
(
elem
.
id
,
12
);
}
else
{
EXPECT_EQ
(
elem
.
vnode
,
77
);
EXPECT_EQ
(
elem
.
id
,
77
);
}
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
vnode
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
printf
(
"%d-%"
PRIu64
"-%"
PRIu64
"
\n
"
,
elem
.
id
,
elem
.
tag
->
i64Key
,
elem
.
ts
);
}
tsBufDestroy
(
pTSBuf1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录