Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2e258a89
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
2e258a89
编写于
6月 24, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'hotfix/tmq' of
https://github.com/taosdata/TDengine
into hotfix/tmq
上级
58a5b9f3
5cadc824
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
75 addition
and
20 deletion
+75
-20
cmake/env.inc
cmake/env.inc
+1
-1
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+2
-1
src/client/tests/timeParseTest.cpp
src/client/tests/timeParseTest.cpp
+2
-2
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+6
-0
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+6
-3
src/os/inc/osDef.h
src/os/inc/osDef.h
+2
-3
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/query/tests/astTest.cpp
src/query/tests/astTest.cpp
+1
-0
src/query/tests/histogramTest.cpp
src/query/tests/histogramTest.cpp
+4
-0
src/query/tests/patternMatchTest.cpp
src/query/tests/patternMatchTest.cpp
+3
-0
src/query/tests/percentileTest.cpp
src/query/tests/percentileTest.cpp
+3
-0
src/query/tests/resultBufferTest.cpp
src/query/tests/resultBufferTest.cpp
+3
-0
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+4
-0
src/query/tests/unitTest.cpp
src/query/tests/unitTest.cpp
+6
-3
未找到文件。
cmake/env.inc
浏览文件 @
2e258a89
...
...
@@ -39,7 +39,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMMON_C_FLAGS} ${DEBUG_FLAGS}
SET
(
CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${COMMON_C_FLAGS} ${RELEASE_FLAGS}"
)
# Set c++ compiler options
SET
(
COMMON_CXX_FLAGS
"${COMMON_FLAGS} -std=c++11"
)
SET
(
COMMON_CXX_FLAGS
"${COMMON_FLAGS} -std=c++11
-Wno-unused-function
"
)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS} ${DEBUG_FLAGS}"
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS} ${RELEASE_FLAGS}"
)
...
...
src/client/src/tscSystem.c
浏览文件 @
2e258a89
...
...
@@ -45,6 +45,7 @@ int32_t tscNumOfObj = 0; // number of sqlObj in current process.
static
void
*
tscCheckDiskUsageTmr
;
void
*
tscRpcCache
;
// cache to keep rpc obj
int32_t
tscNumOfThreads
=
1
;
// num of rpc threads
char
tscLogFileName
[
12
]
=
"taoslog"
;
static
pthread_mutex_t
rpcObjMutex
;
// mutex to protect open the rpc obj concurrently
static
pthread_once_t
tscinit
=
PTHREAD_ONCE_INIT
;
static
volatile
int
tscInitRes
=
0
;
...
...
@@ -132,7 +133,7 @@ void taos_init_imp(void) {
printf
(
"failed to create log dir:%s
\n
"
,
tsLogDir
);
}
sprintf
(
temp
,
"%s/
taoslog"
,
tsLogDir
);
sprintf
(
temp
,
"%s/
%s"
,
tsLogDir
,
tscLogFileName
);
if
(
taosInitLog
(
temp
,
tsNumOfLogLines
,
10
)
<
0
)
{
printf
(
"failed to open log file in directory:%s
\n
"
,
tsLogDir
);
}
...
...
src/client/tests/timeParseTest.cpp
浏览文件 @
2e258a89
...
...
@@ -98,7 +98,7 @@ TEST(testCase, parse_time) {
taosParseTime
(
t41
,
&
time
,
strlen
(
t41
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
852048000999
);
int64_t
k
=
timezone
;
//
int64_t k = timezone;
char
t42
[]
=
"1997-1-1T0:0:0.999999999Z"
;
taosParseTime
(
t42
,
&
time
,
strlen
(
t42
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
852048000999
-
timezone
*
MILLISECOND_PER_SECOND
);
...
...
@@ -163,7 +163,7 @@ TEST(testCase, parse_time) {
taosParseTime
(
t13
,
&
time
,
strlen
(
t13
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
-
28800
*
MILLISECOND_PER_SECOND
);
char
*
t
=
"2021-01-08T02:11:40.000+00:00"
;
char
t
[]
=
"2021-01-08T02:11:40.000+00:00"
;
taosParseTime
(
t
,
&
time
,
strlen
(
t
),
TSDB_TIME_PRECISION_MILLI
,
0
);
printf
(
"%ld
\n
"
,
time
);
}
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
2e258a89
...
...
@@ -6000,6 +6000,12 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
verbosePrint
(
"%s() LN%d: tid=%d seq=%"
PRId64
" tableName=%s
\n
"
,
__func__
,
__LINE__
,
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
;
char
*
pstr
=
pThreadInfo
->
buffer
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
2e258a89
...
...
@@ -1858,13 +1858,13 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
converStringToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
//pstr = stpcpy(pstr, tbuf);
//*(pstr++) = '\'';
pstr
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
curr_sqlstr_len
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
break
;
}
case
TSDB_DATA_TYPE_NCHAR
:
{
char
tbuf
[
COMMAND_SIZE
]
=
{
0
};
convertNCharToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
pstr
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
curr_sqlstr_len
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
break
;
}
case
TSDB_DATA_TYPE_TIMESTAMP
:
...
...
@@ -1897,7 +1897,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
total_sqlstr_len
+=
curr_sqlstr_len
;
if
((
count
>=
arguments
->
data_batch
)
||
(
sql_buf_len
-
total_sqlstr_len
<
TSDB_MAX_BYTES_PER_ROW
))
{
if
((
count
>=
arguments
->
data_batch
)
||
(
sql_buf_len
-
total_sqlstr_len
<
TSDB_MAX_BYTES_PER_ROW
))
{
fprintf
(
fp
,
";
\n
"
);
count
=
0
;
}
//else {
...
...
@@ -1905,6 +1906,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
//}
}
printf
(
"total_sqlstr_len: %d
\n
"
,
total_sqlstr_len
);
fprintf
(
fp
,
"
\n
"
);
atomic_add_fetch_64
(
&
totalDumpOutRows
,
totalRows
);
...
...
src/os/inc/osDef.h
浏览文件 @
2e258a89
...
...
@@ -40,10 +40,9 @@ extern "C" {
#define ASSERT(x)
#endif
#ifdef UNUSED
#undefine UNUSED
#endif
#ifndef UNUSED
#define UNUSED(x) ((void)(x))
#endif
#ifdef UNUSED_FUNC
#undefine UNUSED_FUNC
...
...
src/query/src/qExecutor.c
浏览文件 @
2e258a89
...
...
@@ -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
char
*
tsBlock
=
(
char
*
)
pQueryMsg
+
pQueryMsg
->
tsOffset
;
pTsBuf
=
tsBufCreateFromCompBlocks
(
tsBlock
,
pQueryMsg
->
tsNumOfBlocks
,
pQueryMsg
->
tsLen
,
pQueryMsg
->
tsOrder
,
vgId
);
if
(
pTsBuf
==
NULL
)
{
code
=
TSDB_CODE_QRY_NO_DISKSPACE
;
goto
_error
;
}
tsBufResetPos
(
pTsBuf
);
bool
ret
=
tsBufNextPos
(
pTsBuf
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
2e258a89
...
...
@@ -2,6 +2,7 @@
#include "taoserror.h"
#include "tscompression.h"
#include "tutil.h"
#include "queryLog.h"
static
int32_t
getDataStartOffset
();
static
void
TSBufUpdateGroupInfo
(
STSBuf
*
pTSBuf
,
int32_t
index
,
STSGroupBlockInfo
*
pBlockInfo
);
...
...
@@ -633,10 +634,15 @@ int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) {
int32_t
r
=
fseek
(
pTSBuf
->
f
,
0
,
SEEK_SET
);
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
;
}
fwrite
(
pHeader
,
sizeof
(
STSBufFileHeader
),
1
,
pTSBuf
->
f
);
return
0
;
}
...
...
@@ -856,9 +862,17 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
TSBufUpdateGroupInfo
(
pTSBuf
,
pTSBuf
->
numOfGroups
-
1
,
pBlockInfo
);
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
);
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
->
tsOrder
=
order
;
...
...
@@ -866,9 +880,16 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
STSBufFileHeader
header
=
{
.
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
;
}
...
...
src/query/tests/astTest.cpp
浏览文件 @
2e258a89
...
...
@@ -10,6 +10,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-function"
typedef
struct
ResultObj
{
int32_t
numOfResult
;
...
...
src/query/tests/histogramTest.cpp
浏览文件 @
2e258a89
...
...
@@ -5,6 +5,10 @@
#include "taos.h"
#include "qHistogram.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
void
doHistogramAddTest
()
{
SHistogramInfo
*
pHisto
=
NULL
;
...
...
src/query/tests/patternMatchTest.cpp
浏览文件 @
2e258a89
...
...
@@ -6,6 +6,9 @@
#include "qAggMain.h"
#include "tcompare.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
TEST
(
testCase
,
patternMatchTest
)
{
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
...
...
src/query/tests/percentileTest.cpp
浏览文件 @
2e258a89
...
...
@@ -7,6 +7,9 @@
#include "qPercentile.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
tMemBucket
*
createBigIntDataBucket
(
int32_t
start
,
int32_t
end
)
{
tMemBucket
*
pBucket
=
tMemBucketCreate
(
sizeof
(
int64_t
),
TSDB_DATA_TYPE_BIGINT
,
start
,
end
);
...
...
src/query/tests/resultBufferTest.cpp
浏览文件 @
2e258a89
...
...
@@ -6,6 +6,9 @@
#include "taos.h"
#include "tsdb.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
// simple test
void
simpleTest
()
{
...
...
src/query/tests/tsBufTest.cpp
浏览文件 @
2e258a89
...
...
@@ -9,6 +9,10 @@
#include "ttoken.h"
#include "tutil.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
namespace
{
/**
*
...
...
src/query/tests/unitTest.cpp
浏览文件 @
2e258a89
...
...
@@ -6,14 +6,17 @@
#include "taos.h"
#include "tsdb.h"
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#include "../../client/inc/tscUtil.h"
#include "tutil.h"
#include "tvariant.h"
#include "ttokendef.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
namespace
{
int32_t
testValidateName
(
char
*
name
)
{
SStrToken
token
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录