Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa5f5967
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
aa5f5967
编写于
11月 11, 2021
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10901]<fix>: Solve the conversion and serialization problems caused by long SQL.
上级
79be15f5
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
93 addition
and
105 deletion
+93
-105
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+1
-1
src/query/inc/qFilter.h
src/query/inc/qFilter.h
+17
-28
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/query/src/qFilter.c
src/query/src/qFilter.c
+71
-72
未找到文件。
src/client/src/tscServer.c
浏览文件 @
aa5f5967
...
@@ -975,7 +975,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -975,7 +975,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
if
(
pQueryInfo
->
colCond
&&
taosArrayGetSize
(
pQueryInfo
->
colCond
)
>
0
&&
!
onlyQueryTags
(
&
query
)
)
{
if
(
pQueryInfo
->
colCond
&&
taosArrayGetSize
(
pQueryInfo
->
colCond
)
>
0
&&
!
onlyQueryTags
(
&
query
)
)
{
STblCond
*
pCond
=
tsGetTableFilter
(
pQueryInfo
->
colCond
,
pTableMeta
->
id
.
uid
,
0
);
STblCond
*
pCond
=
tsGetTableFilter
(
pQueryInfo
->
colCond
,
pTableMeta
->
id
.
uid
,
0
);
if
(
pCond
!=
NULL
&&
pCond
->
cond
!=
NULL
)
{
if
(
pCond
!=
NULL
&&
pCond
->
cond
!=
NULL
)
{
pQueryMsg
->
colCondLen
=
hton
s
(
pCond
->
len
);
pQueryMsg
->
colCondLen
=
hton
l
(
pCond
->
len
);
memcpy
(
pMsg
,
pCond
->
cond
,
pCond
->
len
);
memcpy
(
pMsg
,
pCond
->
cond
,
pCond
->
len
);
pMsg
+=
pCond
->
len
;
pMsg
+=
pCond
->
len
;
...
...
src/inc/taosmsg.h
浏览文件 @
aa5f5967
...
@@ -486,7 +486,7 @@ typedef struct {
...
@@ -486,7 +486,7 @@ typedef struct {
SInterval
interval
;
SInterval
interval
;
SSessionWindow
sw
;
// session window
SSessionWindow
sw
;
// session window
uint16_t
tagCondLen
;
// tag length in current query
uint16_t
tagCondLen
;
// tag length in current query
uint16
_t
colCondLen
;
// column length in current query
int32
_t
colCondLen
;
// column length in current query
int16_t
numOfGroupCols
;
// num of group by columns
int16_t
numOfGroupCols
;
// num of group by columns
int16_t
orderByIdx
;
int16_t
orderByIdx
;
int16_t
orderType
;
// used in group by xx order by xxx
int16_t
orderType
;
// used in group by xx order by xxx
...
...
src/query/inc/qExecutor.h
浏览文件 @
aa5f5967
...
@@ -649,7 +649,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp
...
@@ -649,7 +649,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp
int32_t
createIndirectQueryFuncExprFromMsg
(
SQueryTableMsg
*
pQueryMsg
,
int32_t
numOfOutput
,
SExprInfo
**
pExprInfo
,
int32_t
createIndirectQueryFuncExprFromMsg
(
SQueryTableMsg
*
pQueryMsg
,
int32_t
numOfOutput
,
SExprInfo
**
pExprInfo
,
SSqlExpr
**
pExpr
,
SExprInfo
*
prevExpr
,
SUdfInfo
*
pUdfInfo
);
SSqlExpr
**
pExpr
,
SExprInfo
*
prevExpr
,
SUdfInfo
*
pUdfInfo
);
int32_t
createQueryFilter
(
char
*
data
,
uint16
_t
len
,
void
**
pFilters
);
int32_t
createQueryFilter
(
char
*
data
,
int32
_t
len
,
void
**
pFilters
);
SGroupbyExpr
*
createGroupbyExprFromMsg
(
SQueryTableMsg
*
pQueryMsg
,
SColIndex
*
pColIndex
,
int32_t
*
code
);
SGroupbyExpr
*
createGroupbyExprFromMsg
(
SQueryTableMsg
*
pQueryMsg
,
SColIndex
*
pColIndex
,
int32_t
*
code
);
SQInfo
*
createQInfoImpl
(
SQueryTableMsg
*
pQueryMsg
,
SGroupbyExpr
*
pGroupbyExpr
,
SExprInfo
*
pExprs
,
SQInfo
*
createQInfoImpl
(
SQueryTableMsg
*
pQueryMsg
,
SGroupbyExpr
*
pGroupbyExpr
,
SExprInfo
*
pExprs
,
...
...
src/query/inc/qFilter.h
浏览文件 @
aa5f5967
...
@@ -101,14 +101,6 @@ typedef struct SFilterRange {
...
@@ -101,14 +101,6 @@ typedef struct SFilterRange {
char
eflag
;
char
eflag
;
}
SFilterRange
;
}
SFilterRange
;
typedef
struct
SFilterColRange
{
uint16_t
idx
;
//column field idx
bool
isNull
;
bool
notNull
;
bool
isRange
;
SFilterRange
ra
;
}
SFilterColRange
;
typedef
bool
(
*
rangeCompFunc
)
(
const
void
*
,
const
void
*
,
const
void
*
,
const
void
*
,
__compar_fn_t
);
typedef
bool
(
*
rangeCompFunc
)
(
const
void
*
,
const
void
*
,
const
void
*
,
const
void
*
,
__compar_fn_t
);
typedef
int32_t
(
*
filter_desc_compare_func
)(
const
void
*
,
const
void
*
);
typedef
int32_t
(
*
filter_desc_compare_func
)(
const
void
*
,
const
void
*
);
typedef
bool
(
*
filter_exec_func
)(
void
*
,
int32_t
,
int8_t
**
,
SDataStatis
*
,
int16_t
);
typedef
bool
(
*
filter_exec_func
)(
void
*
,
int32_t
,
int8_t
**
,
SDataStatis
*
,
int16_t
);
...
@@ -160,20 +152,20 @@ typedef struct SFilterField {
...
@@ -160,20 +152,20 @@ typedef struct SFilterField {
}
SFilterField
;
}
SFilterField
;
typedef
struct
SFilterFields
{
typedef
struct
SFilterFields
{
uint
16
_t
size
;
uint
32
_t
size
;
uint
16
_t
num
;
uint
32
_t
num
;
SFilterField
*
fields
;
SFilterField
*
fields
;
}
SFilterFields
;
}
SFilterFields
;
typedef
struct
SFilterFieldId
{
typedef
struct
SFilterFieldId
{
uint16_t
type
;
uint16_t
type
;
uint
16
_t
idx
;
uint
32
_t
idx
;
}
SFilterFieldId
;
}
SFilterFieldId
;
typedef
struct
SFilterGroup
{
typedef
struct
SFilterGroup
{
uint
16
_t
unitSize
;
uint
32
_t
unitSize
;
uint
16
_t
unitNum
;
uint
32
_t
unitNum
;
uint
16
_t
*
unitIdxs
;
uint
32
_t
*
unitIdxs
;
uint8_t
*
unitFlags
;
// !unit result
uint8_t
*
unitFlags
;
// !unit result
}
SFilterGroup
;
}
SFilterGroup
;
...
@@ -184,13 +176,13 @@ typedef struct SFilterColInfo {
...
@@ -184,13 +176,13 @@ typedef struct SFilterColInfo {
}
SFilterColInfo
;
}
SFilterColInfo
;
typedef
struct
SFilterGroupCtx
{
typedef
struct
SFilterGroupCtx
{
uint
16
_t
colNum
;
uint
32
_t
colNum
;
uint
16
_t
*
colIdx
;
uint
32
_t
*
colIdx
;
SFilterColInfo
*
colInfo
;
SFilterColInfo
*
colInfo
;
}
SFilterGroupCtx
;
}
SFilterGroupCtx
;
typedef
struct
SFilterColCtx
{
typedef
struct
SFilterColCtx
{
uint
16
_t
colIdx
;
uint
32
_t
colIdx
;
void
*
ctx
;
void
*
ctx
;
}
SFilterColCtx
;
}
SFilterColCtx
;
...
@@ -227,13 +219,12 @@ typedef struct SFilterPCtx {
...
@@ -227,13 +219,12 @@ typedef struct SFilterPCtx {
typedef
struct
SFilterInfo
{
typedef
struct
SFilterInfo
{
uint32_t
options
;
uint32_t
options
;
uint32_t
status
;
uint32_t
status
;
uint
16
_t
unitSize
;
uint
32
_t
unitSize
;
uint
16
_t
unitNum
;
uint
32
_t
unitNum
;
uint
16
_t
groupNum
;
uint
32
_t
groupNum
;
uint
16
_t
colRangeNum
;
uint
32
_t
colRangeNum
;
SFilterFields
fields
[
FLD_TYPE_MAX
];
SFilterFields
fields
[
FLD_TYPE_MAX
];
SFilterGroup
*
groups
;
SFilterGroup
*
groups
;
uint16_t
*
cgroups
;
SFilterUnit
*
units
;
SFilterUnit
*
units
;
SFilterComUnit
*
cunits
;
SFilterComUnit
*
cunits
;
uint8_t
*
unitRes
;
// result
uint8_t
*
unitRes
;
// result
...
@@ -241,15 +232,13 @@ typedef struct SFilterInfo {
...
@@ -241,15 +232,13 @@ typedef struct SFilterInfo {
SFilterRangeCtx
**
colRange
;
SFilterRangeCtx
**
colRange
;
filter_exec_func
func
;
filter_exec_func
func
;
uint8_t
blkFlag
;
uint8_t
blkFlag
;
uint
16
_t
blkGroupNum
;
uint
32
_t
blkGroupNum
;
uint
16
_t
*
blkUnits
;
uint
32
_t
*
blkUnits
;
int8_t
*
blkUnitRes
;
int8_t
*
blkUnitRes
;
SFilterPCtx
pctx
;
SFilterPCtx
pctx
;
}
SFilterInfo
;
}
SFilterInfo
;
#define COL_FIELD_SIZE (sizeof(SFilterField) + 2 * sizeof(int64_t))
#define FILTER_NO_MERGE_DATA_TYPE(t) ((t) == TSDB_DATA_TYPE_BINARY || (t) == TSDB_DATA_TYPE_NCHAR)
#define FILTER_NO_MERGE_DATA_TYPE(t) ((t) == TSDB_DATA_TYPE_BINARY || (t) == TSDB_DATA_TYPE_NCHAR)
#define FILTER_NO_MERGE_OPTR(o) ((o) == TSDB_RELATION_ISNULL || (o) == TSDB_RELATION_NOTNULL || (o) == FILTER_DUMMY_EMPTY_OPTR)
#define FILTER_NO_MERGE_OPTR(o) ((o) == TSDB_RELATION_ISNULL || (o) == TSDB_RELATION_NOTNULL || (o) == FILTER_DUMMY_EMPTY_OPTR)
...
@@ -266,7 +255,7 @@ typedef struct SFilterInfo {
...
@@ -266,7 +255,7 @@ typedef struct SFilterInfo {
#define FILTER_CLR_FLAG(st, f) st &= (~f)
#define FILTER_CLR_FLAG(st, f) st &= (~f)
#define SIMPLE_COPY_VALUES(dst, src) *((int64_t *)dst) = *((int64_t *)src)
#define SIMPLE_COPY_VALUES(dst, src) *((int64_t *)dst) = *((int64_t *)src)
#define FILTER_PACKAGE_UNIT_HASH_KEY(v, optr, idx1, idx2) do { char *_t = (char *)v; _t[0] = optr; *(uint
16_t *)(_t + 1) = idx1; *(uint16
_t *)(_t + 3) = idx2; } while (0)
#define FILTER_PACKAGE_UNIT_HASH_KEY(v, optr, idx1, idx2) do { char *_t = (char *)v; _t[0] = optr; *(uint
32_t *)(_t + 1) = idx1; *(uint32
_t *)(_t + 3) = idx2; } while (0)
#define FILTER_GREATER(cr,sflag,eflag) ((cr > 0) || ((cr == 0) && (FILTER_GET_FLAG(sflag,RANGE_FLG_EXCLUDE) || FILTER_GET_FLAG(eflag,RANGE_FLG_EXCLUDE))))
#define FILTER_GREATER(cr,sflag,eflag) ((cr > 0) || ((cr == 0) && (FILTER_GET_FLAG(sflag,RANGE_FLG_EXCLUDE) || FILTER_GET_FLAG(eflag,RANGE_FLG_EXCLUDE))))
#define FILTER_COPY_RA(dst, src) do { (dst)->sflag = (src)->sflag; (dst)->eflag = (src)->eflag; (dst)->s = (src)->s; (dst)->e = (src)->e; } while (0)
#define FILTER_COPY_RA(dst, src) do { (dst)->sflag = (src)->sflag; (dst)->eflag = (src)->eflag; (dst)->s = (src)->s; (dst)->e = (src)->e; } while (0)
...
@@ -321,7 +310,7 @@ typedef struct SFilterInfo {
...
@@ -321,7 +310,7 @@ typedef struct SFilterInfo {
#define FILTER_PUSH_VAR_HASH(colInfo, ha) do { (colInfo).type = RANGE_TYPE_VAR_HASH; (colInfo).info = ha;} while (0)
#define FILTER_PUSH_VAR_HASH(colInfo, ha) do { (colInfo).type = RANGE_TYPE_VAR_HASH; (colInfo).info = ha;} while (0)
#define FILTER_PUSH_CTX(colInfo, ctx) do { (colInfo).type = RANGE_TYPE_MR_CTX; (colInfo).info = ctx;} while (0)
#define FILTER_PUSH_CTX(colInfo, ctx) do { (colInfo).type = RANGE_TYPE_MR_CTX; (colInfo).info = ctx;} while (0)
#define FILTER_COPY_IDX(dst, src, n) do { *(dst) = malloc(sizeof(uint
16_t) * n); memcpy(*(dst), src, sizeof(uint16
_t) * n);} while (0)
#define FILTER_COPY_IDX(dst, src, n) do { *(dst) = malloc(sizeof(uint
32_t) * n); memcpy(*(dst), src, sizeof(uint32
_t) * n);} while (0)
#define FILTER_ADD_CTX_TO_GRES(gres, idx, ctx) do { if ((gres)->colCtxs == NULL) { (gres)->colCtxs = taosArrayInit(gres->colNum, sizeof(SFilterColCtx)); } SFilterColCtx cCtx = {idx, ctx}; taosArrayPush((gres)->colCtxs, &cCtx); } while (0)
#define FILTER_ADD_CTX_TO_GRES(gres, idx, ctx) do { if ((gres)->colCtxs == NULL) { (gres)->colCtxs = taosArrayInit(gres->colNum, sizeof(SFilterColCtx)); } SFilterColCtx cCtx = {idx, ctx}; taosArrayPush((gres)->colCtxs, &cCtx); } while (0)
...
...
src/query/src/qExecutor.c
浏览文件 @
aa5f5967
...
@@ -7595,7 +7595,7 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
...
@@ -7595,7 +7595,7 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryMsg
->
numOfGroupCols
);
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryMsg
->
numOfGroupCols
);
pQueryMsg
->
tagCondLen
=
htons
(
pQueryMsg
->
tagCondLen
);
pQueryMsg
->
tagCondLen
=
htons
(
pQueryMsg
->
tagCondLen
);
pQueryMsg
->
colCondLen
=
hton
s
(
pQueryMsg
->
colCondLen
);
pQueryMsg
->
colCondLen
=
hton
l
(
pQueryMsg
->
colCondLen
);
pQueryMsg
->
tsBuf
.
tsOffset
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOffset
);
pQueryMsg
->
tsBuf
.
tsOffset
=
htonl
(
pQueryMsg
->
tsBuf
.
tsOffset
);
pQueryMsg
->
tsBuf
.
tsLen
=
htonl
(
pQueryMsg
->
tsBuf
.
tsLen
);
pQueryMsg
->
tsBuf
.
tsLen
=
htonl
(
pQueryMsg
->
tsBuf
.
tsLen
);
...
@@ -8245,7 +8245,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp
...
@@ -8245,7 +8245,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
createQueryFilter
(
char
*
data
,
uint16
_t
len
,
void
**
pFilters
)
{
int32_t
createQueryFilter
(
char
*
data
,
int32
_t
len
,
void
**
pFilters
)
{
tExprNode
*
expr
=
NULL
;
tExprNode
*
expr
=
NULL
;
TRY
(
TSDB_MAX_TAG_CONDITIONS
)
{
TRY
(
TSDB_MAX_TAG_CONDITIONS
)
{
...
...
src/query/src/qFilter.c
浏览文件 @
aa5f5967
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录