Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3d567070
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
3d567070
编写于
6月 16, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix td-642
上级
be1791e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
36 deletion
+31
-36
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+6
-3
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+4
-0
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+5
-5
tests/script/general/parser/stream.sim
tests/script/general/parser/stream.sim
+16
-28
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
3d567070
...
...
@@ -6082,11 +6082,14 @@ int32_t exprTreeFromSqlExpr(tExprNode **pExpr, const tSQLExpr* pSqlExpr, SArray*
}
}
if
((
*
pExpr
)
->
_node
.
optr
!=
TSDB_RELATION_EQUAL
&&
(
*
pExpr
)
->
_node
.
optr
!=
TSDB_RELATION_NOT_EQUAL
)
{
if
(
pRight
->
nodeType
==
TSQL_NODE_VALUE
)
{
if
(
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_BOOL
||
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_BOOL
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
if
((
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pRight
->
pVal
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
&&
(
*
pExpr
)
->
_node
.
optr
!=
TSDB_RELATION_LIKE
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
}
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
3d567070
...
...
@@ -600,6 +600,10 @@ int tsdbDropTable(TsdbRepoT *repo, STableId tableId) {
return
-
1
;
}
if
(
pTable
->
cqhandle
!=
NULL
)
{
pRepo
->
appH
.
cqDropFunc
(
pTable
->
cqhandle
);
}
tsdbTrace
(
"vgId:%d, table %s is dropped! tid:%d, uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
varDataVal
(
pTable
->
name
),
tableId
.
tid
,
tableId
.
uid
);
if
(
tsdbRemoveTableFromMeta
(
pMeta
,
pTable
,
true
)
<
0
)
return
-
1
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
3d567070
...
...
@@ -325,6 +325,11 @@ void vnodeRelease(void *pVnodeRaw) {
tsdbCloseRepo
(
pVnode
->
tsdb
,
1
);
pVnode
->
tsdb
=
NULL
;
// stop continuous query
if
(
pVnode
->
cq
)
cqClose
(
pVnode
->
cq
);
pVnode
->
cq
=
NULL
;
if
(
pVnode
->
wal
)
walClose
(
pVnode
->
wal
);
pVnode
->
wal
=
NULL
;
...
...
@@ -436,11 +441,6 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
pVnode
->
sync
=
NULL
;
}
// stop continuous query
if
(
pVnode
->
cq
)
cqClose
(
pVnode
->
cq
);
pVnode
->
cq
=
NULL
;
// release local resources only after cutting off outside connections
vnodeRelease
(
pVnode
);
}
...
...
tests/script/general/parser/stream.sim
浏览文件 @
3d567070
...
...
@@ -51,19 +51,20 @@ sql drop table strm
## [TBASE304]
print ====== TBASE-304
sleep 10000
print create mt
sql create table mt (ts timestamp, c1 int) tags(t1 int, t2 int)
# we cannot reset query cache in server side, as a workaround,
# set super table name to mt304, need to change back to mt later
print create mt304
sql create table mt304 (ts timestamp, c1 int) tags(t1 int, t2 int)
print create tb1
sql create table tb1 using mt tags(1, 1)
sql create table tb1 using mt
304
tags(1, 1)
print create tb2
sql create table tb2 using mt tags(1, -1)
sql create table tb2 using mt
304
tags(1, -1)
print create strm
sql create table strm as select count(*), avg(c1) from mt where t2 >= 0 interval(4s) sliding(2s)
sql create table strm as select count(*), avg(c1) from mt
304
where t2 >= 0 interval(4s) sliding(2s)
sql insert into tb1 values (now,1)
sql insert into tb2 values (now,2)
sleep
2
0000
sleep
10
0000
sql select * from strm;
sleep 1000
if $rows != 2 then
print ==== expect rows = 2, actually returned rows = $rows
return -1
...
...
@@ -75,11 +76,11 @@ print data02 = $data02
if $data02 != 1.000000000 then
return -1
endi
sql alter table mt drop tag t2;
sql alter table mt
304
drop tag t2;
sql insert into tb2 values (now,2);
sql insert into tb1 values (now,1);
sql select * from strm;
sql alter table mt add tag t2 int;
sql alter table mt
304
add tag t2 int;
sleep 10000
sql select * from strm
...
...
@@ -98,7 +99,7 @@ sleep 4000
sql insert into tb2 values (now, 2, 'tb2')
sleep 4000
sql insert into tb3 values (now, 0, 'tb3')
sleep 6000
sleep 6000
0
sql describe strm
if $rows == 0 then
...
...
@@ -134,11 +135,9 @@ endi
## The vnode client needs to refresh metadata cache to allow strm calculate tb4's data. But the current refreshing frequency is every 10 min
## commented out the case below to save running time
sql create table tb4 using stb tags('a4')
sleep 6000
sql insert into tb4 values(now, 4, 'tb4')
sleep
1
0000
sleep
6
0000
sql select * from strm order by ts desc
sleep 1000
print ======== data0: $data00 $data01 $data02 $data03
#print ======== data1: $data10 $data11 $data12 $data13
#print ======== data2: $data20 $data21 $data22 $data23
...
...
@@ -160,7 +159,7 @@ sleep 3000 # waiting for new tag valid
sql insert into tb1 values (now, 1, 'tb1_a1')
sleep 4000
sql insert into tb4 values (now, -4, 'tb4_b4')
sleep 10000
sleep 10000
0
sql select * from strm order by ts desc
sleep 1000
print ======== data0: $data00 $data01 $data02 $data03
...
...
@@ -191,9 +190,9 @@ sql create table tb3 using stb tags(3, 'tb3')
sql create table tb4 using stb tags(4, 'tb4')
sql create table strm0 as select count(ts), count(c1), max(c2), min(c4), first(c5), last(c6) from stb where ts < now + 30s interval(4s) sliding(2s)
sleep 1000
0
sleep 1000
sql insert into tb0 values (now, 0, 0, 0, 0, 'binary0', '涛思0', true) tb1 values (now, 1, 1, 1, 1, 'binary1', '涛思1', false) tb2 values (now, 2, 2, 2, 2, 'binary2', '涛思2', true) tb3 values (now, 3, 3, 3, 3, 'binary3', '涛思3', false) tb4 values (now, 4, 4, 4, 4, 'binary4', '涛思4', true)
sleep
5
000
sleep
20
000
sql select * from strm0 order by ts desc
sleep 1000
if $rows != 2 then
...
...
@@ -202,7 +201,7 @@ if $rows != 2 then
endi
sql insert into tb0 values (now, 10, 10, 10, 10, 'binary0', '涛思0', true) tb1 values (now, 11, 11, 11, 11, 'binary1', '涛思1', false) tb2 values (now, 12, 12, 12, 12, 'binary2', '涛思2', true) tb3 values (now, 13, 13, 13, 13, 'binary3', '涛思3', false) tb4 values (now, 14, 14, 14, 14, 'binary4', '涛思4', true)
sleep
5
000
sleep
30
000
sql select * from strm0 order by ts desc
sleep 1000
if $rows != 4 then
...
...
@@ -210,15 +209,4 @@ if $rows != 4 then
return -1
endi
sql drop database if exists strm_db_0
sql show databases
if $rows != 0 then
return -1
endi
sql create database $db
sql use $db
sql create table stb (ts timestamp, c1 int) tags(t1 int)
sql create table tb1 using stb tags(1)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录