Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
c455f897
T
TDengine
项目概览
Tonvia
/
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,发现更多精彩内容 >>
未验证
提交
c455f897
编写于
6月 19, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2371 from taosdata/feature/query
Feature/query
上级
d43ba756
fed4f0f2
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
25 addition
and
29 deletion
+25
-29
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+3
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+11
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+3
-3
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+0
-18
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+2
-0
src/util/src/tcompare.c
src/util/src/tcompare.c
+5
-5
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
c455f897
...
...
@@ -42,11 +42,13 @@ static void tscAsyncFetchSingleRowProxy(void *param, TAOS_RES *tres, int numOfRo
int
doAsyncParseSql
(
SSqlObj
*
pSql
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
int32_t
code
=
tscAllocPayload
(
pCmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tscError
(
"failed to malloc payload"
);
pSql
->
res
.
code
=
code
;
tscQueueAsyncRes
(
pSql
);
// tscQueueAsyncRes(pSql->fp, pSql->param, TSDB_CODE_TSC_OUT_OF_MEMORY);
return
code
;
}
...
...
src/client/src/tscParseInsert.c
浏览文件 @
c455f897
src/client/src/tscSQLParser.c
浏览文件 @
c455f897
...
...
@@ -1482,6 +1482,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
const
char
*
msg5
=
"parameter is out of range [0, 100]"
;
const
char
*
msg6
=
"function applied to tags not allowed"
;
const
char
*
msg7
=
"normal table can not apply this function"
;
const
char
*
msg8
=
"multi-columns selection does not support alias column name"
;
switch
(
optr
)
{
case
TK_COUNT
:
{
...
...
@@ -1689,6 +1690,10 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg3
);
}
if
(
pItem
->
pNode
->
pParam
->
nExpr
>
1
&&
strlen
(
pItem
->
aliasName
)
>
0
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg8
);
}
/* in first/last function, multiple columns can be add to resultset */
for
(
int32_t
i
=
0
;
i
<
pItem
->
pNode
->
pParam
->
nExpr
;
++
i
)
{
tSQLExprItem
*
pParamElem
=
&
(
pItem
->
pNode
->
pParam
->
a
[
i
]);
...
...
@@ -1755,6 +1760,11 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
}
else
{
// select * from xxx
int32_t
numOfFields
=
0
;
// multicolumn selection does not support alias name
if
(
strlen
(
pItem
->
aliasName
)
!=
0
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg8
);
}
for
(
int32_t
j
=
0
;
j
<
pQueryInfo
->
numOfTables
;
++
j
)
{
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
j
);
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMetaInfo
->
pTableMeta
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
c455f897
...
...
@@ -1896,6 +1896,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
tscTrace
(
"%p submit data to %d vnode(s)"
,
pSql
,
pDataBlocks
->
nSize
);
SSubqueryState
*
pState
=
calloc
(
1
,
sizeof
(
SSubqueryState
));
pState
->
numOfTotal
=
pSql
->
numOfSubs
;
pState
->
numOfRemain
=
pState
->
numOfTotal
;
pRes
->
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -1917,7 +1918,6 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
*/
pNew
->
fetchFp
=
pNew
->
fp
;
pSql
->
pSubs
[
i
]
=
pNew
;
pNew
->
fetchFp
=
pNew
->
fp
;
tscTrace
(
"%p sub:%p create subObj success. orderOfSub:%d"
,
pSql
,
pNew
,
i
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
c455f897
...
...
@@ -1581,24 +1581,6 @@ void tscClearSubqueryInfo(SSqlCmd* pCmd) {
}
}
void
doRemoveTableMetaInfo
(
SQueryInfo
*
pQueryInfo
,
int32_t
index
,
bool
removeFromCache
)
{
if
(
index
<
0
||
index
>=
pQueryInfo
->
numOfTables
)
{
return
;
}
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
);
tscClearTableMetaInfo
(
pTableMetaInfo
,
removeFromCache
);
free
(
pTableMetaInfo
);
int32_t
after
=
pQueryInfo
->
numOfTables
-
index
-
1
;
if
(
after
>
0
)
{
memmove
(
&
pQueryInfo
->
pTableMetaInfo
[
index
],
&
pQueryInfo
->
pTableMetaInfo
[
index
+
1
],
after
*
POINTER_BYTES
);
}
pQueryInfo
->
numOfTables
-=
1
;
}
void
clearAllTableMetaInfo
(
SQueryInfo
*
pQueryInfo
,
const
char
*
address
,
bool
removeFromCache
)
{
tscTrace
(
"%p deref the table meta in cache, numOfTables:%d"
,
address
,
pQueryInfo
->
numOfTables
);
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
c455f897
...
...
@@ -365,8 +365,10 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
mnodeUpdateVgroupStatus
(
pVgroup
,
pDnode
,
pVload
);
pAccess
->
vgId
=
htonl
(
pVload
->
vgId
);
pAccess
->
accessState
=
pVgroup
->
accessState
;
pAccess
++
;
mnodeDecVgroupRef
(
pVgroup
);
}
}
if
(
pDnode
->
status
==
TAOS_DN_STATUS_OFFLINE
)
{
...
...
src/util/src/tcompare.c
浏览文件 @
c455f897
...
...
@@ -191,9 +191,7 @@ int WCSPatternMatch(const wchar_t *patterStr, const wchar_t *str, size_t size, c
break
;
}
str
++
;
int32_t
ret
=
WCSPatternMatch
(
&
patterStr
[
i
],
str
,
wcslen
(
str
),
pInfo
);
int32_t
ret
=
WCSPatternMatch
(
&
patterStr
[
i
],
++
str
,
size
-
n
-
1
,
pInfo
);
if
(
ret
!=
TSDB_PATTERN_NOMATCH
)
{
return
ret
;
}
...
...
@@ -243,7 +241,9 @@ static int32_t compareWStrPatternComp(const void* pLeft, const void* pRight) {
SPatternCompareInfo
pInfo
=
{
'%'
,
'_'
};
wchar_t
pattern
[
128
]
=
{
0
};
memcpy
(
pattern
,
varDataVal
(
pRight
),
varDataLen
(
pRight
)
/
TSDB_NCHAR_SIZE
);
assert
(
TSDB_PATTERN_STRING_MAX_LEN
<
128
);
memcpy
(
pattern
,
varDataVal
(
pRight
),
varDataLen
(
pRight
));
assert
(
varDataLen
(
pRight
)
<
128
);
int32_t
ret
=
WCSPatternMatch
(
pattern
,
varDataVal
(
pLeft
),
varDataLen
(
pLeft
)
/
TSDB_NCHAR_SIZE
,
&
pInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录