Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
20a49e30
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
20a49e30
编写于
7月 16, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
7月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14978 from taosdata/feature/3.0_debug_wxy
fix: database options 'strict' and 'cachelast' syntax adjustments
上级
97f68ed8
299e117d
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
313 addition
and
248 deletion
+313
-248
include/common/ttokendef.h
include/common/ttokendef.h
+2
-2
include/libs/nodes/cmdnodes.h
include/libs/nodes/cmdnodes.h
+3
-1
include/util/tdef.h
include/util/tdef.h
+22
-11
source/common/src/systable.c
source/common/src/systable.c
+3
-3
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+25
-6
source/libs/command/src/command.c
source/libs/command/src/command.c
+8
-8
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+3
-3
source/libs/parser/inc/parAst.h
source/libs/parser/inc/parAst.h
+2
-2
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+5
-5
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+7
-11
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+2
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+39
-9
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+86
-86
source/libs/parser/test/parInitialATest.cpp
source/libs/parser/test/parInitialATest.cpp
+1
-1
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+8
-7
tests/pytest/alter/alter_cacheLastRow.py
tests/pytest/alter/alter_cacheLastRow.py
+2
-2
tests/pytest/query/last_cache.py
tests/pytest/query/last_cache.py
+6
-6
tests/pytest/query/last_row_cache.py
tests/pytest/query/last_row_cache.py
+33
-33
tests/pytest/util/boundary.py
tests/pytest/util/boundary.py
+1
-1
tests/pytest/util/constant.py
tests/pytest/util/constant.py
+1
-1
tests/script/tsim/db/alter_option.sim
tests/script/tsim/db/alter_option.sim
+15
-15
tests/script/tsim/db/basic6.sim
tests/script/tsim/db/basic6.sim
+1
-1
tests/script/tsim/db/create_all_options.sim
tests/script/tsim/db/create_all_options.sim
+12
-12
tests/script/tsim/parser/last_cache.sim
tests/script/tsim/parser/last_cache.sim
+1
-1
tests/script/tsim/parser/like.sim
tests/script/tsim/parser/like.sim
+1
-1
tests/system-test/0-others/cachelast.py
tests/system-test/0-others/cachelast.py
+17
-11
tests/system-test/2-query/last_row.py
tests/system-test/2-query/last_row.py
+4
-4
tests/system-test/6-cluster/5dnode1mnode.py
tests/system-test/6-cluster/5dnode1mnode.py
+3
-3
未找到文件。
include/common/ttokendef.h
浏览文件 @
20a49e30
...
@@ -79,8 +79,8 @@
...
@@ -79,8 +79,8 @@
#define TK_NOT 61
#define TK_NOT 61
#define TK_EXISTS 62
#define TK_EXISTS 62
#define TK_BUFFER 63
#define TK_BUFFER 63
#define TK_CACHE
LAST
64
#define TK_CACHE
MODEL
64
#define TK_CACHE
LASTSIZE
65
#define TK_CACHE
SIZE
65
#define TK_COMP 66
#define TK_COMP 66
#define TK_DURATION 67
#define TK_DURATION 67
#define TK_NK_VARIABLE 68
#define TK_NK_VARIABLE 68
...
...
include/libs/nodes/cmdnodes.h
浏览文件 @
20a49e30
...
@@ -51,7 +51,8 @@ extern "C" {
...
@@ -51,7 +51,8 @@ extern "C" {
typedef
struct
SDatabaseOptions
{
typedef
struct
SDatabaseOptions
{
ENodeType
type
;
ENodeType
type
;
int32_t
buffer
;
int32_t
buffer
;
int8_t
cacheLast
;
char
cacheModelStr
[
TSDB_CACHE_MODEL_STR_LEN
];
int8_t
cacheModel
;
int32_t
cacheLastSize
;
int32_t
cacheLastSize
;
int8_t
compressionLevel
;
int8_t
compressionLevel
;
int32_t
daysPerFile
;
int32_t
daysPerFile
;
...
@@ -66,6 +67,7 @@ typedef struct SDatabaseOptions {
...
@@ -66,6 +67,7 @@ typedef struct SDatabaseOptions {
char
precisionStr
[
3
];
char
precisionStr
[
3
];
int8_t
precision
;
int8_t
precision
;
int8_t
replica
;
int8_t
replica
;
char
strictStr
[
TSDB_DB_STRICT_STR_LEN
];
int8_t
strict
;
int8_t
strict
;
int8_t
walLevel
;
int8_t
walLevel
;
int32_t
numOfVgroups
;
int32_t
numOfVgroups
;
...
...
include/util/tdef.h
浏览文件 @
20a49e30
...
@@ -53,7 +53,7 @@ extern const int32_t TYPE_BYTES[16];
...
@@ -53,7 +53,7 @@ extern const int32_t TYPE_BYTES[16];
#define TSDB_DATA_BIGINT_NULL 0x8000000000000000LL
#define TSDB_DATA_BIGINT_NULL 0x8000000000000000LL
#define TSDB_DATA_TIMESTAMP_NULL TSDB_DATA_BIGINT_NULL
#define TSDB_DATA_TIMESTAMP_NULL TSDB_DATA_BIGINT_NULL
#define TSDB_DATA_FLOAT_NULL 0x7FF00000 // it is an NAN
#define TSDB_DATA_FLOAT_NULL 0x7FF00000
// it is an NAN
#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000LL // an NAN
#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000LL // an NAN
#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF
#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF
#define TSDB_DATA_BINARY_NULL 0xFF
#define TSDB_DATA_BINARY_NULL 0xFF
...
@@ -107,9 +107,10 @@ extern const int32_t TYPE_BYTES[16];
...
@@ -107,9 +107,10 @@ extern const int32_t TYPE_BYTES[16];
#define TSDB_INS_USER_STABLES_DBNAME_COLID 2
#define TSDB_INS_USER_STABLES_DBNAME_COLID 2
#define TSDB_TICK_PER_SECOND(precision) \
#define TSDB_TICK_PER_SECOND(precision) \
((int64_t)((precision) == TSDB_TIME_PRECISION_MILLI ? 1000LL \
((int64_t)((precision) == TSDB_TIME_PRECISION_MILLI \
: ((precision) == TSDB_TIME_PRECISION_MICRO ? 1000000LL : 1000000000LL)))
? 1000LL \
: ((precision) == TSDB_TIME_PRECISION_MICRO ? 1000000LL : 1000000000LL)))
#define T_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#define T_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#define T_APPEND_MEMBER(dst, ptr, type, member) \
#define T_APPEND_MEMBER(dst, ptr, type, member) \
...
@@ -328,15 +329,25 @@ typedef enum ELogicConditionType {
...
@@ -328,15 +329,25 @@ typedef enum ELogicConditionType {
#define TSDB_MIN_DB_REPLICA 1
#define TSDB_MIN_DB_REPLICA 1
#define TSDB_MAX_DB_REPLICA 3
#define TSDB_MAX_DB_REPLICA 3
#define TSDB_DEFAULT_DB_REPLICA 1
#define TSDB_DEFAULT_DB_REPLICA 1
#define TSDB_DB_STRICT_STR_LEN sizeof(TSDB_DB_STRICT_OFF_STR)
#define TSDB_DB_STRICT_OFF_STR "off"
#define TSDB_DB_STRICT_ON_STR "on"
#define TSDB_DB_STRICT_OFF 0
#define TSDB_DB_STRICT_OFF 0
#define TSDB_DB_STRICT_ON 1
#define TSDB_DB_STRICT_ON 1
#define TSDB_DEFAULT_DB_STRICT 0
#define TSDB_DEFAULT_DB_STRICT TSDB_DB_STRICT_OFF
#define TSDB_MIN_DB_CACHE_LAST 0
#define TSDB_CACHE_MODEL_STR_LEN sizeof(TSDB_CACHE_MODEL_LAST_VALUE_STR)
#define TSDB_MAX_DB_CACHE_LAST 3
#define TSDB_CACHE_MODEL_NONE_STR "none"
#define TSDB_DEFAULT_CACHE_LAST 0
#define TSDB_CACHE_MODEL_LAST_ROW_STR "last_row"
#define TSDB_MIN_DB_CACHE_LAST_SIZE 1 // MB
#define TSDB_CACHE_MODEL_LAST_VALUE_STR "last_value"
#define TSDB_MAX_DB_CACHE_LAST_SIZE 65536
#define TSDB_CACHE_MODEL_BOTH_STR "both"
#define TSDB_DEFAULT_CACHE_LAST_SIZE 1
#define TSDB_CACHE_MODEL_NONE 0
#define TSDB_CACHE_MODEL_LAST_ROW 1
#define TSDB_CACHE_MODEL_LAST_VALUE 2
#define TSDB_CACHE_MODEL_BOTH 3
#define TSDB_DEFAULT_CACHE_MODEL TSDB_CACHE_MODEL_NONE
#define TSDB_MIN_DB_CACHE_SIZE 1 // MB
#define TSDB_MAX_DB_CACHE_SIZE 65536
#define TSDB_DEFAULT_CACHE_SIZE 1
#define TSDB_DB_STREAM_MODE_OFF 0
#define TSDB_DB_STREAM_MODE_OFF 0
#define TSDB_DB_STREAM_MODE_ON 1
#define TSDB_DB_STREAM_MODE_ON 1
#define TSDB_DEFAULT_DB_STREAM_MODE 0
#define TSDB_DEFAULT_DB_STREAM_MODE 0
...
...
source/common/src/systable.c
浏览文件 @
20a49e30
...
@@ -76,7 +76,7 @@ static const SSysDbTableSchema userDBSchema[] = {
...
@@ -76,7 +76,7 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"vgroups"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_SMALLINT
},
{.
name
=
"vgroups"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_SMALLINT
},
{.
name
=
"ntables"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
},
{.
name
=
"ntables"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
},
{.
name
=
"replica"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"replica"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"strict"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"strict"
,
.
bytes
=
TSDB_DB_STRICT_STR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"duration"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"duration"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"keep"
,
.
bytes
=
32
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"keep"
,
.
bytes
=
32
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"buffer"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"buffer"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
...
@@ -87,9 +87,9 @@ static const SSysDbTableSchema userDBSchema[] = {
...
@@ -87,9 +87,9 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"wal"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"wal"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"fsync"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"fsync"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"cache
_model"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"cache
Model"
,
.
bytes
=
TSDB_CACHE_MODEL_STR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable
_model
"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"single_stable"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
// {.name = "schemaless", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL},
// {.name = "schemaless", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL},
{.
name
=
"retention"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"retention"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
20a49e30
...
@@ -293,7 +293,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
...
@@ -293,7 +293,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
buffer
<
TSDB_MIN_BUFFER_PER_VNODE
||
pCfg
->
buffer
>
TSDB_MAX_BUFFER_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
buffer
<
TSDB_MIN_BUFFER_PER_VNODE
||
pCfg
->
buffer
>
TSDB_MAX_BUFFER_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
pageSize
<
TSDB_MIN_PAGESIZE_PER_VNODE
||
pCfg
->
pageSize
>
TSDB_MAX_PAGESIZE_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
pageSize
<
TSDB_MIN_PAGESIZE_PER_VNODE
||
pCfg
->
pageSize
>
TSDB_MAX_PAGESIZE_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
pages
<
TSDB_MIN_PAGES_PER_VNODE
||
pCfg
->
pages
>
TSDB_MAX_PAGES_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
pages
<
TSDB_MIN_PAGES_PER_VNODE
||
pCfg
->
pages
>
TSDB_MAX_PAGES_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
cacheLastSize
<
TSDB_MIN_DB_CACHE_
LAST_SIZE
||
pCfg
->
cacheLastSize
>
TSDB_MAX_DB_CACHE_LAST
_SIZE
)
return
-
1
;
if
(
pCfg
->
cacheLastSize
<
TSDB_MIN_DB_CACHE_
SIZE
||
pCfg
->
cacheLastSize
>
TSDB_MAX_DB_CACHE
_SIZE
)
return
-
1
;
if
(
pCfg
->
daysPerFile
<
TSDB_MIN_DAYS_PER_FILE
||
pCfg
->
daysPerFile
>
TSDB_MAX_DAYS_PER_FILE
)
return
-
1
;
if
(
pCfg
->
daysPerFile
<
TSDB_MIN_DAYS_PER_FILE
||
pCfg
->
daysPerFile
>
TSDB_MAX_DAYS_PER_FILE
)
return
-
1
;
if
(
pCfg
->
daysToKeep0
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep0
>
TSDB_MAX_KEEP
)
return
-
1
;
if
(
pCfg
->
daysToKeep0
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep0
>
TSDB_MAX_KEEP
)
return
-
1
;
if
(
pCfg
->
daysToKeep1
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep1
>
TSDB_MAX_KEEP
)
return
-
1
;
if
(
pCfg
->
daysToKeep1
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep1
>
TSDB_MAX_KEEP
)
return
-
1
;
...
@@ -312,7 +312,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
...
@@ -312,7 +312,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
replications
!=
1
&&
pCfg
->
replications
!=
3
)
return
-
1
;
if
(
pCfg
->
replications
!=
1
&&
pCfg
->
replications
!=
3
)
return
-
1
;
if
(
pCfg
->
strict
<
TSDB_DB_STRICT_OFF
||
pCfg
->
strict
>
TSDB_DB_STRICT_ON
)
return
-
1
;
if
(
pCfg
->
strict
<
TSDB_DB_STRICT_OFF
||
pCfg
->
strict
>
TSDB_DB_STRICT_ON
)
return
-
1
;
if
(
pCfg
->
schemaless
<
TSDB_DB_SCHEMALESS_OFF
||
pCfg
->
schemaless
>
TSDB_DB_SCHEMALESS_ON
)
return
-
1
;
if
(
pCfg
->
schemaless
<
TSDB_DB_SCHEMALESS_OFF
||
pCfg
->
schemaless
>
TSDB_DB_SCHEMALESS_ON
)
return
-
1
;
if
(
pCfg
->
cacheLast
<
TSDB_
MIN_DB_CACHE_LAST
||
pCfg
->
cacheLast
>
TSDB_MAX_DB_CACHE_LAST
)
return
-
1
;
if
(
pCfg
->
cacheLast
<
TSDB_
CACHE_MODEL_NONE
||
pCfg
->
cacheLast
>
TSDB_CACHE_MODEL_BOTH
)
return
-
1
;
if
(
pCfg
->
hashMethod
!=
1
)
return
-
1
;
if
(
pCfg
->
hashMethod
!=
1
)
return
-
1
;
if
(
pCfg
->
replications
>
mndGetDnodeSize
(
pMnode
))
{
if
(
pCfg
->
replications
>
mndGetDnodeSize
(
pMnode
))
{
terrno
=
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
terrno
=
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
...
@@ -341,8 +341,8 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
...
@@ -341,8 +341,8 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
if
(
pCfg
->
compression
<
0
)
pCfg
->
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
if
(
pCfg
->
compression
<
0
)
pCfg
->
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
if
(
pCfg
->
replications
<
0
)
pCfg
->
replications
=
TSDB_DEFAULT_DB_REPLICA
;
if
(
pCfg
->
replications
<
0
)
pCfg
->
replications
=
TSDB_DEFAULT_DB_REPLICA
;
if
(
pCfg
->
strict
<
0
)
pCfg
->
strict
=
TSDB_DEFAULT_DB_STRICT
;
if
(
pCfg
->
strict
<
0
)
pCfg
->
strict
=
TSDB_DEFAULT_DB_STRICT
;
if
(
pCfg
->
cacheLast
<
0
)
pCfg
->
cacheLast
=
TSDB_DEFAULT_CACHE_
LAST
;
if
(
pCfg
->
cacheLast
<
0
)
pCfg
->
cacheLast
=
TSDB_DEFAULT_CACHE_
MODEL
;
if
(
pCfg
->
cacheLastSize
<=
0
)
pCfg
->
cacheLastSize
=
TSDB_DEFAULT_CACHE_
LAST_
SIZE
;
if
(
pCfg
->
cacheLastSize
<=
0
)
pCfg
->
cacheLastSize
=
TSDB_DEFAULT_CACHE_SIZE
;
if
(
pCfg
->
numOfRetensions
<
0
)
pCfg
->
numOfRetensions
=
0
;
if
(
pCfg
->
numOfRetensions
<
0
)
pCfg
->
numOfRetensions
=
0
;
if
(
pCfg
->
schemaless
<
0
)
pCfg
->
schemaless
=
TSDB_DB_SCHEMALESS_OFF
;
if
(
pCfg
->
schemaless
<
0
)
pCfg
->
schemaless
=
TSDB_DB_SCHEMALESS_OFF
;
}
}
...
@@ -1443,6 +1443,22 @@ char *buildRetension(SArray *pRetension) {
...
@@ -1443,6 +1443,22 @@ char *buildRetension(SArray *pRetension) {
return
p1
;
return
p1
;
}
}
static
const
char
*
getCacheModelStr
(
int8_t
cacheModel
)
{
switch
(
cacheModel
)
{
case
TSDB_CACHE_MODEL_NONE
:
return
TSDB_CACHE_MODEL_NONE_STR
;
case
TSDB_CACHE_MODEL_LAST_ROW
:
return
TSDB_CACHE_MODEL_LAST_ROW_STR
;
case
TSDB_CACHE_MODEL_LAST_VALUE
:
return
TSDB_CACHE_MODEL_LAST_VALUE_STR
;
case
TSDB_CACHE_MODEL_BOTH
:
return
TSDB_CACHE_MODEL_BOTH_STR
;
default:
break
;
}
return
"unknown"
;
}
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
bool
sysDb
,
ESdbStatus
objStatus
,
bool
sysinfo
)
{
bool
sysDb
,
ESdbStatus
objStatus
,
bool
sysinfo
)
{
int32_t
cols
=
0
;
int32_t
cols
=
0
;
...
@@ -1491,7 +1507,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1491,7 +1507,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
replications
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
replications
,
false
);
const
char
*
strictStr
=
pDb
->
cfg
.
strict
?
"
strict"
:
"no_strict
"
;
const
char
*
strictStr
=
pDb
->
cfg
.
strict
?
"
on"
:
"off
"
;
char
strictVstr
[
24
]
=
{
0
};
char
strictVstr
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
strictVstr
,
strictStr
,
strlen
(
strictStr
));
STR_WITH_SIZE_TO_VARSTR
(
strictVstr
,
strictStr
,
strlen
(
strictStr
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
...
@@ -1539,8 +1555,11 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1539,8 +1555,11 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
const
char
*
cacheModelStr
=
getCacheModelStr
(
pDb
->
cfg
.
cacheLast
);
char
cacheModelVstr
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
cacheModelVstr
,
cacheModelStr
,
strlen
(
cacheModelStr
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLast
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
cacheModelVstr
,
false
);
const
char
*
precStr
=
NULL
;
const
char
*
precStr
=
NULL
;
switch
(
pDb
->
cfg
.
precision
)
{
switch
(
pDb
->
cfg
.
precision
)
{
...
...
source/libs/command/src/command.c
浏览文件 @
20a49e30
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
#include "command.h"
#include "command.h"
#include "catalog.h"
#include "catalog.h"
#include "tdatablock.h"
#include "tglobal.h"
#include "commandInt.h"
#include "commandInt.h"
#include "scheduler.h"
#include "scheduler.h"
#include "tdatablock.h"
#include "tglobal.h"
extern
SConfig
*
tsCfg
;
extern
SConfig
*
tsCfg
;
...
@@ -222,7 +222,7 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
...
@@ -222,7 +222,7 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
char
*
retentions
=
buildRetension
(
pCfg
->
pRetensions
);
char
*
retentions
=
buildRetension
(
pCfg
->
pRetensions
);
len
+=
sprintf
(
buf2
+
VARSTR_HEADER_SIZE
,
len
+=
sprintf
(
buf2
+
VARSTR_HEADER_SIZE
,
"CREATE DATABASE `%s` BUFFER %d CACHE
LAST
%d COMP %d DURATION %dm "
"CREATE DATABASE `%s` BUFFER %d CACHE
MODEL
%d COMP %d DURATION %dm "
"FSYNC %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"FSYNC %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"STRICT %d WAL %d VGROUPS %d SINGLE_STABLE %d"
,
"STRICT %d WAL %d VGROUPS %d SINGLE_STABLE %d"
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheLast
,
pCfg
->
compression
,
pCfg
->
daysPerFile
,
pCfg
->
fsyncPeriod
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheLast
,
pCfg
->
compression
,
pCfg
->
daysPerFile
,
pCfg
->
fsyncPeriod
,
...
@@ -483,7 +483,7 @@ static int32_t execShowCreateSTable(SShowCreateTableStmt* pStmt, SRetrieveTableR
...
@@ -483,7 +483,7 @@ static int32_t execShowCreateSTable(SShowCreateTableStmt* pStmt, SRetrieveTableR
static
int32_t
execAlterCmd
(
char
*
cmd
,
char
*
value
,
bool
*
processed
)
{
static
int32_t
execAlterCmd
(
char
*
cmd
,
char
*
value
,
bool
*
processed
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
if
(
0
==
strcasecmp
(
cmd
,
COMMAND_RESET_LOG
))
{
if
(
0
==
strcasecmp
(
cmd
,
COMMAND_RESET_LOG
))
{
taosResetLog
();
taosResetLog
();
cfgDumpCfg
(
tsCfg
,
0
,
false
);
cfgDumpCfg
(
tsCfg
,
0
,
false
);
...
@@ -502,13 +502,13 @@ _return:
...
@@ -502,13 +502,13 @@ _return:
if
(
code
)
{
if
(
code
)
{
terrno
=
code
;
terrno
=
code
;
}
}
return
code
;
return
code
;
}
}
static
int32_t
execAlterLocal
(
SAlterLocalStmt
*
pStmt
)
{
static
int32_t
execAlterLocal
(
SAlterLocalStmt
*
pStmt
)
{
bool
processed
=
false
;
bool
processed
=
false
;
if
(
execAlterCmd
(
pStmt
->
config
,
pStmt
->
value
,
&
processed
))
{
if
(
execAlterCmd
(
pStmt
->
config
,
pStmt
->
value
,
&
processed
))
{
return
terrno
;
return
terrno
;
}
}
...
@@ -516,7 +516,7 @@ static int32_t execAlterLocal(SAlterLocalStmt* pStmt) {
...
@@ -516,7 +516,7 @@ static int32_t execAlterLocal(SAlterLocalStmt* pStmt) {
if
(
processed
)
{
if
(
processed
)
{
goto
_return
;
goto
_return
;
}
}
if
(
cfgSetItem
(
tsCfg
,
pStmt
->
config
,
pStmt
->
value
,
CFG_STYPE_ALTER_CMD
))
{
if
(
cfgSetItem
(
tsCfg
,
pStmt
->
config
,
pStmt
->
value
,
CFG_STYPE_ALTER_CMD
))
{
return
terrno
;
return
terrno
;
}
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
20a49e30
...
@@ -3663,7 +3663,7 @@ static int32_t jsonToDownstreamSourceNode(const SJson* pJson, void* pObj) {
...
@@ -3663,7 +3663,7 @@ static int32_t jsonToDownstreamSourceNode(const SJson* pJson, void* pObj) {
}
}
static
const
char
*
jkDatabaseOptionsBuffer
=
"Buffer"
;
static
const
char
*
jkDatabaseOptionsBuffer
=
"Buffer"
;
static
const
char
*
jkDatabaseOptionsCache
last
=
"Cachelast
"
;
static
const
char
*
jkDatabaseOptionsCache
Model
=
"CacheModel
"
;
static
const
char
*
jkDatabaseOptionsCompressionLevel
=
"CompressionLevel"
;
static
const
char
*
jkDatabaseOptionsCompressionLevel
=
"CompressionLevel"
;
static
const
char
*
jkDatabaseOptionsDaysPerFileNode
=
"DaysPerFileNode"
;
static
const
char
*
jkDatabaseOptionsDaysPerFileNode
=
"DaysPerFileNode"
;
static
const
char
*
jkDatabaseOptionsDaysPerFile
=
"DaysPerFile"
;
static
const
char
*
jkDatabaseOptionsDaysPerFile
=
"DaysPerFile"
;
...
@@ -3687,7 +3687,7 @@ static int32_t databaseOptionsToJson(const void* pObj, SJson* pJson) {
...
@@ -3687,7 +3687,7 @@ static int32_t databaseOptionsToJson(const void* pObj, SJson* pJson) {
int32_t
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsBuffer
,
pNode
->
buffer
);
int32_t
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsBuffer
,
pNode
->
buffer
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsCache
last
,
pNode
->
cacheLast
);
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsCache
Model
,
pNode
->
cacheModel
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsCompressionLevel
,
pNode
->
compressionLevel
);
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDatabaseOptionsCompressionLevel
,
pNode
->
compressionLevel
);
...
@@ -3749,7 +3749,7 @@ static int32_t jsonToDatabaseOptions(const SJson* pJson, void* pObj) {
...
@@ -3749,7 +3749,7 @@ static int32_t jsonToDatabaseOptions(const SJson* pJson, void* pObj) {
int32_t
code
=
tjsonGetIntValue
(
pJson
,
jkDatabaseOptionsBuffer
,
&
pNode
->
buffer
);
int32_t
code
=
tjsonGetIntValue
(
pJson
,
jkDatabaseOptionsBuffer
,
&
pNode
->
buffer
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetTinyIntValue
(
pJson
,
jkDatabaseOptionsCache
last
,
&
pNode
->
cacheLast
);
code
=
tjsonGetTinyIntValue
(
pJson
,
jkDatabaseOptionsCache
Model
,
&
pNode
->
cacheModel
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetTinyIntValue
(
pJson
,
jkDatabaseOptionsCompressionLevel
,
&
pNode
->
compressionLevel
);
code
=
tjsonGetTinyIntValue
(
pJson
,
jkDatabaseOptionsCompressionLevel
,
&
pNode
->
compressionLevel
);
...
...
source/libs/parser/inc/parAst.h
浏览文件 @
20a49e30
...
@@ -38,8 +38,8 @@ typedef struct SAstCreateContext {
...
@@ -38,8 +38,8 @@ typedef struct SAstCreateContext {
typedef
enum
EDatabaseOptionType
{
typedef
enum
EDatabaseOptionType
{
DB_OPTION_BUFFER
=
1
,
DB_OPTION_BUFFER
=
1
,
DB_OPTION_CACHE
LAST
,
DB_OPTION_CACHE
MODEL
,
DB_OPTION_CACHE
LAST
SIZE
,
DB_OPTION_CACHESIZE
,
DB_OPTION_COMP
,
DB_OPTION_COMP
,
DB_OPTION_DAYS
,
DB_OPTION_DAYS
,
DB_OPTION_FSYNC
,
DB_OPTION_FSYNC
,
...
...
source/libs/parser/inc/sql.y
浏览文件 @
20a49e30
...
@@ -172,8 +172,8 @@ exists_opt(A) ::= .
...
@@ -172,8 +172,8 @@ exists_opt(A) ::= .
db_options(A) ::= . { A = createDefaultDatabaseOptions(pCxt); }
db_options(A) ::= . { A = createDefaultDatabaseOptions(pCxt); }
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) CACHE
LAST NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHELAST
, &C); }
db_options(A) ::= db_options(B) CACHE
MODEL NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHEMODEL
, &C); }
db_options(A) ::= db_options(B) CACHE
LASTSIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHELAST
SIZE, &C); }
db_options(A) ::= db_options(B) CACHE
SIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHE
SIZE, &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) DURATION NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) DURATION NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) DURATION NK_VARIABLE(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
db_options(A) ::= db_options(B) DURATION NK_VARIABLE(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); }
...
@@ -186,7 +186,7 @@ db_options(A) ::= db_options(B) PAGES NK_INTEGER(C).
...
@@ -186,7 +186,7 @@ db_options(A) ::= db_options(B) PAGES NK_INTEGER(C).
db_options(A) ::= db_options(B) PAGESIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PAGESIZE, &C); }
db_options(A) ::= db_options(B) PAGESIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PAGESIZE, &C); }
db_options(A) ::= db_options(B) PRECISION NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PRECISION, &C); }
db_options(A) ::= db_options(B) PRECISION NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PRECISION, &C); }
db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_REPLICA, &C); }
db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_REPLICA, &C); }
db_options(A) ::= db_options(B) STRICT NK_
INTEGER(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); }
db_options(A) ::= db_options(B) STRICT NK_
STRING(C).
{ A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); }
db_options(A) ::= db_options(B) WAL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL, &C); }
db_options(A) ::= db_options(B) WAL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL, &C); }
db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); }
db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); }
db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); }
db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); }
...
@@ -199,8 +199,8 @@ alter_db_options(A) ::= alter_db_options(B) alter_db_option(C).
...
@@ -199,8 +199,8 @@ alter_db_options(A) ::= alter_db_options(B) alter_db_option(C).
%type alter_db_option { SAlterOption }
%type alter_db_option { SAlterOption }
%destructor alter_db_option { }
%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) ::= CACHE
LAST NK_INTEGER(B). { A.type = DB_OPTION_CACHELAST
; A.val = B; }
alter_db_option(A) ::= CACHE
MODEL NK_STRING(B). { A.type = DB_OPTION_CACHEMODEL
; A.val = B; }
alter_db_option(A) ::= CACHE
LASTSIZE NK_INTEGER(B). { A.type = DB_OPTION_CACHELAST
SIZE; A.val = B; }
alter_db_option(A) ::= CACHE
SIZE NK_INTEGER(B). { A.type = DB_OPTION_CACHE
SIZE; A.val = B; }
alter_db_option(A) ::= FSYNC NK_INTEGER(B). { A.type = DB_OPTION_FSYNC; A.val = B; }
alter_db_option(A) ::= FSYNC 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 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) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; }
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
20a49e30
...
@@ -760,8 +760,8 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) {
...
@@ -760,8 +760,8 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) {
SDatabaseOptions
*
pOptions
=
(
SDatabaseOptions
*
)
nodesMakeNode
(
QUERY_NODE_DATABASE_OPTIONS
);
SDatabaseOptions
*
pOptions
=
(
SDatabaseOptions
*
)
nodesMakeNode
(
QUERY_NODE_DATABASE_OPTIONS
);
CHECK_OUT_OF_MEM
(
pOptions
);
CHECK_OUT_OF_MEM
(
pOptions
);
pOptions
->
buffer
=
TSDB_DEFAULT_BUFFER_PER_VNODE
;
pOptions
->
buffer
=
TSDB_DEFAULT_BUFFER_PER_VNODE
;
pOptions
->
cache
Last
=
TSDB_DEFAULT_CACHE_LAST
;
pOptions
->
cache
Model
=
TSDB_DEFAULT_CACHE_MODEL
;
pOptions
->
cacheLastSize
=
TSDB_DEFAULT_CACHE_
LAST_
SIZE
;
pOptions
->
cacheLastSize
=
TSDB_DEFAULT_CACHE_SIZE
;
pOptions
->
compressionLevel
=
TSDB_DEFAULT_COMP_LEVEL
;
pOptions
->
compressionLevel
=
TSDB_DEFAULT_COMP_LEVEL
;
pOptions
->
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
pOptions
->
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
pOptions
->
fsyncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
pOptions
->
fsyncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
...
@@ -787,7 +787,7 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) {
...
@@ -787,7 +787,7 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) {
SDatabaseOptions
*
pOptions
=
(
SDatabaseOptions
*
)
nodesMakeNode
(
QUERY_NODE_DATABASE_OPTIONS
);
SDatabaseOptions
*
pOptions
=
(
SDatabaseOptions
*
)
nodesMakeNode
(
QUERY_NODE_DATABASE_OPTIONS
);
CHECK_OUT_OF_MEM
(
pOptions
);
CHECK_OUT_OF_MEM
(
pOptions
);
pOptions
->
buffer
=
-
1
;
pOptions
->
buffer
=
-
1
;
pOptions
->
cache
Last
=
-
1
;
pOptions
->
cache
Model
=
-
1
;
pOptions
->
cacheLastSize
=
-
1
;
pOptions
->
cacheLastSize
=
-
1
;
pOptions
->
compressionLevel
=
-
1
;
pOptions
->
compressionLevel
=
-
1
;
pOptions
->
daysPerFile
=
-
1
;
pOptions
->
daysPerFile
=
-
1
;
...
@@ -815,10 +815,10 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
...
@@ -815,10 +815,10 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
case
DB_OPTION_BUFFER
:
case
DB_OPTION_BUFFER
:
((
SDatabaseOptions
*
)
pOptions
)
->
buffer
=
taosStr2Int32
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
((
SDatabaseOptions
*
)
pOptions
)
->
buffer
=
taosStr2Int32
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
break
;
break
;
case
DB_OPTION_CACHE
LAST
:
case
DB_OPTION_CACHE
MODEL
:
((
SDatabaseOptions
*
)
pOptions
)
->
cacheLast
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
COPY_STRING_FORM_STR_TOKEN
(((
SDatabaseOptions
*
)
pOptions
)
->
cacheModelStr
,
(
SToken
*
)
pVal
);
break
;
break
;
case
DB_OPTION_CACHE
LAST
SIZE
:
case
DB_OPTION_CACHESIZE
:
((
SDatabaseOptions
*
)
pOptions
)
->
cacheLastSize
=
taosStr2Int32
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
((
SDatabaseOptions
*
)
pOptions
)
->
cacheLastSize
=
taosStr2Int32
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
break
;
break
;
case
DB_OPTION_COMP
:
case
DB_OPTION_COMP
:
...
@@ -858,7 +858,7 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
...
@@ -858,7 +858,7 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
((
SDatabaseOptions
*
)
pOptions
)
->
replica
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
((
SDatabaseOptions
*
)
pOptions
)
->
replica
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
break
;
break
;
case
DB_OPTION_STRICT
:
case
DB_OPTION_STRICT
:
((
SDatabaseOptions
*
)
pOptions
)
->
strict
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
COPY_STRING_FORM_STR_TOKEN
(((
SDatabaseOptions
*
)
pOptions
)
->
strictStr
,
(
SToken
*
)
pVal
);
break
;
break
;
case
DB_OPTION_WAL
:
case
DB_OPTION_WAL
:
((
SDatabaseOptions
*
)
pOptions
)
->
walLevel
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
((
SDatabaseOptions
*
)
pOptions
)
->
walLevel
=
taosStr2Int8
(((
SToken
*
)
pVal
)
->
z
,
NULL
,
10
);
...
@@ -872,10 +872,6 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
...
@@ -872,10 +872,6 @@ 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:
// ((SDatabaseOptions*)pOptions)->schemaless = taosStr2Int8(((SToken*)pVal)->z, NULL, 10);
// ((SDatabaseOptions*)pOptions)->schemaless = 0;
// break;
default:
default:
break
;
break
;
}
}
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
20a49e30
...
@@ -52,8 +52,8 @@ static SKeyword keywordTable[] = {
...
@@ -52,8 +52,8 @@ static SKeyword keywordTable[] = {
{
"BUFSIZE"
,
TK_BUFSIZE
},
{
"BUFSIZE"
,
TK_BUFSIZE
},
{
"BY"
,
TK_BY
},
{
"BY"
,
TK_BY
},
{
"CACHE"
,
TK_CACHE
},
{
"CACHE"
,
TK_CACHE
},
{
"CACHE
LAST"
,
TK_CACHELAST
},
{
"CACHE
MODEL"
,
TK_CACHEMODEL
},
{
"CACHE
LASTSIZE"
,
TK_CACHELAST
SIZE
},
{
"CACHE
SIZE"
,
TK_CACHE
SIZE
},
{
"CAST"
,
TK_CAST
},
{
"CAST"
,
TK_CAST
},
{
"CLIENT_VERSION"
,
TK_CLIENT_VERSION
},
{
"CLIENT_VERSION"
,
TK_CLIENT_VERSION
},
{
"CLUSTER"
,
TK_CLUSTER
},
{
"CLUSTER"
,
TK_CLUSTER
},
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
20a49e30
...
@@ -2942,7 +2942,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
...
@@ -2942,7 +2942,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
pReq
->
compression
=
pStmt
->
pOptions
->
compressionLevel
;
pReq
->
compression
=
pStmt
->
pOptions
->
compressionLevel
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cache
Last
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cache
Model
;
pReq
->
cacheLastSize
=
pStmt
->
pOptions
->
cacheLastSize
;
pReq
->
cacheLastSize
=
pStmt
->
pOptions
->
cacheLastSize
;
pReq
->
schemaless
=
pStmt
->
pOptions
->
schemaless
;
pReq
->
schemaless
=
pStmt
->
pOptions
->
schemaless
;
pReq
->
ignoreExist
=
pStmt
->
ignoreExists
;
pReq
->
ignoreExist
=
pStmt
->
ignoreExists
;
...
@@ -3023,13 +3023,31 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt
...
@@ -3023,13 +3023,31 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
checkDbCacheModelOption
(
STranslateContext
*
pCxt
,
SDatabaseOptions
*
pOptions
)
{
if
(
'\0'
!=
pOptions
->
cacheModelStr
[
0
])
{
if
(
0
==
strcasecmp
(
pOptions
->
cacheModelStr
,
TSDB_CACHE_MODEL_NONE_STR
))
{
pOptions
->
cacheModel
=
TSDB_CACHE_MODEL_NONE
;
}
else
if
(
0
==
strcasecmp
(
pOptions
->
cacheModelStr
,
TSDB_CACHE_MODEL_LAST_ROW_STR
))
{
pOptions
->
cacheModel
=
TSDB_CACHE_MODEL_LAST_ROW
;
}
else
if
(
0
==
strcasecmp
(
pOptions
->
cacheModelStr
,
TSDB_CACHE_MODEL_LAST_VALUE_STR
))
{
pOptions
->
cacheModel
=
TSDB_CACHE_MODEL_LAST_VALUE
;
}
else
if
(
0
==
strcasecmp
(
pOptions
->
cacheModelStr
,
TSDB_CACHE_MODEL_BOTH_STR
))
{
pOptions
->
cacheModel
=
TSDB_CACHE_MODEL_BOTH
;
}
else
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STR_OPTION
,
"cacheModel"
,
pOptions
->
cacheModelStr
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
checkDbPrecisionOption
(
STranslateContext
*
pCxt
,
SDatabaseOptions
*
pOptions
)
{
static
int32_t
checkDbPrecisionOption
(
STranslateContext
*
pCxt
,
SDatabaseOptions
*
pOptions
)
{
if
(
'\0'
!=
pOptions
->
precisionStr
[
0
])
{
if
(
'\0'
!=
pOptions
->
precisionStr
[
0
])
{
if
(
0
==
strcmp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_MILLI_STR
))
{
if
(
0
==
strc
asec
mp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_MILLI_STR
))
{
pOptions
->
precision
=
TSDB_TIME_PRECISION_MILLI
;
pOptions
->
precision
=
TSDB_TIME_PRECISION_MILLI
;
}
else
if
(
0
==
strcmp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_MICRO_STR
))
{
}
else
if
(
0
==
strc
asec
mp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_MICRO_STR
))
{
pOptions
->
precision
=
TSDB_TIME_PRECISION_MICRO
;
pOptions
->
precision
=
TSDB_TIME_PRECISION_MICRO
;
}
else
if
(
0
==
strcmp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_NANO_STR
))
{
}
else
if
(
0
==
strc
asec
mp
(
pOptions
->
precisionStr
,
TSDB_TIME_PRECISION_NANO_STR
))
{
pOptions
->
precision
=
TSDB_TIME_PRECISION_NANO
;
pOptions
->
precision
=
TSDB_TIME_PRECISION_NANO
;
}
else
{
}
else
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STR_OPTION
,
"precision"
,
pOptions
->
precisionStr
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STR_OPTION
,
"precision"
,
pOptions
->
precisionStr
);
...
@@ -3038,6 +3056,19 @@ static int32_t checkDbPrecisionOption(STranslateContext* pCxt, SDatabaseOptions*
...
@@ -3038,6 +3056,19 @@ static int32_t checkDbPrecisionOption(STranslateContext* pCxt, SDatabaseOptions*
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
checkDbStrictOption
(
STranslateContext
*
pCxt
,
SDatabaseOptions
*
pOptions
)
{
if
(
'\0'
!=
pOptions
->
strictStr
[
0
])
{
if
(
0
==
strcasecmp
(
pOptions
->
strictStr
,
TSDB_DB_STRICT_OFF_STR
))
{
pOptions
->
strict
=
TSDB_DB_STRICT_OFF
;
}
else
if
(
0
==
strcasecmp
(
pOptions
->
strictStr
,
TSDB_DB_STRICT_ON_STR
))
{
pOptions
->
strict
=
TSDB_DB_STRICT_ON
;
}
else
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STR_OPTION
,
"strict"
,
pOptions
->
strictStr
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
checkDbEnumOption
(
STranslateContext
*
pCxt
,
const
char
*
pName
,
int32_t
val
,
int32_t
v1
,
int32_t
v2
)
{
static
int32_t
checkDbEnumOption
(
STranslateContext
*
pCxt
,
const
char
*
pName
,
int32_t
val
,
int32_t
v1
,
int32_t
v2
)
{
if
(
val
>=
0
&&
val
!=
v1
&&
val
!=
v2
)
{
if
(
val
>=
0
&&
val
!=
v1
&&
val
!=
v2
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ENUM_OPTION
,
pName
,
val
,
v1
,
v2
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ENUM_OPTION
,
pName
,
val
,
v1
,
v2
);
...
@@ -3104,11 +3135,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
...
@@ -3104,11 +3135,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
int32_t
code
=
int32_t
code
=
checkRangeOption
(
pCxt
,
"buffer"
,
pOptions
->
buffer
,
TSDB_MIN_BUFFER_PER_VNODE
,
TSDB_MAX_BUFFER_PER_VNODE
);
checkRangeOption
(
pCxt
,
"buffer"
,
pOptions
->
buffer
,
TSDB_MIN_BUFFER_PER_VNODE
,
TSDB_MAX_BUFFER_PER_VNODE
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
check
RangeOption
(
pCxt
,
"cacheLast"
,
pOptions
->
cacheLast
,
TSDB_MIN_DB_CACHE_LAST
,
TSDB_MAX_DB_CACHE_LAST
);
code
=
check
DbCacheModelOption
(
pCxt
,
pOptions
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"cacheLastSize"
,
pOptions
->
cacheLastSize
,
TSDB_MIN_DB_CACHE_LAST_SIZE
,
code
=
checkRangeOption
(
pCxt
,
"cacheSize"
,
pOptions
->
cacheLastSize
,
TSDB_MIN_DB_CACHE_SIZE
,
TSDB_MAX_DB_CACHE_SIZE
);
TSDB_MAX_DB_CACHE_LAST_SIZE
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"compression"
,
pOptions
->
compressionLevel
,
TSDB_MIN_COMP_LEVEL
,
TSDB_MAX_COMP_LEVEL
);
code
=
checkRangeOption
(
pCxt
,
"compression"
,
pOptions
->
compressionLevel
,
TSDB_MIN_COMP_LEVEL
,
TSDB_MAX_COMP_LEVEL
);
...
@@ -3144,7 +3174,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
...
@@ -3144,7 +3174,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
code
=
checkDbEnumOption
(
pCxt
,
"replications"
,
pOptions
->
replica
,
TSDB_MIN_DB_REPLICA
,
TSDB_MAX_DB_REPLICA
);
code
=
checkDbEnumOption
(
pCxt
,
"replications"
,
pOptions
->
replica
,
TSDB_MIN_DB_REPLICA
,
TSDB_MAX_DB_REPLICA
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDb
EnumOption
(
pCxt
,
"strict"
,
pOptions
->
strict
,
TSDB_DB_STRICT_OFF
,
TSDB_DB_STRICT_ON
);
code
=
checkDb
StrictOption
(
pCxt
,
pOptions
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbEnumOption
(
pCxt
,
"walLevel"
,
pOptions
->
walLevel
,
TSDB_MIN_WAL_LEVEL
,
TSDB_MAX_WAL_LEVEL
);
code
=
checkDbEnumOption
(
pCxt
,
"walLevel"
,
pOptions
->
walLevel
,
TSDB_MIN_WAL_LEVEL
,
TSDB_MAX_WAL_LEVEL
);
...
@@ -3229,7 +3259,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
...
@@ -3229,7 +3259,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
pReq
->
fsyncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
fsyncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cache
Last
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cache
Model
;
pReq
->
cacheLastSize
=
pStmt
->
pOptions
->
cacheLastSize
;
pReq
->
cacheLastSize
=
pStmt
->
pOptions
->
cacheLastSize
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
return
;
return
;
...
...
source/libs/parser/src/sql.c
浏览文件 @
20a49e30
...
@@ -384,32 +384,32 @@ static const YYACTIONTYPE yy_action[] = {
...
@@ -384,32 +384,32 @@ static const YYACTIONTYPE yy_action[] = {
/* 1630 */
464
,
1792
,
468
,
467
,
1512
,
469
,
1511
,
1496
,
1587
,
1824
,
/* 1630 */
464
,
1792
,
468
,
467
,
1512
,
469
,
1511
,
1496
,
1587
,
1824
,
/* 1640 */
1154
,
50
,
196
,
295
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1640 */
1154
,
50
,
196
,
295
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1650 */
577
,
1153
,
1586
,
290
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1650 */
577
,
1153
,
1586
,
290
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1660 */
577
,
1079
,
632
,
1078
,
634
,
1077
,
1076
,
584
,
1073
,
1
52
1
,
/* 1660 */
577
,
1079
,
632
,
1078
,
634
,
1077
,
1076
,
584
,
1073
,
1
07
1
,
/* 1670 */
1072
,
319
,
1761
,
320
,
583
,
1071
,
1070
,
1516
,
1514
,
321
,
/* 1670 */
1072
,
1521
,
1761
,
319
,
583
,
1070
,
1516
,
320
,
1514
,
321
,
/* 1680 */
496
,
1792
,
1495
,
498
,
1494
,
500
,
1493
,
502
,
493
,
1732
,
/* 1680 */
496
,
1792
,
1495
,
498
,
1494
,
500
,
1493
,
502
,
493
,
94
,
/* 1690 */
94
,
551
,
15
,
1792
,
1237
,
1726
,
140
,
509
,
1713
,
1824
,
/* 1690 */
1732
,
551
,
509
,
1792
,
1237
,
1726
,
140
,
1713
,
1711
,
1824
,
/* 1700 */
171
1
,
1712
,
1710
,
146
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1700 */
171
2
,
1710
,
1709
,
146
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1710 */
577
,
1
709
,
1707
,
56
,
1699
,
1247
,
229
,
581
,
510
,
227
,
/* 1710 */
577
,
1
247
,
1707
,
56
,
1699
,
41
,
227
,
581
,
510
,
84
,
/* 1720 */
214
,
1810
,
1761
,
16
,
583
,
232
,
339
,
22
5
,
322
,
584
,
/* 1720 */
214
,
1810
,
1761
,
16
,
583
,
232
,
339
,
1
5
,
322
,
584
,
/* 1730 */
219
,
78
,
515
,
41
,
1761
,
17
,
583
,
47
,
79
,
23
,
/* 1730 */
219
,
225
,
515
,
243
,
1761
,
1437
,
583
,
47
,
78
,
79
,
/* 1740 */
524
,
1437
,
84
,
234
,
13
,
243
,
236
,
1419
,
1951
,
1824
,
/* 1740 */
524
,
23
,
242
,
229
,
236
,
234
,
25
,
1419
,
1951
,
1824
,
/* 1750 */
1421
,
238
,
147
,
294
,
1793
,
586
,
1795
,
1796
,
582
,
241
,
/* 1750 */
1421
,
238
,
147
,
294
,
1793
,
586
,
1795
,
1796
,
582
,
241
,
/* 1760 */
577
,
1824
,
1843
,
242
,
1782
,
295
,
1793
,
586
,
1795
,
1796
,
/* 1760 */
577
,
1824
,
1843
,
1782
,
17
,
295
,
1793
,
586
,
1795
,
1796
,
/* 1770 */
582
,
1792
,
577
,
24
,
25
,
252
,
46
,
1414
,
83
,
18
,
/* 1770 */
582
,
1792
,
577
,
24
,
252
,
1414
,
83
,
46
,
1781
,
1394
,
/* 1780 */
1
781
,
1792
,
1394
,
1393
,
151
,
1449
,
1448
,
333
,
1453
,
1454
,
/* 1780 */
1
449
,
1792
,
1393
,
151
,
18
,
1448
,
333
,
1453
,
1452
,
10
,
/* 1790 */
14
43
,
1452
,
334
,
10
,
1280
,
1356
,
1331
,
45
,
19
,
1810
,
/* 1790 */
14
54
,
45
,
1443
,
334
,
1280
,
1356
,
1827
,
1311
,
19
,
1810
,
/* 1800 */
1827
,
576
,
1311
,
1329
,
341
,
1328
,
31
,
584
,
152
,
1810
,
/* 1800 */
589
,
1331
,
1329
,
13
,
341
,
576
,
31
,
584
,
1328
,
1810
,
/* 1810 */
12
,
20
,
1761
,
165
,
583
,
21
,
589
,
584
,
585
,
587
,
/* 1810 */
152
,
12
,
1761
,
165
,
583
,
20
,
21
,
584
,
585
,
587
,
/* 1820 */
342
,
1140
,
1761
,
1137
,
583
,
591
,
594
,
593
,
1134
,
596
,
/* 1820 */
342
,
1140
,
1761
,
591
,
583
,
1137
,
593
,
594
,
596
,
1134
,
/* 1830 */
597
,
1792
,
1128
,
599
,
600
,
602
,
1132
,
1131
,
1117
,
1824
,
/* 1830 */
1128
,
1792
,
597
,
599
,
600
,
602
,
1132
,
1117
,
1131
,
1824
,
/* 1840 */
609
,
1792
,
1149
,
295
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1840 */
1149
,
1792
,
1126
,
295
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1850 */
577
,
1792
,
1126
,
281
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1850 */
577
,
1792
,
263
,
281
,
1793
,
586
,
1795
,
1796
,
582
,
1810
,
/* 1860 */
577
,
603
,
85
,
86
,
62
,
263
,
1145
,
584
,
1130
,
1810
,
/* 1860 */
577
,
603
,
85
,
609
,
86
,
62
,
1130
,
584
,
1129
,
1810
,
/* 1870 */
11
29
,
1042
,
1761
,
618
,
583
,
264
,
1067
,
584
,
1086
,
1810
,
/* 1870 */
11
45
,
618
,
1761
,
1042
,
583
,
1086
,
1067
,
584
,
621
,
1810
,
/* 1880 */
621
,
1065
,
1761
,
1064
,
583
,
1063
,
1062
,
584
,
1061
,
1060
,
/* 1880 */
264
,
1065
,
1761
,
1062
,
583
,
1064
,
1063
,
584
,
1061
,
1060
,
/* 1890 */
1059
,
1058
,
1761
,
1083
,
583
,
1081
,
10
55
,
1054
,
1053
,
1824
,
/* 1890 */
1059
,
1058
,
1761
,
1083
,
583
,
1081
,
10
48
,
1055
,
1054
,
1824
,
/* 1900 */
105
0
,
1049
,
1528
,
282
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1900 */
105
3
,
1050
,
1528
,
282
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1910 */
577
,
104
8
,
1047
,
289
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1910 */
577
,
104
9
,
1047
,
289
,
1793
,
586
,
1795
,
1796
,
582
,
1824
,
/* 1920 */
577
,
643
,
644
,
291
,
1793
,
586
,
1795
,
1796
,
582
,
645
,
/* 1920 */
577
,
643
,
644
,
291
,
1793
,
586
,
1795
,
1796
,
582
,
645
,
/* 1930 */
577
,
1526
,
1792
,
647
,
648
,
649
,
1524
,
1522
,
651
,
652
,
/* 1930 */
577
,
1526
,
1792
,
647
,
648
,
649
,
1524
,
1522
,
651
,
652
,
/* 1940 */
653
,
655
,
656
,
657
,
1510
,
659
,
1004
,
1492
,
267
,
663
,
/* 1940 */
653
,
655
,
656
,
657
,
1510
,
659
,
1004
,
1492
,
267
,
663
,
...
@@ -641,30 +641,30 @@ static const YYCODETYPE yy_lookahead[] = {
...
@@ -641,30 +641,30 @@ static const YYCODETYPE yy_lookahead[] = {
/* 1630 */
47
,
259
,
47
,
35
,
0
,
39
,
0
,
0
,
0
,
327
,
/* 1630 */
47
,
259
,
47
,
35
,
0
,
39
,
0
,
0
,
0
,
327
,
/* 1640 */
35
,
94
,
92
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1640 */
35
,
94
,
92
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1650 */
338
,
22
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1650 */
338
,
22
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1660 */
338
,
35
,
43
,
35
,
43
,
35
,
35
,
295
,
35
,
0
,
/* 1660 */
338
,
35
,
43
,
35
,
43
,
35
,
35
,
295
,
35
,
22
,
/* 1670 */
35
,
22
,
300
,
22
,
302
,
35
,
35
,
0
,
0
,
22
,
/* 1670 */
35
,
0
,
300
,
22
,
302
,
35
,
0
,
22
,
0
,
22
,
/* 1680 */
35
,
259
,
0
,
35
,
0
,
35
,
0
,
22
,
49
,
0
,
/* 1680 */
35
,
259
,
0
,
35
,
0
,
35
,
0
,
22
,
49
,
2
0
,
/* 1690 */
20
,
369
,
85
,
259
,
35
,
0
,
172
,
22
,
0
,
327
,
/* 1690 */
0
,
369
,
22
,
259
,
35
,
0
,
172
,
0
,
0
,
327
,
/* 1700 */
0
,
0
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1700 */
0
,
0
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1710 */
338
,
0
,
0
,
153
,
0
,
181
,
149
,
295
,
153
,
39
,
/* 1710 */
338
,
181
,
0
,
153
,
0
,
43
,
39
,
295
,
153
,
95
,
/* 1720 */
150
,
287
,
300
,
230
,
302
,
46
,
292
,
85
,
153
,
295
,
/* 1720 */
150
,
287
,
300
,
230
,
302
,
46
,
292
,
85
,
153
,
295
,
/* 1730 */
86
,
85
,
155
,
4
3
,
300
,
230
,
302
,
43
,
85
,
85
,
/* 1730 */
86
,
85
,
155
,
4
6
,
300
,
86
,
302
,
43
,
85
,
85
,
/* 1740 */
151
,
8
6
,
95
,
85
,
230
,
46
,
86
,
86
,
376
,
327
,
/* 1740 */
151
,
8
5
,
43
,
149
,
86
,
85
,
43
,
86
,
376
,
327
,
/* 1750 */
86
,
85
,
85
,
331
,
332
,
333
,
334
,
335
,
336
,
85
,
/* 1750 */
86
,
85
,
85
,
331
,
332
,
333
,
334
,
335
,
336
,
85
,
/* 1760 */
338
,
327
,
340
,
4
3
,
46
,
331
,
332
,
333
,
334
,
335
,
/* 1760 */
338
,
327
,
340
,
4
6
,
230
,
331
,
332
,
333
,
334
,
335
,
/* 1770 */
336
,
259
,
338
,
85
,
4
3
,
46
,
43
,
86
,
85
,
43
,
/* 1770 */
336
,
259
,
338
,
85
,
4
6
,
86
,
85
,
43
,
46
,
86
,
/* 1780 */
46
,
259
,
86
,
86
,
46
,
35
,
35
,
35
,
35
,
86
,
/* 1780 */
35
,
259
,
86
,
46
,
43
,
35
,
35
,
35
,
35
,
2
,
/* 1790 */
86
,
35
,
35
,
2
,
22
,
193
,
86
,
224
,
43
,
287
,
/* 1790 */
86
,
224
,
86
,
35
,
22
,
193
,
85
,
22
,
43
,
287
,
/* 1800 */
85
,
85
,
22
,
86
,
292
,
86
,
85
,
295
,
4
6
,
287
,
/* 1800 */
35
,
86
,
86
,
230
,
292
,
85
,
85
,
295
,
8
6
,
287
,
/* 1810 */
85
,
85
,
300
,
46
,
302
,
85
,
3
5
,
295
,
195
,
96
,
/* 1810 */
46
,
85
,
300
,
46
,
302
,
85
,
8
5
,
295
,
195
,
96
,
/* 1820 */
35
,
86
,
300
,
8
6
,
302
,
85
,
85
,
35
,
86
,
35
,
/* 1820 */
35
,
86
,
300
,
8
5
,
302
,
86
,
35
,
85
,
35
,
86
,
/* 1830 */
8
5
,
259
,
86
,
35
,
85
,
35
,
109
,
109
,
22
,
327
,
/* 1830 */
8
6
,
259
,
85
,
35
,
85
,
35
,
109
,
22
,
109
,
327
,
/* 1840 */
97
,
259
,
35
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1840 */
35
,
259
,
86
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1850 */
338
,
259
,
86
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1850 */
338
,
259
,
43
,
331
,
332
,
333
,
334
,
335
,
336
,
287
,
/* 1860 */
338
,
85
,
85
,
85
,
85
,
43
,
22
,
295
,
109
,
287
,
/* 1860 */
338
,
85
,
85
,
97
,
85
,
85
,
109
,
295
,
109
,
287
,
/* 1870 */
109
,
62
,
300
,
61
,
302
,
43
,
35
,
295
,
68
,
287
,
/* 1870 */
22
,
61
,
300
,
62
,
302
,
68
,
35
,
295
,
83
,
287
,
/* 1880 */
83
,
35
,
300
,
35
,
302
,
35
,
35
,
295
,
35
,
22
,
/* 1880 */
43
,
35
,
300
,
22
,
302
,
35
,
35
,
295
,
35
,
22
,
/* 1890 */
35
,
35
,
300
,
68
,
302
,
35
,
35
,
35
,
35
,
327
,
/* 1890 */
35
,
35
,
300
,
68
,
302
,
35
,
22
,
35
,
35
,
327
,
/* 1900 */
35
,
35
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1900 */
35
,
35
,
0
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1910 */
338
,
35
,
35
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1910 */
338
,
35
,
35
,
331
,
332
,
333
,
334
,
335
,
336
,
327
,
/* 1920 */
338
,
35
,
47
,
331
,
332
,
333
,
334
,
335
,
336
,
39
,
/* 1920 */
338
,
35
,
47
,
331
,
332
,
333
,
334
,
335
,
336
,
39
,
...
@@ -783,23 +783,23 @@ static const unsigned short int yy_shift_ofst[] = {
...
@@ -783,23 +783,23 @@ static const unsigned short int yy_shift_ofst[] = {
/* 450 */
1603
,
1606
,
1608
,
1553
,
1611
,
1613
,
1581
,
1571
,
1580
,
1620
,
/* 450 */
1603
,
1606
,
1608
,
1553
,
1611
,
1613
,
1581
,
1571
,
1580
,
1620
,
/* 460 */
1586
,
1576
,
1587
,
1625
,
1593
,
1583
,
1590
,
1627
,
1598
,
1585
,
/* 460 */
1586
,
1576
,
1587
,
1625
,
1593
,
1583
,
1590
,
1627
,
1598
,
1585
,
/* 470 */
1596
,
1634
,
1636
,
1637
,
1638
,
1547
,
1550
,
1605
,
1629
,
1652
,
/* 470 */
1596
,
1634
,
1636
,
1637
,
1638
,
1547
,
1550
,
1605
,
1629
,
1652
,
/* 480 */
1626
,
1628
,
1630
,
1631
,
1619
,
1621
,
1633
,
1635
,
164
0
,
1641
,
/* 480 */
1626
,
1628
,
1630
,
1631
,
1619
,
1621
,
1633
,
1635
,
164
7
,
1640
,
/* 490 */
16
69
,
1649
,
1677
,
1651
,
1639
,
1678
,
1657
,
1645
,
1682
,
1648
,
/* 490 */
16
71
,
1651
,
1676
,
1655
,
1639
,
1678
,
1657
,
1645
,
1682
,
1648
,
/* 500 */
1684
,
1650
,
1686
,
1665
,
16
70
,
1689
,
1560
,
1659
,
1695
,
1524
,
/* 500 */
1684
,
1650
,
1686
,
1665
,
16
69
,
1690
,
1560
,
1659
,
1695
,
1524
,
/* 510 */
167
5
,
1565
,
1570
,
1698
,
1700
,
1575
,
1577
,
1701
,
1702
,
1711
,
/* 510 */
167
0
,
1565
,
1570
,
1697
,
1698
,
1575
,
1577
,
1700
,
1701
,
1702
,
/* 520 */
16
07
,
1644
,
1534
,
1712
,
1642
,
1589
,
1646
,
1714
,
1680
,
1567
,
/* 520 */
16
42
,
1644
,
1530
,
1712
,
1646
,
1589
,
1653
,
1714
,
1677
,
1594
,
/* 530 */
165
3
,
1647
,
1679
,
1690
,
1493
,
1654
,
1655
,
1658
,
1660
,
1661
,
/* 530 */
165
4
,
1624
,
1679
,
1672
,
1493
,
1656
,
1649
,
1660
,
1658
,
1661
,
/* 540 */
1666
,
1694
,
1664
,
1667
,
1674
,
1688
,
16
91
,
1720
,
1699
,
1718
,
/* 540 */
1666
,
1694
,
1664
,
1667
,
1674
,
1688
,
16
89
,
1699
,
1687
,
1717
,
/* 550 */
169
3
,
1731
,
1505
,
1696
,
1697
,
1729
,
1573
,
1733
,
1734
,
1738
,
/* 550 */
169
1
,
1703
,
1534
,
1693
,
1696
,
1728
,
1567
,
1734
,
1732
,
1737
,
/* 560 */
170
3
,
1736
,
1514
,
1704
,
1750
,
1751
,
1752
,
1753
,
1756
,
1757
,
/* 560 */
170
4
,
1741
,
1573
,
1706
,
1745
,
1750
,
1751
,
1752
,
1753
,
1758
,
/* 570 */
170
4
,
1791
,
1772
,
1602
,
1755
,
1715
,
1710
,
1716
,
1717
,
1721
,
/* 570 */
170
6
,
1787
,
1772
,
1602
,
1755
,
1711
,
1715
,
1720
,
1716
,
1721
,
/* 580 */
17
19
,
1762
,
1725
,
1726
,
1767
,
1780
,
1623
,
1730
,
1723
,
1735
,
/* 580 */
17
22
,
1764
,
1726
,
1730
,
1767
,
1775
,
1623
,
1731
,
1723
,
1735
,
/* 590 */
17
81
,
1785
,
1740
,
1737
,
1792
,
1741
,
1742
,
1794
,
1745
,
1746
,
/* 590 */
17
65
,
1785
,
1738
,
1739
,
1791
,
1742
,
1743
,
1793
,
1747
,
1744
,
/* 600 */
1798
,
1749
,
17
66
,
1800
,
1776
,
1727
,
1728
,
1759
,
1761
,
1816
,
/* 600 */
1798
,
1749
,
17
56
,
1800
,
1776
,
1727
,
1729
,
1757
,
1759
,
1815
,
/* 610 */
17
43
,
1777
,
1778
,
1807
,
1779
,
1822
,
1822
,
1844
,
1809
,
1812
,
/* 610 */
17
66
,
1777
,
1779
,
1805
,
1780
,
1809
,
1809
,
1848
,
1811
,
1810
,
/* 620 */
1841
,
18
10
,
1797
,
1832
,
1846
,
1848
,
1850
,
185
1
,
1853
,
1867
,
/* 620 */
1841
,
18
07
,
1795
,
1837
,
1846
,
1850
,
1851
,
186
1
,
1853
,
1867
,
/* 630 */
1855
,
1856
,
1825
,
1619
,
1860
,
1621
,
186
1
,
1862
,
1863
,
1865
,
/* 630 */
1855
,
1856
,
1825
,
1619
,
1860
,
1621
,
186
2
,
1863
,
1865
,
1866
,
/* 640 */
18
66
,
1876
,
1877
,
1902
,
1886
,
1875
,
1890
,
1931
,
1898
,
1887
,
/* 640 */
18
76
,
1874
,
1877
,
1902
,
1886
,
1875
,
1890
,
1931
,
1898
,
1887
,
/* 650 */
1896
,
1936
,
1903
,
1892
,
1901
,
1937
,
1906
,
1895
,
1904
,
1944
,
/* 650 */
1896
,
1936
,
1903
,
1892
,
1901
,
1937
,
1906
,
1895
,
1904
,
1944
,
/* 660 */
1910
,
1911
,
1947
,
1926
,
1928
,
1930
,
1932
,
1929
,
1933
,
/* 660 */
1910
,
1911
,
1947
,
1926
,
1928
,
1930
,
1932
,
1929
,
1933
,
};
};
...
@@ -987,8 +987,8 @@ static const YYCODETYPE yyFallback[] = {
...
@@ -987,8 +987,8 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* NOT => nothing */
0
,
/* NOT => nothing */
0
,
/* EXISTS => nothing */
0
,
/* EXISTS => nothing */
0
,
/* BUFFER => nothing */
0
,
/* BUFFER => nothing */
0
,
/*
CACHELAST
=> nothing */
0
,
/*
CACHEMODEL
=> nothing */
0
,
/*
CACHELAST
SIZE => nothing */
0
,
/*
CACHE
SIZE => nothing */
0
,
/* COMP => nothing */
0
,
/* COMP => nothing */
0
,
/* DURATION => nothing */
0
,
/* DURATION => nothing */
0
,
/* NK_VARIABLE => nothing */
0
,
/* NK_VARIABLE => nothing */
...
@@ -1330,8 +1330,8 @@ static const char *const yyTokenName[] = {
...
@@ -1330,8 +1330,8 @@ static const char *const yyTokenName[] = {
/* 61 */
"NOT"
,
/* 61 */
"NOT"
,
/* 62 */
"EXISTS"
,
/* 62 */
"EXISTS"
,
/* 63 */
"BUFFER"
,
/* 63 */
"BUFFER"
,
/* 64 */
"CACHE
LAST
"
,
/* 64 */
"CACHE
MODEL
"
,
/* 65 */
"CACHE
LAST
SIZE"
,
/* 65 */
"CACHESIZE"
,
/* 66 */
"COMP"
,
/* 66 */
"COMP"
,
/* 67 */
"DURATION"
,
/* 67 */
"DURATION"
,
/* 68 */
"NK_VARIABLE"
,
/* 68 */
"NK_VARIABLE"
,
...
@@ -1726,8 +1726,8 @@ static const char *const yyRuleName[] = {
...
@@ -1726,8 +1726,8 @@ static const char *const yyRuleName[] = {
/* 71 */
"exists_opt ::="
,
/* 71 */
"exists_opt ::="
,
/* 72 */
"db_options ::="
,
/* 72 */
"db_options ::="
,
/* 73 */
"db_options ::= db_options BUFFER NK_INTEGER"
,
/* 73 */
"db_options ::= db_options BUFFER NK_INTEGER"
,
/* 74 */
"db_options ::= db_options CACHE
LAST NK_INTEGER
"
,
/* 74 */
"db_options ::= db_options CACHE
MODEL NK_STRING
"
,
/* 75 */
"db_options ::= db_options CACHE
LAST
SIZE NK_INTEGER"
,
/* 75 */
"db_options ::= db_options CACHESIZE NK_INTEGER"
,
/* 76 */
"db_options ::= db_options COMP NK_INTEGER"
,
/* 76 */
"db_options ::= db_options COMP NK_INTEGER"
,
/* 77 */
"db_options ::= db_options DURATION NK_INTEGER"
,
/* 77 */
"db_options ::= db_options DURATION NK_INTEGER"
,
/* 78 */
"db_options ::= db_options DURATION NK_VARIABLE"
,
/* 78 */
"db_options ::= db_options DURATION NK_VARIABLE"
,
...
@@ -1740,7 +1740,7 @@ static const char *const yyRuleName[] = {
...
@@ -1740,7 +1740,7 @@ static const char *const yyRuleName[] = {
/* 85 */
"db_options ::= db_options PAGESIZE NK_INTEGER"
,
/* 85 */
"db_options ::= db_options PAGESIZE NK_INTEGER"
,
/* 86 */
"db_options ::= db_options PRECISION NK_STRING"
,
/* 86 */
"db_options ::= db_options PRECISION NK_STRING"
,
/* 87 */
"db_options ::= db_options REPLICA NK_INTEGER"
,
/* 87 */
"db_options ::= db_options REPLICA NK_INTEGER"
,
/* 88 */
"db_options ::= db_options STRICT NK_
INTEGER
"
,
/* 88 */
"db_options ::= db_options STRICT NK_
STRING
"
,
/* 89 */
"db_options ::= db_options WAL NK_INTEGER"
,
/* 89 */
"db_options ::= db_options WAL NK_INTEGER"
,
/* 90 */
"db_options ::= db_options VGROUPS NK_INTEGER"
,
/* 90 */
"db_options ::= db_options VGROUPS NK_INTEGER"
,
/* 91 */
"db_options ::= db_options SINGLE_STABLE NK_INTEGER"
,
/* 91 */
"db_options ::= db_options SINGLE_STABLE NK_INTEGER"
,
...
@@ -1749,8 +1749,8 @@ static const char *const yyRuleName[] = {
...
@@ -1749,8 +1749,8 @@ static const char *const yyRuleName[] = {
/* 94 */
"alter_db_options ::= alter_db_option"
,
/* 94 */
"alter_db_options ::= alter_db_option"
,
/* 95 */
"alter_db_options ::= alter_db_options alter_db_option"
,
/* 95 */
"alter_db_options ::= alter_db_options alter_db_option"
,
/* 96 */
"alter_db_option ::= BUFFER NK_INTEGER"
,
/* 96 */
"alter_db_option ::= BUFFER NK_INTEGER"
,
/* 97 */
"alter_db_option ::= CACHE
LAST NK_INTEGER
"
,
/* 97 */
"alter_db_option ::= CACHE
MODEL NK_STRING
"
,
/* 98 */
"alter_db_option ::= CACHE
LAST
SIZE NK_INTEGER"
,
/* 98 */
"alter_db_option ::= CACHESIZE NK_INTEGER"
,
/* 99 */
"alter_db_option ::= FSYNC NK_INTEGER"
,
/* 99 */
"alter_db_option ::= FSYNC NK_INTEGER"
,
/* 100 */
"alter_db_option ::= KEEP integer_list"
,
/* 100 */
"alter_db_option ::= KEEP integer_list"
,
/* 101 */
"alter_db_option ::= KEEP variable_list"
,
/* 101 */
"alter_db_option ::= KEEP variable_list"
,
...
@@ -2816,8 +2816,8 @@ static const struct {
...
@@ -2816,8 +2816,8 @@ static const struct {
{
271
,
0
},
/* (71) exists_opt ::= */
{
271
,
0
},
/* (71) exists_opt ::= */
{
270
,
0
},
/* (72) db_options ::= */
{
270
,
0
},
/* (72) db_options ::= */
{
270
,
-
3
},
/* (73) db_options ::= db_options BUFFER NK_INTEGER */
{
270
,
-
3
},
/* (73) db_options ::= db_options BUFFER NK_INTEGER */
{
270
,
-
3
},
/* (74) db_options ::= db_options CACHE
LAST NK_INTEGER
*/
{
270
,
-
3
},
/* (74) db_options ::= db_options CACHE
MODEL NK_STRING
*/
{
270
,
-
3
},
/* (75) db_options ::= db_options CACHE
LAST
SIZE NK_INTEGER */
{
270
,
-
3
},
/* (75) db_options ::= db_options CACHESIZE NK_INTEGER */
{
270
,
-
3
},
/* (76) db_options ::= db_options COMP NK_INTEGER */
{
270
,
-
3
},
/* (76) db_options ::= db_options COMP NK_INTEGER */
{
270
,
-
3
},
/* (77) db_options ::= db_options DURATION NK_INTEGER */
{
270
,
-
3
},
/* (77) db_options ::= db_options DURATION NK_INTEGER */
{
270
,
-
3
},
/* (78) db_options ::= db_options DURATION NK_VARIABLE */
{
270
,
-
3
},
/* (78) db_options ::= db_options DURATION NK_VARIABLE */
...
@@ -2830,7 +2830,7 @@ static const struct {
...
@@ -2830,7 +2830,7 @@ static const struct {
{
270
,
-
3
},
/* (85) db_options ::= db_options PAGESIZE NK_INTEGER */
{
270
,
-
3
},
/* (85) db_options ::= db_options PAGESIZE NK_INTEGER */
{
270
,
-
3
},
/* (86) db_options ::= db_options PRECISION NK_STRING */
{
270
,
-
3
},
/* (86) db_options ::= db_options PRECISION NK_STRING */
{
270
,
-
3
},
/* (87) db_options ::= db_options REPLICA NK_INTEGER */
{
270
,
-
3
},
/* (87) db_options ::= db_options REPLICA NK_INTEGER */
{
270
,
-
3
},
/* (88) db_options ::= db_options STRICT NK_
INTEGER
*/
{
270
,
-
3
},
/* (88) db_options ::= db_options STRICT NK_
STRING
*/
{
270
,
-
3
},
/* (89) db_options ::= db_options WAL NK_INTEGER */
{
270
,
-
3
},
/* (89) db_options ::= db_options WAL NK_INTEGER */
{
270
,
-
3
},
/* (90) db_options ::= db_options VGROUPS NK_INTEGER */
{
270
,
-
3
},
/* (90) db_options ::= db_options VGROUPS NK_INTEGER */
{
270
,
-
3
},
/* (91) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
{
270
,
-
3
},
/* (91) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
...
@@ -2839,8 +2839,8 @@ static const struct {
...
@@ -2839,8 +2839,8 @@ static const struct {
{
272
,
-
1
},
/* (94) alter_db_options ::= alter_db_option */
{
272
,
-
1
},
/* (94) alter_db_options ::= alter_db_option */
{
272
,
-
2
},
/* (95) alter_db_options ::= alter_db_options alter_db_option */
{
272
,
-
2
},
/* (95) alter_db_options ::= alter_db_options alter_db_option */
{
276
,
-
2
},
/* (96) alter_db_option ::= BUFFER NK_INTEGER */
{
276
,
-
2
},
/* (96) alter_db_option ::= BUFFER NK_INTEGER */
{
276
,
-
2
},
/* (97) alter_db_option ::= CACHE
LAST NK_INTEGER
*/
{
276
,
-
2
},
/* (97) alter_db_option ::= CACHE
MODEL NK_STRING
*/
{
276
,
-
2
},
/* (98) alter_db_option ::= CACHE
LAST
SIZE NK_INTEGER */
{
276
,
-
2
},
/* (98) alter_db_option ::= CACHESIZE NK_INTEGER */
{
276
,
-
2
},
/* (99) alter_db_option ::= FSYNC NK_INTEGER */
{
276
,
-
2
},
/* (99) alter_db_option ::= FSYNC NK_INTEGER */
{
276
,
-
2
},
/* (100) alter_db_option ::= KEEP integer_list */
{
276
,
-
2
},
/* (100) alter_db_option ::= KEEP integer_list */
{
276
,
-
2
},
/* (101) alter_db_option ::= KEEP variable_list */
{
276
,
-
2
},
/* (101) alter_db_option ::= KEEP variable_list */
...
@@ -3543,12 +3543,12 @@ static YYACTIONTYPE yy_reduce(
...
@@ -3543,12 +3543,12 @@ static YYACTIONTYPE yy_reduce(
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_BUFFER
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_BUFFER
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
break
;
break
;
case
74
:
/* db_options ::= db_options CACHE
LAST NK_INTEGER
*/
case
74
:
/* db_options ::= db_options CACHE
MODEL NK_STRING
*/
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_CACHE
LAST
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_CACHE
MODEL
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
break
;
break
;
case
75
:
/* db_options ::= db_options CACHE
LAST
SIZE NK_INTEGER */
case
75
:
/* db_options ::= db_options CACHESIZE NK_INTEGER */
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_CACHE
LAST
SIZE
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_CACHESIZE
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
break
;
break
;
case
76
:
/* db_options ::= db_options COMP NK_INTEGER */
case
76
:
/* db_options ::= db_options COMP NK_INTEGER */
...
@@ -3593,7 +3593,7 @@ static YYACTIONTYPE yy_reduce(
...
@@ -3593,7 +3593,7 @@ static YYACTIONTYPE yy_reduce(
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_REPLICA
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_REPLICA
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
break
;
break
;
case
88
:
/* db_options ::= db_options STRICT NK_
INTEGER
*/
case
88
:
/* db_options ::= db_options STRICT NK_
STRING
*/
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_STRICT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
{
yylhsminor
.
yy616
=
setDatabaseOption
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy616
,
DB_OPTION_STRICT
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
yymsp
[
-
2
].
minor
.
yy616
=
yylhsminor
.
yy616
;
break
;
break
;
...
@@ -3628,11 +3628,11 @@ static YYACTIONTYPE yy_reduce(
...
@@ -3628,11 +3628,11 @@ static YYACTIONTYPE yy_reduce(
case
96
:
/* alter_db_option ::= BUFFER NK_INTEGER */
case
96
:
/* alter_db_option ::= BUFFER NK_INTEGER */
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_BUFFER
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_BUFFER
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
break
;
case
97
:
/* alter_db_option ::= CACHE
LAST NK_INTEGER
*/
case
97
:
/* alter_db_option ::= CACHE
MODEL NK_STRING
*/
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_CACHE
LAST
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_CACHE
MODEL
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
break
;
case
98
:
/* alter_db_option ::= CACHE
LAST
SIZE NK_INTEGER */
case
98
:
/* alter_db_option ::= CACHESIZE NK_INTEGER */
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_CACHE
LAST
SIZE
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_CACHESIZE
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
break
;
case
99
:
/* alter_db_option ::= FSYNC NK_INTEGER */
case
99
:
/* alter_db_option ::= FSYNC NK_INTEGER */
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_FSYNC
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
{
yymsp
[
-
1
].
minor
.
yy409
.
type
=
DB_OPTION_FSYNC
;
yymsp
[
-
1
].
minor
.
yy409
.
val
=
yymsp
[
0
].
minor
.
yy0
;
}
...
...
source/libs/parser/test/parInitialATest.cpp
浏览文件 @
20a49e30
...
@@ -38,7 +38,7 @@ TEST_F(ParserInitialATest, alterDnode) {
...
@@ -38,7 +38,7 @@ TEST_F(ParserInitialATest, alterDnode) {
TEST_F
(
ParserInitialATest
,
alterDatabase
)
{
TEST_F
(
ParserInitialATest
,
alterDatabase
)
{
useDb
(
"root"
,
"test"
);
useDb
(
"root"
,
"test"
);
run
(
"ALTER DATABASE test CACHE
LAST 1
FSYNC 200 WAL 1"
);
run
(
"ALTER DATABASE test CACHE
MODEL 'last_row'
FSYNC 200 WAL 1"
);
run
(
"ALTER DATABASE test KEEP 2400"
);
run
(
"ALTER DATABASE test KEEP 2400"
);
}
}
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
20a49e30
...
@@ -43,7 +43,8 @@ TEST_F(ParserInitialCTest, createBnode) {
...
@@ -43,7 +43,8 @@ TEST_F(ParserInitialCTest, createBnode) {
*
*
* database_option: {
* database_option: {
* BUFFER value
* BUFFER value
* | CACHELAST value
* | CACHEMODEL {'none' | 'last_row' | 'last_value' | 'both'}
* | CACHESIZE value
* | COMP {0 | 1 | 2}
* | COMP {0 | 1 | 2}
* | DURATION value
* | DURATION value
* | FSYNC value
* | FSYNC value
...
@@ -55,7 +56,7 @@ TEST_F(ParserInitialCTest, createBnode) {
...
@@ -55,7 +56,7 @@ TEST_F(ParserInitialCTest, createBnode) {
* | PRECISION {'ms' | 'us' | 'ns'}
* | PRECISION {'ms' | 'us' | 'ns'}
* | REPLICA value
* | REPLICA value
* | RETENTIONS ingestion_duration:keep_duration ...
* | RETENTIONS ingestion_duration:keep_duration ...
* | STRICT
value
* | STRICT
{'off' | 'on'}
* | WAL value
* | WAL value
* | VGROUPS value
* | VGROUPS value
* | SINGLE_STABLE {0 | 1}
* | SINGLE_STABLE {0 | 1}
...
@@ -76,8 +77,8 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -76,8 +77,8 @@ TEST_F(ParserInitialCTest, createDatabase) {
expect
.
db
[
len
]
=
'\0'
;
expect
.
db
[
len
]
=
'\0'
;
expect
.
ignoreExist
=
igExists
;
expect
.
ignoreExist
=
igExists
;
expect
.
buffer
=
TSDB_DEFAULT_BUFFER_PER_VNODE
;
expect
.
buffer
=
TSDB_DEFAULT_BUFFER_PER_VNODE
;
expect
.
cacheLast
=
TSDB_DEFAULT_CACHE_
LAST
;
expect
.
cacheLast
=
TSDB_DEFAULT_CACHE_
MODEL
;
expect
.
cacheLastSize
=
TSDB_DEFAULT_CACHE_
LAST_
SIZE
;
expect
.
cacheLastSize
=
TSDB_DEFAULT_CACHE_SIZE
;
expect
.
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
expect
.
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
expect
.
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
expect
.
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
expect
.
fsyncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
expect
.
fsyncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
...
@@ -203,8 +204,8 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -203,8 +204,8 @@ TEST_F(ParserInitialCTest, createDatabase) {
setDbSchemalessFunc
(
1
);
setDbSchemalessFunc
(
1
);
run
(
"CREATE DATABASE IF NOT EXISTS wxy_db "
run
(
"CREATE DATABASE IF NOT EXISTS wxy_db "
"BUFFER 64 "
"BUFFER 64 "
"CACHE
LAST 2
"
"CACHE
MODEL 'last_value'
"
"CACHE
LAST
SIZE 20 "
"CACHESIZE 20 "
"COMP 1 "
"COMP 1 "
"DURATION 100 "
"DURATION 100 "
"FSYNC 100 "
"FSYNC 100 "
...
@@ -216,7 +217,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -216,7 +217,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
"PRECISION 'ns' "
"PRECISION 'ns' "
"REPLICA 3 "
"REPLICA 3 "
"RETENTIONS 15s:7d,1m:21d,15m:500d "
"RETENTIONS 15s:7d,1m:21d,15m:500d "
"STRICT
1
"
"STRICT
'on'
"
"WAL 2 "
"WAL 2 "
"VGROUPS 100 "
"VGROUPS 100 "
"SINGLE_STABLE 1 "
"SINGLE_STABLE 1 "
...
...
tests/pytest/alter/alter_cacheLastRow.py
浏览文件 @
20a49e30
...
@@ -67,7 +67,7 @@ class TDTestCase:
...
@@ -67,7 +67,7 @@ class TDTestCase:
slow
=
0
#count time where lastRow on is slower
slow
=
0
#count time where lastRow on is slower
for
i
in
range
(
5
):
for
i
in
range
(
5
):
#switch lastRow to off and check
#switch lastRow to off and check
tdSql
.
execute
(
'alter database db cache
last 0
'
)
tdSql
.
execute
(
'alter database db cache
model '
none
'
'
)
tdSql
.
query
(
'show databases'
)
tdSql
.
query
(
'show databases'
)
tdSql
.
checkData
(
0
,
15
,
0
)
tdSql
.
checkData
(
0
,
15
,
0
)
...
@@ -79,7 +79,7 @@ class TDTestCase:
...
@@ -79,7 +79,7 @@ class TDTestCase:
tdLog
.
debug
(
f
'time used:
{
lastRow_Off_end
-
lastRow_Off_start
}
'
)
tdLog
.
debug
(
f
'time used:
{
lastRow_Off_end
-
lastRow_Off_start
}
'
)
#switch lastRow to on and check
#switch lastRow to on and check
tdSql
.
execute
(
'alter database db cache
last 1
'
)
tdSql
.
execute
(
'alter database db cache
model '
last_row
'
'
)
tdSql
.
query
(
'show databases'
)
tdSql
.
query
(
'show databases'
)
tdSql
.
checkData
(
0
,
15
,
1
)
tdSql
.
checkData
(
0
,
15
,
1
)
...
...
tests/pytest/query/last_cache.py
浏览文件 @
20a49e30
...
@@ -89,36 +89,36 @@ class TDTestCase:
...
@@ -89,36 +89,36 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
prepare
()
# last_cache_0.sim
# last_cache_0.sim
tdSql
.
execute
(
"create database test1 cache
last 0
"
)
tdSql
.
execute
(
"create database test1 cache
model 'none'
"
)
tdSql
.
execute
(
"use test1"
)
tdSql
.
execute
(
"use test1"
)
self
.
insertData
()
self
.
insertData
()
self
.
executeQueries
()
self
.
executeQueries
()
tdSql
.
execute
(
"alter database test1 cache
last 1
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'last_row'
"
)
self
.
executeQueries
()
self
.
executeQueries
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries
()
self
.
executeQueries
()
tdSql
.
execute
(
"alter database test1 cache
last 0
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'none'
"
)
self
.
executeQueries
()
self
.
executeQueries
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries
()
self
.
executeQueries
()
# last_cache_1.sim
# last_cache_1.sim
tdSql
.
execute
(
"create database test2 cache
last 1
"
)
tdSql
.
execute
(
"create database test2 cache
model 'last_row'
"
)
tdSql
.
execute
(
"use test2"
)
tdSql
.
execute
(
"use test2"
)
self
.
insertData
()
self
.
insertData
()
self
.
executeQueries
()
self
.
executeQueries
()
tdSql
.
execute
(
"alter database test2 cache
last 0
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'none'
"
)
self
.
executeQueries
()
self
.
executeQueries
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries
()
self
.
executeQueries
()
tdSql
.
execute
(
"alter database test2 cache
last 1
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'last_row'
"
)
self
.
executeQueries
()
self
.
executeQueries
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
...
...
tests/pytest/query/last_row_cache.py
浏览文件 @
20a49e30
...
@@ -142,56 +142,56 @@ class TDTestCase:
...
@@ -142,56 +142,56 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
prepare
()
print
(
"============== Step1: last_row_cache_0.sim"
)
print
(
"============== Step1: last_row_cache_0.sim"
)
tdSql
.
execute
(
"create database test1 cache
last 0
"
)
tdSql
.
execute
(
"create database test1 cache
model 'none'
"
)
tdSql
.
execute
(
"use test1"
)
tdSql
.
execute
(
"use test1"
)
self
.
insertData
()
self
.
insertData
()
self
.
executeQueries
()
self
.
executeQueries
()
self
.
insertData2
()
self
.
insertData2
()
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step2: alter database test1 cache
last 1
"
)
print
(
"============== Step2: alter database test1 cache
model 'last_row'
"
)
tdSql
.
execute
(
"alter database test1 cache
last 1
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'last_row'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step3: alter database test1 cache
last 2
"
)
print
(
"============== Step3: alter database test1 cache
model 'last_value'
"
)
tdSql
.
execute
(
"alter database test1 cache
last 2
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'last_value'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step4: alter database test1 cache
last 3
"
)
print
(
"============== Step4: alter database test1 cache
model 'both'
"
)
tdSql
.
execute
(
"alter database test1 cache
last 3
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'both'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step5: alter database test1 cache
last 0
and restart taosd"
)
print
(
"============== Step5: alter database test1 cache
model 'none'
and restart taosd"
)
tdSql
.
execute
(
"alter database test1 cache
last 0
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'none'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step6: alter database test1 cache
last 1
and restart taosd"
)
print
(
"============== Step6: alter database test1 cache
model 'last_row'
and restart taosd"
)
tdSql
.
execute
(
"alter database test1 cache
last 1
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'last_row'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step7: alter database test1 cache
last 2
and restart taosd"
)
print
(
"============== Step7: alter database test1 cache
model 'last_value'
and restart taosd"
)
tdSql
.
execute
(
"alter database test1 cache
last 2
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'last_value'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step8: alter database test1 cache
last 3
and restart taosd"
)
print
(
"============== Step8: alter database test1 cache
model 'both'
and restart taosd"
)
tdSql
.
execute
(
"alter database test1 cache
last 3
"
)
tdSql
.
execute
(
"alter database test1 cache
model 'both'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step9: create database test2 cache
last 1
"
)
print
(
"============== Step9: create database test2 cache
model 'last_row'
"
)
tdSql
.
execute
(
"create database test2 cache
last 1
"
)
tdSql
.
execute
(
"create database test2 cache
model 'last_row'
"
)
tdSql
.
execute
(
"use test2"
)
tdSql
.
execute
(
"use test2"
)
self
.
insertData
()
self
.
insertData
()
self
.
executeQueries
()
self
.
executeQueries
()
...
@@ -201,45 +201,45 @@ class TDTestCase:
...
@@ -201,45 +201,45 @@ class TDTestCase:
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step8: alter database test2 cache
last 0
"
)
print
(
"============== Step8: alter database test2 cache
model 'none'
"
)
tdSql
.
execute
(
"alter database test2 cache
last 0
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'none'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step9: alter database test2 cache
last 1
"
)
print
(
"============== Step9: alter database test2 cache
model 'last_row'
"
)
tdSql
.
execute
(
"alter database test2 cache
last 1
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'last_row'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step10: alter database test2 cache
last 2
"
)
print
(
"============== Step10: alter database test2 cache
model 'last_value'
"
)
tdSql
.
execute
(
"alter database test2 cache
last 2
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'last_value'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step11: alter database test2 cache
last 3
"
)
print
(
"============== Step11: alter database test2 cache
model 'both'
"
)
tdSql
.
execute
(
"alter database test2 cache
last 3
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'both'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step12: alter database test2 cache
last 0
and restart taosd"
)
print
(
"============== Step12: alter database test2 cache
model 'none'
and restart taosd"
)
tdSql
.
execute
(
"alter database test2 cache
last 0
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'none'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step13: alter database test2 cache
last 1
and restart taosd"
)
print
(
"============== Step13: alter database test2 cache
model 'last_row'
and restart taosd"
)
tdSql
.
execute
(
"alter database test2 cache
last 1
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'last_row'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step14: alter database test2 cache
last 2
and restart taosd"
)
print
(
"============== Step14: alter database test2 cache
model 'last_value'
and restart taosd"
)
tdSql
.
execute
(
"alter database test2 cache
last 2
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'last_value'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
self
.
executeQueries2
()
self
.
executeQueries2
()
print
(
"============== Step15: alter database test2 cache
last 3
and restart taosd"
)
print
(
"============== Step15: alter database test2 cache
model 'both'
and restart taosd"
)
tdSql
.
execute
(
"alter database test2 cache
last 3
"
)
tdSql
.
execute
(
"alter database test2 cache
model 'both'
"
)
self
.
executeQueries2
()
self
.
executeQueries2
()
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
...
...
tests/pytest/util/boundary.py
浏览文件 @
20a49e30
...
@@ -39,6 +39,6 @@ class DataBoundary:
...
@@ -39,6 +39,6 @@ class DataBoundary:
self
.
DB_PARAM_PRECISION_CONFIG
=
{
"create_name"
:
"precision"
,
"query_name"
:
"precision"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
'ms'
,
'us'
,
'ns'
],
"default"
:
"ms"
}
self
.
DB_PARAM_PRECISION_CONFIG
=
{
"create_name"
:
"precision"
,
"query_name"
:
"precision"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
'ms'
,
'us'
,
'ns'
],
"default"
:
"ms"
}
self
.
DB_PARAM_REPLICA_CONFIG
=
{
"create_name"
:
"replica"
,
"query_name"
:
"replica"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
],
"default"
:
1
}
self
.
DB_PARAM_REPLICA_CONFIG
=
{
"create_name"
:
"replica"
,
"query_name"
:
"replica"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
],
"default"
:
1
}
self
.
DB_PARAM_SINGLE_STABLE_CONFIG
=
{
"create_name"
:
"single_stable"
,
"query_name"
:
"single_stable_model"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
0
,
1
],
"default"
:
0
}
self
.
DB_PARAM_SINGLE_STABLE_CONFIG
=
{
"create_name"
:
"single_stable"
,
"query_name"
:
"single_stable_model"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
0
,
1
],
"default"
:
0
}
self
.
DB_PARAM_STRICT_CONFIG
=
{
"create_name"
:
"strict"
,
"query_name"
:
"strict"
,
"vnode_json_key"
:
""
,
"boundary"
:
{
"
no_strict"
:
0
,
"strict"
:
1
},
"default"
:
"no_strict
"
}
self
.
DB_PARAM_STRICT_CONFIG
=
{
"create_name"
:
"strict"
,
"query_name"
:
"strict"
,
"vnode_json_key"
:
""
,
"boundary"
:
{
"
off"
:
0
,
"strict"
:
1
},
"default"
:
"off
"
}
self
.
DB_PARAM_VGROUPS_CONFIG
=
{
"create_name"
:
"vgroups"
,
"query_name"
:
"vgroups"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
,
32
],
"default"
:
2
}
self
.
DB_PARAM_VGROUPS_CONFIG
=
{
"create_name"
:
"vgroups"
,
"query_name"
:
"vgroups"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
,
32
],
"default"
:
2
}
self
.
DB_PARAM_WAL_CONFIG
=
{
"create_name"
:
"wal"
,
"query_name"
:
"wal"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
,
2
],
"default"
:
1
}
self
.
DB_PARAM_WAL_CONFIG
=
{
"create_name"
:
"wal"
,
"query_name"
:
"wal"
,
"vnode_json_key"
:
""
,
"boundary"
:
[
1
,
2
],
"default"
:
1
}
\ No newline at end of file
tests/pytest/util/constant.py
浏览文件 @
20a49e30
...
@@ -54,7 +54,7 @@ TAOS_KEYWORDS = [
...
@@ -54,7 +54,7 @@ TAOS_KEYWORDS = [
"BOOL"
,
"EQ"
,
"LINEAR"
,
"RESET"
,
"TSERIES"
,
"BOOL"
,
"EQ"
,
"LINEAR"
,
"RESET"
,
"TSERIES"
,
"BY"
,
"EXISTS"
,
"LOCAL"
,
"RESTRICT"
,
"UMINUS"
,
"BY"
,
"EXISTS"
,
"LOCAL"
,
"RESTRICT"
,
"UMINUS"
,
"CACHE"
,
"EXPLAIN"
,
"LP"
,
"ROW"
,
"UNION"
,
"CACHE"
,
"EXPLAIN"
,
"LP"
,
"ROW"
,
"UNION"
,
"CACHE
LAST
"
,
"FAIL"
,
"LSHIFT"
,
"RP"
,
"UNSIGNED"
,
"CACHE
MODEL
"
,
"FAIL"
,
"LSHIFT"
,
"RP"
,
"UNSIGNED"
,
"CASCADE"
,
"FILE"
,
"LT"
,
"RSHIFT"
,
"UPDATE"
,
"CASCADE"
,
"FILE"
,
"LT"
,
"RSHIFT"
,
"UPDATE"
,
"CHANGE"
,
"FILL"
,
"MATCH"
,
"SCORES"
,
"UPLUS"
,
"CHANGE"
,
"FILL"
,
"MATCH"
,
"SCORES"
,
"UPLUS"
,
"CLUSTER"
,
"FLOAT"
,
"MAXROWS"
,
"SELECT"
,
"USE"
,
"CLUSTER"
,
"FLOAT"
,
"MAXROWS"
,
"SELECT"
,
"USE"
,
...
...
tests/script/tsim/db/alter_option.sim
浏览文件 @
20a49e30
...
@@ -40,13 +40,13 @@ print ============= create database
...
@@ -40,13 +40,13 @@ print ============= create database
#database_option: {
#database_option: {
# | BUFFER value [3~16384, default: 96]
# | BUFFER value [3~16384, default: 96]
# | PAGES value [64~16384, default: 256]
# | PAGES value [64~16384, default: 256]
# | CACHE
LAST value [0, 1, 2, 3
]
# | CACHE
MODEL value ['node', 'last_row', 'last_value', 'both'
]
# | FSYNC value [0 ~ 180000 ms]
# | FSYNC value [0 ~ 180000 ms]
# | KEEP value [duration, 365000]
# | KEEP value [duration, 365000]
# | REPLICA value [1 | 3]
# | REPLICA value [1 | 3]
# | WAL value [1 | 2]
# | WAL value [1 | 2]
sql create database db CACHE
LAST 3
COMP 0 DURATION 240 FSYNC 1000 MAXROWS 8000 MINROWS 10 KEEP 1000 PRECISION 'ns' REPLICA 3 WAL 2 VGROUPS 6 SINGLE_STABLE 1
sql create database db CACHE
MODEL 'both'
COMP 0 DURATION 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
...
@@ -69,7 +69,7 @@ endi
...
@@ -69,7 +69,7 @@ endi
if $data4_db != 3 then # replica
if $data4_db != 3 then # replica
return -1
return -1
endi
endi
if $data5_db !=
no_strict
then # strict
if $data5_db !=
off
then # strict
return -1
return -1
endi
endi
if $data6_db != 345600m then # duration
if $data6_db != 345600m then # duration
...
@@ -102,7 +102,7 @@ endi
...
@@ -102,7 +102,7 @@ endi
if $data15_db != 0 then # comp
if $data15_db != 0 then # comp
return -1
return -1
endi
endi
if $data16_db !=
3
then # cachelast
if $data16_db !=
both
then # cachelast
return -1
return -1
endi
endi
if $data17_db != ns then # precision
if $data17_db != ns then # precision
...
@@ -333,40 +333,40 @@ sql_error alter database db comp 5
...
@@ -333,40 +333,40 @@ sql_error alter database db comp 5
sql_error alter database db comp -1
sql_error alter database db comp -1
print ============== modify cachelast [0, 1, 2, 3]
print ============== modify cachelast [0, 1, 2, 3]
sql alter database db cache
last 2
sql alter database db cache
model 'last_value'
sql show databases
sql show databases
print cachelast $data16_db
print cachelast $data16_db
if $data16_db !=
2
then
if $data16_db !=
last_value
then
return -1
return -1
endi
endi
sql alter database db cache
last 1
sql alter database db cache
model 'last_row'
sql show databases
sql show databases
print cachelast $data16_db
print cachelast $data16_db
if $data16_db !=
1
then
if $data16_db !=
last_row
then
return -1
return -1
endi
endi
sql alter database db cache
last 0
sql alter database db cache
model 'none'
sql show databases
sql show databases
print cachelast $data16_db
print cachelast $data16_db
if $data16_db !=
0
then
if $data16_db !=
none
then
return -1
return -1
endi
endi
sql alter database db cache
last 2
sql alter database db cache
model 'last_value'
sql show databases
sql show databases
print cachelast $data16_db
print cachelast $data16_db
if $data16_db !=
2
then
if $data16_db !=
last_value
then
return -1
return -1
endi
endi
sql alter database db cache
last 3
sql alter database db cache
model 'both'
sql show databases
sql show databases
print cachelast $data16_db
print cachelast $data16_db
if $data16_db !=
3
then
if $data16_db !=
both
then
return -1
return -1
endi
endi
sql_error alter database db cachelast 4
sql_error alter database db cachelast 4
sql_error alter database db cachelast 10
sql_error alter database db cachelast 10
sql_error alter database db cachelast
-1
sql_error alter database db cachelast
'other'
print ============== modify precision
print ============== modify precision
sql_error alter database db precision 'ms'
sql_error alter database db precision 'ms'
...
...
tests/script/tsim/db/basic6.sim
浏览文件 @
20a49e30
...
@@ -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 duration 2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cache
last 2
precision 'us'
sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cache
model 'last_value'
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
...
...
tests/script/tsim/db/create_all_options.sim
浏览文件 @
20a49e30
...
@@ -40,7 +40,7 @@ print ============= create database with all options
...
@@ -40,7 +40,7 @@ print ============= create database with all options
# | BUFFER value [3~16384, default: 96]
# | BUFFER value [3~16384, default: 96]
# | PAGES value [64~16384, default: 256]
# | PAGES value [64~16384, default: 256]
# | PAGESIZE value [1~16384, default: 4]
# | PAGESIZE value [1~16384, default: 4]
# | CACHE
LAST value [0, 1, 2, 3, default: 0
]
# | CACHE
MODEL value ['node', 'last_row', 'last_value', 'both', default: 'node'
]
# | COMP [0 | 1 | 2, default: 2]
# | COMP [0 | 1 | 2, default: 2]
# | DURATION value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day]
# | DURATION 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]
...
@@ -89,7 +89,7 @@ if $data4_db != 1 then # replica
...
@@ -89,7 +89,7 @@ if $data4_db != 1 then # replica
print expect 1, actual: $data4_db
print expect 1, actual: $data4_db
return -1
return -1
endi
endi
if $data5_db !=
no_strict
then # strict
if $data5_db !=
off
then # strict
return -1
return -1
endi
endi
if $data6_db != 14400m then # duration
if $data6_db != 14400m then # duration
...
@@ -122,7 +122,7 @@ endi
...
@@ -122,7 +122,7 @@ endi
if $data15_db != 2 then # comp
if $data15_db != 2 then # comp
return -1
return -1
endi
endi
if $data16_db !=
0
then # cachelast
if $data16_db !=
none
then # cachelast
return -1
return -1
endi
endi
if $data17_db != ms then # precision
if $data17_db != ms then # precision
...
@@ -167,32 +167,32 @@ sql drop database db
...
@@ -167,32 +167,32 @@ sql drop database db
#endi
#endi
#sql drop database db
#sql drop database db
print ====> CACHE
LAST
value [0, 1, 2, 3, default: 0]
print ====> CACHE
MODEL
value [0, 1, 2, 3, default: 0]
sql create database db CACHE
LAST 1
sql create database db CACHE
MODEL 'last_row'
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 $data16_db !=
1
then
if $data16_db !=
last_row
then
return -1
return -1
endi
endi
sql drop database db
sql drop database db
sql create database db CACHE
LAST 2
sql create database db CACHE
MODEL 'last_value'
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 $data16_db !=
2
then
if $data16_db !=
last_value
then
return -1
return -1
endi
endi
sql drop database db
sql drop database db
sql create database db CACHE
LAST 3
sql create database db CACHE
MODEL 'both'
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 $data16_db !=
3
then
if $data16_db !=
both
then
return -1
return -1
endi
endi
sql drop database db
sql drop database db
sql_error create database db CACHE
LAST 4
sql_error create database db CACHE
MODEL 'other'
sql_error create database db CACHE
LAST -1
sql_error create database db CACHE
MODEL '-1'
print ====> COMP [0 | 1 | 2, default: 2]
print ====> COMP [0 | 1 | 2, default: 2]
sql create database db COMP 1
sql create database db COMP 1
...
...
tests/script/tsim/parser/last_cache.sim
浏览文件 @
20a49e30
...
@@ -7,7 +7,7 @@ print ======================== dnode1 start
...
@@ -7,7 +7,7 @@ print ======================== dnode1 start
$db = testdb
$db = testdb
sql drop database if exists $db
sql drop database if exists $db
sql create database $db cache
last 2
sql create database $db cache
model 'last_value'
sql use $db
sql use $db
sql create stable st2 (ts timestamp, f1 int, f2 double, f3 binary(10), f4 timestamp) tags (id int)
sql create stable st2 (ts timestamp, f1 int, f2 double, f3 binary(10), f4 timestamp) tags (id int)
...
...
tests/script/tsim/parser/like.sim
浏览文件 @
20a49e30
...
@@ -8,7 +8,7 @@ print ======================== dnode1 start
...
@@ -8,7 +8,7 @@ print ======================== dnode1 start
$db = testdb
$db = testdb
sql drop database if exists $db
sql drop database if exists $db
sql create database $db cache
last 2
sql create database $db cache
model 'last_value'
sql use $db
sql use $db
$table1 = table_name
$table1 = table_name
...
...
tests/system-test/0-others/cachelast.py
浏览文件 @
20a49e30
...
@@ -36,22 +36,31 @@ class TDTestCase:
...
@@ -36,22 +36,31 @@ class TDTestCase:
def
illegal_params
(
self
):
def
illegal_params
(
self
):
illegal_params
=
[
"1"
,
"0"
,
"NULL"
,
"
None"
,
"
False"
,
"True"
,
"keep"
,
"now"
,
"*"
,
","
,
"_"
,
"abc"
,
"keep"
]
illegal_params
=
[
"1"
,
"0"
,
"NULL"
,
"False"
,
"True"
,
"keep"
,
"now"
,
"*"
,
","
,
"_"
,
"abc"
,
"keep"
]
for
value
in
illegal_params
:
for
value
in
illegal_params
:
tdSql
.
error
(
"create database testdb replica 1 cache
last
'%s' "
%
value
)
tdSql
.
error
(
"create database testdb replica 1 cache
model
'%s' "
%
value
)
unexpected_numbers
=
[
-
1
,
0.0
,
3.0
,
4
,
10
,
100
]
unexpected_numbers
=
[
-
1
,
0.0
,
3.0
,
4
,
10
,
100
]
for
number
in
unexpected_numbers
:
for
number
in
unexpected_numbers
:
tdSql
.
error
(
"create database testdb replica 1 cache
last
%s "
%
number
)
tdSql
.
error
(
"create database testdb replica 1 cache
model
%s "
%
number
)
def
getCacheModelStr
(
self
,
value
):
numbers
=
{
0
:
"none"
,
1
:
"last_row"
,
2
:
"last_value"
,
3
:
"both"
}
return
numbers
.
get
(
value
,
'other'
)
def
prepare_datas
(
self
):
def
prepare_datas
(
self
):
for
i
in
range
(
4
):
for
i
in
range
(
4
):
tdSql
.
execute
(
"create database test_db_%d replica 1 cachelast %d "
%
(
i
,
i
))
str
=
self
.
getCacheModelStr
(
i
)
tdSql
.
execute
(
"use test_db_%d"
%
i
)
tdSql
.
execute
(
"create database testdb_%s replica 1 cachemodel '%s' "
%
(
str
,
str
))
tdSql
.
execute
(
"use testdb_%s"
%
str
)
tdSql
.
execute
(
"create stable st(ts timestamp , c1 int ,c2 float ) tags(ind int) "
)
tdSql
.
execute
(
"create stable st(ts timestamp , c1 int ,c2 float ) tags(ind int) "
)
tdSql
.
execute
(
"create table tb1 using st tags(1) "
)
tdSql
.
execute
(
"create table tb1 using st tags(1) "
)
tdSql
.
execute
(
"create table tb2 using st tags(2) "
)
tdSql
.
execute
(
"create table tb2 using st tags(2) "
)
...
@@ -81,10 +90,10 @@ class TDTestCase:
...
@@ -81,10 +90,10 @@ class TDTestCase:
# cache_last_set value
# cache_last_set value
for
k
,
v
in
cache_lasts
.
items
():
for
k
,
v
in
cache_lasts
.
items
():
if
k
.
split
(
"_"
)[
-
1
]
==
str
(
v
):
if
k
==
"testdb_"
+
str
(
v
):
tdLog
.
info
(
" database %s cache_last value check pass, value is %
d
"
%
(
k
,
v
)
)
tdLog
.
info
(
" database %s cache_last value check pass, value is %
s
"
%
(
k
,
v
)
)
else
:
else
:
tdLog
.
exit
(
" database %s cache_last value check fail, value is %
d
"
%
(
k
,
v
)
)
tdLog
.
exit
(
" database %s cache_last value check fail, value is %
s
"
%
(
k
,
v
)
)
# # check storage layer implementation
# # check storage layer implementation
...
@@ -132,13 +141,10 @@ class TDTestCase:
...
@@ -132,13 +141,10 @@ class TDTestCase:
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
self
.
illegal_params
()
self
.
illegal_params
()
self
.
prepare_datas
()
self
.
prepare_datas
()
self
.
check_cache_last_sets
()
self
.
check_cache_last_sets
()
self
.
restart_check_cache_last_sets
()
self
.
restart_check_cache_last_sets
()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
tests/system-test/2-query/last_row.py
浏览文件 @
20a49e30
...
@@ -25,7 +25,7 @@ class TDTestCase:
...
@@ -25,7 +25,7 @@ class TDTestCase:
def
insert_datas_and_check_abs
(
self
,
tbnums
,
rownums
,
time_step
):
def
insert_datas_and_check_abs
(
self
,
tbnums
,
rownums
,
time_step
):
tdLog
.
info
(
" prepare datas for auto check abs function "
)
tdLog
.
info
(
" prepare datas for auto check abs function "
)
tdSql
.
execute
(
" create database test cache
last 1
"
)
tdSql
.
execute
(
" create database test cache
model 'last_row'
"
)
tdSql
.
execute
(
" use test "
)
tdSql
.
execute
(
" use test "
)
tdSql
.
execute
(
" create stable stb (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint,
\
tdSql
.
execute
(
" create stable stb (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint,
\
c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) tags (t1 int)"
)
c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) tags (t1 int)"
)
...
@@ -63,7 +63,7 @@ class TDTestCase:
...
@@ -63,7 +63,7 @@ class TDTestCase:
def
prepare_datas
(
self
):
def
prepare_datas
(
self
):
tdSql
.
execute
(
"create database if not exists db keep 3650 duration 1000 cache
last 1
"
)
tdSql
.
execute
(
"create database if not exists db keep 3650 duration 1000 cache
model 'last_row'
"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
"use db"
)
tdSql
.
execute
(
tdSql
.
execute
(
'''create table stb1
'''create table stb1
...
@@ -124,7 +124,7 @@ class TDTestCase:
...
@@ -124,7 +124,7 @@ class TDTestCase:
def
prepare_tag_datas
(
self
):
def
prepare_tag_datas
(
self
):
# prepare datas
# prepare datas
tdSql
.
execute
(
tdSql
.
execute
(
"create database if not exists testdb keep 3650 duration 1000 cache
last 1
"
)
"create database if not exists testdb keep 3650 duration 1000 cache
model 'last_row'
"
)
tdSql
.
execute
(
" use testdb "
)
tdSql
.
execute
(
" use testdb "
)
tdSql
.
execute
(
f
" create stable stb1 (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp , uc1 int unsigned,
\
tdSql
.
execute
(
f
" create stable stb1 (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp , uc1 int unsigned,
\
...
@@ -528,7 +528,7 @@ class TDTestCase:
...
@@ -528,7 +528,7 @@ class TDTestCase:
def
check_boundary_values
(
self
):
def
check_boundary_values
(
self
):
tdSql
.
execute
(
"drop database if exists bound_test"
)
tdSql
.
execute
(
"drop database if exists bound_test"
)
tdSql
.
execute
(
"create database if not exists bound_test cache
last 2
"
)
tdSql
.
execute
(
"create database if not exists bound_test cache
model 'last_value'
"
)
time
.
sleep
(
3
)
time
.
sleep
(
3
)
tdSql
.
execute
(
"use bound_test"
)
tdSql
.
execute
(
"use bound_test"
)
tdSql
.
execute
(
tdSql
.
execute
(
...
...
tests/system-test/6-cluster/5dnode1mnode.py
浏览文件 @
20a49e30
...
@@ -122,9 +122,9 @@ class TDTestCase:
...
@@ -122,9 +122,9 @@ class TDTestCase:
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
tdSql
.
query
(
'show databases;'
)
tdSql
.
query
(
'show databases;'
)
tdSql
.
checkData
(
2
,
5
,
'
no_strict
'
)
tdSql
.
checkData
(
2
,
5
,
'
off
'
)
tdSql
.
error
(
'alter database db strict 0'
)
tdSql
.
error
(
"alter database db strict 'off'"
)
# tdSql.execute('alter database db strict
1
')
# tdSql.execute('alter database db strict
'on'
')
# tdSql.query('show databases;')
# tdSql.query('show databases;')
# tdSql.checkData(2,5,'strict')
# tdSql.checkData(2,5,'strict')
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录