Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46246346
TDengine
提交
d597bc97
TDengine
项目概览
weixin_46246346
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d597bc97
编写于
5月 15, 2020
作者:
T
Tao Liu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/tliu' of
https://github.com/taosdata/TDengine
into feature/tliu
上级
a92fa507
1626b5b2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
5 deletion
+21
-5
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+1
-0
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+3
-4
src/client/src/tscSecondaryMerge.c
src/client/src/tscSecondaryMerge.c
+2
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+15
-0
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
d597bc97
...
...
@@ -134,6 +134,7 @@ void tscFieldInfoSetBinExpr(SFieldInfo* pFieldInfo, int32_t index, SSqlFunctionE
void
tscFieldInfoCalOffset
(
SQueryInfo
*
pQueryInfo
);
void
tscFieldInfoCopy
(
SFieldInfo
*
src
,
SFieldInfo
*
dst
,
const
int32_t
*
indexList
,
int32_t
size
);
void
tscFieldInfoCopyAll
(
SFieldInfo
*
dst
,
SFieldInfo
*
src
);
void
tscFieldInfoUpdateBySqlFunc
(
SQueryInfo
*
pQueryInfo
);
TAOS_FIELD
*
tscFieldInfoGetField
(
SQueryInfo
*
pQueryInfo
,
int32_t
index
);
int16_t
tscFieldInfoGetOffset
(
SQueryInfo
*
pQueryInfo
,
int32_t
index
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
d597bc97
...
...
@@ -1998,17 +1998,16 @@ int32_t doGetColumnIndexByName(SSQLToken* pToken, SQueryInfo* pQueryInfo, SColum
}
int32_t
getMeterIndex
(
SSQLToken
*
pTableToken
,
SQueryInfo
*
pQueryInfo
,
SColumnIndex
*
pIndex
)
{
pIndex
->
tableIndex
=
COLUMN_INDEX_INITIAL_VAL
;
if
(
pTableToken
->
n
==
0
)
{
// only one table and no table name prefix in column name
if
(
pQueryInfo
->
numOfTables
==
1
)
{
pIndex
->
tableIndex
=
0
;
}
return
TSDB_CODE_SUCCESS
;
}
pIndex
->
tableIndex
=
COLUMN_INDEX_INITIAL_VAL
;
char
tableName
[
TSDB_METER_ID_LEN
+
1
]
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
numOfTables
;
++
i
)
{
SMeterMetaInfo
*
pMeterMetaInfo
=
tscGetMeterMetaInfoFromQueryInfo
(
pQueryInfo
,
i
);
if
(
strncasecmp
(
pMeterMetaInfo
->
aliasName
,
pTableToken
->
z
,
pTableToken
->
n
)
==
0
&&
...
...
src/client/src/tscSecondaryMerge.c
浏览文件 @
d597bc97
...
...
@@ -259,8 +259,9 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
pReducer
->
rowSize
=
pMemBuffer
[
0
]
->
nElemSize
;
tscRestoreSQLFunctionForMetricQuery
(
pQueryInfo
);
tscFieldInfoUpdateBySqlFunc
(
pQueryInfo
);
tscFieldInfoCalOffset
(
pQueryInfo
);
if
(
pReducer
->
rowSize
>
pMemBuffer
[
0
]
->
pageSize
)
{
assert
(
false
);
// todo fixed row size is larger than the minimum page size;
}
...
...
src/client/src/tscUtil.c
浏览文件 @
d597bc97
...
...
@@ -926,6 +926,20 @@ void tscFieldInfoSetBinExpr(SFieldInfo* pFieldInfo, int32_t index, SSqlFunctionE
pFieldInfo
->
pExpr
[
index
]
=
pExpr
;
}
void
tscFieldInfoUpdateBySqlFunc
(
SQueryInfo
*
pQueryInfo
)
{
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
fieldsInfo
.
numOfOutputCols
;
++
i
)
{
TAOS_FIELD
*
field
=
tscFieldInfoGetField
(
pQueryInfo
,
i
);
SSqlExpr
*
pExpr
=
pQueryInfo
->
fieldsInfo
.
pSqlExpr
[
i
];
if
(
pExpr
==
NULL
)
{
continue
;
}
field
->
type
=
pExpr
->
resType
;
field
->
bytes
=
pExpr
->
resBytes
;
}
}
void
tscFieldInfoCalOffset
(
SQueryInfo
*
pQueryInfo
)
{
SSqlExprInfo
*
pExprInfo
=
&
pQueryInfo
->
exprsInfo
;
pExprInfo
->
pExprs
[
0
]
->
offset
=
0
;
...
...
@@ -2012,6 +2026,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
// create the fields info from the sql functions
SColumnList
columnList
=
{.
num
=
1
};
// for avg/last/first/histo.. query, the output type is binary not numeric data type
for
(
int32_t
k
=
0
;
k
<
numOfOutputCols
;
++
k
)
{
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
indexList
[
k
]);
columnList
.
ids
[
0
]
=
(
SColumnIndex
){.
tableIndex
=
tableIndex
,
.
columnIndex
=
pExpr
->
colInfo
.
colIdx
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录