Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
ebd1bb38
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
提交
ebd1bb38
编写于
6月 17, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix bugs in join
上级
53cf7201
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
12 deletion
+14
-12
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+4
-2
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+10
-10
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
ebd1bb38
...
...
@@ -1839,7 +1839,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
}
else
{
tVariantDump
(
pVariant
,
val
,
TSDB_DATA_TYPE_BIGINT
,
true
);
int64_t
nTop
=
*
((
int32_t
*
)
val
);
int64_t
nTop
=
GET_INT32_VAL
(
val
);
if
(
nTop
<=
0
||
nTop
>
100
)
{
// todo use macro
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg5
);
}
...
...
@@ -1849,12 +1849,14 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
return
TSDB_CODE_TSC_INVALID_SQL
;
}
// todo REFACTOR
// set the first column ts for top/bottom query
SColumnIndex
index1
=
{
0
,
PRIMARYKEY_TIMESTAMP_COL_INDEX
};
pExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS
,
&
index1
,
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_KEYSIZE
,
TSDB_KEYSIZE
,
false
);
tstrncpy
(
pExpr
->
aliasName
,
aAggs
[
TSDB_FUNC_TS
].
aName
,
sizeof
(
pExpr
->
aliasName
));
const
int32_t
TS_COLUMN_INDEX
=
0
;
const
int32_t
TS_COLUMN_INDEX
=
PRIMARYKEY_TIMESTAMP_COL_INDEX
;
SColumnList
ids
=
getColumnList
(
1
,
0
,
TS_COLUMN_INDEX
);
insertResultField
(
pQueryInfo
,
TS_COLUMN_INDEX
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS
].
aName
,
pExpr
);
...
...
src/query/tests/tsBufTest.cpp
浏览文件 @
ebd1bb38
...
...
@@ -29,7 +29,7 @@ int64_t* createTsList(int32_t num, int64_t start, int32_t step) {
// simple test
void
simpleTest
()
{
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
// write 10 ts points
int32_t
num
=
10
;
...
...
@@ -52,7 +52,7 @@ void simpleTest() {
// one large list of ts, the ts list need to be split into several small blocks
void
largeTSTest
()
{
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
// write 10 ts points
int32_t
num
=
1000000
;
...
...
@@ -75,7 +75,7 @@ void largeTSTest() {
}
void
multiTagsTest
()
{
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
int32_t
num
=
10000
;
int64_t
tag
=
1
;
...
...
@@ -105,7 +105,7 @@ void multiTagsTest() {
}
void
multiVnodeTagsTest
()
{
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
int32_t
num
=
10000
;
int64_t
start
=
10000000
;
...
...
@@ -143,7 +143,7 @@ void multiVnodeTagsTest() {
}
void
loadDataTest
()
{
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
int32_t
num
=
10000
;
int64_t
oldStart
=
10000000
;
...
...
@@ -221,7 +221,7 @@ void TSTraverse() {
int32_t
step
=
30
;
int32_t
numOfVnode
=
2
;
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
for
(
int32_t
j
=
0
;
j
<
numOfVnode
;
++
j
)
{
// vnodeId:0
...
...
@@ -359,8 +359,8 @@ void invalidFileTest() {
}
void
mergeDiffVnodeBufferTest
()
{
STSBuf
*
pTSBuf1
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf2
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf1
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
STSBuf
*
pTSBuf2
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
int32_t
step
=
30
;
int32_t
num
=
1000
;
...
...
@@ -391,8 +391,8 @@ void mergeDiffVnodeBufferTest() {
}
void
mergeIdenticalVnodeBufferTest
()
{
STSBuf
*
pTSBuf1
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf2
=
tsBufCreate
(
true
);
STSBuf
*
pTSBuf1
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
STSBuf
*
pTSBuf2
=
tsBufCreate
(
true
,
TSDB_ORDER_ASC
);
int32_t
step
=
30
;
int32_t
num
=
1000
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录