Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
53892448
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
53892448
编写于
6月 12, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/crash_gen
上级
d285e58d
60050e52
变更
40
显示空白变更内容
内联
并排
Showing
40 changed file
with
815 addition
and
158 deletion
+815
-158
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+2
-1
src/client/src/tscSecondaryMerge.c
src/client/src/tscSecondaryMerge.c
+5
-5
src/client/src/tscServer.c
src/client/src/tscServer.c
+8
-7
src/client/src/tscSql.c
src/client/src/tscSql.c
+22
-13
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-20
src/common/src/tglobal.c
src/common/src/tglobal.c
+5
-4
src/inc/trpc.h
src/inc/trpc.h
+1
-1
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+12
-6
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+2
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+3
-2
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+2
-1
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+4
-2
src/query/inc/tsqlfunction.h
src/query/inc/tsqlfunction.h
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+35
-33
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+11
-5
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+23
-23
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+4
-2
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+3
-0
tests/pytest/query/filterAllIntTypes.py
tests/pytest/query/filterAllIntTypes.py
+117
-0
tests/pytest/query/filterFloatAndDouble.py
tests/pytest/query/filterFloatAndDouble.py
+160
-0
tests/pytest/query/filterOtherTypes.py
tests/pytest/query/filterOtherTypes.py
+362
-0
tests/pytest/regressiontest.sh
tests/pytest/regressiontest.sh
+2
-0
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
+2
-2
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
...ipt/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
+1
-1
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
+1
-1
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
+1
-1
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
...t/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
+2
-2
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
...pt/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
+2
-2
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
+1
-1
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
+2
-2
tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim
.../unique/arbitrator/offline_replica2_alterTable_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim
...pt/unique/arbitrator/offline_replica2_alterTag_online.sim
+3
-3
tests/script/unique/arbitrator/offline_replica2_createTable_online.sim
...unique/arbitrator/offline_replica2_createTable_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim
...ript/unique/arbitrator/offline_replica2_dropDb_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim
...t/unique/arbitrator/offline_replica2_dropTable_online.sim
+3
-3
tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim
.../unique/arbitrator/offline_replica3_alterTable_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim
...pt/unique/arbitrator/offline_replica3_alterTag_online.sim
+3
-3
tests/script/unique/arbitrator/offline_replica3_createTable_online.sim
...unique/arbitrator/offline_replica3_createTable_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim
...ript/unique/arbitrator/offline_replica3_dropDb_online.sim
+1
-1
tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim
...t/unique/arbitrator/offline_replica3_dropTable_online.sim
+3
-3
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
53892448
...
...
@@ -279,7 +279,8 @@ static void tscProcessCurrentUser(SSqlObj *pSql) {
pExpr
->
resType
=
TSDB_DATA_TYPE_BINARY
;
char
*
vx
=
calloc
(
1
,
pExpr
->
resBytes
);
STR_WITH_MAXSIZE_TO_VARSTR
(
vx
,
pSql
->
pTscObj
->
user
,
sizeof
(
pSql
->
pTscObj
->
user
));
size_t
size
=
sizeof
(
pSql
->
pTscObj
->
user
);
STR_WITH_MAXSIZE_TO_VARSTR
(
vx
,
pSql
->
pTscObj
->
user
,
size
);
tscSetLocalQueryResult
(
pSql
,
vx
,
pExpr
->
aliasName
,
pExpr
->
resType
,
pExpr
->
resBytes
);
free
(
vx
);
...
...
src/client/src/tscSecondaryMerge.c
浏览文件 @
53892448
src/client/src/tscServer.c
浏览文件 @
53892448
...
...
@@ -209,6 +209,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
tscError
(
"%p sql is already released"
,
pSql
->
signature
);
return
;
}
if
(
pSql
->
signature
!=
pSql
)
{
tscError
(
"%p sql is already released, signature:%p"
,
pSql
,
pSql
->
signature
);
return
;
...
...
@@ -217,10 +218,9 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
STscObj
*
pObj
=
pSql
->
pTscObj
;
// tscTrace("%p msg:%s is received from server", pSql, taosMsg[rpcMsg->msgType]);
if
(
pObj
->
signature
!=
pObj
)
{
tscTrace
(
"%p sql
is already
released or DB connection is closed, freed:%d pObj:%p signature:%p"
,
pSql
,
pSql
->
freed
,
if
(
pObj
->
signature
!=
pObj
||
pSql
->
freed
==
1
)
{
tscTrace
(
"%p sql
Obj needs to be
released or DB connection is closed, freed:%d pObj:%p signature:%p"
,
pSql
,
pSql
->
freed
,
pObj
,
pObj
->
signature
);
tscFreeSqlObj
(
pSql
);
rpcFreeCont
(
rpcMsg
->
pCont
);
...
...
@@ -375,7 +375,7 @@ int tscProcessSql(SSqlObj *pSql) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
STableMetaInfo
*
pTableMetaInfo
=
NULL
;
uint
16
_t
type
=
0
;
uint
32
_t
type
=
0
;
if
(
pQueryInfo
!=
NULL
)
{
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
...
...
@@ -424,7 +424,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
* sub-queries not correctly released and master sql object of super table query reaches an abnormal state.
*/
pSql
->
pSubs
[
i
]
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
//taosStopRpcConn(pSql->pSubs[i]->thandle
);
// taosStopRpcConn(pSql->pSubs[i]->
);
}
/*
...
...
@@ -1708,8 +1708,9 @@ int tscBuildSTableVgroupMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
numOfTables
;
++
i
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
i
);
tstrncpy
(
pMsg
,
pTableMetaInfo
->
name
,
sizeof
(
pTableMetaInfo
->
name
));
pMsg
+=
sizeof
(
pTableMetaInfo
->
name
);
size_t
size
=
sizeof
(
pTableMetaInfo
->
name
);
tstrncpy
(
pMsg
,
pTableMetaInfo
->
name
,
size
);
pMsg
+=
size
;
}
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_STABLE_VGROUP
;
...
...
src/client/src/tscSql.c
浏览文件 @
53892448
...
...
@@ -219,6 +219,11 @@ void waitForQueryRsp(void *param, TAOS_RES *tres, int code) {
sem_post
(
&
pSql
->
rspSem
);
}
static
void
waitForRetrieveRsp
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
tres
;
sem_post
(
&
pSql
->
rspSem
);
}
TAOS_RES
*
taos_query
(
TAOS
*
taos
,
const
char
*
sqlstr
)
{
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
{
...
...
@@ -369,11 +374,6 @@ int taos_fetch_block_impl(TAOS_RES *res, TAOS_ROW *rows) {
return
(
pQueryInfo
->
order
.
order
==
TSDB_ORDER_DESC
)
?
pRes
->
numOfRows
:
-
pRes
->
numOfRows
;
}
static
void
waitForRetrieveRsp
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
tres
;
sem_post
(
&
pSql
->
rspSem
);
}
TAOS_ROW
taos_fetch_row
(
TAOS_RES
*
res
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
res
;
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
...
...
@@ -476,7 +476,7 @@ int taos_select_db(TAOS *taos, const char *db) {
}
// send free message to vnode to free qhandle and corresponding resources in vnode
static
void
tscFreeQhandleInVnode
(
SSqlObj
*
pSql
)
{
static
bool
tscFreeQhandleInVnode
(
SSqlObj
*
pSql
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
...
...
@@ -496,10 +496,19 @@ static void tscFreeQhandleInVnode(SSqlObj* pSql) {
tscProcessSql
(
pSql
);
// in case of sync model query, waits for response and then goes on
if
(
pSql
->
fp
==
waitForQueryRsp
||
pSql
->
fp
==
waitForRetrieveRsp
)
{
sem_wait
(
&
pSql
->
rspSem
);
}
// if (pSql->fp == waitForQueryRsp || pSql->fp == waitForRetrieveRsp) {
// sem_wait(&pSql->rspSem);
// tscFreeSqlObj(pSql);
// tscTrace("%p sqlObj is freed by app", pSql);
// } else {
tscTrace
(
"%p sqlObj will be freed while rsp received"
,
pSql
);
// }
return
true
;
}
return
false
;
}
void
taos_free_result
(
TAOS_RES
*
res
)
{
...
...
@@ -527,10 +536,10 @@ void taos_free_result(TAOS_RES *res) {
}
pQueryInfo
->
type
=
TSDB_QUERY_TYPE_FREE_RESOURCE
;
tscFreeQhandleInVnode
(
pSql
);
if
(
!
tscFreeQhandleInVnode
(
pSql
))
{
tscFreeSqlObj
(
pSql
);
tscTrace
(
"%p sql result is freed by app"
,
pSql
);
tscTrace
(
"%p sqlObj is freed by app"
,
pSql
);
}
}
// todo should not be used in async query
...
...
src/client/src/tscUtil.c
浏览文件 @
53892448
...
...
@@ -134,24 +134,6 @@ void tscGetDBInfoFromMeterId(char* tableId, char* db) {
db
[
0
]
=
0
;
}
//STableIdInfo* tscGetMeterSidInfo(SVnodeSidList* pSidList, int32_t idx) {
// if (pSidList == NULL) {
// tscError("illegal sidlist");
// return 0;
// }
//
// if (idx < 0 || idx >= pSidList->numOfSids) {
// int32_t sidRange = (pSidList->numOfSids > 0) ? (pSidList->numOfSids - 1) : 0;
//
// tscError("illegal sidIdx:%d, reset to 0, sidIdx range:%d-%d", idx, 0, sidRange);
// idx = 0;
// }
//
// assert(pSidList->pSidExtInfoList[idx] >= 0);
//
// return (STableIdInfo*)(pSidList->pSidExtInfoList[idx] + (char*)pSidList);
//}
bool
tscIsTwoStageSTableQuery
(
SQueryInfo
*
pQueryInfo
,
int32_t
tableIndex
)
{
if
(
pQueryInfo
==
NULL
)
{
return
false
;
...
...
@@ -176,8 +158,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
return
false
;
}
if
(((
pQueryInfo
->
type
&
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
!=
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
&&
pQueryInfo
->
command
==
TSDB_SQL_SELECT
)
{
if
(
!
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
&&
pQueryInfo
->
command
==
TSDB_SQL_SELECT
)
{
return
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
);
}
...
...
src/common/src/tglobal.c
浏览文件 @
53892448
...
...
@@ -1262,9 +1262,10 @@ bool taosCheckGlobalCfg() {
taosSetAllDebugFlag
();
}
if
(
tsLocalFqdn
[
0
]
==
0
)
taosGetFqdn
(
tsLocalEp
);
else
if
(
tsLocalFqdn
[
0
]
==
0
)
{
taosGetFqdn
(
tsLocalFqdn
);
}
strcpy
(
tsLocalEp
,
tsLocalFqdn
);
snprintf
(
tsLocalEp
+
strlen
(
tsLocalEp
),
sizeof
(
tsLocalEp
),
":%d"
,
tsServerPort
);
...
...
src/inc/trpc.h
浏览文件 @
53892448
...
...
@@ -83,7 +83,7 @@ void rpcSendResponse(const SRpcMsg *pMsg);
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SRpcIpSet
*
pIpSet
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SRpcIpSet
*
pIpSet
,
const
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
void
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
#ifdef __cplusplus
}
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
53892448
...
...
@@ -235,12 +235,14 @@ static int32_t mnodeRetrieveConns(SShowObj *pShow, char *data, int32_t rows, voi
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
sizeof
(
pConnObj
->
user
));
size_t
size
=
sizeof
(
pConnObj
->
user
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
snprintf
(
ipStr
,
sizeof
(
ipStr
),
"%s:%u"
,
taosIpStr
(
pConnObj
->
ip
),
pConnObj
->
port
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
sizeof
(
ipStr
));
size
=
sizeof
(
ipStr
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
@@ -358,12 +360,14 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
sizeof
(
pConnObj
->
user
));
size_t
size
=
sizeof
(
pConnObj
->
user
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
snprintf
(
ipStr
,
sizeof
(
ipStr
),
"%s:%u"
,
taosIpStr
(
pConnObj
->
ip
),
pConnObj
->
port
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
sizeof
(
ipStr
));
size
=
sizeof
(
ipStr
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
@@ -479,12 +483,14 @@ static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, v
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
sizeof
(
pConnObj
->
user
));
size_t
size
=
sizeof
(
pConnObj
->
user
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConnObj
->
user
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
snprintf
(
ipStr
,
sizeof
(
ipStr
),
"%s:%u"
,
taosIpStr
(
pConnObj
->
ip
),
pConnObj
->
port
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
sizeof
(
ipStr
));
size
=
sizeof
(
ipStr
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
53892448
...
...
@@ -451,7 +451,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
pthread_mutex_unlock
(
&
pTable
->
mutex
);
sdbTrace
(
"table:%s, insert record:%s to hash, rowSize:%d
v
numOfRows:%"
PRId64
" version:%"
PRIu64
,
pTable
->
tableName
,
sdbTrace
(
"table:%s, insert record:%s to hash, rowSize:%d numOfRows:%"
PRId64
" version:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pOper
->
rowSize
,
pTable
->
numOfRows
,
sdbGetVersion
());
(
*
pTable
->
insertFp
)(
pOper
);
...
...
@@ -475,7 +475,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
pTable
->
numOfRows
--
;
pthread_mutex_unlock
(
&
pTable
->
mutex
);
sdbTrace
(
"table:%s, delete record:%s from hash, numOfRows:%
d
"
PRId64
"version:%"
PRIu64
,
pTable
->
tableName
,
sdbTrace
(
"table:%s, delete record:%s from hash, numOfRows:%"
PRId64
"version:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
());
int8_t
*
updateEnd
=
pOper
->
pObj
+
pTable
->
refCountPos
-
1
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
53892448
...
...
@@ -1004,7 +1004,7 @@ static int32_t mnodeAddSuperTableColumn(SDbObj *pDb, SSuperTableObj *pStable, SS
sizeof
(
SSchema
)
*
pStable
->
numOfTags
);
memcpy
(
pStable
->
schema
+
pStable
->
numOfColumns
,
schema
,
sizeof
(
SSchema
)
*
ncols
);
SSchema
*
tschema
=
(
SSchema
*
)
(
pStable
->
schema
+
sizeof
(
SSchema
)
*
pStable
->
numOfColumns
);
SSchema
*
tschema
=
(
SSchema
*
)
(
pStable
->
schema
+
pStable
->
numOfColumns
);
for
(
int32_t
i
=
0
;
i
<
ncols
;
i
++
)
{
tschema
[
i
].
colId
=
pStable
->
nextColId
++
;
}
...
...
@@ -1770,7 +1770,8 @@ static int32_t mnodeAutoCreateChildTable(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
}
tstrncpy
(
pCreateMsg
->
tableId
,
pInfo
->
tableId
,
sizeof
(
pInfo
->
tableId
));
size_t
size
=
sizeof
(
pInfo
->
tableId
);
tstrncpy
(
pCreateMsg
->
tableId
,
pInfo
->
tableId
,
size
);
tstrncpy
(
pCreateMsg
->
db
,
pMsg
->
pDb
->
name
,
sizeof
(
pCreateMsg
->
db
));
pCreateMsg
->
igExists
=
1
;
pCreateMsg
->
getMeta
=
1
;
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
53892448
...
...
@@ -315,7 +315,8 @@ static int32_t mnodeRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, voi
cols
=
0
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pUser
->
user
,
sizeof
(
pUser
->
user
));
size_t
size
=
sizeof
(
pUser
->
user
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pUser
->
user
,
size
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
53892448
...
...
@@ -101,8 +101,10 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
bool
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int
maxLen
)
{
char
buffer
[
sizeof
(
pContext
->
user
)
+
sizeof
(
pContext
->
pass
)]
=
{
0
};
tstrncpy
(
buffer
,
pContext
->
user
,
sizeof
(
pContext
->
user
));
tstrncpy
(
buffer
+
sizeof
(
pContext
->
user
),
pContext
->
pass
,
sizeof
(
pContext
->
pass
));
size_t
size
=
sizeof
(
pContext
->
user
);
tstrncpy
(
buffer
,
pContext
->
user
,
size
);
size
=
sizeof
(
pContext
->
pass
);
tstrncpy
(
buffer
+
sizeof
(
pContext
->
user
),
pContext
->
pass
,
size
);
char
*
encrypt
=
taosDesEncode
(
KEY_DES_4
,
buffer
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
char
*
base64
=
base64_encode
((
const
unsigned
char
*
)
encrypt
,
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
);
...
...
src/query/inc/tsqlfunction.h
浏览文件 @
53892448
src/query/src/qExecutor.c
浏览文件 @
53892448
...
...
@@ -4470,7 +4470,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
// query error occurred or query is killed, abort current execution
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
||
isQueryKilled
(
pQInfo
))
{
qTrace
(
"QInfo:%p query killed or error occurred, code:%
d, abort"
,
pQInfo
,
pQInfo
->
code
);
qTrace
(
"QInfo:%p query killed or error occurred, code:%
s, abort"
,
pQInfo
,
tstrerror
(
pQInfo
->
code
)
);
return
;
}
...
...
@@ -4491,7 +4491,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
setQueryStatus
(
pQuery
,
QUERY_COMPLETED
);
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
||
isQueryKilled
(
pQInfo
))
{
qTrace
(
"QInfo:%p query killed or error occurred, code:%
d, abort"
,
pQInfo
,
pQInfo
->
code
);
qTrace
(
"QInfo:%p query killed or error occurred, code:%
s, abort"
,
pQInfo
,
tstrerror
(
pQInfo
->
code
)
);
return
;
}
...
...
@@ -5851,6 +5851,8 @@ void qDestroyQueryInfo(qinfo_t qHandle) {
}
int16_t
ref
=
T_REF_DEC
(
pQInfo
);
qTrace
(
"QInfo:%p dec refCount, value:%d"
,
pQInfo
,
ref
);
if
(
ref
==
0
)
{
doDestoryQueryInfo
(
pQInfo
);
}
...
...
src/rpc/src/rpcMain.c
浏览文件 @
53892448
...
...
@@ -393,7 +393,6 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
if
(
pConn
->
inType
==
0
||
pConn
->
user
[
0
]
==
0
)
{
tTrace
(
"%s, connection is already released, rsp wont be sent"
,
pConn
->
info
);
rpcUnlockConn
(
pConn
);
rpcDecRef
(
pRpc
);
return
;
}
...
...
@@ -487,12 +486,19 @@ void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pMsg, SRpcMsg
}
// this API is used by server app to keep an APP context in case connection is broken
void
rpcReportProgress
(
void
*
handle
,
char
*
pCont
,
int
contLen
)
{
int
rpcReportProgress
(
void
*
handle
,
char
*
pCont
,
int
contLen
)
{
SRpcConn
*
pConn
=
(
SRpcConn
*
)
handle
;
if
(
pConn
->
user
[
0
])
{
// pReqMsg and reqMsgLen is re-used to store the context from app server
pConn
->
pReqMsg
=
pCont
;
pConn
->
reqMsgLen
=
contLen
;
return
0
;
}
tTrace
(
"%s, rpc connection is already released"
,
pConn
->
info
);
rpcFreeCont
(
pCont
);
return
-
1
;
}
static
void
rpcFreeMsg
(
void
*
msg
)
{
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
53892448
src/vnode/src/vnodeRead.c
浏览文件 @
53892448
...
...
@@ -68,6 +68,7 @@ static void vnodeNotifyCurrentQhandle(void* handle, void* qhandle, int32_t vgId)
killQueryMsg
->
header
.
vgId
=
htonl
(
vgId
);
killQueryMsg
->
header
.
contLen
=
htonl
(
sizeof
(
SRetrieveTableMsg
));
vTrace
(
"QInfo:%p register qhandle to connect:%p"
,
qhandle
,
handle
);
rpcReportProgress
(
handle
,
(
char
*
)
killQueryMsg
,
sizeof
(
SRetrieveTableMsg
));
}
...
...
@@ -85,10 +86,11 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
killQueryMsg
->
free
=
htons
(
killQueryMsg
->
free
);
killQueryMsg
->
qhandle
=
htobe64
(
killQueryMsg
->
qhandle
);
vWarn
(
"QInfo:%p connection %p broken, kill query"
,
killQueryMsg
->
qhandle
,
pReadMsg
->
rpcMsg
.
handle
);
assert
(
pReadMsg
->
rpcMsg
.
contLen
>
0
&&
killQueryMsg
->
free
==
1
);
qDestroyQueryInfo
((
qinfo_t
)
killQueryMsg
->
qhandle
);
return
TSDB_CODE_SUCCESS
;
qKillQuery
((
qinfo_t
)
killQueryMsg
->
qhandle
);
return
TSDB_CODE_TSC_QUERY_CANCELLED
;
// todo change the error code
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
tests/pytest/fulltest.sh
浏览文件 @
53892448
...
...
@@ -134,6 +134,9 @@ python3 ./test.py -f query/filter.py
python3 ./test.py
-f
query/filterCombo.py
python3 ./test.py
-f
query/queryNormal.py
python3 ./test.py
-f
query/queryError.py
python3 ./test.py
-f
query/filterAllIntTypes.py
python3 ./test.py
-f
query/filterFloatAndDouble.py
python3 ./test.py
-f
query/filterOtherTypes.py
#stream
python3 ./test.py
-f
stream/stream1.py
...
...
tests/pytest/query/filterAllIntTypes.py
0 → 100644
浏览文件 @
53892448
###################################################################
# 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
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
powers
=
[
7
,
15
,
31
,
63
]
self
.
types
=
[
"tinyint"
,
"smallint"
,
"int"
,
"bigint"
]
self
.
rowNum
=
10
self
.
ts
=
1537146000000
def
run
(
self
):
tdSql
.
prepare
()
for
i
in
range
(
len
(
self
.
powers
)):
curType
=
self
.
types
[
i
]
print
(
"======= Verify filter for %s type ========="
%
(
curType
))
tdLog
.
debug
(
"create table st%s(ts timestamp, num %s) tags(id %s)"
%
(
curType
,
curType
,
curType
))
tdSql
.
execute
(
"create table st%s(ts timestamp, num %s) tags(id %s)"
%
(
curType
,
curType
,
curType
))
#create 10 tables, insert 10 rows for each table
for
j
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"create table st%s%d using st%s tags(%d)"
%
(
curType
,
j
+
1
,
curType
,
j
+
1
))
for
k
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into st%s%d values(%d, %d)"
%
(
curType
,
j
+
1
,
self
.
ts
+
k
+
1
,
j
*
10
+
k
+
1
))
tdSql
.
error
(
"insert into st%s10 values(%d, %d)"
%
(
curType
,
self
.
ts
+
11
,
pow
(
2
,
self
.
powers
[
i
])))
tdSql
.
execute
(
"insert into st%s10 values(%d, %d)"
%
(
curType
,
self
.
ts
+
12
,
pow
(
2
,
self
.
powers
[
i
])
-
1
))
tdSql
.
error
(
"insert into st%s10 values(%d, %d)"
%
(
curType
,
self
.
ts
+
13
,
pow
(
-
2
,
self
.
powers
[
i
])))
tdSql
.
execute
(
"insert into st%s10 values(%d, %d)"
%
(
curType
,
self
.
ts
+
14
,
pow
(
-
2
,
self
.
powers
[
i
])
+
1
))
# > for int type on column
tdSql
.
query
(
"select * from st%s where num > 50"
%
curType
)
tdSql
.
checkRows
(
51
)
# >= for int type on column
tdSql
.
query
(
"select * from st%s where num >= 50"
%
curType
)
tdSql
.
checkRows
(
52
)
# = for int type on column
tdSql
.
query
(
"select * from st%s where num = 50"
%
curType
)
tdSql
.
checkRows
(
1
)
# < for int type on column
tdSql
.
query
(
"select * from st%s where num < 50"
%
curType
)
tdSql
.
checkRows
(
50
)
# <= for int type on column
tdSql
.
query
(
"select * from st%s where num <= 50"
%
curType
)
tdSql
.
checkRows
(
51
)
# <> for int type on column
tdSql
.
query
(
"select * from st%s where num <> 50"
%
curType
)
tdSql
.
checkRows
(
101
)
# != for int type on column
tdSql
.
query
(
"select * from st%s where num != 50"
%
curType
)
tdSql
.
checkRows
(
101
)
# > for int type on tag
tdSql
.
query
(
"select * from st%s where id > 5"
%
curType
)
tdSql
.
checkRows
(
52
)
# >= for int type on tag
tdSql
.
query
(
"select * from st%s where id >= 5"
%
curType
)
tdSql
.
checkRows
(
62
)
# = for int type on tag
tdSql
.
query
(
"select * from st%s where id = 5"
%
curType
)
tdSql
.
checkRows
(
10
)
# < for int type on tag
tdSql
.
query
(
"select * from st%s where id < 5"
%
curType
)
tdSql
.
checkRows
(
40
)
# <= for int type on tag
tdSql
.
query
(
"select * from st%s where id <= 5"
%
curType
)
tdSql
.
checkRows
(
50
)
# <> for int type on tag
tdSql
.
query
(
"select * from st%s where id <> 5"
%
curType
)
tdSql
.
checkRows
(
92
)
# != for int type on tag
tdSql
.
query
(
"select * from st%s where id != 5"
%
curType
)
tdSql
.
checkRows
(
92
)
print
(
"======= Verify filter for %s type finished ========="
%
curType
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/query/filterFloatAndDouble.py
0 → 100644
浏览文件 @
53892448
###################################################################
# 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
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
rowNum
=
10
self
.
ts
=
1537146000000
def
run
(
self
):
tdSql
.
prepare
()
print
(
"======= Verify filter for float and double type ========="
)
tdLog
.
debug
(
"create table st(ts timestamp, num float, speed double) tags(tagcol1 float, tagcol2 double)"
)
tdSql
.
execute
(
"create table st(ts timestamp, num float, speed double) tags(tagcol1 float, tagcol2 double)"
)
for
j
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into st1 using st tags(1.1, 2.3) values(%d, %f, %f)"
%
(
self
.
ts
+
j
+
1
,
1.1
*
(
j
+
1
),
2.3
*
(
j
+
1
)))
# > for float type on column
tdSql
.
query
(
"select * from st where num > 5.5"
)
tdSql
.
checkRows
(
5
)
# >= for float type on column
tdSql
.
query
(
"select * from st where num >= 5.5"
)
tdSql
.
checkRows
(
6
)
# = for float type on column
tdSql
.
query
(
"select * from st where num = 5.5"
)
tdSql
.
checkRows
(
1
)
# <> for float type on column
tdSql
.
query
(
"select * from st where num <> 5.5"
)
tdSql
.
checkRows
(
9
)
# != for float type on column
tdSql
.
query
(
"select * from st where num != 5.5"
)
tdSql
.
checkRows
(
9
)
# <= for float type on column
tdSql
.
query
(
"select * from st where num <= 5.5"
)
tdSql
.
checkRows
(
5
)
# < for float type on column
tdSql
.
query
(
"select * from st where num < 5.5"
)
tdSql
.
checkRows
(
4
)
# > for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 > 1.1"
)
tdSql
.
checkRows
(
0
)
# >= for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 >= 1.1"
)
tdSql
.
checkRows
(
10
)
# = for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 = 1.1"
)
tdSql
.
checkRows
(
10
)
# <> for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 <> 1.1"
)
tdSql
.
checkRows
(
0
)
# != for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 != 1.1"
)
tdSql
.
checkRows
(
0
)
# <= for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 <= 1.1"
)
tdSql
.
checkRows
(
10
)
# < for float type on tag
tdSql
.
query
(
"select * from st where tagcol1 < 1.1"
)
tdSql
.
checkRows
(
0
)
# > for double type on column
tdSql
.
query
(
"select * from st where speed > 11.5"
)
tdSql
.
checkRows
(
5
)
# >= for double type on column
tdSql
.
query
(
"select * from st where speed >= 11.5"
)
tdSql
.
checkRows
(
6
)
# = for double type on column
tdSql
.
query
(
"select * from st where speed = 11.5"
)
tdSql
.
checkRows
(
1
)
# <> for double type on column
tdSql
.
query
(
"select * from st where speed <> 11.5"
)
tdSql
.
checkRows
(
9
)
# != for double type on column
tdSql
.
query
(
"select * from st where speed != 11.5"
)
tdSql
.
checkRows
(
9
)
# <= for double type on column
tdSql
.
query
(
"select * from st where speed <= 11.5"
)
tdSql
.
checkRows
(
5
)
# < for double type on column
tdSql
.
query
(
"select * from st where speed < 11.5"
)
tdSql
.
checkRows
(
4
)
# > for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 > 2.3"
)
tdSql
.
checkRows
(
0
)
# >= for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 >= 2.3"
)
tdSql
.
checkRows
(
10
)
# = for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 = 2.3"
)
tdSql
.
checkRows
(
10
)
# <> for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 <> 2.3"
)
tdSql
.
checkRows
(
0
)
# != for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 != 2.3"
)
tdSql
.
checkRows
(
0
)
# <= for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 <= 2.3"
)
tdSql
.
checkRows
(
10
)
# < for double type on tag
tdSql
.
query
(
"select * from st where tagcol2 < 2.3"
)
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/query/filterOtherTypes.py
0 → 100644
浏览文件 @
53892448
###################################################################
# 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
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1537146000000
def
run
(
self
):
tdSql
.
prepare
()
print
(
"======= Verify filter for bool, nchar and binary type ========="
)
tdLog
.
debug
(
"create table st(ts timestamp, tbcol1 bool, tbcol2 nchar(10), tbcol3 binary(20)) tags(tagcol1 bool, tagcol2 nchar(10), tagcol3 binary(10))"
)
tdSql
.
execute
(
"create table st(ts timestamp, tbcol1 bool, tbcol2 nchar(10), tbcol3 binary(20)) tags(tagcol1 bool, tagcol2 nchar(10), tagcol3 binary(10))"
)
tdSql
.
execute
(
"create table st1 using st tags(true, 'table1', '水表')"
)
for
i
in
range
(
1
,
6
):
tdSql
.
execute
(
"insert into st1 values(%d, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
%
2
,
i
,
i
))
tdSql
.
execute
(
"create table st2 using st tags(false, 'table2', '电表')"
)
for
i
in
range
(
6
,
11
):
tdSql
.
execute
(
"insert into st2 values(%d, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
%
2
,
i
,
i
))
# =============Verify stable columns====================
# > for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 > false"
)
# >= for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 >= false"
)
# = for bool type on column
tdSql
.
query
(
"select * from st where tbcol1 = false"
)
tdSql
.
checkRows
(
5
)
# <> for bool type on column
tdSql
.
query
(
"select * from st where tbcol1 <> true"
)
tdSql
.
checkRows
(
5
)
# != for bool type on column
tdSql
.
query
(
"select * from st where tbcol1 != true"
)
tdSql
.
checkRows
(
5
)
# > for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 < true"
)
# >= for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 <= true"
)
# % for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 like '%'"
)
# _ for bool type on column
tdSql
.
error
(
"select * from st where tbcol1 like '____'"
)
# > for nchar type on column
tdSql
.
error
(
"select * from st where tbcol2 > 'taosdata'"
)
# >= for nchar type on column
tdSql
.
error
(
"select * from st where tbcol2 >= 'taosdata'"
)
# = for nchar type on column
tdSql
.
query
(
"select * from st where tbcol2 = 'taosdata1'"
)
tdSql
.
checkRows
(
1
)
# <> for nchar type on column
tdSql
.
query
(
"select * from st where tbcol2 <> 'taosdata1'"
)
tdSql
.
checkRows
(
9
)
# != for nchar type on column
tdSql
.
query
(
"select * from st where tbcol2 != 'taosdata1'"
)
tdSql
.
checkRows
(
9
)
# > for nchar type on column
tdSql
.
error
(
"select * from st where tbcol2 < 'taodata'"
)
# >= for nchar type on column
tdSql
.
error
(
"select * from st where tbcol2 <= 'taodata'"
)
# % for nchar type on column case 1
tdSql
.
query
(
"select * from st where tbcol2 like '%'"
)
tdSql
.
checkRows
(
10
)
# % for nchar type on column case 2
tdSql
.
query
(
"select * from st where tbcol2 like 'a%'"
)
tdSql
.
checkRows
(
0
)
# % for nchar type on column case 3
tdSql
.
query
(
"select * from st where tbcol2 like 't%_'"
)
tdSql
.
checkRows
(
10
)
# % for nchar type on column case 4
tdSql
.
query
(
"select * from st where tbcol2 like '%1'"
)
# tdSql.checkRows(2)
# _ for nchar type on column case 1
tdSql
.
query
(
"select * from st where tbcol2 like '____________'"
)
tdSql
.
checkRows
(
0
)
# _ for nchar type on column case 2
tdSql
.
query
(
"select * from st where tbcol2 like '__________'"
)
tdSql
.
checkRows
(
1
)
# _ for nchar type on column case 3
tdSql
.
query
(
"select * from st where tbcol2 like '_________'"
)
tdSql
.
checkRows
(
9
)
# _ for nchar type on column case 4
tdSql
.
query
(
"select * from st where tbcol2 like 't________'"
)
tdSql
.
checkRows
(
9
)
# _ for nchar type on column case 5
tdSql
.
query
(
"select * from st where tbcol2 like '%________'"
)
tdSql
.
checkRows
(
10
)
# > for binary type on column
tdSql
.
error
(
"select * from st where tbcol3 > '涛思数据'"
)
# >= for binary type on column
tdSql
.
error
(
"select * from st where tbcol3 >= '涛思数据'"
)
# = for binary type on column
tdSql
.
query
(
"select * from st where tbcol3 = '涛思数据1'"
)
tdSql
.
checkRows
(
1
)
# <> for binary type on column
tdSql
.
query
(
"select * from st where tbcol3 <> '涛思数据1'"
)
tdSql
.
checkRows
(
9
)
# != for binary type on column
tdSql
.
query
(
"select * from st where tbcol3 != '涛思数据1'"
)
tdSql
.
checkRows
(
9
)
# > for binary type on column
tdSql
.
error
(
"select * from st where tbcol3 < '涛思数据'"
)
# >= for binary type on column
tdSql
.
error
(
"select * from st where tbcol3 <= '涛思数据'"
)
# % for binary type on column case 1
tdSql
.
query
(
"select * from st where tbcol3 like '%'"
)
tdSql
.
checkRows
(
10
)
# % for binary type on column case 2
tdSql
.
query
(
"select * from st where tbcol3 like '陶%'"
)
tdSql
.
checkRows
(
0
)
# % for binary type on column case 3
tdSql
.
query
(
"select * from st where tbcol3 like '涛%_'"
)
tdSql
.
checkRows
(
10
)
# % for binary type on column case 4
tdSql
.
query
(
"select * from st where tbcol3 like '%1'"
)
tdSql
.
checkRows
(
1
)
# _ for binary type on column case 1
tdSql
.
query
(
"select * from st where tbcol3 like '_______'"
)
tdSql
.
checkRows
(
0
)
# _ for binary type on column case 2
tdSql
.
query
(
"select * from st where tbcol3 like '______'"
)
tdSql
.
checkRows
(
1
)
# _ for binary type on column case 2
tdSql
.
query
(
"select * from st where tbcol3 like '_____'"
)
tdSql
.
checkRows
(
9
)
# _ for binary type on column case 3
tdSql
.
query
(
"select * from st where tbcol3 like '____'"
)
tdSql
.
checkRows
(
0
)
# _ for binary type on column case 4
tdSql
.
query
(
"select * from st where tbcol3 like 't____'"
)
tdSql
.
checkRows
(
0
)
# =============Verify stable tags====================
# > for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 > false"
)
# >= for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 >= false"
)
# = for bool type on tag
tdSql
.
query
(
"select * from st where tagcol1 = false"
)
tdSql
.
checkRows
(
5
)
# <> for bool type on tag
tdSql
.
query
(
"select * from st where tagcol1 <> true"
)
tdSql
.
checkRows
(
5
)
# != for bool type on tag
tdSql
.
query
(
"select * from st where tagcol1 != true"
)
tdSql
.
checkRows
(
5
)
# > for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 < true"
)
# >= for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 <= true"
)
# % for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 like '%'"
)
# _ for bool type on tag
tdSql
.
error
(
"select * from st where tagcol1 like '____'"
)
# > for nchar type on tag
tdSql
.
error
(
"select * from st where tagcol2 > 'table'"
)
# >= for nchar type on tag
tdSql
.
error
(
"select * from st where tagcol2 >= 'table'"
)
# = for nchar type on tag
tdSql
.
query
(
"select * from st where tagcol2 = 'table1'"
)
tdSql
.
checkRows
(
5
)
# <> for nchar type on tag
tdSql
.
query
(
"select * from st where tagcol2 <> 'table1'"
)
tdSql
.
checkRows
(
5
)
# != for nchar type on tag
tdSql
.
query
(
"select * from st where tagcol2 != 'table'"
)
tdSql
.
checkRows
(
10
)
# > for nchar type on tag
tdSql
.
error
(
"select * from st where tagcol2 < 'table'"
)
# >= for nchar type on tag
tdSql
.
error
(
"select * from st where tagcol2 <= 'table'"
)
# % for nchar type on tag case 1
tdSql
.
query
(
"select * from st where tagcol2 like '%'"
)
tdSql
.
checkRows
(
10
)
# % for nchar type on tag case 2
tdSql
.
query
(
"select * from st where tagcol2 like 'a%'"
)
tdSql
.
checkRows
(
0
)
# % for nchar type on tag case 3
tdSql
.
query
(
"select * from st where tagcol2 like 't%_'"
)
tdSql
.
checkRows
(
10
)
# % for nchar type on tag case 4
tdSql
.
query
(
"select * from st where tagcol2 like '%1'"
)
tdSql
.
checkRows
(
5
)
# _ for nchar type on tag case 1
tdSql
.
query
(
"select * from st where tagcol2 like '_______'"
)
tdSql
.
checkRows
(
0
)
# _ for nchar type on tag case 2
tdSql
.
query
(
"select * from st where tagcol2 like '______'"
)
tdSql
.
checkRows
(
10
)
# _ for nchar type on tag case 3
tdSql
.
query
(
"select * from st where tagcol2 like 't_____'"
)
tdSql
.
checkRows
(
10
)
# _ for nchar type on tag case 4
tdSql
.
query
(
"select * from st where tagcol2 like 's________'"
)
tdSql
.
checkRows
(
0
)
# _ for nchar type on tag case 5
tdSql
.
query
(
"select * from st where tagcol2 like '%__'"
)
tdSql
.
checkRows
(
10
)
# > for binary type on tag
tdSql
.
error
(
"select * from st where tagcol3 > '表'"
)
# >= for binary type on tag
tdSql
.
error
(
"select * from st where tagcol3 >= '表'"
)
# = for binary type on tag
tdSql
.
query
(
"select * from st where tagcol3 = '水表'"
)
tdSql
.
checkRows
(
5
)
# <> for binary type on tag
tdSql
.
query
(
"select * from st where tagcol3 <> '水表'"
)
tdSql
.
checkRows
(
5
)
# != for binary type on tag
tdSql
.
query
(
"select * from st where tagcol3 != '水表'"
)
tdSql
.
checkRows
(
5
)
# > for binary type on tag
tdSql
.
error
(
"select * from st where tagcol3 < '水表'"
)
# >= for binary type on tag
tdSql
.
error
(
"select * from st where tagcol3 <= '水表'"
)
# % for binary type on tag case 1
tdSql
.
query
(
"select * from st where tagcol3 like '%'"
)
tdSql
.
checkRows
(
10
)
# % for binary type on tag case 2
tdSql
.
query
(
"select * from st where tagcol3 like '水%'"
)
tdSql
.
checkRows
(
5
)
# % for binary type on tag case 3
tdSql
.
query
(
"select * from st where tagcol3 like '数%_'"
)
tdSql
.
checkRows
(
0
)
# % for binary type on tag case 4
tdSql
.
query
(
"select * from st where tagcol3 like '%表'"
)
tdSql
.
checkRows
(
10
)
# % for binary type on tag case 5
tdSql
.
query
(
"select * from st where tagcol3 like '%据'"
)
tdSql
.
checkRows
(
0
)
# _ for binary type on tag case 1
tdSql
.
query
(
"select * from st where tagcol3 like '__'"
)
tdSql
.
checkRows
(
10
)
# _ for binary type on tag case 2
tdSql
.
query
(
"select * from st where tagcol3 like '水_'"
)
tdSql
.
checkRows
(
5
)
# _ for binary type on tag case 2
tdSql
.
query
(
"select * from st where tagcol3 like '_表'"
)
tdSql
.
checkRows
(
10
)
# _ for binary type on tag case 3
tdSql
.
query
(
"select * from st where tagcol3 like '___'"
)
tdSql
.
checkRows
(
0
)
# _ for binary type on tag case 4
tdSql
.
query
(
"select * from st where tagcol3 like '数_'"
)
tdSql
.
checkRows
(
0
)
# _ for binary type on tag case 5
tdSql
.
query
(
"select * from st where tagcol3 like '_据'"
)
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/regressiontest.sh
浏览文件 @
53892448
...
...
@@ -131,6 +131,8 @@ python3 ./test.py -f user/pass_len.py
#query
python3 ./test.py
-f
query/filter.py
python3 ./test.py
-f
query/filterAllIntTypes.py
python3 ./test.py
-f
query/filterFloatAndDouble.py
#stream
...
...
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
浏览文件 @
53892448
...
...
@@ -51,7 +51,7 @@ system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname2
sleep 3000
$totalTableNum = 10
000
$totalTableNum = 10
$sleepTimer = 10000
$db = db
...
...
@@ -192,7 +192,7 @@ if $data00 != $totalRows then
endi
print ============== step4: stop dnode2 for checking if sync
success
print ============== step4: stop dnode2 for checking if sync
ok
system sh/exec.sh -n dnode2 -s stop
sleep $sleepTimer
...
...
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
00
$totalTableNum = 10
$sleepTimer = 10000
$db = db
...
...
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
浏览文件 @
53892448
...
...
@@ -173,7 +173,7 @@ if $rows != 3 then
return -1
endi
print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should
success
print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should
ok
system sh/exec.sh -n dnode4 -s stop
system rm -rf ../../../sim/dnode4
...
...
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
#sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
@@ -177,7 +177,7 @@ if $data00 != $totalRows then
return -1
endi
print ============== step5: stop dnode2, and check if dnode3 sync
success
print ============== step5: stop dnode2, and check if dnode3 sync
ok
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep $sleepTimer
wait_dnode2_offline_0:
...
...
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
#sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
@@ -105,7 +105,7 @@ if $data00 != $totalRows then
return -1
endi
print ============== step5: stop dnode2, and check if dnode3 sync
success
print ============== step5: stop dnode2, and check if dnode3 sync
ok
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep $sleepTimer
wait_dnode2_offline_0:
...
...
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
浏览文件 @
53892448
...
...
@@ -55,7 +55,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
@@ -152,7 +152,7 @@ print ============== step4: restart dnode2, then create database with replica 2,
system sh/exec.sh -n dnode2 -s start
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db1
...
...
tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname2
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim
浏览文件 @
53892448
...
...
@@ -67,7 +67,7 @@ sql use $db
# create table , insert data
$stb = stb
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t
0 int, t
1 int)
$rowNum = 500
$tblNum = $totalTableNum
$totalRows = 0
...
...
@@ -77,7 +77,7 @@ $tsEnd = 0
$i = 0
while $i < $tblNum
$tb = tb . $i
sql create table $tb using $stb tags( $i )
sql create table $tb using $stb tags( $i
, $i
)
$x = 0
while $x < $rowNum
...
...
@@ -164,7 +164,7 @@ $totalRows = 0
$i = 0
while $i < $tblNum
$tb = tb . $i
sql create table $tb using $stb tags( $i , $i )
sql create table $tb using $stb tags( $i , $i
, $i
)
$x = 0
while $x < $rowNum
...
...
tests/script/unique/arbitrator/offline_replica2_createTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname2
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$maxTables = $totalTableNum * 2
...
...
tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname2
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname2
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
@@ -146,14 +146,14 @@ endi
print ============== step4: drop some tables
$i = 1
$dropTblNum =
21
$dropTblNum =
6
while $i < $dropTblNum
$tb = tb . $i
sql drop table if exists $tb
$i = $i + 1
endw
$tblNum = $tblNum -
20
$tblNum = $tblNum -
5
print ============== step5: restart dnode4, waiting dnode4 synced
system sh/exec.sh -n dnode4 -s start
...
...
tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim
浏览文件 @
53892448
...
...
@@ -67,7 +67,7 @@ sql use $db
# create table , insert data
$stb = stb
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t
0 int, t
1 int)
$rowNum = 500
$tblNum = $totalTableNum
$totalRows = 0
...
...
@@ -77,7 +77,7 @@ $tsEnd = 0
$i = 0
while $i < $tblNum
$tb = tb . $i
sql create table $tb using $stb tags( $i )
sql create table $tb using $stb tags( $i
, $i
)
$x = 0
while $x < $rowNum
...
...
@@ -164,7 +164,7 @@ $totalRows = 0
$i = 0
while $i < $tblNum
$tb = tb . $i
sql create table $tb using $stb tags( $i , $i )
sql create table $tb using $stb tags( $i , $i
, $i
)
$x = 0
while $x < $rowNum
...
...
tests/script/unique/arbitrator/offline_replica3_createTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$maxTables = $totalTableNum * 2
...
...
tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim
浏览文件 @
53892448
...
...
@@ -56,7 +56,7 @@ sql create dnode $hostname3
sql create dnode $hostname4
sleep 3000
$totalTableNum = 10
0
$totalTableNum = 10
$sleepTimer = 3000
$db = db
...
...
@@ -146,14 +146,14 @@ endi
print ============== step4: drop some tables
$i = 1
$dropTblNum =
21
$dropTblNum =
6
while $i < $dropTblNum
$tb = tb . $i
sql drop table if exists $tb
$i = $i + 1
endw
$tblNum = $tblNum -
20
$tblNum = $tblNum -
5
print ============== step5: restart dnode4, waiting dnode4 synced
system sh/exec.sh -n dnode4 -s start
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录