Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf3fffb1
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看板
提交
bf3fffb1
编写于
5月 10, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into hotfix/TD-4099
上级
a0020b15
598a72e9
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
105 addition
and
33 deletion
+105
-33
src/inc/taoserror.h
src/inc/taoserror.h
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+31
-23
src/vnode/src/vnodeSync.c
src/vnode/src/vnodeSync.c
+1
-2
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+8
-7
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/pytest/query/queryTsisNull.py
tests/pytest/query/queryTsisNull.py
+53
-0
tests/pytest/query/unionAllTest.py
tests/pytest/query/unionAllTest.py
+10
-0
未找到文件。
src/inc/taoserror.h
浏览文件 @
bf3fffb1
...
...
@@ -218,7 +218,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_VND_NOT_SYNCED TAOS_DEF_ERROR_CODE(0, 0x0511) //"Database suspended")
#define TSDB_CODE_VND_NO_WRITE_AUTH TAOS_DEF_ERROR_CODE(0, 0x0512) //"Database write operation denied")
#define TSDB_CODE_VND_IS_SYNCING TAOS_DEF_ERROR_CODE(0, 0x0513) //"Database is syncing")
#define TSDB_CODE_VND_INVALID_TSDB_STATE TAOS_DEF_ERROR_CODE(0, 0x051
3
) //"Invalid tsdb state")
#define TSDB_CODE_VND_INVALID_TSDB_STATE TAOS_DEF_ERROR_CODE(0, 0x051
4
) //"Invalid tsdb state")
// tsdb
#define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600) //"Invalid table ID")
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
bf3fffb1
...
...
@@ -771,48 +771,49 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
arguments
->
sqlFile
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-q"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-q need a number following!
\n
Query mode -- 0: SYNC, 1: ASYNC. Default is SYNC.
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
query_mode
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-T"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-T need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
num_of_threads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-i need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
insert_interval
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-qt"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
]))
||
(
atoi
(
argv
[
i
+
1
])
<=
0
))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-qt need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-qt need a
valid (>0)
number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
query_times
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-B"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-B need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
interlace_rows
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
if
((
argc
==
i
+
1
)
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-r need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
...
...
@@ -1072,7 +1073,7 @@ static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet) {
if
(
code
!=
0
)
{
if
(
!
quiet
)
{
debugPrint
(
"%s() LN%d - command: %s
\n
"
,
__func__
,
__LINE__
,
command
);
errorPrint
(
"Failed to
run
%s, reason: %s
\n
"
,
command
,
taos_errstr
(
res
));
errorPrint
(
"Failed to
execute
%s, reason: %s
\n
"
,
command
,
taos_errstr
(
res
));
}
taos_free_result
(
res
);
//taos_close(taos);
...
...
@@ -4040,9 +4041,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
gQueryTimes
=
cJSON_GetObjectItem
(
root
,
"query_times"
);
if
(
gQueryTimes
&&
gQueryTimes
->
type
==
cJSON_Number
)
{
if
(
gQueryTimes
->
valueint
<
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
__func__
,
__LINE__
);
if
(
gQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
,
gQueryTimes
->
valueint
);
goto
PARSE_OVER
;
}
g_args
.
query_times
=
gQueryTimes
->
valueint
;
...
...
@@ -4091,9 +4092,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
specifiedQueryTimes
=
cJSON_GetObjectItem
(
specifiedQuery
,
"query_times"
);
if
(
specifiedQueryTimes
&&
specifiedQueryTimes
->
type
==
cJSON_Number
)
{
if
(
specifiedQueryTimes
->
valueint
<
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
__func__
,
__LINE__
);
if
(
specifiedQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
,
specifiedQueryTimes
->
valueint
);
goto
PARSE_OVER
;
}
...
...
@@ -4235,9 +4236,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
superQueryTimes
=
cJSON_GetObjectItem
(
superQuery
,
"query_times"
);
if
(
superQueryTimes
&&
superQueryTimes
->
type
==
cJSON_Number
)
{
if
(
superQueryTimes
->
valueint
<
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
__func__
,
__LINE__
);
if
(
superQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
,
superQueryTimes
->
valueint
);
goto
PARSE_OVER
;
}
g_queryInfo
.
superQueryInfo
.
queryTimes
=
superQueryTimes
->
valueint
;
...
...
@@ -5200,6 +5201,13 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
startTs
=
taosGetTimestampMs
();
if
(
recOfBatch
==
0
)
{
errorPrint
(
"[%d] %s() LN%d try inserting records of batch is %"
PRIu64
"
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
,
recOfBatch
);
errorPrint
(
"%s
\n
"
,
"
\t
Please check if the batch or the buffer length is proper value!
\n
"
);
goto
free_of_interlace
;
}
int64_t
affectedRows
=
execInsert
(
pThreadInfo
,
buffer
,
recOfBatch
);
endTs
=
taosGetTimestampMs
();
...
...
src/vnode/src/vnodeSync.c
浏览文件 @
bf3fffb1
...
...
@@ -119,7 +119,6 @@ void vnodeConfirmForard(int32_t vgId, void *wparam, int32_t code) {
void
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
==
NULL
)
{
vError
(
"vgId:%d, vnode not found while confirm forward"
,
vgId
);
return
;
}
dnodeSendRpcVWriteRsp
(
pVnode
,
wparam
,
code
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
bf3fffb1
...
...
@@ -317,12 +317,13 @@ int32_t vnodeWriteToWQueue(void *vparam, void *wparam, int32_t qtype, void *rpar
void
vnodeFreeFromWQueue
(
void
*
vparam
,
SVWriteMsg
*
pWrite
)
{
SVnodeObj
*
pVnode
=
vparam
;
if
(
pVnode
)
{
int32_t
queued
=
atomic_sub_fetch_32
(
&
pVnode
->
queuedWMsg
,
1
);
int64_t
queuedSize
=
atomic_sub_fetch_64
(
&
pVnode
->
queuedWMsgSize
,
pWrite
->
pHead
.
len
);
vTrace
(
"vgId:%d, msg:%p, app:%p, free from vwqueue, queued:%d size:%"
PRId64
,
pVnode
->
vgId
,
pWrite
,
pWrite
->
rpcMsg
.
ahandle
,
queued
,
queuedSize
);
}
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
...
...
@@ -371,8 +372,8 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) {
taosMsleep
(
ms
);
return
0
;
}
else
{
void
*
unUsed
=
NULL
;
taosTmrReset
(
vnodeFlowCtrlMsgToWQueue
,
100
,
pWrite
,
tsDnodeTmr
,
&
unUsed
);
void
*
unUsed
TimerId
=
NULL
;
taosTmrReset
(
vnodeFlowCtrlMsgToWQueue
,
100
,
pWrite
,
tsDnodeTmr
,
&
unUsed
TimerId
);
vTrace
(
"vgId:%d, msg:%p, app:%p, perform flowctrl, retry:%d"
,
pVnode
->
vgId
,
pWrite
,
pWrite
->
rpcMsg
.
ahandle
,
pWrite
->
processedCount
);
...
...
tests/pytest/fulltest.sh
浏览文件 @
bf3fffb1
...
...
@@ -226,6 +226,7 @@ python3 ./test.py -f query/querySecondtscolumnTowherenow.py
python3 ./test.py
-f
query/queryFilterTswithDateUnit.py
python3 ./test.py
-f
query/queryTscomputWithNow.py
python3 ./test.py
-f
query/computeErrorinWhere.py
python3 ./test.py
-f
query/queryTsisNull.py
...
...
tests/pytest/query/queryTsisNull.py
0 → 100644
浏览文件 @
bf3fffb1
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db keep 3650"
)
tdSql
.
execute
(
"use db"
)
tdLog
.
printNoPrefix
(
"==========step1:create table and insert data"
)
tdSql
.
execute
(
"create table stb1 (ts timestamp, c1 timestamp , c2 int) TAGS(t1 int )"
)
tdLog
.
printNoPrefix
(
"==========step2:query data where timestamp data is null"
)
tdSql
.
execute
(
"insert into t1 using stb1(t1) tags(1) (ts, c1, c2) values (now-1m, null, 1)"
)
tdSql
.
execute
(
"insert into t1 using stb1(t1) tags(1) (ts, c2) values (now-2m, 2)"
)
tdSql
.
query
(
"select * from t1 where c1 is NULL"
)
tdSql
.
checkRows
(
2
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/query/unionAllTest.py
浏览文件 @
bf3fffb1
...
...
@@ -74,6 +74,16 @@ class TDTestCase:
tdSql
.
error
(
"select 'dc' as options from stb where type = 1 limit 1 union all select 'ad' as city from stb where type = 2 limit 1"
)
# for defect https://jira.taosdata.com:18080/browse/TD-4017
tdSql
.
execute
(
"alter table stb add column col int"
)
tdSql
.
execute
(
"insert into tb1 values(%d, 'option1', 'beijing', 10)"
%
(
self
.
ts
+
1000
))
tdSql
.
query
(
"select 'dc' as options from stb where col > 10 limit 1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select 'dcs' as options from stb where col > 200 limit 1 union all select 'aaa' as options from stb limit 10"
)
tdSql
.
checkData
(
0
,
0
,
'aaa'
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录