Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ad8af725
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ad8af725
编写于
9月 29, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/TD-6117
上级
54e3a3d3
b78fb511
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
811 addition
and
437 deletion
+811
-437
README.md
README.md
+13
-0
cmake/define.inc
cmake/define.inc
+4
-0
cmake/input.inc
cmake/input.inc
+6
-0
documentation20/cn/02.getting-started/docs.md
documentation20/cn/02.getting-started/docs.md
+12
-0
documentation20/en/02.getting-started/docs.md
documentation20/en/02.getting-started/docs.md
+14
-1
src/client/CMakeLists.txt
src/client/CMakeLists.txt
+5
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+7
-0
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+5
-0
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+2
-0
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+2
-0
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+149
-117
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+436
-267
src/plugins/CMakeLists.txt
src/plugins/CMakeLists.txt
+6
-2
tests/connectorTest/C#Test/nanosupport/nanotest.cs
tests/connectorTest/C#Test/nanosupport/nanotest.cs
+13
-46
tests/gotest/batchtest.bat
tests/gotest/batchtest.bat
+2
-2
tests/gotest/batchtest.sh
tests/gotest/batchtest.sh
+1
-1
tests/pytest/client/nettest.py
tests/pytest/client/nettest.py
+57
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+5
-0
tests/pytest/insert/schemaChangeTest.py
tests/pytest/insert/schemaChangeTest.py
+72
-0
未找到文件。
README.md
浏览文件 @
ad8af725
...
...
@@ -202,6 +202,19 @@ taos
If TDengine shell connects the server successfully, welcome messages and version info are printed. Otherwise, an error message is shown.
## Install TDengine by apt-get
If you use Debian or Ubuntu system, you can use 'apt-get' command to intall TDengine from official repository. Please use following commands to setup:
```
wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add -
echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-stable stable main" | sudo tee /etc/apt/sources.list.d/tdengine-stable.list
[Optional] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list
sudo apt-get update
apt-get policy tdengine
sudo apt-get install tdengine
```
## Quick Run
If you don't want to run TDengine as a service, you can run it in current shell. For example, to quickly start a TDengine server after building, run the command below in terminal: (We take Linux as an example, command on Windows will be
`taosd.exe`
)
...
...
cmake/define.inc
浏览文件 @
ad8af725
...
...
@@ -124,6 +124,10 @@ IF (TD_APLHINE)
MESSAGE
(
STATUS
"aplhine is defined"
)
ENDIF
()
IF
(
TD_BUILD_HTTP
)
ADD_DEFINITIONS
(
-
DHTTP_EMBEDDED
)
ENDIF
()
IF
(
TD_LINUX
)
ADD_DEFINITIONS
(
-
DLINUX
)
ADD_DEFINITIONS
(
-
D_LINUX
)
...
...
cmake/input.inc
浏览文件 @
ad8af725
...
...
@@ -90,6 +90,12 @@ IF (${BUILD_JDBC} MATCHES "false")
SET
(
TD_BUILD_JDBC
FALSE
)
ENDIF
()
SET
(
TD_BUILD_HTTP
TRUE
)
IF
(
$
{
BUILD_HTTP
}
MATCHES
"false"
)
SET
(
TD_BUILD_HTTP
FALSE
)
ENDIF
()
SET
(
TD_MEMORY_SANITIZER
FALSE
)
IF
(
$
{
MEMORY_SANITIZER
}
MATCHES
"true"
)
SET
(
TD_MEMORY_SANITIZER
TRUE
)
...
...
documentation20/cn/02.getting-started/docs.md
浏览文件 @
ad8af725
...
...
@@ -22,6 +22,18 @@ TDengine 的安装非常简单,从下载到安装成功仅仅只要几秒钟
具体的安装过程,请参见
[
TDengine 多种安装包的安装和卸载
](
https://www.taosdata.com/blog/2019/08/09/566.html
)
以及
[
视频教程
](
https://www.taosdata.com/blog/2020/11/11/1941.html
)
。
### 使用 apt-get 安装
如果使用 Debian 或 Ubuntu 系统,也可以使用 apt-get 从官方仓库安装,设置方法为:
```
wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add -
echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-stable stable main" | sudo tee /etc/apt/sources.list.d/tdengine-stable.list
[ beta 版安装包仓库为可选安装项 ] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list
sudo apt-get update
apt-get policy tdengine
sudo apt-get install tdengine
```
<a
class=
"anchor"
id=
"start"
></a>
## 轻松启动
...
...
documentation20/en/02.getting-started/docs.md
浏览文件 @
ad8af725
...
...
@@ -20,6 +20,19 @@ Three different packages for TDengine server are provided, please pick up the on
Click
[
here
](
https://www.taosdata.com/en/getting-started/#Install-from-Package
)
to download the install package.
### Install TDengine by apt-get
If you use Debian or Ubuntu system you can use 'apt-get' command to install TDengine from official repository. Please use following commands to setup:
```
wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add -
echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-stable stable main" | sudo tee /etc/apt/sources.list.d/tdengine-stable.list
[Optional] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list
sudo apt-get update
apt-get policy tdengine
sudo apt-get install tdengine
```
## <a class="anchor" id="start"></a>Quick Launch
After installation, you can start the TDengine service by the
`systemctl`
command.
...
...
@@ -218,4 +231,4 @@ Comparison matrix as following:
Note: ● has been verified by official tests; ○ has been verified by unofficial tests.
Please visit Connectors section for more detailed information.
\ No newline at end of file
Please visit Connectors section for more detailed information.
src/client/CMakeLists.txt
浏览文件 @
ad8af725
...
...
@@ -5,7 +5,11 @@ INCLUDE_DIRECTORIES(inc)
INCLUDE_DIRECTORIES
(
jni
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/zlib-1.2.11/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/plugins/http/inc
)
IF
(
TD_BUILD_HTTP
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/plugins/http/inc
)
ENDIF
()
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX
)
...
...
src/client/src/tscUtil.c
浏览文件 @
ad8af725
...
...
@@ -29,7 +29,10 @@
#include "tsclient.h"
#include "ttimer.h"
#include "ttokendef.h"
#ifdef HTTP_EMBEDDED
#include "httpInt.h"
#endif
static
void
freeQueryInfoImpl
(
SQueryInfo
*
pQueryInfo
);
...
...
@@ -5118,11 +5121,14 @@ void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) {
char
*
cloneCurrentDBName
(
SSqlObj
*
pSql
)
{
char
*
p
=
NULL
;
#ifdef HTTP_EMBEDDED
HttpContext
*
pCtx
=
NULL
;
#endif
pthread_mutex_lock
(
&
pSql
->
pTscObj
->
mutex
);
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
switch
(
pTscObj
->
from
)
{
#ifdef HTTP_EMBEDDED
case
TAOS_REQ_FROM_HTTP
:
pCtx
=
pSql
->
param
;
if
(
pCtx
&&
pCtx
->
db
[
0
]
!=
'\0'
)
{
...
...
@@ -5133,6 +5139,7 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
p
=
strdup
(
db
);
}
break
;
#endif
default:
break
;
}
...
...
src/dnode/CMakeLists.txt
浏览文件 @
ad8af725
...
...
@@ -18,7 +18,12 @@ ELSE ()
ENDIF
()
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
IF
(
TD_BUILD_HTTP
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync
${
LINK_JEMALLOC
}
)
ELSE
()
TARGET_LINK_LIBRARIES
(
taosd mnode monitor tsdb twal vnode cJson lua lz4 balance sync
${
LINK_JEMALLOC
}
)
ENDIF
()
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
ad8af725
...
...
@@ -49,6 +49,7 @@ static void dnodeAllocModules() {
tsModule
[
TSDB_MOD_MNODE
].
startFp
=
mnodeStartSystem
;
tsModule
[
TSDB_MOD_MNODE
].
stopFp
=
mnodeStopSystem
;
#ifdef HTTP_EMBEDDED
tsModule
[
TSDB_MOD_HTTP
].
enable
=
(
tsEnableHttpModule
==
1
);
tsModule
[
TSDB_MOD_HTTP
].
name
=
"http"
;
tsModule
[
TSDB_MOD_HTTP
].
initFp
=
httpInitSystem
;
...
...
@@ -58,6 +59,7 @@ static void dnodeAllocModules() {
if
(
tsEnableHttpModule
)
{
dnodeSetModuleStatus
(
TSDB_MOD_HTTP
);
}
#endif
#ifdef _MQTT
tsModule
[
TSDB_MOD_MQTT
].
enable
=
(
tsEnableMqttModule
==
1
);
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
ad8af725
...
...
@@ -240,7 +240,9 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t tid) {
SStatisInfo
dnodeGetStatisInfo
()
{
SStatisInfo
info
=
{
0
};
if
(
dnodeGetRunStatus
()
==
TSDB_RUN_STATUS_RUNING
)
{
#ifdef HTTP_EMBEDDED
info
.
httpReqNum
=
httpGetReqCount
();
#endif
info
.
queryReqNum
=
atomic_exchange_32
(
&
tsQueryReqNum
,
0
);
info
.
submitReqNum
=
atomic_exchange_32
(
&
tsSubmitReqNum
,
0
);
}
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
ad8af725
...
...
@@ -986,36 +986,55 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
performance_print
=
true
;
}
else
if
((
0
==
strncmp
(
argv
[
i
],
"-P"
,
strlen
(
"-P"
)))
||
(
0
==
strncmp
(
argv
[
i
],
"--port"
,
strlen
(
"--port"
))))
{
uint64_t
port
;
char
strPort
[
BIGINT_BUFF_LEN
];
if
(
2
==
strlen
(
argv
[
i
]))
{
if
(
argc
==
i
+
1
)
{
errorPrintReqArg
(
argv
[
0
],
"P"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
!
isStringNumber
(
argv
[
i
+
1
]))
{
}
else
if
(
isStringNumber
(
argv
[
i
+
1
]))
{
tstrncpy
(
strPort
,
argv
[
++
i
],
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"P"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
if
(
0
==
strncmp
(
argv
[
i
],
"--port="
,
strlen
(
"--port="
)))
{
if
(
isStringNumber
((
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
))))
{
arguments
->
port
=
atoi
((
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
)));
tstrncpy
(
strPort
,
(
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
)),
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
}
else
if
(
0
==
strncmp
(
argv
[
i
],
"-P"
,
strlen
(
"-P"
)))
{
if
(
isStringNumber
((
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
))))
{
arguments
->
port
=
atoi
((
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
)));
tstrncpy
(
strPort
,
(
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
)),
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
}
else
if
(
strlen
(
"--port"
)
==
strlen
(
argv
[
i
]))
{
if
(
argc
==
i
+
1
)
{
errorPrintReqArg3
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
!
isStringNumber
(
argv
[
i
+
1
]))
{
}
else
if
(
isStringNumber
(
argv
[
i
+
1
]))
{
tstrncpy
(
strPort
,
argv
[
++
i
],
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
{
errorUnrecognized
(
argv
[
0
],
argv
[
i
]);
exit
(
EXIT_FAILURE
);
}
port
=
atoi
(
strPort
);
if
(
port
>
65535
)
{
errorWrongValue
(
"taosdump"
,
"-P or --port"
,
strPort
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
(
uint16_t
)
port
;
}
else
if
((
0
==
strncmp
(
argv
[
i
],
"-I"
,
strlen
(
"-I"
)))
||
(
0
==
strncmp
(
argv
[
i
],
"--interface"
,
strlen
(
"--interface"
))))
{
if
(
2
==
strlen
(
argv
[
i
]))
{
...
...
@@ -1581,7 +1600,9 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
&&
strcasecmp
(
dataType
,
"BIGINT"
)
&&
strcasecmp
(
dataType
,
"DOUBLE"
)
&&
strcasecmp
(
dataType
,
"TIMESTAMP"
)
&&
!
regexMatch
(
dataType
,
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
)
&&
!
regexMatch
(
dataType
,
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
)
&&
strcasecmp
(
dataType
,
"UTINYINT"
)
&&
strcasecmp
(
dataType
,
"USMALLINT"
)
&&
strcasecmp
(
dataType
,
"UINT"
)
...
...
@@ -1603,11 +1624,13 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_FLOAT
;
}
else
if
(
0
==
strcasecmp
(
dataType
,
"DOUBLE"
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_DOUBLE
;
}
else
if
(
1
==
regexMatch
(
dataType
,
"^BINARY(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
}
else
if
(
1
==
regexMatch
(
dataType
,
"^BINARY(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_BINARY
;
}
else
if
(
1
==
regexMatch
(
dataType
,
"^NCHAR(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
}
else
if
(
1
==
regexMatch
(
dataType
,
"^NCHAR(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_NCHAR
;
}
else
if
(
0
==
strcasecmp
(
dataType
,
"BOOL"
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_BOOL
;
...
...
@@ -2663,117 +2686,127 @@ static int printfInsertMeta() {
}
}
printf
(
" super table count:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTblCount
);
for
(
uint64_t
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
printf
(
" super table[
\033
[33m%"
PRIu64
"
\033
[0m]:
\n
"
,
j
);
printf
(
" stbName:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
stbName
);
if
(
PRE_CREATE_SUBTBL
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
autoCreateTable
)
{
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"no"
);
}
else
if
(
AUTO_CREATE_SUBTBL
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
autoCreateTable
)
{
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"yes"
);
}
else
{
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"error"
);
}
if
(
TBL_NO_EXISTS
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblExists
)
{
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"no"
);
}
else
if
(
TBL_ALREADY_EXISTS
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblExists
)
{
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"yes"
);
}
else
{
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"error"
);
}
printf
(
" childTblCount:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblCount
);
printf
(
" childTblPrefix:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblPrefix
);
printf
(
" dataSource:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
);
printf
(
" iface:
\033
[33m%s
\033
[0m
\n
"
,
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
iface
==
TAOSC_IFACE
)
?
"taosc"
:
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
iface
==
REST_IFACE
)
?
"rest"
:
"stmt"
);
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblLimit
>
0
)
{
printf
(
" childTblLimit:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblLimit
);
}
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblOffset
>
0
)
{
printf
(
" childTblOffset:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblOffset
);
}
printf
(
" insertRows:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
);
/*
if (0 == g_Dbs.db[i].superTbls[j].multiThreadWriteOneTbl) {
printf(" multiThreadWriteOneTbl: \033[33m no\033[0m\n");
}else {
printf(" multiThreadWriteOneTbl: \033[33m yes\033[0m\n");
}
*/
printf
(
" interlaceRows:
\033
[33m%u
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
interlaceRows
);
if
(
g_args
.
use_metric
)
{
printf
(
" super table count:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTblCount
);
for
(
uint64_t
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
printf
(
" super table[
\033
[33m%"
PRIu64
"
\033
[0m]:
\n
"
,
j
);
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
interlaceRows
>
0
)
{
printf
(
" stable insert interval:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertInterval
);
}
printf
(
" stbName:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
stbName
);
printf
(
" disorderRange:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
disorderRange
);
printf
(
" disorderRatio:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
disorderRatio
);
printf
(
" maxSqlLen:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
maxSqlLen
);
printf
(
" timeStampStep:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
timeStampStep
);
printf
(
" startTimestamp:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
);
printf
(
" sampleFormat:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
);
printf
(
" sampleFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFile
);
printf
(
" tagsFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagsFile
);
printf
(
" columnCount:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columnCount
);
for
(
int
k
=
0
;
k
<
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columnCount
;
k
++
)
{
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].columns[k].dataType, g_Dbs.db[i].superTbls[j].columns[k].dataLen);
if
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
"binary"
,
6
))
||
(
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
"nchar"
,
5
)))
{
printf
(
"column[%d]:
\033
[33m%s(%d)
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataLen
);
if
(
PRE_CREATE_SUBTBL
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
autoCreateTable
)
{
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"no"
);
}
else
if
(
AUTO_CREATE_SUBTBL
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
autoCreateTable
)
{
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"yes"
);
}
else
{
printf
(
"column[%d]:
\033
[33m%s
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
);
printf
(
" autoCreateTable:
\033
[33m%s
\033
[0m
\n
"
,
"error"
);
}
}
printf
(
"
\n
"
);
printf
(
" tagCount:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagCount
);
for
(
int
k
=
0
;
k
<
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagCount
;
k
++
)
{
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].tags[k].dataType, g_Dbs.db[i].superTbls[j].tags[k].dataLen);
if
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
"binary"
,
strlen
(
"binary"
)))
||
(
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
"nchar"
,
strlen
(
"nchar"
))))
{
printf
(
"tag[%d]:
\033
[33m%s(%d)
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataLen
);
if
(
TBL_NO_EXISTS
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblExists
)
{
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"no"
);
}
else
if
(
TBL_ALREADY_EXISTS
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblExists
)
{
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"yes"
);
}
else
{
printf
(
"tag[%d]:
\033
[33m%s
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
);
printf
(
" childTblExists:
\033
[33m%s
\033
[0m
\n
"
,
"error"
);
}
printf
(
" childTblCount:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblCount
);
printf
(
" childTblPrefix:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblPrefix
);
printf
(
" dataSource:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
);
printf
(
" iface:
\033
[33m%s
\033
[0m
\n
"
,
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
iface
==
TAOSC_IFACE
)
?
"taosc"
:
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
iface
==
REST_IFACE
)
?
"rest"
:
"stmt"
);
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblLimit
>
0
)
{
printf
(
" childTblLimit:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblLimit
);
}
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblOffset
>
0
)
{
printf
(
" childTblOffset:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblOffset
);
}
printf
(
" insertRows:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
);
/*
if (0 == g_Dbs.db[i].superTbls[j].multiThreadWriteOneTbl) {
printf(" multiThreadWriteOneTbl: \033[33m no\033[0m\n");
}else {
printf(" multiThreadWriteOneTbl: \033[33m yes\033[0m\n");
}
*/
printf
(
" interlaceRows:
\033
[33m%u
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
interlaceRows
);
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
interlaceRows
>
0
)
{
printf
(
" stable insert interval:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertInterval
);
}
printf
(
" disorderRange:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
disorderRange
);
printf
(
" disorderRatio:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
disorderRatio
);
printf
(
" maxSqlLen:
\033
[33m%"
PRIu64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
maxSqlLen
);
printf
(
" timeStampStep:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
timeStampStep
);
printf
(
" startTimestamp:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
);
printf
(
" sampleFormat:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
);
printf
(
" sampleFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFile
);
printf
(
" tagsFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagsFile
);
printf
(
" columnCount:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columnCount
);
for
(
int
k
=
0
;
k
<
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columnCount
;
k
++
)
{
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].columns[k].dataType, g_Dbs.db[i].superTbls[j].columns[k].dataLen);
if
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
"binary"
,
6
))
||
(
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
"nchar"
,
5
)))
{
printf
(
"column[%d]:
\033
[33m%s(%d)
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataLen
);
}
else
{
printf
(
"column[%d]:
\033
[33m%s
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
);
}
}
printf
(
"
\n
"
);
printf
(
" tagCount:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagCount
);
for
(
int
k
=
0
;
k
<
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagCount
;
k
++
)
{
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].tags[k].dataType, g_Dbs.db[i].superTbls[j].tags[k].dataLen);
if
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
"binary"
,
strlen
(
"binary"
)))
||
(
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
"nchar"
,
strlen
(
"nchar"
))))
{
printf
(
"tag[%d]:
\033
[33m%s(%d)
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataLen
);
}
else
{
printf
(
"tag[%d]:
\033
[33m%s
\033
[0m "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
);
}
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
}
else
{
printf
(
" childTblCount:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_args
.
ntables
);
printf
(
" insertRows:
\033
[33m%"
PRId64
"
\033
[0m
\n
"
,
g_args
.
insertRows
);
}
printf
(
"
\n
"
);
}
...
...
@@ -10270,7 +10303,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
&
stbInfo
->
childTblName
,
&
childTblCount
,
limit
,
offset
);
ntables
=
childTblCount
;
// CBD
ntables
=
childTblCount
;
}
else
{
ntables
=
g_args
.
ntables
;
tableFrom
=
0
;
...
...
@@ -10289,8 +10322,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
b
=
ntables
%
threads
;
}
if
((
stbInfo
)
&&
(
stbInfo
->
iface
==
REST_IFACE
))
{
if
(
g_args
.
iface
==
REST_IFACE
||
((
stbInfo
)
&&
(
stbInfo
->
iface
==
REST_IFACE
)))
{
if
(
convertHostToServAddr
(
g_Dbs
.
host
,
g_Dbs
.
port
,
&
(
g_Dbs
.
serv_addr
))
!=
0
)
{
ERROR_EXIT
(
"convert host to server address"
);
...
...
@@ -11824,7 +11856,7 @@ static void setParaFromArg() {
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
data_type
=
data_type
[
i
];
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
dataType
[
i
],
min
(
DATATYPE_BUFF_LEN
,
strlen
(
dataType
[
i
])
+
1
));
if
(
1
==
regexMatch
(
dataType
[
i
],
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))$"
,
REG_ICASE
|
if
(
1
==
regexMatch
(
dataType
[
i
],
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))$"
,
REG_ICASE
|
REG_EXTENDED
))
{
sscanf
(
dataType
[
i
],
"%[^(](%[^)]"
,
type
,
length
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
atoi
(
length
);
...
...
@@ -11833,7 +11865,7 @@ static void setParaFromArg() {
}
else
{
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
g_args
.
binwidth
;
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
dataType
[
i
],
min
(
DATATYPE_BUFF_LEN
,
strlen
(
dataType
[
i
])
+
1
));
dataType
[
i
],
min
(
DATATYPE_BUFF_LEN
,
strlen
(
dataType
[
i
])
+
1
));
}
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
++
;
}
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
ad8af725
此差异已折叠。
点击以展开。
src/plugins/CMakeLists.txt
浏览文件 @
ad8af725
...
...
@@ -2,7 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
PROJECT
(
TDengine
)
ADD_SUBDIRECTORY
(
monitor
)
ADD_SUBDIRECTORY
(
http
)
IF
(
TD_BUILD_HTTP
)
ADD_SUBDIRECTORY
(
http
)
ENDIF
()
IF
(
TD_LINUX AND TD_MQTT
)
ADD_SUBDIRECTORY
(
mqtt
)
ENDIF
()
\ No newline at end of file
ENDIF
()
tests/connectorTest/C#Test/nanosupport/nanotest.cs
浏览文件 @
ad8af725
...
...
@@ -29,21 +29,7 @@ namespace TDengineDriver
private
string
password
=
"taosdata"
;
private
short
port
=
0
;
//sql parameters
private
string
dbName
;
private
string
tbName
;
private
string
precision
;
private
bool
isInsertData
;
private
bool
isQueryData
;
private
long
tableCount
;
private
long
totalRows
;
private
long
batchRows
;
private
long
beginTimestamp
=
1551369600000L
;
private
IntPtr
conn
=
IntPtr
.
Zero
;
private
long
rowsInserted
=
0
;
static
void
Main
(
string
[]
args
)
{
...
...
@@ -73,15 +59,6 @@ namespace TDengineDriver
tester
.
executeQuery
(
"select * from tb;"
);
// Console.WriteLine("expected is : {0}", width);
// tdSql.checkData(0,0,"2021-06-10 0:00:00.100000001");
// tdSql.checkData(1,0,"2021-06-10 0:00:00.150000000");
// tdSql.checkData(2,0,"2021-06-10 0:00:00.299999999");
// tdSql.checkData(3,1,3);
// tdSql.checkData(4,1,5);
// tdSql.checkData(5,1,7);
// tdSql.checkRows(6);
tester
.
executeQuery
(
"select count(*) from tb where ts > 1623254400100000000 and ts < 1623254400100000002;"
);
Console
.
WriteLine
(
"expected is : 1 "
);
tester
.
executeQuery
(
"select count(*) from tb where ts > '2021-06-10 0:00:00.100000001' and ts < '2021-06-10 0:00:00.160000000';"
);
...
...
@@ -271,8 +248,8 @@ namespace TDengineDriver
// tdSql.checkData(0,0,1623258000123456789);
Console
.
WriteLine
(
"usdb"
);
tester
.
execute
(
"drop database if exists usdb;"
);
tester
.
execute
(
"create database usdb precision 'us';"
);
tester
.
execute
(
"use usdb;"
);
tester
.
execute
(
"create stable st (ts timestamp ,speed float ) tags(time timestamp ,id int);"
);
...
...
@@ -289,16 +266,12 @@ namespace TDengineDriver
tester
.
execute
(
"insert into tb1 using st tags('2021-06-10 0:00:00.123' , 1 ) values('2021-06-10T0:00:00.123+07:00' , 1.0);"
);
tester
.
executeQuery
(
"select first(*) from tb1;"
);
Console
.
WriteLine
(
"expected is : 1623258000123 "
);
tester
.
CloseConnection
();
tester
.
cleanup
();
}
public
void
InitTDengine
()
public
void
InitTDengine
()
{
TDengine
.
Options
((
int
)
TDengineInitOption
.
TDDB_OPTION_CONFIGDIR
,
this
.
configDir
);
TDengine
.
Options
((
int
)
TDengineInitOption
.
TDDB_OPTION_SHELL_ACTIVITY_TIMER
,
"60"
);
...
...
@@ -307,7 +280,7 @@ namespace TDengineDriver
Console
.
WriteLine
(
"get connection starting..."
);
}
public
void
ConnectTDengine
()
public
void
ConnectTDengine
()
{
string
db
=
""
;
this
.
conn
=
TDengine
.
Connect
(
this
.
host
,
this
.
user
,
this
.
password
,
db
,
this
.
port
);
...
...
@@ -321,13 +294,13 @@ namespace TDengineDriver
Console
.
WriteLine
(
"[ OK ] Connection established."
);
}
}
//EXECUTE SQL
public
void
execute
(
string
sql
)
//EXECUTE SQL
public
void
execute
(
string
sql
)
{
DateTime
dt1
=
DateTime
.
Now
;
IntPtr
res
=
TDengine
.
Query
(
this
.
conn
,
sql
.
ToString
());
DateTime
dt2
=
DateTime
.
Now
;
TimeSpan
span
=
dt2
-
dt1
;
if
((
res
==
IntPtr
.
Zero
)
||
(
TDengine
.
ErrorNo
(
res
)
!=
0
))
{
...
...
@@ -345,7 +318,7 @@ namespace TDengineDriver
TDengine
.
FreeResult
(
res
);
}
//EXECUTE QUERY
public
void
executeQuery
(
string
sql
)
public
void
executeQuery
(
string
sql
)
{
DateTime
dt1
=
DateTime
.
Now
;
...
...
@@ -454,7 +427,7 @@ namespace TDengineDriver
}
public
void
CloseConnection
()
public
void
CloseConnection
()
{
if
(
this
.
conn
!=
IntPtr
.
Zero
)
{
...
...
@@ -481,22 +454,16 @@ namespace TDengineDriver
switch
(
psc
)
{
case
0
:
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
"
,
this
.
dbName
,
"
millisecond"
);
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
millisecond"
);
break
;
case
1
:
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
"
,
this
.
dbName
,
"
microsecond"
);
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
microsecond"
);
break
;
case
2
:
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
"
,
this
.
dbName
,
"
nanosecond"
);
Console
.
WriteLine
(
"db:[{0:G}]'s precision is {1:G}
nanosecond"
);
break
;
}
}
// public void checkData(int x ,int y , long ts ){
// }
}
}
}
tests/gotest/batchtest.bat
浏览文件 @
ad8af725
...
...
@@ -9,7 +9,7 @@ if "%severIp%"=="" (set severIp=127.0.0.1)
if
"
%serverPort%
"
==
""
(
set
serverPort
=
6030
)
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https
://goproxy.
io
,
direct
go
env
-w
GOPROXY
=
https
://goproxy.
cn
,
direct
cd
case001
case001
.bat
%severIp%
%serverPort%
...
...
@@ -25,4 +25,4 @@ rem cd nanosupport
rem nanoCase.bat
:: cd nanosupport
:: nanoCase.bat
\ No newline at end of file
:: nanoCase.bat
tests/gotest/batchtest.sh
浏览文件 @
ad8af725
...
...
@@ -14,7 +14,7 @@ if [ ! -n "$serverPort" ]; then
fi
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.
io
,direct
go
env
-w
GOPROXY
=
https://goproxy.
cn
,direct
bash ./case001/case001.sh
$severIp
$serverPort
bash ./case002/case002.sh
$severIp
$serverPort
...
...
tests/pytest/client/nettest.py
0 → 100644
浏览文件 @
ad8af725
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
taos
import
subprocess
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
try
:
str1
=
'taos -n speed -P 6030 -N 1000 -l 100000 -S tcp'
result1
=
subprocess
.
call
(
str1
)
except
Exception
as
result1
:
if
result1
==
1
:
tdLog
.
exit
(
"the shell 'taos -n speed -P 6030 -N 1000 -l 100000 -S tcp' is wrong"
)
try
:
str2
=
'taos -n speed -P 6030 -N 1000 -l 100000 -S udp'
result2
=
subprocess
.
call
(
str2
)
except
Exception
as
result2
:
if
result2
==
1
:
tdLog
.
exit
(
"the shell 'taos -n speed -P 6030 -N 1000 -l 100000 -S udp' is wrong"
)
try
:
str3
=
'taos -n fqdn'
result3
=
subprocess
.
call
(
str3
)
except
Exception
as
result3
:
if
result3
==
1
:
tdLog
.
exit
(
'the shell"taos -n fqdn" is wrong'
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/fulltest.sh
浏览文件 @
ad8af725
...
...
@@ -398,7 +398,12 @@ python3 ./test.py -f query/queryWildcardLength.py
python3 ./test.py
-f
query/queryTbnameUpperLower.py
python3 ./test.py
-f
query/query.py
python3 ./test.py
-f
query/queryDiffColsOr.py
python3 ./test.py
-f
client/nettest.py
python3 ./test.py
-f
query/queryRegex.py
#======================p4-end===============
...
...
tests/pytest/insert/schemaChangeTest.py
0 → 100644
浏览文件 @
ad8af725
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
import
multiprocessing
as
mp
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1609430400000
def
alterTableSchema
(
self
):
conn1
=
taos
.
connect
(
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"taosdata"
,
config
=
tdDnodes
.
getSimCfgPath
())
c1
=
conn1
.
cursor
()
c1
.
execute
(
"use db"
)
c1
.
execute
(
"alter table st drop column c2"
)
c1
.
execute
(
"alter table st add column c2 double"
)
tdLog
.
sleep
(
1
)
c1
.
execute
(
"select * from st"
)
for
data
in
c1
:
print
(
"Process 1: c2 = %s"
%
data
[
2
])
def
insertData
(
self
):
conn2
=
taos
.
connect
(
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"taosdata"
,
config
=
tdDnodes
.
getSimCfgPath
())
c2
=
conn2
.
cursor
()
tdLog
.
sleep
(
1
)
c2
.
execute
(
"use db"
)
c2
.
execute
(
"insert into t1 values(%d, 2, 2.22)"
%
(
self
.
ts
+
1
))
c2
.
execute
(
"select * from st"
)
for
data
in
c2
:
print
(
"Process 2: c2 = %f"
%
data
[
2
])
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
"create table st(ts timestamp, c1 int, c2 float) tags(t1 int)"
)
tdSql
.
execute
(
"create table t1 using st tags(1)"
)
tdSql
.
execute
(
"insert into t1 values(%d, 1, 1.11)"
%
self
.
ts
)
p1
=
mp
.
Process
(
target
=
self
.
alterTableSchema
,
args
=
())
p2
=
mp
.
Process
(
target
=
self
.
insertData
,
args
=
())
p1
.
start
()
p2
.
start
()
p1
.
join
()
p2
.
join
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录