Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b6e79b26
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看板
提交
b6e79b26
编写于
6月 04, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into feat/row_refact
上级
23494b8f
31096b1c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
121 addition
and
50 deletion
+121
-50
source/common/src/systable.c
source/common/src/systable.c
+4
-3
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+73
-3
tests/script/tsim/db/alter_option.sim
tests/script/tsim/db/alter_option.sim
+1
-1
tests/script/tsim/db/create_all_options.sim
tests/script/tsim/db/create_all_options.sim
+1
-1
tests/script/tsim/testsuit.sim
tests/script/tsim/testsuit.sim
+42
-42
未找到文件。
source/common/src/systable.c
浏览文件 @
b6e79b26
...
...
@@ -87,11 +87,12 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"wal"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"fsync"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"cache
last
"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"cache
_model
"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable
"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"single_stable
_model"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"schemaless"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"schemaless"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"retension"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
// {.name = "update", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, // disable update
};
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
b6e79b26
...
...
@@ -1431,6 +1431,52 @@ const char *mndGetDbStr(const char *src) {
return
pos
;
}
int64_t
getValOfDiffPrecision
(
int8_t
unit
,
int64_t
val
)
{
int64_t
v
=
0
;
switch
(
unit
)
{
case
's'
:
v
=
val
/
1000
;
break
;
case
'm'
:
v
=
val
/
tsTickPerMin
[
TSDB_TIME_PRECISION_MILLI
];
break
;
case
'h'
:
v
=
val
/
(
tsTickPerMin
[
TSDB_TIME_PRECISION_MILLI
]
*
60
);
break
;
case
'd'
:
v
=
val
/
(
tsTickPerMin
[
TSDB_TIME_PRECISION_MILLI
]
*
24
*
60
);
break
;
case
'w'
:
v
=
val
/
(
tsTickPerMin
[
TSDB_TIME_PRECISION_MILLI
]
*
24
*
60
*
7
);
break
;
default:
break
;
}
return
v
;
}
char
*
buildRetension
(
SArray
*
pRetension
)
{
size_t
size
=
taosArrayGetSize
(
pRetension
);
if
(
size
==
0
)
{
return
NULL
;
}
char
*
p1
=
taosMemoryCalloc
(
1
,
100
);
SRetention
*
p
=
taosArrayGet
(
pRetension
,
0
);
int32_t
len
=
2
;
int64_t
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
int64_t
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c,"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
p
=
taosArrayGet
(
pRetension
,
1
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c,"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
p
=
taosArrayGet
(
pRetension
,
2
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
varDataSetLen
(
p1
,
len
);
return
p1
;
}
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
bool
sysDb
)
{
int32_t
cols
=
0
;
...
...
@@ -1478,7 +1524,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
replications
,
false
);
const
char
*
src
=
pDb
->
cfg
.
strict
?
"strict"
:
"nostrict"
;
const
char
*
src
=
pDb
->
cfg
.
strict
?
"strict"
:
"no
_
strict"
;
char
strict
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
strict
,
src
,
strlen
(
src
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
...
...
@@ -1526,7 +1572,21 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLastRow
,
false
);
STR_WITH_SIZE_TO_VARSTR
(
strict
,
src
,
strlen
(
src
));
#if 0
char cacheModel[24] = {0};
bool null = false;
if (pDb->cfg.cacheLastRow == 0) {
STR_TO_VARSTR(cacheModel, "no_cache");
} else if (pDb->cfg.cacheLastRow == 1) {
STR_TO_VARSTR(cacheModel, "last_row_cache")
} else {
null = true;
}
colDataAppend(pColInfo, rows, cacheModel, null);
#endif
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLastRow
,
false
);
char
*
prec
=
NULL
;
switch
(
pDb
->
cfg
.
precision
)
{
...
...
@@ -1555,8 +1615,18 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
statusB
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
schemaless
,
false
);
char
*
p
=
buildRetension
(
pDb
->
cfg
.
pRetensions
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
if
(
p
==
NULL
)
{
colDataAppendNULL
(
pColInfo
,
rows
);
}
else
{
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
p
,
false
);
taosMemoryFree
(
p
);
}
}
}
...
...
tests/script/tsim/db/alter_option.sim
浏览文件 @
b6e79b26
...
...
@@ -89,7 +89,7 @@ endi
if $data4_db != 3 then # replica
return -1
endi
if $data5_db != nostrict then # strict
if $data5_db != no
_
strict then # strict
return -1
endi
if $data6_db != 345600 then # days
...
...
tests/script/tsim/db/create_all_options.sim
浏览文件 @
b6e79b26
...
...
@@ -110,7 +110,7 @@ if $data4_db != 1 then # replica
print expect 1, actual: $data4_db
return -1
endi
if $data5_db != nostrict then # strict
if $data5_db != no
_
strict then # strict
return -1
endi
if $data6_db != 14400 then # days
...
...
tests/script/tsim/testsuit.sim
浏览文件 @
b6e79b26
run tsim/user/pass_alter.sim
run tsim/user/basic1.sim
run tsim/user/privilege2.sim
run tsim/user/user_len.sim
run tsim/user/privilege1.sim
run tsim/user/pass_len.sim
run tsim/table/basic1.sim
run tsim/trans/lossdata1.sim
run tsim/trans/create_db.sim
run tsim/stable/alter_metrics.sim
run tsim/stable/tag_modify.sim
run tsim/stable/alter_comment.sim
run tsim/stable/column_drop.sim
run tsim/stable/column_modify.sim
run tsim/stable/tag_rename.sim
run tsim/stable/vnode3.sim
run tsim/stable/metrics.sim
run tsim/stable/alter_insert2.sim
run tsim/stable/show.sim
run tsim/stable/alter_import.sim
run tsim/stable/tag_add.sim
run tsim/stable/tag_drop.sim
run tsim/stable/column_add.sim
run tsim/stable/alter_count.sim
run tsim/stable/values.sim
run tsim/stable/dnode3.sim
run tsim/stable/alter_insert1.sim
run tsim/stable/refcount.sim
run tsim/stable/disk.sim
run tsim/db/basic1.sim
run tsim/db/basic3.sim
run tsim/db/basic7.sim
run tsim/db/basic6.sim
run tsim/db/create_all_options.sim
run tsim/db/basic2.sim
run tsim/db/error1.sim
run tsim/db/taosdlog.sim
run tsim/db/alter_option.sim
run tsim/mnode/basic1.sim
run tsim/mnode/basic3.sim
run tsim/mnode/basic2.sim
run tsim/parser/fourArithmetic-basic.sim
#
run tsim/user/pass_alter.sim
#
run tsim/user/basic1.sim
#
run tsim/user/privilege2.sim
#
run tsim/user/user_len.sim
#
run tsim/user/privilege1.sim
##
run tsim/user/pass_len.sim
##
run tsim/table/basic1.sim
#
run tsim/trans/lossdata1.sim
#
run tsim/trans/create_db.sim
##
run tsim/stable/alter_metrics.sim
##
run tsim/stable/tag_modify.sim
##
run tsim/stable/alter_comment.sim
##
run tsim/stable/column_drop.sim
##
run tsim/stable/column_modify.sim
##
run tsim/stable/tag_rename.sim
##
run tsim/stable/vnode3.sim
##
run tsim/stable/metrics.sim
##
run tsim/stable/alter_insert2.sim
##
run tsim/stable/show.sim
##
run tsim/stable/alter_import.sim
##
run tsim/stable/tag_add.sim
##
run tsim/stable/tag_drop.sim
##
run tsim/stable/column_add.sim
##
run tsim/stable/alter_count.sim
##
run tsim/stable/values.sim
##
run tsim/stable/dnode3.sim
##
run tsim/stable/alter_insert1.sim
##
run tsim/stable/refcount.sim
##
run tsim/stable/disk.sim
#
run tsim/db/basic1.sim
#
run tsim/db/basic3.sim
##
run tsim/db/basic7.sim
#
run tsim/db/basic6.sim
#
run tsim/db/create_all_options.sim
#
run tsim/db/basic2.sim
#
run tsim/db/error1.sim
#
run tsim/db/taosdlog.sim
#
run tsim/db/alter_option.sim
#
run tsim/mnode/basic1.sim
#
run tsim/mnode/basic3.sim
#
run tsim/mnode/basic2.sim
#
run tsim/parser/fourArithmetic-basic.sim
run tsim/parser/groupby-basic.sim
run tsim/snode/basic1.sim
run tsim/query/time_process.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录