Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e6edc1e5
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看板
未验证
提交
e6edc1e5
编写于
6月 06, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
6月 06, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13496 from taosdata/feature/3_liaohj_wxy
fix: a problem of parser async
上级
79d8361a
d8e89196
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
6 deletion
+38
-6
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+13
-0
source/libs/parser/test/mockCatalog.cpp
source/libs/parser/test/mockCatalog.cpp
+9
-0
source/libs/parser/test/parInitialDTest.cpp
source/libs/parser/test/parInitialDTest.cpp
+10
-2
source/libs/parser/test/parTestUtil.h
source/libs/parser/test/parTestUtil.h
+6
-4
未找到文件。
source/libs/parser/src/parAstParser.c
浏览文件 @
e6edc1e5
...
@@ -258,6 +258,17 @@ static int32_t collectMetaKeyFromExplain(SCollectMetaKeyCxt* pCxt, SExplainStmt*
...
@@ -258,6 +258,17 @@ static int32_t collectMetaKeyFromExplain(SCollectMetaKeyCxt* pCxt, SExplainStmt*
return
collectMetaKeyFromQuery
(
pCxt
,
pStmt
->
pQuery
);
return
collectMetaKeyFromQuery
(
pCxt
,
pStmt
->
pQuery
);
}
}
static
int32_t
collectMetaKeyFromDescribe
(
SCollectMetaKeyCxt
*
pCxt
,
SDescribeStmt
*
pStmt
)
{
SName
name
=
{.
type
=
TSDB_TABLE_NAME_T
,
.
acctId
=
pCxt
->
pParseCxt
->
acctId
};
strcpy
(
name
.
dbname
,
pStmt
->
dbName
);
strcpy
(
name
.
tname
,
pStmt
->
tableName
);
int32_t
code
=
catalogRemoveTableMeta
(
pCxt
->
pParseCxt
->
pCatalog
,
&
name
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
pCxt
->
pMetaCache
);
}
return
code
;
}
static
int32_t
collectMetaKeyFromCreateStream
(
SCollectMetaKeyCxt
*
pCxt
,
SCreateStreamStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromCreateStream
(
SCollectMetaKeyCxt
*
pCxt
,
SCreateStreamStmt
*
pStmt
)
{
return
collectMetaKeyFromQuery
(
pCxt
,
pStmt
->
pQuery
);
return
collectMetaKeyFromQuery
(
pCxt
,
pStmt
->
pQuery
);
}
}
...
@@ -381,6 +392,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
...
@@ -381,6 +392,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
return
collectMetaKeyFromCreateTopic
(
pCxt
,
(
SCreateTopicStmt
*
)
pStmt
);
return
collectMetaKeyFromCreateTopic
(
pCxt
,
(
SCreateTopicStmt
*
)
pStmt
);
case
QUERY_NODE_EXPLAIN_STMT
:
case
QUERY_NODE_EXPLAIN_STMT
:
return
collectMetaKeyFromExplain
(
pCxt
,
(
SExplainStmt
*
)
pStmt
);
return
collectMetaKeyFromExplain
(
pCxt
,
(
SExplainStmt
*
)
pStmt
);
case
QUERY_NODE_DESCRIBE_STMT
:
return
collectMetaKeyFromDescribe
(
pCxt
,
(
SDescribeStmt
*
)
pStmt
);
case
QUERY_NODE_CREATE_STREAM_STMT
:
case
QUERY_NODE_CREATE_STREAM_STMT
:
return
collectMetaKeyFromCreateStream
(
pCxt
,
(
SCreateStreamStmt
*
)
pStmt
);
return
collectMetaKeyFromCreateStream
(
pCxt
,
(
SCreateStreamStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_DNODES_STMT
:
case
QUERY_NODE_SHOW_DNODES_STMT
:
...
...
source/libs/parser/test/mockCatalog.cpp
浏览文件 @
e6edc1e5
...
@@ -207,6 +207,13 @@ int32_t __catalogGetUdfInfo(SCatalog* pCtg, void* pTrans, const SEpSet* pMgmtEps
...
@@ -207,6 +207,13 @@ int32_t __catalogGetUdfInfo(SCatalog* pCtg, void* pTrans, const SEpSet* pMgmtEps
return
g_mockCatalogService
->
catalogGetUdfInfo
(
funcName
,
pInfo
);
return
g_mockCatalogService
->
catalogGetUdfInfo
(
funcName
,
pInfo
);
}
}
int32_t
__catalogRefreshGetTableMeta
(
SCatalog
*
pCatalog
,
void
*
pTransporter
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
STableMeta
**
pTableMeta
,
int32_t
isSTable
)
{
return
g_mockCatalogService
->
catalogGetTableMeta
(
pTableName
,
pTableMeta
);
}
int32_t
__catalogRemoveTableMeta
(
SCatalog
*
pCtg
,
SName
*
pTableName
)
{
return
0
;
}
void
initMetaDataEnv
()
{
void
initMetaDataEnv
()
{
g_mockCatalogService
.
reset
(
new
MockCatalogService
());
g_mockCatalogService
.
reset
(
new
MockCatalogService
());
...
@@ -221,6 +228,8 @@ void initMetaDataEnv() {
...
@@ -221,6 +228,8 @@ void initMetaDataEnv() {
stub
.
set
(
catalogGetDBCfg
,
__catalogGetDBCfg
);
stub
.
set
(
catalogGetDBCfg
,
__catalogGetDBCfg
);
stub
.
set
(
catalogChkAuth
,
__catalogChkAuth
);
stub
.
set
(
catalogChkAuth
,
__catalogChkAuth
);
stub
.
set
(
catalogGetUdfInfo
,
__catalogGetUdfInfo
);
stub
.
set
(
catalogGetUdfInfo
,
__catalogGetUdfInfo
);
stub
.
set
(
catalogRefreshGetTableMeta
,
__catalogRefreshGetTableMeta
);
stub
.
set
(
catalogRemoveTableMeta
,
__catalogRemoveTableMeta
);
// {
// {
// AddrAny any("libcatalog.so");
// AddrAny any("libcatalog.so");
// std::map<std::string,void*> result;
// std::map<std::string,void*> result;
...
...
source/libs/parser/test/parInitialDTest.cpp
浏览文件 @
e6edc1e5
...
@@ -21,7 +21,7 @@ namespace ParserTest {
...
@@ -21,7 +21,7 @@ namespace ParserTest {
class
ParserInitialDTest
:
public
ParserDdlTest
{};
class
ParserInitialDTest
:
public
ParserDdlTest
{};
// DELETE FROM t
b
_name [WHERE condition]
// DELETE FROM t
able
_name [WHERE condition]
TEST_F
(
ParserInitialDTest
,
delete
)
{
TEST_F
(
ParserInitialDTest
,
delete
)
{
useDb
(
"root"
,
"test"
);
useDb
(
"root"
,
"test"
);
...
@@ -40,7 +40,15 @@ TEST_F(ParserInitialDTest, deleteSemanticCheck) {
...
@@ -40,7 +40,15 @@ TEST_F(ParserInitialDTest, deleteSemanticCheck) {
run
(
"DELETE FROM t1 WHERE c1 > 10"
,
TSDB_CODE_PAR_INVALID_DELETE_WHERE
,
PARSER_STAGE_TRANSLATE
);
run
(
"DELETE FROM t1 WHERE c1 > 10"
,
TSDB_CODE_PAR_INVALID_DELETE_WHERE
,
PARSER_STAGE_TRANSLATE
);
}
}
// todo desc
// DESC table_name
TEST_F
(
ParserInitialDTest
,
describe
)
{
useDb
(
"root"
,
"test"
);
run
(
"DESC t1"
);
run
(
"DESCRIBE st1"
);
}
// todo describe
// todo describe
// todo DROP account
// todo DROP account
...
...
source/libs/parser/test/parTestUtil.h
浏览文件 @
e6edc1e5
...
@@ -50,11 +50,13 @@ class ParserDdlTest : public ParserTestBase {
...
@@ -50,11 +50,13 @@ class ParserDdlTest : public ParserTestBase {
virtual
void
checkDdl
(
const
SQuery
*
pQuery
,
ParserStage
stage
)
{
virtual
void
checkDdl
(
const
SQuery
*
pQuery
,
ParserStage
stage
)
{
ASSERT_NE
(
pQuery
,
nullptr
);
ASSERT_NE
(
pQuery
,
nullptr
);
ASSERT_EQ
(
pQuery
->
haveResultSet
,
false
);
ASSERT_NE
(
pQuery
->
pRoot
,
nullptr
);
ASSERT_NE
(
pQuery
->
pRoot
,
nullptr
);
ASSERT_EQ
(
pQuery
->
numOfResCols
,
0
);
if
(
QUERY_EXEC_MODE_RPC
==
pQuery
->
execMode
)
{
ASSERT_EQ
(
pQuery
->
pResSchema
,
nullptr
);
ASSERT_EQ
(
pQuery
->
haveResultSet
,
false
);
ASSERT_EQ
(
pQuery
->
precision
,
0
);
ASSERT_EQ
(
pQuery
->
numOfResCols
,
0
);
ASSERT_EQ
(
pQuery
->
pResSchema
,
nullptr
);
ASSERT_EQ
(
pQuery
->
precision
,
0
);
}
if
(
nullptr
!=
checkDdl_
)
{
if
(
nullptr
!=
checkDdl_
)
{
checkDdl_
(
pQuery
,
stage
);
checkDdl_
(
pQuery
,
stage
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录