Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
64ca1f72
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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,发现更多精彩内容 >>
提交
64ca1f72
编写于
7月 14, 2021
作者:
W
wpan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix join issues
上级
22796177
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
22 deletion
+26
-22
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+17
-22
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+9
-0
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
64ca1f72
...
@@ -730,8 +730,16 @@ static int32_t quitAllSubquery(SSqlObj* pSqlSub, SSqlObj* pSqlObj, SJoinSupporte
...
@@ -730,8 +730,16 @@ static int32_t quitAllSubquery(SSqlObj* pSqlSub, SSqlObj* pSqlObj, SJoinSupporte
static
void
updateQueryTimeRange
(
SQueryInfo
*
pQueryInfo
,
STimeWindow
*
win
)
{
static
void
updateQueryTimeRange
(
SQueryInfo
*
pQueryInfo
,
STimeWindow
*
win
)
{
assert
(
pQueryInfo
->
window
.
skey
<=
win
->
skey
&&
pQueryInfo
->
window
.
ekey
>=
win
->
ekey
);
assert
(
pQueryInfo
->
window
.
skey
<=
win
->
skey
&&
pQueryInfo
->
window
.
ekey
>=
win
->
ekey
);
pQueryInfo
->
window
=
*
win
;
pQueryInfo
->
window
=
*
win
;
}
int32_t
tagValCompar
(
const
void
*
p1
,
const
void
*
p2
)
{
const
STidTags
*
t1
=
(
const
STidTags
*
)
varDataVal
(
p1
);
const
STidTags
*
t2
=
(
const
STidTags
*
)
varDataVal
(
p2
);
__compar_fn_t
func
=
getComparFunc
(
t1
->
padding
,
0
);
return
func
(
t1
->
tag
,
t2
->
tag
);
}
}
int32_t
tidTagsCompar
(
const
void
*
p1
,
const
void
*
p2
)
{
int32_t
tidTagsCompar
(
const
void
*
p1
,
const
void
*
p2
)
{
...
@@ -742,28 +750,7 @@ int32_t tidTagsCompar(const void* p1, const void* p2) {
...
@@ -742,28 +750,7 @@ int32_t tidTagsCompar(const void* p1, const void* p2) {
return
(
t1
->
vgId
>
t2
->
vgId
)
?
1
:
-
1
;
return
(
t1
->
vgId
>
t2
->
vgId
)
?
1
:
-
1
;
}
}
tstr
*
tag1
=
(
tstr
*
)
t1
->
tag
;
return
tagValCompar
(
p1
,
p2
);
tstr
*
tag2
=
(
tstr
*
)
t2
->
tag
;
if
(
tag1
->
len
!=
tag2
->
len
)
{
return
(
tag1
->
len
>
tag2
->
len
)
?
1
:
-
1
;
}
return
strncmp
(
tag1
->
data
,
tag2
->
data
,
tag1
->
len
);
}
int32_t
tagValCompar
(
const
void
*
p1
,
const
void
*
p2
)
{
const
STidTags
*
t1
=
(
const
STidTags
*
)
varDataVal
(
p1
);
const
STidTags
*
t2
=
(
const
STidTags
*
)
varDataVal
(
p2
);
tstr
*
tag1
=
(
tstr
*
)
t1
->
tag
;
tstr
*
tag2
=
(
tstr
*
)
t2
->
tag
;
if
(
tag1
->
len
!=
tag2
->
len
)
{
return
(
tag1
->
len
>
tag2
->
len
)
?
1
:
-
1
;
}
return
memcmp
(
tag1
->
data
,
tag2
->
data
,
tag1
->
len
);
}
}
void
tscBuildVgroupTableInfo
(
SSqlObj
*
pSql
,
STableMetaInfo
*
pTableMetaInfo
,
SArray
*
tables
)
{
void
tscBuildVgroupTableInfo
(
SSqlObj
*
pSql
,
STableMetaInfo
*
pTableMetaInfo
,
SArray
*
tables
)
{
...
@@ -889,6 +876,12 @@ static bool checkForDuplicateTagVal(SSchema* pColSchema, SJoinSupporter* p1, SSq
...
@@ -889,6 +876,12 @@ static bool checkForDuplicateTagVal(SSchema* pColSchema, SJoinSupporter* p1, SSq
return
true
;
return
true
;
}
}
static
void
setTidTagType
(
SJoinSupporter
*
p
,
uint8_t
type
)
{
for
(
int32_t
i
=
0
;
i
<
p
->
num
;
++
i
)
{
STidTags
*
tag
=
(
STidTags
*
)
varDataVal
(
p
->
pIdTagList
+
i
*
p
->
tagSize
);
tag
->
padding
=
type
;
}
}
static
int32_t
getIntersectionOfTableTuple
(
SQueryInfo
*
pQueryInfo
,
SSqlObj
*
pParentSql
,
SArray
*
resList
)
{
static
int32_t
getIntersectionOfTableTuple
(
SQueryInfo
*
pQueryInfo
,
SSqlObj
*
pParentSql
,
SArray
*
resList
)
{
int16_t
joinNum
=
pParentSql
->
subState
.
numOfSub
;
int16_t
joinNum
=
pParentSql
->
subState
.
numOfSub
;
...
@@ -908,6 +901,8 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
...
@@ -908,6 +901,8 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
for
(
int32_t
i
=
0
;
i
<
joinNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
joinNum
;
i
++
)
{
SJoinSupporter
*
p
=
pParentSql
->
pSubs
[
i
]
->
param
;
SJoinSupporter
*
p
=
pParentSql
->
pSubs
[
i
]
->
param
;
setTidTagType
(
p
,
pColSchema
->
type
);
ctxlist
[
i
].
p
=
p
;
ctxlist
[
i
].
p
=
p
;
ctxlist
[
i
].
res
=
taosArrayInit
(
p
->
num
,
size
);
ctxlist
[
i
].
res
=
taosArrayInit
(
p
->
num
,
size
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
64ca1f72
...
@@ -267,6 +267,10 @@ static void writeDataToDisk(STSBuf* pTSBuf) {
...
@@ -267,6 +267,10 @@ static void writeDataToDisk(STSBuf* pTSBuf) {
if
(
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_BINARY
||
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_BINARY
||
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
nLen
,
1
,
sizeof
(
pBlock
->
tag
.
nLen
),
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
nLen
,
1
,
sizeof
(
pBlock
->
tag
.
nLen
),
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
pBlock
->
tag
.
pz
,
1
,
(
size_t
)
pBlock
->
tag
.
nLen
,
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
pBlock
->
tag
.
pz
,
1
,
(
size_t
)
pBlock
->
tag
.
nLen
,
pTSBuf
->
f
);
}
else
if
(
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
nLen
,
1
,
sizeof
(
pBlock
->
tag
.
nLen
),
pTSBuf
->
f
);
float
tfloat
=
pBlock
->
tag
.
dKey
;
metaLen
+=
(
int32_t
)
fwrite
(
&
tfloat
,
1
,
(
size_t
)
pBlock
->
tag
.
nLen
,
pTSBuf
->
f
);
}
else
if
(
pBlock
->
tag
.
nType
!=
TSDB_DATA_TYPE_NULL
)
{
}
else
if
(
pBlock
->
tag
.
nType
!=
TSDB_DATA_TYPE_NULL
)
{
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
nLen
,
1
,
sizeof
(
pBlock
->
tag
.
nLen
),
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
nLen
,
1
,
sizeof
(
pBlock
->
tag
.
nLen
),
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
i64
,
1
,
(
size_t
)
pBlock
->
tag
.
nLen
,
pTSBuf
->
f
);
metaLen
+=
(
int32_t
)
fwrite
(
&
pBlock
->
tag
.
i64
,
1
,
(
size_t
)
pBlock
->
tag
.
nLen
,
pTSBuf
->
f
);
...
@@ -351,6 +355,11 @@ STSBlock* readDataFromDisk(STSBuf* pTSBuf, int32_t order, bool decomp) {
...
@@ -351,6 +355,11 @@ STSBlock* readDataFromDisk(STSBuf* pTSBuf, int32_t order, bool decomp) {
sz
=
fread
(
pBlock
->
tag
.
pz
,
(
size_t
)
pBlock
->
tag
.
nLen
,
1
,
pTSBuf
->
f
);
sz
=
fread
(
pBlock
->
tag
.
pz
,
(
size_t
)
pBlock
->
tag
.
nLen
,
1
,
pTSBuf
->
f
);
UNUSED
(
sz
);
UNUSED
(
sz
);
}
else
if
(
pBlock
->
tag
.
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
float
tfloat
=
0
;
sz
=
fread
(
&
tfloat
,
(
size_t
)
pBlock
->
tag
.
nLen
,
1
,
pTSBuf
->
f
);
pBlock
->
tag
.
dKey
=
tfloat
;
UNUSED
(
sz
);
}
else
if
(
pBlock
->
tag
.
nType
!=
TSDB_DATA_TYPE_NULL
)
{
//TODO check the return value
}
else
if
(
pBlock
->
tag
.
nType
!=
TSDB_DATA_TYPE_NULL
)
{
//TODO check the return value
sz
=
fread
(
&
pBlock
->
tag
.
i64
,
(
size_t
)
pBlock
->
tag
.
nLen
,
1
,
pTSBuf
->
f
);
sz
=
fread
(
&
pBlock
->
tag
.
i64
,
(
size_t
)
pBlock
->
tag
.
nLen
,
1
,
pTSBuf
->
f
);
UNUSED
(
sz
);
UNUSED
(
sz
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录