Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1f52dfb9
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看板
提交
1f52dfb9
编写于
8月 27, 2021
作者:
wmmhello
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into test/TD-6167
上级
5feb4106
86b93ad1
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
86 addition
and
26 deletion
+86
-26
Jenkinsfile
Jenkinsfile
+6
-6
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-0
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+5
-5
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+4
-3
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+16
-3
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+13
-1
src/query/src/qPercentile.c
src/query/src/qPercentile.c
+12
-4
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+15
-1
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+1
-1
tests/script/general/parser/function.sim
tests/script/general/parser/function.sim
+11
-0
未找到文件。
Jenkinsfile
浏览文件 @
1f52dfb9
...
...
@@ -265,12 +265,12 @@ pipeline {
}
}
timeout
(
time:
60
,
unit:
'MINUTES'
){
sh
'''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
'''
//
sh '''
//
cd ${WKC}/tests/pytest
//
rm -rf /var/lib/taos/*
//
rm -rf /var/log/taos/*
//
./handle_crash_gen_val_log.sh
//
'''
sh
'''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
...
...
src/client/src/tscParseInsert.c
浏览文件 @
1f52dfb9
...
...
@@ -1778,6 +1778,7 @@ static void parseFileSendDataBlock(void *param, TAOS_RES *tres, int32_t numOfRow
}
_error:
pParentSql
->
res
.
code
=
code
;
tfree
(
tokenBuf
);
tfree
(
line
);
taos_free_result
(
pSql
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
1f52dfb9
...
...
@@ -2609,6 +2609,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
SColumnIndex
indexTS
=
{.
tableIndex
=
index
.
tableIndex
,
.
columnIndex
=
0
};
SExprInfo
*
pExpr
=
tscExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS_DUMMY
,
&
indexTS
,
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_KEYSIZE
,
getNewResColId
(
pCmd
),
TSDB_KEYSIZE
,
false
);
tstrncpy
(
pExpr
->
base
.
aliasName
,
aAggs
[
TSDB_FUNC_TS_DUMMY
].
name
,
sizeof
(
pExpr
->
base
.
aliasName
));
SColumnList
ids
=
createColumnList
(
1
,
0
,
0
);
insertResultField
(
pQueryInfo
,
colIndex
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS_DUMMY
].
name
,
pExpr
);
...
...
@@ -8449,6 +8450,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
pSub
->
udfCopy
=
true
;
pSub
->
pDownstream
=
pQueryInfo
;
taosArrayPush
(
pQueryInfo
->
pUpstream
,
&
pSub
);
int32_t
code
=
validateSqlNode
(
pSql
,
p
,
pSub
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
...
...
@@ -8472,8 +8474,6 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
tstrncpy
(
pTableMetaInfo1
->
aliasName
,
subInfo
->
aliasName
.
z
,
subInfo
->
aliasName
.
n
+
1
);
}
taosArrayPush
(
pQueryInfo
->
pUpstream
,
&
pSub
);
// NOTE: order mix up in subquery not support yet.
pQueryInfo
->
order
=
pSub
->
order
;
...
...
src/common/src/tglobal.c
浏览文件 @
1f52dfb9
...
...
@@ -84,7 +84,7 @@ int8_t tsTscEnableRecordSql = 0;
// the maximum number of results for projection query on super table that are returned from
// one virtual node, to order according to timestamp
int32_t
tsMaxNumOfOrderedResults
=
100000
;
int32_t
tsMaxNumOfOrderedResults
=
100000
0
;
// 10 ms for sliding time, the value will changed in case of time precision changed
int32_t
tsMinSlidingTime
=
10
;
...
...
@@ -1017,8 +1017,8 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsMaxNumOfOrderedResults
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
TSDB_MAX_SQL_LEN
;
cfg
.
maxValue
=
TSDB_MAX_ALLOWED_SQL_LEN
;
cfg
.
minValue
=
100000
;
cfg
.
maxValue
=
100000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
@@ -1217,10 +1217,10 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"topicBi
an
ryLen"
;
cfg
.
option
=
"topicBi
na
ryLen"
;
cfg
.
ptr
=
&
tsTopicBianryLen
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
16
;
cfg
.
maxValue
=
16000
;
cfg
.
ptrLength
=
0
;
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
1f52dfb9
...
...
@@ -102,7 +102,7 @@ extern char configDir[];
#define NOTE_BUFF_LEN (SMALL_BUFF_LEN*16)
#define DEFAULT_TIMESTAMP_STEP 1
#define DEFAULT_CHILDTABLES 10000
enum
TEST_MODE
{
INSERT_TEST
,
// 0
...
...
@@ -625,7 +625,7 @@ SArguments g_args = {
0
,
// interlace_rows;
30000
,
// num_of_RPR
(
1024
*
1024
),
// max_sql_len
10000
,
// num_of_tables
DEFAULT_CHILDTABLES
,
// num_of_tables
10000
,
// num_of_DPT
0
,
// abort
0
,
// disorderRatio
...
...
@@ -639,7 +639,7 @@ SArguments g_args = {
static
SDbs
g_Dbs
;
static
int64_t
g_totalChildTables
=
0
;
static
int64_t
g_totalChildTables
=
DEFAULT_CHILDTABLES
;
static
int64_t
g_actualChildTables
=
0
;
static
SQueryMetaInfo
g_queryInfo
;
static
FILE
*
g_fpOfInsertResult
=
NULL
;
...
...
@@ -9154,6 +9154,7 @@ int main(int argc, char *argv[]) {
debugPrint
(
"meta file: %s
\n
"
,
g_args
.
metaFile
);
if
(
g_args
.
metaFile
)
{
g_totalChildTables
=
0
;
initOfInsertMeta
();
initOfQueryMeta
();
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
1f52dfb9
...
...
@@ -232,9 +232,9 @@ static struct argp_option options[] = {
{
"inpath"
,
'i'
,
"INPATH"
,
0
,
"Input file path."
,
1
},
{
"resultFile"
,
'r'
,
"RESULTFILE"
,
0
,
"DumpOut/In Result file path and name."
,
1
},
#ifdef _TD_POWER_
{
"config"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/power/taos.cfg."
,
1
},
{
"config
-dir
"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/power/taos.cfg."
,
1
},
#else
{
"config"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/taos/taos.cfg."
,
1
},
{
"config
-dir
"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/taos/taos.cfg."
,
1
},
#endif
{
"encode"
,
'e'
,
"ENCODE"
,
0
,
"Input file encoding."
,
1
},
// dump unit options
...
...
@@ -370,6 +370,15 @@ struct arguments g_args = {
false
// performance_print
};
static
void
errorPrintReqArg3
(
char
*
program
,
char
*
wrong_arg
)
{
fprintf
(
stderr
,
"%s: option '%s' requires an argument
\n
"
,
program
,
wrong_arg
);
fprintf
(
stderr
,
"Try `taosdump --help' or `taosdump --usage' for more information.
\n
"
);
}
/* Parse a single option. */
static
error_t
parse_opt
(
int
key
,
char
*
arg
,
struct
argp_state
*
state
)
{
/* Get the input argument from argp_parse, which we
...
...
@@ -430,9 +439,13 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
g_args
.
resultFile
=
arg
;
break
;
case
'c'
:
if
(
0
==
strlen
(
arg
))
{
errorPrintReqArg3
(
"taosdump"
,
"-c or --config-dir"
);
exit
(
EXIT_FAILURE
);
}
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
errorPrint
(
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
exit
(
EXIT_FAILURE
)
;
}
tstrncpy
(
configDir
,
full_path
.
we_wordv
[
0
],
MAX_FILE_NAME_LEN
);
wordfree
(
&
full_path
);
...
...
src/query/src/qAggMain.c
浏览文件 @
1f52dfb9
...
...
@@ -4032,11 +4032,23 @@ static void irate_function(SQLFunctionCtx *pCtx) {
double
v
=
0
;
GET_TYPED_DATA
(
v
,
double
,
pCtx
->
inputType
,
pData
);
if
(
(
INT64_MIN
==
pRateInfo
->
lastKey
)
||
primaryKey
[
i
]
>
pRateInfo
->
lastKey
)
{
if
(
INT64_MIN
==
pRateInfo
->
lastKey
)
{
pRateInfo
->
lastValue
=
v
;
pRateInfo
->
lastKey
=
primaryKey
[
i
];
continue
;
}
if
(
primaryKey
[
i
]
>
pRateInfo
->
lastKey
)
{
if
((
INT64_MIN
==
pRateInfo
->
firstKey
)
||
pRateInfo
->
lastKey
>
pRateInfo
->
firstKey
)
{
pRateInfo
->
firstValue
=
pRateInfo
->
lastValue
;
pRateInfo
->
firstKey
=
pRateInfo
->
lastKey
;
}
pRateInfo
->
lastValue
=
v
;
pRateInfo
->
lastKey
=
primaryKey
[
i
];
continue
;
}
if
((
INT64_MIN
==
pRateInfo
->
firstKey
)
||
primaryKey
[
i
]
>
pRateInfo
->
firstKey
)
{
pRateInfo
->
firstValue
=
v
;
...
...
src/query/src/qPercentile.c
浏览文件 @
1f52dfb9
...
...
@@ -67,10 +67,18 @@ static int32_t setBoundingBox(MinMaxEntry* range, int16_t type, double minval, d
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
))
{
range
->
i64MinVal
=
(
int64_t
)
minval
;
range
->
i64MaxVal
=
(
int64_t
)
maxval
;
if
(
maxval
>
INT64_MAX
||
(
int64_t
)
maxval
==
INT64_MIN
)
{
range
->
i64MaxVal
=
INT64_MAX
;
}
else
{
range
->
i64MaxVal
=
(
int64_t
)
maxval
;
}
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
type
)){
range
->
u64MinVal
=
(
uint64_t
)
minval
;
range
->
u64MaxVal
=
(
uint64_t
)
maxval
;
if
((
uint64_t
)
maxval
>
UINT64_MAX
)
{
range
->
u64MaxVal
=
UINT64_MAX
;
}
else
{
range
->
u64MaxVal
=
(
uint64_t
)
maxval
;
}
}
else
{
range
->
dMinVal
=
minval
;
range
->
dMaxVal
=
maxval
;
...
...
@@ -127,8 +135,8 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) {
index
=
(
delta
%
pBucket
->
numOfSlots
);
}
else
{
double
slotSpan
=
(
double
)
span
/
pBucket
->
numOfSlots
;
index
=
(
int32_t
)((
v
-
pBucket
->
range
.
i64MinVal
)
/
slotSpan
);
if
(
v
==
pBucket
->
range
.
i64MaxVal
)
{
index
=
(
int32_t
)((
(
double
)
v
-
pBucket
->
range
.
i64MinVal
)
/
slotSpan
);
if
(
index
==
pBucket
->
numOfSlots
)
{
index
-=
1
;
}
}
...
...
src/query/src/qTsbuf.c
浏览文件 @
1f52dfb9
...
...
@@ -375,6 +375,16 @@ STSBlock* readDataFromDisk(STSBuf* pTSBuf, int32_t order, bool decomp) {
sz
=
fread
(
pBlock
->
payload
,
(
size_t
)
pBlock
->
compLen
,
1
,
pTSBuf
->
f
);
if
(
decomp
)
{
if
(
pBlock
->
numOfElem
*
TSDB_KEYSIZE
>
pTSBuf
->
tsData
.
allocSize
)
{
pTSBuf
->
tsData
.
rawBuf
=
realloc
(
pTSBuf
->
tsData
.
rawBuf
,
pBlock
->
numOfElem
*
TSDB_KEYSIZE
);
pTSBuf
->
tsData
.
allocSize
=
pBlock
->
numOfElem
*
TSDB_KEYSIZE
;
}
if
(
pBlock
->
numOfElem
*
TSDB_KEYSIZE
>
pTSBuf
->
bufSize
)
{
pTSBuf
->
assistBuf
=
realloc
(
pTSBuf
->
assistBuf
,
pBlock
->
numOfElem
*
TSDB_KEYSIZE
);
pTSBuf
->
bufSize
=
pBlock
->
numOfElem
*
TSDB_KEYSIZE
;
}
pTSBuf
->
tsData
.
len
=
tsDecompressTimestamp
(
pBlock
->
payload
,
pBlock
->
compLen
,
pBlock
->
numOfElem
,
pTSBuf
->
tsData
.
rawBuf
,
pTSBuf
->
tsData
.
allocSize
,
TWO_STAGE_COMP
,
pTSBuf
->
assistBuf
,
pTSBuf
->
bufSize
);
...
...
@@ -471,7 +481,7 @@ void tsBufAppend(STSBuf* pTSBuf, int32_t id, tVariant* tag, const char* pData, i
// the size of raw data exceeds the size of the default prepared buffer, so
// during getBufBlock, the output buffer needs to be large enough.
if
(
ptsData
->
len
>=
ptsData
->
threshold
)
{
if
(
ptsData
->
len
>=
ptsData
->
threshold
-
TSDB_KEYSIZE
)
{
writeDataToDisk
(
pTSBuf
);
shrinkBuffer
(
ptsData
);
}
...
...
@@ -603,6 +613,10 @@ static void tsBufGetBlock(STSBuf* pTSBuf, int32_t groupIndex, int32_t blockIndex
expandBuffer
(
&
pTSBuf
->
tsData
,
(
int32_t
)
s
);
}
if
(
s
>
pTSBuf
->
bufSize
)
{
pTSBuf
->
assistBuf
=
realloc
(
pTSBuf
->
assistBuf
,
s
);
pTSBuf
->
bufSize
=
(
int32_t
)
s
;
}
pTSBuf
->
tsData
.
len
=
tsDecompressTimestamp
(
pBlock
->
payload
,
pBlock
->
compLen
,
pBlock
->
numOfElem
,
pTSBuf
->
tsData
.
rawBuf
,
pTSBuf
->
tsData
.
allocSize
,
TWO_STAGE_COMP
,
pTSBuf
->
assistBuf
,
pTSBuf
->
bufSize
);
...
...
tests/pytest/util/dnodes.py
浏览文件 @
1f52dfb9
...
...
@@ -125,7 +125,7 @@ class TDDnode:
"charset"
:
"UTF-8"
,
"asyncLog"
:
"0"
,
"anyIp"
:
"0"
,
"t
sEnableT
elemetryReporting"
:
"0"
,
"telemetryReporting"
:
"0"
,
"dDebugFlag"
:
"135"
,
"tsdbDebugFlag"
:
"135"
,
"mDebugFlag"
:
"135"
,
...
...
tests/script/general/parser/function.sim
浏览文件 @
1f52dfb9
...
...
@@ -941,6 +941,17 @@ if $data32 != 0.000144445 then
return -1
endi
sql insert into t1 values('2015-09-18 00:30:00', 3.0);
sql select irate(k) from t1
if $rows != 1 then
return -1
endi
if $data00 != 0.000000354 then
return -1
endi
print ===========================> derivative
sql drop table t1
sql drop table tx;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录