Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
27c05997
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
27c05997
编写于
4月 12, 2022
作者:
dengyihao
提交者:
GitHub
4月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11431 from taosdata/feature/filter_tag
fix compile error
上级
0d5151cd
b3c03c14
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
31 deletion
+37
-31
include/common/tmsg.h
include/common/tmsg.h
+4
-0
source/dnode/vnode/src/meta/metaTDBImpl.c
source/dnode/vnode/src/meta/metaTDBImpl.c
+33
-31
未找到文件。
include/common/tmsg.h
浏览文件 @
27c05997
...
@@ -2016,6 +2016,7 @@ typedef struct {
...
@@ -2016,6 +2016,7 @@ typedef struct {
static
FORCE_INLINE
int32_t
taosEncodeSSchema
(
void
**
buf
,
const
SSchema
*
pSchema
)
{
static
FORCE_INLINE
int32_t
taosEncodeSSchema
(
void
**
buf
,
const
SSchema
*
pSchema
)
{
int32_t
tlen
=
0
;
int32_t
tlen
=
0
;
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
type
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
type
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
index
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pSchema
->
bytes
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pSchema
->
bytes
);
tlen
+=
taosEncodeFixedI16
(
buf
,
pSchema
->
colId
);
tlen
+=
taosEncodeFixedI16
(
buf
,
pSchema
->
colId
);
tlen
+=
taosEncodeString
(
buf
,
pSchema
->
name
);
tlen
+=
taosEncodeString
(
buf
,
pSchema
->
name
);
...
@@ -2024,6 +2025,7 @@ static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema
...
@@ -2024,6 +2025,7 @@ static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema
static
FORCE_INLINE
void
*
taosDecodeSSchema
(
void
*
buf
,
SSchema
*
pSchema
)
{
static
FORCE_INLINE
void
*
taosDecodeSSchema
(
void
*
buf
,
SSchema
*
pSchema
)
{
buf
=
taosDecodeFixedI8
(
buf
,
&
pSchema
->
type
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pSchema
->
type
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pSchema
->
index
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pSchema
->
bytes
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pSchema
->
bytes
);
buf
=
taosDecodeFixedI16
(
buf
,
&
pSchema
->
colId
);
buf
=
taosDecodeFixedI16
(
buf
,
&
pSchema
->
colId
);
buf
=
taosDecodeStringTo
(
buf
,
pSchema
->
name
);
buf
=
taosDecodeStringTo
(
buf
,
pSchema
->
name
);
...
@@ -2032,6 +2034,7 @@ static FORCE_INLINE void* taosDecodeSSchema(void* buf, SSchema* pSchema) {
...
@@ -2032,6 +2034,7 @@ static FORCE_INLINE void* taosDecodeSSchema(void* buf, SSchema* pSchema) {
static
FORCE_INLINE
int32_t
tEncodeSSchema
(
SCoder
*
pEncoder
,
const
SSchema
*
pSchema
)
{
static
FORCE_INLINE
int32_t
tEncodeSSchema
(
SCoder
*
pEncoder
,
const
SSchema
*
pSchema
)
{
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pSchema
->
index
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tEncodeI16
(
pEncoder
,
pSchema
->
colId
)
<
0
)
return
-
1
;
if
(
tEncodeI16
(
pEncoder
,
pSchema
->
colId
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
pSchema
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
pSchema
->
name
)
<
0
)
return
-
1
;
...
@@ -2040,6 +2043,7 @@ static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSch
...
@@ -2040,6 +2043,7 @@ static FORCE_INLINE int32_t tEncodeSSchema(SCoder* pEncoder, const SSchema* pSch
static
FORCE_INLINE
int32_t
tDecodeSSchema
(
SCoder
*
pDecoder
,
SSchema
*
pSchema
)
{
static
FORCE_INLINE
int32_t
tDecodeSSchema
(
SCoder
*
pDecoder
,
SSchema
*
pSchema
)
{
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
type
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pSchema
->
index
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pSchema
->
bytes
)
<
0
)
return
-
1
;
if
(
tDecodeI16
(
pDecoder
,
&
pSchema
->
colId
)
<
0
)
return
-
1
;
if
(
tDecodeI16
(
pDecoder
,
&
pSchema
->
colId
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pSchema
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pSchema
->
name
)
<
0
)
return
-
1
;
...
...
source/dnode/vnode/src/meta/metaTDBImpl.c
浏览文件 @
27c05997
...
@@ -25,18 +25,18 @@ typedef struct SPoolMem {
...
@@ -25,18 +25,18 @@ typedef struct SPoolMem {
static
SPoolMem
*
openPool
();
static
SPoolMem
*
openPool
();
static
void
clearPool
(
SPoolMem
*
pPool
);
static
void
clearPool
(
SPoolMem
*
pPool
);
static
void
closePool
(
SPoolMem
*
pPool
);
static
void
closePool
(
SPoolMem
*
pPool
);
static
void
*
poolMalloc
(
void
*
arg
,
size_t
size
);
static
void
*
poolMalloc
(
void
*
arg
,
size_t
size
);
static
void
poolFree
(
void
*
arg
,
void
*
ptr
);
static
void
poolFree
(
void
*
arg
,
void
*
ptr
);
struct
SMetaDB
{
struct
SMetaDB
{
TXN
txn
;
TXN
txn
;
TENV
*
pEnv
;
TENV
*
pEnv
;
TDB
*
pTbDB
;
TDB
*
pTbDB
;
TDB
*
pSchemaDB
;
TDB
*
pSchemaDB
;
TDB
*
pNameIdx
;
TDB
*
pNameIdx
;
TDB
*
pStbIdx
;
TDB
*
pStbIdx
;
TDB
*
pNtbIdx
;
TDB
*
pNtbIdx
;
TDB
*
pCtbIdx
;
TDB
*
pCtbIdx
;
SPoolMem
*
pPool
;
SPoolMem
*
pPool
;
};
};
...
@@ -46,7 +46,7 @@ typedef struct __attribute__((__packed__)) {
...
@@ -46,7 +46,7 @@ typedef struct __attribute__((__packed__)) {
}
SSchemaDbKey
;
}
SSchemaDbKey
;
typedef
struct
{
typedef
struct
{
char
*
name
;
char
*
name
;
tb_uid_t
uid
;
tb_uid_t
uid
;
}
SNameIdxKey
;
}
SNameIdxKey
;
...
@@ -205,14 +205,14 @@ void metaCloseDB(SMeta *pMeta) {
...
@@ -205,14 +205,14 @@ void metaCloseDB(SMeta *pMeta) {
int
metaSaveTableToDB
(
SMeta
*
pMeta
,
STbCfg
*
pTbCfg
)
{
int
metaSaveTableToDB
(
SMeta
*
pMeta
,
STbCfg
*
pTbCfg
)
{
tb_uid_t
uid
;
tb_uid_t
uid
;
SMetaDB
*
pMetaDb
;
SMetaDB
*
pMetaDb
;
void
*
pKey
;
void
*
pKey
;
void
*
pVal
;
void
*
pVal
;
int
kLen
;
int
kLen
;
int
vLen
;
int
vLen
;
int
ret
;
int
ret
;
char
buf
[
512
];
char
buf
[
512
];
void
*
pBuf
;
void
*
pBuf
;
SCtbIdxKey
ctbIdxKey
;
SCtbIdxKey
ctbIdxKey
;
SSchemaDbKey
schemaDbKey
;
SSchemaDbKey
schemaDbKey
;
SSchemaWrapper
schemaWrapper
;
SSchemaWrapper
schemaWrapper
;
...
@@ -329,11 +329,11 @@ int metaRemoveTableFromDb(SMeta *pMeta, tb_uid_t uid) {
...
@@ -329,11 +329,11 @@ int metaRemoveTableFromDb(SMeta *pMeta, tb_uid_t uid) {
STbCfg
*
metaGetTbInfoByUid
(
SMeta
*
pMeta
,
tb_uid_t
uid
)
{
STbCfg
*
metaGetTbInfoByUid
(
SMeta
*
pMeta
,
tb_uid_t
uid
)
{
int
ret
;
int
ret
;
SMetaDB
*
pMetaDb
=
pMeta
->
pDB
;
SMetaDB
*
pMetaDb
=
pMeta
->
pDB
;
void
*
pKey
;
void
*
pKey
;
void
*
pVal
;
void
*
pVal
;
int
kLen
;
int
kLen
;
int
vLen
;
int
vLen
;
STbCfg
*
pTbCfg
;
STbCfg
*
pTbCfg
;
// Fetch
// Fetch
pKey
=
&
uid
;
pKey
=
&
uid
;
...
@@ -385,14 +385,14 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
...
@@ -385,14 +385,14 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
}
}
static
SSchemaWrapper
*
metaGetTableSchemaImpl
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
bool
isinline
,
bool
isGetEx
)
{
static
SSchemaWrapper
*
metaGetTableSchemaImpl
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
bool
isinline
,
bool
isGetEx
)
{
void
*
pKey
;
void
*
pKey
;
void
*
pVal
;
void
*
pVal
;
int
kLen
;
int
kLen
;
int
vLen
;
int
vLen
;
int
ret
;
int
ret
;
SSchemaDbKey
schemaDbKey
;
SSchemaDbKey
schemaDbKey
;
SSchemaWrapper
*
pSchemaWrapper
;
SSchemaWrapper
*
pSchemaWrapper
;
void
*
pBuf
;
void
*
pBuf
;
// fetch
// fetch
schemaDbKey
.
uid
=
uid
;
schemaDbKey
.
uid
=
uid
;
...
@@ -419,9 +419,9 @@ STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {
...
@@ -419,9 +419,9 @@ STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {
tb_uid_t
quid
;
tb_uid_t
quid
;
SSchemaWrapper
*
pSW
;
SSchemaWrapper
*
pSW
;
STSchemaBuilder
sb
;
STSchemaBuilder
sb
;
SSchemaEx
*
pSchema
;
SSchemaEx
*
pSchema
;
STSchema
*
pTSchema
;
STSchema
*
pTSchema
;
STbCfg
*
pTbCfg
;
STbCfg
*
pTbCfg
;
pTbCfg
=
metaGetTbInfoByUid
(
pMeta
,
uid
);
pTbCfg
=
metaGetTbInfoByUid
(
pMeta
,
uid
);
if
(
pTbCfg
->
type
==
META_CHILD_TABLE
)
{
if
(
pTbCfg
->
type
==
META_CHILD_TABLE
)
{
...
@@ -452,7 +452,7 @@ struct SMTbCursor {
...
@@ -452,7 +452,7 @@ struct SMTbCursor {
SMTbCursor
*
metaOpenTbCursor
(
SMeta
*
pMeta
)
{
SMTbCursor
*
metaOpenTbCursor
(
SMeta
*
pMeta
)
{
SMTbCursor
*
pTbCur
=
NULL
;
SMTbCursor
*
pTbCur
=
NULL
;
SMetaDB
*
pDB
=
pMeta
->
pDB
;
SMetaDB
*
pDB
=
pMeta
->
pDB
;
pTbCur
=
(
SMTbCursor
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
pTbCur
));
pTbCur
=
(
SMTbCursor
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
pTbCur
));
if
(
pTbCur
==
NULL
)
{
if
(
pTbCur
==
NULL
)
{
...
@@ -474,12 +474,12 @@ void metaCloseTbCursor(SMTbCursor *pTbCur) {
...
@@ -474,12 +474,12 @@ void metaCloseTbCursor(SMTbCursor *pTbCur) {
}
}
char
*
metaTbCursorNext
(
SMTbCursor
*
pTbCur
)
{
char
*
metaTbCursorNext
(
SMTbCursor
*
pTbCur
)
{
void
*
pKey
=
NULL
;
void
*
pKey
=
NULL
;
void
*
pVal
=
NULL
;
void
*
pVal
=
NULL
;
int
kLen
;
int
kLen
;
int
vLen
;
int
vLen
;
int
ret
;
int
ret
;
void
*
pBuf
;
void
*
pBuf
;
STbCfg
tbCfg
;
STbCfg
tbCfg
;
for
(;;)
{
for
(;;)
{
...
@@ -503,17 +503,17 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
...
@@ -503,17 +503,17 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
}
}
struct
SMCtbCursor
{
struct
SMCtbCursor
{
TDBC
*
pCur
;
TDBC
*
pCur
;
tb_uid_t
suid
;
tb_uid_t
suid
;
void
*
pKey
;
void
*
pKey
;
void
*
pVal
;
void
*
pVal
;
int
kLen
;
int
kLen
;
int
vLen
;
int
vLen
;
};
};
SMCtbCursor
*
metaOpenCtbCursor
(
SMeta
*
pMeta
,
tb_uid_t
uid
)
{
SMCtbCursor
*
metaOpenCtbCursor
(
SMeta
*
pMeta
,
tb_uid_t
uid
)
{
SMCtbCursor
*
pCtbCur
=
NULL
;
SMCtbCursor
*
pCtbCur
=
NULL
;
SMetaDB
*
pDB
=
pMeta
->
pDB
;
SMetaDB
*
pDB
=
pMeta
->
pDB
;
int
ret
;
int
ret
;
pCtbCur
=
(
SMCtbCursor
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
pCtbCur
));
pCtbCur
=
(
SMCtbCursor
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
pCtbCur
));
...
@@ -621,6 +621,7 @@ static int metaEncodeSchema(void **buf, SSchemaWrapper *pSW) {
...
@@ -621,6 +621,7 @@ static int metaEncodeSchema(void **buf, SSchemaWrapper *pSW) {
for
(
int
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
pSchema
=
pSW
->
pSchema
+
i
;
pSchema
=
pSW
->
pSchema
+
i
;
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
type
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
type
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pSchema
->
index
);
tlen
+=
taosEncodeFixedI16
(
buf
,
pSchema
->
colId
);
tlen
+=
taosEncodeFixedI16
(
buf
,
pSchema
->
colId
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pSchema
->
bytes
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pSchema
->
bytes
);
tlen
+=
taosEncodeString
(
buf
,
pSchema
->
name
);
tlen
+=
taosEncodeString
(
buf
,
pSchema
->
name
);
...
@@ -637,6 +638,7 @@ static void *metaDecodeSchema(void *buf, SSchemaWrapper *pSW) {
...
@@ -637,6 +638,7 @@ static void *metaDecodeSchema(void *buf, SSchemaWrapper *pSW) {
for
(
int
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pSW
->
nCols
;
i
++
)
{
pSchema
=
pSW
->
pSchema
+
i
;
pSchema
=
pSW
->
pSchema
+
i
;
buf
=
taosDecodeFixedI8
(
buf
,
&
pSchema
->
type
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pSchema
->
type
);
buf
=
taosSkipFixedLen
(
buf
,
sizeof
(
int8_t
));
buf
=
taosDecodeFixedI16
(
buf
,
&
pSchema
->
colId
);
buf
=
taosDecodeFixedI16
(
buf
,
&
pSchema
->
colId
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pSchema
->
bytes
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pSchema
->
bytes
);
buf
=
taosDecodeStringTo
(
buf
,
pSchema
->
name
);
buf
=
taosDecodeStringTo
(
buf
,
pSchema
->
name
);
...
@@ -781,7 +783,7 @@ static void closePool(SPoolMem *pPool) {
...
@@ -781,7 +783,7 @@ static void closePool(SPoolMem *pPool) {
}
}
static
void
*
poolMalloc
(
void
*
arg
,
size_t
size
)
{
static
void
*
poolMalloc
(
void
*
arg
,
size_t
size
)
{
void
*
ptr
=
NULL
;
void
*
ptr
=
NULL
;
SPoolMem
*
pPool
=
(
SPoolMem
*
)
arg
;
SPoolMem
*
pPool
=
(
SPoolMem
*
)
arg
;
SPoolMem
*
pMem
;
SPoolMem
*
pMem
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录