Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
6e743d53
T
TDengine
项目概览
Tonvia
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6e743d53
编写于
7月 28, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix the bug found by regression test.
上级
e0046dbb
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
71 addition
and
51 deletion
+71
-51
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+2
-0
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+40
-46
src/client/src/tscServer.c
src/client/src/tscServer.c
+9
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+18
-4
tests/pytest/insert/line_insert.py
tests/pytest/insert/line_insert.py
+2
-0
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
6e743d53
...
@@ -376,6 +376,8 @@ void tscResetSqlCmd(SSqlCmd *pCmd, bool removeMeta);
...
@@ -376,6 +376,8 @@ void tscResetSqlCmd(SSqlCmd *pCmd, bool removeMeta);
*/
*/
void
tscFreeSqlResult
(
SSqlObj
*
pSql
);
void
tscFreeSqlResult
(
SSqlObj
*
pSql
);
void
*
tscCleanupTableMetaMap
(
SHashObj
*
pTableMetaMap
);
/**
/**
* free sql object, release allocated resource
* free sql object, release allocated resource
* @param pObj
* @param pObj
...
...
src/client/src/tscAsync.c
浏览文件 @
6e743d53
...
@@ -336,7 +336,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -336,7 +336,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
pRes
->
code
=
code
;
pRes
->
code
=
code
;
SSqlObj
*
sub
=
(
SSqlObj
*
)
res
;
SSqlObj
*
sub
=
(
SSqlObj
*
)
res
;
const
char
*
msg
=
(
sub
->
cmd
.
command
==
TSDB_SQL_STABLEVGROUP
)
?
"vgroup-list"
:
"
[multi-]
tableMeta"
;
const
char
*
msg
=
(
sub
->
cmd
.
command
==
TSDB_SQL_STABLEVGROUP
)
?
"vgroup-list"
:
"
multi-
tableMeta"
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tscError
(
"0x%"
PRIx64
" get %s failed, code:%s"
,
pSql
->
self
,
msg
,
tstrerror
(
code
));
tscError
(
"0x%"
PRIx64
" get %s failed, code:%s"
,
pSql
->
self
,
msg
,
tstrerror
(
code
));
goto
_error
;
goto
_error
;
...
@@ -346,11 +346,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -346,11 +346,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
if
(
pSql
->
pStream
==
NULL
)
{
if
(
pSql
->
pStream
==
NULL
)
{
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
pCmd
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
pCmd
);
// assert(TSDB_QUERY_HAS_TYPE(pQueryInfo->type, (TSDB_QUERY_TYPE_STABLE_SUBQUERY | TSDB_QUERY_TYPE_SUBQUERY | TSDB_QUERY_TYPE_TAG_FILTER_QUERY)) == 0);
// super table subquery failure will be ignored
// if (!TSDB_QUERY_HAS_TYPE(pQueryInfo->type, (TSDB_QUERY_TYPE_STABLE_SUBQUERY | TSDB_QUERY_TYPE_SUBQUERY |
// TSDB_QUERY_TYPE_TAG_FILTER_QUERY))) {
if
(
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_INSERT
))
{
if
(
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_INSERT
))
{
tscDebug
(
"0x%"
PRIx64
" continue parse sql after get table-meta"
,
pSql
->
self
);
tscDebug
(
"0x%"
PRIx64
" continue parse sql after get table-meta"
,
pSql
->
self
);
...
@@ -401,7 +396,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -401,7 +396,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
return
;
return
;
// }
}
else
{
// stream computing
}
else
{
// stream computing
tscDebug
(
"0x%"
PRIx64
" stream:%p meta is updated, start new query, command:%d"
,
pSql
->
self
,
pSql
->
pStream
,
pCmd
->
command
);
tscDebug
(
"0x%"
PRIx64
" stream:%p meta is updated, start new query, command:%d"
,
pSql
->
self
,
pSql
->
pStream
,
pCmd
->
command
);
...
...
src/client/src/tscServer.c
浏览文件 @
6e743d53
...
@@ -2224,6 +2224,9 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
...
@@ -2224,6 +2224,9 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
if
(
pMultiMeta
->
metaClone
==
1
||
pTableMeta
->
tableType
==
TSDB_SUPER_TABLE
)
{
if
(
pMultiMeta
->
metaClone
==
1
||
pTableMeta
->
tableType
==
TSDB_SUPER_TABLE
)
{
STableMetaVgroupInfo
p
=
{.
pTableMeta
=
pTableMeta
,};
STableMetaVgroupInfo
p
=
{.
pTableMeta
=
pTableMeta
,};
size_t
keyLen
=
strnlen
(
pMetaMsg
->
tableFname
,
TSDB_TABLE_FNAME_LEN
);
size_t
keyLen
=
strnlen
(
pMetaMsg
->
tableFname
,
TSDB_TABLE_FNAME_LEN
);
void
*
t
=
taosHashGet
(
pParentCmd
->
pTableMetaMap
,
pMetaMsg
->
tableFname
,
keyLen
);
assert
(
t
==
NULL
);
taosHashPut
(
pParentCmd
->
pTableMetaMap
,
pMetaMsg
->
tableFname
,
keyLen
,
&
p
,
sizeof
(
STableMetaVgroupInfo
));
taosHashPut
(
pParentCmd
->
pTableMetaMap
,
pMetaMsg
->
tableFname
,
keyLen
,
&
p
,
sizeof
(
STableMetaVgroupInfo
));
}
else
{
}
else
{
freeMeta
=
true
;
freeMeta
=
true
;
...
@@ -2915,7 +2918,9 @@ static void freeElem(void* p) {
...
@@ -2915,7 +2918,9 @@ static void freeElem(void* p) {
* @return status code
* @return status code
*/
*/
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
int32_t
tableIndex
)
{
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
int32_t
tableIndex
)
{
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
&
pSql
->
cmd
);
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfo
(
pCmd
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
tableIndex
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
tableIndex
);
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
...
@@ -2934,6 +2939,9 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
...
@@ -2934,6 +2939,9 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
// remove stored tableMeta info in hash table
// remove stored tableMeta info in hash table
tscRemoveTableMetaBuf
(
pTableMetaInfo
,
pSql
->
self
);
tscRemoveTableMetaBuf
(
pTableMetaInfo
,
pSql
->
self
);
pCmd
->
pTableMetaMap
=
tscCleanupTableMetaMap
(
pCmd
->
pTableMetaMap
);
pCmd
->
pTableMetaMap
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
SArray
*
pNameList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
pNameList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
vgroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
vgroupList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
...
...
src/client/src/tscUtil.c
浏览文件 @
6e743d53
...
@@ -1398,6 +1398,22 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta) {
...
@@ -1398,6 +1398,22 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta) {
}
}
}
}
void
*
tscCleanupTableMetaMap
(
SHashObj
*
pTableMetaMap
)
{
if
(
pTableMetaMap
==
NULL
)
{
return
NULL
;
}
STableMetaVgroupInfo
*
p
=
taosHashIterate
(
pTableMetaMap
,
NULL
);
while
(
p
)
{
taosArrayDestroy
(
p
->
vgroupIdList
);
tfree
(
p
->
pTableMeta
);
p
=
taosHashIterate
(
pTableMetaMap
,
p
);
}
taosHashCleanup
(
pTableMetaMap
);
return
NULL
;
}
void
tscFreeSqlResult
(
SSqlObj
*
pSql
)
{
void
tscFreeSqlResult
(
SSqlObj
*
pSql
)
{
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
...
@@ -3481,11 +3497,9 @@ SSqlObj* createSimpleSubObj(SSqlObj* pSql, __async_cb_func_t fp, void* param, in
...
@@ -3481,11 +3497,9 @@ SSqlObj* createSimpleSubObj(SSqlObj* pSql, __async_cb_func_t fp, void* param, in
SSqlCmd
*
pCmd
=
&
pNew
->
cmd
;
SSqlCmd
*
pCmd
=
&
pNew
->
cmd
;
pCmd
->
command
=
cmd
;
pCmd
->
command
=
cmd
;
tsem_init
(
&
pNew
->
rspSem
,
0
,
0
);
if
(
tscAddQueryInfo
(
pCmd
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tscAddQueryInfo
(
pCmd
)
!=
TSDB_CODE_SUCCESS
)
{
#ifdef __APPLE__
// to satisfy later tsem_destroy in taos_free_result
tsem_init
(
&
pNew
->
rspSem
,
0
,
0
);
#endif // __APPLE__
tscFreeSqlObj
(
pNew
);
tscFreeSqlObj
(
pNew
);
return
NULL
;
return
NULL
;
}
}
...
...
tests/pytest/insert/line_insert.py
浏览文件 @
6e743d53
...
@@ -77,6 +77,8 @@ class TDTestCase:
...
@@ -77,6 +77,8 @@ class TDTestCase:
"sth,t1=4i64,t2=5f64,t4=5f64,ID=
\"
childtable
\"
c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641ms"
,
"sth,t1=4i64,t2=5f64,t4=5f64,ID=
\"
childtable
\"
c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641ms"
,
"sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933654ms"
"sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933654ms"
])
])
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select tbname, * from sth'
)
tdSql
.
query
(
'select tbname, * from sth'
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
2
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录