Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
58eac469
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
58eac469
编写于
4月 03, 2021
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into xiaoping/add_test_case
上级
8904a164
a8d53d1f
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
635 addition
and
411 deletion
+635
-411
documentation20/cn/02.getting-started/docs.md
documentation20/cn/02.getting-started/docs.md
+4
-4
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+297
-255
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+182
-127
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+8
-5
src/query/src/qUtil.c
src/query/src/qUtil.c
+4
-7
src/sync/inc/syncInt.h
src/sync/inc/syncInt.h
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+6
-1
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+5
-1
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
+57
-0
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
+59
-0
tests/pytest/tools/insert-tblimit-tboffset0.json
tests/pytest/tools/insert-tblimit-tboffset0.json
+2
-2
tests/pytest/tools/insert-tblimit1-tboffset.json
tests/pytest/tools/insert-tblimit1-tboffset.json
+2
-2
tests/pytest/tools/taosdemo-sampledata.json
tests/pytest/tools/taosdemo-sampledata.json
+0
-2
tests/pytest/tools/taosdemoTestLimitOffset.py
tests/pytest/tools/taosdemoTestLimitOffset.py
+4
-1
tests/pytest/tools/taosdemoTestSampleData.py
tests/pytest/tools/taosdemoTestSampleData.py
+1
-1
未找到文件。
documentation20/cn/02.getting-started/docs.md
浏览文件 @
58eac469
...
...
@@ -101,7 +101,7 @@ $ taos -h 192.168.0.1 -s "use db; show tables;"
### 运行SQL命令脚本
TDengine
终端可以通过
`source`
命令来运行SQL
命令脚本.
TDengine
终端可以通过
`source`
命令来运行 SQL
命令脚本.
```
mysql
taos> source <filename>;
...
...
@@ -109,10 +109,10 @@ taos> source <filename>;
### Shell小技巧
-
可以使用上下光标键查看
已经历史输入的命
令
-
修改用户密码。在
shell中使用alter user命
令
-
可以使用上下光标键查看
历史输入的指
令
-
修改用户密码。在
shell 中使用 alter user 指
令
-
ctrl+c 中止正在进行中的查询
-
执行
`RESET QUERY CACHE`
清空本地缓存的表的
schema
-
执行
`RESET QUERY CACHE`
清空本地缓存的表
schema
## <a class="anchor" id="demo"></a>TDengine 极速体验
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
58eac469
...
...
@@ -222,7 +222,7 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
dnodeSendRpcVWriteRsp
(
pVnode
,
pWrite
,
pWrite
->
code
);
}
else
{
if
(
qtype
==
TAOS_QTYPE_FWD
)
{
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
.
version
,
0
,
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
.
version
,
pWrite
->
code
,
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
}
if
(
pWrite
->
rspRet
.
rsp
)
{
rpcFreeCont
(
pWrite
->
rspRet
.
rsp
);
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
58eac469
此差异已折叠。
点击以展开。
src/kit/taosdump/taosdump.c
浏览文件 @
58eac469
此差异已折叠。
点击以展开。
src/query/inc/qExecutor.h
浏览文件 @
58eac469
...
...
@@ -86,7 +86,8 @@ typedef struct SResultRow {
bool
closed
;
// this result status: closed or opened
uint32_t
numOfRows
;
// number of rows of current time window
SResultRowCellInfo
*
pCellInfo
;
// For each result column, there is a resultInfo
union
{
STimeWindow
win
;
char
*
key
;};
// start key of current result row
STimeWindow
win
;
char
*
key
;
// start key of current result row
}
SResultRow
;
typedef
struct
SGroupResInfo
{
...
...
src/query/src/qExecutor.c
浏览文件 @
58eac469
...
...
@@ -1876,14 +1876,15 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
taosHashCleanup
(
pRuntimeEnv
->
pResultRowHashTable
);
pRuntimeEnv
->
pResultRowHashTable
=
NULL
;
pRuntimeEnv
->
pool
=
destroyResultRowPool
(
pRuntimeEnv
->
pool
);
taosArrayDestroyEx
(
pRuntimeEnv
->
prevResult
,
freeInterResult
);
pRuntimeEnv
->
prevResult
=
NULL
;
taosHashCleanup
(
pRuntimeEnv
->
pTableRetrieveTsMap
);
pRuntimeEnv
->
pTableRetrieveTsMap
=
NULL
;
destroyOperatorInfo
(
pRuntimeEnv
->
proot
);
pRuntimeEnv
->
pool
=
destroyResultRowPool
(
pRuntimeEnv
->
pool
);
taosArrayDestroyEx
(
pRuntimeEnv
->
prevResult
,
freeInterResult
);
pRuntimeEnv
->
prevResult
=
NULL
;
}
static
bool
needBuildResAfterQueryComplete
(
SQInfo
*
pQInfo
)
{
...
...
@@ -6463,6 +6464,9 @@ void freeQInfo(SQInfo *pQInfo) {
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
releaseQueryBuf
(
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
);
doDestroyTableQueryInfo
(
&
pRuntimeEnv
->
tableqinfoGroupInfo
);
teardownQueryRuntimeEnv
(
&
pQInfo
->
runtimeEnv
);
SQuery
*
pQuery
=
pQInfo
->
runtimeEnv
.
pQuery
;
...
...
@@ -6498,7 +6502,6 @@ void freeQInfo(SQInfo *pQInfo) {
}
}
doDestroyTableQueryInfo
(
&
pRuntimeEnv
->
tableqinfoGroupInfo
);
tfree
(
pQInfo
->
pBuf
);
tfree
(
pQInfo
->
sql
);
...
...
src/query/src/qUtil.c
浏览文件 @
58eac469
...
...
@@ -66,8 +66,8 @@ void cleanupResultRowInfo(SResultRowInfo *pResultRowInfo) {
return
;
}
if
(
pResultRowInfo
->
type
==
TSDB_DATA_TYPE_BINARY
||
pResultRowInfo
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
for
(
int32_t
i
=
0
;
i
<
pResultRowInfo
->
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pResultRowInfo
->
size
;
++
i
)
{
if
(
pResultRowInfo
->
pResult
[
i
]
)
{
tfree
(
pResultRowInfo
->
pResult
[
i
]
->
key
);
}
}
...
...
@@ -153,11 +153,8 @@ void clearResultRow(SQueryRuntimeEnv *pRuntimeEnv, SResultRow *pResultRow, int16
pResultRow
->
offset
=
-
1
;
pResultRow
->
closed
=
false
;
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
tfree
(
pResultRow
->
key
);
}
else
{
pResultRow
->
win
=
TSWINDOW_INITIALIZER
;
}
tfree
(
pResultRow
->
key
);
pResultRow
->
win
=
TSWINDOW_INITIALIZER
;
}
// TODO refactor: use macro
...
...
src/sync/inc/syncInt.h
浏览文件 @
58eac469
...
...
@@ -35,7 +35,7 @@ extern "C" {
#define SYNC_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + sizeof(SSyncHead) + 16)
#define SYNC_RECV_BUFFER_SIZE (5*1024*1024)
#define SYNC_MAX_FWDS
512
#define SYNC_MAX_FWDS
1024
#define SYNC_FWD_TIMER 300
#define SYNC_ROLE_TIMER 15000 // ms
#define SYNC_CHECK_INTERVAL 1000 // ms
...
...
src/sync/src/syncMain.c
浏览文件 @
58eac469
...
...
@@ -1459,7 +1459,12 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle
if
((
pNode
->
quorum
>
1
||
force
)
&&
code
==
0
)
{
code
=
syncSaveFwdInfo
(
pNode
,
pWalHead
->
version
,
mhandle
);
if
(
code
>=
0
)
code
=
1
;
if
(
code
>=
0
)
{
code
=
1
;
}
else
{
pthread_mutex_unlock
(
&
pNode
->
mutex
);
return
code
;
}
}
int32_t
retLen
=
taosWriteMsg
(
pPeer
->
peerFd
,
pSyncHead
,
fwdLen
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
58eac469
...
...
@@ -91,13 +91,17 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
int32_t
syncCode
=
0
;
bool
force
=
(
pWrite
==
NULL
?
false
:
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
syncCode
=
syncForwardToPeer
(
pVnode
->
sync
,
pHead
,
pWrite
,
qtype
,
force
);
if
(
syncCode
<
0
)
return
syncCode
;
if
(
syncCode
<
0
)
{
pHead
->
version
=
0
;
return
syncCode
;
}
// write into WAL
code
=
walWrite
(
pVnode
->
wal
,
pHead
);
if
(
code
<
0
)
{
if
(
syncCode
>
0
)
atomic_sub_fetch_32
(
&
pWrite
->
processedCount
,
1
);
vError
(
"vgId:%d, hver:%"
PRIu64
" vver:%"
PRIu64
" code:0x%x"
,
pVnode
->
vgId
,
pHead
->
version
,
pVnode
->
version
,
code
);
pHead
->
version
=
0
;
return
code
;
}
...
...
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
0 → 100644
浏览文件 @
58eac469
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
4
,
"thread_count_create_tbl"
:
4
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"num_of_records_per_req"
:
100
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
365
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"number_of_tbl_in_one_sql"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
},
{
"type"
:
"DOUBLE"
,
"count"
:
10
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
3
},
{
"type"
:
"BINARY"
,
"len"
:
32
,
"count"
:
6
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
0 → 100644
浏览文件 @
58eac469
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
4
,
"thread_count_create_tbl"
:
4
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"num_of_records_per_req"
:
100
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"no"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
365
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"yes"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
1000
,
"childtable_limit"
:
33
,
"childtable_offset"
:
33
,
"multi_thread_write_one_tbl"
:
"no"
,
"number_of_tbl_in_one_sql"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
},
{
"type"
:
"DOUBLE"
,
"count"
:
10
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
3
},
{
"type"
:
"BINARY"
,
"len"
:
32
,
"count"
:
6
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}
tests/pytest/tools/insert-tblimit-tboffset0.json
浏览文件 @
58eac469
...
...
@@ -15,7 +15,7 @@
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"
yes
"
,
"drop"
:
"
no
"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
...
...
@@ -33,7 +33,7 @@
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"
no
"
,
"child_table_exists"
:
"
yes
"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
...
...
tests/pytest/tools/insert-tblimit1-tboffset.json
浏览文件 @
58eac469
...
...
@@ -15,7 +15,7 @@
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"
yes
"
,
"drop"
:
"
no
"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
...
...
@@ -33,7 +33,7 @@
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"
no
"
,
"child_table_exists"
:
"
yes
"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
...
...
tests/pytest/tools/taosdemo-sampledata.json
浏览文件 @
58eac469
...
...
@@ -16,8 +16,6 @@
"name"
:
"stb"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
20
,
"childtable_limit"
:
10
,
"childtable_offset"
:
0
,
"childtable_prefix"
:
"t_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"sample"
,
...
...
tests/pytest/tools/taosdemoTestLimitOffset.py
浏览文件 @
58eac469
...
...
@@ -51,7 +51,8 @@ class TDTestCase:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-insertrec.json"
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select count(tbname) from db.stb"
)
...
...
@@ -59,6 +60,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
33000
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset0.json"
%
binPath
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -68,6 +70,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
20000
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit1-tboffset.json"
%
binPath
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/pytest/tools/taosdemoTestSampleData.py
浏览文件 @
58eac469
...
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(tbname) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
2
00
)
tdSql
.
checkData
(
0
,
0
,
4
00
)
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录