Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
14ab4c75
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
14ab4c75
编写于
12月 07, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
correct static warning
上级
b6e668a0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
9 deletion
+12
-9
src/client/src/tscAst.c
src/client/src/tscAst.c
+12
-9
未找到文件。
src/client/src/tscAst.c
浏览文件 @
14ab4c75
...
@@ -108,12 +108,12 @@ static tSQLSyntaxNode *tSQLSyntaxNodeCreate(SSchema *pSchema, int32_t numOfCols,
...
@@ -108,12 +108,12 @@ static tSQLSyntaxNode *tSQLSyntaxNodeCreate(SSchema *pSchema, int32_t numOfCols,
return
NULL
;
return
NULL
;
}
}
int32_t
i
=
0
;
size_t
nodeSize
=
sizeof
(
tSQLSyntaxNode
);
size_t
nodeSize
=
sizeof
(
tSQLSyntaxNode
);
tSQLSyntaxNode
*
pNode
=
NULL
;
tSQLSyntaxNode
*
pNode
=
NULL
;
if
(
pToken
->
type
==
TK_ID
||
pToken
->
type
==
TK_TBNAME
)
{
if
(
pToken
->
type
==
TK_ID
||
pToken
->
type
==
TK_TBNAME
)
{
if
(
pToken
->
type
==
TK_ID
)
{
if
(
pToken
->
type
==
TK_ID
)
{
int32_t
i
=
0
;
do
{
do
{
size_t
len
=
strlen
(
pSchema
[
i
].
name
);
size_t
len
=
strlen
(
pSchema
[
i
].
name
);
if
(
strncmp
(
pToken
->
z
,
pSchema
[
i
].
name
,
pToken
->
n
)
==
0
&&
pToken
->
n
==
len
)
break
;
if
(
strncmp
(
pToken
->
z
,
pSchema
[
i
].
name
,
pToken
->
n
)
==
0
&&
pToken
->
n
==
len
)
break
;
...
@@ -268,8 +268,8 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
...
@@ -268,8 +268,8 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
}
}
// get the operator of expr
// get the operator of expr
uint8_t
optr
=
getBinaryExprOptr
(
&
t0
);
uint8_t
optr
=
getBinaryExprOptr
(
&
t0
);
if
(
optr
<
=
0
)
{
if
(
optr
=
=
0
)
{
pError
(
"not support binary operator:%d"
,
t0
.
type
);
pError
(
"not support binary operator:%d"
,
t0
.
type
);
tSQLSyntaxNodeDestroy
(
pLeft
,
NULL
);
tSQLSyntaxNodeDestroy
(
pLeft
,
NULL
);
return
NULL
;
return
NULL
;
...
@@ -323,10 +323,11 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
...
@@ -323,10 +323,11 @@ static tSQLSyntaxNode *createSyntaxTree(SSchema *pSchema, int32_t numOfCols, cha
pn
->
colId
=
-
1
;
pn
->
colId
=
-
1
;
return
pn
;
return
pn
;
}
else
{
}
else
{
uint8_t
localOptr
=
getBinaryExprOptr
(
&
t0
);
uint8_t
localOptr
=
getBinaryExprOptr
(
&
t0
);
if
(
localOptr
<
=
0
)
{
if
(
localOptr
=
=
0
)
{
pError
(
"not support binary operator:%d"
,
t0
.
type
);
pError
(
"not support binary operator:%d"
,
t0
.
type
);
return
NULL
;
return
NULL
;
free
(
pBinExpr
)
}
}
return
parseRemainStr
(
str
,
pBinExpr
,
pSchema
,
localOptr
,
numOfCols
,
i
);
return
parseRemainStr
(
str
,
pBinExpr
,
pSchema
,
localOptr
,
numOfCols
,
i
);
...
@@ -418,16 +419,17 @@ void tSQLBinaryExprToString(tSQLBinaryExpr *pExpr, char *dst, int32_t *len) {
...
@@ -418,16 +419,17 @@ void tSQLBinaryExprToString(tSQLBinaryExpr *pExpr, char *dst, int32_t *len) {
if
(
pExpr
==
NULL
)
{
if
(
pExpr
==
NULL
)
{
*
dst
=
0
;
*
dst
=
0
;
*
len
=
0
;
*
len
=
0
;
return
;
}
}
int32_t
lhs
=
tSQLBinaryExprToStringImpl
(
pExpr
->
pLeft
,
dst
,
pExpr
->
pLeft
->
nodeType
);
int32_t
lhs
=
tSQLBinaryExprToStringImpl
(
pExpr
->
pLeft
,
dst
,
pExpr
->
pLeft
->
nodeType
);
dst
+=
lhs
;
dst
+=
lhs
;
*
len
=
lhs
;
*
len
=
lhs
;
char
*
start
=
tSQLOptrToString
(
pExpr
->
nSQLBinaryOptr
,
dst
);
char
*
start
=
tSQLOptrToString
(
pExpr
->
nSQLBinaryOptr
,
dst
);
*
len
+=
(
start
-
dst
);
*
len
+=
(
start
-
dst
);
*
len
+=
tSQLBinaryExprToStringImpl
(
pExpr
->
pRight
,
start
,
pExpr
->
pRight
->
nodeType
);
*
len
+=
tSQLBinaryExprToStringImpl
(
pExpr
->
pRight
,
start
,
pExpr
->
pRight
->
nodeType
);
}
}
static
void
UNUSED_FUNC
destroySyntaxTree
(
tSQLSyntaxNode
*
pNode
)
{
tSQLSyntaxNodeDestroy
(
pNode
,
NULL
);
}
static
void
UNUSED_FUNC
destroySyntaxTree
(
tSQLSyntaxNode
*
pNode
)
{
tSQLSyntaxNodeDestroy
(
pNode
,
NULL
);
}
...
@@ -650,7 +652,8 @@ void tSQLListTraverseOnResult(struct tSQLBinaryExpr *pExpr, bool (*fp)(tSkipList
...
@@ -650,7 +652,8 @@ void tSQLListTraverseOnResult(struct tSQLBinaryExpr *pExpr, bool (*fp)(tSkipList
// brutal force search
// brutal force search
int64_t
num
=
pResult
->
num
;
int64_t
num
=
pResult
->
num
;
for
(
int32_t
i
=
0
,
j
=
0
;
i
<
pResult
->
num
;
++
i
)
{
for
(
int32_t
i
=
0
,
j
=
0
;
i
<
pResult
->
num
;
++
i
)
{
if
(
fp
==
NULL
||
(
fp
!=
NULL
&&
fp
(
pResult
->
pRes
[
i
],
pExpr
->
info
)
==
true
))
{
//if (fp == NULL || (fp != NULL && fp(pResult->pRes[i], pExpr->info) == true)) {
if
(
fp
==
NULL
||
(
fp
(
pResult
->
pRes
[
i
],
pExpr
->
info
)
==
true
))
{
pResult
->
pRes
[
j
++
]
=
pResult
->
pRes
[
i
];
pResult
->
pRes
[
j
++
]
=
pResult
->
pRes
[
i
];
}
else
{
}
else
{
num
--
;
num
--
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录