Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
12e3633f
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
12e3633f
编写于
10月 30, 2020
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1611
上级
21d754c4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
15 deletion
+13
-15
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+13
-15
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
12e3633f
...
...
@@ -3727,9 +3727,6 @@ int32_t handleExprInDelCond(SSqlCmd* pCmd, SQueryInfo *pQueryInfo, tSQLExpr* pEx
}
int32_t
getDelCond
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
tSQLExpr
*
pExpr
,
int64_t
**
tsBuf
,
int32_t
*
sz
)
{
if
(
pExpr
==
NULL
)
{
return
TSDB_CODE_SUCCESS
;
}
const
char
*
msg1
=
"invalid time stamp"
;
const
char
*
msg2
=
"illegal column name"
;
...
...
@@ -3758,10 +3755,10 @@ int32_t getDelCond(SSqlCmd* pCmd, SQueryInfo *pQueryInfo, tSQLExpr* pExpr, int64
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
nParam
=
pRight
->
pParam
->
nExpr
;
*
tsBuf
=
malloc
(
sizeof
(
int64_t
)
*
nParam
);
if
(
*
tsBuf
==
NULL
)
{
if
((
*
tsBuf
=
malloc
(
sizeof
(
int64_t
)
*
nParam
))
==
NULL
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
{
int64_t
ts
;
if
(
getTimeFromExpr
(
pRight
->
pParam
->
a
[
i
].
pNode
,
timePrecision
,
&
ts
)
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -3774,10 +3771,10 @@ int32_t getDelCond(SSqlCmd* pCmd, SQueryInfo *pQueryInfo, tSQLExpr* pExpr, int64
*
sz
=
nParam
;
}
else
if
(
pExpr
->
nSQLOptr
==
TK_EQ
)
{
nParam
=
1
;
*
tsBuf
=
malloc
(
sizeof
(
int64_t
)
*
nParam
);
if
(
*
tsBuf
==
NULL
)
{
if
((
*
tsBuf
=
malloc
(
sizeof
(
int64_t
)
*
nParam
))
==
NULL
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
int64_t
ts
;
if
(
getTimeFromExpr
(
pRight
,
timePrecision
,
&
ts
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
...
...
@@ -4662,9 +4659,8 @@ int32_t parseOrderbyClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQu
int32_t
setDelInfo
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
)
{
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg2
=
"invalid delete sql"
;
const
char
*
msg3
=
"data deletion is not supported on super table"
;
const
char
*
msg4
=
"Only data deletion by timestamp is supported "
;
const
char
*
msg2
=
"data deletion is not supported on super table"
;
const
char
*
msg3
=
"Only data deletion by timestamp is supported "
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -4699,21 +4695,23 @@ int32_t setDelInfo(SSqlObj *pSql, struct SSqlInfo* pInfo) {
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
3
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
2
);
}
int64_t
*
tsBuf
=
NULL
;
int32_t
sz
=
0
;
if
(
pDelSql
->
pWhere
!=
NULL
)
{
if
(
getDelCond
(
pCmd
,
pQueryInfo
,
pDelSql
->
pWhere
,
&
tsBuf
,
&
sz
)
!=
TSDB_CODE_SUCCESS
)
{
code
=
getDelCond
(
pCmd
,
pQueryInfo
,
pDelSql
->
pWhere
,
&
tsBuf
,
&
sz
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
free
(
tsBuf
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
)
;
}
return
code
;
}
}
else
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
4
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
3
);
}
if
((
code
=
tscAllocPayload
(
pCmd
,
sizeof
(
SDeleteMsg
)
+
sz
*
sizeof
(
tsBuf
[
0
])
+
64
))
!=
TSDB_CODE_SUCCESS
)
{
free
(
tsBuf
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录