Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0354f3b4
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看板
提交
0354f3b4
编写于
6月 15, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/TD-11274-3.0
上级
26cd9f8a
60028dce
变更
84
隐藏空白更改
内联
并排
Showing
84 changed file
with
587 addition
and
218 deletion
+587
-218
.gitmodules
.gitmodules
+3
-0
Jenkinsfile2
Jenkinsfile2
+14
-0
cmake/cmake.define
cmake/cmake.define
+27
-0
include/common/tmsg.h
include/common/tmsg.h
+6
-5
include/common/ttokendef.h
include/common/ttokendef.h
+1
-1
include/libs/nodes/cmdnodes.h
include/libs/nodes/cmdnodes.h
+6
-0
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+1
-0
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+8
-1
include/util/tdef.h
include/util/tdef.h
+5
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-4
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+7
-3
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+8
-4
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+4
-12
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+4
-1
source/libs/parser/inc/parAst.h
source/libs/parser/inc/parAst.h
+2
-0
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+14
-11
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+17
-8
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+2
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+7
-3
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+14
-14
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+4
-4
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+26
-9
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+9
-3
tests/parallel_test/collect_cases.sh
tests/parallel_test/collect_cases.sh
+11
-0
tests/parallel_test/run.sh
tests/parallel_test/run.sh
+13
-1
tests/pytest/alter/alter_replica.py
tests/pytest/alter/alter_replica.py
+1
-1
tests/pytest/functions/function_max.py
tests/pytest/functions/function_max.py
+1
-1
tests/pytest/functions/function_min.py
tests/pytest/functions/function_min.py
+1
-1
tests/pytest/functions/queryTestCases.py
tests/pytest/functions/queryTestCases.py
+1
-1
tests/pytest/insert/before_1970.py
tests/pytest/insert/before_1970.py
+1
-1
tests/pytest/insert/retentionpolicy.py
tests/pytest/insert/retentionpolicy.py
+1
-1
tests/pytest/multilevel/fileDistributionSameLevel.py
tests/pytest/multilevel/fileDistributionSameLevel.py
+2
-2
tests/pytest/multilevel/retentionTest.py
tests/pytest/multilevel/retentionTest.py
+1
-1
tests/pytest/perfbenchmark/bug3433.py
tests/pytest/perfbenchmark/bug3433.py
+1
-1
tests/pytest/perfbenchmark/joinPerformance.py
tests/pytest/perfbenchmark/joinPerformance.py
+1
-1
tests/pytest/perfbenchmark/taosdemoInsert.py
tests/pytest/perfbenchmark/taosdemoInsert.py
+1
-1
tests/pytest/query/query1970YearsAf.py
tests/pytest/query/query1970YearsAf.py
+1
-1
tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
...demoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
+1
-1
tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py
...st/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py
+1
-1
tests/pytest/tools/taosdumpTest.py
tests/pytest/tools/taosdumpTest.py
+3
-3
tests/pytest/tools/taosdumpTestNanoSupport.py
tests/pytest/tools/taosdumpTestNanoSupport.py
+1
-1
tests/pytest/update/merge_commit_data-0.py
tests/pytest/update/merge_commit_data-0.py
+1
-1
tests/pytest/update/merge_commit_data.py
tests/pytest/update/merge_commit_data.py
+1
-1
tests/pytest/update/merge_commit_data2.py
tests/pytest/update/merge_commit_data2.py
+1
-1
tests/pytest/update/merge_commit_data2_update0.py
tests/pytest/update/merge_commit_data2_update0.py
+1
-1
tests/pytest/update/merge_commit_last.py
tests/pytest/update/merge_commit_last.py
+1
-1
tests/pytest/util/sql.py
tests/pytest/util/sql.py
+1
-1
tests/pytest/util/taosdemoCfg.py
tests/pytest/util/taosdemoCfg.py
+1
-1
tests/script/general/db/alter_option.sim
tests/script/general/db/alter_option.sim
+8
-8
tests/script/general/db/backup/keep.sim
tests/script/general/db/backup/keep.sim
+2
-2
tests/script/general/db/topic1.sim
tests/script/general/db/topic1.sim
+15
-15
tests/script/general/import/commit.sim
tests/script/general/import/commit.sim
+2
-2
tests/script/general/import/replica1.sim
tests/script/general/import/replica1.sim
+1
-1
tests/script/general/parser/alter.sim
tests/script/general/parser/alter.sim
+1
-1
tests/script/general/parser/alter__for_community_version.sim
tests/script/general/parser/alter__for_community_version.sim
+1
-1
tests/script/general/parser/create_db.sim
tests/script/general/parser/create_db.sim
+3
-3
tests/script/general/parser/create_db__for_community_version.sim
...cript/general/parser/create_db__for_community_version.sim
+3
-3
tests/script/tsim/db/alter_option.sim
tests/script/tsim/db/alter_option.sim
+8
-8
tests/script/tsim/db/basic6.sim
tests/script/tsim/db/basic6.sim
+2
-2
tests/script/tsim/db/create_all_options.sim
tests/script/tsim/db/create_all_options.sim
+11
-11
tests/script/tsim/insert/commit-merge0.sim
tests/script/tsim/insert/commit-merge0.sim
+1
-1
tests/script/tsim/query/interval-offset.sim
tests/script/tsim/query/interval-offset.sim
+1
-1
tests/script/tsim/stable/alter_count.sim
tests/script/tsim/stable/alter_count.sim
+1
-1
tests/script/tsim/stable/alter_import.sim
tests/script/tsim/stable/alter_import.sim
+1
-1
tests/script/unique/db/commit.sim
tests/script/unique/db/commit.sim
+1
-1
tests/script/unique/import/replica2.sim
tests/script/unique/import/replica2.sim
+1
-1
tests/script/unique/import/replica3.sim
tests/script/unique/import/replica3.sim
+1
-1
tests/script/windows/db/basic.sim
tests/script/windows/db/basic.sim
+2
-2
tests/system-test/0-others/taosShellError.py
tests/system-test/0-others/taosShellError.py
+4
-4
tests/system-test/0-others/udfTest.py
tests/system-test/0-others/udfTest.py
+1
-1
tests/system-test/0-others/udf_cluster.py
tests/system-test/0-others/udf_cluster.py
+1
-1
tests/system-test/0-others/udf_create.py
tests/system-test/0-others/udf_create.py
+1
-1
tests/system-test/0-others/udf_restart_taosd.py
tests/system-test/0-others/udf_restart_taosd.py
+1
-1
tests/system-test/2-query/abs.py
tests/system-test/2-query/abs.py
+1
-1
tests/system-test/2-query/sample.py
tests/system-test/2-query/sample.py
+1
-1
tests/system-test/6-cluster/5dnode1mnode.py
tests/system-test/6-cluster/5dnode1mnode.py
+1
-1
tests/system-test/6-cluster/5dnode2mnode.py
tests/system-test/6-cluster/5dnode2mnode.py
+2
-2
tests/system-test/6-cluster/5dnode3mnodeDrop.py
tests/system-test/6-cluster/5dnode3mnodeDrop.py
+1
-1
tests/system-test/6-cluster/5dnode3mnodeStop.py
tests/system-test/6-cluster/5dnode3mnodeStop.py
+1
-1
tests/system-test/6-cluster/5dnode3mnodeStopInsert.py
tests/system-test/6-cluster/5dnode3mnodeStopInsert.py
+1
-1
tests/system-test/7-tmq/schema.py
tests/system-test/7-tmq/schema.py
+170
-25
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-0
tools/CMakeLists.txt
tools/CMakeLists.txt
+92
-0
tools/taosadapter
tools/taosadapter
+1
-0
未找到文件。
.gitmodules
浏览文件 @
0354f3b4
...
@@ -16,3 +16,6 @@
...
@@ -16,3 +16,6 @@
[submodule "tools/taos-tools"]
[submodule "tools/taos-tools"]
path = tools/taos-tools
path = tools/taos-tools
url = https://github.com/taosdata/taos-tools
url = https://github.com/taosdata/taos-tools
[submodule "tools/taosadapter"]
path = tools/taosadapter
url = https://github.com/taosdata/taosadapter.git
Jenkinsfile2
浏览文件 @
0354f3b4
...
@@ -38,6 +38,7 @@ def pre_test(){
...
@@ -38,6 +38,7 @@ def pre_test(){
sh '''
sh '''
hostname
hostname
date
date
env
'''
'''
sh '''
sh '''
cd ${WK}
cd ${WK}
...
@@ -82,23 +83,33 @@ def pre_test(){
...
@@ -82,23 +83,33 @@ def pre_test(){
sh '''
sh '''
cd ${WKC}
cd ${WKC}
git pull >/dev/null
git pull >/dev/null
git log -5
echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log
echo "community log: `git log -5`" >>${WKDIR}/jenkins.log
git fetch origin +refs/pull/${CHANGE_ID}/merge
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git checkout -qf FETCH_HEAD
git log -5
git log -5
echo "community log merged: `git log -5`" >>${WKDIR}/jenkins.log
cd ${WK}
cd ${WK}
git pull >/dev/null
git pull >/dev/null
git log -5
git log -5
echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log
'''
'''
} else if (env.CHANGE_URL =~ /\/TDinternal\//) {
} else if (env.CHANGE_URL =~ /\/TDinternal\//) {
sh '''
sh '''
cd ${WK}
cd ${WK}
git pull >/dev/null
git pull >/dev/null
git log -5
echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log
echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log
git fetch origin +refs/pull/${CHANGE_ID}/merge
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git checkout -qf FETCH_HEAD
git log -5
git log -5
echo "tdinternal log merged: `git log -5`" >>${WKDIR}/jenkins.log
cd ${WKC}
cd ${WKC}
git pull >/dev/null
git pull >/dev/null
git log -5
git log -5
echo "community log: `git log -5`" >>${WKDIR}/jenkins.log
'''
'''
} else {
} else {
sh '''
sh '''
...
@@ -113,6 +124,9 @@ def pre_test(){
...
@@ -113,6 +124,9 @@ def pre_test(){
cd ${WKPY}
cd ${WKPY}
git reset --hard
git reset --hard
git pull
git pull
git log -5
echo "python connector log: `git log -5`" >>${WKDIR}/jenkins.log
echo >>${WKDIR}/jenkins.log
'''
'''
return 1
return 1
}
}
...
...
cmake/cmake.define
浏览文件 @
0354f3b4
...
@@ -18,6 +18,33 @@ if (NOT DEFINED TD_GRANT)
...
@@ -18,6 +18,33 @@ if (NOT DEFINED TD_GRANT)
SET(TD_GRANT FALSE)
SET(TD_GRANT FALSE)
endif()
endif()
IF ("${BUILD_HTTP}" STREQUAL "")
IF (TD_LINUX)
IF (TD_ARM_32)
SET(TD_BUILD_HTTP TRUE)
ELSE ()
SET(TD_BUILD_HTTP TRUE)
ENDIF ()
ELSEIF (TD_DARWIN)
SET(TD_BUILD_HTTP TRUE)
ELSE ()
SET(TD_BUILD_HTTP TRUE)
ENDIF ()
ELSEIF (${BUILD_HTTP} MATCHES "false")
SET(TD_BUILD_HTTP FALSE)
ELSEIF (${BUILD_HTTP} MATCHES "true")
SET(TD_BUILD_HTTP TRUE)
ELSEIF (${BUILD_HTTP} MATCHES "internal")
SET(TD_BUILD_HTTP FALSE)
SET(TD_BUILD_TAOSA_INTERNAL TRUE)
ELSE ()
SET(TD_BUILD_HTTP TRUE)
ENDIF ()
IF (TD_BUILD_HTTP)
ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF ()
IF ("${BUILD_TOOLS}" STREQUAL "")
IF ("${BUILD_TOOLS}" STREQUAL "")
IF (TD_LINUX)
IF (TD_LINUX)
IF (TD_ARM_32)
IF (TD_ARM_32)
...
...
include/common/tmsg.h
浏览文件 @
0354f3b4
...
@@ -1134,11 +1134,11 @@ void tFreeSMAlterStbRsp(SMAlterStbRsp* pRsp);
...
@@ -1134,11 +1134,11 @@ void tFreeSMAlterStbRsp(SMAlterStbRsp* pRsp);
int32_t
tSerializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
int32_t
tSerializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
int32_t
tDeserializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
int32_t
tDeserializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
void
tFreeSTableMetaRsp
(
STableMetaRsp
*
pRsp
);
void
tFreeSTableMetaRsp
(
STableMetaRsp
*
pRsp
);
void
tFreeSTableIndexRsp
(
void
*
info
);
void
tFreeSTableIndexRsp
(
void
*
info
);
typedef
struct
{
typedef
struct
{
SArray
*
pMetaRsp
;
// Array of STableMetaRsp
SArray
*
pMetaRsp
;
// Array of STableMetaRsp
SArray
*
pIndexRsp
;
// Array of STableIndexRsp;
SArray
*
pIndexRsp
;
// Array of STableIndexRsp;
}
SSTbHbRsp
;
}
SSTbHbRsp
;
int32_t
tSerializeSSTbHbRsp
(
void
*
buf
,
int32_t
bufLen
,
SSTbHbRsp
*
pRsp
);
int32_t
tSerializeSSTbHbRsp
(
void
*
buf
,
int32_t
bufLen
,
SSTbHbRsp
*
pRsp
);
...
@@ -1305,8 +1305,9 @@ int32_t tSerializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq
...
@@ -1305,8 +1305,9 @@ int32_t tSerializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq
int32_t
tDeserializeSSetStandbyReq
(
void
*
buf
,
int32_t
bufLen
,
SSetStandbyReq
*
pReq
);
int32_t
tDeserializeSSetStandbyReq
(
void
*
buf
,
int32_t
bufLen
,
SSetStandbyReq
*
pReq
);
typedef
struct
{
typedef
struct
{
int32_t
connId
;
int32_t
connId
;
// todo remove
int32_t
queryId
;
int32_t
queryId
;
// todo remove
char
queryStrId
[
TSDB_QUERY_ID_LEN
];
}
SKillQueryReq
;
}
SKillQueryReq
;
int32_t
tSerializeSKillQueryReq
(
void
*
buf
,
int32_t
bufLen
,
SKillQueryReq
*
pReq
);
int32_t
tSerializeSKillQueryReq
(
void
*
buf
,
int32_t
bufLen
,
SKillQueryReq
*
pReq
);
...
...
include/common/ttokendef.h
浏览文件 @
0354f3b4
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
#define TK_BUFFER 60
#define TK_BUFFER 60
#define TK_CACHELAST 61
#define TK_CACHELAST 61
#define TK_COMP 62
#define TK_COMP 62
#define TK_D
AYS
63
#define TK_D
URATION
63
#define TK_NK_VARIABLE 64
#define TK_NK_VARIABLE 64
#define TK_FSYNC 65
#define TK_FSYNC 65
#define TK_MAXROWS 66
#define TK_MAXROWS 66
...
...
include/libs/nodes/cmdnodes.h
浏览文件 @
0354f3b4
...
@@ -89,6 +89,7 @@ typedef struct STableOptions {
...
@@ -89,6 +89,7 @@ typedef struct STableOptions {
ENodeType
type
;
ENodeType
type
;
char
comment
[
TSDB_TB_COMMENT_LEN
];
char
comment
[
TSDB_TB_COMMENT_LEN
];
double
filesFactor
;
double
filesFactor
;
int32_t
delay
;
SNodeList
*
pRollupFuncs
;
SNodeList
*
pRollupFuncs
;
int32_t
ttl
;
int32_t
ttl
;
SNodeList
*
pSma
;
SNodeList
*
pSma
;
...
@@ -286,6 +287,11 @@ typedef struct SKillStmt {
...
@@ -286,6 +287,11 @@ typedef struct SKillStmt {
int32_t
targetId
;
int32_t
targetId
;
}
SKillStmt
;
}
SKillStmt
;
typedef
struct
SKillQueryStmt
{
ENodeType
type
;
char
queryId
[
TSDB_QUERY_ID_LEN
];
}
SKillQueryStmt
;
typedef
struct
SStreamOptions
{
typedef
struct
SStreamOptions
{
ENodeType
type
;
ENodeType
type
;
int8_t
triggerType
;
int8_t
triggerType
;
...
...
include/libs/nodes/nodes.h
浏览文件 @
0354f3b4
...
@@ -204,6 +204,7 @@ typedef enum ENodeType {
...
@@ -204,6 +204,7 @@ typedef enum ENodeType {
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
,
...
...
include/libs/nodes/plannodes.h
浏览文件 @
0354f3b4
...
@@ -34,7 +34,13 @@ typedef struct SLogicNode {
...
@@ -34,7 +34,13 @@ typedef struct SLogicNode {
uint8_t
precision
;
uint8_t
precision
;
}
SLogicNode
;
}
SLogicNode
;
typedef
enum
EScanType
{
SCAN_TYPE_TAG
=
1
,
SCAN_TYPE_TABLE
,
SCAN_TYPE_SYSTEM_TABLE
,
SCAN_TYPE_STREAM
}
EScanType
;
typedef
enum
EScanType
{
SCAN_TYPE_TAG
=
1
,
SCAN_TYPE_TABLE
,
SCAN_TYPE_SYSTEM_TABLE
,
SCAN_TYPE_STREAM
,
SCAN_TYPE_TABLE_MERGE
}
EScanType
;
typedef
struct
SScanLogicNode
{
typedef
struct
SScanLogicNode
{
SLogicNode
node
;
SLogicNode
node
;
...
@@ -262,6 +268,7 @@ typedef struct STableScanPhysiNode {
...
@@ -262,6 +268,7 @@ typedef struct STableScanPhysiNode {
}
STableScanPhysiNode
;
}
STableScanPhysiNode
;
typedef
STableScanPhysiNode
STableSeqScanPhysiNode
;
typedef
STableScanPhysiNode
STableSeqScanPhysiNode
;
typedef
STableScanPhysiNode
STableMergeScanPhysiNode
;
typedef
STableScanPhysiNode
SStreamScanPhysiNode
;
typedef
STableScanPhysiNode
SStreamScanPhysiNode
;
typedef
struct
SProjectPhysiNode
{
typedef
struct
SProjectPhysiNode
{
...
...
include/util/tdef.h
浏览文件 @
0354f3b4
...
@@ -222,6 +222,8 @@ typedef enum ELogicConditionType {
...
@@ -222,6 +222,8 @@ typedef enum ELogicConditionType {
#define TSDB_APP_NAME_LEN TSDB_UNI_LEN
#define TSDB_APP_NAME_LEN TSDB_UNI_LEN
#define TSDB_TB_COMMENT_LEN 1025
#define TSDB_TB_COMMENT_LEN 1025
#define TSDB_QUERY_ID_LEN 26
/**
/**
* In some scenarios uint16_t (0~65535) is used to store the row len.
* In some scenarios uint16_t (0~65535) is used to store the row len.
* - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header.
* - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header.
...
@@ -341,6 +343,9 @@ typedef enum ELogicConditionType {
...
@@ -341,6 +343,9 @@ typedef enum ELogicConditionType {
#define TSDB_DB_SCHEMALESS_OFF 0
#define TSDB_DB_SCHEMALESS_OFF 0
#define TSDB_DEFAULT_DB_SCHEMALESS TSDB_DB_SCHEMALESS_OFF
#define TSDB_DEFAULT_DB_SCHEMALESS TSDB_DB_SCHEMALESS_OFF
// #define TSDB_MIN_ROLLUP_DELAY 1
// #define TSDB_MAX_ROLLUP_DELAY 10
// #define TSDB_DEFAULT_ROLLUP_DELAY 1
#define TSDB_MIN_ROLLUP_FILE_FACTOR 0
#define TSDB_MIN_ROLLUP_FILE_FACTOR 0
#define TSDB_MAX_ROLLUP_FILE_FACTOR 10
#define TSDB_MAX_ROLLUP_FILE_FACTOR 10
#define TSDB_DEFAULT_ROLLUP_FILE_FACTOR 0.1
#define TSDB_DEFAULT_ROLLUP_FILE_FACTOR 0.1
...
...
source/common/src/tmsg.c
浏览文件 @
0354f3b4
...
@@ -3369,8 +3369,7 @@ int32_t tSerializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq)
...
@@ -3369,8 +3369,7 @@ int32_t tSerializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq)
tEncoderInit
(
&
encoder
,
buf
,
bufLen
);
tEncoderInit
(
&
encoder
,
buf
,
bufLen
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
connId
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
queryStrId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
queryId
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
int32_t
tlen
=
encoder
.
pos
;
...
@@ -3383,8 +3382,7 @@ int32_t tDeserializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq
...
@@ -3383,8 +3382,7 @@ int32_t tDeserializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq
tDecoderInit
(
&
decoder
,
buf
,
bufLen
);
tDecoderInit
(
&
decoder
,
buf
,
bufLen
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
connId
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
queryStrId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
queryId
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
0354f3b4
...
@@ -407,6 +407,7 @@ static int32_t mndSetUpdateSmaStbCommitLogs(SMnode *pMnode, STrans *pTrans, SStb
...
@@ -407,6 +407,7 @@ static int32_t mndSetUpdateSmaStbCommitLogs(SMnode *pMnode, STrans *pTrans, SStb
return
0
;
return
0
;
}
}
#if 0
static int32_t mndSetCreateSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SSmaObj *pSma) {
static int32_t mndSetCreateSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SSmaObj *pSma) {
SSdb *pSdb = pMnode->pSdb;
SSdb *pSdb = pMnode->pSdb;
SVgObj *pVgroup = NULL;
SVgObj *pVgroup = NULL;
...
@@ -445,6 +446,7 @@ static int32_t mndSetCreateSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
...
@@ -445,6 +446,7 @@ static int32_t mndSetCreateSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
return 0;
return 0;
}
}
#endif
static
int32_t
mndSetCreateSmaVgroupRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
static
int32_t
mndSetCreateSmaVgroupRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
SSmaObj
*
pSma
)
{
SSmaObj
*
pSma
)
{
...
@@ -579,7 +581,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
...
@@ -579,7 +581,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
if
(
mndSetCreateSmaCommitLogs
(
pMnode
,
pTrans
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaCommitLogs
(
pMnode
,
pTrans
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
&
streamObj
.
fixedSinkVg
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
&
streamObj
.
fixedSinkVg
)
!=
0
)
goto
_OVER
;
if
(
mndSetUpdateSmaStbCommitLogs
(
pMnode
,
pTrans
,
pStb
)
!=
0
)
goto
_OVER
;
if
(
mndSetUpdateSmaStbCommitLogs
(
pMnode
,
pTrans
,
pStb
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
smaObj
)
!=
0
)
goto
_OVER
;
//
if (mndSetCreateSmaRedoActions(pMnode, pTrans, pDb, &smaObj) != 0) goto _OVER;
if
(
mndSetCreateSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
streamObj
.
fixedSinkVg
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
streamObj
.
fixedSinkVg
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndAddStreamToTrans
(
pMnode
,
&
streamObj
,
pCreate
->
ast
,
STREAM_TRIGGER_AT_ONCE
,
0
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndAddStreamToTrans
(
pMnode
,
&
streamObj
,
pCreate
->
ast
,
STREAM_TRIGGER_AT_ONCE
,
0
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
@@ -734,6 +736,7 @@ static int32_t mndSetDropSmaVgroupCommitLogs(SMnode *pMnode, STrans *pTrans, SVg
...
@@ -734,6 +736,7 @@ static int32_t mndSetDropSmaVgroupCommitLogs(SMnode *pMnode, STrans *pTrans, SVg
return
0
;
return
0
;
}
}
#if 0
static int32_t mndSetDropSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SSmaObj *pSma) {
static int32_t mndSetDropSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SSmaObj *pSma) {
SSdb *pSdb = pMnode->pSdb;
SSdb *pSdb = pMnode->pSdb;
SVgObj *pVgroup = NULL;
SVgObj *pVgroup = NULL;
...
@@ -774,6 +777,7 @@ static int32_t mndSetDropSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
...
@@ -774,6 +777,7 @@ static int32_t mndSetDropSmaRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
return 0;
return 0;
}
}
#endif
static
int32_t
mndSetDropSmaVgroupRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
static
int32_t
mndSetDropSmaVgroupRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
0
;
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
0
;
...
@@ -824,7 +828,7 @@ static int32_t mndDropSma(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SSmaObj *p
...
@@ -824,7 +828,7 @@ static int32_t mndDropSma(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SSmaObj *p
if
(
mndSetDropSmaCommitLogs
(
pMnode
,
pTrans
,
pSma
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaCommitLogs
(
pMnode
,
pTrans
,
pSma
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetUpdateSmaStbCommitLogs
(
pMnode
,
pTrans
,
pStb
)
!=
0
)
goto
_OVER
;
if
(
mndSetUpdateSmaStbCommitLogs
(
pMnode
,
pTrans
,
pStb
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaRedoActions
(
pMnode
,
pTrans
,
pDb
,
pSma
)
!=
0
)
goto
_OVER
;
//
if (mndSetDropSmaRedoActions(pMnode, pTrans, pDb, pSma) != 0) goto _OVER;
if
(
mndSetDropSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
@@ -854,7 +858,7 @@ int32_t mndDropSmasByStb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *p
...
@@ -854,7 +858,7 @@ int32_t mndDropSmasByStb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *p
if
(
mndSetDropSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
pVgroup
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaCommitLogs
(
pMnode
,
pTrans
,
pSma
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaCommitLogs
(
pMnode
,
pTrans
,
pSma
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropSmaRedoActions
(
pMnode
,
pTrans
,
pDb
,
pSma
)
!=
0
)
goto
_OVER
;
//
if (mndSetDropSmaRedoActions(pMnode, pTrans, pDb, pSma) != 0) goto _OVER;
mndReleaseVgroup
(
pMnode
,
pVgroup
);
mndReleaseVgroup
(
pMnode
,
pVgroup
);
pVgroup
=
NULL
;
pVgroup
=
NULL
;
}
}
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
0354f3b4
...
@@ -323,10 +323,14 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew) {
...
@@ -323,10 +323,14 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew) {
pOld
->
smaVer
=
pNew
->
smaVer
;
pOld
->
smaVer
=
pNew
->
smaVer
;
pOld
->
nextColId
=
pNew
->
nextColId
;
pOld
->
nextColId
=
pNew
->
nextColId
;
pOld
->
ttl
=
pNew
->
ttl
;
pOld
->
ttl
=
pNew
->
ttl
;
pOld
->
numOfColumns
=
pNew
->
numOfColumns
;
if
(
pNew
->
numOfColumns
>
0
)
{
pOld
->
numOfTags
=
pNew
->
numOfTags
;
pOld
->
numOfColumns
=
pNew
->
numOfColumns
;
memcpy
(
pOld
->
pColumns
,
pNew
->
pColumns
,
pOld
->
numOfColumns
*
sizeof
(
SSchema
));
memcpy
(
pOld
->
pColumns
,
pNew
->
pColumns
,
pOld
->
numOfColumns
*
sizeof
(
SSchema
));
memcpy
(
pOld
->
pTags
,
pNew
->
pTags
,
pOld
->
numOfTags
*
sizeof
(
SSchema
));
}
if
(
pNew
->
numOfTags
>
0
)
{
pOld
->
numOfTags
=
pNew
->
numOfTags
;
memcpy
(
pOld
->
pTags
,
pNew
->
pTags
,
pOld
->
numOfTags
*
sizeof
(
SSchema
));
}
if
(
pNew
->
commentLen
!=
0
)
{
if
(
pNew
->
commentLen
!=
0
)
{
memcpy
(
pOld
->
comment
,
pNew
->
comment
,
pNew
->
commentLen
);
memcpy
(
pOld
->
comment
,
pNew
->
comment
,
pNew
->
commentLen
);
}
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
0354f3b4
...
@@ -1480,14 +1480,6 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
...
@@ -1480,14 +1480,6 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
return
code
;
return
code
;
}
}
static
int32_t
physiStreamScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
return
physiTableScanNodeToJson
(
pObj
,
pJson
);
}
static
int32_t
jsonToPhysiStreamScanNode
(
const
SJson
*
pJson
,
void
*
pObj
)
{
return
jsonToPhysiTableScanNode
(
pJson
,
pObj
);
}
static
const
char
*
jkSysTableScanPhysiPlanMnodeEpSet
=
"MnodeEpSet"
;
static
const
char
*
jkSysTableScanPhysiPlanMnodeEpSet
=
"MnodeEpSet"
;
static
const
char
*
jkSysTableScanPhysiPlanShowRewrite
=
"ShowRewrite"
;
static
const
char
*
jkSysTableScanPhysiPlanShowRewrite
=
"ShowRewrite"
;
static
const
char
*
jkSysTableScanPhysiPlanAccountId
=
"AccountId"
;
static
const
char
*
jkSysTableScanPhysiPlanAccountId
=
"AccountId"
;
...
@@ -3964,9 +3956,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
...
@@ -3964,9 +3956,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
return
physiTagScanNodeToJson
(
pObj
,
pJson
);
return
physiTagScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
return
physiTableScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
return
physi
Stream
ScanNodeToJson
(
pObj
,
pJson
);
return
physi
Table
ScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
return
physiSysTableScanNodeToJson
(
pObj
,
pJson
);
return
physiSysTableScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:
...
@@ -4097,9 +4089,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
...
@@ -4097,9 +4089,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
return
jsonToPhysiTagScanNode
(
pJson
,
pObj
);
return
jsonToPhysiTagScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
return
jsonToPhysiTableScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
return
jsonToPhysi
Stream
ScanNode
(
pJson
,
pObj
);
return
jsonToPhysi
Table
ScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
return
jsonToPhysiSysTableScanNode
(
pJson
,
pObj
);
return
jsonToPhysiSysTableScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
0354f3b4
...
@@ -209,9 +209,10 @@ SNode* nodesMakeNode(ENodeType type) {
...
@@ -209,9 +209,10 @@ SNode* nodesMakeNode(ENodeType type) {
case
QUERY_NODE_SHOW_CREATE_STABLE_STMT
:
case
QUERY_NODE_SHOW_CREATE_STABLE_STMT
:
case
QUERY_NODE_SHOW_TRANSACTIONS_STMT
:
case
QUERY_NODE_SHOW_TRANSACTIONS_STMT
:
return
makeNode
(
type
,
sizeof
(
SShowStmt
));
return
makeNode
(
type
,
sizeof
(
SShowStmt
));
case
QUERY_NODE_KILL_CONNECTION_STMT
:
case
QUERY_NODE_KILL_QUERY_STMT
:
case
QUERY_NODE_KILL_QUERY_STMT
:
return
makeNode
(
type
,
sizeof
(
SKillQueryStmt
));
case
QUERY_NODE_KILL_TRANSACTION_STMT
:
case
QUERY_NODE_KILL_TRANSACTION_STMT
:
case
QUERY_NODE_KILL_CONNECTION_STMT
:
return
makeNode
(
type
,
sizeof
(
SKillStmt
));
return
makeNode
(
type
,
sizeof
(
SKillStmt
));
case
QUERY_NODE_DELETE_STMT
:
case
QUERY_NODE_DELETE_STMT
:
return
makeNode
(
type
,
sizeof
(
SDeleteStmt
));
return
makeNode
(
type
,
sizeof
(
SDeleteStmt
));
...
@@ -251,6 +252,8 @@ SNode* nodesMakeNode(ENodeType type) {
...
@@ -251,6 +252,8 @@ SNode* nodesMakeNode(ENodeType type) {
return
makeNode
(
type
,
sizeof
(
STableScanPhysiNode
));
return
makeNode
(
type
,
sizeof
(
STableScanPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN
:
return
makeNode
(
type
,
sizeof
(
STableSeqScanPhysiNode
));
return
makeNode
(
type
,
sizeof
(
STableSeqScanPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
return
makeNode
(
type
,
sizeof
(
STableMergeScanPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
return
makeNode
(
type
,
sizeof
(
SStreamScanPhysiNode
));
return
makeNode
(
type
,
sizeof
(
SStreamScanPhysiNode
));
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
:
...
...
source/libs/parser/inc/parAst.h
浏览文件 @
0354f3b4
...
@@ -60,6 +60,7 @@ typedef enum EDatabaseOptionType {
...
@@ -60,6 +60,7 @@ typedef enum EDatabaseOptionType {
typedef
enum
ETableOptionType
{
typedef
enum
ETableOptionType
{
TABLE_OPTION_COMMENT
=
1
,
TABLE_OPTION_COMMENT
=
1
,
TABLE_OPTION_FILE_FACTOR
,
TABLE_OPTION_FILE_FACTOR
,
TABLE_OPTION_DELAY
,
TABLE_OPTION_ROLLUP
,
TABLE_OPTION_ROLLUP
,
TABLE_OPTION_TTL
,
TABLE_OPTION_TTL
,
TABLE_OPTION_SMA
TABLE_OPTION_SMA
...
@@ -187,6 +188,7 @@ SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const
...
@@ -187,6 +188,7 @@ SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const
SNode
*
pOptions
,
SNode
*
pQuery
);
SNode
*
pOptions
,
SNode
*
pQuery
);
SNode
*
createDropStreamStmt
(
SAstCreateContext
*
pCxt
,
bool
ignoreNotExists
,
const
SToken
*
pStreamName
);
SNode
*
createDropStreamStmt
(
SAstCreateContext
*
pCxt
,
bool
ignoreNotExists
,
const
SToken
*
pStreamName
);
SNode
*
createKillStmt
(
SAstCreateContext
*
pCxt
,
ENodeType
type
,
const
SToken
*
pId
);
SNode
*
createKillStmt
(
SAstCreateContext
*
pCxt
,
ENodeType
type
,
const
SToken
*
pId
);
SNode
*
createKillQueryStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pQueryId
);
SNode
*
createBalanceVgroupStmt
(
SAstCreateContext
*
pCxt
);
SNode
*
createBalanceVgroupStmt
(
SAstCreateContext
*
pCxt
);
SNode
*
createMergeVgroupStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pVgId1
,
const
SToken
*
pVgId2
);
SNode
*
createMergeVgroupStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pVgId1
,
const
SToken
*
pVgId2
);
SNode
*
createRedistributeVgroupStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pVgId
,
SNodeList
*
pDnodes
);
SNode
*
createRedistributeVgroupStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pVgId
,
SNodeList
*
pDnodes
);
...
...
source/libs/parser/inc/sql.y
浏览文件 @
0354f3b4
...
@@ -168,8 +168,8 @@ db_options(A) ::= .
...
@@ -168,8 +168,8 @@ db_options(A) ::= .
db_options(A) ::= db_options(B) BUFFER NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_BUFFER, &C); }
db_options(A) ::= db_options(B) BUFFER NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_BUFFER, &C); }
db_options(A) ::= db_options(B) CACHELAST NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHELAST, &C); }
db_options(A) ::= db_options(B) CACHELAST NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHELAST, &C); }
db_options(A) ::= db_options(B) COMP NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_COMP, &C); }
db_options(A) ::= db_options(B) COMP NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_COMP, &C); }
db_options(A) ::= db_options(B) D
AYS NK_INTEGER(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) D
URATION NK_INTEGER(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) D
AYS NK_VARIABLE(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) D
URATION NK_VARIABLE(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) FSYNC NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_FSYNC, &C); }
db_options(A) ::= db_options(B) FSYNC NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_FSYNC, &C); }
db_options(A) ::= db_options(B) MAXROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MAXROWS, &C); }
db_options(A) ::= db_options(B) MAXROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MAXROWS, &C); }
db_options(A) ::= db_options(B) MINROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MINROWS, &C); }
db_options(A) ::= db_options(B) MINROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MINROWS, &C); }
...
@@ -317,8 +317,9 @@ tags_def(A) ::= TAGS NK_LP column_def_list(B) NK_RP.
...
@@ -317,8 +317,9 @@ tags_def(A) ::= TAGS NK_LP column_def_list(B) NK_RP.
table_options(A) ::= . { A = createDefaultTableOptions(pCxt); }
table_options(A) ::= . { A = createDefaultTableOptions(pCxt); }
table_options(A) ::= table_options(B) COMMENT NK_STRING(C). { A = setTableOption(pCxt, B, TABLE_OPTION_COMMENT, &C); }
table_options(A) ::= table_options(B) COMMENT NK_STRING(C). { A = setTableOption(pCxt, B, TABLE_OPTION_COMMENT, &C); }
//table_options(A) ::= table_options(B) DELAY NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_DELAY, &C); }
table_options(A) ::= table_options(B) FILE_FACTOR NK_FLOAT(C). { A = setTableOption(pCxt, B, TABLE_OPTION_FILE_FACTOR, &C); }
table_options(A) ::= table_options(B) FILE_FACTOR NK_FLOAT(C). { A = setTableOption(pCxt, B, TABLE_OPTION_FILE_FACTOR, &C); }
table_options(A) ::= table_options(B) ROLLUP NK_LP
func_name_list(C) NK_RP.
{ A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); }
table_options(A) ::= table_options(B) ROLLUP NK_LP
rollup_func_list(C) NK_RP.
{ A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); }
table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); }
table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); }
table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); }
table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); }
...
@@ -330,6 +331,15 @@ alter_table_options(A) ::= alter_table_options(B) alter_table_option(C).
...
@@ -330,6 +331,15 @@ alter_table_options(A) ::= alter_table_options(B) alter_table_option(C).
alter_table_option(A) ::= COMMENT NK_STRING(B). { A.type = TABLE_OPTION_COMMENT; A.val = B; }
alter_table_option(A) ::= COMMENT NK_STRING(B). { A.type = TABLE_OPTION_COMMENT; A.val = B; }
alter_table_option(A) ::= TTL NK_INTEGER(B). { A.type = TABLE_OPTION_TTL; A.val = B; }
alter_table_option(A) ::= TTL NK_INTEGER(B). { A.type = TABLE_OPTION_TTL; A.val = B; }
%type rollup_func_list { SNodeList* }
%destructor rollup_func_list { nodesDestroyList($$); }
rollup_func_list(A) ::= rollup_func_name(B). { A = createNodeList(pCxt, B); }
rollup_func_list(A) ::= rollup_func_list(B) NK_COMMA rollup_func_name(C). { A = addNodeToList(pCxt, B, C); }
rollup_func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); }
rollup_func_name(A) ::= FIRST(B). { A = createFunctionNode(pCxt, &B, NULL); }
rollup_func_name(A) ::= LAST(B). { A = createFunctionNode(pCxt, &B, NULL); }
%type col_name_list { SNodeList* }
%type col_name_list { SNodeList* }
%destructor col_name_list { nodesDestroyList($$); }
%destructor col_name_list { nodesDestroyList($$); }
col_name_list(A) ::= col_name(B). { A = createNodeList(pCxt, B); }
col_name_list(A) ::= col_name(B). { A = createNodeList(pCxt, B); }
...
@@ -378,13 +388,6 @@ table_name_cond(A) ::= table_name(B).
...
@@ -378,13 +388,6 @@ table_name_cond(A) ::= table_name(B).
from_db_opt(A) ::= . { A = createDefaultDatabaseCondValue(pCxt); }
from_db_opt(A) ::= . { A = createDefaultDatabaseCondValue(pCxt); }
from_db_opt(A) ::= FROM db_name(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); }
from_db_opt(A) ::= FROM db_name(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); }
%type func_name_list { SNodeList* }
%destructor func_name_list { nodesDestroyList($$); }
func_name_list(A) ::= func_name(B). { A = createNodeList(pCxt, B); }
func_name_list(A) ::= func_name_list(B) NK_COMMA func_name(C). { A = addNodeToList(pCxt, B, C); }
func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); }
/************************************************ create index ********************************************************/
/************************************************ create index ********************************************************/
cmd ::= CREATE SMA INDEX not_exists_opt(D)
cmd ::= CREATE SMA INDEX not_exists_opt(D)
index_name(A) ON table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, &A, &B, NULL, C); }
index_name(A) ON table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, &A, &B, NULL, C); }
...
@@ -466,7 +469,7 @@ stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C).
...
@@ -466,7 +469,7 @@ stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C).
/************************************************ kill connection/query ***********************************************/
/************************************************ kill connection/query ***********************************************/
cmd ::= KILL CONNECTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &A); }
cmd ::= KILL CONNECTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &A); }
cmd ::= KILL QUERY NK_
INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT
, &A); }
cmd ::= KILL QUERY NK_
STRING(A). { pCxt->pRootNode = createKillQueryStmt(pCxt
, &A); }
cmd ::= KILL TRANSACTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &A); }
cmd ::= KILL TRANSACTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &A); }
/************************************************ merge/redistribute/ vgroup ******************************************/
/************************************************ merge/redistribute/ vgroup ******************************************/
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
0354f3b4
...
@@ -804,10 +804,10 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
...
@@ -804,10 +804,10 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
case
DB_OPTION_RETENTIONS
:
case
DB_OPTION_RETENTIONS
:
((
SDatabaseOptions
*
)
pOptions
)
->
pRetentions
=
pVal
;
((
SDatabaseOptions
*
)
pOptions
)
->
pRetentions
=
pVal
;
break
;
break
;
// case DB_OPTION_SCHEMALESS:
// case DB_OPTION_SCHEMALESS:
// ((SDatabaseOptions*)pOptions)->schemaless = taosStr2Int8(((SToken*)pVal)->z, NULL, 10);
// ((SDatabaseOptions*)pOptions)->schemaless = taosStr2Int8(((SToken*)pVal)->z, NULL, 10);
// ((SDatabaseOptions*)pOptions)->schemaless = 0;
// ((SDatabaseOptions*)pOptions)->schemaless = 0;
// break;
// break;
default:
default:
break
;
break
;
}
}
...
@@ -867,6 +867,7 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) {
...
@@ -867,6 +867,7 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) {
CHECK_PARSER_STATUS
(
pCxt
);
CHECK_PARSER_STATUS
(
pCxt
);
STableOptions
*
pOptions
=
(
STableOptions
*
)
nodesMakeNode
(
QUERY_NODE_TABLE_OPTIONS
);
STableOptions
*
pOptions
=
(
STableOptions
*
)
nodesMakeNode
(
QUERY_NODE_TABLE_OPTIONS
);
CHECK_OUT_OF_MEM
(
pOptions
);
CHECK_OUT_OF_MEM
(
pOptions
);
// pOptions->delay = TSDB_DEFAULT_ROLLUP_DELAY;
pOptions
->
filesFactor
=
TSDB_DEFAULT_ROLLUP_FILE_FACTOR
;
pOptions
->
filesFactor
=
TSDB_DEFAULT_ROLLUP_FILE_FACTOR
;
pOptions
->
ttl
=
TSDB_DEFAULT_TABLE_TTL
;
pOptions
->
ttl
=
TSDB_DEFAULT_TABLE_TTL
;
return
(
SNode
*
)
pOptions
;
return
(
SNode
*
)
pOptions
;
...
@@ -876,7 +877,7 @@ SNode* createAlterTableOptions(SAstCreateContext* pCxt) {
...
@@ -876,7 +877,7 @@ SNode* createAlterTableOptions(SAstCreateContext* pCxt) {
CHECK_PARSER_STATUS
(
pCxt
);
CHECK_PARSER_STATUS
(
pCxt
);
STableOptions
*
pOptions
=
(
STableOptions
*
)
nodesMakeNode
(
QUERY_NODE_TABLE_OPTIONS
);
STableOptions
*
pOptions
=
(
STableOptions
*
)
nodesMakeNode
(
QUERY_NODE_TABLE_OPTIONS
);
CHECK_OUT_OF_MEM
(
pOptions
);
CHECK_OUT_OF_MEM
(
pOptions
);
pOptions
->
filesFactor
=
-
1
;
pOptions
->
delay
=
-
1
;
pOptions
->
ttl
=
-
1
;
pOptions
->
ttl
=
-
1
;
return
(
SNode
*
)
pOptions
;
return
(
SNode
*
)
pOptions
;
}
}
...
@@ -890,8 +891,8 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType
...
@@ -890,8 +891,8 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType
sizeof
(((
STableOptions
*
)
pOptions
)
->
comment
));
sizeof
(((
STableOptions
*
)
pOptions
)
->
comment
));
}
}
break
;
break
;
case
TABLE_OPTION_
FILE_FACTOR
:
case
TABLE_OPTION_
DELAY
:
((
STableOptions
*
)
pOptions
)
->
filesFactor
=
taosStr2Double
(((
SToken
*
)
pVal
)
->
z
,
NULL
);
((
STableOptions
*
)
pOptions
)
->
delay
=
taosStr2Int32
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
break
;
break
;
case
TABLE_OPTION_ROLLUP
:
case
TABLE_OPTION_ROLLUP
:
((
STableOptions
*
)
pOptions
)
->
pRollupFuncs
=
pVal
;
((
STableOptions
*
)
pOptions
)
->
pRollupFuncs
=
pVal
;
...
@@ -1431,7 +1432,7 @@ SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const
...
@@ -1431,7 +1432,7 @@ SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const
CHECK_PARSER_STATUS
(
pCxt
);
CHECK_PARSER_STATUS
(
pCxt
);
SDropStreamStmt
*
pStmt
=
(
SDropStreamStmt
*
)
nodesMakeNode
(
QUERY_NODE_DROP_STREAM_STMT
);
SDropStreamStmt
*
pStmt
=
(
SDropStreamStmt
*
)
nodesMakeNode
(
QUERY_NODE_DROP_STREAM_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
CHECK_OUT_OF_MEM
(
pStmt
);
strncpy
(
pStmt
->
streamName
,
pStreamName
->
z
,
pStreamName
->
n
);
strncpy
(
pStmt
->
streamName
,
pStreamName
->
z
,
TMIN
(
pStreamName
->
n
,
sizeof
(
pStmt
->
streamName
)
-
1
)
);
pStmt
->
ignoreNotExists
=
ignoreNotExists
;
pStmt
->
ignoreNotExists
=
ignoreNotExists
;
return
(
SNode
*
)
pStmt
;
return
(
SNode
*
)
pStmt
;
}
}
...
@@ -1444,6 +1445,14 @@ SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId
...
@@ -1444,6 +1445,14 @@ SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId
return
(
SNode
*
)
pStmt
;
return
(
SNode
*
)
pStmt
;
}
}
SNode
*
createKillQueryStmt
(
SAstCreateContext
*
pCxt
,
const
SToken
*
pQueryId
)
{
CHECK_PARSER_STATUS
(
pCxt
);
SKillQueryStmt
*
pStmt
=
(
SKillQueryStmt
*
)
nodesMakeNode
(
QUERY_NODE_KILL_QUERY_STMT
);
CHECK_OUT_OF_MEM
(
pStmt
);
strncpy
(
pStmt
->
queryId
,
pQueryId
->
z
,
TMIN
(
pQueryId
->
n
,
sizeof
(
pStmt
->
queryId
)
-
1
));
return
(
SNode
*
)
pStmt
;
}
SNode
*
createBalanceVgroupStmt
(
SAstCreateContext
*
pCxt
)
{
SNode
*
createBalanceVgroupStmt
(
SAstCreateContext
*
pCxt
)
{
CHECK_PARSER_STATUS
(
pCxt
);
CHECK_PARSER_STATUS
(
pCxt
);
SBalanceVgroupStmt
*
pStmt
=
(
SBalanceVgroupStmt
*
)
nodesMakeNode
(
QUERY_NODE_BALANCE_VGROUP_STMT
);
SBalanceVgroupStmt
*
pStmt
=
(
SBalanceVgroupStmt
*
)
nodesMakeNode
(
QUERY_NODE_BALANCE_VGROUP_STMT
);
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
0354f3b4
...
@@ -68,7 +68,7 @@ static SKeyword keywordTable[] = {
...
@@ -68,7 +68,7 @@ static SKeyword keywordTable[] = {
{
"CONTAINS"
,
TK_CONTAINS
},
{
"CONTAINS"
,
TK_CONTAINS
},
{
"DATABASE"
,
TK_DATABASE
},
{
"DATABASE"
,
TK_DATABASE
},
{
"DATABASES"
,
TK_DATABASES
},
{
"DATABASES"
,
TK_DATABASES
},
{
"DAYS"
,
TK_DAYS
},
//
{"DAYS", TK_DAYS},
{
"DBS"
,
TK_DBS
},
{
"DBS"
,
TK_DBS
},
{
"DELETE"
,
TK_DELETE
},
{
"DELETE"
,
TK_DELETE
},
{
"DESC"
,
TK_DESC
},
{
"DESC"
,
TK_DESC
},
...
@@ -78,6 +78,7 @@ static SKeyword keywordTable[] = {
...
@@ -78,6 +78,7 @@ static SKeyword keywordTable[] = {
{
"DNODES"
,
TK_DNODES
},
{
"DNODES"
,
TK_DNODES
},
{
"DOUBLE"
,
TK_DOUBLE
},
{
"DOUBLE"
,
TK_DOUBLE
},
{
"DROP"
,
TK_DROP
},
{
"DROP"
,
TK_DROP
},
{
"DURATION"
,
TK_DURATION
},
{
"EXISTS"
,
TK_EXISTS
},
{
"EXISTS"
,
TK_EXISTS
},
{
"EXPLAIN"
,
TK_EXPLAIN
},
{
"EXPLAIN"
,
TK_EXPLAIN
},
{
"FILE_FACTOR"
,
TK_FILE_FACTOR
},
{
"FILE_FACTOR"
,
TK_FILE_FACTOR
},
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
0354f3b4
...
@@ -2839,6 +2839,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt
...
@@ -2839,6 +2839,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checTableFactorOption
(
pCxt
,
pStmt
->
pOptions
->
filesFactor
);
code
=
checTableFactorOption
(
pCxt
,
pStmt
->
pOptions
->
filesFactor
);
}
}
// if (TSDB_CODE_SUCCESS == code) {
// code = checkRangeOption(pCxt, "delay", pStmt->pOptions->delay, TSDB_MIN_ROLLUP_DELAY, TSDB_MAX_ROLLUP_DELAY);
// }
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkTableRollupOption
(
pCxt
,
pStmt
->
pOptions
->
pRollupFuncs
);
code
=
checkTableRollupOption
(
pCxt
,
pStmt
->
pOptions
->
pRollupFuncs
);
}
}
...
@@ -3081,6 +3084,7 @@ static int32_t buildRollupAst(STranslateContext* pCxt, SCreateTableStmt* pStmt,
...
@@ -3081,6 +3084,7 @@ static int32_t buildRollupAst(STranslateContext* pCxt, SCreateTableStmt* pStmt,
static
int32_t
buildCreateStbReq
(
STranslateContext
*
pCxt
,
SCreateTableStmt
*
pStmt
,
SMCreateStbReq
*
pReq
)
{
static
int32_t
buildCreateStbReq
(
STranslateContext
*
pCxt
,
SCreateTableStmt
*
pStmt
,
SMCreateStbReq
*
pReq
)
{
pReq
->
igExists
=
pStmt
->
ignoreExists
;
pReq
->
igExists
=
pStmt
->
ignoreExists
;
// pReq->delay = pStmt->pOptions->delay;
pReq
->
xFilesFactor
=
pStmt
->
pOptions
->
filesFactor
;
pReq
->
xFilesFactor
=
pStmt
->
pOptions
->
filesFactor
;
pReq
->
ttl
=
pStmt
->
pOptions
->
ttl
;
pReq
->
ttl
=
pStmt
->
pOptions
->
ttl
;
columnDefNodeToField
(
pStmt
->
pCols
,
&
pReq
->
pColumns
);
columnDefNodeToField
(
pStmt
->
pCols
,
&
pReq
->
pColumns
);
...
@@ -3626,9 +3630,9 @@ static int32_t translateKillConnection(STranslateContext* pCxt, SKillStmt* pStmt
...
@@ -3626,9 +3630,9 @@ static int32_t translateKillConnection(STranslateContext* pCxt, SKillStmt* pStmt
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_CONN
,
(
FSerializeFunc
)
tSerializeSKillQueryReq
,
&
killReq
);
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_CONN
,
(
FSerializeFunc
)
tSerializeSKillQueryReq
,
&
killReq
);
}
}
static
int32_t
translateKillQuery
(
STranslateContext
*
pCxt
,
SKillStmt
*
pStmt
)
{
static
int32_t
translateKillQuery
(
STranslateContext
*
pCxt
,
SKill
Query
Stmt
*
pStmt
)
{
SKillQueryReq
killReq
=
{
0
};
SKillQueryReq
killReq
=
{
0
};
killReq
.
queryId
=
pStmt
->
targetId
;
strcpy
(
killReq
.
queryStrId
,
pStmt
->
queryId
)
;
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_QUERY
,
(
FSerializeFunc
)
tSerializeSKillQueryReq
,
&
killReq
);
return
buildCmdMsg
(
pCxt
,
TDMT_MND_KILL_QUERY
,
(
FSerializeFunc
)
tSerializeSKillQueryReq
,
&
killReq
);
}
}
...
@@ -3970,7 +3974,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
...
@@ -3970,7 +3974,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
code
=
translateKillConnection
(
pCxt
,
(
SKillStmt
*
)
pNode
);
code
=
translateKillConnection
(
pCxt
,
(
SKillStmt
*
)
pNode
);
break
;
break
;
case
QUERY_NODE_KILL_QUERY_STMT
:
case
QUERY_NODE_KILL_QUERY_STMT
:
code
=
translateKillQuery
(
pCxt
,
(
SKillStmt
*
)
pNode
);
code
=
translateKillQuery
(
pCxt
,
(
SKill
Query
Stmt
*
)
pNode
);
break
;
break
;
case
QUERY_NODE_KILL_TRANSACTION_STMT
:
case
QUERY_NODE_KILL_TRANSACTION_STMT
:
code
=
translateKillTransaction
(
pCxt
,
(
SKillStmt
*
)
pNode
);
code
=
translateKillTransaction
(
pCxt
,
(
SKillStmt
*
)
pNode
);
...
...
source/libs/parser/src/sql.c
浏览文件 @
0354f3b4
...
@@ -564,7 +564,7 @@ static const YYCODETYPE yy_lookahead[] = {
...
@@ -564,7 +564,7 @@ static const YYCODETYPE yy_lookahead[] = {
/* 1260 */
0
,
0
,
40
,
0
,
271
,
72
,
0
,
47
,
175
,
175
,
/* 1260 */
0
,
0
,
40
,
0
,
271
,
72
,
0
,
47
,
175
,
175
,
/* 1270 */
47
,
47
,
279
,
310
,
47
,
0
,
313
,
314
,
315
,
316
,
/* 1270 */
47
,
47
,
279
,
310
,
47
,
0
,
313
,
314
,
315
,
316
,
/* 1280 */
317
,
318
,
289
,
320
,
47
,
47
,
293
,
243
,
175
,
0
,
/* 1280 */
317
,
318
,
289
,
320
,
47
,
47
,
293
,
243
,
175
,
0
,
/* 1290 */
175
,
0
,
47
,
0
,
47
,
0
,
243
,
47
,
0
,
81
,
/* 1290 */
175
,
0
,
47
,
0
,
22
,
0
,
243
,
47
,
0
,
81
,
/* 1300 */
113
,
160
,
156
,
310
,
159
,
0
,
313
,
314
,
315
,
316
,
/* 1300 */
113
,
160
,
156
,
310
,
159
,
0
,
313
,
314
,
315
,
316
,
/* 1310 */
317
,
318
,
0
,
320
,
152
,
271
,
323
,
151
,
0
,
356
,
/* 1310 */
317
,
318
,
0
,
320
,
152
,
271
,
323
,
151
,
0
,
356
,
/* 1320 */
357
,
328
,
0
,
279
,
271
,
44
,
0
,
0
,
0
,
0
,
/* 1320 */
357
,
328
,
0
,
279
,
271
,
44
,
0
,
0
,
0
,
0
,
...
@@ -693,7 +693,7 @@ static const unsigned short int yy_shift_ofst[] = {
...
@@ -693,7 +693,7 @@ static const unsigned short int yy_shift_ofst[] = {
/* 310 */
929
,
931
,
826
,
875
,
934
,
952
,
962
,
965
,
974
,
976
,
/* 310 */
929
,
931
,
826
,
875
,
934
,
952
,
962
,
965
,
974
,
976
,
/* 320 */
859
,
935
,
1260
,
1261
,
1222
,
1263
,
1193
,
1266
,
1220
,
1093
,
/* 320 */
859
,
935
,
1260
,
1261
,
1222
,
1263
,
1193
,
1266
,
1220
,
1093
,
/* 330 */
1223
,
1224
,
1227
,
1094
,
1275
,
1237
,
1238
,
1113
,
1289
,
1115
,
/* 330 */
1223
,
1224
,
1227
,
1094
,
1275
,
1237
,
1238
,
1113
,
1289
,
1115
,
/* 340 */
1291
,
1245
,
1293
,
12
47
,
1295
,
1250
,
1298
,
1218
,
1141
,
1145
,
/* 340 */
1291
,
1245
,
1293
,
12
72
,
1295
,
1250
,
1298
,
1218
,
1141
,
1145
,
/* 350 */
1187
,
1146
,
1305
,
1312
,
1162
,
1166
,
1318
,
1322
,
1281
,
1326
,
/* 350 */
1187
,
1146
,
1305
,
1312
,
1162
,
1166
,
1318
,
1322
,
1281
,
1326
,
/* 360 */
1327
,
1328
,
1329
,
1330
,
1331
,
1334
,
1335
,
1336
,
1338
,
1339
,
/* 360 */
1327
,
1328
,
1329
,
1330
,
1331
,
1334
,
1335
,
1336
,
1338
,
1339
,
/* 370 */
1340
,
1341
,
1343
,
1344
,
1345
,
1347
,
1348
,
1309
,
1351
,
1352
,
/* 370 */
1340
,
1341
,
1343
,
1344
,
1345
,
1347
,
1348
,
1309
,
1351
,
1352
,
...
@@ -898,7 +898,7 @@ static const YYCODETYPE yyFallback[] = {
...
@@ -898,7 +898,7 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* BUFFER => nothing */
0
,
/* BUFFER => nothing */
0
,
/* CACHELAST => nothing */
0
,
/* CACHELAST => nothing */
0
,
/* COMP => nothing */
0
,
/* COMP => nothing */
0
,
/*
DAYS
=> nothing */
0
,
/*
DURATION
=> nothing */
0
,
/* NK_VARIABLE => nothing */
0
,
/* NK_VARIABLE => nothing */
0
,
/* FSYNC => nothing */
0
,
/* FSYNC => nothing */
0
,
/* MAXROWS => nothing */
0
,
/* MAXROWS => nothing */
...
@@ -1225,7 +1225,7 @@ static const char *const yyTokenName[] = {
...
@@ -1225,7 +1225,7 @@ static const char *const yyTokenName[] = {
/* 60 */
"BUFFER"
,
/* 60 */
"BUFFER"
,
/* 61 */
"CACHELAST"
,
/* 61 */
"CACHELAST"
,
/* 62 */
"COMP"
,
/* 62 */
"COMP"
,
/* 63 */
"D
AYS
"
,
/* 63 */
"D
URATION
"
,
/* 64 */
"NK_VARIABLE"
,
/* 64 */
"NK_VARIABLE"
,
/* 65 */
"FSYNC"
,
/* 65 */
"FSYNC"
,
/* 66 */
"MAXROWS"
,
/* 66 */
"MAXROWS"
,
...
@@ -1600,8 +1600,8 @@ static const char *const yyRuleName[] = {
...
@@ -1600,8 +1600,8 @@ static const char *const yyRuleName[] = {
/* 68 */
"db_options ::= db_options BUFFER NK_INTEGER"
,
/* 68 */
"db_options ::= db_options BUFFER NK_INTEGER"
,
/* 69 */
"db_options ::= db_options CACHELAST NK_INTEGER"
,
/* 69 */
"db_options ::= db_options CACHELAST NK_INTEGER"
,
/* 70 */
"db_options ::= db_options COMP NK_INTEGER"
,
/* 70 */
"db_options ::= db_options COMP NK_INTEGER"
,
/* 71 */
"db_options ::= db_options D
AYS
NK_INTEGER"
,
/* 71 */
"db_options ::= db_options D
URATION
NK_INTEGER"
,
/* 72 */
"db_options ::= db_options D
AYS
NK_VARIABLE"
,
/* 72 */
"db_options ::= db_options D
URATION
NK_VARIABLE"
,
/* 73 */
"db_options ::= db_options FSYNC NK_INTEGER"
,
/* 73 */
"db_options ::= db_options FSYNC NK_INTEGER"
,
/* 74 */
"db_options ::= db_options MAXROWS NK_INTEGER"
,
/* 74 */
"db_options ::= db_options MAXROWS NK_INTEGER"
,
/* 75 */
"db_options ::= db_options MINROWS NK_INTEGER"
,
/* 75 */
"db_options ::= db_options MINROWS NK_INTEGER"
,
...
@@ -1783,7 +1783,7 @@ static const char *const yyRuleName[] = {
...
@@ -1783,7 +1783,7 @@ static const char *const yyRuleName[] = {
/* 251 */
"stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal"
,
/* 251 */
"stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal"
,
/* 252 */
"stream_options ::= stream_options WATERMARK duration_literal"
,
/* 252 */
"stream_options ::= stream_options WATERMARK duration_literal"
,
/* 253 */
"cmd ::= KILL CONNECTION NK_INTEGER"
,
/* 253 */
"cmd ::= KILL CONNECTION NK_INTEGER"
,
/* 254 */
"cmd ::= KILL QUERY NK_
INTEGER
"
,
/* 254 */
"cmd ::= KILL QUERY NK_
STRING
"
,
/* 255 */
"cmd ::= KILL TRANSACTION NK_INTEGER"
,
/* 255 */
"cmd ::= KILL TRANSACTION NK_INTEGER"
,
/* 256 */
"cmd ::= BALANCE VGROUP"
,
/* 256 */
"cmd ::= BALANCE VGROUP"
,
/* 257 */
"cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER"
,
/* 257 */
"cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER"
,
...
@@ -2646,8 +2646,8 @@ static const struct {
...
@@ -2646,8 +2646,8 @@ static const struct {
{
254
,
-
3
},
/* (68) db_options ::= db_options BUFFER NK_INTEGER */
{
254
,
-
3
},
/* (68) db_options ::= db_options BUFFER NK_INTEGER */
{
254
,
-
3
},
/* (69) db_options ::= db_options CACHELAST NK_INTEGER */
{
254
,
-
3
},
/* (69) db_options ::= db_options CACHELAST NK_INTEGER */
{
254
,
-
3
},
/* (70) db_options ::= db_options COMP NK_INTEGER */
{
254
,
-
3
},
/* (70) db_options ::= db_options COMP NK_INTEGER */
{
254
,
-
3
},
/* (71) db_options ::= db_options D
AYS
NK_INTEGER */
{
254
,
-
3
},
/* (71) db_options ::= db_options D
URATION
NK_INTEGER */
{
254
,
-
3
},
/* (72) db_options ::= db_options D
AYS
NK_VARIABLE */
{
254
,
-
3
},
/* (72) db_options ::= db_options D
URATION
NK_VARIABLE */
{
254
,
-
3
},
/* (73) db_options ::= db_options FSYNC NK_INTEGER */
{
254
,
-
3
},
/* (73) db_options ::= db_options FSYNC NK_INTEGER */
{
254
,
-
3
},
/* (74) db_options ::= db_options MAXROWS NK_INTEGER */
{
254
,
-
3
},
/* (74) db_options ::= db_options MAXROWS NK_INTEGER */
{
254
,
-
3
},
/* (75) db_options ::= db_options MINROWS NK_INTEGER */
{
254
,
-
3
},
/* (75) db_options ::= db_options MINROWS NK_INTEGER */
...
@@ -2829,7 +2829,7 @@ static const struct {
...
@@ -2829,7 +2829,7 @@ static const struct {
{
305
,
-
4
},
/* (251) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
{
305
,
-
4
},
/* (251) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
{
305
,
-
3
},
/* (252) stream_options ::= stream_options WATERMARK duration_literal */
{
305
,
-
3
},
/* (252) stream_options ::= stream_options WATERMARK duration_literal */
{
240
,
-
3
},
/* (253) cmd ::= KILL CONNECTION NK_INTEGER */
{
240
,
-
3
},
/* (253) cmd ::= KILL CONNECTION NK_INTEGER */
{
240
,
-
3
},
/* (254) cmd ::= KILL QUERY NK_
INTEGER
*/
{
240
,
-
3
},
/* (254) cmd ::= KILL QUERY NK_
STRING
*/
{
240
,
-
3
},
/* (255) cmd ::= KILL TRANSACTION NK_INTEGER */
{
240
,
-
3
},
/* (255) cmd ::= KILL TRANSACTION NK_INTEGER */
{
240
,
-
2
},
/* (256) cmd ::= BALANCE VGROUP */
{
240
,
-
2
},
/* (256) cmd ::= BALANCE VGROUP */
{
240
,
-
4
},
/* (257) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
{
240
,
-
4
},
/* (257) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
...
@@ -3326,8 +3326,8 @@ static YYACTIONTYPE yy_reduce(
...
@@ -3326,8 +3326,8 @@ static YYACTIONTYPE yy_reduce(
{
yylhsminor
.
yy632
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy632
,
DB_OPTION_COMP
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy632
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy632
,
DB_OPTION_COMP
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy632
=
yylhsminor
.
yy632
;
yymsp
[
-
2
].
minor
.
yy632
=
yylhsminor
.
yy632
;
break
;
break
;
case
71
:
/* db_options ::= db_options D
AYS
NK_INTEGER */
case
71
:
/* db_options ::= db_options D
URATION
NK_INTEGER */
case
72
:
/* db_options ::= db_options D
AYS
NK_VARIABLE */
yytestcase
(
yyruleno
==
72
);
case
72
:
/* db_options ::= db_options D
URATION
NK_VARIABLE */
yytestcase
(
yyruleno
==
72
);
{
yylhsminor
.
yy632
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy632
,
DB_OPTION_DAYS
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy632
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy632
,
DB_OPTION_DAYS
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy632
=
yylhsminor
.
yy632
;
yymsp
[
-
2
].
minor
.
yy632
=
yylhsminor
.
yy632
;
break
;
break
;
...
@@ -3907,8 +3907,8 @@ static YYACTIONTYPE yy_reduce(
...
@@ -3907,8 +3907,8 @@ static YYACTIONTYPE yy_reduce(
case
253
:
/* cmd ::= KILL CONNECTION NK_INTEGER */
case
253
:
/* cmd ::= KILL CONNECTION NK_INTEGER */
{
pCxt
->
pRootNode
=
createKillStmt
(
pCxt
,
QUERY_NODE_KILL_CONNECTION_STMT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
pCxt
->
pRootNode
=
createKillStmt
(
pCxt
,
QUERY_NODE_KILL_CONNECTION_STMT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
break
;
case
254
:
/* cmd ::= KILL QUERY NK_
INTEGER
*/
case
254
:
/* cmd ::= KILL QUERY NK_
STRING
*/
{
pCxt
->
pRootNode
=
createKill
Stmt
(
pCxt
,
QUERY_NODE_KILL_QUERY_STMT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
pCxt
->
pRootNode
=
createKill
QueryStmt
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
break
;
case
255
:
/* cmd ::= KILL TRANSACTION NK_INTEGER */
case
255
:
/* cmd ::= KILL TRANSACTION NK_INTEGER */
{
pCxt
->
pRootNode
=
createKillStmt
(
pCxt
,
QUERY_NODE_KILL_TRANSACTION_STMT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
pCxt
->
pRootNode
=
createKillStmt
(
pCxt
,
QUERY_NODE_KILL_TRANSACTION_STMT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
0354f3b4
...
@@ -46,7 +46,7 @@ TEST_F(ParserInitialCTest, createBnode) {
...
@@ -46,7 +46,7 @@ TEST_F(ParserInitialCTest, createBnode) {
* BUFFER value
* BUFFER value
* | CACHELAST value
* | CACHELAST value
* | COMP {0 | 1 | 2}
* | COMP {0 | 1 | 2}
* | D
AYS
value
* | D
URATION
value
* | FSYNC value
* | FSYNC value
* | MAXROWS value
* | MAXROWS value
* | MINROWS value
* | MINROWS value
...
@@ -155,7 +155,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -155,7 +155,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
ASSERT_EQ
(
req
.
replications
,
expect
.
replications
);
ASSERT_EQ
(
req
.
replications
,
expect
.
replications
);
ASSERT_EQ
(
req
.
strict
,
expect
.
strict
);
ASSERT_EQ
(
req
.
strict
,
expect
.
strict
);
ASSERT_EQ
(
req
.
cacheLastRow
,
expect
.
cacheLastRow
);
ASSERT_EQ
(
req
.
cacheLastRow
,
expect
.
cacheLastRow
);
//ASSERT_EQ(req.schemaless, expect.schemaless);
//
ASSERT_EQ(req.schemaless, expect.schemaless);
ASSERT_EQ
(
req
.
ignoreExist
,
expect
.
ignoreExist
);
ASSERT_EQ
(
req
.
ignoreExist
,
expect
.
ignoreExist
);
ASSERT_EQ
(
req
.
numOfRetensions
,
expect
.
numOfRetensions
);
ASSERT_EQ
(
req
.
numOfRetensions
,
expect
.
numOfRetensions
);
if
(
expect
.
numOfRetensions
>
0
)
{
if
(
expect
.
numOfRetensions
>
0
)
{
...
@@ -202,7 +202,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -202,7 +202,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
"BUFFER 64 "
"BUFFER 64 "
"CACHELAST 2 "
"CACHELAST 2 "
"COMP 1 "
"COMP 1 "
"D
AYS
100 "
"D
URATION
100 "
"FSYNC 100 "
"FSYNC 100 "
"MAXROWS 1000 "
"MAXROWS 1000 "
"MINROWS 100 "
"MINROWS 100 "
...
@@ -223,7 +223,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -223,7 +223,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
setDbDaysFunc
(
100
);
setDbDaysFunc
(
100
);
setDbKeepFunc
(
1440
,
300
*
60
,
400
*
1440
);
setDbKeepFunc
(
1440
,
300
*
60
,
400
*
1440
);
run
(
"CREATE DATABASE IF NOT EXISTS wxy_db "
run
(
"CREATE DATABASE IF NOT EXISTS wxy_db "
"D
AYS
100m "
"D
URATION
100m "
"KEEP 1440m,300h,400d "
);
"KEEP 1440m,300h,400d "
);
clearCreateDbReq
();
clearCreateDbReq
();
}
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
0354f3b4
...
@@ -181,7 +181,7 @@ static int16_t getUnsetSlotId(const SArray* pSlotIdsInfo) {
...
@@ -181,7 +181,7 @@ static int16_t getUnsetSlotId(const SArray* pSlotIdsInfo) {
}
}
static
int32_t
addDataBlockSlotsImpl
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pList
,
SDataBlockDescNode
*
pDataBlockDesc
,
static
int32_t
addDataBlockSlotsImpl
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pList
,
SDataBlockDescNode
*
pDataBlockDesc
,
const
char
*
pStmtName
,
bool
output
,
bool
reserve
)
{
const
char
*
pStmtName
,
bool
output
,
bool
reserve
)
{
if
(
NULL
==
pList
)
{
if
(
NULL
==
pList
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -463,10 +463,25 @@ static int32_t createTagScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubpla
...
@@ -463,10 +463,25 @@ static int32_t createTagScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubpla
return
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
(
SScanPhysiNode
*
)
pTagScan
,
pPhyNode
);
return
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
(
SScanPhysiNode
*
)
pTagScan
,
pPhyNode
);
}
}
static
ENodeType
getScanOperatorType
(
EScanType
scanType
)
{
switch
(
scanType
)
{
case
SCAN_TYPE_TABLE
:
return
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
;
case
SCAN_TYPE_STREAM
:
return
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
;
case
SCAN_TYPE_TABLE_MERGE
:
return
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
;
// return QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN;
default:
break
;
}
return
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
;
}
static
int32_t
createTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
static
int32_t
createTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SPhysiNode
**
pPhyNode
)
{
STableScanPhysiNode
*
pTableScan
=
STableScanPhysiNode
*
pTableScan
=
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
);
getScanOperatorType
(
pScanLogicNode
->
scanType
)
);
if
(
NULL
==
pTableScan
)
{
if
(
NULL
==
pTableScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -528,12 +543,12 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan*
...
@@ -528,12 +543,12 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan*
static
int32_t
createStreamScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
static
int32_t
createStreamScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SPhysiNode
**
pPhyNode
)
{
int32_t
res
=
createTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
return
createTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
if
(
res
==
TSDB_CODE_SUCCESS
)
{
}
ENodeType
type
=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
;
setNodeType
(
*
pPhyNode
,
type
);
static
int32_t
createTableMergeScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
}
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
return
res
;
return
createTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
)
;
}
}
static
int32_t
createScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
static
int32_t
createScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
...
@@ -547,6 +562,8 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan,
...
@@ -547,6 +562,8 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan,
return
createSystemTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
return
createSystemTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
case
SCAN_TYPE_STREAM
:
case
SCAN_TYPE_STREAM
:
return
createStreamScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
return
createStreamScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
case
SCAN_TYPE_TABLE_MERGE
:
return
createTableMergeScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
default:
default:
break
;
break
;
}
}
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
0354f3b4
...
@@ -170,8 +170,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) {
...
@@ -170,8 +170,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) {
switch
(
nodeType
(
pNode
))
{
switch
(
nodeType
(
pNode
))
{
case
QUERY_NODE_LOGIC_PLAN_SCAN
:
case
QUERY_NODE_LOGIC_PLAN_SCAN
:
return
stbSplIsMultiTbScan
(
streamQuery
,
(
SScanLogicNode
*
)
pNode
);
return
stbSplIsMultiTbScan
(
streamQuery
,
(
SScanLogicNode
*
)
pNode
);
//
case QUERY_NODE_LOGIC_PLAN_JOIN:
case
QUERY_NODE_LOGIC_PLAN_JOIN
:
//
return !(((SJoinLogicNode*)pNode)->isSingleTableJoin);
return
!
(((
SJoinLogicNode
*
)
pNode
)
->
isSingleTableJoin
);
case
QUERY_NODE_LOGIC_PLAN_AGG
:
case
QUERY_NODE_LOGIC_PLAN_AGG
:
return
!
stbSplHasGatherExecFunc
(((
SAggLogicNode
*
)
pNode
)
->
pAggFuncs
)
&&
stbSplHasMultiTbScan
(
streamQuery
,
pNode
);
return
!
stbSplHasGatherExecFunc
(((
SAggLogicNode
*
)
pNode
)
->
pAggFuncs
)
&&
stbSplHasMultiTbScan
(
streamQuery
,
pNode
);
case
QUERY_NODE_LOGIC_PLAN_WINDOW
:
{
case
QUERY_NODE_LOGIC_PLAN_WINDOW
:
{
...
@@ -392,6 +392,7 @@ static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo
...
@@ -392,6 +392,7 @@ static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartWindow
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartWindow
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -408,6 +409,7 @@ static int32_t stbSplSplitIntervalForStream(SSplitContext* pCxt, SStableSplitInf
...
@@ -408,6 +409,7 @@ static int32_t stbSplSplitIntervalForStream(SSplitContext* pCxt, SStableSplitInf
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartWindow
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartWindow
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -496,6 +498,7 @@ static int32_t stbSplSplitAggNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
...
@@ -496,6 +498,7 @@ static int32_t stbSplSplitAggNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartAgg
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartAgg
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -610,6 +613,7 @@ static int32_t stbSplSplitSortNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
...
@@ -610,6 +613,7 @@ static int32_t stbSplSplitSortNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartSort
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pPartSort
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
pInfo
->
pSubplan
->
subplanType
=
SUBPLAN_TYPE_MERGE
;
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -619,6 +623,7 @@ static int32_t stbSplSplitScanNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
...
@@ -619,6 +623,7 @@ static int32_t stbSplSplitScanNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
code
=
nodesListMakeStrictAppend
(
&
pInfo
->
pSubplan
->
pChildren
,
code
=
nodesListMakeStrictAppend
(
&
pInfo
->
pSubplan
->
pChildren
,
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pInfo
->
pSplitNode
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pInfo
->
pSplitNode
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -642,6 +647,8 @@ static int32_t stbSplSplitScanNodeForJoin(SSplitContext* pCxt, SLogicSubplan* pS
...
@@ -642,6 +647,8 @@ static int32_t stbSplSplitScanNodeForJoin(SSplitContext* pCxt, SLogicSubplan* pS
code
=
nodesListMakeStrictAppend
(
&
pSubplan
->
pChildren
,
code
=
nodesListMakeStrictAppend
(
&
pSubplan
->
pChildren
,
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
(
SLogicNode
*
)
pScan
,
SPLIT_FLAG_STABLE_SPLIT
));
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
(
SLogicNode
*
)
pScan
,
SPLIT_FLAG_STABLE_SPLIT
));
}
}
pScan
->
scanType
=
SCAN_TYPE_TABLE_MERGE
;
++
(
pCxt
->
groupId
);
return
code
;
return
code
;
}
}
...
@@ -703,7 +710,6 @@ static int32_t stableSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) {
...
@@ -703,7 +710,6 @@ static int32_t stableSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) {
break
;
break
;
}
}
++
(
pCxt
->
groupId
);
pCxt
->
split
=
true
;
pCxt
->
split
=
true
;
return
code
;
return
code
;
}
}
...
...
tests/parallel_test/collect_cases.sh
浏览文件 @
0354f3b4
...
@@ -41,5 +41,16 @@ fi
...
@@ -41,5 +41,16 @@ fi
cat
../script/jenkins/basic.txt |grep
-v
"^#"
|grep
-v
"^$"
|sed
"s/^/,,script,/"
>>
$case_file
cat
../script/jenkins/basic.txt |grep
-v
"^#"
|grep
-v
"^$"
|sed
"s/^/,,script,/"
>>
$case_file
grep
"^python"
../system-test/fulltest.sh |sed
"s/^/,,system-test,/"
>>
$case_file
grep
"^python"
../system-test/fulltest.sh |sed
"s/^/,,system-test,/"
>>
$case_file
# tar source code for run.sh to use
# if [ $ent -eq 0 ]; then
# cd ../../../
# rm -rf TDengine.tar.gz
# tar --exclude=TDengine/debug --exclude=TDengine/sim --exclude=TDengine/release -czf TDengine.tar.gz TDengine taos-connector-python
# else
# cd ../../../../
# rm -rf TDinternal.tar.gz
# tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release --exclude=TDinternal/community/sim -czf TDinternal.tar.gz TDinternal taos-connector-python
# fi
exit
0
exit
0
tests/parallel_test/run.sh
浏览文件 @
0354f3b4
...
@@ -255,7 +255,6 @@ function run_thread() {
...
@@ -255,7 +255,6 @@ function run_thread() {
$cmd
# 2>/dev/null
$cmd
# 2>/dev/null
local
case_info
=
`
echo
"
$line
"
|cut
-d
,
-f
3,4
`
local
case_info
=
`
echo
"
$line
"
|cut
-d
,
-f
3,4
`
local
corefile
=
`
ls
$log_dir
/
${
case_file
}
.coredump/
`
local
corefile
=
`
ls
$log_dir
/
${
case_file
}
.coredump/
`
corefile
=
`
find
$log_dir
/
${
case_file
}
.coredump/
-name
"core.*"
`
echo
-e
"
$case_info
\e
[31m failed
\e
[0m"
echo
-e
"
$case_info
\e
[31m failed
\e
[0m"
echo
"=========================log============================"
echo
"=========================log============================"
cat
$log_dir
/
$case_file
.log
cat
$log_dir
/
$case_file
.log
...
@@ -291,6 +290,19 @@ function run_thread() {
...
@@ -291,6 +290,19 @@ function run_thread() {
fi
fi
cmd
=
"
$scpcmd
:
${
remote_sim_tar
}
$log_dir
/
${
case_file
}
.sim.tar.gz"
cmd
=
"
$scpcmd
:
${
remote_sim_tar
}
$log_dir
/
${
case_file
}
.sim.tar.gz"
$cmd
$cmd
# backup source code (disabled)
source_tar_dir
=
$log_dir
/TDengine_
${
hosts
[index]
}
source_tar_file
=
TDengine.tar.gz
if
[
$ent
-ne
0
]
;
then
source_tar_dir
=
$log_dir
/TDinternal_
${
hosts
[index]
}
source_tar_file
=
TDinternal.tar.gz
fi
mkdir
$source_tar_dir
2>/dev/null
if
[
$?
-eq
0
]
;
then
cmd
=
"
$scpcmd
:
${
workdirs
[index]
}
/
$source_tar_file
$source_tar_dir
"
# echo "$cmd"
# $cmd
fi
fi
fi
done
done
}
}
...
...
tests/pytest/alter/alter_replica.py
浏览文件 @
0354f3b4
...
@@ -42,7 +42,7 @@ class TDTestCase:
...
@@ -42,7 +42,7 @@ class TDTestCase:
tdDnodes
.
start
(
3
)
tdDnodes
.
start
(
3
)
def
run
(
self
):
def
run
(
self
):
tdSql
.
execute
(
'create database db replica 3 d
ays
7'
)
tdSql
.
execute
(
'create database db replica 3 d
uration
7'
)
tdSql
.
execute
(
'use db'
)
tdSql
.
execute
(
'use db'
)
for
tid
in
range
(
1
,
11
):
for
tid
in
range
(
1
,
11
):
tdSql
.
execute
(
'create table tb%d(ts timestamp, i int)'
%
tid
)
tdSql
.
execute
(
'create table tb%d(ts timestamp, i int)'
%
tid
)
...
...
tests/pytest/functions/function_max.py
浏览文件 @
0354f3b4
...
@@ -83,7 +83,7 @@ class TDTestCase:
...
@@ -83,7 +83,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
floatData
))
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
floatData
))
# test case: https://jira.taosdata.com:18080/browse/TD-2583
# test case: https://jira.taosdata.com:18080/browse/TD-2583
tdSql
.
execute
(
"create database test d
ays
2"
)
tdSql
.
execute
(
"create database test d
uration
2"
)
tdSql
.
execute
(
"create table car(ts timestamp, speed int)"
)
tdSql
.
execute
(
"create table car(ts timestamp, speed int)"
)
tdSql
.
execute
(
"insert into car values(now, -1)"
)
tdSql
.
execute
(
"insert into car values(now, -1)"
)
tdSql
.
execute
(
"insert into car values(now-10d, null)"
)
tdSql
.
execute
(
"insert into car values(now-10d, null)"
)
...
...
tests/pytest/functions/function_min.py
浏览文件 @
0354f3b4
...
@@ -83,7 +83,7 @@ class TDTestCase:
...
@@ -83,7 +83,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
np
.
min
(
floatData
))
tdSql
.
checkData
(
0
,
0
,
np
.
min
(
floatData
))
# test case: https://jira.taosdata.com:18080/browse/TD-2583
# test case: https://jira.taosdata.com:18080/browse/TD-2583
tdSql
.
execute
(
"create database test d
ays
2"
)
tdSql
.
execute
(
"create database test d
uration
2"
)
tdSql
.
execute
(
"create table car(ts timestamp, speed int)"
)
tdSql
.
execute
(
"create table car(ts timestamp, speed int)"
)
tdSql
.
execute
(
"insert into car values(now, 1)"
)
tdSql
.
execute
(
"insert into car values(now, 1)"
)
tdSql
.
execute
(
"insert into car values(now-10d, null)"
)
tdSql
.
execute
(
"insert into car values(now-10d, null)"
)
...
...
tests/pytest/functions/queryTestCases.py
浏览文件 @
0354f3b4
...
@@ -264,7 +264,7 @@ class TDTestCase:
...
@@ -264,7 +264,7 @@ class TDTestCase:
def
td4288
(
self
):
def
td4288
(
self
):
tdLog
.
printNoPrefix
(
"==========TD-4288=========="
)
tdLog
.
printNoPrefix
(
"==========TD-4288=========="
)
# keep ~ [d
ays
,365000]
# keep ~ [d
uration
,365000]
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db"
)
tdSql
.
execute
(
"create database if not exists db"
)
tdSql
.
query
(
"show variables"
)
tdSql
.
query
(
"show variables"
)
...
...
tests/pytest/insert/before_1970.py
浏览文件 @
0354f3b4
...
@@ -32,7 +32,7 @@ class TDTestCase:
...
@@ -32,7 +32,7 @@ class TDTestCase:
print
(
"==============step1"
)
print
(
"==============step1"
)
tdSql
.
execute
(
"create database if not exists demo keep 36500;"
);
tdSql
.
execute
(
"create database if not exists demo keep 36500;"
);
print
(
"==============create db demo keep 365000 d
ays
"
)
print
(
"==============create db demo keep 365000 d
uration
"
)
tdSql
.
execute
(
"use demo;"
)
tdSql
.
execute
(
"use demo;"
)
tdSql
.
execute
(
"CREATE table if not exists test (ts timestamp, f1 int);"
)
tdSql
.
execute
(
"CREATE table if not exists test (ts timestamp, f1 int);"
)
print
(
"==============create table test"
)
print
(
"==============create table test"
)
...
...
tests/pytest/insert/retentionpolicy.py
浏览文件 @
0354f3b4
...
@@ -51,7 +51,7 @@ class TDTestRetetion:
...
@@ -51,7 +51,7 @@ class TDTestRetetion:
def
run
(
self
):
def
run
(
self
):
tdLog
.
info
(
"=============== step1"
)
tdLog
.
info
(
"=============== step1"
)
tdSql
.
execute
(
'create database test keep 3 d
ays
1;'
)
tdSql
.
execute
(
'create database test keep 3 d
uration
1;'
)
tdSql
.
execute
(
'use test;'
)
tdSql
.
execute
(
'use test;'
)
tdSql
.
execute
(
'create table test(ts timestamp,i int);'
)
tdSql
.
execute
(
'create table test(ts timestamp,i int);'
)
...
...
tests/pytest/multilevel/fileDistributionSameLevel.py
浏览文件 @
0354f3b4
...
@@ -66,7 +66,7 @@ class TDTestCase:
...
@@ -66,7 +66,7 @@ class TDTestCase:
tdDnodes
.
deploy
(
1
,
cfg
)
tdDnodes
.
deploy
(
1
,
cfg
)
tdDnodes
.
startWithoutSleep
(
1
)
tdDnodes
.
startWithoutSleep
(
1
)
tdSql
.
execute
(
"create database test d
ays
1"
)
tdSql
.
execute
(
"create database test d
uration
1"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"create table stb(ts timestamp, c int) tags(t int)"
)
tdSql
.
execute
(
"create table stb(ts timestamp, c int) tags(t int)"
)
...
@@ -85,7 +85,7 @@ class TDTestCase:
...
@@ -85,7 +85,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step3"
)
tdLog
.
info
(
"================= step3"
)
tdSql
.
execute
(
'drop database test'
)
tdSql
.
execute
(
'drop database test'
)
for
i
in
range
(
50
):
for
i
in
range
(
50
):
tdSql
.
execute
(
"create database test%d d
ays
1"
%
(
i
))
tdSql
.
execute
(
"create database test%d d
uration
1"
%
(
i
))
tdSql
.
execute
(
"use test%d"
%
(
i
))
tdSql
.
execute
(
"use test%d"
%
(
i
))
tdSql
.
execute
(
"create table tb (ts timestamp,i int)"
)
tdSql
.
execute
(
"create table tb (ts timestamp,i int)"
)
for
j
in
range
(
10
):
for
j
in
range
(
10
):
...
...
tests/pytest/multilevel/retentionTest.py
浏览文件 @
0354f3b4
...
@@ -56,7 +56,7 @@ class TDTestCase:
...
@@ -56,7 +56,7 @@ class TDTestCase:
tdDnodes
.
deploy
(
1
,
cfg
)
tdDnodes
.
deploy
(
1
,
cfg
)
tdDnodes
.
startWithoutSleep
(
1
)
tdDnodes
.
startWithoutSleep
(
1
)
tdSql
.
execute
(
"create database test d
ays
1 keep 15,5,10"
)
tdSql
.
execute
(
"create database test d
uration
1 keep 15,5,10"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"create table tb(ts timestamp, c int)"
)
tdSql
.
execute
(
"create table tb(ts timestamp, c int)"
)
...
...
tests/pytest/perfbenchmark/bug3433.py
浏览文件 @
0354f3b4
...
@@ -66,7 +66,7 @@ class TDTestCase:
...
@@ -66,7 +66,7 @@ class TDTestCase:
"name"
:
"db"
,
"name"
:
"db"
,
"drop"
:
"yes"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"replica"
:
1
,
"d
ays
"
:
10
,
"d
uration
"
:
10
,
"cache"
:
16
,
"cache"
:
16
,
"blocks"
:
8
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"precision"
:
"ms"
,
...
...
tests/pytest/perfbenchmark/joinPerformance.py
浏览文件 @
0354f3b4
...
@@ -81,7 +81,7 @@ class JoinPerf:
...
@@ -81,7 +81,7 @@ class JoinPerf:
"name"
:
self
.
dbname
,
"name"
:
self
.
dbname
,
"drop"
:
self
.
drop
,
"drop"
:
self
.
drop
,
"replica"
:
1
,
"replica"
:
1
,
"d
ays
"
:
10
,
"d
uration
"
:
10
,
"cache"
:
16
,
"cache"
:
16
,
"blocks"
:
8
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"precision"
:
"ms"
,
...
...
tests/pytest/perfbenchmark/taosdemoInsert.py
浏览文件 @
0354f3b4
...
@@ -75,7 +75,7 @@ class Taosdemo:
...
@@ -75,7 +75,7 @@ class Taosdemo:
"name"
:
self
.
dbname
,
"name"
:
self
.
dbname
,
"drop"
:
self
.
drop
,
"drop"
:
self
.
drop
,
"replica"
:
1
,
"replica"
:
1
,
"d
ays
"
:
10
,
"d
uration
"
:
10
,
"cache"
:
16
,
"cache"
:
16
,
"blocks"
:
8
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"precision"
:
"ms"
,
...
...
tests/pytest/query/query1970YearsAf.py
浏览文件 @
0354f3b4
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
"name"
:
"db"
,
"name"
:
"db"
,
"drop"
:
"yes"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"replica"
:
1
,
"d
ays
"
:
10
,
"d
uration
"
:
10
,
"cache"
:
16
,
"cache"
:
16
,
"blocks"
:
8
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"precision"
:
"ms"
,
...
...
tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
浏览文件 @
0354f3b4
...
@@ -138,7 +138,7 @@ class TDTestCase:
...
@@ -138,7 +138,7 @@ class TDTestCase:
sqls_ls
=
[
sqls_ls
=
[
'drop database if exists nsdbsql;'
,
'drop database if exists nsdbsql;'
,
'create database nsdbsql precision "ns" keep 3600 d
ays
6 update 1;'
,
'create database nsdbsql precision "ns" keep 3600 d
uration
6 update 1;'
,
'use nsdbsql;'
,
'use nsdbsql;'
,
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);'
,
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);'
,
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);'
,
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);'
,
...
...
tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py
浏览文件 @
0354f3b4
...
@@ -125,7 +125,7 @@ class TDTestCase:
...
@@ -125,7 +125,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
600
)
tdSql
.
checkData
(
0
,
0
,
600
)
# check taosdemo -s
# check taosdemo -s
sqls_ls
=
[
'drop database if exists nsdbsql;'
,
'create database nsdbsql precision "ns" keep 36 d
ays
6 update 1;'
,
sqls_ls
=
[
'drop database if exists nsdbsql;'
,
'create database nsdbsql precision "ns" keep 36 d
uration
6 update 1;'
,
'use nsdbsql;'
,
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);'
,
'use nsdbsql;'
,
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);'
,
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);'
,
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);'
,
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);'
,
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);'
,
...
...
tests/pytest/tools/taosdumpTest.py
浏览文件 @
0354f3b4
...
@@ -60,8 +60,8 @@ class TDTestCase:
...
@@ -60,8 +60,8 @@ class TDTestCase:
if
not
os
.
path
.
exists
(
"./taosdumptest/tmp2"
):
if
not
os
.
path
.
exists
(
"./taosdumptest/tmp2"
):
os
.
makedirs
(
"./taosdumptest/tmp2"
)
os
.
makedirs
(
"./taosdumptest/tmp2"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database db d
ays
11 keep 3649 blocks 8 "
)
tdSql
.
execute
(
"create database db d
uration
11 keep 3649 blocks 8 "
)
tdSql
.
execute
(
"create database db1 d
ays
12 keep 3640 blocks 7 "
)
tdSql
.
execute
(
"create database db1 d
uration
12 keep 3640 blocks 7 "
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
"create table st(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))"
)
"create table st(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))"
)
...
@@ -102,7 +102,7 @@ class TDTestCase:
...
@@ -102,7 +102,7 @@ class TDTestCase:
tdSql
.
query
(
"show databases"
)
tdSql
.
query
(
"show databases"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
2
)
dbresult
=
tdSql
.
queryResult
dbresult
=
tdSql
.
queryResult
# 6--d
ays
,7--keep0,keep1,keep, 12--block,
# 6--d
uration
,7--keep0,keep1,keep, 12--block,
isCommunity
=
self
.
checkCommunity
()
isCommunity
=
self
.
checkCommunity
()
print
(
"iscommunity: %d"
%
isCommunity
)
print
(
"iscommunity: %d"
%
isCommunity
)
...
...
tests/pytest/tools/taosdumpTestNanoSupport.py
浏览文件 @
0354f3b4
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
def
build_db
(
precision
,
start_time
):
def
build_db
(
precision
,
start_time
):
tdSql
.
execute
(
"drop database if exists timedb1"
)
tdSql
.
execute
(
"drop database if exists timedb1"
)
tdSql
.
execute
(
tdSql
.
execute
(
"create database timedb1 d
ays
10 keep 365 blocks 8 precision "
+
"
\"
"
+
precision
+
"
\"
"
)
"create database timedb1 d
uration
10 keep 365 blocks 8 precision "
+
"
\"
"
+
precision
+
"
\"
"
)
tdSql
.
execute
(
"use timedb1"
)
tdSql
.
execute
(
"use timedb1"
)
tdSql
.
execute
(
tdSql
.
execute
(
...
...
tests/pytest/update/merge_commit_data-0.py
浏览文件 @
0354f3b4
...
@@ -30,7 +30,7 @@ class TDTestCase:
...
@@ -30,7 +30,7 @@ class TDTestCase:
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'drop database if exists db'
s
=
'drop database if exists db'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'create database db d
ays
30'
s
=
'create database db d
uration
30'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'use db'
s
=
'use db'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
...
...
tests/pytest/update/merge_commit_data.py
浏览文件 @
0354f3b4
...
@@ -30,7 +30,7 @@ class TDTestCase:
...
@@ -30,7 +30,7 @@ class TDTestCase:
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'drop database if exists db'
s
=
'drop database if exists db'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'create database db update 1 d
ays
30'
s
=
'create database db update 1 d
uration
30'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
s
=
'use db'
s
=
'use db'
tdSql
.
execute
(
s
)
tdSql
.
execute
(
s
)
...
...
tests/pytest/update/merge_commit_data2.py
浏览文件 @
0354f3b4
...
@@ -50,7 +50,7 @@ class TDTestCase:
...
@@ -50,7 +50,7 @@ class TDTestCase:
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'drop database if exists db'
sql
=
'drop database if exists db'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'create database db update 1 d
ays
30;'
sql
=
'create database db update 1 d
uration
30;'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'use db;'
sql
=
'use db;'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
...
...
tests/pytest/update/merge_commit_data2_update0.py
浏览文件 @
0354f3b4
...
@@ -49,7 +49,7 @@ class TDTestCase:
...
@@ -49,7 +49,7 @@ class TDTestCase:
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'drop database if exists db'
sql
=
'drop database if exists db'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'create database db update 0 d
ays
30;'
sql
=
'create database db update 0 d
uration
30;'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'use db;'
sql
=
'use db;'
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
...
...
tests/pytest/update/merge_commit_last.py
浏览文件 @
0354f3b4
...
@@ -34,7 +34,7 @@ class TDTestCase:
...
@@ -34,7 +34,7 @@ class TDTestCase:
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
tdSql
.
execute
(
"create database udb update 1 d
ays
30"
)
tdSql
.
execute
(
"create database udb update 1 d
uration
30"
)
tdSql
.
execute
(
"use udb"
)
tdSql
.
execute
(
"use udb"
)
print
(
"==============step 1: UPDATE THE LAST RECORD REPEATEDLY"
)
print
(
"==============step 1: UPDATE THE LAST RECORD REPEATEDLY"
)
...
...
tests/pytest/util/sql.py
浏览文件 @
0354f3b4
...
@@ -57,7 +57,7 @@ class TDSql:
...
@@ -57,7 +57,7 @@ class TDSql:
tdLog
.
notice
(
"'reset query cache' is not supported"
)
tdLog
.
notice
(
"'reset query cache' is not supported"
)
s
=
'drop database if exists db'
s
=
'drop database if exists db'
self
.
cursor
.
execute
(
s
)
self
.
cursor
.
execute
(
s
)
s
=
'create database db d
ays
300'
s
=
'create database db d
uration
300'
self
.
cursor
.
execute
(
s
)
self
.
cursor
.
execute
(
s
)
s
=
'use db'
s
=
'use db'
self
.
cursor
.
execute
(
s
)
self
.
cursor
.
execute
(
s
)
...
...
tests/pytest/util/taosdemoCfg.py
浏览文件 @
0354f3b4
...
@@ -63,7 +63,7 @@ class TDTaosdemoCfg:
...
@@ -63,7 +63,7 @@ class TDTaosdemoCfg:
"name"
:
'db'
,
"name"
:
'db'
,
"drop"
:
'yes'
,
"drop"
:
'yes'
,
"replica"
:
1
,
"replica"
:
1
,
"d
ays
"
:
10
,
"d
uration
"
:
10
,
"cache"
:
16
,
"cache"
:
16
,
"blocks"
:
6
,
"blocks"
:
6
,
"precision"
:
"ms"
,
"precision"
:
"ms"
,
...
...
tests/script/general/db/alter_option.sim
浏览文件 @
0354f3b4
...
@@ -9,7 +9,7 @@ sleep 2000
...
@@ -9,7 +9,7 @@ sleep 2000
sql connect
sql connect
print ============= create database
print ============= create database
sql create database db cache 2 blocks 4 d
ays
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql create database db cache 2 blocks 4 d
uration
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql show databases
sql show databases
if $data00 != db then
if $data00 != db then
return -1
return -1
...
@@ -87,13 +87,13 @@ sql_error alter database db quorum 4
...
@@ -87,13 +87,13 @@ sql_error alter database db quorum 4
sql_error alter database db quorum 5
sql_error alter database db quorum 5
sql_error alter database db quorum -1
sql_error alter database db quorum -1
print ============== step d
ays
print ============== step d
uration
sql_error alter database db d
ays
0
sql_error alter database db d
uration
0
sql_error alter database db d
ays
1
sql_error alter database db d
uration
1
sql_error alter database db d
ays
2
sql_error alter database db d
uration
2
sql_error alter database db d
ays
10
sql_error alter database db d
uration
10
sql_error alter database db d
ays
50
sql_error alter database db d
uration
50
sql_error alter database db d
ays
100
sql_error alter database db d
uration
100
print ============== step keep
print ============== step keep
sql show databases
sql show databases
...
...
tests/script/general/db/backup/keep.sim
浏览文件 @
0354f3b4
...
@@ -26,7 +26,7 @@ system sh/exec.sh -n dnode2 -s start
...
@@ -26,7 +26,7 @@ system sh/exec.sh -n dnode2 -s start
sleep 2000
sleep 2000
print ======== step1 create db
print ======== step1 create db
sql create database keepdb replica 1 keep 30 d
ays
7
sql create database keepdb replica 1 keep 30 d
uration
7
sql use keepdb
sql use keepdb
sql create table tb (ts timestamp, i int)
sql create table tb (ts timestamp, i int)
...
@@ -201,7 +201,7 @@ sql alter database keepdb keep 0 -x error2
...
@@ -201,7 +201,7 @@ sql alter database keepdb keep 0 -x error2
return -1
return -1
error2:
error2:
sql alter database keepdb d
ays
1 -x error3
sql alter database keepdb d
uration
1 -x error3
return -1
return -1
error3:
error3:
...
...
tests/script/general/db/topic1.sim
浏览文件 @
0354f3b4
...
@@ -171,7 +171,7 @@ sql_error create topic t1 partitions -1;
...
@@ -171,7 +171,7 @@ sql_error create topic t1 partitions -1;
sql_error create topic t1 partitions 10001;
sql_error create topic t1 partitions 10001;
print =============step3 create with db para
print =============step3 create with db para
sql create topic db cache 2 blocks 4 d
ays
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql create topic db cache 2 blocks 4 d
uration
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql show databases
sql show databases
if $data00 != db then
if $data00 != db then
return -1
return -1
...
@@ -199,7 +199,7 @@ if $data09 != 4 then
...
@@ -199,7 +199,7 @@ if $data09 != 4 then
endi
endi
sql drop topic db;
sql drop topic db;
sql create topic db cache 2 blocks 4 d
ays
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 partitions 7
sql create topic db cache 2 blocks 4 d
uration
10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 partitions 7
sql show databases
sql show databases
if $data00 != db then
if $data00 != db then
return -1
return -1
...
@@ -334,19 +334,19 @@ sql_error alter topic db quorum 4
...
@@ -334,19 +334,19 @@ sql_error alter topic db quorum 4
sql_error alter topic db quorum 5
sql_error alter topic db quorum 5
sql_error alter topic db quorum -1
sql_error alter topic db quorum -1
print ============== step d
ays
print ============== step d
uration
sql_error alter database db d
ays
0
sql_error alter database db d
uration
0
sql_error alter database db d
ays
1
sql_error alter database db d
uration
1
sql_error alter database db d
ays
2
sql_error alter database db d
uration
2
sql_error alter database db d
ays
10
sql_error alter database db d
uration
10
sql_error alter database db d
ays
50
sql_error alter database db d
uration
50
sql_error alter database db d
ays
100
sql_error alter database db d
uration
100
sql_error alter topic db d
ays
0
sql_error alter topic db d
uration
0
sql_error alter topic db d
ays
1
sql_error alter topic db d
uration
1
sql_error alter topic db d
ays
2
sql_error alter topic db d
uration
2
sql_error alter topic db d
ays
10
sql_error alter topic db d
uration
10
sql_error alter topic db d
ays
50
sql_error alter topic db d
uration
50
sql_error alter topic db d
ays
100
sql_error alter topic db d
uration
100
print ============== step keep
print ============== step keep
sql show databases
sql show databases
...
...
tests/script/general/import/commit.sim
浏览文件 @
0354f3b4
...
@@ -30,7 +30,7 @@ sleep 2000
...
@@ -30,7 +30,7 @@ sleep 2000
sql connect
sql connect
print ========= step1
print ========= step1
sql create database ic1db d
ays
7;
sql create database ic1db d
uration
7;
sql create table ic1db.tb(ts timestamp, s int);
sql create table ic1db.tb(ts timestamp, s int);
sql insert into ic1db.tb values(now-30d, -30);
sql insert into ic1db.tb values(now-30d, -30);
sql insert into ic1db.tb values(now-20d, -20);
sql insert into ic1db.tb values(now-20d, -20);
...
@@ -50,7 +50,7 @@ if $rows != 12 then
...
@@ -50,7 +50,7 @@ if $rows != 12 then
endi
endi
print ========= step2
print ========= step2
sql create database ic2db d
ays
7;
sql create database ic2db d
uration
7;
sql create table ic2db.tb(ts timestamp, s int);
sql create table ic2db.tb(ts timestamp, s int);
sql insert into ic2db.tb values(now, 0);
sql insert into ic2db.tb values(now, 0);
sql import into ic2db.tb values(now-30d, -30);
sql import into ic2db.tb values(now-30d, -30);
...
...
tests/script/general/import/replica1.sim
浏览文件 @
0354f3b4
...
@@ -30,7 +30,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -30,7 +30,7 @@ system sh/exec.sh -n dnode1 -s start
sleep 2000
sleep 2000
sql connect
sql connect
sql create database ir1db d
ays
7
sql create database ir1db d
uration
7
sql use ir1db
sql use ir1db
sql create table tb(ts timestamp, i bigint)
sql create table tb(ts timestamp, i bigint)
...
...
tests/script/general/parser/alter.sim
浏览文件 @
0354f3b4
...
@@ -20,7 +20,7 @@ $db = $dbPrefix . $i
...
@@ -20,7 +20,7 @@ $db = $dbPrefix . $i
$mt = $mtPrefix . $i
$mt = $mtPrefix . $i
sql drop database if exists $db
sql drop database if exists $db
sql create database $db d
ays
10 keep 20,20,20
sql create database $db d
uration
10 keep 20,20,20
sql use $db
sql use $db
sql_error alter database $db keep "20"
sql_error alter database $db keep "20"
...
...
tests/script/general/parser/alter__for_community_version.sim
浏览文件 @
0354f3b4
...
@@ -20,7 +20,7 @@ $db = $dbPrefix . $i
...
@@ -20,7 +20,7 @@ $db = $dbPrefix . $i
$mt = $mtPrefix . $i
$mt = $mtPrefix . $i
sql drop database if exists $db
sql drop database if exists $db
sql create database $db d
ays
10 keep 20
sql create database $db d
uration
10 keep 20
sql use $db
sql use $db
sql show databases
sql show databases
if $rows != 1 then
if $rows != 1 then
...
...
tests/script/general/parser/create_db.sim
浏览文件 @
0354f3b4
...
@@ -101,7 +101,7 @@ print db_already_exists test passed
...
@@ -101,7 +101,7 @@ print db_already_exists test passed
print create_db.sim case5: db_meta_data test
print create_db.sim case5: db_meta_data test
# cfg params
# cfg params
$replica = 1 # max=3
$replica = 1 # max=3
$d
ays
= 10
$d
uration
= 10
$keep = 365,365,365
$keep = 365,365,365
$rows_db = 1000
$rows_db = 1000
$cache = 16 # 16MB
$cache = 16 # 16MB
...
@@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours
...
@@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours
$wal = 1 # valid value is 1, 2
$wal = 1 # valid value is 1, 2
$comp = 1 # max=32, automatically trimmed when exceeding
$comp = 1 # max=32, automatically trimmed when exceeding
sql create database $db replica $replica d
ays $days
keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp
sql create database $db replica $replica d
uration $duration
keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp
sql show databases
sql show databases
if $rows != 1 then
if $rows != 1 then
return -1
return -1
...
@@ -122,7 +122,7 @@ endi
...
@@ -122,7 +122,7 @@ endi
if $data04 != $replica then
if $data04 != $replica then
return -1
return -1
endi
endi
if $data06 != $d
ays
then
if $data06 != $d
uration
then
return -1
return -1
endi
endi
if $data07 != 365,365,365 then
if $data07 != 365,365,365 then
...
...
tests/script/general/parser/create_db__for_community_version.sim
浏览文件 @
0354f3b4
...
@@ -101,7 +101,7 @@ print db_already_exists test passed
...
@@ -101,7 +101,7 @@ print db_already_exists test passed
print create_db.sim case5: db_meta_data test
print create_db.sim case5: db_meta_data test
# cfg params
# cfg params
$replica = 1 # max=3
$replica = 1 # max=3
$d
ays
= 10
$d
uration
= 10
$keep = 365
$keep = 365
$rows_db = 1000
$rows_db = 1000
$cache = 16 # 16MB
$cache = 16 # 16MB
...
@@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours
...
@@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours
$wal = 1 # valid value is 1, 2
$wal = 1 # valid value is 1, 2
$comp = 1 # max=32, automatically trimmed when exceeding
$comp = 1 # max=32, automatically trimmed when exceeding
sql create database $db replica $replica d
ays $days
keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp
sql create database $db replica $replica d
uration $duration
keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp
sql show databases
sql show databases
if $rows != 1 then
if $rows != 1 then
return -1
return -1
...
@@ -122,7 +122,7 @@ endi
...
@@ -122,7 +122,7 @@ endi
if $data04 != $replica then
if $data04 != $replica then
return -1
return -1
endi
endi
if $data06 != $d
ays
then
if $data06 != $d
uration
then
return -1
return -1
endi
endi
if $data07 != 365 then
if $data07 != 365 then
...
...
tests/script/tsim/db/alter_option.sim
浏览文件 @
0354f3b4
...
@@ -62,11 +62,11 @@ print ============= create database
...
@@ -62,11 +62,11 @@ print ============= create database
# | PAGES value [64~16384, default: 256]
# | PAGES value [64~16384, default: 256]
# | CACHELAST value [0, 1, 2, 3]
# | CACHELAST value [0, 1, 2, 3]
# | FSYNC value [0 ~ 180000 ms]
# | FSYNC value [0 ~ 180000 ms]
# | KEEP value [d
ays
, 365000]
# | KEEP value [d
uration
, 365000]
# | REPLICA value [1 | 3]
# | REPLICA value [1 | 3]
# | WAL value [1 | 2]
# | WAL value [1 | 2]
sql create database db CACHELAST 3 COMP 0 D
AYS
240 FSYNC 1000 MAXROWS 8000 MINROWS 10 KEEP 1000 PRECISION 'ns' REPLICA 3 WAL 2 VGROUPS 6 SINGLE_STABLE 1
sql create database db CACHELAST 3 COMP 0 D
URATION
240 FSYNC 1000 MAXROWS 8000 MINROWS 10 KEEP 1000 PRECISION 'ns' REPLICA 3 WAL 2 VGROUPS 6 SINGLE_STABLE 1
sql show databases
sql show databases
print rows: $rows
print rows: $rows
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
...
@@ -92,7 +92,7 @@ endi
...
@@ -92,7 +92,7 @@ endi
if $data5_db != no_strict then # strict
if $data5_db != no_strict then # strict
return -1
return -1
endi
endi
if $data6_db != 345600 then # d
ays
if $data6_db != 345600 then # d
uration
return -1
return -1
endi
endi
if $data7_db != 1440000m,1440000m,1440000m then # keep
if $data7_db != 1440000m,1440000m,1440000m then # keep
...
@@ -222,11 +222,11 @@ sql_error alter database db replica 0
...
@@ -222,11 +222,11 @@ sql_error alter database db replica 0
#sql_error alter database db quorum 4
#sql_error alter database db quorum 4
#sql_error alter database db quorum 5
#sql_error alter database db quorum 5
#print ============== modify d
ays
#print ============== modify d
uration
sql_error alter database db d
ays
480
sql_error alter database db d
uration
480
sql_error alter database db d
ays
360
sql_error alter database db d
uration
360
sql_error alter database db d
ays
0
sql_error alter database db d
uration
0
sql_error alter database db d
ays
14400 # set over than keep
sql_error alter database db d
uration
14400 # set over than keep
print ============== modify keep
print ============== modify keep
sql alter database db keep 2400
sql alter database db keep 2400
...
...
tests/script/tsim/db/basic6.sim
浏览文件 @
0354f3b4
...
@@ -15,7 +15,7 @@ $tb = $tbPrefix . $i
...
@@ -15,7 +15,7 @@ $tb = $tbPrefix . $i
print =============== step1
print =============== step1
# quorum presicion
# quorum presicion
sql create database $db vgroups 8 replica 1 d
ays
2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cachelast 2 precision 'us'
sql create database $db vgroups 8 replica 1 d
uration
2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cachelast 2 precision 'us'
sql show databases
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
...
@@ -66,7 +66,7 @@ print =============== step4
...
@@ -66,7 +66,7 @@ print =============== step4
sql_error drop database $db
sql_error drop database $db
print =============== step5
print =============== step5
sql create database $db replica 1 d
ays
15 keep 1500
sql create database $db replica 1 d
uration
15 keep 1500
sql show databases
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data20 != $db then
if $data20 != $db then
...
...
tests/script/tsim/db/create_all_options.sim
浏览文件 @
0354f3b4
...
@@ -63,7 +63,7 @@ print ============= create database with all options
...
@@ -63,7 +63,7 @@ print ============= create database with all options
# | PAGESIZE value [1~16384, default: 4]
# | PAGESIZE value [1~16384, default: 4]
# | CACHELAST value [0, 1, 2, 3, default: 0]
# | CACHELAST value [0, 1, 2, 3, default: 0]
# | COMP [0 | 1 | 2, default: 2]
# | COMP [0 | 1 | 2, default: 2]
# | D
AYS
value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day]
# | D
URATION
value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day]
# | FSYNC value [0 ~ 180000 ms, default: 3000]
# | FSYNC value [0 ~ 180000 ms, default: 3000]
# | MAXROWS value [200~10000, default: 4096]
# | MAXROWS value [200~10000, default: 4096]
# | MINROWS value [10~1000, default: 100]
# | MINROWS value [10~1000, default: 100]
...
@@ -79,7 +79,7 @@ print ============= create database with all options
...
@@ -79,7 +79,7 @@ print ============= create database with all options
#$data2_db : vgroups
#$data2_db : vgroups
#$data3_db : ntables
#$data3_db : ntables
#$data4_db : replica
#$data4_db : replica
#$data6_db : d
ays
#$data6_db : d
uration
#$data7_db : keep
#$data7_db : keep
#$data10_db : minrows
#$data10_db : minrows
#$data11_db : maxrows
#$data11_db : maxrows
...
@@ -113,7 +113,7 @@ endi
...
@@ -113,7 +113,7 @@ endi
if $data5_db != no_strict then # strict
if $data5_db != no_strict then # strict
return -1
return -1
endi
endi
if $data6_db != 14400 then # d
ays
if $data6_db != 14400 then # d
uration
return -1
return -1
endi
endi
if $data7_db != 5256000m,5256000m,5256000m then # keep
if $data7_db != 5256000m,5256000m,5256000m then # keep
...
@@ -234,9 +234,9 @@ sql drop database db
...
@@ -234,9 +234,9 @@ sql drop database db
sql_error create database db COMP 3
sql_error create database db COMP 3
sql_error create database db COMP -1
sql_error create database db COMP -1
#print ====> D
AYS
value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day]
#print ====> D
URATION
value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day]
#print ====> KEEP value [max(1d ~ 365000d), default: 1d, unit may be minut/hour/day]
#print ====> KEEP value [max(1d ~ 365000d), default: 1d, unit may be minut/hour/day]
#sql create database db D
AYS
60m KEEP 60m
#sql create database db D
URATION
60m KEEP 60m
#sql show databases
#sql show databases
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#if $data6_db != 60 then
#if $data6_db != 60 then
...
@@ -246,7 +246,7 @@ sql_error create database db COMP -1
...
@@ -246,7 +246,7 @@ sql_error create database db COMP -1
# return -1
# return -1
#endi
#endi
#sql drop database db
#sql drop database db
#sql create database db D
AYS
60m KEEP 1d
#sql create database db D
URATION
60m KEEP 1d
#sql show databases
#sql show databases
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#if $data6_db != 60 then
#if $data6_db != 60 then
...
@@ -255,7 +255,7 @@ sql_error create database db COMP -1
...
@@ -255,7 +255,7 @@ sql_error create database db COMP -1
#if $data7_db != 1440,1440,1440 then
#if $data7_db != 1440,1440,1440 then
# return -1
# return -1
#endi
#endi
#sql create database db D
AYS
3650d KEEP 365000d
#sql create database db D
URATION
3650d KEEP 365000d
#sql show databases
#sql show databases
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
#if $data6_db != 5256000 then
#if $data6_db != 5256000 then
...
@@ -265,10 +265,10 @@ sql_error create database db COMP -1
...
@@ -265,10 +265,10 @@ sql_error create database db COMP -1
# return -1
# return -1
#endi
#endi
#sql drop database db
#sql drop database db
#sql_error create database db D
AYS
-59m
#sql_error create database db D
URATION
-59m
#sql_error create database db D
AYS
59m
#sql_error create database db D
URATION
59m
#sql_error create database db D
AYS
5256001m
#sql_error create database db D
URATION
5256001m
#sql_error create database db D
AYS
3651d
#sql_error create database db D
URATION
3651d
#sql_error create database db KEEP -59m
#sql_error create database db KEEP -59m
#sql_error create database db KEEP 14399m
#sql_error create database db KEEP 14399m
#sql_error create database db KEEP 525600001m
#sql_error create database db KEEP 525600001m
...
...
tests/script/tsim/insert/commit-merge0.sim
浏览文件 @
0354f3b4
...
@@ -5,7 +5,7 @@ sleep 50
...
@@ -5,7 +5,7 @@ sleep 50
sql connect
sql connect
print =============== create database
print =============== create database
sql create database db d
ays
300 keep 365000d,365000d,365000d
sql create database db d
uration
300 keep 365000d,365000d,365000d
sql show databases
sql show databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
...
...
tests/script/tsim/query/interval-offset.sim
浏览文件 @
0354f3b4
...
@@ -5,7 +5,7 @@ sleep 500
...
@@ -5,7 +5,7 @@ sleep 500
sql connect
sql connect
print =============== create database
print =============== create database
sql create database d0 d
ays
300
sql create database d0 d
uration
300
sql use d0
sql use d0
print =============== create super table and child table
print =============== create super table and child table
...
...
tests/script/tsim/stable/alter_count.sim
浏览文件 @
0354f3b4
...
@@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print ======== step1
print ======== step1
sql create database d1 replica 1 d
ays
7 keep 50
sql create database d1 replica 1 d
uration
7 keep 50
sql use d1
sql use d1
sql create table tb (ts timestamp, a int)
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-28d, -28)
...
...
tests/script/tsim/stable/alter_import.sim
浏览文件 @
0354f3b4
...
@@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print ======== step1
print ======== step1
sql create database d1 replica 1 d
ays
7 keep 50
sql create database d1 replica 1 d
uration
7 keep 50
sql use d1
sql use d1
sql create table tb (ts timestamp, a int)
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-30d, -28)
sql insert into tb values(now-30d, -28)
...
...
tests/script/unique/db/commit.sim
浏览文件 @
0354f3b4
...
@@ -24,7 +24,7 @@ system sh/exec.sh -n dnode2 -s start
...
@@ -24,7 +24,7 @@ system sh/exec.sh -n dnode2 -s start
sleep 2000
sleep 2000
print ======== step1 create db
print ======== step1 create db
sql create database commitdb replica 1 d
ays
7 keep 30
sql create database commitdb replica 1 d
uration
7 keep 30
sql use commitdb
sql use commitdb
sql create table tb (ts timestamp, i int)
sql create table tb (ts timestamp, i int)
...
...
tests/script/unique/import/replica2.sim
浏览文件 @
0354f3b4
...
@@ -52,7 +52,7 @@ if $data4_2 != ready then
...
@@ -52,7 +52,7 @@ if $data4_2 != ready then
goto step1
goto step1
endi
endi
sql create database ir2db replica 2 d
ays
7
sql create database ir2db replica 2 d
uration
7
sql use ir2db
sql use ir2db
sql create table tb(ts timestamp, i bigint)
sql create table tb(ts timestamp, i bigint)
...
...
tests/script/unique/import/replica3.sim
浏览文件 @
0354f3b4
...
@@ -58,7 +58,7 @@ if $data4_3 != ready then
...
@@ -58,7 +58,7 @@ if $data4_3 != ready then
goto step1
goto step1
endi
endi
sql create database ir3db replica 3 d
ays
7
sql create database ir3db replica 3 d
uration
7
sql use ir3db
sql use ir3db
sql create table tb(ts timestamp, i bigint)
sql create table tb(ts timestamp, i bigint)
...
...
tests/script/windows/db/basic.sim
浏览文件 @
0354f3b4
...
@@ -17,7 +17,7 @@ $db = $dbPrefix . $i
...
@@ -17,7 +17,7 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
print =============== step1
sql create database $db replica 1 d
ays
20 keep 2000 cache 16
sql create database $db replica 1 d
uration
20 keep 2000 cache 16
sql show databases
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
if $data00 != $db then
...
@@ -57,7 +57,7 @@ print =============== step4
...
@@ -57,7 +57,7 @@ print =============== step4
sql_error drop database $db
sql_error drop database $db
print =============== step5
print =============== step5
sql create database $db replica 1 d
ays
15 keep 1500
sql create database $db replica 1 d
uration
15 keep 1500
sql show databases
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
if $data00 != $db then
...
...
tests/system-test/0-others/taosShellError.py
浏览文件 @
0354f3b4
...
@@ -48,21 +48,21 @@ def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key
...
@@ -48,21 +48,21 @@ def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key
#output = child.readline()
#output = child.readline()
#print (output.decode())
#print (output.decode())
if
len
(
expectString
)
!=
0
:
if
len
(
expectString
)
!=
0
:
i
=
child
.
expect
([
expectString
,
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
6
)
i
=
child
.
expect
([
expectString
,
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
20
)
else
:
else
:
i
=
child
.
expect
([
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
6
)
i
=
child
.
expect
([
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
20
)
if
platform
.
system
().
lower
()
==
'windows'
:
if
platform
.
system
().
lower
()
==
'windows'
:
retResult
=
child
.
before
retResult
=
child
.
before
else
:
else
:
retResult
=
child
.
before
.
decode
()
retResult
=
child
.
before
.
decode
()
print
(
"cmd return result:
\n
%s
\n
"
%
retResult
)
print
(
"cmd return result:
\n
%s
\n
"
%
retResult
)
#print(child.after.decode())
#
print(child.after.decode())
if
i
==
0
:
if
i
==
0
:
print
(
'taos login success! Here can run sql, taos> '
)
print
(
'taos login success! Here can run sql, taos> '
)
if
len
(
sqlString
)
!=
0
:
if
len
(
sqlString
)
!=
0
:
child
.
sendline
(
sqlString
)
child
.
sendline
(
sqlString
)
w
=
child
.
expect
([
"Query OK"
,
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
1
)
w
=
child
.
expect
([
"Query OK"
,
taosExpect
.
TIMEOUT
,
taosExpect
.
EOF
],
timeout
=
1
0
)
if
platform
.
system
().
lower
()
==
'windows'
:
if
platform
.
system
().
lower
()
==
'windows'
:
retResult
=
child
.
before
retResult
=
child
.
before
else
:
else
:
...
...
tests/system-test/0-others/udfTest.py
浏览文件 @
0354f3b4
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
def
prepare_data
(
self
):
def
prepare_data
(
self
):
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"create database if not exists db d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/0-others/udf_cluster.py
浏览文件 @
0354f3b4
...
@@ -63,7 +63,7 @@ class TDTestCase:
...
@@ -63,7 +63,7 @@ class TDTestCase:
def
prepare_data
(
self
):
def
prepare_data
(
self
):
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/0-others/udf_create.py
浏览文件 @
0354f3b4
...
@@ -62,7 +62,7 @@ class TDTestCase:
...
@@ -62,7 +62,7 @@ class TDTestCase:
def
prepare_data
(
self
):
def
prepare_data
(
self
):
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"create database if not exists db d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/0-others/udf_restart_taosd.py
浏览文件 @
0354f3b4
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
def
prepare_data
(
self
):
def
prepare_data
(
self
):
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"drop database if exists db "
)
tdSql
.
execute
(
"create database if not exists db d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/2-query/abs.py
浏览文件 @
0354f3b4
...
@@ -68,7 +68,7 @@ class TDTestCase:
...
@@ -68,7 +68,7 @@ class TDTestCase:
def
prepare_tag_datas
(
self
):
def
prepare_tag_datas
(
self
):
# prepare datas
# prepare datas
tdSql
.
execute
(
"create database if not exists testdb keep 3650 d
ays
1000"
)
tdSql
.
execute
(
"create database if not exists testdb keep 3650 d
uration
1000"
)
tdSql
.
execute
(
" use testdb "
)
tdSql
.
execute
(
" use testdb "
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/2-query/sample.py
浏览文件 @
0354f3b4
...
@@ -628,7 +628,7 @@ class TDTestCase:
...
@@ -628,7 +628,7 @@ class TDTestCase:
def
basic_sample_query
(
self
):
def
basic_sample_query
(
self
):
tdSql
.
execute
(
" drop database if exists db "
)
tdSql
.
execute
(
" drop database if exists db "
)
tdSql
.
execute
(
" create database if not exists db d
ays
300 "
)
tdSql
.
execute
(
" create database if not exists db d
uration
300 "
)
tdSql
.
execute
(
" use db "
)
tdSql
.
execute
(
" use db "
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/6-cluster/5dnode1mnode.py
浏览文件 @
0354f3b4
...
@@ -104,7 +104,7 @@ class TDTestCase:
...
@@ -104,7 +104,7 @@ class TDTestCase:
tdSql
.
error
(
"drop mnode on dnode 1;"
)
tdSql
.
error
(
"drop mnode on dnode 1;"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/6-cluster/5dnode2mnode.py
浏览文件 @
0354f3b4
...
@@ -104,7 +104,7 @@ class TDTestCase:
...
@@ -104,7 +104,7 @@ class TDTestCase:
tdSql
.
error
(
"drop mnode on dnode 1;"
)
tdSql
.
error
(
"drop mnode on dnode 1;"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db replica 1 d
uration
300"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
@@ -163,7 +163,7 @@ class TDTestCase:
...
@@ -163,7 +163,7 @@ class TDTestCase:
# fisrt add data : db\stable\childtable\general table
# fisrt add data : db\stable\childtable\general table
tdSql
.
execute
(
"drop database if exists db2"
)
tdSql
.
execute
(
"drop database if exists db2"
)
tdSql
.
execute
(
"create database if not exists db2 replica 1 d
ays
300"
)
tdSql
.
execute
(
"create database if not exists db2 replica 1 d
uration
300"
)
tdSql
.
execute
(
"use db2"
)
tdSql
.
execute
(
"use db2"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/6-cluster/5dnode3mnodeDrop.py
浏览文件 @
0354f3b4
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
# fisrt add data : db\stable\childtable\general table
# fisrt add data : db\stable\childtable\general table
for
couti
in
count
:
for
couti
in
count
:
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
ays
300"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
uration
300"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/6-cluster/5dnode3mnodeStop.py
浏览文件 @
0354f3b4
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
# fisrt add data : db\stable\childtable\general table
# fisrt add data : db\stable\childtable\general table
for
couti
in
count
:
for
couti
in
count
:
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
ays
300"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
uration
300"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/6-cluster/5dnode3mnodeStopInsert.py
浏览文件 @
0354f3b4
...
@@ -54,7 +54,7 @@ class TDTestCase:
...
@@ -54,7 +54,7 @@ class TDTestCase:
# fisrt add data : db\stable\childtable\general table
# fisrt add data : db\stable\childtable\general table
for
couti
in
range
(
countstart
,
countstop
):
for
couti
in
range
(
countstart
,
countstop
):
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
ays
300"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 d
uration
300"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
...
tests/system-test/7-tmq/schema.py
浏览文件 @
0354f3b4
...
@@ -358,8 +358,8 @@ class TDTestCase:
...
@@ -358,8 +358,8 @@ class TDTestCase:
tdSql
.
error
(
"alter table %s.%s modify column c2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify column c2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s set tag t1
10"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t1
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t2
'20'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t2
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -370,9 +370,9 @@ class TDTestCase:
...
@@ -370,9 +370,9 @@ class TDTestCase:
tdSql
.
query
(
"alter table %s.%s modify column c4 binary(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c4 binary(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s set tag t3
30"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
query
(
"alter table %s.%s set tag t3
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t4
'40'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
query
(
"alter table %s.%s set tag t4
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t5
'50'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
query
(
"alter table %s.%s set tag t5
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s rename column c3 c3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename column c3 c3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename column c4 c4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename column c4 c4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -395,7 +395,7 @@ class TDTestCase:
...
@@ -395,7 +395,7 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case 2: "
)
tdLog
.
printNoPrefix
(
"======== test case 2: "
)
parameterDict
=
{
'cfg'
:
''
,
\
parameterDict
=
{
'cfg'
:
''
,
\
'actionType'
:
0
,
\
'actionType'
:
0
,
\
'dbName'
:
'db
1
'
,
\
'dbName'
:
'db
2
'
,
\
'dropFlag'
:
1
,
\
'dropFlag'
:
1
,
\
'vgroups'
:
4
,
\
'vgroups'
:
4
,
\
'replica'
:
1
,
\
'replica'
:
1
,
\
...
@@ -407,8 +407,8 @@ class TDTestCase:
...
@@ -407,8 +407,8 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
parameterDict
[
'cfg'
]
=
cfgPath
#
tdLog.info("create database, super table, child table, normal table")
tdLog
.
info
(
"create database, super table, child table, normal table"
)
#
self.create_database(tdSql, parameterDict["dbName"])
self
.
create_database
(
tdSql
,
parameterDict
[
"dbName"
])
ntbName
=
'ntb2'
ntbName
=
'ntb2'
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
ntbName
))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
ntbName
))
...
@@ -449,10 +449,10 @@ class TDTestCase:
...
@@ -449,10 +449,10 @@ class TDTestCase:
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c5
new
"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c5"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s add column c5 int"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s add column c5 int"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -508,10 +508,10 @@ class TDTestCase:
...
@@ -508,10 +508,10 @@ class TDTestCase:
tdSql
.
error
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s set tag t1
11"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t1
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t2
'22'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t2
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t3
33"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t3
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t4
'44'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t4
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -526,7 +526,7 @@ class TDTestCase:
...
@@ -526,7 +526,7 @@ class TDTestCase:
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(60)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s set tag t5
'50'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
query
(
"alter table %s.%s set tag t5
='50'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -543,7 +543,7 @@ class TDTestCase:
...
@@ -543,7 +543,7 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case 3: "
)
tdLog
.
printNoPrefix
(
"======== test case 3: "
)
parameterDict
=
{
'cfg'
:
''
,
\
parameterDict
=
{
'cfg'
:
''
,
\
'actionType'
:
0
,
\
'actionType'
:
0
,
\
'dbName'
:
'db
1
'
,
\
'dbName'
:
'db
3
'
,
\
'dropFlag'
:
1
,
\
'dropFlag'
:
1
,
\
'vgroups'
:
4
,
\
'vgroups'
:
4
,
\
'replica'
:
1
,
\
'replica'
:
1
,
\
...
@@ -555,7 +555,8 @@ class TDTestCase:
...
@@ -555,7 +555,8 @@ class TDTestCase:
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
parameterDict
[
'cfg'
]
=
cfgPath
# tdLog.info("create database, super table, child table, normal table")
tdLog
.
info
(
"create database, super table, child table, normal table"
)
self
.
create_database
(
tdSql
,
parameterDict
[
"dbName"
])
ntbName
=
'ntb3'
ntbName
=
'ntb3'
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
ntbName
))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
ntbName
))
...
@@ -627,7 +628,7 @@ class TDTestCase:
...
@@ -627,7 +628,7 @@ class TDTestCase:
parameterDict
[
'stbName'
]
=
'stb31'
parameterDict
[
'stbName'
]
=
'stb31'
ctbName
=
'stb31_0'
ctbName
=
'stb31_0'
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"create table %s.%s using %s.%s tags (10,
100, '100
0')"
%
(
parameterDict
[
"dbName"
],
ctbName
,
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"create table %s.%s using %s.%s tags (10,
'10', 10, '10', '1
0')"
%
(
parameterDict
[
"dbName"
],
ctbName
,
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdLog
.
info
(
"create topics from child table"
)
tdLog
.
info
(
"create topics from child table"
)
columnTopicFromCtb
=
'column_topic_from_ctb3'
columnTopicFromCtb
=
'column_topic_from_ctb3'
...
@@ -653,11 +654,11 @@ class TDTestCase:
...
@@ -653,11 +654,11 @@ class TDTestCase:
tdSql
.
error
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s set tag t1
10"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t1
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t2
'20'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t2
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t3
30"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t3
=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t4
'40'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t4
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s set tag t5
'50'"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]
))
tdSql
.
error
(
"alter table %s.%s set tag t5
='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
...
@@ -676,6 +677,148 @@ class TDTestCase:
...
@@ -676,6 +677,148 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case 3 end ...... "
)
tdLog
.
printNoPrefix
(
"======== test case 3 end ...... "
)
def
tmqCase4
(
self
,
cfgPath
,
buildPath
):
tdLog
.
printNoPrefix
(
"======== test case 4: "
)
parameterDict
=
{
'cfg'
:
''
,
\
'actionType'
:
0
,
\
'dbName'
:
'db4'
,
\
'dropFlag'
:
1
,
\
'vgroups'
:
4
,
\
'replica'
:
1
,
\
'stbName'
:
'stb4'
,
\
'ctbPrefix'
:
'stb4'
,
\
'ctbNum'
:
10
,
\
'rowsPerTbl'
:
10000
,
\
'batchNum'
:
23
,
\
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
ctbName
=
'stb4_0'
tdLog
.
info
(
"create database, super table, child table, normal table"
)
self
.
create_database
(
tdSql
,
parameterDict
[
"dbName"
])
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s using %s.%s tags (10, '10', 10, '10', '10')"
%
(
parameterDict
[
"dbName"
],
ctbName
,
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdLog
.
info
(
"create topics from super table"
)
columnTopicFromStb
=
'star_topic_from_stb4'
tdSql
.
execute
(
"create topic %s as stable %s.%s"
%
(
columnTopicFromStb
,
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdLog
.
info
(
"======== child table test:"
)
tdSql
.
query
(
"alter table %s.%s set tag t1=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t2='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t3=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t4='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t5='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdLog
.
info
(
"======== super table test:"
)
# all alter actions allow
tdSql
.
query
(
"alter table %s.%s add column c6 int"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s add tag t6 float"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c3 c3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c4 c4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t1 t1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t2 t2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t3 t3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t4 t4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c1"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c2"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c3"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c4"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c5"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdLog
.
printNoPrefix
(
"======== test case 4 end ...... "
)
def
tmqCase5
(
self
,
cfgPath
,
buildPath
):
tdLog
.
printNoPrefix
(
"======== test case 5: "
)
parameterDict
=
{
'cfg'
:
''
,
\
'actionType'
:
0
,
\
'dbName'
:
'db5'
,
\
'dropFlag'
:
1
,
\
'vgroups'
:
4
,
\
'replica'
:
1
,
\
'stbName'
:
'stb5'
,
\
'ctbPrefix'
:
'stb5'
,
\
'ctbNum'
:
10
,
\
'rowsPerTbl'
:
10000
,
\
'batchNum'
:
23
,
\
'startTs'
:
1640966400000
}
# 2022-01-01 00:00:00.000
parameterDict
[
'cfg'
]
=
cfgPath
ctbName
=
'stb5_0'
tdLog
.
info
(
"create database, super table, child table, normal table"
)
self
.
create_database
(
tdSql
,
parameterDict
[
"dbName"
])
tdSql
.
query
(
"create table %s.%s (ts timestamp, c1 int, c2 binary(32), c3 double, c4 binary(32), c5 nchar(10)) tags (t1 int, t2 binary(32), t3 double, t4 binary(32), t5 nchar(10))"
%
(
parameterDict
[
"dbName"
],
parameterDict
[
"stbName"
]))
tdSql
.
query
(
"create table %s.%s using %s.%s tags (10, '10', 10, '10', '10')"
%
(
parameterDict
[
"dbName"
],
ctbName
,
parameterDict
[
"dbName"
],
parameterDict
[
'stbName'
]))
tdLog
.
info
(
"create topics from super table"
)
columnTopicFromStb
=
'star_topic_from_db5'
tdSql
.
execute
(
"create topic %s as database %s"
%
(
columnTopicFromStb
,
parameterDict
[
'dbName'
]))
tdLog
.
info
(
"======== child table test:"
)
tdSql
.
query
(
"alter table %s.%s set tag t1=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t2='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t3=20"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t4='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdSql
.
query
(
"alter table %s.%s set tag t5='20'"
%
(
parameterDict
[
'dbName'
],
ctbName
))
tdLog
.
info
(
"======== super table test:"
)
# all alter actions allow
tdSql
.
query
(
"alter table %s.%s add column c6 int"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s add tag t6 float"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify column c5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t2 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t4 binary(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s modify tag t5 nchar(40)"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c1 c1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c2 c2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c3 c3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c4 c4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
error
(
"alter table %s.%s rename column c5 c5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t1 t1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t2 t2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t3 t3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t4 t4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s rename tag t5 t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c1"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c2"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c3"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c4"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop column c5"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t1new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t2new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t3new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t4new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdSql
.
query
(
"alter table %s.%s drop tag t5new"
%
(
parameterDict
[
'dbName'
],
parameterDict
[
'stbName'
]))
tdLog
.
printNoPrefix
(
"======== test case 5 end ...... "
)
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
...
@@ -687,9 +830,11 @@ class TDTestCase:
...
@@ -687,9 +830,11 @@ class TDTestCase:
cfgPath
=
buildPath
+
"/../sim/psim/cfg"
cfgPath
=
buildPath
+
"/../sim/psim/cfg"
tdLog
.
info
(
"cfgPath: %s"
%
cfgPath
)
tdLog
.
info
(
"cfgPath: %s"
%
cfgPath
)
self
.
tmqCase1
(
cfgPath
,
buildPath
)
#
self.tmqCase1(cfgPath, buildPath)
self
.
tmqCase2
(
cfgPath
,
buildPath
)
#
self.tmqCase2(cfgPath, buildPath)
# self.tmqCase3(cfgPath, buildPath)
# self.tmqCase3(cfgPath, buildPath)
self
.
tmqCase4
(
cfgPath
,
buildPath
)
self
.
tmqCase5
(
cfgPath
,
buildPath
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
0354f3b4
...
@@ -117,3 +117,4 @@ python3 ./test.py -f 7-tmq/subscribeStb3.py
...
@@ -117,3 +117,4 @@ python3 ./test.py -f 7-tmq/subscribeStb3.py
python3 ./test.py
-f
7-tmq/subscribeStb4.py
python3 ./test.py
-f
7-tmq/subscribeStb4.py
python3 ./test.py
-f
7-tmq/db.py
python3 ./test.py
-f
7-tmq/db.py
python3 ./test.py
-f
7-tmq/tmqError.py
python3 ./test.py
-f
7-tmq/tmqError.py
python3 ./test.py
-f
7-tmq/schema.py
tools/CMakeLists.txt
浏览文件 @
0354f3b4
...
@@ -9,3 +9,95 @@ IF (TD_TAOS_TOOLS)
...
@@ -9,3 +9,95 @@ IF (TD_TAOS_TOOLS)
ENDIF
()
ENDIF
()
add_subdirectory
(
shell
)
add_subdirectory
(
shell
)
IF
(
TD_BUILD_HTTP
)
MESSAGE
(
""
)
MESSAGE
(
"
${
Yellow
}
use original embedded httpd
${
ColourReset
}
"
)
MESSAGE
(
""
)
# ADD_SUBDIRECTORY(http)
ELSEIF
(
TD_BUILD_TAOSA_INTERNAL
)
MESSAGE
(
"
${
Yellow
}
use taosa internal as httpd
${
ColourReset
}
"
)
ELSE
()
MESSAGE
(
""
)
MESSAGE
(
"
${
Green
}
use taosadapter as httpd, platform is
${
PLATFORM_ARCH_STR
}
${
ColourReset
}
"
)
EXECUTE_PROCESS
(
COMMAND git rev-parse --abbrev-ref HEAD
RESULT_VARIABLE result_taos_version
OUTPUT_VARIABLE taos_version
)
STRING
(
FIND
${
taos_version
}
release is_release_branch
)
IF
(
"
${
is_release_branch
}
"
STREQUAL
"0"
)
STRING
(
SUBSTRING
"
${
taos_version
}
"
12 -1 taos_version
)
STRING
(
STRIP
"
${
taos_version
}
"
taos_version
)
ELSE
()
STRING
(
CONCAT taos_version
"_branch_"
"
${
taos_version
}
"
)
STRING
(
STRIP
"
${
taos_version
}
"
taos_version
)
ENDIF
()
EXECUTE_PROCESS
(
COMMAND cd
${
CMAKE_CURRENT_SOURCE_DIR
}
/taosadapter
)
EXECUTE_PROCESS
(
COMMAND git rev-parse --short HEAD
RESULT_VARIABLE commit_sha1
OUTPUT_VARIABLE taosadapter_commit_sha1
)
IF
(
"
${
taosadapter_commit_sha1
}
"
STREQUAL
""
)
SET
(
taosadapter_commit_sha1
"unknown"
)
ELSE
()
STRING
(
SUBSTRING
"
${
taosadapter_commit_sha1
}
"
0 7 taosadapter_commit_sha1
)
STRING
(
STRIP
"
${
taosadapter_commit_sha1
}
"
taosadapter_commit_sha1
)
ENDIF
()
MESSAGE
(
"
${
Green
}
taosAdapter will use
${
taos_version
}
and commit
${
taosadapter_commit_sha1
}
as version
${
ColourReset
}
"
)
EXECUTE_PROCESS
(
COMMAND cd ..
)
MESSAGE
(
"CURRENT SOURCE DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
IF
(
TD_LINUX
)
include
(
ExternalProject
)
ExternalProject_Add
(
taosadapter
PREFIX
"taosadapter"
SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/taosadapter
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo
"taosadapter no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -ldflags
"-s -w -X github.com/taosdata/taosadapter/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -o taosadapter-debug -ldflags
"-X github.com/taosdata/taosadapter/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/version.CommitID=
${
taosadapter_commit_sha1
}
"
INSTALL_COMMAND
COMMAND curl -sL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-
${
PLATFORM_ARCH_STR
}
_linux.tar.xz -o upx.tar.xz && tar -xvJf upx.tar.xz -C
${
CMAKE_BINARY_DIR
}
--strip-components 1 > /dev/null &&
${
CMAKE_BINARY_DIR
}
/upx taosadapter || :
COMMAND cmake -E copy taosadapter
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./taosadapter.service
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy taosadapter-debug
${
CMAKE_BINARY_DIR
}
/build/bin
)
ELSEIF
(
TD_DARWIN
)
include
(
ExternalProject
)
ExternalProject_Add
(
taosadapter
PREFIX
"taosadapter"
SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/taosadapter
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo
"taosadapter no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -ldflags
"-s -w -X github.com/taosdata/taosadapter/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -o taosadapter-debug -ldflags
"-X github.com/taosdata/taosadapter/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/version.CommitID=
${
taosadapter_commit_sha1
}
"
INSTALL_COMMAND
COMMAND cmake -E copy taosadapter
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./taosadapter.service
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy taosadapter-debug
${
CMAKE_BINARY_DIR
}
/build/bin
)
ELSE
()
MESSAGE
(
"
${
Yellow
}
Windows system still use original embedded httpd
${
ColourReset
}
"
)
ENDIF
()
ENDIF
()
taosadapter
@
9ce3f5c9
Subproject commit 9ce3f5c98ef95d9c7c596c4ed7302b0ed69a92b2
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录