Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c597c8ad
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看板
提交
c597c8ad
编写于
4月 25, 2020
作者:
weixin_48148422
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-97: fix bug and update testcases
上级
a9e6abc0
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
32 addition
and
27 deletion
+32
-27
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/query/src/qast.c
src/query/src/qast.c
+2
-1
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+11
-9
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+7
-8
tests/pytest/query/__init__.py
tests/pytest/query/__init__.py
+0
-0
tests/pytest/query/tbname.py
tests/pytest/query/tbname.py
+10
-7
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
c597c8ad
...
...
@@ -3545,7 +3545,7 @@ static int32_t setTableCondForSTableQuery(SQueryInfo* pQueryInfo, const char* ac
return
TSDB_CODE_SUCCESS
;
}
SStringBuilder
sb1
;
SStringBuilder
sb1
=
{
0
}
;
taosStringBuilderAppendStringLen
(
&
sb1
,
QUERY_COND_REL_PREFIX_IN
,
QUERY_COND_REL_PREFIX_IN_LEN
);
char
db
[
TSDB_TABLE_ID_LEN
]
=
{
0
};
...
...
src/client/src/tscServer.c
浏览文件 @
c597c8ad
...
...
@@ -1855,7 +1855,7 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_HEARTBEAT
;
assert
(
msgLen
+
minMsgSize
()
<=
size
);
return
msgLen
;
return
TSDB_CODE_SUCCESS
;
}
int
tscProcessTableMetaRsp
(
SSqlObj
*
pSql
)
{
...
...
src/query/src/qast.c
浏览文件 @
c597c8ad
...
...
@@ -816,7 +816,7 @@ static void tQueryIndexlessColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo,
if
(
pQueryInfo
->
optr
==
TSDB_RELATION_IN
)
{
addToResult
=
pQueryInfo
->
compare
(
table
->
name
,
pQueryInfo
->
q
.
arr
);
}
else
if
(
pQueryInfo
->
optr
==
TSDB_RELATION_LIKE
)
{
addToResult
=
pQueryInfo
->
compare
(
table
->
name
,
pQueryInfo
->
q
.
pz
);
addToResult
=
!
pQueryInfo
->
compare
(
table
->
name
,
pQueryInfo
->
q
.
pz
);
}
}
else
{
// TODO: other columns
...
...
@@ -1188,6 +1188,7 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) {
// TODO:
}
memcpy
(
pVal
->
pz
,
tbnameCond
+
QUERY_COND_REL_PREFIX_LIKE_LEN
,
len
);
pVal
->
nLen
=
(
int32_t
)
len
;
}
else
if
(
strncmp
(
tbnameCond
,
QUERY_COND_REL_PREFIX_IN
,
QUERY_COND_REL_PREFIX_IN_LEN
)
==
0
)
{
right
->
nodeType
=
TSQL_NODE_VALUE
;
...
...
src/query/src/queryExecutor.c
浏览文件 @
c597c8ad
...
...
@@ -5430,13 +5430,6 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
pMsg
+=
sizeof
(
int64_t
)
*
pQueryMsg
->
numOfOutput
;
}
// the tag query condition expression string is located at the end of query msg
if
(
pQueryMsg
->
tagCondLen
>
0
)
{
*
tagCond
=
calloc
(
1
,
pQueryMsg
->
tagCondLen
);
memcpy
(
*
tagCond
,
pMsg
,
pQueryMsg
->
tagCondLen
);
pMsg
+=
pQueryMsg
->
tagCondLen
;
}
if
(
pQueryMsg
->
numOfTags
>
0
)
{
(
*
tagCols
)
=
calloc
(
1
,
sizeof
(
SColumnInfo
)
*
pQueryMsg
->
numOfTags
);
for
(
int32_t
i
=
0
;
i
<
pQueryMsg
->
numOfTags
;
++
i
)
{
...
...
@@ -5448,13 +5441,22 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
pTagCol
->
numOfFilters
=
0
;
(
*
tagCols
)[
i
]
=
*
pTagCol
;
pMsg
+=
sizeof
(
SColumnInfo
);
}
}
// the tag query condition expression string is located at the end of query msg
if
(
pQueryMsg
->
tagCondLen
>
0
)
{
*
tagCond
=
calloc
(
1
,
pQueryMsg
->
tagCondLen
);
memcpy
(
*
tagCond
,
pMsg
,
pQueryMsg
->
tagCondLen
);
pMsg
+=
pQueryMsg
->
tagCondLen
;
}
if
(
*
pMsg
!=
0
)
{
size_t
len
=
strlen
(
pMsg
);
*
tbnameCond
=
malloc
(
len
+
1
);
size_t
len
=
strlen
(
pMsg
)
+
1
;
*
tbnameCond
=
malloc
(
len
);
strcpy
(
*
tbnameCond
,
pMsg
);
pMsg
+=
len
;
}
qTrace
(
"qmsg:%p query on %d table(s), qrange:%"
PRId64
"-%"
PRId64
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
c597c8ad
...
...
@@ -1448,7 +1448,7 @@ int32_t tsdbQueryByTagsCond(
size_t
len
,
int16_t
tagNameRelType
,
const
char
*
tbnameCond
,
STableGroupInfo
*
pGroup
List
,
STableGroupInfo
*
pGroup
Info
,
SColIndex
*
pColIndex
,
int32_t
numOfCols
)
{
...
...
@@ -1465,16 +1465,15 @@ int32_t tsdbQueryByTagsCond(
if
(
tbnameCond
==
NULL
&&
(
pTagCond
==
NULL
||
len
==
0
))
{
int32_t
ret
=
getAllTableIdList
(
tsdb
,
uid
,
res
);
if
(
ret
==
TSDB_CODE_SUCCESS
)
{
pGroupList
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroupList
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
);
}
pGroupInfo
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroupInfo
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
);
}
taosArrayDestroy
(
res
);
return
ret
;
}
int32_t
ret
=
TSDB_CODE_SUCCESS
;
tExprNode
*
expr
=
exprTreeFromTableName
(
tbnameCond
);
tExprNode
*
tagExpr
=
exprTreeFromBinary
(
pTagCond
,
len
);
if
(
tagExpr
!=
NULL
)
{
...
...
@@ -1491,8 +1490,8 @@ int32_t tsdbQueryByTagsCond(
}
doQueryTableList
(
pSTable
,
res
,
expr
);
pGroup
List
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroup
List
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
);
pGroup
Info
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroup
Info
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
);
taosArrayDestroy
(
res
);
return
ret
;
...
...
tests/pytest/
select
/__init__.py
→
tests/pytest/
query
/__init__.py
浏览文件 @
c597c8ad
文件已移动
tests/pytest/
select
/tbname.py
→
tests/pytest/
query
/tbname.py
浏览文件 @
c597c8ad
...
...
@@ -39,29 +39,32 @@ class TDTestCase:
tdSql
.
query
(
"select * from cars where tbname in ('carzero', 'cartwo')"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from cars where id=1 or tbname in ('carzero
0
', 'cartwo')"
)
tdSql
.
query
(
"select * from cars where id=1 or tbname in ('carzero', 'cartwo')"
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select * from cars where id=1 and tbname in ('carzero
0
', 'cartwo')"
)
tdSql
.
query
(
"select * from cars where id=1 and tbname in ('carzero', 'cartwo')"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select * from cars where id=0 and tbname in ('carzero
0
', 'cartwo')"
)
tdSql
.
query
(
"select * from cars where id=0 and tbname in ('carzero', 'cartwo')"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from cars where tbname like 'car%')
"""
tdSql.query("select * from cars where tbname like 'car%'")
tdSql.checkRows(2)
tdSql.query("
select
*
from
cars
where
tbname
like
'%%o'
)
tdSql.cursor.execute("use db")
tdSql.query("select * from cars where tbname like '%o'")
tdSql.checkRows(1)
tdSql.query("select * from cars where id=1 and tbname like 'car%')
tdSql.checkRows(1)
tdSql.query("
select
*
from
cars
where
id
=
1
and
tbname
like
'%
%
o'
)
tdSql.query("select * from cars where id = 1 and tbname like '%o')
tdSql.checkRows(0)
tdSql
.
query
(
"select * from cars where id = 1 or tbname like '%
%
o')
tdSql.query("select * from cars where id = 1 or tbname like '%o')
tdSql.checkRows(2)
"""
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录