Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
753acd2d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
753acd2d
编写于
5月 12, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
5月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12379 from taosdata/fix/hzcheng_3.0
Fix: return error code when table not exists
上级
7357c807
eff8656c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
9 deletion
+21
-9
include/common/tmsg.h
include/common/tmsg.h
+2
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+4
-3
source/dnode/vnode/src/tsdb/tsdbMemTable.c
source/dnode/vnode/src/tsdb/tsdbMemTable.c
+11
-0
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+4
-5
未找到文件。
include/common/tmsg.h
浏览文件 @
753acd2d
...
@@ -252,6 +252,7 @@ STSRow* tGetSubmitBlkNext(SSubmitBlkIter* pIter);
...
@@ -252,6 +252,7 @@ STSRow* tGetSubmitBlkNext(SSubmitBlkIter* pIter);
int32_t
tPrintFixedSchemaSubmitReq
(
const
SSubmitReq
*
pReq
,
STSchema
*
pSchema
);
int32_t
tPrintFixedSchemaSubmitReq
(
const
SSubmitReq
*
pReq
,
STSchema
*
pSchema
);
typedef
struct
{
typedef
struct
{
int32_t
code
;
int8_t
hashMeta
;
int8_t
hashMeta
;
int64_t
uid
;
int64_t
uid
;
char
*
tblFName
;
char
*
tblFName
;
...
@@ -271,7 +272,7 @@ typedef struct {
...
@@ -271,7 +272,7 @@ typedef struct {
int32_t
tEncodeSSubmitRsp
(
SEncoder
*
pEncoder
,
const
SSubmitRsp
*
pRsp
);
int32_t
tEncodeSSubmitRsp
(
SEncoder
*
pEncoder
,
const
SSubmitRsp
*
pRsp
);
int32_t
tDecodeSSubmitRsp
(
SDecoder
*
pDecoder
,
SSubmitRsp
*
pRsp
);
int32_t
tDecodeSSubmitRsp
(
SDecoder
*
pDecoder
,
SSubmitRsp
*
pRsp
);
void
tFreeSSubmitRsp
(
SSubmitRsp
*
pRsp
);
void
tFreeSSubmitRsp
(
SSubmitRsp
*
pRsp
);
#define COL_SMA_ON ((int8_t)0x1)
#define COL_SMA_ON ((int8_t)0x1)
#define COL_IDX_ON ((int8_t)0x2)
#define COL_IDX_ON ((int8_t)0x2)
...
...
source/common/src/tmsg.c
浏览文件 @
753acd2d
...
@@ -4032,6 +4032,7 @@ int32_t tDecodeSVSubmitReq(SDecoder *pCoder, SVSubmitReq *pReq) {
...
@@ -4032,6 +4032,7 @@ int32_t tDecodeSVSubmitReq(SDecoder *pCoder, SVSubmitReq *pReq) {
static
int32_t
tEncodeSSubmitBlkRsp
(
SEncoder
*
pEncoder
,
const
SSubmitBlkRsp
*
pBlock
)
{
static
int32_t
tEncodeSSubmitBlkRsp
(
SEncoder
*
pEncoder
,
const
SSubmitBlkRsp
*
pBlock
)
{
if
(
tStartEncode
(
pEncoder
)
<
0
)
return
-
1
;
if
(
tStartEncode
(
pEncoder
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pBlock
->
code
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pBlock
->
hashMeta
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pBlock
->
hashMeta
)
<
0
)
return
-
1
;
if
(
pBlock
->
hashMeta
)
{
if
(
pBlock
->
hashMeta
)
{
if
(
tEncodeI64
(
pEncoder
,
pBlock
->
uid
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pBlock
->
uid
)
<
0
)
return
-
1
;
...
@@ -4047,10 +4048,11 @@ static int32_t tEncodeSSubmitBlkRsp(SEncoder *pEncoder, const SSubmitBlkRsp *pBl
...
@@ -4047,10 +4048,11 @@ static int32_t tEncodeSSubmitBlkRsp(SEncoder *pEncoder, const SSubmitBlkRsp *pBl
static
int32_t
tDecodeSSubmitBlkRsp
(
SDecoder
*
pDecoder
,
SSubmitBlkRsp
*
pBlock
)
{
static
int32_t
tDecodeSSubmitBlkRsp
(
SDecoder
*
pDecoder
,
SSubmitBlkRsp
*
pBlock
)
{
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pBlock
->
code
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pBlock
->
hashMeta
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pBlock
->
hashMeta
)
<
0
)
return
-
1
;
if
(
pBlock
->
hashMeta
)
{
if
(
pBlock
->
hashMeta
)
{
if
(
tDecodeI64
(
pDecoder
,
&
pBlock
->
uid
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pBlock
->
uid
)
<
0
)
return
-
1
;
pBlock
->
tblFName
=
taosMemoryCalloc
(
TSDB_TABLE_FNAME_LEN
,
1
);
pBlock
->
tblFName
=
taosMemoryCalloc
(
TSDB_TABLE_FNAME_LEN
,
1
);
if
(
NULL
==
pBlock
->
tblFName
)
return
-
1
;
if
(
NULL
==
pBlock
->
tblFName
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pBlock
->
tblFName
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pBlock
->
tblFName
)
<
0
)
return
-
1
;
}
}
...
@@ -4089,7 +4091,7 @@ int32_t tDecodeSSubmitRsp(SDecoder *pDecoder, SSubmitRsp *pRsp) {
...
@@ -4089,7 +4091,7 @@ int32_t tDecodeSSubmitRsp(SDecoder *pDecoder, SSubmitRsp *pRsp) {
if
(
tDecodeSSubmitBlkRsp
(
pDecoder
,
pRsp
->
pBlocks
+
iBlock
)
<
0
)
return
-
1
;
if
(
tDecodeSSubmitBlkRsp
(
pDecoder
,
pRsp
->
pBlocks
+
iBlock
)
<
0
)
return
-
1
;
}
}
tEndDecode
(
pDecoder
);
tEndDecode
(
pDecoder
);
tDecoderClear
(
pDecoder
);
tDecoderClear
(
pDecoder
);
return
0
;
return
0
;
}
}
...
@@ -4108,4 +4110,3 @@ void tFreeSSubmitRsp(SSubmitRsp *pRsp) {
...
@@ -4108,4 +4110,3 @@ void tFreeSSubmitRsp(SSubmitRsp *pRsp) {
taosMemoryFree
(
pRsp
);
taosMemoryFree
(
pRsp
);
}
}
source/dnode/vnode/src/tsdb/tsdbMemTable.c
浏览文件 @
753acd2d
...
@@ -310,6 +310,17 @@ int tsdbInsertTableData(STsdb *pTsdb, SSubmitMsgIter *pMsgIter, SSubmitBlk *pBlo
...
@@ -310,6 +310,17 @@ int tsdbInsertTableData(STsdb *pTsdb, SSubmitMsgIter *pMsgIter, SSubmitBlk *pBlo
TSKEY
keyMax
;
TSKEY
keyMax
;
SSubmitBlk
*
pBlkCopy
;
SSubmitBlk
*
pBlkCopy
;
// check if table exists
SMetaReader
mr
=
{
0
};
SMetaEntry
me
=
{
0
};
metaReaderInit
(
&
mr
,
pTsdb
->
pVnode
->
pMeta
,
0
);
if
(
metaGetTableEntryByUid
(
&
mr
,
pMsgIter
->
uid
)
<
0
)
{
metaReaderClear
(
&
mr
);
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
return
-
1
;
}
metaReaderClear
(
&
mr
);
// create container is nedd
// create container is nedd
tptr
=
taosHashGet
(
pMemTable
->
pHashIdx
,
&
(
pMsgIter
->
uid
),
sizeof
(
pMsgIter
->
uid
));
tptr
=
taosHashGet
(
pMemTable
->
pHashIdx
,
&
(
pMsgIter
->
uid
),
sizeof
(
pMsgIter
->
uid
));
if
(
tptr
==
NULL
)
{
if
(
tptr
==
NULL
)
{
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
753acd2d
...
@@ -502,7 +502,7 @@ _exit:
...
@@ -502,7 +502,7 @@ _exit:
return
0
;
return
0
;
}
}
static
int
vnodeDebugPrintSingleSubmitMsg
(
SMeta
*
pMeta
,
SSubmitBlk
*
pBlock
,
SSubmitMsgIter
*
msgIter
,
const
char
*
tags
)
{
static
int
vnodeDebugPrintSingleSubmitMsg
(
SMeta
*
pMeta
,
SSubmitBlk
*
pBlock
,
SSubmitMsgIter
*
msgIter
,
const
char
*
tags
)
{
SSubmitBlkIter
blkIter
=
{
0
};
SSubmitBlkIter
blkIter
=
{
0
};
STSchema
*
pSchema
=
NULL
;
STSchema
*
pSchema
=
NULL
;
tb_uid_t
suid
=
0
;
tb_uid_t
suid
=
0
;
...
@@ -544,7 +544,7 @@ static int vnodeDebugPrintSubmitMsg(SVnode *pVnode, SSubmitReq *pMsg, const char
...
@@ -544,7 +544,7 @@ static int vnodeDebugPrintSubmitMsg(SVnode *pVnode, SSubmitReq *pMsg, const char
while
(
true
)
{
while
(
true
)
{
if
(
tGetSubmitMsgNext
(
&
msgIter
,
&
pBlock
)
<
0
)
return
-
1
;
if
(
tGetSubmitMsgNext
(
&
msgIter
,
&
pBlock
)
<
0
)
return
-
1
;
if
(
pBlock
==
NULL
)
break
;
if
(
pBlock
==
NULL
)
break
;
vnodeDebugPrintSingleSubmitMsg
(
pMeta
,
pBlock
,
&
msgIter
,
tags
);
vnodeDebugPrintSingleSubmitMsg
(
pMeta
,
pBlock
,
&
msgIter
,
tags
);
}
}
...
@@ -595,7 +595,7 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in
...
@@ -595,7 +595,7 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in
if
(
metaCreateTable
(
pVnode
->
pMeta
,
version
,
&
createTbReq
)
<
0
)
{
if
(
metaCreateTable
(
pVnode
->
pMeta
,
version
,
&
createTbReq
)
<
0
)
{
if
(
terrno
!=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
)
{
if
(
terrno
!=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
)
{
pRsp
->
code
=
terrno
;
submitBlkRsp
.
code
=
terrno
;
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
goto
_exit
;
goto
_exit
;
}
}
...
@@ -617,8 +617,7 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in
...
@@ -617,8 +617,7 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in
}
}
if
(
tsdbInsertTableData
(
pVnode
->
pTsdb
,
&
msgIter
,
pBlock
,
&
submitBlkRsp
)
<
0
)
{
if
(
tsdbInsertTableData
(
pVnode
->
pTsdb
,
&
msgIter
,
pBlock
,
&
submitBlkRsp
)
<
0
)
{
pRsp
->
code
=
terrno
;
submitBlkRsp
.
code
=
terrno
;
goto
_exit
;
}
}
submitRsp
.
numOfRows
+=
submitBlkRsp
.
numOfRows
;
submitRsp
.
numOfRows
+=
submitBlkRsp
.
numOfRows
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录