Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a50d1086
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看板
未验证
提交
a50d1086
编写于
6月 04, 2022
作者:
H
Haojun Liao
提交者:
GitHub
6月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13455 from taosdata/feature/3_liaohj
Feature/3 liaohj
上级
d733d6ca
0c94c65a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
15 deletion
+55
-15
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/libs/catalog/src/ctgAsync.c
source/libs/catalog/src/ctgAsync.c
+12
-0
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+18
-0
source/libs/parser/test/parInitialDTest.cpp
source/libs/parser/test/parInitialDTest.cpp
+24
-14
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
a50d1086
...
...
@@ -1087,7 +1087,7 @@ void* doAsyncFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUc
tsem_wait
(
&
pParam
->
sem
);
}
if
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
&&
setupOneRowPtr
)
{
if
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
&&
pResultInfo
->
numOfRows
>
0
&&
setupOneRowPtr
)
{
doSetOneRowPtr
(
pResultInfo
);
pResultInfo
->
current
+=
1
;
}
...
...
source/libs/catalog/src/ctgAsync.c
浏览文件 @
a50d1086
...
...
@@ -328,6 +328,18 @@ int32_t ctgInitJob(CTG_PARAMS, SCtgJob** job, uint64_t reqId, const SCatalogReq*
CTG_ERR_JRET
(
ctgInitGetQnodeTask
(
pJob
,
taskIdx
++
));
}
pJob
->
refId
=
taosAddRef
(
gCtgMgmt
.
jobPool
,
pJob
);
if
(
pJob
->
refId
<
0
)
{
ctgError
(
"add job to ref failed, error: %s"
,
tstrerror
(
terrno
));
CTG_ERR_JRET
(
terrno
);
}
taosAcquireRef
(
gCtgMgmt
.
jobPool
,
pJob
->
refId
);
qDebug
(
"QID:%"
PRIx64
", job %"
PRIx64
" initialized, task num %d"
,
pJob
->
queryId
,
pJob
->
refId
,
*
taskNum
);
return
TSDB_CODE_SUCCESS
;
_return:
taosMemoryFreeClear
(
*
job
);
CTG_RET
(
code
);
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
a50d1086
...
...
@@ -199,6 +199,22 @@ static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCre
return
code
;
}
static
int32_t
collectMetaKeyFromDropTable
(
SCollectMetaKeyCxt
*
pCxt
,
SDropTableStmt
*
pStmt
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pNode
=
NULL
;
FOREACH
(
pNode
,
pStmt
->
pTables
)
{
SDropTableClause
*
pClause
=
(
SDropTableClause
*
)
pNode
;
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
pCxt
->
pMetaCache
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveTableVgroupInCache
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
pCxt
->
pMetaCache
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
}
}
return
code
;
}
static
int32_t
collectMetaKeyFromAlterTable
(
SCollectMetaKeyCxt
*
pCxt
,
SAlterTableStmt
*
pStmt
)
{
int32_t
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
pCxt
->
pMetaCache
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
@@ -341,6 +357,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
return
collectMetaKeyFromCreateTable
(
pCxt
,
(
SCreateTableStmt
*
)
pStmt
);
case
QUERY_NODE_CREATE_MULTI_TABLE_STMT
:
return
collectMetaKeyFromCreateMultiTable
(
pCxt
,
(
SCreateMultiTableStmt
*
)
pStmt
);
case
QUERY_NODE_DROP_TABLE_STMT
:
return
collectMetaKeyFromDropTable
(
pCxt
,
(
SDropTableStmt
*
)
pStmt
);
case
QUERY_NODE_ALTER_TABLE_STMT
:
return
collectMetaKeyFromAlterTable
(
pCxt
,
(
SAlterTableStmt
*
)
pStmt
);
case
QUERY_NODE_USE_DATABASE_STMT
:
...
...
source/libs/parser/test/parInitialDTest.cpp
浏览文件 @
a50d1086
...
...
@@ -24,7 +24,7 @@ class ParserInitialDTest : public ParserDdlTest {};
// todo delete
// todo desc
// todo describe
// todo
drop
account
// todo
DROP
account
TEST_F
(
ParserInitialDTest
,
dropBnode
)
{
useDb
(
"root"
,
"test"
);
...
...
@@ -62,51 +62,61 @@ TEST_F(ParserInitialDTest, dropCGroup) {
run
(
"DROP CONSUMER GROUP IF EXISTS cg1 ON tp1"
);
}
// todo
drop
database
// todo
drop
dnode
// todo
drop
function
// todo
DROP
database
// todo
DROP
dnode
// todo
DROP
function
TEST_F
(
ParserInitialDTest
,
dropIndex
)
{
useDb
(
"root"
,
"test"
);
run
(
"
drop
index index1 on t1"
);
run
(
"
DROP
index index1 on t1"
);
}
TEST_F
(
ParserInitialDTest
,
dropMnode
)
{
useDb
(
"root"
,
"test"
);
run
(
"
drop
mnode on dnode 1"
);
run
(
"
DROP
mnode on dnode 1"
);
}
TEST_F
(
ParserInitialDTest
,
dropQnode
)
{
useDb
(
"root"
,
"test"
);
run
(
"
drop
qnode on dnode 1"
);
run
(
"
DROP
qnode on dnode 1"
);
}
TEST_F
(
ParserInitialDTest
,
dropSnode
)
{
useDb
(
"root"
,
"test"
);
run
(
"
drop
snode on dnode 1"
);
run
(
"
DROP
snode on dnode 1"
);
}
// todo drop stable
// todo drop stream
// todo drop table
TEST_F
(
ParserInitialDTest
,
dropSTable
)
{
useDb
(
"root"
,
"test"
);
run
(
"DROP STABLE st1"
);
}
// todo DROP stream
TEST_F
(
ParserInitialDTest
,
dropTable
)
{
useDb
(
"root"
,
"test"
);
run
(
"DROP TABLE t1"
);
}
TEST_F
(
ParserInitialDTest
,
dropTopic
)
{
useDb
(
"root"
,
"test"
);
run
(
"
drop
topic tp1"
);
run
(
"
DROP
topic tp1"
);
run
(
"
drop
topic if exists tp1"
);
run
(
"
DROP
topic if exists tp1"
);
}
TEST_F
(
ParserInitialDTest
,
dropUser
)
{
login
(
"root"
);
useDb
(
"root"
,
"test"
);
run
(
"
drop
user wxy"
);
run
(
"
DROP
user wxy"
);
}
}
// namespace ParserTest
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录