Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
57bbde8d
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
57bbde8d
编写于
12月 17, 2021
作者:
W
wenzhouwww
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/fix/TD-12135' into develop
上级
2069de9f
f27f4e38
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
35 addition
and
22 deletion
+35
-22
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+33
-20
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
57bbde8d
...
@@ -440,7 +440,7 @@ int tsParseSql(SSqlObj *pSql, bool initial);
...
@@ -440,7 +440,7 @@ int tsParseSql(SSqlObj *pSql, bool initial);
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpcEpSet
*
pEpSet
);
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpcEpSet
*
pEpSet
);
int
tscBuildAndSendRequest
(
SSqlObj
*
pSql
,
SQueryInfo
*
pQueryInfo
);
int
tscBuildAndSendRequest
(
SSqlObj
*
pSql
,
SQueryInfo
*
pQueryInfo
);
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
int32_t
tableIndex
);
int
tscRenewTableMeta
(
SSqlObj
*
pSql
);
void
tscAsyncResultOnError
(
SSqlObj
*
pSql
);
void
tscAsyncResultOnError
(
SSqlObj
*
pSql
);
void
tscQueueAsyncError
(
void
(
*
fp
),
void
*
param
,
int32_t
code
);
void
tscQueueAsyncError
(
void
(
*
fp
),
void
*
param
,
int32_t
code
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
57bbde8d
src/client/src/tscServer.c
浏览文件 @
57bbde8d
...
@@ -444,7 +444,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -444,7 +444,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
}
}
pSql
->
retryReason
=
rpcMsg
->
code
;
pSql
->
retryReason
=
rpcMsg
->
code
;
rpcMsg
->
code
=
tscRenewTableMeta
(
pSql
,
0
);
rpcMsg
->
code
=
tscRenewTableMeta
(
pSql
);
// if there is an error occurring, proceed to the following error handling procedure.
// if there is an error occurring, proceed to the following error handling procedure.
if
(
rpcMsg
->
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
if
(
rpcMsg
->
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
taosReleaseRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
@@ -3074,28 +3074,46 @@ static void freeElem(void* p) {
...
@@ -3074,28 +3074,46 @@ static void freeElem(void* p) {
/**
/**
* retrieve table meta from mnode, and then update the local table meta hashmap.
* retrieve table meta from mnode, and then update the local table meta hashmap.
* @param pSql sql object
* @param pSql sql object
* @param tableIndex table index
* @return status code
* @return status code
*/
*/
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
int32_t
tableIndex
)
{
int
tscRenewTableMeta
(
SSqlObj
*
pSql
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
pCmd
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
pCmd
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
tableIndex
);
SArray
*
pNameList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
vgroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SHashObj
*
nameTable
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
while
(
pQueryInfo
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
int32_t
code
=
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
code
=
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tscError
(
"0x%"
PRIx64
" failed to generate the table full name"
,
pSql
->
self
);
tscError
(
"0x%"
PRIx64
" failed to generate the table full name"
,
pSql
->
self
);
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
//do not add duplicate names
if
(
!
taosHashGet
(
nameTable
,
name
,
strlen
(
name
)))
{
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
pTableMeta
)
{
if
(
pTableMeta
)
{
tscDebug
(
"0x%"
PRIx64
" update table meta:%s, old meta numOfTags:%d, numOfCols:%d, uid:%"
PRIu64
,
pSql
->
self
,
name
,
tscDebug
(
"0x%"
PRIx64
" update table meta:%s, old meta numOfTags:%d, numOfCols:%d, uid:%"
PRIu64
,
pSql
->
self
,
name
,
tscGetNumOfTags
(
pTableMeta
),
tscGetNumOfColumns
(
pTableMeta
),
pTableMeta
->
id
.
uid
);
tscGetNumOfTags
(
pTableMeta
),
tscGetNumOfColumns
(
pTableMeta
),
pTableMeta
->
id
.
uid
);
}
}
char
*
n
=
strdup
(
name
);
taosArrayPush
(
pNameList
,
&
n
);
uint8_t
dummy_val
=
0
;
taosHashPut
(
nameTable
,
name
,
strlen
(
name
),
&
dummy_val
,
sizeof
(
uint8_t
));
}
pQueryInfo
=
pQueryInfo
->
sibling
;
}
taosHashCleanup
(
nameTable
);
// remove stored tableMeta info in hash table
// remove stored tableMeta info in hash table
tscResetSqlCmd
(
pCmd
,
true
,
pSql
->
self
);
tscResetSqlCmd
(
pCmd
,
true
,
pSql
->
self
);
...
@@ -3110,11 +3128,6 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
...
@@ -3110,11 +3128,6 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
tscFreeSubobj
(
pSql
->
rootObj
);
tscFreeSubobj
(
pSql
->
rootObj
);
tfree
(
tmpSql
->
pSubs
);
tfree
(
tmpSql
->
pSubs
);
SArray
*
pNameList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
vgroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
char
*
n
=
strdup
(
name
);
taosArrayPush
(
pNameList
,
&
n
);
code
=
getMultiTableMetaFromMnode
(
tmpSql
,
pNameList
,
vgroupList
,
NULL
,
tscTableMetaCallBack
,
true
);
code
=
getMultiTableMetaFromMnode
(
tmpSql
,
pNameList
,
vgroupList
,
NULL
,
tscTableMetaCallBack
,
true
);
taosArrayDestroyEx
(
pNameList
,
freeElem
);
taosArrayDestroyEx
(
pNameList
,
freeElem
);
taosArrayDestroyEx
(
vgroupList
,
freeElem
);
taosArrayDestroyEx
(
vgroupList
,
freeElem
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录