Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
40dd568d
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看板
未验证
提交
40dd568d
编写于
3月 10, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
3月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10678 from taosdata/feature/3.0_query_integrate_wxy
TD-13747 bugfix
上级
ae9f58af
54afca4d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
10 deletion
+38
-10
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+6
-1
source/libs/nodes/src/nodesCloneFuncs.c
source/libs/nodes/src/nodesCloneFuncs.c
+9
-0
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+2
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+20
-8
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-1
未找到文件。
source/libs/function/src/builtins.c
浏览文件 @
40dd568d
...
...
@@ -77,7 +77,9 @@ const int32_t funcMgtBuiltinsNum = (sizeof(funcMgtBuiltins) / sizeof(SBuiltinFun
int32_t
stubCheckAndGetResultType
(
SFunctionNode
*
pFunc
)
{
switch
(
pFunc
->
funcType
)
{
case
FUNCTION_TYPE_COUNT
:
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
sizeof
(
int64_t
),
.
type
=
TSDB_DATA_TYPE_BIGINT
};
break
;
case
FUNCTION_TYPE_COUNT
:
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
sizeof
(
int64_t
),
.
type
=
TSDB_DATA_TYPE_BIGINT
};
break
;
case
FUNCTION_TYPE_SUM
:
{
SColumnNode
*
pParam
=
nodesListGetNode
(
pFunc
->
pParameterList
,
0
);
int32_t
paraType
=
pParam
->
node
.
resType
.
type
;
...
...
@@ -103,6 +105,9 @@ int32_t stubCheckAndGetResultType(SFunctionNode* pFunc) {
pFunc
->
node
.
resType
=
(
SDataType
)
{
.
bytes
=
tDataTypes
[
paraType
].
bytes
,
.
type
=
paraType
};
break
;
}
case
FUNCTION_TYPE_CONCAT
:
// todo
break
;
default:
ASSERT
(
0
);
// to found the fault ASAP.
}
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
40dd568d
...
...
@@ -271,6 +271,13 @@ static SNode* slotDescCopy(const SSlotDescNode* pSrc, SSlotDescNode* pDst) {
return
(
SNode
*
)
pDst
;
}
static
SNode
*
downstreamSourceCopy
(
const
SDownstreamSourceNode
*
pSrc
,
SDownstreamSourceNode
*
pDst
)
{
COPY_SCALAR_FIELD
(
addr
);
COPY_SCALAR_FIELD
(
taskId
);
COPY_SCALAR_FIELD
(
schedId
);
return
(
SNode
*
)
pDst
;
}
SNodeptr
nodesCloneNode
(
const
SNodeptr
pNode
)
{
if
(
NULL
==
pNode
)
{
return
NULL
;
...
...
@@ -306,6 +313,8 @@ SNodeptr nodesCloneNode(const SNodeptr pNode) {
return
dataBlockDescCopy
((
const
SDataBlockDescNode
*
)
pNode
,
(
SDataBlockDescNode
*
)
pDst
);
case
QUERY_NODE_SLOT_DESC
:
return
slotDescCopy
((
const
SSlotDescNode
*
)
pNode
,
(
SSlotDescNode
*
)
pDst
);
case
QUERY_NODE_DOWNSTREAM_SOURCE
:
return
downstreamSourceCopy
((
const
SDownstreamSourceNode
*
)
pNode
,
(
SDownstreamSourceNode
*
)
pDst
);
case
QUERY_NODE_LOGIC_PLAN_SCAN
:
return
logicScanCopy
((
const
SScanLogicNode
*
)
pNode
,
(
SScanLogicNode
*
)
pDst
);
case
QUERY_NODE_LOGIC_PLAN_AGG
:
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
40dd568d
...
...
@@ -74,6 +74,8 @@ SNodeptr nodesMakeNode(ENodeType type) {
return
makeNode
(
type
,
sizeof
(
SSlotDescNode
));
case
QUERY_NODE_COLUMN_DEF
:
return
makeNode
(
type
,
sizeof
(
SColumnDefNode
));
case
QUERY_NODE_DOWNSTREAM_SOURCE
:
return
makeNode
(
type
,
sizeof
(
SDownstreamSourceNode
));
case
QUERY_NODE_SET_OPERATOR
:
return
makeNode
(
type
,
sizeof
(
SSetOperator
));
case
QUERY_NODE_SELECT_STMT
:
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
40dd568d
...
...
@@ -891,7 +891,7 @@ static int32_t translateDropTable(STranslateContext* pCxt, SDropTableStmt* pStmt
if
(
TSDB_SUPER_TABLE
==
pTableMeta
->
tableType
)
{
code
=
doTranslateDropSuperTable
(
pCxt
,
&
tableName
,
pClause
->
ignoreNotExists
);
}
else
{
// todo
;
// todo
: drop normal table or child table
code
=
TSDB_CODE_FAILED
;
}
}
...
...
@@ -1203,6 +1203,9 @@ static int32_t setReslutSchema(STranslateContext* pCxt, SQuery* pQuery) {
}
static
void
destroyTranslateContext
(
STranslateContext
*
pCxt
)
{
if
(
NULL
!=
pCxt
->
pNsLevel
)
{
}
taosArrayDestroy
(
pCxt
->
pNsLevel
);
if
(
NULL
!=
pCxt
->
pCmdMsg
)
{
tfree
(
pCxt
->
pCmdMsg
->
pMsg
);
...
...
@@ -1222,6 +1225,11 @@ static void toSchema(const SColumnDefNode* pCol, int32_t colId, SSchema* pSchema
strcpy
(
pSchema
->
name
,
pCol
->
colName
);
}
static
void
destroyCreateTbReq
(
SVCreateTbReq
*
pReq
)
{
tfree
(
pReq
->
name
);
tfree
(
pReq
->
ntbCfg
.
pSchema
);
}
static
int32_t
buildNormalTableBatchReq
(
const
char
*
pTableName
,
const
SNodeList
*
pColumns
,
const
SVgroupInfo
*
pVgroupInfo
,
SVgroupTablesBatch
*
pBatch
)
{
SVCreateTbReq
req
=
{
0
};
...
...
@@ -1230,6 +1238,7 @@ static int32_t buildNormalTableBatchReq(
req
.
ntbCfg
.
nCols
=
LIST_LENGTH
(
pColumns
);
req
.
ntbCfg
.
pSchema
=
calloc
(
req
.
ntbCfg
.
nCols
,
sizeof
(
SSchema
));
if
(
NULL
==
req
.
name
||
NULL
==
req
.
ntbCfg
.
pSchema
)
{
destroyCreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
SNode
*
pCol
;
...
...
@@ -1242,6 +1251,7 @@ static int32_t buildNormalTableBatchReq(
pBatch
->
info
=
*
pVgroupInfo
;
pBatch
->
req
.
pArray
=
taosArrayInit
(
1
,
sizeof
(
struct
SVCreateTbReq
));
if
(
NULL
==
pBatch
->
req
.
pArray
)
{
destroyCreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
taosArrayPush
(
pBatch
->
req
.
pArray
,
&
req
);
...
...
@@ -1311,18 +1321,20 @@ static int32_t rewriteToVnodeModifOpStmt(SQuery* pQuery, SArray* pBufArray) {
}
static
int32_t
buildCreateTableDataBlock
(
const
SCreateTableStmt
*
pStmt
,
const
SVgroupInfo
*
pInfo
,
SArray
**
pBufArray
)
{
*
pBufArray
=
taosArrayInit
(
1
,
POINTER_BYTES
);
if
(
NULL
==
*
pBufArray
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
SVgroupTablesBatch
tbatch
=
{
0
};
int32_t
code
=
buildNormalTableBatchReq
(
pStmt
->
tableName
,
pStmt
->
pCols
,
pInfo
,
&
tbatch
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
*
pBufArray
=
taosArrayInit
(
1
,
POINTER_BYTES
);
if
(
NULL
==
pBufArray
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
serializeVgroupTablesBatch
(
&
tbatch
,
*
pBufArray
);
}
destroyCreateTbReqBatch
(
&
tbatch
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
// todo : destroyCreateTbReqArray(*pBufArray);
}
return
code
;
}
...
...
@@ -1331,7 +1343,7 @@ static int32_t rewriteCreateTable(STranslateContext* pCxt, SQuery* pQuery) {
SVgroupInfo
info
=
{
0
};
int32_t
code
=
getTableHashVgroup
(
pCxt
->
pParseCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
info
);
SArray
*
pBufArray
;
SArray
*
pBufArray
=
NULL
;
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
buildCreateTableDataBlock
(
pStmt
,
&
info
,
&
pBufArray
);
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
40dd568d
...
...
@@ -48,7 +48,7 @@ static SNode* createSlotDesc(SPhysiPlanContext* pCxt, const SNode* pNode, int16_
pSlot
->
slotId
=
slotId
;
pSlot
->
dataType
=
((
SExprNode
*
)
pNode
)
->
resType
;
pSlot
->
reserve
=
false
;
pSlot
->
output
=
fals
e
;
pSlot
->
output
=
tru
e
;
return
(
SNode
*
)
pSlot
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录