Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b00c4257
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看板
提交
b00c4257
编写于
10月 08, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 'alter database pages' and 'alter database buffer'
上级
d3c4b338
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
1938 addition
and
1904 deletion
+1938
-1904
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+2
-2
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+1909
-1899
source/libs/parser/test/parAlterToBalanceTest.cpp
source/libs/parser/test/parAlterToBalanceTest.cpp
+27
-3
未找到文件。
source/libs/parser/inc/sql.y
浏览文件 @
b00c4257
...
...
@@ -217,13 +217,13 @@ alter_db_options(A) ::= alter_db_options(B) alter_db_option(C).
%type alter_db_option { SAlterOption }
%destructor alter_db_option { }
//
alter_db_option(A) ::= BUFFER NK_INTEGER(B). { A.type = DB_OPTION_BUFFER; A.val = B; }
alter_db_option(A) ::= BUFFER NK_INTEGER(B). { A.type = DB_OPTION_BUFFER; A.val = B; }
alter_db_option(A) ::= CACHEMODEL NK_STRING(B). { A.type = DB_OPTION_CACHEMODEL; A.val = B; }
alter_db_option(A) ::= CACHESIZE NK_INTEGER(B). { A.type = DB_OPTION_CACHESIZE; A.val = B; }
alter_db_option(A) ::= WAL_FSYNC_PERIOD NK_INTEGER(B). { A.type = DB_OPTION_FSYNC; A.val = B; }
alter_db_option(A) ::= KEEP integer_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; }
alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; }
//
alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; }
alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; }
//alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; }
//alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; }
alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; }
...
...
source/libs/parser/src/sql.c
浏览文件 @
b00c4257
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
source/libs/parser/test/parAlterToBalanceTest.cpp
浏览文件 @
b00c4257
...
...
@@ -79,12 +79,12 @@ TEST_F(ParserInitialATest, alterDnode) {
* alter_database_option ...
*
* alter_database_option: {
* BUFFER int_value --
todo:
range [3, 16384], default 96, unit MB
* BUFFER int_value -- range [3, 16384], default 96, unit MB
* | CACHEMODEL {'none' | 'last_row' | 'last_value' | 'both'} -- default 'none'
* | CACHESIZE int_value -- range [1, 65536], default 1, unit MB
* | WAL_FSYNC_PERIOD int_value -- rang [0, 180000], default 3000, unit ms
* | KEEP {int_value | duration_value} -- rang [1, 365000], default 3650, unit day
* | PAGES int_value --
todo: rang [64, +oo)
, default 256, unit page
* | PAGES int_value --
rang [64, 16384]
, default 256, unit page
* | REPLICA int_value -- todo: enum 1, 3, default 1, unit replica
* | STRICT {'off' | 'on'} -- todo: default 'off'
* | WAL_LEVEL int_value -- enum 1, 2, default 1
...
...
@@ -162,7 +162,19 @@ TEST_F(ParserInitialATest, alterDatabase) {
setAlterDbWal
(
1
);
setAlterDbCacheModel
(
TSDB_CACHE_MODEL_LAST_ROW
);
setAlterDbSstTrigger
(
16
);
run
(
"ALTER DATABASE test CACHEMODEL 'last_row' CACHESIZE 32 WAL_FSYNC_PERIOD 200 KEEP 10 WAL_LEVEL 1 STT_TRIGGER 16"
);
setAlterDbBuffer
(
16
);
setAlterDbPages
(
128
);
run
(
"ALTER DATABASE test BUFFER 16 CACHEMODEL 'last_row' CACHESIZE 32 WAL_FSYNC_PERIOD 200 KEEP 10 PAGES 128 "
"WAL_LEVEL 1 STT_TRIGGER 16"
);
clearAlterDbReq
();
initAlterDb
(
"test"
);
setAlterDbBuffer
(
3
);
run
(
"ALTER DATABASE test BUFFER 3"
);
setAlterDbBuffer
(
64
);
run
(
"ALTER DATABASE test BUFFER 64"
);
setAlterDbBuffer
(
16384
);
run
(
"ALTER DATABASE test BUFFER 16384"
);
clearAlterDbReq
();
initAlterDb
(
"test"
);
...
...
@@ -213,6 +225,15 @@ TEST_F(ParserInitialATest, alterDatabase) {
run
(
"ALTER DATABASE test KEEP 14400m,2400h,1500d"
);
clearAlterDbReq
();
initAlterDb
(
"test"
);
setAlterDbPages
(
64
);
run
(
"ALTER DATABASE test PAGES 64"
);
setAlterDbPages
(
1024
);
run
(
"ALTER DATABASE test PAGES 1024"
);
setAlterDbPages
(
16384
);
run
(
"ALTER DATABASE test PAGES 16384"
);
clearAlterDbReq
();
initAlterDb
(
"test"
);
setAlterDbWal
(
1
);
run
(
"ALTER DATABASE test WAL_LEVEL 1"
);
...
...
@@ -224,6 +245,8 @@ TEST_F(ParserInitialATest, alterDatabase) {
TEST_F
(
ParserInitialATest
,
alterDatabaseSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
run
(
"ALTER DATABASE test BUFFER 2"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test BUFFER 16385"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test CACHEMODEL 'other'"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test CACHESIZE 0"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test CACHESIZE 65537"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
...
...
@@ -234,6 +257,7 @@ TEST_F(ParserInitialATest, alterDatabaseSemanticCheck) {
run
(
"ALTER DATABASE test KEEP 365001"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test KEEP 1000000000s"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test KEEP 1w"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test PAGES 63"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test WAL_LEVEL 0"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test WAL_LEVEL 3"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
run
(
"ALTER DATABASE test STT_TRIGGER 0"
,
TSDB_CODE_PAR_INVALID_DB_OPTION
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录