Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c80f3239
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看板
未验证
提交
c80f3239
编写于
3月 31, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
3月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11159 from taosdata/feature/3.0_wxy
bugfix
上级
1e5bdbfa
e555db03
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
0 deletion
+30
-0
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+30
-0
未找到文件。
source/libs/parser/src/parAstCreater.c
浏览文件 @
c80f3239
...
...
@@ -473,6 +473,9 @@ static bool checkPort(SAstCreateContext* pCxt, const SToken* pPortToken, int32_t
static
bool
checkDbName
(
SAstCreateContext
*
pCxt
,
SToken
*
pDbName
,
bool
query
)
{
if
(
NULL
==
pDbName
)
{
pCxt
->
valid
=
(
query
?
NULL
!=
pCxt
->
pQueryCxt
->
db
:
true
);
if
(
!
pCxt
->
valid
)
{
snprintf
(
pCxt
->
pQueryCxt
->
pMsg
,
pCxt
->
pQueryCxt
->
msgLen
,
"db not specified"
);
}
}
else
{
pCxt
->
valid
=
pDbName
->
n
<
TSDB_DB_NAME_LEN
?
true
:
false
;
}
...
...
@@ -1017,6 +1020,9 @@ SDataType createVarLenDataType(uint8_t type, const SToken* pLen) {
SNode
*
createCreateTableStmt
(
SAstCreateContext
*
pCxt
,
bool
ignoreExists
,
SNode
*
pRealTable
,
SNodeList
*
pCols
,
SNodeList
*
pTags
,
SNode
*
pOptions
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SCreateTableStmt
*
pStmt
=
(
SCreateTableStmt
*
)
nodesMakeNode
(
QUERY_NODE_CREATE_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
strcpy
(
pStmt
->
dbName
,
((
SRealTableNode
*
)
pRealTable
)
->
table
.
dbName
);
...
...
@@ -1031,6 +1037,9 @@ SNode* createCreateTableStmt(SAstCreateContext* pCxt,
SNode
*
createCreateSubTableClause
(
SAstCreateContext
*
pCxt
,
bool
ignoreExists
,
SNode
*
pRealTable
,
SNode
*
pUseRealTable
,
SNodeList
*
pSpecificTags
,
SNodeList
*
pValsOfTags
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SCreateSubTableClause
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_CREATE_SUBTABLE_CLAUSE
);
CHECK_OUT_OF_MEM
(
pStmt
);
strcpy
(
pStmt
->
dbName
,
((
SRealTableNode
*
)
pRealTable
)
->
table
.
dbName
);
...
...
@@ -1053,6 +1062,9 @@ SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables
}
SNode
*
createDropTableClause
(
SAstCreateContext
*
pCxt
,
bool
ignoreNotExists
,
SNode
*
pRealTable
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SDropTableClause
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_DROP_TABLE_CLAUSE
);
CHECK_OUT_OF_MEM
(
pStmt
);
strcpy
(
pStmt
->
dbName
,
((
SRealTableNode
*
)
pRealTable
)
->
table
.
dbName
);
...
...
@@ -1080,6 +1092,9 @@ SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, S
}
SNode
*
createAlterTableOption
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
SNode
*
pOptions
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SAlterTableStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_ALTER_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
pStmt
->
alterType
=
TSDB_ALTER_TABLE_UPDATE_OPTIONS
;
...
...
@@ -1088,6 +1103,9 @@ SNode* createAlterTableOption(SAstCreateContext* pCxt, SNode* pRealTable, SNode*
}
SNode
*
createAlterTableAddModifyCol
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
int8_t
alterType
,
const
SToken
*
pColName
,
SDataType
dataType
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SAlterTableStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_ALTER_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
pStmt
->
alterType
=
alterType
;
...
...
@@ -1097,6 +1115,9 @@ SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable,
}
SNode
*
createAlterTableDropCol
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
int8_t
alterType
,
const
SToken
*
pColName
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SAlterTableStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_ALTER_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
pStmt
->
alterType
=
alterType
;
...
...
@@ -1105,6 +1126,9 @@ SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_
}
SNode
*
createAlterTableRenameCol
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
int8_t
alterType
,
const
SToken
*
pOldColName
,
const
SToken
*
pNewColName
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SAlterTableStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_ALTER_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
pStmt
->
alterType
=
alterType
;
...
...
@@ -1114,6 +1138,9 @@ SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int
}
SNode
*
createAlterTableSetTag
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
const
SToken
*
pTagName
,
SNode
*
pVal
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SAlterTableStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_ALTER_TABLE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
pStmt
->
alterType
=
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
;
...
...
@@ -1345,6 +1372,9 @@ SNode* createExplainStmt(SAstCreateContext* pCxt, bool analyze, SNode* pOptions,
}
SNode
*
createDescribeStmt
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
)
{
if
(
NULL
==
pRealTable
)
{
return
NULL
;
}
SDescribeStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_DESCRIBE_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
strcpy
(
pStmt
->
dbName
,
((
SRealTableNode
*
)
pRealTable
)
->
table
.
dbName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录