Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
51b44687
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
51b44687
编写于
2月 05, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/linux
上级
e14f0fde
fdb56520
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
23 deletion
+69
-23
Jenkinsfile
Jenkinsfile
+27
-6
documentation20/webdocs/markdowndocs/TAOS SQL-ch.md
documentation20/webdocs/markdowndocs/TAOS SQL-ch.md
+2
-2
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+16
-0
src/inc/taoserror.h
src/inc/taoserror.h
+1
-1
src/plugins/http/src/httpResp.c
src/plugins/http/src/httpResp.c
+1
-1
src/plugins/http/src/httpRestHandle.c
src/plugins/http/src/httpRestHandle.c
+1
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+18
-9
tests/pytest/insert/before_1970.py
tests/pytest/insert/before_1970.py
+3
-3
未找到文件。
Jenkinsfile
浏览文件 @
51b44687
...
...
@@ -5,7 +5,7 @@ node {
git
url:
'https://github.com/taosdata/TDengine.git'
}
def
kipstage
=
0
def
abortPreviousBuilds
()
{
def
currentJobName
=
env
.
JOB_NAME
def
currentBuildNumber
=
env
.
BUILD_NUMBER
.
toInteger
()
...
...
@@ -63,6 +63,7 @@ def pre_test(){
'''
return
1
}
pipeline
{
agent
none
...
...
@@ -72,12 +73,33 @@ pipeline {
}
stages
{
stage
(
'pre_build'
){
agent
{
label
'master'
}
when
{
changeRequest
()
}
steps
{
sh
'''
cd ${WORKSPACE}
git checkout develop
git pull
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
'''
script
{
skipstage
=
sh
(
script:
"git --no-pager diff --name-only FETCH_HEAD develop|grep -v -E '.*md|//src//connector|Jenkinsfile|test-all.sh' || echo 1 "
,
returnStdout:
true
)
}
}
}
stage
(
'Parallel test stage'
)
{
//only build pr
when
{
changeRequest
()
expression
{
skipstage
!=
1
}
}
parallel
{
stage
(
'python_1_s1'
)
{
...
...
@@ -127,7 +149,7 @@ pipeline {
stage
(
'test_b1_s2'
)
{
agent
{
label
'b1'
}
steps
{
timeout
(
time:
90
,
unit:
'MINUTES'
){
timeout
(
time:
45
,
unit:
'MINUTES'
){
pre_test
()
sh
'''
cd ${WKC}/tests
...
...
@@ -240,8 +262,7 @@ pipeline {
}
}
}
post
{
post
{
success
{
emailext
(
subject:
"PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS"
,
...
...
@@ -300,7 +321,7 @@ pipeline {
<ul>
<div style="font-size:18px">
<li>构建名称>>分支:${env.BRANCH_NAME}</li>
<li>构建结果:<span style="color:
green"> Successful
</span></li>
<li>构建结果:<span style="color:
red"> Failure
</span></li>
<li>构建编号:${BUILD_NUMBER}</li>
<li>触发用户:${env.CHANGE_AUTHOR}</li>
<li>提交信息:${env.CHANGE_TITLE}</li>
...
...
documentation20/webdocs/markdowndocs/TAOS SQL-ch.md
浏览文件 @
51b44687
...
...
@@ -290,7 +290,7 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic
-
**修改子表标签值**
```mysql
ALTER
S
TABLE tb_name SET TAG tag_name=new_tag_value;
ALTER TABLE tb_name SET TAG tag_name=new_tag_value;
```
说明:除了更新标签的值的操作是针对子表进行,其他所有的标签操作(添加标签、删除标签等)均只能作用于 STable,不能对单个子表操作。对 STable 添加标签以后,依托于该 STable 建立的所有表将自动增加了一个标签,所有新增标签的默认值都是 NULL。
...
...
@@ -757,7 +757,7 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
应用字段:不能应用在timestamp、binary、nchar、bool类型字段。
适用于:表。(从 2.0.15 版本开始,本函数也支持超级表)
适用于:表。(从 2.0.15
.1
版本开始,本函数也支持超级表)
示例:
```mysql
...
...
src/common/inc/tdataformat.h
浏览文件 @
51b44687
...
...
@@ -134,6 +134,22 @@ typedef uint64_t TKEY;
#define tdGetTKEY(key) (((TKEY)ABS(key)) | (TKEY_NEGATIVE_FLAG & (TKEY)(key)))
#define tdGetKey(tkey) (((TSKEY)((tkey)&TKEY_VALUE_FILTER)) * (TKEY_IS_NEGATIVE(tkey) ? -1 : 1))
#define MIN_TS_KEY ((TSKEY)0x8000000000000001)
#define MAX_TS_KEY ((TSKEY)0x3fffffffffffffff)
#define TD_TO_TKEY(key) tdGetTKEY(((key) < MIN_TS_KEY) ? MIN_TS_KEY : (((key) > MAX_TS_KEY) ? MAX_TS_KEY : key))
static
FORCE_INLINE
TKEY
keyToTkey
(
TSKEY
key
)
{
TSKEY
lkey
=
key
;
if
(
key
>
MAX_TS_KEY
)
{
lkey
=
MAX_TS_KEY
;
}
else
if
(
key
<
MIN_TS_KEY
)
{
lkey
=
MIN_TS_KEY
;
}
return
tdGetTKEY
(
lkey
);
}
static
FORCE_INLINE
int
tkeyComparFn
(
const
void
*
tkey1
,
const
void
*
tkey2
)
{
TSKEY
key1
=
tdGetKey
(
*
(
TKEY
*
)
tkey1
);
TSKEY
key2
=
tdGetKey
(
*
(
TKEY
*
)
tkey2
);
...
...
src/inc/taoserror.h
浏览文件 @
51b44687
...
...
@@ -296,7 +296,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_WAL_SIZE_LIMIT, 0, 0x1002, "WAL size e
// http
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_SERVER_OFFLINE
,
0
,
0x1100
,
"http server is not onlin"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_UNSUPPORT_URL
,
0
,
0x1101
,
"url is not support"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_INV
L
ALID_URL
,
0
,
0x1102
,
"invalid url format"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_INVALID_URL
,
0
,
0x1102
,
"invalid url format"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_NO_ENOUGH_MEMORY
,
0
,
0x1103
,
"no enough memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_REQUSET_TOO_BIG
,
0
,
0x1104
,
"request size is too big"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_NO_AUTH_INFO
,
0
,
0x1105
,
"no auth info input"
)
...
...
src/plugins/http/src/httpResp.c
浏览文件 @
51b44687
...
...
@@ -74,7 +74,7 @@ void httpSendErrorResp(HttpContext *pContext, int32_t errNo) {
httpCode
=
404
;
else
if
(
errNo
==
TSDB_CODE_HTTP_UNSUPPORT_URL
)
httpCode
=
404
;
else
if
(
errNo
==
TSDB_CODE_HTTP_INV
L
ALID_URL
)
else
if
(
errNo
==
TSDB_CODE_HTTP_INVALID_URL
)
httpCode
=
404
;
else
if
(
errNo
==
TSDB_CODE_HTTP_NO_ENOUGH_MEMORY
)
httpCode
=
507
;
...
...
src/plugins/http/src/httpRestHandle.c
浏览文件 @
51b44687
...
...
@@ -141,6 +141,6 @@ bool restProcessRequest(struct HttpContext* pContext) {
}
else
{
}
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_INV
L
ALID_URL
);
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_INVALID_URL
);
return
false
;
}
src/tsdb/src/tsdbRead.c
浏览文件 @
51b44687
...
...
@@ -317,7 +317,7 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(STsdbRepo* tsdb, STsdbQueryCond* pC
pQueryHandle
->
window
=
pCond
->
twindow
;
pQueryHandle
->
pTsdb
=
tsdb
;
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_ALL
;
pQueryHandle
->
cur
.
fid
=
-
1
;
pQueryHandle
->
cur
.
fid
=
INT32_MIN
;
pQueryHandle
->
cur
.
win
=
TSWINDOW_INITIALIZER
;
pQueryHandle
->
checkFiles
=
true
;
pQueryHandle
->
activeIndex
=
0
;
// current active table index
...
...
@@ -478,16 +478,18 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
if
(
pMemT
&&
pCheckInfo
->
tableId
.
tid
<
pMemT
->
maxTables
)
{
pMem
=
pMemT
->
tData
[
pCheckInfo
->
tableId
.
tid
];
if
(
pMem
!=
NULL
&&
pMem
->
uid
==
pCheckInfo
->
tableId
.
uid
)
{
// check uid
TKEY
tLastKey
=
keyToTkey
(
pCheckInfo
->
lastKey
);
pCheckInfo
->
iter
=
tSkipListCreateIterFromVal
(
pMem
->
pData
,
(
const
char
*
)
&
pCheckInfo
->
l
astKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
tSkipListCreateIterFromVal
(
pMem
->
pData
,
(
const
char
*
)
&
tL
astKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
}
}
if
(
pIMemT
&&
pCheckInfo
->
tableId
.
tid
<
pIMemT
->
maxTables
)
{
pIMem
=
pIMemT
->
tData
[
pCheckInfo
->
tableId
.
tid
];
if
(
pIMem
!=
NULL
&&
pIMem
->
uid
==
pCheckInfo
->
tableId
.
uid
)
{
// check uid
TKEY
tLastKey
=
keyToTkey
(
pCheckInfo
->
lastKey
);
pCheckInfo
->
iiter
=
tSkipListCreateIterFromVal
(
pIMem
->
pData
,
(
const
char
*
)
&
pCheckInfo
->
l
astKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
tSkipListCreateIterFromVal
(
pIMem
->
pData
,
(
const
char
*
)
&
tL
astKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
}
}
...
...
@@ -652,7 +654,7 @@ static bool hasMoreDataInCache(STsdbQueryHandle* pHandle) {
STsdbCfg
*
pCfg
=
&
pHandle
->
pTsdb
->
config
;
size_t
size
=
taosArrayGetSize
(
pHandle
->
pTableCheckInfo
);
assert
(
pHandle
->
activeIndex
<
size
&&
pHandle
->
activeIndex
>=
0
&&
size
>=
1
);
pHandle
->
cur
.
fid
=
-
1
;
pHandle
->
cur
.
fid
=
INT32_MIN
;
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pHandle
->
pTableCheckInfo
,
pHandle
->
activeIndex
);
...
...
@@ -1117,7 +1119,12 @@ int32_t doCopyRowsFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t capacity
if
(
pColInfo
->
info
.
colId
==
src
->
colId
)
{
if
(
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
for
(
int32_t
n
=
0
;
n
<
num
;
n
++
)
{
TKEY
tkey
=
*
(
TKEY
*
)((
char
*
)
src
->
pData
+
bytes
*
start
+
n
*
sizeof
(
TKEY
));
*
(
TSKEY
*
)(
pData
+
n
*
sizeof
(
TSKEY
))
=
tdGetKey
(
tkey
);
}
}
else
if
(
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
memmove
(
pData
,
(
char
*
)
src
->
pData
+
bytes
*
start
,
bytes
*
num
);
}
else
{
// handle the var-string
char
*
dst
=
pData
;
...
...
@@ -1225,7 +1232,6 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_TIMESTAMP
:
*
(
uint64_t
*
)
pData
=
*
(
uint64_t
*
)
value
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
...
...
@@ -1234,6 +1240,9 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
case
TSDB_DATA_TYPE_DOUBLE
:
SET_DOUBLE_PTR
(
pData
,
value
);
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
*
(
TSKEY
*
)
pData
=
tdGetKey
(
*
(
TKEY
*
)
value
);
break
;
default:
memcpy
(
pData
,
value
,
pColInfo
->
info
.
bytes
);
}
...
...
@@ -1893,7 +1902,7 @@ static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exist
assert
(
pQueryHandle
->
pFileGroup
==
NULL
);
}
cur
->
fid
=
-
1
;
// denote that there are no data in file anymore
cur
->
fid
=
INT32_MIN
;
// denote that there are no data in file anymore
*
exists
=
false
;
return
code
;
}
...
...
@@ -2496,7 +2505,7 @@ void tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle, SDataBlockInfo* p
STable
*
pTable
=
NULL
;
// there are data in file
if
(
pHandle
->
cur
.
fid
>=
0
)
{
if
(
pHandle
->
cur
.
fid
!=
INT32_MIN
)
{
STableBlockInfo
*
pBlockInfo
=
&
pHandle
->
pDataBlockInfo
[
cur
->
slot
];
pTable
=
pBlockInfo
->
pTableCheckInfo
->
pTableObj
;
}
else
{
...
...
@@ -2580,7 +2589,7 @@ SArray* tsdbRetrieveDataBlock(TsdbQueryHandleT* pQueryHandle, SArray* pIdList) {
*/
STsdbQueryHandle
*
pHandle
=
(
STsdbQueryHandle
*
)
pQueryHandle
;
if
(
pHandle
->
cur
.
fid
<
0
)
{
if
(
pHandle
->
cur
.
fid
==
INT32_MIN
)
{
return
pHandle
->
pColumns
;
}
else
{
STableBlockInfo
*
pBlockInfo
=
&
pHandle
->
pDataBlockInfo
[
pHandle
->
cur
.
slot
];
...
...
tests/pytest/insert/before_1970.py
浏览文件 @
51b44687
...
...
@@ -41,7 +41,7 @@ class TDTestCase:
#TODO : should add more testcases
tdSql
.
execute
(
"insert into test values('1930-12-12 01:19:20.345', 1);"
)
tdSql
.
execute
(
"insert into test values('1969-12-30 23:59:59.999', 2);"
)
tdSql
.
execute
(
"insert into test values(-3600, 3);"
)
tdSql
.
execute
(
"insert into test values(-3600
001
, 3);"
)
tdSql
.
execute
(
"insert into test values('2020-10-20 14:02:53.770', 4);"
)
print
(
"==============insert data"
)
...
...
@@ -61,11 +61,11 @@ class TDTestCase:
print
(
"==============step4"
)
tdSql
.
execute
(
"use demo;"
)
tdSql
.
query
(
"select * from test;"
)
#
print(tdSql.queryResult)
print
(
tdSql
.
queryResult
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
'1930-12-12 01:19:20.345000'
)
tdSql
.
checkData
(
1
,
0
,
'1969-12-30 23:59:59.999000'
)
tdSql
.
checkData
(
2
,
0
,
'1970-01-01 0
7:00:00.000
000'
)
tdSql
.
checkData
(
2
,
0
,
'1970-01-01 0
6:59:59.999
000'
)
tdSql
.
checkData
(
3
,
0
,
'2020-10-20 14:02:53.770000'
)
print
(
"==============check data"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录