Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9a5c327b
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9a5c327b
编写于
12月 22, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:modify delete msg type to tmq meta
上级
dffe02e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
45 addition
and
0 deletion
+45
-0
source/client/src/clientRawBlockWrite.c
source/client/src/clientRawBlockWrite.c
+44
-0
utils/test/c/tmq_taosx_ci.c
utils/test/c/tmq_taosx_ci.c
+1
-0
未找到文件。
source/client/src/clientRawBlockWrite.c
浏览文件 @
9a5c327b
...
@@ -553,6 +553,45 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
...
@@ -553,6 +553,45 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
return
string
;
return
string
;
}
}
static
char
*
processDeleteTable
(
SMqMetaRsp
*
metaRsp
){
SDeleteRes
req
=
{
0
};
SDecoder
coder
=
{
0
};
int32_t
code
=
TSDB_CODE_SUCCESS
;
cJSON
*
json
=
NULL
;
char
*
string
=
NULL
;
// decode and process req
void
*
data
=
POINTER_SHIFT
(
metaRsp
->
metaRsp
,
sizeof
(
SMsgHead
));
int32_t
len
=
metaRsp
->
metaRspLen
-
sizeof
(
SMsgHead
);
tDecoderInit
(
&
coder
,
data
,
len
);
if
(
tDecodeDeleteRes
(
&
coder
,
&
req
)
<
0
)
{
code
=
TSDB_CODE_INVALID_PARA
;
goto
_exit
;
}
// getTbName(req.tableFName);
char
sql
[
256
]
=
{
0
};
snprintf
(
sql
,
sizeof
(
sql
),
"delete from `%s` where `%s` >= %"
PRId64
" and `%s` <= %"
PRId64
,
req
.
tableFName
,
req
.
tsColName
,
req
.
skey
,
req
.
tsColName
,
req
.
ekey
);
uDebug
(
"delete sql:%s
\n
"
,
sql
);
json
=
cJSON_CreateObject
();
if
(
json
==
NULL
)
{
goto
_exit
;
}
cJSON
*
type
=
cJSON_CreateString
(
"delete"
);
cJSON_AddItemToObject
(
json
,
"type"
,
type
);
cJSON
*
sqlJson
=
cJSON_CreateString
(
sql
);
cJSON_AddItemToObject
(
json
,
"sql"
,
sqlJson
);
string
=
cJSON_PrintUnformatted
(
json
);
_exit:
cJSON_Delete
(
json
);
tDecoderClear
(
&
coder
);
return
string
;
}
static
char
*
processDropTable
(
SMqMetaRsp
*
metaRsp
)
{
static
char
*
processDropTable
(
SMqMetaRsp
*
metaRsp
)
{
SDecoder
decoder
=
{
0
};
SDecoder
decoder
=
{
0
};
...
@@ -2202,7 +2241,12 @@ char* tmq_get_json_meta(TAOS_RES* res) {
...
@@ -2202,7 +2241,12 @@ char* tmq_get_json_meta(TAOS_RES* res) {
return
processAlterTable
(
&
pMetaRspObj
->
metaRsp
);
return
processAlterTable
(
&
pMetaRspObj
->
metaRsp
);
}
else
if
(
pMetaRspObj
->
metaRsp
.
resMsgType
==
TDMT_VND_DROP_TABLE
)
{
}
else
if
(
pMetaRspObj
->
metaRsp
.
resMsgType
==
TDMT_VND_DROP_TABLE
)
{
return
processDropTable
(
&
pMetaRspObj
->
metaRsp
);
return
processDropTable
(
&
pMetaRspObj
->
metaRsp
);
}
else
if
(
pMetaRspObj
->
metaRsp
.
resMsgType
==
TDMT_VND_DROP_TABLE
)
{
return
processDropTable
(
&
pMetaRspObj
->
metaRsp
);
}
else
if
(
pMetaRspObj
->
metaRsp
.
resMsgType
==
TDMT_VND_DELETE
)
{
return
processDeleteTable
(
&
pMetaRspObj
->
metaRsp
);
}
}
return
NULL
;
return
NULL
;
}
}
...
...
utils/test/c/tmq_taosx_ci.c
浏览文件 @
9a5c327b
...
@@ -661,6 +661,7 @@ void initLogFile() {
...
@@ -661,6 +661,7 @@ void initLogFile() {
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
super
\"
,
\"
tableName
\"
:
\"
st1
\"
,
\"
alterType
\"
:7,
\"
colName
\"
:
\"
c3
\"
,
\"
colType
\"
:8,
\"
colLength
\"
:64}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
super
\"
,
\"
tableName
\"
:
\"
st1
\"
,
\"
alterType
\"
:7,
\"
colName
\"
:
\"
c3
\"
,
\"
colType
\"
:8,
\"
colLength
\"
:64}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
super
\"
,
\"
tableName
\"
:
\"
st1
\"
,
\"
alterType
\"
:1,
\"
colName
\"
:
\"
t2
\"
,
\"
colType
\"
:8,
\"
colLength
\"
:64}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
super
\"
,
\"
tableName
\"
:
\"
st1
\"
,
\"
alterType
\"
:1,
\"
colName
\"
:
\"
t2
\"
,
\"
colType
\"
:8,
\"
colLength
\"
:64}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
child
\"
,
\"
tableName
\"
:
\"
ct3
\"
,
\"
alterType
\"
:4,
\"
colName
\"
:
\"
t1
\"
,
\"
colValue
\"
:
\"
5000
\"
,
\"
colValueNull
\"
:false}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
child
\"
,
\"
tableName
\"
:
\"
ct3
\"
,
\"
alterType
\"
:4,
\"
colName
\"
:
\"
t1
\"
,
\"
colValue
\"
:
\"
5000
\"
,
\"
colValueNull
\"
:false}"
,
"{
\"
type
\"
:
\"
delete
\"
,
\"
sql
\"
:
\"
delete from `ct3` where `ts` >= 1626006833600 and `ts` <= 1626006833605
\"
}"
,
"{
\"
type
\"
:
\"
create
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
columns
\"
:[{
\"
name
\"
:
\"
ts
\"
,
\"
type
\"
:9},{
\"
name
\"
:
\"
c1
\"
,
\"
type
\"
:4},{
\"
name
\"
:
\"
c2
\"
,
\"
type
\"
:10,
\"
length
\"
:4}],
\"
tags
\"
:[]}"
,
"{
\"
type
\"
:
\"
create
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
columns
\"
:[{
\"
name
\"
:
\"
ts
\"
,
\"
type
\"
:9},{
\"
name
\"
:
\"
c1
\"
,
\"
type
\"
:4},{
\"
name
\"
:
\"
c2
\"
,
\"
type
\"
:10,
\"
length
\"
:4}],
\"
tags
\"
:[]}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
alterType
\"
:5,
\"
colName
\"
:
\"
c3
\"
,
\"
colType
\"
:5}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
alterType
\"
:5,
\"
colName
\"
:
\"
c3
\"
,
\"
colType
\"
:5}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
alterType
\"
:7,
\"
colName
\"
:
\"
c2
\"
,
\"
colType
\"
:10,
\"
colLength
\"
:8}"
,
"{
\"
type
\"
:
\"
alter
\"
,
\"
tableType
\"
:
\"
normal
\"
,
\"
tableName
\"
:
\"
n1
\"
,
\"
alterType
\"
:7,
\"
colName
\"
:
\"
c2
\"
,
\"
colType
\"
:10,
\"
colLength
\"
:8}"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录