Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4585cf61
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4585cf61
编写于
12月 16, 2021
作者:
wmmhello
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into fix/TD-11201
上级
84faef50
4a784a72
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
268 addition
and
12 deletion
+268
-12
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+5
-1
src/kit/taos-tools
src/kit/taos-tools
+1
-1
src/query/inc/tdigest.h
src/query/inc/tdigest.h
+1
-1
src/query/src/qPlan.c
src/query/src/qPlan.c
+6
-0
src/query/src/queryMain.c
src/query/src/queryMain.c
+1
-0
src/util/src/tlog.c
src/util/src/tlog.c
+1
-1
tests/examples/C#/taosdemo/taosdemo.cs
tests/examples/C#/taosdemo/taosdemo.cs
+8
-2
tests/examples/JDBC/taosdemo/pom.xml
tests/examples/JDBC/taosdemo/pom.xml
+1
-1
tests/pytest/functions/function_elapsed_case.py
tests/pytest/functions/function_elapsed_case.py
+2
-0
tests/pytest/tools/taosdumpTest2.py
tests/pytest/tools/taosdumpTest2.py
+1
-1
tests/pytest/tools/taosdumpTest3.py
tests/pytest/tools/taosdumpTest3.py
+0
-1
tests/script/general/parser/nestquery.sim
tests/script/general/parser/nestquery.sim
+203
-0
tests/script/general/parser/select_with_tags.sim
tests/script/general/parser/select_with_tags.sim
+35
-0
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
4585cf61
...
...
@@ -2759,7 +2759,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
if
(
pItem
->
pNode
->
Expr
.
paramList
==
NULL
||
(
functionId
!=
TSDB_FUNC_LEASTSQR
&&
functionId
!=
TSDB_FUNC_DERIVATIVE
&&
functionId
!=
TSDB_FUNC_ELAPSED
&&
numOfParams
!=
1
)
||
((
functionId
==
TSDB_FUNC_LEASTSQR
||
functionId
==
TSDB_FUNC_DERIVATIVE
)
&&
numOfParams
!=
3
)
||
(
functionId
==
TSDB_FUNC_ELAPSED
&&
numOfParams
>
2
))
{
(
functionId
==
TSDB_FUNC_ELAPSED
&&
numOfParams
!=
1
&&
numOfParams
!=
2
))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
4585cf61
...
...
@@ -3783,7 +3783,7 @@ void tscSetQuerySort(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr) {
size_t
size
=
taosArrayGetSize
(
pQueryInfo
->
pUpstream
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SQueryInfo
*
pq
=
taosArrayGetP
(
pQueryInfo
->
pUpstream
,
i
);
if
(
pq
->
groupbyTag
&&
pq
->
interval
.
interval
>
0
)
{
if
(
pq
->
groupbyTag
)
{
pQueryAttr
->
needSort
=
true
;
return
;
}
...
...
src/client/src/tscSystem.c
浏览文件 @
4585cf61
...
...
@@ -113,7 +113,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry
SRpcObj
rpcObj
;
memset
(
&
rpcObj
,
0
,
sizeof
(
rpcObj
));
strncpy
(
rpcObj
.
key
,
key
,
strlen
(
key
));
tstrncpy
(
rpcObj
.
key
,
key
,
sizeof
(
rpcObj
.
key
));
rpcObj
.
pDnodeConn
=
rpcOpen
(
&
rpcInit
);
if
(
rpcObj
.
pDnodeConn
==
NULL
)
{
pthread_mutex_unlock
(
&
rpcObjMutex
);
...
...
src/client/src/tscUtil.c
浏览文件 @
4585cf61
...
...
@@ -4928,7 +4928,11 @@ int32_t createProjectionExpr(SQueryInfo* pQueryInfo, STableMetaInfo* pTableMetaI
}
}
pse
->
colInfo
.
flag
=
pSource
->
base
.
colInfo
.
flag
;
//TSDB_COL_NORMAL;
if
(
!
pQueryInfo
->
stableQuery
&&
TSDB_COL_IS_TAG
(
pSource
->
base
.
colInfo
.
flag
))
{
pse
->
colInfo
.
flag
=
(
pSource
->
base
.
colInfo
.
flag
)
&
(
~
TSDB_COL_TAG
);
}
else
{
pse
->
colInfo
.
flag
=
pSource
->
base
.
colInfo
.
flag
;
}
pse
->
resType
=
pSource
->
base
.
resType
;
pse
->
resBytes
=
pSource
->
base
.
resBytes
;
strncpy
(
pse
->
colInfo
.
name
,
pSource
->
base
.
aliasName
,
tListLen
(
pse
->
colInfo
.
name
));
...
...
taos-tools
@
7eae58a0
比较
0b4a16e9
...
7eae58a0
Subproject commit
0b4a16e96b5cc9cb6e4f8cacf6a1f3028c91adb0
Subproject commit
7eae58a0fbf7c7321dd1bdc96e375d4c832cf373
src/query/inc/tdigest.h
浏览文件 @
4585cf61
...
...
@@ -29,7 +29,7 @@
#define DOUBLE_MAX 1.79e+308
#define ADDITION_CENTROID_NUM 2
#define COMPRESSION
4
00
#define COMPRESSION
3
00
#define GET_CENTROID(compression) (ceil(compression * M_PI / 2) + 1 + ADDITION_CENTROID_NUM)
#define GET_THRESHOLD(compression) (7.5 + 0.37 * compression - 2e-4 * pow(compression, 2))
#define TDIGEST_SIZE(compression) (sizeof(TDigest) + sizeof(SCentroid)*GET_CENTROID(compression) + sizeof(SPt)*GET_THRESHOLD(compression))
...
...
src/query/src/qPlan.c
浏览文件 @
4585cf61
...
...
@@ -588,6 +588,12 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
op
=
OP_Fill
;
taosArrayPush
(
plan
,
&
op
);
}
// outer query order by support
int32_t
orderColId
=
pQueryAttr
->
order
.
orderColId
;
if
(
pQueryAttr
->
vgId
==
0
&&
orderColId
!=
PRIMARYKEY_TIMESTAMP_COL_INDEX
&&
orderColId
!=
INT32_MIN
)
{
op
=
OP_Order
;
taosArrayPush
(
plan
,
&
op
);
}
}
}
else
if
(
pQueryAttr
->
groupbyColumn
)
{
...
...
src/query/src/queryMain.c
浏览文件 @
4585cf61
...
...
@@ -279,6 +279,7 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) {
if
(
isQueryKilled
(
pQInfo
))
{
qDebug
(
"QInfo:0x%"
PRIx64
" it is already killed, abort"
,
pQInfo
->
qId
);
setQueryKilled
(
pQInfo
);
pQInfo
->
runtimeEnv
.
outputBuf
=
NULL
;
return
doBuildResCheck
(
pQInfo
);
}
...
...
src/util/src/tlog.c
浏览文件 @
4585cf61
...
...
@@ -131,7 +131,7 @@ void taosCloseLog() {
taosStopLog
();
//tsem_post(&(tsLogObj.logHandle->buffNotEmpty));
taosMsleep
(
MAX_LOG_INTERVAL
/
1000
);
if
(
taosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
if
(
t
sLogObj
.
logHandle
&&
t
aosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
pthread_join
(
tsLogObj
.
logHandle
->
asyncThread
,
NULL
);
}
// In case that other threads still use log resources causing invalid write in valgrind
...
...
tests/examples/C#/taosdemo/taosdemo.cs
浏览文件 @
4585cf61
...
...
@@ -361,7 +361,10 @@ namespace TDengineDriver
threadArr
[
i
]
=
new
Thread
(
createTableThread
.
ThreadMain
);
threadArr
[
i
].
Start
();
threadArr
[
i
].
Join
();
}
for
(
int
j
=
0
;
j
<
numOfThreads
;
j
++)
{
threadArr
[
j
].
Join
();
}
}
...
...
@@ -482,7 +485,10 @@ namespace TDengineDriver
threadArr
[
i
]
=
new
Thread
(
insertThread
.
ThreadMain
);
threadArr
[
i
].
Start
();
threadArr
[
i
].
Join
();
}
for
(
int
j
=
0
;
j
<
numOfThreads
;
j
++)
{
threadArr
[
j
].
Join
();
}
}
...
...
tests/examples/JDBC/taosdemo/pom.xml
浏览文件 @
4585cf61
...
...
@@ -88,7 +88,7 @@
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
<version>
2.1
5
.0
</version>
<version>
2.1
6
.0
</version>
</dependency>
<!-- junit -->
<dependency>
...
...
tests/pytest/functions/function_elapsed_case.py
浏览文件 @
4585cf61
...
...
@@ -320,6 +320,8 @@ class ElapsedCase:
def
selectIllegalTest
(
self
):
tdSql
.
execute
(
"use wxy_db"
)
tdSql
.
error
(
"select elapsed() from t1"
)
tdSql
.
error
(
"select elapsed(,) from t1"
)
tdSql
.
error
(
"select elapsed(1) from t1 where ts > '2021-11-22 00:00:00' and ts < '2021-11-23 00:00:00'"
)
tdSql
.
error
(
"select elapsed('2021-11-18 00:00:10') from t1 where ts > '2021-11-22 00:00:00' and ts < '2021-11-23 00:00:00'"
)
tdSql
.
error
(
"select elapsed(now) from t1 where ts > '2021-11-22 00:00:00' and ts < '2021-11-23 00:00:00'"
)
...
...
tests/pytest/tools/taosdumpTest2.py
浏览文件 @
4585cf61
...
...
@@ -69,7 +69,7 @@ class TDTestCase:
os
.
system
(
"rm /tmp/*.sql"
)
os
.
system
(
"%staosdump --databases db -o /tmp -B
32766
-L 1048576"
%
"%staosdump --databases db -o /tmp -B
16384
-L 1048576"
%
binPath
)
tdSql
.
execute
(
"drop database db"
)
...
...
tests/pytest/tools/taosdumpTest3.py
浏览文件 @
4585cf61
...
...
@@ -137,7 +137,6 @@ class TDTestCase:
# verify ns
os
.
system
(
"%staosdump -o ./taosdumptest/tmp6 dp3 st0_0"
%
binPath
)
assert
os
.
system
(
"%staosdump -o ./taosdumptest/tmp6 dp3 st0_0 -C ns "
%
binPath
)
!=
0
# verify -D:--database
os
.
system
(
"%staosdump -o ./taosdumptest/tmp5 --databases dp1,dp2 "
%
binPath
)
...
...
tests/script/general/parser/nestquery.sim
浏览文件 @
4585cf61
...
...
@@ -941,4 +941,207 @@ if $data02 != 0 then
return -1
endi
print ==========================================> TD-11097
sql create database td11097
sql use td11097
sql create table meters2 (ts timestamp, voltage bigint,num int) tags (location binary(30), groupid int);
sql create table D001 using meters2 tags ("Beijing.Chaoyang", 1);
sql create table D002 using meters2 tags ("Beijing.haidian", 2);
sql create table D003 using meters2 tags ('"Beijing.Tongzhou"', 3);
$ts = 1639556426000
sql insert into d001 values ( $ts ,1,2);
sql insert into d001 values ( $ts +1m,2,3);
sql insert into d001 values ( $ts +2m,4,3);
sql insert into d001 values ( $ts +4m,8,3);
sql insert into d002 values ( $ts ,4,3);
sql insert into d002 values ( $ts +3m,40,3);
sql insert into d002 values ( $ts +1m,46,3);
sql insert into d001 values ( $ts +20m,1,2);
sql insert into d002 values ( $ts +21m,4,3);
sql select diff(voltage) value from meters2 group by tbname;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) ;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc;
$emptyString = @@
print execute sql select diff(voltage) value from meters2 group by tbname;
sql select diff(voltage) value from meters2 group by tbname;
if $data00 != @21-12-15 16:21:26.000@ then
return -1
endi
if $data01 != @1@ then
return -1
endi
if $data02 != @d001@ then
return -1
endi
if $data10 != @21-12-15 16:22:26.000@ then
return -1
endi
if $data11 != @2@ then
return -1
endi
if $data12 != @d001@ then
return -1
endi
if $data20 != @21-12-15 16:24:26.000@ then
return -1
endi
if $data21 != @4@ then
return -1
endi
if $data22 != @d001@ then
return -1
endi
if $data30 != @21-12-15 16:40:26.000@ then
return -1
endi
if $data31 != @-7@ then
return -1
endi
if $data32 != @d001@ then
return -1
endi
if $data40 != @21-12-15 16:21:26.000@ then
return -1
endi
if $data41 != @42@ then
return -1
endi
if $data42 != @d002@ then
return -1
endi
if $data50 != @21-12-15 16:23:26.000@ then
return -1
endi
if $data51 != @-6@ then
return -1
endi
if $data52 != @d002@ then
return -1
endi
if $data60 != @21-12-15 16:41:26.000@ then
return -1
endi
if $data61 != @-36@ then
return -1
endi
if $data62 != @d002@ then
return -1
endi
print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) ;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) ;
if $data00 != @21-12-15 16:21:00.000@ then
return -1
endi
if $data01 != @43@ then
return -1
endi
if $data10 != @21-12-15 16:22:00.000@ then
return -1
endi
if $data11 != @2@ then
return -1
endi
if $data20 != @21-12-15 16:23:00.000@ then
return -1
endi
if $data21 != @-6@ then
return -1
endi
if $data30 != @21-12-15 16:24:00.000@ then
return -1
endi
if $data31 != @4@ then
return -1
endi
if $data40 != @21-12-15 16:40:00.000@ then
return -1
endi
if $data41 != @-7@ then
return -1
endi
if $data50 != @21-12-15 16:41:00.000@ then
return -1
endi
if $data51 != @-36@ then
return -1
endi
print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts;
if $data00 != @21-12-15 16:21:00.000@ then
return -1
endi
if $data01 != @43@ then
return -1
endi
if $data10 != @21-12-15 16:22:00.000@ then
return -1
endi
if $data11 != @2@ then
return -1
endi
if $data20 != @21-12-15 16:23:00.000@ then
return -1
endi
if $data21 != @-6@ then
return -1
endi
if $data30 != @21-12-15 16:24:00.000@ then
return -1
endi
if $data31 != @4@ then
return -1
endi
if $data40 != @21-12-15 16:40:00.000@ then
return -1
endi
if $data41 != @-7@ then
return -1
endi
if $data50 != @21-12-15 16:41:00.000@ then
return -1
endi
if $data51 != @-36@ then
return -1
endi
print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc;
sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc;
if $data00 != @21-12-15 16:41:00.000@ then
return -1
endi
if $data01 != @-36@ then
return -1
endi
if $data10 != @21-12-15 16:40:00.000@ then
return -1
endi
if $data11 != @-7@ then
return -1
endi
if $data20 != @21-12-15 16:24:00.000@ then
return -1
endi
if $data21 != @4@ then
return -1
endi
if $data30 != @21-12-15 16:23:00.000@ then
return -1
endi
if $data31 != @-6@ then
return -1
endi
if $data40 != @21-12-15 16:22:00.000@ then
return -1
endi
if $data41 != @2@ then
return -1
endi
if $data50 != @21-12-15 16:21:00.000@ then
return -1
endi
if $data51 != @43@ then
return -1
endi
sql drop database td11097
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/general/parser/select_with_tags.sim
浏览文件 @
4585cf61
...
...
@@ -956,4 +956,39 @@ sql_error select first(c1), count(*), t2, t1, tbname from select_tags_mt0 group
#sql select count(c1) from select_tags_mt0 where c1=99 group by tbname;
#sql select count(*),tbname from select_tags_mt0 group by tbname
print ==================================> TD-11943
sql create database test11943;
sql use test11943;
sql create stable st (ts timestamp , id int ) tags (ind int );
sql insert into sub1 using st tags(1) values(now ,1);
sql insert into sub1 using st tags(1) values(now ,2);
sql insert into sub2 using st tags(2) values(now ,3);
sql insert into sub2 using st tags(2) values(now ,4);
sql select tbname ,max(id)+5 from sub1;
if $data00 != @sub1@ then
return -1
endi
if $data01 != @7.000000000@ then
return -1
endi
sql select ind, max(id)+5 from st group by tbname
if $data00 != @1@ then
return -1
endi
if $data01 != @7.000000000@ then
return -1
endi
if $data02 != @sub1@ then
return -1
endi
if $data10 != @2@ then
return -1
endi
if $data11 != @9.000000000@ then
return -1
endi
if $data12 != @sub2@ then
return -1
endi
sql drop database test11943
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录