Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
9e9cc345
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9e9cc345
编写于
6月 22, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into hotfix/tmq
上级
25ec36dd
f1de963d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
7 deletion
+38
-7
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+6
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+5
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+27
-6
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
9e9cc345
...
@@ -6000,6 +6000,12 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6000,6 +6000,12 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
verbosePrint
(
"%s() LN%d: tid=%d seq=%"
PRId64
" tableName=%s
\n
"
,
verbosePrint
(
"%s() LN%d: tid=%d seq=%"
PRId64
" tableName=%s
\n
"
,
__func__
,
__LINE__
,
__func__
,
__LINE__
,
pThreadInfo
->
threadID
,
tableSeq
,
tableName
);
pThreadInfo
->
threadID
,
tableSeq
,
tableName
);
if
(
0
==
strlen
(
tableName
))
{
errorPrint
(
"[%d] %s() LN%d, getTableName return null
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
);
free
(
pThreadInfo
->
buffer
);
return
NULL
;
}
int64_t
remainderBufLen
=
maxSqlLen
;
int64_t
remainderBufLen
=
maxSqlLen
;
char
*
pstr
=
pThreadInfo
->
buffer
;
char
*
pstr
=
pThreadInfo
->
buffer
;
...
...
src/query/src/qExecutor.c
浏览文件 @
9e9cc345
...
@@ -6720,7 +6720,11 @@ int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQInfo *p
...
@@ -6720,7 +6720,11 @@ int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQInfo *p
if
(
pQueryMsg
->
tsLen
>
0
)
{
// open new file to save the result
if
(
pQueryMsg
->
tsLen
>
0
)
{
// open new file to save the result
char
*
tsBlock
=
(
char
*
)
pQueryMsg
+
pQueryMsg
->
tsOffset
;
char
*
tsBlock
=
(
char
*
)
pQueryMsg
+
pQueryMsg
->
tsOffset
;
pTsBuf
=
tsBufCreateFromCompBlocks
(
tsBlock
,
pQueryMsg
->
tsNumOfBlocks
,
pQueryMsg
->
tsLen
,
pQueryMsg
->
tsOrder
,
vgId
);
pTsBuf
=
tsBufCreateFromCompBlocks
(
tsBlock
,
pQueryMsg
->
tsNumOfBlocks
,
pQueryMsg
->
tsLen
,
pQueryMsg
->
tsOrder
,
vgId
);
if
(
pTsBuf
==
NULL
)
{
code
=
TSDB_CODE_QRY_NO_DISKSPACE
;
goto
_error
;
}
tsBufResetPos
(
pTsBuf
);
tsBufResetPos
(
pTsBuf
);
bool
ret
=
tsBufNextPos
(
pTsBuf
);
bool
ret
=
tsBufNextPos
(
pTsBuf
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
9e9cc345
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include "taoserror.h"
#include "taoserror.h"
#include "tscompression.h"
#include "tscompression.h"
#include "tutil.h"
#include "tutil.h"
#include "queryLog.h"
static
int32_t
getDataStartOffset
();
static
int32_t
getDataStartOffset
();
static
void
TSBufUpdateGroupInfo
(
STSBuf
*
pTSBuf
,
int32_t
index
,
STSGroupBlockInfo
*
pBlockInfo
);
static
void
TSBufUpdateGroupInfo
(
STSBuf
*
pTSBuf
,
int32_t
index
,
STSGroupBlockInfo
*
pBlockInfo
);
...
@@ -633,10 +634,15 @@ int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) {
...
@@ -633,10 +634,15 @@ int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) {
int32_t
r
=
fseek
(
pTSBuf
->
f
,
0
,
SEEK_SET
);
int32_t
r
=
fseek
(
pTSBuf
->
f
,
0
,
SEEK_SET
);
if
(
r
!=
0
)
{
if
(
r
!=
0
)
{
qError
(
"fseek failed, errno:%d"
,
errno
);
return
-
1
;
}
size_t
ws
=
fwrite
(
pHeader
,
sizeof
(
STSBufFileHeader
),
1
,
pTSBuf
->
f
);
if
(
ws
!=
1
)
{
qError
(
"ts update header fwrite failed, size:%d, expected size:%d"
,
(
int32_t
)
ws
,
(
int32_t
)
sizeof
(
STSBufFileHeader
));
return
-
1
;
return
-
1
;
}
}
fwrite
(
pHeader
,
sizeof
(
STSBufFileHeader
),
1
,
pTSBuf
->
f
);
return
0
;
return
0
;
}
}
...
@@ -856,9 +862,17 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
...
@@ -856,9 +862,17 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
TSBufUpdateGroupInfo
(
pTSBuf
,
pTSBuf
->
numOfGroups
-
1
,
pBlockInfo
);
TSBufUpdateGroupInfo
(
pTSBuf
,
pTSBuf
->
numOfGroups
-
1
,
pBlockInfo
);
int32_t
ret
=
fseek
(
pTSBuf
->
f
,
pBlockInfo
->
offset
,
SEEK_SET
);
int32_t
ret
=
fseek
(
pTSBuf
->
f
,
pBlockInfo
->
offset
,
SEEK_SET
);
UNUSED
(
ret
);
if
(
ret
==
-
1
)
{
qError
(
"fseek failed, errno:%d"
,
errno
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
size_t
sz
=
fwrite
((
void
*
)
pData
,
1
,
len
,
pTSBuf
->
f
);
size_t
sz
=
fwrite
((
void
*
)
pData
,
1
,
len
,
pTSBuf
->
f
);
UNUSED
(
sz
);
if
(
sz
!=
len
)
{
qError
(
"ts data fwrite failed, write size:%d, expected size:%d"
,
(
int32_t
)
sz
,
len
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
pTSBuf
->
fileSize
+=
len
;
pTSBuf
->
fileSize
+=
len
;
pTSBuf
->
tsOrder
=
order
;
pTSBuf
->
tsOrder
=
order
;
...
@@ -866,9 +880,16 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
...
@@ -866,9 +880,16 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
STSBufFileHeader
header
=
{
STSBufFileHeader
header
=
{
.
magic
=
TS_COMP_FILE_MAGIC
,
.
numOfGroup
=
pTSBuf
->
numOfGroups
,
.
tsOrder
=
pTSBuf
->
tsOrder
};
.
magic
=
TS_COMP_FILE_MAGIC
,
.
numOfGroup
=
pTSBuf
->
numOfGroups
,
.
tsOrder
=
pTSBuf
->
tsOrder
};
STSBufUpdateHeader
(
pTSBuf
,
&
header
);
if
(
STSBufUpdateHeader
(
pTSBuf
,
&
header
)
<
0
)
{
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
fsync
(
fileno
(
pTSBuf
->
f
));
if
(
fsync
(
fileno
(
pTSBuf
->
f
))
==
-
1
)
{
qError
(
"fsync failed, errno:%d"
,
errno
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
return
pTSBuf
;
return
pTSBuf
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录