Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b194ff18
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
b194ff18
编写于
1月 11, 2022
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
(query):use tlv for client/server message compability
上级
ab8b8875
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
27 deletion
+26
-27
src/client/src/tscServer.c
src/client/src/tscServer.c
+7
-9
src/inc/taosmsg.h
src/inc/taosmsg.h
+0
-2
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+15
-14
src/query/src/queryMain.c
src/query/src/queryMain.c
+2
-2
未找到文件。
src/client/src/tscServer.c
浏览文件 @
b194ff18
...
@@ -964,9 +964,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -964,9 +964,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
);
pQueryMsg
->
numOfGroupCols
=
htons
(
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
);
pQueryMsg
->
queryType
=
htonl
(
pQueryInfo
->
type
);
pQueryMsg
->
queryType
=
htonl
(
pQueryInfo
->
type
);
pQueryMsg
->
prevResultLen
=
htonl
(
pQueryInfo
->
bufLen
);
pQueryMsg
->
prevResultLen
=
htonl
(
pQueryInfo
->
bufLen
);
pQueryMsg
->
schemaVersion
=
htons
(
pTableMeta
->
sversion
);
pQueryMsg
->
tagVersion
=
htons
(
pTableMeta
->
tversion
);
// set column list ids
// set column list ids
size_t
numOfCols
=
taosArrayGetSize
(
pQueryInfo
->
colList
);
size_t
numOfCols
=
taosArrayGetSize
(
pQueryInfo
->
colList
);
char
*
pMsg
=
(
char
*
)(
pQueryMsg
->
tableCols
)
+
numOfCols
*
sizeof
(
SColumnInfo
);
char
*
pMsg
=
(
char
*
)(
pQueryMsg
->
tableCols
)
+
numOfCols
*
sizeof
(
SColumnInfo
);
...
@@ -1152,21 +1150,21 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1152,21 +1150,21 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pMsg
+=
sqlLen
;
pMsg
+=
sqlLen
;
/*
//MSG EXTEND DEMO
pQueryMsg
->
extend
=
1
;
pQueryMsg
->
extend
=
1
;
STLV
*
tlv
=
(
STLV
*
)
pMsg
;
STLV
*
tlv
=
(
STLV
*
)
pMsg
;
tlv->type = htons(TLV_TYPE_DUMMY);
tlv
->
type
=
htons
(
TLV_TYPE_META_VERSION
);
tlv->len = htonl(sizeof(int16_t));
tlv
->
len
=
htonl
(
sizeof
(
int16_t
)
*
2
);
*(int16_t *)tlv->value = htons(12345);
*
(
int16_t
*
)
tlv
->
value
=
htons
(
pTableMeta
->
sversion
);
*
(
int16_t
*
)(
tlv
->
value
+
sizeof
(
int16_t
))
=
htons
(
pTableMeta
->
tversion
);
pMsg
+=
sizeof
(
*
tlv
)
+
ntohl
(
tlv
->
len
);
pMsg
+=
sizeof
(
*
tlv
)
+
ntohl
(
tlv
->
len
);
tlv
=
(
STLV
*
)
pMsg
;
tlv
=
(
STLV
*
)
pMsg
;
tlv
->
type
=
htons
(
TLV_TYPE_END_MARK
);
tlv
->
len
=
0
;
tlv
->
len
=
0
;
pMsg
+=
sizeof
(
*
tlv
);
pMsg
+=
sizeof
(
*
tlv
);
*/
int32_t
msgLen
=
(
int32_t
)(
pMsg
-
pCmd
->
payload
);
int32_t
msgLen
=
(
int32_t
)(
pMsg
-
pCmd
->
payload
);
...
...
src/inc/taosmsg.h
浏览文件 @
b194ff18
...
@@ -523,8 +523,6 @@ typedef struct {
...
@@ -523,8 +523,6 @@ typedef struct {
int32_t
udfNum
;
// number of udf function
int32_t
udfNum
;
// number of udf function
int32_t
udfContentOffset
;
int32_t
udfContentOffset
;
int32_t
udfContentLen
;
int32_t
udfContentLen
;
int16_t
schemaVersion
;
int16_t
tagVersion
;
SColumnInfo
tableCols
[];
SColumnInfo
tableCols
[];
}
SQueryTableMsg
;
}
SQueryTableMsg
;
...
...
src/query/inc/qExecutor.h
浏览文件 @
b194ff18
...
@@ -428,6 +428,8 @@ typedef struct SQueryParam {
...
@@ -428,6 +428,8 @@ typedef struct SQueryParam {
int32_t
tableScanOperator
;
int32_t
tableScanOperator
;
SArray
*
pOperator
;
SArray
*
pOperator
;
SUdfInfo
*
pUdfInfo
;
SUdfInfo
*
pUdfInfo
;
int16_t
schemaVersion
;
int16_t
tagVersion
;
}
SQueryParam
;
}
SQueryParam
;
typedef
struct
SColumnDataParam
{
typedef
struct
SColumnDataParam
{
...
...
src/query/src/qExecutor.c
浏览文件 @
b194ff18
...
@@ -8264,10 +8264,6 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
...
@@ -8264,10 +8264,6 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
goto
_cleanup
;
goto
_cleanup
;
}
}
/*
//MSG EXTEND DEMO
if
(
pQueryMsg
->
extend
)
{
if
(
pQueryMsg
->
extend
)
{
pMsg
+=
pQueryMsg
->
sqlstrLen
;
pMsg
+=
pQueryMsg
->
sqlstrLen
;
...
@@ -8276,19 +8272,24 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
...
@@ -8276,19 +8272,24 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
tlv
=
(
STLV
*
)
pMsg
;
tlv
=
(
STLV
*
)
pMsg
;
tlv
->
type
=
ntohs
(
tlv
->
type
);
tlv
->
type
=
ntohs
(
tlv
->
type
);
tlv
->
len
=
ntohl
(
tlv
->
len
);
tlv
->
len
=
ntohl
(
tlv
->
len
);
if (tlv->len > 0) {
if
(
tlv
->
type
==
TLV_TYPE_END_MARK
)
{
*(int16_t *)tlv->value = ntohs(*(int16_t *)tlv->value);
break
;
qDebug("Got TLV,type:%d,len:%d,value:%d", tlv->type, tlv->len, *(int16_t*)tlv->value);
}
pMsg += sizeof(*tlv) + tlv->len;
switch
(
tlv
->
type
)
{
continue;
case
TLV_TYPE_META_VERSION
:
{
assert
(
tlv
->
len
==
2
*
sizeof
(
int16_t
));
param
->
schemaVersion
=
ntohs
(
*
(
int16_t
*
)
tlv
->
value
);
param
->
tagVersion
=
ntohs
(
*
(
int16_t
*
)(
tlv
->
value
+
sizeof
(
int16_t
)));
pMsg
+=
sizeof
(
*
tlv
)
+
tlv
->
len
;
break
;
}
default:
{
pMsg
+=
sizeof
(
*
tlv
)
+
tlv
->
len
;
break
;
}
}
}
break;
}
}
}
}
*/
qDebug
(
"qmsg:%p query %d tables, type:%d, qrange:%"
PRId64
"-%"
PRId64
", numOfGroupbyTagCols:%d, order:%d, "
qDebug
(
"qmsg:%p query %d tables, type:%d, qrange:%"
PRId64
"-%"
PRId64
", numOfGroupbyTagCols:%d, order:%d, "
"outputCols:%d, numOfCols:%d, interval:%"
PRId64
", fillType:%d, comptsLen:%d, compNumOfBlocks:%d, limit:%"
PRId64
", offset:%"
PRId64
,
"outputCols:%d, numOfCols:%d, interval:%"
PRId64
", fillType:%d, comptsLen:%d, compNumOfBlocks:%d, limit:%"
PRId64
", offset:%"
PRId64
,
...
...
src/query/src/queryMain.c
浏览文件 @
b194ff18
...
@@ -162,8 +162,8 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi
...
@@ -162,8 +162,8 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi
assert
(
0
);
assert
(
0
);
}
}
int16_t
queryTagVersion
=
ntohs
(
pQueryMsg
->
tagVersion
)
;
int16_t
queryTagVersion
=
param
.
tagVersion
;
int16_t
querySchemaVersion
=
ntohs
(
pQueryMsg
->
schemaVersion
)
;
int16_t
querySchemaVersion
=
param
.
schemaVersion
;
if
(
queryTagVersion
<
tableGroupInfo
.
tVersion
||
querySchemaVersion
<
tableGroupInfo
.
sVersion
)
{
if
(
queryTagVersion
<
tableGroupInfo
.
tVersion
||
querySchemaVersion
<
tableGroupInfo
.
sVersion
)
{
code
=
TSDB_CODE_QRY_INVALID_SCHEMA_VERSION
;
code
=
TSDB_CODE_QRY_INVALID_SCHEMA_VERSION
;
goto
_over
;
goto
_over
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录