Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
973a942d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
973a942d
编写于
11月 01, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: support get meta only from cache
上级
5202ccfb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
71 addition
and
12 deletion
+71
-12
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+3
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+27
-3
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+5
-0
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+20
-0
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+1
-0
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+11
-9
source/libs/scalar/src/scalar.c
source/libs/scalar/src/scalar.c
+4
-0
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
973a942d
...
...
@@ -309,6 +309,9 @@ int32_t catalogGetUdfInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* f
int32_t
catalogChkAuth
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
pass
);
int32_t
catalogChkAuthFromCache
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
pass
,
bool
*
exists
);
int32_t
catalogUpdateUserAuthInfo
(
SCatalog
*
pCtg
,
SGetUserAuthRsp
*
pAuth
);
int32_t
catalogUpdateVgEpSet
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
int32_t
vgId
,
SEpSet
*
epSet
);
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
973a942d
...
...
@@ -320,7 +320,7 @@ _return:
}
int32_t
ctgChkAuth
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
pass
)
{
bool
*
pass
,
bool
*
exists
)
{
bool
inCache
=
false
;
int32_t
code
=
0
;
...
...
@@ -329,6 +329,13 @@ int32_t ctgChkAuth(SCatalog* pCtg, SRequestConnInfo* pConn, const char* user, co
CTG_ERR_RET
(
ctgChkAuthFromCache
(
pCtg
,
(
char
*
)
user
,
(
char
*
)
dbFName
,
type
,
&
inCache
,
pass
));
if
(
inCache
)
{
if
(
exists
)
{
*
exists
=
true
;
}
return
TSDB_CODE_SUCCESS
;
}
else
if
(
exists
)
{
*
exists
=
false
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1032,7 +1039,7 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, SRequestConnInfo* pConn, SArray*
switch
(
tbType
)
{
case
TSDB_CHILD_TABLE
:
{
SName
stb
=
name
;
strcpy
(
stb
.
tname
,
stbName
);
tstrncpy
(
stb
.
tname
,
stbName
,
sizeof
(
stb
.
tname
)
);
ctgRemoveTbMeta
(
pCtg
,
&
stb
);
break
;
}
...
...
@@ -1373,13 +1380,30 @@ int32_t catalogChkAuth(SCatalog* pCtg, SRequestConnInfo* pConn, const char* user
}
int32_t
code
=
0
;
CTG_ERR_JRET
(
ctgChkAuth
(
pCtg
,
pConn
,
user
,
dbFName
,
type
,
pass
));
CTG_ERR_JRET
(
ctgChkAuth
(
pCtg
,
pConn
,
user
,
dbFName
,
type
,
pass
,
NULL
));
_return:
CTG_API_LEAVE
(
code
);
}
int32_t
catalogChkAuthFromCache
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
pass
,
bool
*
exists
)
{
CTG_API_ENTER
();
if
(
NULL
==
pCtg
||
NULL
==
pConn
||
NULL
==
user
||
NULL
==
dbFName
||
NULL
==
pass
||
NULL
==
exists
)
{
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
int32_t
code
=
0
;
CTG_ERR_JRET
(
ctgChkAuth
(
pCtg
,
pConn
,
user
,
dbFName
,
type
,
pass
,
exists
));
_return:
CTG_API_LEAVE
(
code
);
}
int32_t
catalogGetServerVersion
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
char
**
pVersion
)
{
CTG_API_ENTER
();
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
973a942d
...
...
@@ -924,6 +924,11 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SCtgTaskReq* tReq, SDBVgInfo*
if
(
1
==
vgNum
)
{
void
*
pIter
=
taosHashIterate
(
dbInfo
->
vgHash
,
NULL
);
if
(
NULL
==
pIter
)
{
ctgError
(
"empty vgHash, db:%s, vgroup number:%d"
,
dbFName
,
vgNum
);
CTG_ERR_RET
(
TSDB_CODE_CTG_INTERNAL_ERROR
);
}
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
vgInfo
=
taosMemoryMalloc
(
sizeof
(
SVgroupInfo
));
if
(
NULL
==
vgInfo
)
{
...
...
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
973a942d
...
...
@@ -2771,10 +2771,30 @@ TEST(apiTest, catalogChkAuth_test) {
ASSERT_EQ
(
code
,
0
);
bool
pass
=
false
;
bool
exists
=
false
;
code
=
catalogChkAuthFromCache
(
pCtg
,
mockPointer
,
ctgTestUsername
,
ctgTestDbname
,
AUTH_TYPE_READ
,
&
pass
,
&
exists
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
exists
,
false
);
code
=
catalogChkAuth
(
pCtg
,
mockPointer
,
ctgTestUsername
,
ctgTestDbname
,
AUTH_TYPE_READ
,
&
pass
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
pass
,
true
);
while
(
true
)
{
uint64_t
n
=
0
;
ctgdGetStatNum
(
"runtime.numOfOpDequeue"
,
(
void
*
)
&
n
);
if
(
n
!=
1
)
{
taosMsleep
(
50
);
}
else
{
break
;
}
}
code
=
catalogChkAuthFromCache
(
pCtg
,
mockPointer
,
ctgTestUsername
,
ctgTestDbname
,
AUTH_TYPE_READ
,
&
pass
,
&
exists
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
pass
,
true
);
ASSERT_EQ
(
exists
,
true
);
catalogDestroy
();
}
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
973a942d
...
...
@@ -456,6 +456,7 @@ int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
(
*
pDst
)
->
vgHash
=
taosHashInit
(
taosHashGetSize
(
pSrc
->
vgHash
),
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
if
(
NULL
==
(
*
pDst
)
->
vgHash
)
{
taosMemoryFreeClear
(
*
pDst
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
...
...
source/libs/scalar/src/filter.c
浏览文件 @
973a942d
...
...
@@ -1087,7 +1087,7 @@ int32_t filterAddUnitImpl(SFilterInfo *info, uint8_t optr, SFilterFieldId *left,
if
(
tmp
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
info
->
units
=
tmp
;
info
->
units
=
(
SFilterUnit
*
)
tmp
;
memset
(
info
->
units
+
psize
,
0
,
sizeof
(
*
info
->
units
)
*
FILTER_DEFAULT_UNIT_SIZE
);
}
...
...
@@ -1633,12 +1633,12 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options)
SValueNode
*
var
=
(
SValueNode
*
)
field
->
desc
;
SDataType
*
dType
=
&
var
->
node
.
resType
;
if
(
dType
->
type
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
qDebug
(
"VAL%d => [type:TS][val:[%"
PRIi64
"] - [%"
PRId64
"]]"
,
i
,
*
(
int64_t
*
)
field
->
data
,
*
(((
int64_t
*
)
field
->
data
)
+
1
));
}
else
{
//
if (dType->type == TSDB_DATA_TYPE_VALUE_ARRAY) {
//
qDebug("VAL%d => [type:TS][val:[%" PRIi64 "] - [%" PRId64 "]]", i, *(int64_t *)field->data,
//
*(((int64_t *)field->data) + 1));
//
} else {
qDebug
(
"VAL%d => [type:%d][val:%"
PRIx64
"]"
,
i
,
dType
->
type
,
var
->
datum
.
i
);
// TODO
}
//
}
}
else
if
(
field
->
data
)
{
qDebug
(
"VAL%d => [type:NIL][val:NIL]"
,
i
);
// TODO
}
...
...
@@ -4059,11 +4059,13 @@ bool filterExecute(SFilterInfo *info, SSDataBlock *pSrc, SColumnInfoData **p, SC
SArray
*
pList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
pList
,
&
pSrc
);
FLT_ERR_RET
(
scalarCalculate
(
info
->
sclCtx
.
node
,
pList
,
&
output
));
*
p
=
output
.
columnData
;
int32_t
code
=
scalarCalculate
(
info
->
sclCtx
.
node
,
pList
,
&
output
);
taosArrayDestroy
(
pList
);
FLT_ERR_RET
(
code
);
*
p
=
output
.
columnData
;
if
(
output
.
numOfQualified
==
output
.
numOfRows
)
{
*
pResultStatus
=
FILTER_RESULT_ALL_QUALIFIED
;
}
else
if
(
output
.
numOfQualified
==
0
)
{
...
...
source/libs/scalar/src/scalar.c
浏览文件 @
973a942d
...
...
@@ -896,6 +896,10 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp
SCL_ERR_JRET
(
sclGetNodeRes
(
pWhenThen
->
pWhen
,
ctx
,
&
pWhen
));
SCL_ERR_JRET
(
sclGetNodeRes
(
pWhenThen
->
pThen
,
ctx
,
&
pThen
));
if
(
NULL
==
pWhen
||
NULL
==
pThen
)
{
sclError
(
"invalid when/then in whenThen list"
);
SCL_ERR_JRET
(
TSDB_CODE_INVALID_PARA
);
}
if
(
pCase
)
{
vectorCompare
(
pCase
,
pWhen
,
&
comp
,
TSDB_ORDER_ASC
,
OP_TYPE_EQUAL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录