Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
86bbd50e
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
86bbd50e
编写于
6月 16, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
差异文件
[TD-3086]<feature> merge develop
上级
85f75ffa
cd7b241e
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
1966 addition
and
1694 deletion
+1966
-1694
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+10
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+18
-3
src/client/src/tscServer.c
src/client/src/tscServer.c
+85
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+7
-0
src/common/inc/tcmdtype.h
src/common/inc/tcmdtype.h
+2
-0
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+2
-1
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-0
src/dnode/src/dnodeVMgmt.c
src/dnode/src/dnodeVMgmt.c
+9
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+11
-2
src/inc/ttokendef.h
src/inc/ttokendef.h
+111
-110
src/inc/vnode.h
src/inc/vnode.h
+1
-0
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+1
-0
src/mnode/inc/mnodeVgroup.h
src/mnode/inc/mnodeVgroup.h
+1
-0
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+55
-1
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+43
-2
src/query/inc/qSqlparser.h
src/query/inc/qSqlparser.h
+2
-0
src/query/inc/sql.y
src/query/inc/sql.y
+4
-0
src/query/src/qSqlParser.c
src/query/src/qSqlParser.c
+4
-0
src/query/src/sql.c
src/query/src/sql.c
+1277
-1269
src/tsdb/src/tsdbCompact.c
src/tsdb/src/tsdbCompact.c
+298
-297
src/util/src/ttokenizer.c
src/util/src/ttokenizer.c
+1
-0
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+14
-0
src/vnode/src/vnodeMgmt.c
src/vnode/src/vnodeMgmt.c
+1
-0
tests/pytest/query/filter.py
tests/pytest/query/filter.py
+2
-2
tests/pytest/query/querySecondtscolumnTowherenow.py
tests/pytest/query/querySecondtscolumnTowherenow.py
+2
-2
tests/script/general/parser/timestamp_query.sim
tests/script/general/parser/timestamp_query.sim
+3
-1
未找到文件。
src/client/src/tscPrepare.c
浏览文件 @
86bbd50e
...
...
@@ -951,7 +951,10 @@ static int insertStmtBindParamBatch(STscStmt* stmt, TAOS_MULTI_BIND* bind, int c
}
}
assert
(
colIdx
==
-
1
||
(
colIdx
>=
0
&&
colIdx
<
pBlock
->
numOfParams
));
if
(
!
(
colIdx
==
-
1
||
(
colIdx
>=
0
&&
colIdx
<
pBlock
->
numOfParams
)))
{
tscError
(
"0x%"
PRIx64
" invalid colIdx:%d"
,
pStmt
->
pSql
->
self
,
colIdx
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
&
stmt
->
pSql
->
cmd
),
"invalid param colIdx"
);
}
uint32_t
totalDataSize
=
sizeof
(
SSubmitBlk
)
+
(
pCmd
->
batchSize
+
rowNum
)
*
pBlock
->
rowSize
;
if
(
totalDataSize
>
pBlock
->
nAllocSize
)
{
...
...
@@ -1462,6 +1465,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
STMT_RET
(
TSDB_CODE_TSC_DISCONNECTED
);
}
if
(
sql
==
NULL
)
{
tscError
(
"sql is NULL"
);
STMT_RET
(
invalidOperationMsg
(
tscGetErrorMsgPayload
(
&
pStmt
->
pSql
->
cmd
),
"sql is NULL"
));
}
if
(
pStmt
->
last
!=
STMT_INIT
)
{
tscError
(
"prepare status error, last:%d"
,
pStmt
->
last
);
STMT_RET
(
invalidOperationMsg
(
tscGetErrorMsgPayload
(
&
pStmt
->
pSql
->
cmd
),
"prepare status error"
));
...
...
@@ -1736,7 +1744,7 @@ int taos_stmt_bind_single_param_batch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, in
STMT_RET
(
TSDB_CODE_TSC_DISCONNECTED
);
}
if
(
bind
==
NULL
||
bind
->
num
<=
0
||
bind
->
num
>
INT16_MAX
)
{
if
(
bind
==
NULL
||
bind
->
num
<=
0
||
bind
->
num
>
INT16_MAX
||
colIdx
<
0
)
{
tscError
(
"0x%"
PRIx64
" invalid parameter"
,
pStmt
->
pSql
->
self
);
STMT_RET
(
invalidOperationMsg
(
tscGetErrorMsgPayload
(
&
pStmt
->
pSql
->
cmd
),
"invalid bind param"
));
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
86bbd50e
...
...
@@ -111,6 +111,7 @@ static int32_t validateDNodeConfig(SMiscInfo* pOptions);
static
int32_t
validateLocalConfig
(
SMiscInfo
*
pOptions
);
static
int32_t
validateColumnName
(
char
*
name
);
static
int32_t
setKillInfo
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
,
int32_t
killType
);
static
int32_t
setCompactVnodeInfo
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
);
static
bool
validateOneTags
(
SSqlCmd
*
pCmd
,
TAOS_FIELD
*
pTagField
);
static
bool
hasTimestampForPointInterpQuery
(
SQueryInfo
*
pQueryInfo
);
...
...
@@ -506,7 +507,7 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
break
;
}
case
TSDB_SQL_CREATE_DNODE
:
{
const
char
*
msg
=
"invalid host name (ip address)"
;
...
...
@@ -802,7 +803,13 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
break
;
}
case
TSDB_SQL_COMPACT_VNODE
:{
const
char
*
msg
=
"invalid compact"
;
if
(
setCompactVnodeInfo
(
pSql
,
pInfo
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
break
;
}
default:
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
"not support sql expression"
);
}
...
...
@@ -2963,7 +2970,12 @@ int32_t setKillInfo(SSqlObj* pSql, struct SSqlInfo* pInfo, int32_t killType) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
setCompactVnodeInfo
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pCmd
->
command
=
pInfo
->
type
;
return
TSDB_CODE_SUCCESS
;
}
bool
validateIpAddress
(
const
char
*
ip
,
size_t
size
)
{
char
tmp
[
128
]
=
{
0
};
// buffer to build null-terminated string
assert
(
size
<
128
);
...
...
@@ -4881,7 +4893,10 @@ int32_t getTimeRange(STimeWindow* win, tSqlExpr* pRight, int32_t optr, int16_t t
win
->
skey
=
val
;
}
else
if
(
optr
==
TK_EQ
)
{
win
->
ekey
=
win
->
skey
=
val
;
}
else
if
(
optr
==
TK_NE
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
return
TSDB_CODE_SUCCESS
;
}
...
...
src/client/src/tscServer.c
浏览文件 @
86bbd50e
...
...
@@ -47,6 +47,31 @@ static int32_t getWaitingTimeInterval(int32_t count) {
return
initial
*
((
2u
)
<<
(
count
-
2
));
}
static
int32_t
vgIdCompare
(
const
void
*
lhs
,
const
void
*
rhs
)
{
int32_t
left
=
*
(
int32_t
*
)
lhs
;
int32_t
right
=
*
(
int32_t
*
)
rhs
;
if
(
left
==
right
)
{
return
0
;
}
else
{
return
left
>
right
?
1
:
-
1
;
}
}
static
int32_t
removeDupVgid
(
int32_t
*
src
,
int32_t
sz
)
{
if
(
src
==
NULL
||
sz
<=
0
)
{
return
0
;
}
qsort
(
src
,
sz
,
sizeof
(
src
[
0
]),
vgIdCompare
);
int32_t
ret
=
1
;
for
(
int
i
=
1
;
i
<
sz
;
i
++
)
{
if
(
src
[
i
]
!=
src
[
i
-
1
])
{
src
[
ret
++
]
=
src
[
i
];
}
}
return
ret
;
}
static
void
tscSetDnodeEpSet
(
SRpcEpSet
*
pEpSet
,
SVgroupInfo
*
pVgroupInfo
)
{
assert
(
pEpSet
!=
NULL
&&
pVgroupInfo
!=
NULL
&&
pVgroupInfo
->
numOfEps
>
0
);
...
...
@@ -1515,6 +1540,60 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
return
TSDB_CODE_SUCCESS
;
}
int
tscBuildCompactMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
if
(
pInfo
->
list
==
NULL
||
taosArrayGetSize
(
pInfo
->
list
)
<=
0
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
STscObj
*
pObj
=
pSql
->
pTscObj
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SArray
*
pList
=
pInfo
->
list
;
int32_t
size
=
(
int32_t
)
taosArrayGetSize
(
pList
);
int32_t
*
result
=
malloc
(
sizeof
(
int32_t
)
*
size
);
if
(
result
==
NULL
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
tSqlExprItem
*
pSub
=
taosArrayGet
(
pList
,
i
);
tVariant
*
pVar
=
&
pSub
->
pNode
->
value
;
if
(
pVar
->
nType
>=
TSDB_DATA_TYPE_TINYINT
&&
pVar
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
result
[
i
]
=
(
int32_t
)(
pVar
->
i64
);
}
else
{
free
(
result
);
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
int
count
=
removeDupVgid
(
result
,
size
);
pCmd
->
payloadLen
=
sizeof
(
SCompactMsg
)
+
count
*
sizeof
(
int32_t
);
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_COMPACT_VNODE
;
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
pCmd
,
pCmd
->
payloadLen
))
{
tscError
(
"0x%"
PRIx64
" failed to malloc for query msg"
,
pSql
->
self
);
free
(
result
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SCompactMsg
*
pCompactMsg
=
(
SCompactMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
0
);
if
(
tNameIsEmpty
(
&
pTableMetaInfo
->
name
))
{
pthread_mutex_lock
(
&
pObj
->
mutex
);
tstrncpy
(
pCompactMsg
->
db
,
pObj
->
db
,
sizeof
(
pCompactMsg
->
db
));
pthread_mutex_unlock
(
&
pObj
->
mutex
);
}
else
{
tNameGetFullDbName
(
&
pTableMetaInfo
->
name
,
pCompactMsg
->
db
);
}
pCompactMsg
->
numOfVgroup
=
htons
(
count
);
for
(
int32_t
i
=
0
;
i
<
count
;
i
++
)
{
pCompactMsg
->
vgid
[
i
]
=
htons
(
result
[
i
]);
}
free
(
result
);
return
TSDB_CODE_SUCCESS
;
}
int
tscBuildRetrieveFromMgmtMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
...
@@ -2268,6 +2347,10 @@ int tscProcessAlterDbMsgRsp(SSqlObj *pSql) {
UNUSED
(
pSql
);
return
0
;
}
int
tscProcessCompactRsp
(
SSqlObj
*
pSql
)
{
UNUSED
(
pSql
);
return
TSDB_CODE_SUCCESS
;
}
int
tscProcessShowCreateRsp
(
SSqlObj
*
pSql
)
{
return
tscLocalResultCommonBuilder
(
pSql
,
1
);
...
...
@@ -2654,6 +2737,7 @@ void tscInitMsgsFp() {
tscBuildMsg
[
TSDB_SQL_ALTER_TABLE
]
=
tscBuildAlterTableMsg
;
tscBuildMsg
[
TSDB_SQL_UPDATE_TAGS_VAL
]
=
tscBuildUpdateTagMsg
;
tscBuildMsg
[
TSDB_SQL_ALTER_DB
]
=
tscAlterDbMsg
;
tscBuildMsg
[
TSDB_SQL_COMPACT_VNODE
]
=
tscBuildCompactMsg
;
tscBuildMsg
[
TSDB_SQL_CONNECT
]
=
tscBuildConnectMsg
;
tscBuildMsg
[
TSDB_SQL_USE_DB
]
=
tscBuildUseDbMsg
;
...
...
@@ -2694,6 +2778,7 @@ void tscInitMsgsFp() {
tscProcessMsgRsp
[
TSDB_SQL_ALTER_TABLE
]
=
tscProcessAlterTableMsgRsp
;
tscProcessMsgRsp
[
TSDB_SQL_ALTER_DB
]
=
tscProcessAlterDbMsgRsp
;
tscProcessMsgRsp
[
TSDB_SQL_COMPACT_VNODE
]
=
tscProcessCompactRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_TABLE
]
=
tscProcessShowCreateRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_STABLE
]
=
tscProcessShowCreateRsp
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
86bbd50e
...
...
@@ -3152,6 +3152,13 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
// it is the failure retry insert
if
(
pSql
->
pSubs
!=
NULL
)
{
int32_t
blockNum
=
(
int32_t
)
taosArrayGetSize
(
pCmd
->
insertParam
.
pDataBlocks
);
if
(
pSql
->
subState
.
numOfSub
!=
blockNum
)
{
tscError
(
"0x%"
PRIx64
" sub num:%d is not same with data block num:%d"
,
pSql
->
self
,
pSql
->
subState
.
numOfSub
,
blockNum
);
pRes
->
code
=
TSDB_CODE_TSC_APP_ERROR
;
return
pRes
->
code
;
}
for
(
int32_t
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
SInsertSupporter
*
pSup
=
calloc
(
1
,
sizeof
(
SInsertSupporter
));
...
...
src/common/inc/tcmdtype.h
浏览文件 @
86bbd50e
...
...
@@ -51,6 +51,7 @@ enum {
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_ALTER_ACCT
,
"alter-acct"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_ALTER_TABLE
,
"alter-table"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_ALTER_DB
,
"alter-db"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SYNC_DB_REPLICA
,
"sync db-replica"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_CREATE_MNODE
,
"create-mnode"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_DROP_MNODE
,
"drop-mnode"
)
...
...
@@ -63,6 +64,7 @@ enum {
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_KILL_QUERY
,
"kill-query"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_KILL_STREAM
,
"kill-stream"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_KILL_CONNECTION
,
"kill-connection"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_COMPACT_VNODE
,
"compact-vnode"
)
// SQL below is for read operation
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_READ
,
"read"
)
...
...
src/dnode/src/dnodePeer.c
浏览文件 @
86bbd50e
...
...
@@ -47,7 +47,8 @@ int32_t dnodeInitServer() {
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_VNODE
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_STREAM
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CONFIG_DNODE
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_MNODE
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_MNODE
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_COMPACT_VNODE
]
=
dnodeDispatchToVMgmtQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_TABLE
]
=
dnodeDispatchToMPeerQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_VNODE
]
=
dnodeDispatchToMPeerQueue
;
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
86bbd50e
...
...
@@ -61,6 +61,7 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_KILL_STREAM
]
=
dnodeDispatchToMWriteQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_KILL_CONN
]
=
dnodeDispatchToMWriteQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_CONFIG_DNODE
]
=
dnodeDispatchToMWriteQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_COMPACT_VNODE
]
=
dnodeDispatchToMWriteQueue
;
// the following message shall be treated as mnode query
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_HEARTBEAT
]
=
dnodeDispatchToMReadQueue
;
...
...
src/dnode/src/dnodeVMgmt.c
浏览文件 @
86bbd50e
...
...
@@ -31,6 +31,7 @@ static void * dnodeProcessMgmtQueue(void *param);
static
int32_t
dnodeProcessCreateVnodeMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessAlterVnodeMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessSyncVnodeMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessCompactVnodeMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessDropVnodeMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessAlterStreamMsg
(
SRpcMsg
*
pMsg
);
static
int32_t
dnodeProcessConfigDnodeMsg
(
SRpcMsg
*
pMsg
);
...
...
@@ -40,7 +41,8 @@ static int32_t (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *pMsg);
int32_t
dnodeInitVMgmt
()
{
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_VNODE
]
=
dnodeProcessCreateVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_VNODE
]
=
dnodeProcessAlterVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_SYNC_VNODE
]
=
dnodeProcessSyncVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_SYNC_VNODE
]
=
dnodeProcessSyncVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_COMPACT_VNODE
]
=
dnodeProcessCompactVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_DROP_VNODE
]
=
dnodeProcessDropVnodeMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_STREAM
]
=
dnodeProcessAlterStreamMsg
;
dnodeProcessMgmtMsgFp
[
TSDB_MSG_TYPE_MD_CONFIG_DNODE
]
=
dnodeProcessConfigDnodeMsg
;
...
...
@@ -187,6 +189,12 @@ static int32_t dnodeProcessSyncVnodeMsg(SRpcMsg *rpcMsg) {
return
vnodeSync
(
pSyncVnode
->
vgId
);
}
static
int32_t
dnodeProcessCompactVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SCompactVnodeMsg
*
pCompactVnode
=
rpcMsg
->
pCont
;
pCompactVnode
->
vgId
=
htonl
(
pCompactVnode
->
vgId
);
return
vnodeCompact
(
pCompactVnode
->
vgId
);
}
static
int32_t
dnodeProcessDropVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SDropVnodeMsg
*
pDrop
=
rpcMsg
->
pCont
;
pDrop
->
vgId
=
htonl
(
pDrop
->
vgId
);
...
...
src/inc/taosmsg.h
浏览文件 @
86bbd50e
...
...
@@ -61,9 +61,11 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" )
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_MD_ALTER_VNODE
,
"alter-vnode"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_MD_SYNC_VNODE
,
"sync-vnode"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_MD_CREATE_MNODE
,
"create-mnode"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_MD_COMPACT_VNODE
,
"compact-vnode"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DUMMY6
,
"dummy6"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DUMMY7
,
"dummy7"
)
// message from client to mnode
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_CONNECT
,
"connect"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_CREATE_ACCT
,
"create-acct"
)
...
...
@@ -84,6 +86,7 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" )
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_ALTER_TABLE
,
"alter-table"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_TABLE_META
,
"table-meta"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_STABLE_VGROUP
,
"stable-vgroup"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_COMPACT_VNODE
,
"compact-vnode"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_TABLES_META
,
"multiTable-meta"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_ALTER_STREAM
,
"alter-stream"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CM_SHOW
,
"show"
)
...
...
@@ -393,7 +396,7 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
}
SDropVnodeMsg
,
SSyncVnodeMsg
;
}
SDropVnodeMsg
,
SSyncVnodeMsg
,
SCompactVnodeMsg
;
typedef
struct
SColIndex
{
int16_t
colId
;
// column id
...
...
@@ -539,7 +542,7 @@ typedef struct {
uint8_t
status
;
uint8_t
role
;
uint8_t
replica
;
uint8_t
reserved
;
uint8_t
compact
;
}
SVnodeLoad
;
typedef
struct
{
...
...
@@ -781,6 +784,12 @@ typedef struct {
char
payload
[];
}
SShowMsg
;
typedef
struct
{
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
];
int32_t
numOfVgroup
;
int32_t
vgid
[];
}
SCompactMsg
;
typedef
struct
SShowRsp
{
uint64_t
qhandle
;
STableMetaMsg
tableMeta
;
...
...
src/inc/ttokendef.h
浏览文件 @
86bbd50e
...
...
@@ -94,116 +94,117 @@
#define TK_PASS 76
#define TK_PRIVILEGE 77
#define TK_LOCAL 78
#define TK_IF 79
#define TK_EXISTS 80
#define TK_PPS 81
#define TK_TSERIES 82
#define TK_DBS 83
#define TK_STORAGE 84
#define TK_QTIME 85
#define TK_CONNS 86
#define TK_STATE 87
#define TK_COMMA 88
#define TK_KEEP 89
#define TK_CACHE 90
#define TK_REPLICA 91
#define TK_QUORUM 92
#define TK_DAYS 93
#define TK_MINROWS 94
#define TK_MAXROWS 95
#define TK_BLOCKS 96
#define TK_CTIME 97
#define TK_WAL 98
#define TK_FSYNC 99
#define TK_COMP 100
#define TK_PRECISION 101
#define TK_UPDATE 102
#define TK_CACHELAST 103
#define TK_PARTITIONS 104
#define TK_LP 105
#define TK_RP 106
#define TK_UNSIGNED 107
#define TK_TAGS 108
#define TK_USING 109
#define TK_AS 110
#define TK_NULL 111
#define TK_NOW 112
#define TK_SELECT 113
#define TK_UNION 114
#define TK_ALL 115
#define TK_DISTINCT 116
#define TK_FROM 117
#define TK_VARIABLE 118
#define TK_INTERVAL 119
#define TK_SESSION 120
#define TK_STATE_WINDOW 121
#define TK_FILL 122
#define TK_SLIDING 123
#define TK_ORDER 124
#define TK_BY 125
#define TK_ASC 126
#define TK_DESC 127
#define TK_GROUP 128
#define TK_HAVING 129
#define TK_LIMIT 130
#define TK_OFFSET 131
#define TK_SLIMIT 132
#define TK_SOFFSET 133
#define TK_WHERE 134
#define TK_RESET 135
#define TK_QUERY 136
#define TK_SYNCDB 137
#define TK_ADD 138
#define TK_COLUMN 139
#define TK_MODIFY 140
#define TK_TAG 141
#define TK_CHANGE 142
#define TK_SET 143
#define TK_KILL 144
#define TK_CONNECTION 145
#define TK_STREAM 146
#define TK_COLON 147
#define TK_ABORT 148
#define TK_AFTER 149
#define TK_ATTACH 150
#define TK_BEFORE 151
#define TK_BEGIN 152
#define TK_CASCADE 153
#define TK_CLUSTER 154
#define TK_CONFLICT 155
#define TK_COPY 156
#define TK_DEFERRED 157
#define TK_DELIMITERS 158
#define TK_DETACH 159
#define TK_EACH 160
#define TK_END 161
#define TK_EXPLAIN 162
#define TK_FAIL 163
#define TK_FOR 164
#define TK_IGNORE 165
#define TK_IMMEDIATE 166
#define TK_INITIALLY 167
#define TK_INSTEAD 168
#define TK_MATCH 169
#define TK_KEY 170
#define TK_OF 171
#define TK_RAISE 172
#define TK_REPLACE 173
#define TK_RESTRICT 174
#define TK_ROW 175
#define TK_STATEMENT 176
#define TK_TRIGGER 177
#define TK_VIEW 178
#define TK_SEMI 179
#define TK_NONE 180
#define TK_PREV 181
#define TK_LINEAR 182
#define TK_IMPORT 183
#define TK_TBNAME 184
#define TK_JOIN 185
#define TK_INSERT 186
#define TK_INTO 187
#define TK_VALUES 188
#define TK_COMPACT 79
#define TK_LP 80
#define TK_RP 81
#define TK_IF 82
#define TK_EXISTS 83
#define TK_PPS 84
#define TK_TSERIES 85
#define TK_DBS 86
#define TK_STORAGE 87
#define TK_QTIME 88
#define TK_CONNS 89
#define TK_STATE 90
#define TK_COMMA 91
#define TK_KEEP 92
#define TK_CACHE 93
#define TK_REPLICA 94
#define TK_QUORUM 95
#define TK_DAYS 96
#define TK_MINROWS 97
#define TK_MAXROWS 98
#define TK_BLOCKS 99
#define TK_CTIME 100
#define TK_WAL 101
#define TK_FSYNC 102
#define TK_COMP 103
#define TK_PRECISION 104
#define TK_UPDATE 105
#define TK_CACHELAST 106
#define TK_PARTITIONS 107
#define TK_UNSIGNED 108
#define TK_TAGS 109
#define TK_USING 110
#define TK_AS 111
#define TK_NULL 112
#define TK_NOW 113
#define TK_SELECT 114
#define TK_UNION 115
#define TK_ALL 116
#define TK_DISTINCT 117
#define TK_FROM 118
#define TK_VARIABLE 119
#define TK_INTERVAL 120
#define TK_SESSION 121
#define TK_STATE_WINDOW 122
#define TK_FILL 123
#define TK_SLIDING 124
#define TK_ORDER 125
#define TK_BY 126
#define TK_ASC 127
#define TK_DESC 128
#define TK_GROUP 129
#define TK_HAVING 130
#define TK_LIMIT 131
#define TK_OFFSET 132
#define TK_SLIMIT 133
#define TK_SOFFSET 134
#define TK_WHERE 135
#define TK_RESET 136
#define TK_QUERY 137
#define TK_SYNCDB 138
#define TK_ADD 139
#define TK_COLUMN 140
#define TK_MODIFY 141
#define TK_TAG 142
#define TK_CHANGE 143
#define TK_SET 144
#define TK_KILL 145
#define TK_CONNECTION 146
#define TK_STREAM 147
#define TK_COLON 148
#define TK_ABORT 149
#define TK_AFTER 150
#define TK_ATTACH 151
#define TK_BEFORE 152
#define TK_BEGIN 153
#define TK_CASCADE 154
#define TK_CLUSTER 155
#define TK_CONFLICT 156
#define TK_COPY 157
#define TK_DEFERRED 158
#define TK_DELIMITERS 159
#define TK_DETACH 160
#define TK_EACH 161
#define TK_END 162
#define TK_EXPLAIN 163
#define TK_FAIL 164
#define TK_FOR 165
#define TK_IGNORE 166
#define TK_IMMEDIATE 167
#define TK_INITIALLY 168
#define TK_INSTEAD 169
#define TK_MATCH 170
#define TK_KEY 171
#define TK_OF 172
#define TK_RAISE 173
#define TK_REPLACE 174
#define TK_RESTRICT 175
#define TK_ROW 176
#define TK_STATEMENT 177
#define TK_TRIGGER 178
#define TK_VIEW 179
#define TK_SEMI 180
#define TK_NONE 181
#define TK_PREV 182
#define TK_LINEAR 183
#define TK_IMPORT 184
#define TK_TBNAME 185
#define TK_JOIN 186
#define TK_INSERT 187
#define TK_INTO 188
#define TK_VALUES 189
#define TK_SPACE 300
...
...
src/inc/vnode.h
浏览文件 @
86bbd50e
...
...
@@ -62,6 +62,7 @@ int32_t vnodeOpen(int32_t vgId);
int32_t
vnodeAlter
(
void
*
pVnode
,
SCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeSync
(
int32_t
vgId
);
int32_t
vnodeClose
(
int32_t
vgId
);
int32_t
vnodeCompact
(
int32_t
vgId
);
// vnodeMgmt
int32_t
vnodeInitMgmt
();
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
86bbd50e
...
...
@@ -144,6 +144,7 @@ typedef struct SVgObj {
int8_t
reserved0
[
4
];
SVnodeGid
vnodeGid
[
TSDB_MAX_REPLICA
];
int32_t
vgCfgVersion
;
int8_t
compact
;
int8_t
reserved1
[
8
];
int8_t
updateEnd
[
4
];
int32_t
refCount
;
...
...
src/mnode/inc/mnodeVgroup.h
浏览文件 @
86bbd50e
...
...
@@ -51,6 +51,7 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle);
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
,
SMnodeMsg
*
pMsg
);
void
mnodeSendSyncVgroupMsg
(
SVgObj
*
pVgroup
);
void
mnodeSendCompactVgroupMsg
(
SVgObj
*
pVgroup
);
SRpcEpSet
mnodeGetEpSetFromVgroup
(
SVgObj
*
pVgroup
);
SRpcEpSet
mnodeGetEpSetFromIp
(
char
*
ep
);
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
86bbd50e
...
...
@@ -53,6 +53,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
static
int32_t
mnodeProcessCreateDbMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeProcessDropDbMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeProcessSyncDbMsg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mnodeProcessCompactMsg
(
SMnodeMsg
*
pMsg
);
int32_t
mnodeProcessAlterDbMsg
(
SMnodeMsg
*
pMsg
);
#ifndef _TOPIC
...
...
@@ -200,10 +201,12 @@ int32_t mnodeInitDbs() {
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_ALTER_DB
,
mnodeProcessAlterDbMsg
);
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_DROP_DB
,
mnodeProcessDropDbMsg
);
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_SYNC_DB
,
mnodeProcessSyncDbMsg
);
mnodeAddWriteMsgHandle
(
TSDB_MSG_TYPE_CM_COMPACT_VNODE
,
mnodeProcessCompactMsg
);
mnodeAddShowMetaHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeGetDbMeta
);
mnodeAddShowRetrieveHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeRetrieveDbs
);
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_DB
,
mnodeCancelGetNextDb
);
mDebug
(
"table:dbs table is created"
);
return
tpInit
();
}
...
...
@@ -1267,7 +1270,7 @@ static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) {
static
int32_t
mnodeSyncDb
(
SDbObj
*
pDb
,
SMnodeMsg
*
pMsg
)
{
void
*
pIter
=
NULL
;
SVgObj
*
pVgroup
=
NULL
;
while
(
1
)
{
while
(
1
)
{
pIter
=
mnodeGetNextVgroup
(
pIter
,
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
if
(
pVgroup
->
pDb
==
pDb
)
{
...
...
@@ -1281,6 +1284,43 @@ static int32_t mnodeSyncDb(SDbObj *pDb, SMnodeMsg *pMsg) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeCompact
(
SDbObj
*
pDb
,
SCompactMsg
*
pCompactMsg
)
{
int32_t
count
=
ntohs
(
pCompactMsg
->
numOfVgroup
);
int32_t
*
buf
=
malloc
(
sizeof
(
int32_t
)
*
count
);
if
(
buf
==
NULL
)
{
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
}
for
(
int32_t
i
=
0
;
i
<
count
;
i
++
)
{
buf
[
i
]
=
ntohs
(
pCompactMsg
->
vgid
[
i
]);
}
// copy from mnodeSyncDb, so ugly
for
(
int32_t
i
=
0
;
i
<
count
;
i
++
)
{
SVgObj
*
pVgroup
=
NULL
;
void
*
pIter
=
NULL
;
bool
valid
=
false
;
while
(
1
)
{
pIter
=
mnodeGetNextVgroup
(
pIter
,
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
if
(
pVgroup
->
pDb
==
pDb
&&
pVgroup
->
vgId
==
buf
[
i
])
{
mnodeSendCompactVgroupMsg
(
pVgroup
);
mnodeDecVgroupRef
(
pVgroup
);
valid
=
true
;
break
;
}
mnodeDecVgroupRef
(
pVgroup
);
}
if
(
valid
==
false
)
{
mLError
(
"db:%s, cannot find valid vgId: %d"
,
pDb
->
name
,
buf
[
i
]);
}
}
free
(
buf
);
mLInfo
(
"db:%s, trigger compact"
,
pDb
->
name
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mnodeProcessSyncDbMsg
(
SMnodeMsg
*
pMsg
)
{
SSyncDbMsg
*
pSyncDb
=
pMsg
->
rpcMsg
.
pCont
;
mDebug
(
"db:%s, syncdb is received from thandle:%p, ignore:%d"
,
pSyncDb
->
db
,
pMsg
->
rpcMsg
.
handle
,
pSyncDb
->
ignoreNotExists
);
...
...
@@ -1303,6 +1343,20 @@ static int32_t mnodeProcessSyncDbMsg(SMnodeMsg *pMsg) {
return
mnodeSyncDb
(
pMsg
->
pDb
,
pMsg
);
}
static
int32_t
mnodeProcessCompactMsg
(
SMnodeMsg
*
pMsg
)
{
SCompactMsg
*
pCompact
=
pMsg
->
rpcMsg
.
pCont
;
mDebug
(
"db:%s, compact is received from thandle:%p"
,
pCompact
->
db
,
pMsg
->
rpcMsg
.
handle
);
if
(
pMsg
->
pDb
==
NULL
)
pMsg
->
pDb
=
mnodeGetDb
(
pCompact
->
db
);
if
(
pMsg
->
pDb
==
NULL
)
return
TSDB_CODE_MND_DB_NOT_SELECTED
;
if
(
pMsg
->
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
mError
(
"db:%s, status:%d, in dropping, ignore compact request"
,
pCompact
->
db
,
pMsg
->
pDb
->
status
);
return
TSDB_CODE_MND_DB_IN_DROPPING
;
}
return
mnodeCompact
(
pMsg
->
pDb
,
pCompact
);
}
void
mnodeDropAllDbs
(
SAcctObj
*
pAcct
)
{
int32_t
numOfDbs
=
0
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
86bbd50e
...
...
@@ -1202,4 +1202,4 @@ int32_t mnodeCompactWal() {
sdbInfo
(
"vgId:1, compact mnode wal success"
);
return
0
;
}
\ No newline at end of file
}
src/mnode/src/mnodeVgroup.c
浏览文件 @
86bbd50e
...
...
@@ -60,6 +60,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
static
int32_t
mnodeRetrieveVgroups
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mnodeProcessCreateVnodeRsp
(
SRpcMsg
*
rpcMsg
);
static
void
mnodeProcessAlterVnodeRsp
(
SRpcMsg
*
rpcMsg
);
static
void
mnodeProcessCompactVnodeRsp
(
SRpcMsg
*
rpcMsg
);
static
void
mnodeProcessDropVnodeRsp
(
SRpcMsg
*
rpcMsg
);
static
int32_t
mnodeProcessVnodeCfgMsg
(
SMnodeMsg
*
pMsg
)
;
static
void
mnodeSendDropVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
...
...
@@ -236,6 +237,7 @@ int32_t mnodeInitVgroups() {
mnodeAddShowFreeIterHandle
(
TSDB_MGMT_TABLE_VGROUP
,
mnodeCancelGetNextVgroup
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP
,
mnodeProcessCreateVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP
,
mnodeProcessAlterVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_COMPACT_VNODE_RSP
,
mnodeProcessCompactVnodeRsp
);
mnodeAddPeerRspHandle
(
TSDB_MSG_TYPE_MD_DROP_VNODE_RSP
,
mnodeProcessDropVnodeRsp
);
mnodeAddPeerMsgHandle
(
TSDB_MSG_TYPE_DM_CONFIG_VNODE
,
mnodeProcessVnodeCfgMsg
);
...
...
@@ -350,6 +352,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
pVgroup
->
pDb
->
dbCfgVersion
,
pVgroup
->
vgCfgVersion
,
pVgroup
->
numOfVnodes
);
mnodeSendAlterVgroupMsg
(
pVgroup
,
NULL
);
}
pVgroup
->
compact
=
pVload
->
compact
;
}
static
int32_t
mnodeAllocVgroupIdPool
(
SVgObj
*
pInputVgroup
)
{
...
...
@@ -717,6 +720,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
cols
++
;
}
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"compacting"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pMeta
->
numOfColumns
=
htons
(
cols
);
pShow
->
numOfColumns
=
cols
;
...
...
@@ -820,7 +830,11 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
role
,
pShow
->
bytes
[
cols
]);
cols
++
;
}
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int8_t
*
)
pWrite
=
pVgroup
->
compact
;
cols
++
;
mnodeDecVgroupRef
(
pVgroup
);
numOfRows
++
;
}
...
...
@@ -979,6 +993,7 @@ static SSyncVnodeMsg *mnodeBuildSyncVnodeMsg(int32_t vgId) {
return
pSyncVnode
;
}
static
void
mnodeSendSyncVnodeMsg
(
SVgObj
*
pVgroup
,
SRpcEpSet
*
epSet
)
{
SSyncVnodeMsg
*
pSyncVnode
=
mnodeBuildSyncVnodeMsg
(
pVgroup
->
vgId
);
SRpcMsg
rpcMsg
=
{
...
...
@@ -991,6 +1006,18 @@ static void mnodeSendSyncVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet) {
dnodeSendMsgToDnode
(
epSet
,
&
rpcMsg
);
}
static
void
mnodeSendCompactVnodeMsg
(
SVgObj
*
pVgroup
,
SRpcEpSet
*
epSet
)
{
SCompactVnodeMsg
*
pCompactVnode
=
mnodeBuildSyncVnodeMsg
(
pVgroup
->
vgId
);
SRpcMsg
rpcMsg
=
{
.
ahandle
=
NULL
,
.
pCont
=
pCompactVnode
,
.
contLen
=
pCompactVnode
?
sizeof
(
SCompactVnodeMsg
)
:
0
,
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_COMPACT_VNODE
};
dnodeSendMsgToDnode
(
epSet
,
&
rpcMsg
);
}
void
mnodeSendSyncVgroupMsg
(
SVgObj
*
pVgroup
)
{
mDebug
(
"vgId:%d, send sync all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
...
...
@@ -1004,6 +1031,17 @@ void mnodeSendSyncVgroupMsg(SVgObj *pVgroup) {
}
}
void
mnodeSendCompactVgroupMsg
(
SVgObj
*
pVgroup
)
{
mDebug
(
"vgId:%d, send compact all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
pVgroup
->
dbName
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
//if (pVgroup->vnodeGid[i].role != TAOS_SYNC_ROLE_SLAVE) continue; //TODO(yihaoDeng): compact slave or not ?
SRpcEpSet
epSet
=
mnodeGetEpSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, index:%d, send compact vnode msg to dnode %s"
,
pVgroup
->
vgId
,
i
,
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mnodeSendCompactVnodeMsg
(
pVgroup
,
&
epSet
);
}
}
static
void
mnodeSendCreateVnodeMsg
(
SVgObj
*
pVgroup
,
SRpcEpSet
*
epSet
,
void
*
ahandle
)
{
SCreateVnodeMsg
*
pCreate
=
mnodeBuildVnodeMsg
(
pVgroup
);
SRpcMsg
rpcMsg
=
{
...
...
@@ -1050,6 +1088,9 @@ static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg) {
dnodeSendRpcMWriteRsp
(
mnodeMsg
,
code
);
}
}
static
void
mnodeProcessCompactVnodeRsp
(
SRpcMsg
*
rpcMsg
)
{
mDebug
(
"compact vnode rsp received"
);
}
static
void
mnodeProcessCreateVnodeRsp
(
SRpcMsg
*
rpcMsg
)
{
if
(
rpcMsg
->
ahandle
==
NULL
)
return
;
...
...
@@ -1346,4 +1387,4 @@ int32_t mnodeCompactVgroups() {
mInfo
(
"end to compact vgroups table..."
);
return
0
;
}
\ No newline at end of file
}
src/query/inc/qSqlparser.h
浏览文件 @
86bbd50e
...
...
@@ -312,6 +312,8 @@ void setCreateUserSql(SSqlInfo *pInfo, SStrToken *pName, SStrToken *pPasswd);
void
setKillSql
(
SSqlInfo
*
pInfo
,
int32_t
type
,
SStrToken
*
ip
);
void
setAlterUserSql
(
SSqlInfo
*
pInfo
,
int16_t
type
,
SStrToken
*
pName
,
SStrToken
*
pPwd
,
SStrToken
*
pPrivilege
);
void
setCompactVnodeSql
(
SSqlInfo
*
pInfo
,
int32_t
type
,
SArray
*
pParam
);
void
setDefaultCreateDbOption
(
SCreateDbInfo
*
pDBInfo
);
void
setDefaultCreateTopicOption
(
SCreateDbInfo
*
pDBInfo
);
...
...
src/query/inc/sql.y
浏览文件 @
86bbd50e
...
...
@@ -174,6 +174,10 @@ cmd ::= ALTER TOPIC ids(X) alter_topic_optr(Y). { SStrToken t = {0}; setCreateD
cmd ::= ALTER ACCOUNT ids(X) acct_optr(Z). { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &X, NULL, &Z);}
cmd ::= ALTER ACCOUNT ids(X) PASS ids(Y) acct_optr(Z). { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &X, &Y, &Z);}
////////////////////////////// COMPACT STATEMENT //////////////////////////////////////////////
cmd ::= COMPACT VNODES IN LP exprlist(Y) RP. { setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, Y);}
// An IDENTIFIER can be a generic identifier, or one of several keywords.
// Any non-standard keyword can also be an identifier.
// And "ids" is an identifer-or-string.
...
...
src/query/src/qSqlParser.c
浏览文件 @
86bbd50e
...
...
@@ -1067,6 +1067,10 @@ void setCreateAcctSql(SSqlInfo *pInfo, int32_t type, SStrToken *pName, SStrToken
pInfo
->
pMiscInfo
->
user
.
passwd
=
*
pPwd
;
}
}
void
setCompactVnodeSql
(
SSqlInfo
*
pInfo
,
int32_t
type
,
SArray
*
pParam
)
{
pInfo
->
type
=
type
;
pInfo
->
list
=
pParam
;
}
void
setCreateUserSql
(
SSqlInfo
*
pInfo
,
SStrToken
*
pName
,
SStrToken
*
pPasswd
)
{
pInfo
->
type
=
TSDB_SQL_CREATE_USER
;
...
...
src/query/src/sql.c
浏览文件 @
86bbd50e
...
...
@@ -66,28 +66,28 @@
** defined, then do no error processing.
*/
#define YYCODETYPE unsigned short int
#define YYNOCODE 27
0
#define YYNOCODE 27
1
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef
union
{
int
yyinit
;
ParseTOKENTYPE
yy0
;
SSessionWindowVal
yy15
;
S
IntervalVal
yy42
;
tSqlExpr
*
yy
68
;
SCreate
AcctInfo
yy77
;
S
Array
*
yy93
;
int
yy150
;
SS
qlNode
*
yy224
;
S
WindowStateVal
yy274
;
int64_t
yy279
;
S
LimitVal
yy284
;
TAOS_FIELD
yy325
;
S
RelationInfo
*
yy330
;
S
CreateDbInfo
yy372
;
tVariant
yy518
;
SCreatedTableInfo
yy
528
;
SCreateTableSql
*
yy532
;
int
yy112
;
S
CreateAcctInfo
yy151
;
tSqlExpr
*
yy
166
;
SCreate
TableSql
*
yy182
;
S
SqlNode
*
yy236
;
SRelationInfo
*
yy244
;
SS
essionWindowVal
yy259
;
S
IntervalVal
yy340
;
TAOS_FIELD
yy343
;
S
WindowStateVal
yy348
;
int64_t
yy369
;
S
CreateDbInfo
yy382
;
S
LimitVal
yy414
;
SArray
*
yy441
;
SCreatedTableInfo
yy
456
;
tVariant
yy506
;
}
YYMINORTYPE
;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
...
...
@@ -96,8 +96,8 @@ typedef union {
#define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo
#define ParseARG_STORE yypParser->pInfo = pInfo
#define YYNSTATE 54
3
#define YYNRULE 28
4
#define YYNSTATE 54
9
#define YYNRULE 28
5
#define YYFALLBACK 1
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
...
...
@@ -167,304 +167,306 @@ static const YYMINORTYPE yyzerominor = { 0 };
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
*/
#define YY_ACTTAB_COUNT (8
43
)
#define YY_ACTTAB_COUNT (8
54
)
static
const
YYACTIONTYPE
yy_action
[]
=
{
/* 0 */
526
,
51
,
50
,
125
,
124
,
49
,
48
,
47
,
525
,
142
,
/* 10 */
140
,
139
,
52
,
53
,
32
,
56
,
57
,
289
,
543
,
230
,
/* 20 */
46
,
529
,
55
,
283
,
60
,
58
,
62
,
59
,
338
,
337
,
/* 30 */
136
,
528
,
51
,
50
,
828
,
341
,
49
,
48
,
47
,
52
,
/* 40 */
53
,
349
,
56
,
57
,
481
,
70
,
230
,
46
,
178
,
55
,
/* 50 */
283
,
60
,
58
,
62
,
59
,
151
,
395
,
13
,
394
,
51
,
/* 60 */
50
,
93
,
90
,
49
,
48
,
47
,
52
,
53
,
245
,
56
,
/* 70 */
57
,
64
,
410
,
230
,
46
,
251
,
55
,
283
,
60
,
58
,
/* 80 */
62
,
59
,
357
,
468
,
255
,
254
,
51
,
50
,
71
,
415
,
/* 90 */
49
,
48
,
47
,
52
,
54
,
34
,
56
,
57
,
259
,
144
,
/* 100 */
230
,
46
,
526
,
55
,
283
,
60
,
58
,
62
,
59
,
76
,
/* 110 */
525
,
315
,
314
,
51
,
50
,
92
,
236
,
49
,
48
,
47
,
/* 120 */
348
,
64
,
60
,
58
,
62
,
59
,
369
,
21
,
278
,
20
,
/* 130 */
51
,
50
,
399
,
288
,
49
,
48
,
47
,
317
,
247
,
412
,
/* 140 */
244
,
463
,
310
,
309
,
91
,
67
,
542
,
541
,
540
,
539
,
/* 150 */
538
,
537
,
536
,
535
,
534
,
533
,
532
,
531
,
530
,
340
,
/* 160 */
360
,
53
,
219
,
56
,
57
,
266
,
265
,
230
,
46
,
393
,
/* 170 */
55
,
283
,
60
,
58
,
62
,
59
,
418
,
417
,
33
,
409
,
/* 180 */
51
,
50
,
240
,
228
,
49
,
48
,
47
,
56
,
57
,
8
,
/* 190 */
68
,
230
,
46
,
517
,
55
,
283
,
60
,
58
,
62
,
59
,
/* 200 */
49
,
48
,
47
,
151
,
51
,
50
,
1
,
166
,
49
,
48
,
/* 210 */
47
,
423
,
435
,
434
,
433
,
432
,
431
,
430
,
429
,
428
,
/* 220 */
427
,
426
,
425
,
424
,
422
,
421
,
229
,
385
,
6
,
392
,
/* 230 */
396
,
391
,
389
,
34
,
388
,
374
,
373
,
40
,
297
,
334
,
/* 240 */
333
,
296
,
295
,
294
,
332
,
293
,
331
,
330
,
329
,
292
,
/* 250 */
328
,
327
,
241
,
23
,
239
,
35
,
303
,
302
,
215
,
216
,
/* 260 */
229
,
385
,
282
,
180
,
396
,
73
,
389
,
465
,
388
,
112
,
/* 270 */
204
,
111
,
280
,
286
,
87
,
313
,
19
,
205
,
18
,
463
,
/* 280 */
80
,
34
,
128
,
127
,
203
,
35
,
138
,
491
,
262
,
493
,
/* 290 */
492
,
443
,
215
,
216
,
490
,
178
,
488
,
487
,
489
,
34
,
/* 300 */
486
,
485
,
40
,
408
,
334
,
333
,
453
,
195
,
452
,
332
,
/* 310 */
284
,
331
,
330
,
329
,
82
,
328
,
327
,
226
,
378
,
451
,
/* 320 */
398
,
450
,
41
,
312
,
113
,
107
,
118
,
463
,
195
,
137
,
/* 330 */
61
,
117
,
123
,
126
,
116
,
501
,
384
,
387
,
227
,
378
,
/* 340 */
120
,
311
,
390
,
386
,
258
,
463
,
74
,
456
,
34
,
34
,
/* 350 */
459
,
34
,
458
,
212
,
457
,
24
,
397
,
34
,
34
,
187
,
/* 360 */
185
,
183
,
679
,
34
,
61
,
34
,
182
,
131
,
130
,
129
,
/* 370 */
384
,
387
,
526
,
383
,
5
,
37
,
168
,
386
,
242
,
243
,
/* 380 */
525
,
167
,
101
,
96
,
100
,
17
,
106
,
16
,
105
,
75
,
/* 390 */
307
,
306
,
24
,
305
,
463
,
463
,
15
,
463
,
14
,
304
,
/* 400 */
234
,
25
,
94
,
463
,
463
,
233
,
401
,
220
,
64
,
463
,
/* 410 */
379
,
463
,
146
,
79
,
35
,
526
,
82
,
3
,
179
,
365
,
/* 420 */
89
,
262
,
347
,
525
,
41
,
482
,
366
,
335
,
502
,
178
,
/* 430 */
362
,
115
,
260
,
34
,
77
,
246
,
325
,
416
,
151
,
357
,
/* 440 */
237
,
299
,
151
,
357
,
413
,
350
,
235
,
224
,
500
,
195
,
/* 450 */
413
,
413
,
218
,
339
,
499
,
222
,
455
,
454
,
498
,
221
,
/* 460 */
377
,
497
,
496
,
495
,
494
,
484
,
480
,
479
,
478
,
477
,
/* 470 */
476
,
464
,
475
,
474
,
473
,
35
,
28
,
467
,
469
,
470
,
/* 480 */
466
,
110
,
108
,
104
,
102
,
99
,
66
,
65
,
298
,
441
,
/* 490 */
442
,
440
,
439
,
438
,
437
,
95
,
27
,
93
,
287
,
436
,
/* 500 */
26
,
285
,
12
,
400
,
7
,
11
,
376
,
10
,
31
,
88
,
/* 510 */
352
,
30
,
150
,
370
,
367
,
225
,
274
,
86
,
148
,
364
,
/* 520 */
85
,
84
,
363
,
147
,
264
,
257
,
345
,
361
,
358
,
29
,
/* 530 */
9
,
346
,
81
,
344
,
253
,
343
,
250
,
342
,
2
,
141
,
/* 540 */
262
,
252
,
4
,
249
,
524
,
523
,
504
,
135
,
518
,
503
,
/* 550 */
483
,
134
,
516
,
336
,
133
,
132
,
326
,
509
,
324
,
176
,
/* 560 */
177
,
323
,
322
,
321
,
320
,
319
,
175
,
114
,
318
,
173
,
/* 570 */
211
,
174
,
210
,
98
,
172
,
299
,
171
,
420
,
471
,
290
,
/* 580 */
97
,
45
,
161
,
158
,
156
,
268
,
153
,
69
,
160
,
276
,
/* 590 */
269
,
829
,
238
,
159
,
157
,
217
,
372
,
270
,
83
,
78
,
/* 600 */
261
,
829
,
829
,
271
,
829
,
829
,
273
,
829
,
829
,
829
,
/* 610 */
829
,
829
,
829
,
275
,
829
,
277
,
368
,
829
,
155
,
281
,
/* 620 */
154
,
279
,
189
,
63
,
527
,
152
,
162
,
72
,
406
,
829
,
/* 630 */
188
,
522
,
521
,
520
,
829
,
519
,
829
,
186
,
223
,
184
,
/* 640 */
267
,
515
,
829
,
514
,
513
,
829
,
829
,
512
,
375
,
829
,
/* 650 */
829
,
371
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 660 */
829
,
829
,
829
,
829
,
829
,
407
,
263
,
325
,
829
,
829
,
/* 670 */
356
,
829
,
829
,
829
,
829
,
316
,
829
,
829
,
829
,
829
,
/* 680 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 690 */
44
,
829
,
511
,
510
,
181
,
248
,
508
,
507
,
122
,
121
,
/* 700 */
506
,
829
,
119
,
505
,
191
,
43
,
36
,
829
,
829
,
39
,
/* 710 */
472
,
170
,
462
,
461
,
109
,
460
,
308
,
169
,
448
,
447
,
/* 720 */
103
,
829
,
829
,
829
,
829
,
829
,
446
,
301
,
444
,
300
,
/* 730 */
38
,
190
,
42
,
291
,
419
,
165
,
164
,
829
,
411
,
163
,
/* 740 */
272
,
149
,
145
,
359
,
355
,
354
,
353
,
351
,
143
,
256
,
/* 750 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 760 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 770 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 780 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
232
,
405
,
404
,
/* 790 */
231
,
403
,
402
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 800 */
829
,
829
,
829
,
449
,
445
,
414
,
829
,
829
,
829
,
829
,
/* 810 */
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
829
,
/* 820 */
829
,
829
,
829
,
196
,
206
,
192
,
207
,
209
,
208
,
202
,
/* 830 */
201
,
194
,
200
,
198
,
197
,
214
,
213
,
382
,
381
,
380
,
/* 840 */
199
,
193
,
22
,
/* 0 */
532
,
53
,
52
,
126
,
125
,
51
,
50
,
49
,
531
,
143
,
/* 10 */
141
,
140
,
54
,
55
,
14
,
58
,
59
,
379
,
378
,
239
,
/* 20 */
48
,
450
,
57
,
300
,
62
,
60
,
63
,
61
,
343
,
342
,
/* 30 */
137
,
25
,
53
,
52
,
835
,
346
,
51
,
50
,
49
,
54
,
/* 40 */
55
,
549
,
58
,
59
,
94
,
91
,
239
,
48
,
237
,
57
,
/* 50 */
300
,
62
,
60
,
63
,
61
,
443
,
71
,
442
,
152
,
53
,
/* 60 */
52
,
389
,
253
,
51
,
50
,
49
,
54
,
55
,
6
,
58
,
/* 70 */
59
,
257
,
256
,
239
,
48
,
74
,
57
,
300
,
62
,
60
,
/* 80 */
63
,
61
,
22
,
362
,
21
,
92
,
53
,
52
,
532
,
95
,
/* 90 */
51
,
50
,
49
,
51
,
50
,
49
,
531
,
72
,
440
,
261
,
/* 100 */
439
,
54
,
56
,
471
,
58
,
59
,
232
,
449
,
239
,
48
,
/* 110 */
77
,
57
,
300
,
62
,
60
,
63
,
61
,
397
,
396
,
34
,
/* 120 */
388
,
53
,
52
,
474
,
395
,
51
,
50
,
49
,
282
,
113
,
/* 130 */
88
,
112
,
548
,
547
,
546
,
545
,
544
,
543
,
542
,
541
,
/* 140 */
540
,
539
,
538
,
537
,
536
,
345
,
35
,
55
,
220
,
58
,
/* 150 */
59
,
320
,
319
,
239
,
48
,
535
,
57
,
300
,
62
,
60
,
/* 160 */
63
,
61
,
534
,
33
,
145
,
247
,
53
,
52
,
532
,
441
,
/* 170 */
51
,
50
,
49
,
58
,
59
,
152
,
531
,
239
,
48
,
81
,
/* 180 */
57
,
300
,
62
,
60
,
63
,
61
,
20
,
302
,
19
,
322
,
/* 190 */
53
,
52
,
288
,
469
,
51
,
50
,
49
,
402
,
414
,
413
,
/* 200 */
412
,
411
,
410
,
409
,
408
,
407
,
406
,
405
,
404
,
403
,
/* 210 */
401
,
400
,
438
,
264
,
41
,
296
,
339
,
338
,
295
,
294
,
/* 220 */
293
,
337
,
292
,
336
,
335
,
334
,
291
,
333
,
332
,
238
,
/* 230 */
433
,
268
,
267
,
444
,
446
,
437
,
249
,
436
,
246
,
523
,
/* 240 */
315
,
314
,
24
,
62
,
60
,
63
,
61
,
374
,
35
,
280
,
/* 250 */
139
,
53
,
52
,
83
,
35
,
51
,
50
,
49
,
459
,
205
,
/* 260 */
458
,
217
,
218
,
3
,
180
,
301
,
206
,
457
,
240
,
456
,
/* 270 */
445
,
129
,
128
,
204
,
18
,
68
,
17
,
305
,
83
,
497
,
/* 280 */
76
,
499
,
498
,
354
,
448
,
35
,
496
,
42
,
494
,
493
,
/* 290 */
495
,
318
,
492
,
491
,
431
,
469
,
41
,
317
,
339
,
338
,
/* 300 */
138
,
469
,
35
,
337
,
25
,
336
,
335
,
334
,
64
,
333
,
/* 310 */
332
,
242
,
42
,
352
,
114
,
108
,
119
,
532
,
69
,
235
,
/* 320 */
236
,
118
,
124
,
127
,
117
,
531
,
462
,
197
,
316
,
465
,
/* 330 */
121
,
464
,
469
,
463
,
260
,
507
,
75
,
425
,
238
,
433
,
/* 340 */
432
,
435
,
444
,
213
,
437
,
312
,
436
,
434
,
35
,
469
,
/* 350 */
365
,
80
,
188
,
186
,
184
,
35
,
35
,
244
,
245
,
183
,
/* 360 */
132
,
131
,
130
,
353
,
35
,
35
,
5
,
38
,
169
,
181
,
/* 370 */
217
,
218
,
35
,
168
,
102
,
97
,
101
,
9
,
197
,
197
,
/* 380 */
686
,
107
,
243
,
106
,
241
,
264
,
308
,
307
,
425
,
425
,
/* 390 */
16
,
311
,
15
,
116
,
426
,
469
,
29
,
152
,
310
,
309
,
/* 400 */
487
,
330
,
469
,
469
,
25
,
179
,
394
,
230
,
229
,
152
,
/* 410 */
287
,
469
,
469
,
391
,
285
,
221
,
65
,
64
,
506
,
469
,
/* 420 */
93
,
387
,
370
,
65
,
36
,
371
,
1
,
167
,
367
,
262
,
/* 430 */
90
,
36
,
26
,
340
,
508
,
65
,
461
,
460
,
147
,
36
,
/* 440 */
505
,
422
,
35
,
488
,
78
,
362
,
179
,
362
,
179
,
432
,
/* 450 */
435
,
248
,
355
,
504
,
233
,
231
,
434
,
503
,
392
,
392
,
/* 460 */
225
,
223
,
298
,
222
,
392
,
197
,
219
,
344
,
502
,
89
,
/* 470 */
501
,
500
,
490
,
486
,
485
,
424
,
484
,
483
,
482
,
481
,
/* 480 */
480
,
375
,
479
,
36
,
475
,
473
,
472
,
111
,
470
,
476
,
/* 490 */
304
,
109
,
67
,
105
,
103
,
66
,
8
,
447
,
430
,
7
,
/* 500 */
100
,
297
,
303
,
421
,
420
,
419
,
418
,
417
,
416
,
96
,
/* 510 */
94
,
28
,
12
,
415
,
286
,
284
,
27
,
13
,
357
,
32
,
/* 520 */
11
,
31
,
151
,
226
,
372
,
276
,
87
,
82
,
369
,
86
,
/* 530 */
149
,
368
,
366
,
148
,
259
,
85
,
30
,
264
,
363
,
10
,
/* 540 */
349
,
255
,
348
,
254
,
252
,
266
,
251
,
347
,
351
,
142
,
/* 550 */
4
,
530
,
350
,
529
,
509
,
136
,
2
,
524
,
489
,
135
,
/* 560 */
522
,
327
,
134
,
133
,
341
,
515
,
178
,
331
,
329
,
510
,
/* 570 */
173
,
328
,
177
,
326
,
325
,
176
,
324
,
174
,
175
,
323
,
/* 580 */
99
,
115
,
212
,
172
,
211
,
477
,
289
,
298
,
234
,
98
,
/* 590 */
270
,
214
,
161
,
157
,
155
,
162
,
46
,
70
,
278
,
377
,
/* 600 */
836
,
271
,
272
,
84
,
399
,
159
,
380
,
79
,
273
,
263
,
/* 610 */
836
,
836
,
190
,
836
,
275
,
533
,
277
,
189
,
279
,
528
,
/* 620 */
527
,
283
,
160
,
526
,
281
,
158
,
836
,
47
,
156
,
73
,
/* 630 */
373
,
154
,
525
,
836
,
187
,
153
,
836
,
385
,
836
,
386
,
/* 640 */
836
,
836
,
265
,
836
,
836
,
163
,
224
,
269
,
836
,
361
,
/* 650 */
836
,
836
,
836
,
836
,
836
,
836
,
185
,
376
,
836
,
321
,
/* 660 */
836
,
836
,
836
,
836
,
836
,
836
,
228
,
836
,
45
,
836
,
/* 670 */
836
,
836
,
836
,
384
,
193
,
836
,
836
,
836
,
836
,
330
,
/* 680 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 690 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 700 */
521
,
836
,
520
,
519
,
518
,
836
,
517
,
516
,
182
,
250
,
/* 710 */
514
,
513
,
123
,
122
,
512
,
120
,
836
,
511
,
192
,
44
,
/* 720 */
836
,
37
,
40
,
478
,
171
,
468
,
467
,
110
,
466
,
836
,
/* 730 */
836
,
836
,
313
,
836
,
170
,
454
,
836
,
453
,
104
,
452
,
/* 740 */
306
,
423
,
299
,
836
,
39
,
191
,
43
,
290
,
398
,
166
,
/* 750 */
165
,
390
,
164
,
274
,
150
,
146
,
364
,
360
,
359
,
358
,
/* 760 */
356
,
144
,
258
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 770 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 780 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 790 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 800 */
836
,
383
,
227
,
382
,
381
,
836
,
836
,
836
,
836
,
836
,
/* 810 */
836
,
836
,
836
,
836
,
836
,
455
,
451
,
393
,
836
,
836
,
/* 820 */
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
836
,
/* 830 */
836
,
836
,
836
,
836
,
836
,
207
,
210
,
209
,
208
,
203
,
/* 840 */
202
,
196
,
201
,
199
,
198
,
216
,
215
,
429
,
428
,
427
,
/* 850 */
200
,
195
,
194
,
23
,
};
static
const
YYCODETYPE
yy_lookahead
[]
=
{
/* 0 */
1
,
33
,
34
,
76
,
77
,
37
,
38
,
39
,
9
,
62
,
/* 10 */
63
,
64
,
13
,
14
,
105
,
16
,
17
,
108
,
0
,
20
,
/* 20 */
21
,
59
,
23
,
24
,
25
,
26
,
27
,
28
,
65
,
66
,
/* 30 */
67
,
60
,
33
,
34
,
190
,
191
,
37
,
38
,
39
,
13
,
/* 40 */
14
,
37
,
16
,
17
,
198
,
88
,
20
,
21
,
202
,
23
,
/* 50 */
24
,
25
,
26
,
27
,
28
,
193
,
5
,
105
,
7
,
33
,
/* 60 */
34
,
109
,
110
,
37
,
38
,
39
,
13
,
14
,
68
,
16
,
/* 70 */
17
,
88
,
193
,
20
,
21
,
136
,
23
,
24
,
25
,
26
,
/* 80 */
27
,
28
,
238
,
5
,
145
,
146
,
33
,
34
,
131
,
106
,
/* 90 */
37
,
38
,
39
,
13
,
14
,
193
,
16
,
17
,
254
,
193
,
/* 100 */
20
,
21
,
1
,
23
,
24
,
25
,
26
,
27
,
28
,
110
,
/* 110 */
9
,
33
,
34
,
33
,
34
,
88
,
237
,
37
,
38
,
39
,
/* 120 */
116
,
88
,
25
,
26
,
27
,
28
,
264
,
139
,
266
,
141
,
/* 130 */
33
,
34
,
106
,
106
,
37
,
38
,
39
,
235
,
138
,
106
,
/* 140 */
140
,
239
,
142
,
143
,
199
,
88
,
45
,
46
,
47
,
48
,
/* 150 */
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
/* 160 */
88
,
14
,
61
,
16
,
17
,
259
,
260
,
20
,
21
,
118
,
/* 170 */
23
,
24
,
25
,
26
,
27
,
28
,
231
,
232
,
233
,
234
,
/* 180 */
33
,
34
,
68
,
60
,
37
,
38
,
39
,
16
,
17
,
117
,
/* 190 */
133
,
20
,
21
,
80
,
23
,
24
,
25
,
26
,
27
,
28
,
/* 200 */
37
,
38
,
39
,
193
,
33
,
34
,
200
,
201
,
37
,
38
,
/* 210 */
39
,
213
,
214
,
215
,
216
,
217
,
218
,
219
,
220
,
221
,
/* 220 */
222
,
223
,
224
,
225
,
226
,
227
,
1
,
2
,
105
,
5
,
/* 230 */
5
,
7
,
7
,
193
,
9
,
126
,
127
,
89
,
90
,
91
,
/* 240 */
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
,
100
,
101
,
/* 250 */
102
,
103
,
138
,
44
,
140
,
88
,
142
,
143
,
33
,
34
,
/* 260 */
1
,
2
,
37
,
88
,
5
,
105
,
7
,
107
,
9
,
139
,
/* 270 */
61
,
141
,
262
,
106
,
264
,
235
,
139
,
68
,
141
,
239
,
/* 280 */
106
,
193
,
73
,
74
,
75
,
88
,
21
,
213
,
114
,
215
,
/* 290 */
216
,
198
,
33
,
34
,
220
,
202
,
222
,
223
,
224
,
193
,
/* 300 */
226
,
227
,
89
,
106
,
91
,
92
,
5
,
257
,
7
,
96
,
/* 310 */
15
,
98
,
99
,
100
,
105
,
102
,
103
,
267
,
268
,
5
,
/* 320 */
1
,
7
,
113
,
235
,
62
,
63
,
64
,
239
,
257
,
21
,
/* 330 */
105
,
69
,
70
,
71
,
72
,
5
,
111
,
112
,
267
,
268
,
/* 340 */
78
,
235
,
118
,
118
,
135
,
239
,
137
,
2
,
193
,
193
,
/* 350 */
5
,
193
,
7
,
144
,
9
,
88
,
37
,
193
,
193
,
62
,
/* 360 */
63
,
64
,
0
,
193
,
105
,
193
,
69
,
70
,
71
,
72
,
/* 370 */
111
,
112
,
1
,
106
,
62
,
63
,
64
,
118
,
33
,
34
,
/* 380 */
9
,
69
,
70
,
71
,
72
,
139
,
139
,
141
,
141
,
199
,
/* 390 */
235
,
235
,
88
,
235
,
239
,
239
,
139
,
239
,
141
,
235
,
/* 400 */
235
,
88
,
199
,
239
,
239
,
235
,
111
,
235
,
88
,
239
,
/* 410 */
106
,
239
,
88
,
106
,
88
,
1
,
105
,
196
,
197
,
106
,
/* 420 */
241
,
114
,
232
,
9
,
113
,
198
,
106
,
211
,
212
,
202
,
/* 430 */
106
,
76
,
106
,
193
,
255
,
193
,
81
,
234
,
193
,
238
,
/* 440 */
236
,
79
,
193
,
238
,
240
,
193
,
236
,
236
,
5
,
257
,
/* 450 */
240
,
240
,
192
,
193
,
5
,
254
,
111
,
112
,
5
,
254
,
/* 460 */
268
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
/* 470 */
5
,
229
,
5
,
5
,
5
,
88
,
105
,
5
,
106
,
239
,
/* 480 */
5
,
141
,
141
,
141
,
141
,
76
,
16
,
16
,
15
,
5
,
/* 490 */
80
,
5
,
5
,
5
,
5
,
76
,
105
,
109
,
108
,
9
,
/* 500 */
105
,
108
,
105
,
111
,
105
,
125
,
106
,
125
,
88
,
264
,
/* 510 */
258
,
88
,
105
,
264
,
106
,
1
,
105
,
105
,
88
,
106
,
/* 520 */
105
,
88
,
106
,
105
,
88
,
136
,
91
,
106
,
106
,
105
,
/* 530 */
105
,
90
,
115
,
5
,
5
,
5
,
5
,
5
,
200
,
60
,
/* 540 */
114
,
147
,
196
,
147
,
194
,
194
,
212
,
195
,
194
,
5
,
/* 550 */
228
,
195
,
194
,
79
,
195
,
195
,
104
,
194
,
82
,
206
,
/* 560 */
203
,
84
,
54
,
85
,
83
,
50
,
205
,
87
,
86
,
204
,
/* 570 */
194
,
207
,
194
,
199
,
208
,
79
,
209
,
228
,
210
,
194
,
/* 580 */
199
,
134
,
243
,
246
,
248
,
119
,
251
,
132
,
244
,
261
,
/* 590 */
261
,
269
,
194
,
245
,
247
,
194
,
194
,
194
,
194
,
194
,
/* 600 */
194
,
269
,
269
,
120
,
269
,
269
,
121
,
269
,
269
,
269
,
/* 610 */
269
,
269
,
269
,
122
,
269
,
123
,
118
,
269
,
249
,
124
,
/* 620 */
250
,
128
,
193
,
129
,
193
,
252
,
242
,
130
,
253
,
269
,
/* 630 */
193
,
193
,
193
,
193
,
269
,
193
,
269
,
193
,
261
,
193
,
/* 640 */
261
,
193
,
269
,
193
,
193
,
269
,
269
,
193
,
265
,
269
,
/* 650 */
269
,
265
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 660 */
269
,
269
,
269
,
269
,
269
,
238
,
238
,
81
,
269
,
269
,
/* 670 */
238
,
269
,
269
,
269
,
269
,
230
,
269
,
269
,
269
,
269
,
/* 680 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 690 */
256
,
269
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
/* 700 */
193
,
269
,
193
,
193
,
193
,
193
,
193
,
269
,
269
,
193
,
/* 710 */
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
/* 720 */
193
,
269
,
269
,
269
,
269
,
269
,
193
,
193
,
193
,
193
,
/* 730 */
193
,
193
,
193
,
193
,
193
,
193
,
193
,
269
,
193
,
193
,
/* 740 */
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
193
,
/* 750 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 760 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 770 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 780 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
230
,
230
,
230
,
/* 790 */
230
,
230
,
230
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 800 */
269
,
269
,
269
,
240
,
240
,
240
,
269
,
269
,
269
,
269
,
/* 810 */
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
269
,
/* 820 */
269
,
269
,
269
,
257
,
257
,
257
,
257
,
257
,
257
,
257
,
/* 830 */
257
,
257
,
257
,
257
,
257
,
257
,
257
,
257
,
257
,
257
,
/* 840 */
257
,
257
,
257
,
/* 10 */
63
,
64
,
13
,
14
,
80
,
16
,
17
,
127
,
128
,
20
,
/* 20 */
21
,
81
,
23
,
24
,
25
,
26
,
27
,
28
,
65
,
66
,
/* 30 */
67
,
91
,
33
,
34
,
191
,
192
,
37
,
38
,
39
,
13
,
/* 40 */
14
,
0
,
16
,
17
,
110
,
111
,
20
,
21
,
60
,
23
,
/* 50 */
24
,
25
,
26
,
27
,
28
,
5
,
91
,
7
,
194
,
33
,
/* 60 */
34
,
194
,
137
,
37
,
38
,
39
,
13
,
14
,
80
,
16
,
/* 70 */
17
,
146
,
147
,
20
,
21
,
80
,
23
,
24
,
25
,
26
,
/* 80 */
27
,
28
,
140
,
240
,
142
,
201
,
33
,
34
,
1
,
201
,
/* 90 */
37
,
38
,
39
,
37
,
38
,
39
,
9
,
132
,
5
,
256
,
/* 100 */
7
,
13
,
14
,
108
,
16
,
17
,
239
,
81
,
20
,
21
,
/* 110 */
111
,
23
,
24
,
25
,
26
,
27
,
28
,
233
,
234
,
235
,
/* 120 */
236
,
33
,
34
,
5
,
236
,
37
,
38
,
39
,
264
,
140
,
/* 130 */
266
,
142
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
/* 140 */
53
,
54
,
55
,
56
,
57
,
58
,
194
,
14
,
61
,
16
,
/* 150 */
17
,
33
,
34
,
20
,
21
,
59
,
23
,
24
,
25
,
26
,
/* 160 */
27
,
28
,
60
,
80
,
194
,
68
,
33
,
34
,
1
,
119
,
/* 170 */
37
,
38
,
39
,
16
,
17
,
194
,
9
,
20
,
21
,
81
,
/* 180 */
23
,
24
,
25
,
26
,
27
,
28
,
140
,
15
,
142
,
237
,
/* 190 */
33
,
34
,
109
,
241
,
37
,
38
,
39
,
215
,
216
,
217
,
/* 200 */
218
,
219
,
220
,
221
,
222
,
223
,
224
,
225
,
226
,
227
,
/* 210 */
228
,
229
,
119
,
115
,
92
,
93
,
94
,
95
,
96
,
97
,
/* 220 */
98
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
106
,
1
,
/* 230 */
2
,
261
,
262
,
5
,
1
,
7
,
139
,
9
,
141
,
83
,
/* 240 */
143
,
144
,
44
,
25
,
26
,
27
,
28
,
266
,
194
,
268
,
/* 250 */
21
,
33
,
34
,
80
,
194
,
37
,
38
,
39
,
5
,
61
,
/* 260 */
7
,
33
,
34
,
197
,
198
,
37
,
68
,
5
,
200
,
7
,
/* 270 */
37
,
73
,
74
,
75
,
140
,
91
,
142
,
79
,
80
,
215
,
/* 280 */
201
,
217
,
218
,
37
,
112
,
194
,
222
,
114
,
224
,
225
,
/* 290 */
226
,
237
,
228
,
229
,
81
,
241
,
92
,
237
,
94
,
95
,
/* 300 */
21
,
241
,
194
,
99
,
91
,
101
,
102
,
103
,
80
,
105
,
/* 310 */
106
,
68
,
114
,
234
,
62
,
63
,
64
,
1
,
134
,
200
,
/* 320 */
200
,
69
,
70
,
71
,
72
,
9
,
2
,
259
,
237
,
5
,
/* 330 */
78
,
7
,
241
,
9
,
136
,
5
,
138
,
269
,
1
,
2
,
/* 340 */
112
,
113
,
5
,
145
,
7
,
237
,
9
,
119
,
194
,
241
,
/* 350 */
91
,
81
,
62
,
63
,
64
,
194
,
194
,
33
,
34
,
69
,
/* 360 */
70
,
71
,
72
,
117
,
194
,
194
,
62
,
63
,
64
,
91
,
/* 370 */
33
,
34
,
194
,
69
,
70
,
71
,
72
,
118
,
259
,
259
,
/* 380 */
0
,
140
,
139
,
142
,
141
,
115
,
143
,
144
,
269
,
269
,
/* 390 */
140
,
237
,
142
,
76
,
81
,
241
,
80
,
194
,
237
,
237
,
/* 400 */
199
,
84
,
241
,
241
,
91
,
204
,
81
,
237
,
237
,
194
,
/* 410 */
81
,
241
,
241
,
81
,
81
,
237
,
91
,
80
,
5
,
241
,
/* 420 */
91
,
81
,
81
,
91
,
91
,
81
,
202
,
203
,
81
,
81
,
/* 430 */
243
,
91
,
91
,
213
,
214
,
91
,
112
,
113
,
91
,
91
,
/* 440 */
5
,
199
,
194
,
199
,
257
,
240
,
204
,
240
,
204
,
112
,
/* 450 */
113
,
194
,
194
,
5
,
238
,
238
,
119
,
5
,
242
,
242
,
/* 460 */
238
,
256
,
82
,
256
,
242
,
259
,
193
,
194
,
5
,
266
,
/* 470 */
5
,
5
,
5
,
5
,
5
,
269
,
5
,
5
,
5
,
5
,
/* 480 */
5
,
266
,
5
,
91
,
81
,
5
,
5
,
142
,
231
,
241
,
/* 490 */
58
,
142
,
16
,
142
,
142
,
16
,
80
,
112
,
81
,
80
,
/* 500 */
76
,
15
,
24
,
83
,
5
,
5
,
5
,
5
,
5
,
76
,
/* 510 */
110
,
80
,
126
,
9
,
109
,
109
,
80
,
80
,
260
,
91
,
/* 520 */
126
,
91
,
80
,
1
,
81
,
80
,
80
,
116
,
81
,
80
,
/* 530 */
91
,
81
,
81
,
80
,
137
,
91
,
80
,
115
,
81
,
80
,
/* 540 */
5
,
5
,
5
,
148
,
5
,
91
,
148
,
5
,
93
,
60
,
/* 550 */
197
,
195
,
94
,
195
,
5
,
196
,
202
,
195
,
230
,
196
,
/* 560 */
195
,
54
,
196
,
196
,
82
,
195
,
205
,
107
,
85
,
214
,
/* 570 */
210
,
87
,
208
,
88
,
86
,
207
,
50
,
206
,
209
,
89
,
/* 580 */
201
,
90
,
195
,
211
,
195
,
212
,
195
,
82
,
195
,
201
,
/* 590 */
120
,
195
,
246
,
250
,
252
,
245
,
135
,
133
,
263
,
195
,
/* 600 */
270
,
263
,
195
,
195
,
230
,
248
,
267
,
195
,
121
,
195
,
/* 610 */
270
,
270
,
194
,
270
,
122
,
194
,
123
,
194
,
124
,
194
,
/* 620 */
194
,
125
,
247
,
194
,
129
,
249
,
270
,
130
,
251
,
131
,
/* 630 */
119
,
253
,
194
,
270
,
194
,
254
,
270
,
255
,
270
,
240
,
/* 640 */
270
,
270
,
240
,
270
,
270
,
244
,
263
,
263
,
270
,
240
,
/* 650 */
270
,
270
,
270
,
270
,
270
,
270
,
194
,
267
,
270
,
232
,
/* 660 */
270
,
270
,
270
,
270
,
270
,
270
,
232
,
270
,
258
,
270
,
/* 670 */
270
,
270
,
270
,
232
,
259
,
270
,
270
,
270
,
270
,
84
,
/* 680 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 690 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 700 */
194
,
270
,
194
,
194
,
194
,
270
,
194
,
194
,
194
,
194
,
/* 710 */
194
,
194
,
194
,
194
,
194
,
194
,
270
,
194
,
194
,
194
,
/* 720 */
270
,
194
,
194
,
194
,
194
,
194
,
194
,
194
,
194
,
270
,
/* 730 */
270
,
270
,
194
,
270
,
194
,
194
,
270
,
194
,
194
,
194
,
/* 740 */
194
,
194
,
194
,
270
,
194
,
194
,
194
,
194
,
194
,
194
,
/* 750 */
194
,
194
,
194
,
194
,
194
,
194
,
194
,
194
,
194
,
194
,
/* 760 */
194
,
194
,
194
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 770 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 780 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 790 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 800 */
270
,
232
,
232
,
232
,
232
,
270
,
270
,
270
,
270
,
270
,
/* 810 */
270
,
270
,
270
,
270
,
270
,
242
,
242
,
242
,
270
,
270
,
/* 820 */
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
270
,
/* 830 */
270
,
270
,
270
,
270
,
270
,
259
,
259
,
259
,
259
,
259
,
/* 840 */
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
/* 850 */
259
,
259
,
259
,
259
,
};
#define YY_SHIFT_USE_DFLT (-
92
)
#define YY_SHIFT_COUNT (34
1
)
#define YY_SHIFT_MIN (-
91
)
#define YY_SHIFT_MAX (5
86
)
#define YY_SHIFT_USE_DFLT (-
111
)
#define YY_SHIFT_COUNT (34
6
)
#define YY_SHIFT_MIN (-
110
)
#define YY_SHIFT_MAX (5
95
)
static
const
short
yy_shift_ofst
[]
=
{
/* 0 */
209
,
148
,
148
,
213
,
213
,
496
,
225
,
259
,
371
,
414
,
/* 10 */
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 20 */
414
,
414
,
-
1
,
101
,
259
,
345
,
345
,
345
,
311
,
311
,
/* 30 */
414
,
414
,
414
,
362
,
414
,
414
,
355
,
496
,
586
,
586
,
/* 40 */
5
44
,
-
92
,
-
92
,
-
92
,
259
,
259
,
259
,
259
,
259
,
259
,
/* 50 */
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
259
,
/* 60 */
259
,
259
,
259
,
259
,
345
,
345
,
345
,
78
,
78
,
7
8
,
/* 70 */
78
,
78
,
78
,
78
,
414
,
414
,
414
,
4
,
414
,
414
,
/* 80 */
414
,
311
,
311
,
414
,
414
,
414
,
414
,
109
,
109
,
72
,
/* 90 */
311
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 100 */
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 110 */
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 120 */
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 130 */
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
414
,
/* 140 */
414
,
414
,
414
,
479
,
479
,
479
,
498
,
498
,
498
,
479
,
/* 150 */
4
98
,
479
,
497
,
455
,
494
,
495
,
493
,
492
,
491
,
485
,
/* 160 */
4
83
,
466
,
447
,
479
,
479
,
479
,
452
,
496
,
496
,
479
,
/* 170 */
4
79
,
480
,
482
,
515
,
481
,
478
,
508
,
477
,
476
,
452
,
/* 180 */
544
,
479
,
474
,
474
,
479
,
474
,
479
,
474
,
479
,
47
9
,
/* 190 */
-
92
,
-
92
,
26
,
53
,
80
,
53
,
53
,
147
,
171
,
9
7
,
/* 200 */
97
,
97
,
97
,
262
,
312
,
297
,
-
32
,
-
32
,
-
32
,
-
32
,
/* 210 */
114
,
0
,
-
61
,
163
,
163
,
224
,
51
,
-
48
,
-
37
,
-
53
,
/* 220 */
326
,
307
,
174
,
324
,
320
,
313
,
304
,
267
,
319
,
123
,
/* 230 */
295
,
57
,
-
43
,
197
,
167
,
33
,
27
,
-
17
,
-
91
,
257
,
/* 240 */
247
,
246
,
314
,
301
,
137
,
130
,
160
,
-
12
,
-
73
,
532
,
/* 250 */
396
,
531
,
530
,
394
,
529
,
528
,
435
,
441
,
389
,
426
,
/* 260 */
39
3
,
425
,
417
,
422
,
424
,
436
,
433
,
421
,
418
,
416
,
/* 270 */
4
30
,
415
,
413
,
412
,
514
,
411
,
408
,
407
,
423
,
38
2
,
/* 280 */
4
20
,
380
,
400
,
399
,
392
,
397
,
393
,
395
,
390
,
391
,
/* 290 */
388
,
419
,
490
,
489
,
488
,
487
,
486
,
484
,
410
,
473
,
/* 300 */
4
09
,
471
,
343
,
342
,
387
,
387
,
387
,
387
,
470
,
341
,
/* 310 */
3
40
,
387
,
387
,
387
,
475
,
472
,
372
,
387
,
469
,
468
,
/* 320 */
4
67
,
465
,
464
,
463
,
462
,
461
,
460
,
459
,
458
,
457
,
/* 330 */
4
56
,
453
,
449
,
443
,
330
,
175
,
113
,
308
,
265
,
-
29
,
/* 340 */
-
38
,
18
,
/* 0 */
198
,
122
,
122
,
204
,
204
,
505
,
228
,
337
,
337
,
316
,
/* 10 */
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 20 */
167
,
167
,
167
,
-
1
,
87
,
337
,
324
,
324
,
324
,
173
,
/* 30 */
173
,
167
,
167
,
167
,
380
,
167
,
167
,
317
,
505
,
595
,
/* 40 */
5
95
,
549
,
-
111
,
-
111
,
-
111
,
337
,
337
,
337
,
337
,
337
,
/* 50 */
337
,
337
,
337
,
337
,
337
,
337
,
337
,
337
,
337
,
337
,
/* 60 */
337
,
337
,
337
,
337
,
337
,
324
,
324
,
324
,
118
,
11
8
,
/* 70 */
118
,
118
,
118
,
118
,
118
,
167
,
167
,
167
,
246
,
167
,
/* 80 */
167
,
167
,
173
,
173
,
167
,
167
,
167
,
167
,
-
110
,
-
110
,
/* 90 */
259
,
173
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 100 */
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 110 */
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 120 */
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 130 */
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
167
,
/* 140 */
167
,
167
,
167
,
167
,
489
,
489
,
489
,
511
,
511
,
511
,
/* 150 */
4
89
,
511
,
489
,
498
,
464
,
497
,
496
,
495
,
494
,
493
,
/* 160 */
4
92
,
487
,
470
,
461
,
489
,
489
,
489
,
460
,
505
,
505
,
/* 170 */
4
89
,
489
,
491
,
490
,
526
,
488
,
485
,
507
,
484
,
483
,
/* 180 */
460
,
549
,
489
,
482
,
482
,
489
,
482
,
489
,
482
,
48
9
,
/* 190 */
489
,
-
111
,
-
111
,
26
,
53
,
53
,
88
,
53
,
133
,
15
7
,
/* 200 */
218
,
218
,
218
,
218
,
252
,
304
,
290
,
-
32
,
-
32
,
-
32
,
/* 210 */
-
32
,
243
,
97
,
-
75
,
-
66
,
56
,
56
,
93
,
50
,
-
37
,
/* 220 */
-
53
,
348
,
270
,
98
,
347
,
344
,
341
,
184
,
-
35
,
340
,
/* 230 */
333
,
332
,
329
,
325
,
83
,
313
,
213
,
233
,
-
12
,
172
,
/* 240 */
-
60
,
250
,
241
,
134
,
262
,
253
,
46
,
-
11
,
-
5
,
-
58
,
/* 250 */
-
73
,
542
,
398
,
539
,
537
,
395
,
536
,
535
,
458
,
455
,
/* 260 */
39
7
,
422
,
406
,
459
,
411
,
457
,
456
,
454
,
444
,
451
,
/* 270 */
4
53
,
450
,
439
,
449
,
447
,
446
,
522
,
445
,
443
,
44
2
,
/* 280 */
4
30
,
394
,
428
,
386
,
437
,
406
,
436
,
405
,
431
,
400
,
/* 290 */
433
,
504
,
503
,
502
,
501
,
500
,
499
,
420
,
486
,
424
,
/* 300 */
4
19
,
417
,
385
,
416
,
478
,
432
,
479
,
352
,
351
,
392
,
/* 310 */
3
92
,
392
,
392
,
476
,
349
,
345
,
392
,
392
,
392
,
481
,
/* 320 */
4
80
,
403
,
392
,
477
,
475
,
474
,
473
,
472
,
471
,
469
,
/* 330 */
4
68
,
467
,
466
,
465
,
463
,
452
,
448
,
435
,
413
,
330
,
/* 340 */
278
,
156
,
279
,
229
,
102
,
96
,
41
,
};
#define YY_REDUCE_USE_DFLT (-15
7
)
#define YY_REDUCE_COUNT (19
1
)
#define YY_REDUCE_MIN (-15
6
)
#define YY_REDUCE_MAX (5
85
)
#define YY_REDUCE_USE_DFLT (-15
8
)
#define YY_REDUCE_COUNT (19
2
)
#define YY_REDUCE_MIN (-15
7
)
#define YY_REDUCE_MAX (5
94
)
static
const
short
yy_reduce_ofst
[]
=
{
/* 0 */
-
15
6
,
-
2
,
-
2
,
74
,
74
,
-
55
,
71
,
50
,
-
94
,
172
,
/* 10 */
-
138
,
10
,
170
,
165
,
164
,
158
,
156
,
155
,
106
,
88
,
/* 20 */
40
,
-
98
,
252
,
260
,
192
,
211
,
210
,
204
,
205
,
201
,
/* 30 */
2
49
,
245
,
-
121
,
203
,
242
,
240
,
227
,
190
,
93
,
-
154
,
/* 40 */
2
16
,
179
,
6
,
221
,
585
,
584
,
583
,
582
,
581
,
58
0
,
/* 50 */
5
79
,
578
,
577
,
576
,
575
,
574
,
573
,
572
,
571
,
57
0
,
/* 60 */
5
69
,
568
,
567
,
566
,
565
,
564
,
563
,
562
,
561
,
560
,
/* 70 */
5
59
,
558
,
557
,
445
,
556
,
555
,
554
,
434
,
553
,
552
,
/* 80 */
5
51
,
432
,
428
,
550
,
549
,
548
,
547
,
386
,
383
,
384
,
/* 90 */
4
27
,
546
,
545
,
543
,
542
,
541
,
540
,
539
,
538
,
537
,
/* 100 */
5
36
,
535
,
534
,
533
,
527
,
526
,
525
,
524
,
523
,
522
,
/* 110 */
5
21
,
520
,
519
,
518
,
517
,
516
,
513
,
512
,
511
,
510
,
/* 120 */
5
09
,
507
,
506
,
505
,
504
,
503
,
502
,
501
,
500
,
499
,
/* 130 */
454
,
451
,
450
,
448
,
446
,
444
,
442
,
440
,
439
,
438
,
/* 140 */
4
37
,
431
,
429
,
406
,
405
,
404
,
379
,
377
,
329
,
403
,
/* 150 */
328
,
402
,
375
,
373
,
335
,
370
,
369
,
336
,
347
,
337
,
/* 160 */
3
48
,
344
,
339
,
401
,
398
,
385
,
349
,
381
,
374
,
378
,
/* 170 */
3
76
,
368
,
367
,
366
,
365
,
364
,
361
,
353
,
357
,
322
,
/* 180 */
3
34
,
363
,
360
,
359
,
358
,
356
,
354
,
352
,
351
,
350
,
/* 190 */
3
38
,
346
,
/* 0 */
-
15
7
,
-
18
,
-
18
,
64
,
64
,
-
116
,
120
,
119
,
68
,
-
30
,
/* 10 */
178
,
-
19
,
-
136
,
171
,
170
,
162
,
161
,
154
,
108
,
91
,
/* 20 */
60
,
54
,
-
48
,
258
,
273
,
206
,
222
,
217
,
216
,
207
,
/* 30 */
2
05
,
215
,
203
,
-
133
,
-
112
,
257
,
248
,
244
,
79
,
242
,
/* 40 */
2
01
,
220
,
187
,
224
,
66
,
594
,
593
,
592
,
591
,
59
0
,
/* 50 */
5
89
,
588
,
587
,
586
,
585
,
584
,
583
,
582
,
581
,
58
0
,
/* 60 */
5
79
,
578
,
577
,
576
,
415
,
575
,
574
,
573
,
572
,
571
,
/* 70 */
5
70
,
569
,
441
,
434
,
427
,
568
,
567
,
566
,
410
,
565
,
/* 80 */
5
64
,
563
,
409
,
402
,
562
,
561
,
560
,
559
,
390
,
339
,
/* 90 */
4
01
,
399
,
558
,
557
,
556
,
555
,
554
,
553
,
552
,
551
,
/* 100 */
5
50
,
548
,
547
,
546
,
545
,
544
,
543
,
541
,
540
,
538
,
/* 110 */
5
34
,
533
,
532
,
531
,
530
,
529
,
528
,
527
,
525
,
524
,
/* 120 */
5
23
,
521
,
520
,
519
,
518
,
517
,
516
,
515
,
514
,
513
,
/* 130 */
512
,
510
,
509
,
508
,
506
,
462
,
440
,
438
,
429
,
426
,
/* 140 */
4
25
,
423
,
421
,
418
,
414
,
412
,
408
,
384
,
383
,
338
,
/* 150 */
407
,
335
,
404
,
382
,
381
,
378
,
342
,
377
,
343
,
376
,
/* 160 */
3
57
,
375
,
346
,
350
,
396
,
393
,
391
,
374
,
388
,
379
,
/* 170 */
3
89
,
387
,
373
,
372
,
360
,
371
,
369
,
368
,
364
,
361
,
/* 180 */
3
28
,
355
,
370
,
367
,
366
,
365
,
363
,
362
,
359
,
358
,
/* 190 */
3
56
,
354
,
353
,
};
static
const
YYACTIONTYPE
yy_default
[]
=
{
/* 0 */
8
27
,
656
,
599
,
668
,
587
,
596
,
805
,
805
,
827
,
827
,
/* 10 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 20 */
8
27
,
827
,
716
,
559
,
805
,
827
,
827
,
827
,
827
,
827
,
/* 30 */
8
27
,
827
,
827
,
596
,
827
,
827
,
602
,
596
,
602
,
602
,
/* 40 */
827
,
711
,
640
,
658
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 50 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 60 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 70 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
718
,
724
,
72
1
,
/* 80 */
827
,
827
,
827
,
726
,
827
,
827
,
827
,
748
,
748
,
709
,
/* 90 */
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 100 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 110 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
585
,
/* 120 */
827
,
583
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 130 */
8
27
,
827
,
827
,
827
,
827
,
827
,
570
,
827
,
827
,
827
,
/* 140 */
8
27
,
827
,
827
,
561
,
561
,
561
,
827
,
827
,
827
,
561
,
/* 150 */
827
,
561
,
755
,
759
,
753
,
741
,
749
,
740
,
736
,
734
,
/* 160 */
7
32
,
731
,
763
,
561
,
561
,
561
,
600
,
596
,
596
,
561
,
/* 170 */
56
1
,
618
,
616
,
614
,
606
,
612
,
608
,
610
,
604
,
588
,
/* 180 */
827
,
561
,
594
,
594
,
561
,
594
,
561
,
594
,
561
,
561
,
/* 190 */
640
,
658
,
827
,
764
,
827
,
804
,
754
,
794
,
793
,
800
,
/* 200 */
792
,
791
,
790
,
827
,
827
,
827
,
786
,
787
,
789
,
788
,
/* 210 */
827
,
827
,
827
,
796
,
795
,
827
,
827
,
827
,
827
,
827
,
/* 220 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
766
,
/* 230 */
8
27
,
760
,
756
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 240 */
8
27
,
827
,
827
,
827
,
827
,
827
,
670
,
827
,
827
,
827
,
/* 250 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
708
,
/* 260 */
8
27
,
827
,
827
,
827
,
827
,
720
,
719
,
827
,
827
,
827
,
/* 270 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
750
,
827
,
/* 280 */
7
42
,
827
,
827
,
827
,
827
,
827
,
682
,
827
,
827
,
827
,
/* 290 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 300 */
8
27
,
827
,
827
,
827
,
823
,
818
,
819
,
816
,
827
,
827
,
/* 310 */
82
7
,
815
,
810
,
811
,
827
,
827
,
827
,
808
,
827
,
827
,
/* 320 */
8
27
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
827
,
/* 330 */
8
27
,
827
,
827
,
827
,
827
,
624
,
827
,
568
,
566
,
827
,
/* 340 */
557
,
827
,
826
,
825
,
824
,
807
,
806
,
678
,
717
,
713
,
/* 350 */
715
,
714
,
712
,
725
,
722
,
723
,
707
,
706
,
705
,
727
,
/* 360 */
7
10
,
730
,
729
,
733
,
735
,
738
,
737
,
739
,
728
,
75
2
,
/* 370 */
7
51
,
744
,
745
,
747
,
746
,
743
,
783
,
802
,
803
,
801
,
/* 380 */
7
99
,
798
,
797
,
782
,
781
,
780
,
777
,
776
,
775
,
772
,
/* 390 */
778
,
774
,
771
,
779
,
773
,
770
,
769
,
768
,
767
,
765
,
/* 400 */
785
,
784
,
762
,
761
,
758
,
757
,
704
,
688
,
683
,
680
,
/* 410 */
6
87
,
686
,
685
,
693
,
692
,
684
,
681
,
677
,
676
,
601
,
/* 420 */
6
57
,
655
,
654
,
653
,
652
,
651
,
650
,
649
,
648
,
647
,
/* 430 */
646
,
645
,
644
,
643
,
642
,
641
,
636
,
632
,
630
,
629
,
/* 440 */
628
,
625
,
595
,
598
,
597
,
822
,
821
,
820
,
817
,
814
,
/* 450 */
703
,
702
,
701
,
700
,
699
,
698
,
697
,
696
,
695
,
694
,
/* 460 */
813
,
812
,
809
,
690
,
691
,
672
,
675
,
674
,
673
,
671
,
/* 470 */
6
89
,
620
,
619
,
617
,
615
,
607
,
613
,
609
,
611
,
605
,
/* 480 */
6
03
,
590
,
589
,
669
,
639
,
667
,
666
,
665
,
664
,
663
,
/* 490 */
6
62
,
661
,
660
,
659
,
638
,
637
,
635
,
634
,
633
,
631
,
/* 500 */
6
27
,
626
,
622
,
623
,
621
,
586
,
584
,
582
,
581
,
58
0
,
/* 510 */
579
,
578
,
577
,
576
,
575
,
574
,
573
,
593
,
572
,
571
,
/* 520 */
5
69
,
567
,
565
,
564
,
563
,
592
,
591
,
562
,
560
,
558
,
/* 530 */
5
56
,
555
,
554
,
553
,
552
,
551
,
550
,
549
,
548
,
547
,
/* 540 */
5
46
,
545
,
544
,
/* 0 */
8
34
,
663
,
606
,
675
,
593
,
603
,
812
,
812
,
812
,
834
,
/* 10 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 20 */
8
34
,
834
,
834
,
723
,
565
,
812
,
834
,
834
,
834
,
834
,
/* 30 */
8
34
,
834
,
834
,
834
,
603
,
834
,
834
,
609
,
603
,
609
,
/* 40 */
609
,
834
,
718
,
647
,
665
,
834
,
834
,
834
,
834
,
834
,
/* 50 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 60 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 70 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
725
,
73
1
,
/* 80 */
728
,
834
,
834
,
834
,
733
,
834
,
834
,
834
,
755
,
755
,
/* 90 */
716
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 100 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 110 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 120 */
591
,
834
,
589
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 130 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
576
,
834
,
834
,
/* 140 */
8
34
,
834
,
834
,
834
,
567
,
567
,
567
,
834
,
834
,
834
,
/* 150 */
567
,
834
,
567
,
762
,
766
,
760
,
748
,
756
,
747
,
743
,
/* 160 */
7
41
,
739
,
738
,
770
,
567
,
567
,
567
,
607
,
603
,
603
,
/* 170 */
56
7
,
567
,
625
,
623
,
621
,
613
,
619
,
615
,
617
,
611
,
/* 180 */
594
,
834
,
567
,
601
,
601
,
567
,
601
,
567
,
601
,
567
,
/* 190 */
567
,
647
,
665
,
834
,
771
,
761
,
834
,
811
,
801
,
800
,
/* 200 */
807
,
799
,
798
,
797
,
834
,
834
,
834
,
793
,
796
,
795
,
/* 210 */
794
,
834
,
834
,
834
,
834
,
803
,
802
,
834
,
834
,
834
,
/* 220 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
767
,
763
,
834
,
/* 230 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
773
,
834
,
/* 240 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
677
,
834
,
/* 250 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 260 */
8
34
,
715
,
834
,
834
,
834
,
834
,
834
,
727
,
726
,
834
,
/* 270 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 280 */
7
57
,
834
,
749
,
834
,
834
,
689
,
834
,
834
,
834
,
834
,
/* 290 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 300 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
830
,
/* 310 */
82
5
,
826
,
823
,
834
,
834
,
834
,
822
,
817
,
818
,
834
,
/* 320 */
8
34
,
834
,
815
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 330 */
8
34
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
834
,
/* 340 */
631
,
834
,
574
,
572
,
834
,
563
,
834
,
833
,
832
,
831
,
/* 350 */
814
,
813
,
685
,
724
,
720
,
722
,
721
,
719
,
732
,
729
,
/* 360 */
7
30
,
714
,
713
,
712
,
734
,
717
,
737
,
736
,
740
,
74
2
,
/* 370 */
7
45
,
744
,
746
,
735
,
759
,
758
,
751
,
752
,
754
,
753
,
/* 380 */
7
50
,
769
,
768
,
765
,
764
,
711
,
695
,
690
,
687
,
694
,
/* 390 */
693
,
692
,
700
,
699
,
691
,
688
,
684
,
683
,
608
,
664
,
/* 400 */
662
,
661
,
660
,
659
,
658
,
657
,
656
,
655
,
654
,
653
,
/* 410 */
6
52
,
651
,
650
,
649
,
648
,
643
,
639
,
637
,
636
,
635
,
/* 420 */
6
32
,
602
,
605
,
604
,
809
,
810
,
808
,
806
,
805
,
804
,
/* 430 */
790
,
789
,
788
,
787
,
784
,
783
,
782
,
779
,
785
,
781
,
/* 440 */
778
,
786
,
780
,
777
,
776
,
775
,
774
,
792
,
791
,
772
,
/* 450 */
597
,
829
,
828
,
827
,
824
,
821
,
710
,
709
,
708
,
707
,
/* 460 */
706
,
705
,
704
,
703
,
702
,
701
,
820
,
819
,
816
,
697
,
/* 470 */
6
98
,
679
,
682
,
681
,
680
,
678
,
696
,
627
,
626
,
624
,
/* 480 */
6
22
,
614
,
620
,
616
,
618
,
612
,
610
,
596
,
595
,
676
,
/* 490 */
6
46
,
674
,
673
,
672
,
671
,
670
,
669
,
668
,
667
,
666
,
/* 500 */
6
45
,
644
,
642
,
641
,
640
,
638
,
634
,
633
,
629
,
63
0
,
/* 510 */
628
,
592
,
590
,
588
,
587
,
586
,
585
,
584
,
583
,
582
,
/* 520 */
5
81
,
580
,
579
,
600
,
578
,
577
,
575
,
573
,
571
,
570
,
/* 530 */
5
69
,
599
,
598
,
568
,
566
,
564
,
562
,
561
,
560
,
559
,
/* 540 */
5
58
,
557
,
556
,
555
,
554
,
553
,
552
,
551
,
550
,
};
/* The next table maps tokens into fallback tokens. If a construct
...
...
@@ -558,6 +560,9 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* PASS => nothing */
0
,
/* PRIVILEGE => nothing */
0
,
/* LOCAL => nothing */
0
,
/* COMPACT => nothing */
0
,
/* LP => nothing */
0
,
/* RP => nothing */
0
,
/* IF => nothing */
0
,
/* EXISTS => nothing */
0
,
/* PPS => nothing */
...
...
@@ -584,8 +589,6 @@ static const YYCODETYPE yyFallback[] = {
0
,
/* UPDATE => nothing */
0
,
/* CACHELAST => nothing */
0
,
/* PARTITIONS => nothing */
0
,
/* LP => nothing */
0
,
/* RP => nothing */
0
,
/* UNSIGNED => nothing */
0
,
/* TAGS => nothing */
0
,
/* USING => nothing */
...
...
@@ -765,55 +768,55 @@ static const char *const yyTokenName[] = {
"DATABASE"
,
"TABLES"
,
"STABLES"
,
"VGROUPS"
,
"DROP"
,
"TOPIC"
,
"DNODE"
,
"USER"
,
"ACCOUNT"
,
"USE"
,
"DESCRIBE"
,
"ALTER"
,
"PASS"
,
"PRIVILEGE"
,
"LOCAL"
,
"
IF"
,
"
EXISTS"
,
"PPS"
,
"TSERIES"
,
"DBS"
,
"
STORAGE"
,
"QTIME"
,
"CONNS"
,
"STATE"
,
"
COMMA"
,
"KEEP"
,
"CACHE"
,
"REPLICA"
,
"
QUORUM"
,
"DAYS"
,
"MINROWS"
,
"MAXROWS"
,
"
BLOCKS"
,
"CTIME"
,
"WAL"
,
"FSYNC"
,
"C
OMP"
,
"PRECISION"
,
"UPDATE"
,
"CACHELAST"
,
"P
ARTITIONS"
,
"LP"
,
"RP"
,
"UNSIGNED"
,
"
TAGS"
,
"USING"
,
"AS"
,
"NULL"
,
"N
OW"
,
"SELECT"
,
"UNION"
,
"ALL"
,
"
DISTINCT"
,
"FROM"
,
"VARIABLE"
,
"INTERVAL
"
,
"
SESSION"
,
"STATE_WINDOW"
,
"FILL"
,
"SLIDING"
,
"
ORDER"
,
"BY"
,
"ASC"
,
"DESC"
,
"
GROUP"
,
"HAVING"
,
"LIMIT"
,
"OFFSET"
,
"
SLIMIT"
,
"SOFFSET"
,
"WHERE"
,
"RESET
"
,
"
QUERY"
,
"SYNCDB"
,
"ADD"
,
"COLUMN"
,
"
MODIFY"
,
"TAG"
,
"CHANGE"
,
"SET"
,
"
KILL"
,
"CONNECTION"
,
"STREAM"
,
"COLON"
,
"
ABORT"
,
"AFTER"
,
"ATTACH"
,
"BEFORE
"
,
"BE
GIN"
,
"CASCADE"
,
"CLUSTER"
,
"CONFLICT"
,
"CO
PY"
,
"DEFERRED"
,
"DELIMITERS"
,
"DETACH"
,
"
EACH"
,
"END"
,
"EXPLAIN"
,
"FAIL"
,
"F
OR"
,
"IGNORE"
,
"IMMEDIATE"
,
"INITIALLY
"
,
"IN
STEAD"
,
"MATCH"
,
"KEY"
,
"OF"
,
"
RAISE"
,
"REPLACE"
,
"RESTRICT"
,
"ROW"
,
"
STATEMENT"
,
"TRIGGER"
,
"VIEW"
,
"SEMI
"
,
"
NONE"
,
"PREV"
,
"LINEAR"
,
"IMPORT
"
,
"
TBNAME"
,
"JOIN"
,
"INSERT"
,
"INTO"
,
"
VALUES"
,
"error"
,
"program"
,
"cmd"
,
"
dbPrefix"
,
"ids"
,
"cpxName"
,
"ifexists"
,
"
alter_db_optr"
,
"alter_topic_optr"
,
"acct_optr"
,
"ifnotexists"
,
"
db_optr"
,
"topic_optr"
,
"pps"
,
"tseries"
,
"
dbs"
,
"streams"
,
"storage"
,
"qtime"
,
"
users"
,
"conns"
,
"state"
,
"intitemlist"
,
"
intitem"
,
"keep"
,
"cache"
,
"replica"
,
"
quorum"
,
"days"
,
"minrows"
,
"maxrows"
,
"
blocks"
,
"ctime"
,
"wal"
,
"fsync
"
,
"
comp"
,
"prec"
,
"update"
,
"cachelast"
,
"
partitions"
,
"typename"
,
"signed"
,
"create_table_args"
,
"
create_stable_args"
,
"create_table_list"
,
"create_from_stable"
,
"columnlist"
,
"
tagitemlist"
,
"tagNamelist"
,
"select"
,
"column"
,
"
tagitem"
,
"selcollist"
,
"from"
,
"where_opt"
,
"
interval_opt"
,
"session_option"
,
"windowstate_option"
,
"fill_opt"
,
"
sliding_opt"
,
"groupby_opt"
,
"orderby_opt"
,
"having_opt"
,
"
slimit_opt"
,
"limit_opt"
,
"union"
,
"sclp"
,
"
distinct"
,
"expr"
,
"as"
,
"tablelist"
,
"
sub"
,
"tmvar"
,
"sortlist"
,
"sortitem"
,
"
item"
,
"sortorder"
,
"grouplist"
,
"exprlist"
,
"expritem"
,
"PASS"
,
"PRIVILEGE"
,
"LOCAL"
,
"
COMPACT"
,
"
LP"
,
"RP"
,
"IF"
,
"EXISTS"
,
"
PPS"
,
"TSERIES"
,
"DBS"
,
"STORAGE"
,
"
QTIME"
,
"CONNS"
,
"STATE"
,
"COMMA"
,
"
KEEP"
,
"CACHE"
,
"REPLICA"
,
"QUORUM"
,
"
DAYS"
,
"MINROWS"
,
"MAXROWS"
,
"BLOCKS"
,
"C
TIME"
,
"WAL"
,
"FSYNC"
,
"COMP"
,
"P
RECISION"
,
"UPDATE"
,
"CACHELAST"
,
"PARTITIONS"
,
"
UNSIGNED"
,
"TAGS"
,
"USING"
,
"AS"
,
"N
ULL"
,
"NOW"
,
"SELECT"
,
"UNION"
,
"
ALL"
,
"DISTINCT"
,
"FROM"
,
"VARIABLE
"
,
"
INTERVAL"
,
"SESSION"
,
"STATE_WINDOW"
,
"FILL"
,
"
SLIDING"
,
"ORDER"
,
"BY"
,
"ASC"
,
"
DESC"
,
"GROUP"
,
"HAVING"
,
"LIMIT"
,
"
OFFSET"
,
"SLIMIT"
,
"SOFFSET"
,
"WHERE
"
,
"
RESET"
,
"QUERY"
,
"SYNCDB"
,
"ADD"
,
"
COLUMN"
,
"MODIFY"
,
"TAG"
,
"CHANGE"
,
"
SET"
,
"KILL"
,
"CONNECTION"
,
"STREAM"
,
"
COLON"
,
"ABORT"
,
"AFTER"
,
"ATTACH
"
,
"BE
FORE"
,
"BEGIN"
,
"CASCADE"
,
"CLUSTER"
,
"CO
NFLICT"
,
"COPY"
,
"DEFERRED"
,
"DELIMITERS"
,
"
DETACH"
,
"EACH"
,
"END"
,
"EXPLAIN"
,
"F
AIL"
,
"FOR"
,
"IGNORE"
,
"IMMEDIATE
"
,
"IN
ITIALLY"
,
"INSTEAD"
,
"MATCH"
,
"KEY"
,
"
OF"
,
"RAISE"
,
"REPLACE"
,
"RESTRICT"
,
"
ROW"
,
"STATEMENT"
,
"TRIGGER"
,
"VIEW
"
,
"
SEMI"
,
"NONE"
,
"PREV"
,
"LINEAR
"
,
"
IMPORT"
,
"TBNAME"
,
"JOIN"
,
"INSERT"
,
"
INTO"
,
"VALUES"
,
"error"
,
"program"
,
"
cmd"
,
"dbPrefix"
,
"ids"
,
"cpxName"
,
"
ifexists"
,
"alter_db_optr"
,
"alter_topic_optr"
,
"acct_optr"
,
"
exprlist"
,
"ifnotexists"
,
"db_optr"
,
"topic_optr"
,
"
pps"
,
"tseries"
,
"dbs"
,
"streams"
,
"
storage"
,
"qtime"
,
"users"
,
"conns"
,
"
state"
,
"intitemlist"
,
"intitem"
,
"keep"
,
"
cache"
,
"replica"
,
"quorum"
,
"days"
,
"
minrows"
,
"maxrows"
,
"blocks"
,
"ctime
"
,
"
wal"
,
"fsync"
,
"comp"
,
"prec"
,
"
update"
,
"cachelast"
,
"partitions"
,
"typename"
,
"
signed"
,
"create_table_args"
,
"create_stable_args"
,
"create_table_list"
,
"
create_from_stable"
,
"columnlist"
,
"tagitemlist"
,
"tagNamelist"
,
"
select"
,
"column"
,
"tagitem"
,
"selcollist"
,
"
from"
,
"where_opt"
,
"interval_opt"
,
"session_option"
,
"
windowstate_option"
,
"fill_opt"
,
"sliding_opt"
,
"groupby_opt"
,
"
orderby_opt"
,
"having_opt"
,
"slimit_opt"
,
"limit_opt"
,
"
union"
,
"sclp"
,
"distinct"
,
"expr"
,
"
as"
,
"tablelist"
,
"sub"
,
"tmvar"
,
"
sortlist"
,
"sortitem"
,
"item"
,
"sortorder"
,
"
grouplist"
,
"
expritem"
,
};
#endif
/* NDEBUG */
...
...
@@ -869,242 +872,243 @@ static const char *const yyRuleName[] = {
/* 45 */
"cmd ::= ALTER TOPIC ids alter_topic_optr"
,
/* 46 */
"cmd ::= ALTER ACCOUNT ids acct_optr"
,
/* 47 */
"cmd ::= ALTER ACCOUNT ids PASS ids acct_optr"
,
/* 48 */
"ids ::= ID"
,
/* 49 */
"ids ::= STRING"
,
/* 50 */
"ifexists ::= IF EXISTS"
,
/* 51 */
"ifexists ::="
,
/* 52 */
"ifnotexists ::= IF NOT EXISTS"
,
/* 53 */
"ifnotexists ::="
,
/* 54 */
"cmd ::= CREATE DNODE ids"
,
/* 55 */
"cmd ::= CREATE ACCOUNT ids PASS ids acct_optr"
,
/* 56 */
"cmd ::= CREATE DATABASE ifnotexists ids db_optr"
,
/* 57 */
"cmd ::= CREATE TOPIC ifnotexists ids topic_optr"
,
/* 58 */
"cmd ::= CREATE USER ids PASS ids"
,
/* 59 */
"pps ::="
,
/* 60 */
"pps ::= PPS INTEGER"
,
/* 61 */
"tseries ::="
,
/* 62 */
"tseries ::= TSERIES INTEGER"
,
/* 63 */
"dbs ::="
,
/* 64 */
"dbs ::= DBS INTEGER"
,
/* 65 */
"streams ::="
,
/* 66 */
"streams ::= STREAMS INTEGER"
,
/* 67 */
"storage ::="
,
/* 68 */
"storage ::= STORAGE INTEGER"
,
/* 69 */
"qtime ::="
,
/* 70 */
"qtime ::= QTIME INTEGER"
,
/* 71 */
"users ::="
,
/* 72 */
"users ::= USERS INTEGER"
,
/* 73 */
"conns ::="
,
/* 74 */
"conns ::= CONNS INTEGER"
,
/* 75 */
"state ::="
,
/* 76 */
"state ::= STATE ids"
,
/* 77 */
"acct_optr ::= pps tseries storage streams qtime dbs users conns state"
,
/* 78 */
"intitemlist ::= intitemlist COMMA intitem"
,
/* 79 */
"intitemlist ::= intitem"
,
/* 80 */
"intitem ::= INTEGER"
,
/* 81 */
"keep ::= KEEP intitemlist"
,
/* 82 */
"cache ::= CACHE INTEGER"
,
/* 83 */
"replica ::= REPLICA INTEGER"
,
/* 84 */
"quorum ::= QUORUM INTEGER"
,
/* 85 */
"days ::= DAYS INTEGER"
,
/* 86 */
"minrows ::= MINROWS INTEGER"
,
/* 87 */
"maxrows ::= MAXROWS INTEGER"
,
/* 88 */
"blocks ::= BLOCKS INTEGER"
,
/* 89 */
"ctime ::= CTIME INTEGER"
,
/* 90 */
"wal ::= WAL INTEGER"
,
/* 91 */
"fsync ::= FSYNC INTEGER"
,
/* 92 */
"comp ::= COMP INTEGER"
,
/* 93 */
"prec ::= PRECISION STRING"
,
/* 94 */
"update ::= UPDATE INTEGER"
,
/* 95 */
"cachelast ::= CACHELAST INTEGER"
,
/* 96 */
"partitions ::= PARTITIONS INTEGER"
,
/* 97 */
"db_optr ::="
,
/* 98 */
"db_optr ::= db_optr cache"
,
/* 99 */
"db_optr ::= db_optr replica"
,
/* 100 */
"db_optr ::= db_optr quorum"
,
/* 101 */
"db_optr ::= db_optr days"
,
/* 102 */
"db_optr ::= db_optr minrows"
,
/* 103 */
"db_optr ::= db_optr maxrows"
,
/* 104 */
"db_optr ::= db_optr blocks"
,
/* 105 */
"db_optr ::= db_optr ctime"
,
/* 106 */
"db_optr ::= db_optr wal"
,
/* 107 */
"db_optr ::= db_optr fsync"
,
/* 108 */
"db_optr ::= db_optr comp"
,
/* 109 */
"db_optr ::= db_optr prec"
,
/* 110 */
"db_optr ::= db_optr keep"
,
/* 111 */
"db_optr ::= db_optr update"
,
/* 112 */
"db_optr ::= db_optr cachelast"
,
/* 113 */
"topic_optr ::= db_optr"
,
/* 114 */
"topic_optr ::= topic_optr partitions"
,
/* 115 */
"alter_db_optr ::="
,
/* 116 */
"alter_db_optr ::= alter_db_optr replica"
,
/* 117 */
"alter_db_optr ::= alter_db_optr quorum"
,
/* 118 */
"alter_db_optr ::= alter_db_optr keep"
,
/* 119 */
"alter_db_optr ::= alter_db_optr blocks"
,
/* 120 */
"alter_db_optr ::= alter_db_optr comp"
,
/* 121 */
"alter_db_optr ::= alter_db_optr wal"
,
/* 122 */
"alter_db_optr ::= alter_db_optr fsync"
,
/* 123 */
"alter_db_optr ::= alter_db_optr update"
,
/* 124 */
"alter_db_optr ::= alter_db_optr cachelast"
,
/* 125 */
"alter_topic_optr ::= alter_db_optr"
,
/* 126 */
"alter_topic_optr ::= alter_topic_optr partitions"
,
/* 127 */
"typename ::= ids"
,
/* 128 */
"typename ::= ids LP signed RP"
,
/* 129 */
"typename ::= ids UNSIGNED"
,
/* 130 */
"signed ::= INTEGER"
,
/* 131 */
"signed ::= PLUS INTEGER"
,
/* 132 */
"signed ::= MINUS INTEGER"
,
/* 133 */
"cmd ::= CREATE TABLE create_table_args"
,
/* 134 */
"cmd ::= CREATE TABLE create_stable_args"
,
/* 135 */
"cmd ::= CREATE STABLE create_stable_args"
,
/* 136 */
"cmd ::= CREATE TABLE create_table_list"
,
/* 137 */
"create_table_list ::= create_from_stable"
,
/* 138 */
"create_table_list ::= create_table_list create_from_stable"
,
/* 139 */
"create_table_args ::= ifnotexists ids cpxName LP columnlist RP"
,
/* 140 */
"create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP"
,
/* 141 */
"create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP"
,
/* 142 */
"create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP"
,
/* 143 */
"tagNamelist ::= tagNamelist COMMA ids"
,
/* 144 */
"tagNamelist ::= ids"
,
/* 145 */
"create_table_args ::= ifnotexists ids cpxName AS select"
,
/* 146 */
"columnlist ::= columnlist COMMA column"
,
/* 147 */
"columnlist ::= column"
,
/* 148 */
"column ::= ids typename"
,
/* 149 */
"tagitemlist ::= tagitemlist COMMA tagitem"
,
/* 150 */
"tagitemlist ::= tagitem"
,
/* 151 */
"tagitem ::= INTEGER"
,
/* 152 */
"tagitem ::= FLOAT"
,
/* 153 */
"tagitem ::= STRING"
,
/* 154 */
"tagitem ::= BOOL"
,
/* 155 */
"tagitem ::= NULL"
,
/* 156 */
"tagitem ::= NOW"
,
/* 157 */
"tagitem ::= MINUS INTEGER"
,
/* 158 */
"tagitem ::= MINUS FLOAT"
,
/* 159 */
"tagitem ::= PLUS INTEGER"
,
/* 160 */
"tagitem ::= PLUS FLOAT"
,
/* 161 */
"select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt"
,
/* 162 */
"select ::= LP select RP"
,
/* 163 */
"union ::= select"
,
/* 164 */
"union ::= union UNION ALL select"
,
/* 165 */
"cmd ::= union"
,
/* 166 */
"select ::= SELECT selcollist"
,
/* 167 */
"sclp ::= selcollist COMMA"
,
/* 168 */
"sclp ::="
,
/* 169 */
"selcollist ::= sclp distinct expr as"
,
/* 170 */
"selcollist ::= sclp STAR"
,
/* 171 */
"as ::= AS ids"
,
/* 172 */
"as ::= ids"
,
/* 173 */
"as ::="
,
/* 174 */
"distinct ::= DISTINCT"
,
/* 175 */
"distinct ::="
,
/* 176 */
"from ::= FROM tablelist"
,
/* 177 */
"from ::= FROM sub"
,
/* 178 */
"sub ::= LP union RP"
,
/* 179 */
"sub ::= LP union RP ids"
,
/* 180 */
"sub ::= sub COMMA LP union RP ids"
,
/* 181 */
"tablelist ::= ids cpxName"
,
/* 182 */
"tablelist ::= ids cpxName ids"
,
/* 183 */
"tablelist ::= tablelist COMMA ids cpxName"
,
/* 184 */
"tablelist ::= tablelist COMMA ids cpxName ids"
,
/* 185 */
"tmvar ::= VARIABLE"
,
/* 186 */
"interval_opt ::= INTERVAL LP tmvar RP"
,
/* 187 */
"interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP"
,
/* 188 */
"interval_opt ::="
,
/* 189 */
"session_option ::="
,
/* 190 */
"session_option ::= SESSION LP ids cpxName COMMA tmvar RP"
,
/* 191 */
"windowstate_option ::="
,
/* 192 */
"windowstate_option ::= STATE_WINDOW LP ids RP"
,
/* 193 */
"fill_opt ::="
,
/* 194 */
"fill_opt ::= FILL LP ID COMMA tagitemlist RP"
,
/* 195 */
"fill_opt ::= FILL LP ID RP"
,
/* 196 */
"sliding_opt ::= SLIDING LP tmvar RP"
,
/* 197 */
"sliding_opt ::="
,
/* 198 */
"orderby_opt ::="
,
/* 199 */
"orderby_opt ::= ORDER BY sortlist"
,
/* 200 */
"sortlist ::= sortlist COMMA item sortorder"
,
/* 201 */
"sortlist ::= item sortorder"
,
/* 202 */
"item ::= ids cpxName"
,
/* 203 */
"sortorder ::= ASC"
,
/* 204 */
"sortorder ::= DESC"
,
/* 205 */
"sortorder ::="
,
/* 206 */
"groupby_opt ::="
,
/* 207 */
"groupby_opt ::= GROUP BY grouplist"
,
/* 208 */
"grouplist ::= grouplist COMMA item"
,
/* 209 */
"grouplist ::= item"
,
/* 210 */
"having_opt ::="
,
/* 211 */
"having_opt ::= HAVING expr"
,
/* 212 */
"limit_opt ::="
,
/* 213 */
"limit_opt ::= LIMIT signed"
,
/* 214 */
"limit_opt ::= LIMIT signed OFFSET signed"
,
/* 215 */
"limit_opt ::= LIMIT signed COMMA signed"
,
/* 216 */
"slimit_opt ::="
,
/* 217 */
"slimit_opt ::= SLIMIT signed"
,
/* 218 */
"slimit_opt ::= SLIMIT signed SOFFSET signed"
,
/* 219 */
"slimit_opt ::= SLIMIT signed COMMA signed"
,
/* 220 */
"where_opt ::="
,
/* 221 */
"where_opt ::= WHERE expr"
,
/* 222 */
"expr ::= LP expr RP"
,
/* 223 */
"expr ::= ID"
,
/* 224 */
"expr ::= ID DOT ID"
,
/* 225 */
"expr ::= ID DOT STAR"
,
/* 226 */
"expr ::= INTEGER"
,
/* 227 */
"expr ::= MINUS INTEGER"
,
/* 228 */
"expr ::= PLUS INTEGER"
,
/* 229 */
"expr ::= FLOAT"
,
/* 230 */
"expr ::= MINUS FLOAT"
,
/* 231 */
"expr ::= PLUS FLOAT"
,
/* 232 */
"expr ::= STRING"
,
/* 233 */
"expr ::= NOW"
,
/* 234 */
"expr ::= VARIABLE"
,
/* 235 */
"expr ::= PLUS VARIABLE"
,
/* 236 */
"expr ::= MINUS VARIABLE"
,
/* 237 */
"expr ::= BOOL"
,
/* 238 */
"expr ::= NULL"
,
/* 239 */
"expr ::= ID LP exprlist RP"
,
/* 240 */
"expr ::= ID LP STAR RP"
,
/* 241 */
"expr ::= expr IS NULL"
,
/* 242 */
"expr ::= expr IS NOT NULL"
,
/* 243 */
"expr ::= expr LT expr"
,
/* 244 */
"expr ::= expr GT expr"
,
/* 245 */
"expr ::= expr LE expr"
,
/* 246 */
"expr ::= expr GE expr"
,
/* 247 */
"expr ::= expr NE expr"
,
/* 248 */
"expr ::= expr EQ expr"
,
/* 249 */
"expr ::= expr BETWEEN expr AND expr"
,
/* 250 */
"expr ::= expr AND expr"
,
/* 251 */
"expr ::= expr OR expr"
,
/* 252 */
"expr ::= expr PLUS expr"
,
/* 253 */
"expr ::= expr MINUS expr"
,
/* 254 */
"expr ::= expr STAR expr"
,
/* 255 */
"expr ::= expr SLASH expr"
,
/* 256 */
"expr ::= expr REM expr"
,
/* 257 */
"expr ::= expr LIKE expr"
,
/* 258 */
"expr ::= expr IN LP exprlist RP"
,
/* 259 */
"exprlist ::= exprlist COMMA expritem"
,
/* 260 */
"exprlist ::= expritem"
,
/* 261 */
"expritem ::= expr"
,
/* 262 */
"expritem ::="
,
/* 263 */
"cmd ::= RESET QUERY CACHE"
,
/* 264 */
"cmd ::= SYNCDB ids REPLICA"
,
/* 265 */
"cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist"
,
/* 266 */
"cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids"
,
/* 267 */
"cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist"
,
/* 268 */
"cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist"
,
/* 269 */
"cmd ::= ALTER TABLE ids cpxName DROP TAG ids"
,
/* 270 */
"cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids"
,
/* 271 */
"cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 272 */
"cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist"
,
/* 273 */
"cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist"
,
/* 274 */
"cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids"
,
/* 275 */
"cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist"
,
/* 276 */
"cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist"
,
/* 277 */
"cmd ::= ALTER STABLE ids cpxName DROP TAG ids"
,
/* 278 */
"cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids"
,
/* 279 */
"cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 280 */
"cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist"
,
/* 281 */
"cmd ::= KILL CONNECTION INTEGER"
,
/* 282 */
"cmd ::= KILL STREAM INTEGER COLON INTEGER"
,
/* 283 */
"cmd ::= KILL QUERY INTEGER COLON INTEGER"
,
/* 48 */
"cmd ::= COMPACT VNODES IN LP exprlist RP"
,
/* 49 */
"ids ::= ID"
,
/* 50 */
"ids ::= STRING"
,
/* 51 */
"ifexists ::= IF EXISTS"
,
/* 52 */
"ifexists ::="
,
/* 53 */
"ifnotexists ::= IF NOT EXISTS"
,
/* 54 */
"ifnotexists ::="
,
/* 55 */
"cmd ::= CREATE DNODE ids"
,
/* 56 */
"cmd ::= CREATE ACCOUNT ids PASS ids acct_optr"
,
/* 57 */
"cmd ::= CREATE DATABASE ifnotexists ids db_optr"
,
/* 58 */
"cmd ::= CREATE TOPIC ifnotexists ids topic_optr"
,
/* 59 */
"cmd ::= CREATE USER ids PASS ids"
,
/* 60 */
"pps ::="
,
/* 61 */
"pps ::= PPS INTEGER"
,
/* 62 */
"tseries ::="
,
/* 63 */
"tseries ::= TSERIES INTEGER"
,
/* 64 */
"dbs ::="
,
/* 65 */
"dbs ::= DBS INTEGER"
,
/* 66 */
"streams ::="
,
/* 67 */
"streams ::= STREAMS INTEGER"
,
/* 68 */
"storage ::="
,
/* 69 */
"storage ::= STORAGE INTEGER"
,
/* 70 */
"qtime ::="
,
/* 71 */
"qtime ::= QTIME INTEGER"
,
/* 72 */
"users ::="
,
/* 73 */
"users ::= USERS INTEGER"
,
/* 74 */
"conns ::="
,
/* 75 */
"conns ::= CONNS INTEGER"
,
/* 76 */
"state ::="
,
/* 77 */
"state ::= STATE ids"
,
/* 78 */
"acct_optr ::= pps tseries storage streams qtime dbs users conns state"
,
/* 79 */
"intitemlist ::= intitemlist COMMA intitem"
,
/* 80 */
"intitemlist ::= intitem"
,
/* 81 */
"intitem ::= INTEGER"
,
/* 82 */
"keep ::= KEEP intitemlist"
,
/* 83 */
"cache ::= CACHE INTEGER"
,
/* 84 */
"replica ::= REPLICA INTEGER"
,
/* 85 */
"quorum ::= QUORUM INTEGER"
,
/* 86 */
"days ::= DAYS INTEGER"
,
/* 87 */
"minrows ::= MINROWS INTEGER"
,
/* 88 */
"maxrows ::= MAXROWS INTEGER"
,
/* 89 */
"blocks ::= BLOCKS INTEGER"
,
/* 90 */
"ctime ::= CTIME INTEGER"
,
/* 91 */
"wal ::= WAL INTEGER"
,
/* 92 */
"fsync ::= FSYNC INTEGER"
,
/* 93 */
"comp ::= COMP INTEGER"
,
/* 94 */
"prec ::= PRECISION STRING"
,
/* 95 */
"update ::= UPDATE INTEGER"
,
/* 96 */
"cachelast ::= CACHELAST INTEGER"
,
/* 97 */
"partitions ::= PARTITIONS INTEGER"
,
/* 98 */
"db_optr ::="
,
/* 99 */
"db_optr ::= db_optr cache"
,
/* 100 */
"db_optr ::= db_optr replica"
,
/* 101 */
"db_optr ::= db_optr quorum"
,
/* 102 */
"db_optr ::= db_optr days"
,
/* 103 */
"db_optr ::= db_optr minrows"
,
/* 104 */
"db_optr ::= db_optr maxrows"
,
/* 105 */
"db_optr ::= db_optr blocks"
,
/* 106 */
"db_optr ::= db_optr ctime"
,
/* 107 */
"db_optr ::= db_optr wal"
,
/* 108 */
"db_optr ::= db_optr fsync"
,
/* 109 */
"db_optr ::= db_optr comp"
,
/* 110 */
"db_optr ::= db_optr prec"
,
/* 111 */
"db_optr ::= db_optr keep"
,
/* 112 */
"db_optr ::= db_optr update"
,
/* 113 */
"db_optr ::= db_optr cachelast"
,
/* 114 */
"topic_optr ::= db_optr"
,
/* 115 */
"topic_optr ::= topic_optr partitions"
,
/* 116 */
"alter_db_optr ::="
,
/* 117 */
"alter_db_optr ::= alter_db_optr replica"
,
/* 118 */
"alter_db_optr ::= alter_db_optr quorum"
,
/* 119 */
"alter_db_optr ::= alter_db_optr keep"
,
/* 120 */
"alter_db_optr ::= alter_db_optr blocks"
,
/* 121 */
"alter_db_optr ::= alter_db_optr comp"
,
/* 122 */
"alter_db_optr ::= alter_db_optr wal"
,
/* 123 */
"alter_db_optr ::= alter_db_optr fsync"
,
/* 124 */
"alter_db_optr ::= alter_db_optr update"
,
/* 125 */
"alter_db_optr ::= alter_db_optr cachelast"
,
/* 126 */
"alter_topic_optr ::= alter_db_optr"
,
/* 127 */
"alter_topic_optr ::= alter_topic_optr partitions"
,
/* 128 */
"typename ::= ids"
,
/* 129 */
"typename ::= ids LP signed RP"
,
/* 130 */
"typename ::= ids UNSIGNED"
,
/* 131 */
"signed ::= INTEGER"
,
/* 132 */
"signed ::= PLUS INTEGER"
,
/* 133 */
"signed ::= MINUS INTEGER"
,
/* 134 */
"cmd ::= CREATE TABLE create_table_args"
,
/* 135 */
"cmd ::= CREATE TABLE create_stable_args"
,
/* 136 */
"cmd ::= CREATE STABLE create_stable_args"
,
/* 137 */
"cmd ::= CREATE TABLE create_table_list"
,
/* 138 */
"create_table_list ::= create_from_stable"
,
/* 139 */
"create_table_list ::= create_table_list create_from_stable"
,
/* 140 */
"create_table_args ::= ifnotexists ids cpxName LP columnlist RP"
,
/* 141 */
"create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP"
,
/* 142 */
"create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP"
,
/* 143 */
"create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP"
,
/* 144 */
"tagNamelist ::= tagNamelist COMMA ids"
,
/* 145 */
"tagNamelist ::= ids"
,
/* 146 */
"create_table_args ::= ifnotexists ids cpxName AS select"
,
/* 147 */
"columnlist ::= columnlist COMMA column"
,
/* 148 */
"columnlist ::= column"
,
/* 149 */
"column ::= ids typename"
,
/* 150 */
"tagitemlist ::= tagitemlist COMMA tagitem"
,
/* 151 */
"tagitemlist ::= tagitem"
,
/* 152 */
"tagitem ::= INTEGER"
,
/* 153 */
"tagitem ::= FLOAT"
,
/* 154 */
"tagitem ::= STRING"
,
/* 155 */
"tagitem ::= BOOL"
,
/* 156 */
"tagitem ::= NULL"
,
/* 157 */
"tagitem ::= NOW"
,
/* 158 */
"tagitem ::= MINUS INTEGER"
,
/* 159 */
"tagitem ::= MINUS FLOAT"
,
/* 160 */
"tagitem ::= PLUS INTEGER"
,
/* 161 */
"tagitem ::= PLUS FLOAT"
,
/* 162 */
"select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt"
,
/* 163 */
"select ::= LP select RP"
,
/* 164 */
"union ::= select"
,
/* 165 */
"union ::= union UNION ALL select"
,
/* 166 */
"cmd ::= union"
,
/* 167 */
"select ::= SELECT selcollist"
,
/* 168 */
"sclp ::= selcollist COMMA"
,
/* 169 */
"sclp ::="
,
/* 170 */
"selcollist ::= sclp distinct expr as"
,
/* 171 */
"selcollist ::= sclp STAR"
,
/* 172 */
"as ::= AS ids"
,
/* 173 */
"as ::= ids"
,
/* 174 */
"as ::="
,
/* 175 */
"distinct ::= DISTINCT"
,
/* 176 */
"distinct ::="
,
/* 177 */
"from ::= FROM tablelist"
,
/* 178 */
"from ::= FROM sub"
,
/* 179 */
"sub ::= LP union RP"
,
/* 180 */
"sub ::= LP union RP ids"
,
/* 181 */
"sub ::= sub COMMA LP union RP ids"
,
/* 182 */
"tablelist ::= ids cpxName"
,
/* 183 */
"tablelist ::= ids cpxName ids"
,
/* 184 */
"tablelist ::= tablelist COMMA ids cpxName"
,
/* 185 */
"tablelist ::= tablelist COMMA ids cpxName ids"
,
/* 186 */
"tmvar ::= VARIABLE"
,
/* 187 */
"interval_opt ::= INTERVAL LP tmvar RP"
,
/* 188 */
"interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP"
,
/* 189 */
"interval_opt ::="
,
/* 190 */
"session_option ::="
,
/* 191 */
"session_option ::= SESSION LP ids cpxName COMMA tmvar RP"
,
/* 192 */
"windowstate_option ::="
,
/* 193 */
"windowstate_option ::= STATE_WINDOW LP ids RP"
,
/* 194 */
"fill_opt ::="
,
/* 195 */
"fill_opt ::= FILL LP ID COMMA tagitemlist RP"
,
/* 196 */
"fill_opt ::= FILL LP ID RP"
,
/* 197 */
"sliding_opt ::= SLIDING LP tmvar RP"
,
/* 198 */
"sliding_opt ::="
,
/* 199 */
"orderby_opt ::="
,
/* 200 */
"orderby_opt ::= ORDER BY sortlist"
,
/* 201 */
"sortlist ::= sortlist COMMA item sortorder"
,
/* 202 */
"sortlist ::= item sortorder"
,
/* 203 */
"item ::= ids cpxName"
,
/* 204 */
"sortorder ::= ASC"
,
/* 205 */
"sortorder ::= DESC"
,
/* 206 */
"sortorder ::="
,
/* 207 */
"groupby_opt ::="
,
/* 208 */
"groupby_opt ::= GROUP BY grouplist"
,
/* 209 */
"grouplist ::= grouplist COMMA item"
,
/* 210 */
"grouplist ::= item"
,
/* 211 */
"having_opt ::="
,
/* 212 */
"having_opt ::= HAVING expr"
,
/* 213 */
"limit_opt ::="
,
/* 214 */
"limit_opt ::= LIMIT signed"
,
/* 215 */
"limit_opt ::= LIMIT signed OFFSET signed"
,
/* 216 */
"limit_opt ::= LIMIT signed COMMA signed"
,
/* 217 */
"slimit_opt ::="
,
/* 218 */
"slimit_opt ::= SLIMIT signed"
,
/* 219 */
"slimit_opt ::= SLIMIT signed SOFFSET signed"
,
/* 220 */
"slimit_opt ::= SLIMIT signed COMMA signed"
,
/* 221 */
"where_opt ::="
,
/* 222 */
"where_opt ::= WHERE expr"
,
/* 223 */
"expr ::= LP expr RP"
,
/* 224 */
"expr ::= ID"
,
/* 225 */
"expr ::= ID DOT ID"
,
/* 226 */
"expr ::= ID DOT STAR"
,
/* 227 */
"expr ::= INTEGER"
,
/* 228 */
"expr ::= MINUS INTEGER"
,
/* 229 */
"expr ::= PLUS INTEGER"
,
/* 230 */
"expr ::= FLOAT"
,
/* 231 */
"expr ::= MINUS FLOAT"
,
/* 232 */
"expr ::= PLUS FLOAT"
,
/* 233 */
"expr ::= STRING"
,
/* 234 */
"expr ::= NOW"
,
/* 235 */
"expr ::= VARIABLE"
,
/* 236 */
"expr ::= PLUS VARIABLE"
,
/* 237 */
"expr ::= MINUS VARIABLE"
,
/* 238 */
"expr ::= BOOL"
,
/* 239 */
"expr ::= NULL"
,
/* 240 */
"expr ::= ID LP exprlist RP"
,
/* 241 */
"expr ::= ID LP STAR RP"
,
/* 242 */
"expr ::= expr IS NULL"
,
/* 243 */
"expr ::= expr IS NOT NULL"
,
/* 244 */
"expr ::= expr LT expr"
,
/* 245 */
"expr ::= expr GT expr"
,
/* 246 */
"expr ::= expr LE expr"
,
/* 247 */
"expr ::= expr GE expr"
,
/* 248 */
"expr ::= expr NE expr"
,
/* 249 */
"expr ::= expr EQ expr"
,
/* 250 */
"expr ::= expr BETWEEN expr AND expr"
,
/* 251 */
"expr ::= expr AND expr"
,
/* 252 */
"expr ::= expr OR expr"
,
/* 253 */
"expr ::= expr PLUS expr"
,
/* 254 */
"expr ::= expr MINUS expr"
,
/* 255 */
"expr ::= expr STAR expr"
,
/* 256 */
"expr ::= expr SLASH expr"
,
/* 257 */
"expr ::= expr REM expr"
,
/* 258 */
"expr ::= expr LIKE expr"
,
/* 259 */
"expr ::= expr IN LP exprlist RP"
,
/* 260 */
"exprlist ::= exprlist COMMA expritem"
,
/* 261 */
"exprlist ::= expritem"
,
/* 262 */
"expritem ::= expr"
,
/* 263 */
"expritem ::="
,
/* 264 */
"cmd ::= RESET QUERY CACHE"
,
/* 265 */
"cmd ::= SYNCDB ids REPLICA"
,
/* 266 */
"cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist"
,
/* 267 */
"cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids"
,
/* 268 */
"cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist"
,
/* 269 */
"cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist"
,
/* 270 */
"cmd ::= ALTER TABLE ids cpxName DROP TAG ids"
,
/* 271 */
"cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids"
,
/* 272 */
"cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 273 */
"cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist"
,
/* 274 */
"cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist"
,
/* 275 */
"cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids"
,
/* 276 */
"cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist"
,
/* 277 */
"cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist"
,
/* 278 */
"cmd ::= ALTER STABLE ids cpxName DROP TAG ids"
,
/* 279 */
"cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids"
,
/* 280 */
"cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 281 */
"cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist"
,
/* 282 */
"cmd ::= KILL CONNECTION INTEGER"
,
/* 283 */
"cmd ::= KILL STREAM INTEGER COLON INTEGER"
,
/* 284 */
"cmd ::= KILL QUERY INTEGER COLON INTEGER"
,
};
#endif
/* NDEBUG */
...
...
@@ -1183,60 +1187,60 @@ static void yy_destructor(
** which appear on the RHS of the rule, but which are not used
** inside the C code.
*/
case
211
:
/* intitemlist */
case
213
:
/* keep */
case
235
:
/* columnlist */
case
236
:
/* tagitemlist */
case
237
:
/* tagNamelist */
case
247
:
/* fill_opt */
case
249
:
/* groupby_opt */
case
250
:
/* orderby_opt */
case
262
:
/* sortlist */
case
266
:
/* grouplist */
{
taosArrayDestroy
((
yypminor
->
yy93
));
case
200
:
/* exprlist */
case
243
:
/* selcollist */
case
257
:
/* sclp */
{
tSqlExprListDestroy
((
yypminor
->
yy441
));
}
break
;
case
233
:
/* create_table_list */
{
destroyCreateTableSql
((
yypminor
->
yy532
));
case
213
:
/* intitemlist */
case
215
:
/* keep */
case
237
:
/* columnlist */
case
238
:
/* tagitemlist */
case
239
:
/* tagNamelist */
case
249
:
/* fill_opt */
case
251
:
/* groupby_opt */
case
252
:
/* orderby_opt */
case
264
:
/* sortlist */
case
268
:
/* grouplist */
{
taosArrayDestroy
((
yypminor
->
yy441
));
}
break
;
case
23
8
:
/* selec
t */
case
23
5
:
/* create_table_lis
t */
{
destroy
SqlNode
((
yypminor
->
yy224
));
destroy
CreateTableSql
((
yypminor
->
yy182
));
}
break
;
case
241
:
/* selcollist */
case
255
:
/* sclp */
case
267
:
/* exprlist */
case
240
:
/* select */
{
tSqlExprListDestroy
((
yypminor
->
yy93
));
destroySqlNode
((
yypminor
->
yy236
));
}
break
;
case
24
2
:
/* from */
case
2
59
:
/* tablelist */
case
26
0
:
/* sub */
case
24
4
:
/* from */
case
2
61
:
/* tablelist */
case
26
2
:
/* sub */
{
destroyRelationInfo
((
yypminor
->
yy
330
));
destroyRelationInfo
((
yypminor
->
yy
244
));
}
break
;
case
24
3
:
/* where_opt */
case
25
1
:
/* having_opt */
case
25
7
:
/* expr */
case
26
8
:
/* expritem */
case
24
5
:
/* where_opt */
case
25
3
:
/* having_opt */
case
25
9
:
/* expr */
case
26
9
:
/* expritem */
{
tSqlExprDestroy
((
yypminor
->
yy
68
));
tSqlExprDestroy
((
yypminor
->
yy
166
));
}
break
;
case
25
4
:
/* union */
case
25
6
:
/* union */
{
destroyAllSqlNode
((
yypminor
->
yy
93
));
destroyAllSqlNode
((
yypminor
->
yy
441
));
}
break
;
case
26
3
:
/* sortitem */
case
26
5
:
/* sortitem */
{
tVariantDestroy
(
&
(
yypminor
->
yy5
18
));
tVariantDestroy
(
&
(
yypminor
->
yy5
06
));
}
break
;
default:
break
;
/* If no destructor action specified: do nothing */
...
...
@@ -1474,69 +1478,66 @@ static const struct {
YYCODETYPE
lhs
;
/* Symbol on the left-hand side of the rule */
unsigned
char
nrhs
;
/* Number of right-hand side symbols in the rule */
}
yyRuleInfo
[]
=
{
{
190
,
1
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
2
},
{
191
,
3
},
{
192
,
0
},
{
191
,
1
},
{
192
,
2
},
{
194
,
0
},
{
194
,
2
},
{
191
,
5
},
{
191
,
5
},
{
191
,
4
},
{
191
,
3
},
{
191
,
5
},
{
191
,
3
},
{
191
,
5
},
{
191
,
3
},
{
191
,
4
},
{
191
,
5
},
{
191
,
5
},
{
191
,
4
},
{
191
,
4
},
{
191
,
3
},
{
191
,
3
},
{
191
,
3
},
{
191
,
2
},
{
191
,
3
},
{
191
,
5
},
{
191
,
5
},
{
191
,
4
},
{
191
,
5
},
{
191
,
3
},
{
191
,
4
},
{
191
,
4
},
{
191
,
4
},
{
191
,
4
},
{
191
,
6
},
{
193
,
1
},
{
193
,
1
},
{
195
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
2
},
{
192
,
3
},
{
193
,
0
},
{
193
,
2
},
{
195
,
0
},
{
199
,
3
},
{
199
,
0
},
{
191
,
3
},
{
191
,
6
},
{
191
,
5
},
{
191
,
5
},
{
191
,
5
},
{
202
,
0
},
{
202
,
2
},
{
203
,
0
},
{
203
,
2
},
{
195
,
2
},
{
192
,
5
},
{
192
,
5
},
{
192
,
4
},
{
192
,
3
},
{
192
,
5
},
{
192
,
3
},
{
192
,
5
},
{
192
,
3
},
{
192
,
4
},
{
192
,
5
},
{
192
,
5
},
{
192
,
4
},
{
192
,
4
},
{
192
,
3
},
{
192
,
3
},
{
192
,
3
},
{
192
,
2
},
{
192
,
3
},
{
192
,
5
},
{
192
,
5
},
{
192
,
4
},
{
192
,
5
},
{
192
,
3
},
{
192
,
4
},
{
192
,
4
},
{
192
,
4
},
{
192
,
4
},
{
192
,
6
},
{
192
,
6
},
{
194
,
1
},
{
194
,
1
},
{
196
,
2
},
{
196
,
0
},
{
201
,
3
},
{
201
,
0
},
{
192
,
3
},
{
192
,
6
},
{
192
,
5
},
{
192
,
5
},
{
192
,
5
},
{
204
,
0
},
{
204
,
2
},
{
205
,
0
},
...
...
@@ -1551,12 +1552,14 @@ static const struct {
{
209
,
2
},
{
210
,
0
},
{
210
,
2
},
{
198
,
9
},
{
211
,
3
},
{
211
,
1
},
{
212
,
1
},
{
213
,
2
},
{
214
,
2
},
{
211
,
0
},
{
211
,
2
},
{
212
,
0
},
{
212
,
2
},
{
199
,
9
},
{
213
,
3
},
{
213
,
1
},
{
214
,
1
},
{
215
,
2
},
{
216
,
2
},
{
217
,
2
},
...
...
@@ -1571,193 +1574,195 @@ static const struct {
{
226
,
2
},
{
227
,
2
},
{
228
,
2
},
{
200
,
0
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
200
,
2
},
{
201
,
1
},
{
201
,
2
},
{
196
,
0
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
196
,
2
},
{
197
,
1
},
{
197
,
2
},
{
229
,
1
},
{
229
,
4
},
{
229
,
2
},
{
230
,
1
},
{
230
,
2
},
{
230
,
2
},
{
191
,
3
},
{
191
,
3
},
{
191
,
3
},
{
191
,
3
},
{
233
,
1
},
{
233
,
2
},
{
231
,
6
},
{
232
,
10
},
{
202
,
0
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
202
,
2
},
{
203
,
1
},
{
203
,
2
},
{
197
,
0
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
197
,
2
},
{
198
,
1
},
{
198
,
2
},
{
231
,
1
},
{
231
,
4
},
{
231
,
2
},
{
232
,
1
},
{
232
,
2
},
{
232
,
2
},
{
192
,
3
},
{
192
,
3
},
{
192
,
3
},
{
192
,
3
},
{
235
,
1
},
{
235
,
2
},
{
233
,
6
},
{
234
,
10
},
{
234
,
13
},
{
236
,
10
},
{
236
,
13
},
{
239
,
3
},
{
239
,
1
},
{
233
,
5
},
{
237
,
3
},
{
237
,
1
},
{
231
,
5
},
{
235
,
3
},
{
235
,
1
},
{
239
,
2
},
{
236
,
3
},
{
236
,
1
},
{
240
,
1
},
{
240
,
1
},
{
240
,
1
},
{
240
,
1
},
{
240
,
1
},
{
240
,
1
},
{
240
,
2
},
{
240
,
2
},
{
240
,
2
},
{
240
,
2
},
{
238
,
14
},
{
238
,
3
},
{
254
,
1
},
{
254
,
4
},
{
191
,
1
},
{
238
,
2
},
{
255
,
2
},
{
255
,
0
},
{
241
,
4
},
{
241
,
2
},
{
258
,
2
},
{
258
,
1
},
{
258
,
0
},
{
256
,
1
},
{
256
,
0
},
{
238
,
3
},
{
238
,
1
},
{
242
,
1
},
{
242
,
1
},
{
242
,
1
},
{
242
,
1
},
{
242
,
1
},
{
242
,
1
},
{
242
,
2
},
{
242
,
2
},
{
260
,
3
},
{
260
,
4
},
{
260
,
6
},
{
259
,
2
},
{
259
,
3
},
{
259
,
4
},
{
259
,
5
},
{
261
,
1
},
{
244
,
4
},
{
244
,
6
},
{
244
,
0
},
{
245
,
0
},
{
245
,
7
},
{
246
,
0
},
{
242
,
2
},
{
242
,
2
},
{
240
,
14
},
{
240
,
3
},
{
256
,
1
},
{
256
,
4
},
{
192
,
1
},
{
240
,
2
},
{
257
,
2
},
{
257
,
0
},
{
243
,
4
},
{
243
,
2
},
{
260
,
2
},
{
260
,
1
},
{
260
,
0
},
{
258
,
1
},
{
258
,
0
},
{
244
,
2
},
{
244
,
2
},
{
262
,
3
},
{
262
,
4
},
{
262
,
6
},
{
261
,
2
},
{
261
,
3
},
{
261
,
4
},
{
261
,
5
},
{
263
,
1
},
{
246
,
4
},
{
246
,
6
},
{
246
,
0
},
{
247
,
0
},
{
247
,
6
},
{
247
,
4
},
{
248
,
4
},
{
247
,
7
},
{
248
,
0
},
{
248
,
4
},
{
249
,
0
},
{
249
,
6
},
{
249
,
4
},
{
250
,
4
},
{
250
,
0
},
{
25
0
,
3
},
{
2
62
,
4
},
{
26
2
,
2
},
{
25
2
,
0
},
{
2
52
,
3
},
{
26
4
,
4
},
{
264
,
2
},
{
265
,
1
},
{
265
,
1
},
{
265
,
0
},
{
249
,
0
},
{
249
,
3
},
{
266
,
3
},
{
266
,
1
},
{
266
,
2
},
{
267
,
1
},
{
267
,
1
},
{
267
,
0
},
{
251
,
0
},
{
251
,
2
},
{
251
,
3
},
{
268
,
3
},
{
268
,
1
},
{
253
,
0
},
{
253
,
2
},
{
253
,
4
},
{
253
,
4
},
{
252
,
0
},
{
252
,
2
},
{
252
,
4
},
{
252
,
4
},
{
243
,
0
},
{
243
,
2
},
{
257
,
3
},
{
257
,
1
},
{
257
,
3
},
{
257
,
3
},
{
257
,
1
},
{
257
,
2
},
{
257
,
2
},
{
257
,
1
},
{
257
,
2
},
{
257
,
2
},
{
257
,
1
},
{
257
,
1
},
{
257
,
1
},
{
257
,
2
},
{
257
,
2
},
{
257
,
1
},
{
257
,
1
},
{
257
,
4
},
{
257
,
4
},
{
257
,
3
},
{
257
,
4
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
5
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
3
},
{
257
,
5
},
{
267
,
3
},
{
267
,
1
},
{
268
,
1
},
{
268
,
0
},
{
191
,
3
},
{
191
,
3
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
8
},
{
191
,
9
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
7
},
{
191
,
8
},
{
191
,
9
},
{
191
,
7
},
{
191
,
3
},
{
191
,
5
},
{
191
,
5
},
{
255
,
0
},
{
255
,
2
},
{
255
,
4
},
{
255
,
4
},
{
254
,
0
},
{
254
,
2
},
{
254
,
4
},
{
254
,
4
},
{
245
,
0
},
{
245
,
2
},
{
259
,
3
},
{
259
,
1
},
{
259
,
3
},
{
259
,
3
},
{
259
,
1
},
{
259
,
2
},
{
259
,
2
},
{
259
,
1
},
{
259
,
2
},
{
259
,
2
},
{
259
,
1
},
{
259
,
1
},
{
259
,
1
},
{
259
,
2
},
{
259
,
2
},
{
259
,
1
},
{
259
,
1
},
{
259
,
4
},
{
259
,
4
},
{
259
,
3
},
{
259
,
4
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
5
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
3
},
{
259
,
5
},
{
200
,
3
},
{
200
,
1
},
{
269
,
1
},
{
269
,
0
},
{
192
,
3
},
{
192
,
3
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
8
},
{
192
,
9
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
7
},
{
192
,
8
},
{
192
,
9
},
{
192
,
7
},
{
192
,
3
},
{
192
,
5
},
{
192
,
5
},
};
static
void
yy_accept
(
yyParser
*
);
/* Forward Declaration */
...
...
@@ -1981,645 +1986,648 @@ static void yy_reduce(
break
;
case
44
:
/* cmd ::= ALTER DATABASE ids alter_db_optr */
case
45
:
/* cmd ::= ALTER TOPIC ids alter_topic_optr */
yytestcase
(
yyruleno
==
45
);
{
SStrToken
t
=
{
0
};
setCreateDbInfo
(
pInfo
,
TSDB_SQL_ALTER_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy3
7
2
,
&
t
);}
{
SStrToken
t
=
{
0
};
setCreateDbInfo
(
pInfo
,
TSDB_SQL_ALTER_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy3
8
2
,
&
t
);}
break
;
case
46
:
/* cmd ::= ALTER ACCOUNT ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
,
&
yymsp
[
0
].
minor
.
yy
77
);}
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
,
&
yymsp
[
0
].
minor
.
yy
151
);}
break
;
case
47
:
/* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy77
);}
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_ALTER_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy151
);}
break
;
case
48
:
/* cmd ::= COMPACT VNODES IN LP exprlist RP */
{
setCompactVnodeSql
(
pInfo
,
TSDB_SQL_COMPACT_VNODE
,
yymsp
[
-
1
].
minor
.
yy441
);}
break
;
case
4
8
:
/* ids ::= ID */
case
49
:
/* ids ::= STRING */
yytestcase
(
yyruleno
==
49
);
case
4
9
:
/* ids ::= ID */
case
50
:
/* ids ::= STRING */
yytestcase
(
yyruleno
==
50
);
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
5
0
:
/* ifexists ::= IF EXISTS */
case
5
2
:
/* ifnotexists ::= IF NOT EXISTS */
yytestcase
(
yyruleno
==
52
);
case
5
1
:
/* ifexists ::= IF EXISTS */
case
5
3
:
/* ifnotexists ::= IF NOT EXISTS */
yytestcase
(
yyruleno
==
53
);
{
yygotominor
.
yy0
.
n
=
1
;}
break
;
case
5
1
:
/* ifexists ::= */
case
5
3
:
/* ifnotexists ::= */
yytestcase
(
yyruleno
==
53
);
case
17
5
:
/* distinct ::= */
yytestcase
(
yyruleno
==
175
);
case
5
2
:
/* ifexists ::= */
case
5
4
:
/* ifnotexists ::= */
yytestcase
(
yyruleno
==
54
);
case
17
6
:
/* distinct ::= */
yytestcase
(
yyruleno
==
176
);
{
yygotominor
.
yy0
.
n
=
0
;}
break
;
case
5
4
:
/* cmd ::= CREATE DNODE ids */
case
5
5
:
/* cmd ::= CREATE DNODE ids */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_CREATE_DNODE
,
1
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
5
5
:
/* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_CREATE_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
77
);}
case
5
6
:
/* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{
setCreateAcctSql
(
pInfo
,
TSDB_SQL_CREATE_ACCT
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy
151
);}
break
;
case
5
6
:
/* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case
5
7
:
/* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
yytestcase
(
yyruleno
==
57
);
{
setCreateDbInfo
(
pInfo
,
TSDB_SQL_CREATE_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy3
7
2
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
case
5
7
:
/* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case
5
8
:
/* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
yytestcase
(
yyruleno
==
58
);
{
setCreateDbInfo
(
pInfo
,
TSDB_SQL_CREATE_DB
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy3
8
2
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
case
5
8
:
/* cmd ::= CREATE USER ids PASS ids */
case
5
9
:
/* cmd ::= CREATE USER ids PASS ids */
{
setCreateUserSql
(
pInfo
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
59
:
/* pps ::= */
case
6
1
:
/* tseries ::= */
yytestcase
(
yyruleno
==
61
);
case
6
3
:
/* dbs ::= */
yytestcase
(
yyruleno
==
63
);
case
6
5
:
/* streams ::= */
yytestcase
(
yyruleno
==
65
);
case
6
7
:
/* storage ::= */
yytestcase
(
yyruleno
==
67
);
case
69
:
/* qtime ::= */
yytestcase
(
yyruleno
==
69
);
case
7
1
:
/* users ::= */
yytestcase
(
yyruleno
==
71
);
case
7
3
:
/* conns ::= */
yytestcase
(
yyruleno
==
73
);
case
7
5
:
/* state ::= */
yytestcase
(
yyruleno
==
75
);
case
60
:
/* pps ::= */
case
6
2
:
/* tseries ::= */
yytestcase
(
yyruleno
==
62
);
case
6
4
:
/* dbs ::= */
yytestcase
(
yyruleno
==
64
);
case
6
6
:
/* streams ::= */
yytestcase
(
yyruleno
==
66
);
case
6
8
:
/* storage ::= */
yytestcase
(
yyruleno
==
68
);
case
70
:
/* qtime ::= */
yytestcase
(
yyruleno
==
70
);
case
7
2
:
/* users ::= */
yytestcase
(
yyruleno
==
72
);
case
7
4
:
/* conns ::= */
yytestcase
(
yyruleno
==
74
);
case
7
6
:
/* state ::= */
yytestcase
(
yyruleno
==
76
);
{
yygotominor
.
yy0
.
n
=
0
;
}
break
;
case
6
0
:
/* pps ::= PPS INTEGER */
case
6
2
:
/* tseries ::= TSERIES INTEGER */
yytestcase
(
yyruleno
==
62
);
case
6
4
:
/* dbs ::= DBS INTEGER */
yytestcase
(
yyruleno
==
64
);
case
6
6
:
/* streams ::= STREAMS INTEGER */
yytestcase
(
yyruleno
==
66
);
case
6
8
:
/* storage ::= STORAGE INTEGER */
yytestcase
(
yyruleno
==
68
);
case
7
0
:
/* qtime ::= QTIME INTEGER */
yytestcase
(
yyruleno
==
70
);
case
7
2
:
/* users ::= USERS INTEGER */
yytestcase
(
yyruleno
==
72
);
case
7
4
:
/* conns ::= CONNS INTEGER */
yytestcase
(
yyruleno
==
74
);
case
7
6
:
/* state ::= STATE ids */
yytestcase
(
yyruleno
==
76
);
case
6
1
:
/* pps ::= PPS INTEGER */
case
6
3
:
/* tseries ::= TSERIES INTEGER */
yytestcase
(
yyruleno
==
63
);
case
6
5
:
/* dbs ::= DBS INTEGER */
yytestcase
(
yyruleno
==
65
);
case
6
7
:
/* streams ::= STREAMS INTEGER */
yytestcase
(
yyruleno
==
67
);
case
6
9
:
/* storage ::= STORAGE INTEGER */
yytestcase
(
yyruleno
==
69
);
case
7
1
:
/* qtime ::= QTIME INTEGER */
yytestcase
(
yyruleno
==
71
);
case
7
3
:
/* users ::= USERS INTEGER */
yytestcase
(
yyruleno
==
73
);
case
7
5
:
/* conns ::= CONNS INTEGER */
yytestcase
(
yyruleno
==
75
);
case
7
7
:
/* state ::= STATE ids */
yytestcase
(
yyruleno
==
77
);
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
7
7
:
/* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yygotominor
.
yy
77
.
maxUsers
=
(
yymsp
[
-
2
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
2
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
maxDbs
=
(
yymsp
[
-
3
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
3
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
maxTimeSeries
=
(
yymsp
[
-
7
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
7
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
maxStreams
=
(
yymsp
[
-
5
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
5
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
maxPointsPerSecond
=
(
yymsp
[
-
8
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
8
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
maxStorage
=
(
yymsp
[
-
6
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
6
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yygotominor
.
yy
77
.
maxQueryTime
=
(
yymsp
[
-
4
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
4
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yygotominor
.
yy
77
.
maxConnections
=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
1
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
77
.
stat
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
7
8
:
/* intitemlist ::= intitemlist COMMA intitem */
case
1
49
:
/* tagitemlist ::= tagitemlist COMMA tagitem */
yytestcase
(
yyruleno
==
149
);
{
yygotominor
.
yy
93
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy518
,
-
1
);
}
break
;
case
79
:
/* intitemlist ::= intitem */
case
15
0
:
/* tagitemlist ::= tagitem */
yytestcase
(
yyruleno
==
150
);
{
yygotominor
.
yy
93
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy518
,
-
1
);
}
break
;
case
8
0
:
/* intitem ::= INTEGER */
case
15
1
:
/* tagitem ::= INTEGER */
yytestcase
(
yyruleno
==
151
);
case
15
2
:
/* tagitem ::= FLOAT */
yytestcase
(
yyruleno
==
152
);
case
15
3
:
/* tagitem ::= STRING */
yytestcase
(
yyruleno
==
153
);
case
15
4
:
/* tagitem ::= BOOL */
yytestcase
(
yyruleno
==
154
);
{
toTSDBType
(
yymsp
[
0
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
yygotominor
.
yy5
18
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
8
1
:
/* keep ::= KEEP intitemlist */
{
yygotominor
.
yy
93
=
yymsp
[
0
].
minor
.
yy93
;
}
break
;
case
8
2
:
/* cache ::= CACHE INTEGER */
case
8
3
:
/* replica ::= REPLICA INTEGER */
yytestcase
(
yyruleno
==
83
);
case
8
4
:
/* quorum ::= QUORUM INTEGER */
yytestcase
(
yyruleno
==
84
);
case
8
5
:
/* days ::= DAYS INTEGER */
yytestcase
(
yyruleno
==
85
);
case
8
6
:
/* minrows ::= MINROWS INTEGER */
yytestcase
(
yyruleno
==
86
);
case
8
7
:
/* maxrows ::= MAXROWS INTEGER */
yytestcase
(
yyruleno
==
87
);
case
8
8
:
/* blocks ::= BLOCKS INTEGER */
yytestcase
(
yyruleno
==
88
);
case
89
:
/* ctime ::= CTIME INTEGER */
yytestcase
(
yyruleno
==
89
);
case
9
0
:
/* wal ::= WAL INTEGER */
yytestcase
(
yyruleno
==
90
);
case
9
1
:
/* fsync ::= FSYNC INTEGER */
yytestcase
(
yyruleno
==
91
);
case
9
2
:
/* comp ::= COMP INTEGER */
yytestcase
(
yyruleno
==
92
);
case
9
3
:
/* prec ::= PRECISION STRING */
yytestcase
(
yyruleno
==
93
);
case
9
4
:
/* update ::= UPDATE INTEGER */
yytestcase
(
yyruleno
==
94
);
case
9
5
:
/* cachelast ::= CACHELAST INTEGER */
yytestcase
(
yyruleno
==
95
);
case
9
6
:
/* partitions ::= PARTITIONS INTEGER */
yytestcase
(
yyruleno
==
96
);
case
7
8
:
/* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yygotominor
.
yy
151
.
maxUsers
=
(
yymsp
[
-
2
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
2
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
maxDbs
=
(
yymsp
[
-
3
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
3
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
maxTimeSeries
=
(
yymsp
[
-
7
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
7
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
maxStreams
=
(
yymsp
[
-
5
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
5
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
maxPointsPerSecond
=
(
yymsp
[
-
8
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
8
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
maxStorage
=
(
yymsp
[
-
6
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
6
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yygotominor
.
yy
151
.
maxQueryTime
=
(
yymsp
[
-
4
].
minor
.
yy0
.
n
>
0
)
?
strtoll
(
yymsp
[
-
4
].
minor
.
yy0
.
z
,
NULL
,
10
)
:-
1
;
yygotominor
.
yy
151
.
maxConnections
=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
>
0
)
?
atoi
(
yymsp
[
-
1
].
minor
.
yy0
.
z
)
:-
1
;
yygotominor
.
yy
151
.
stat
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
7
9
:
/* intitemlist ::= intitemlist COMMA intitem */
case
1
50
:
/* tagitemlist ::= tagitemlist COMMA tagitem */
yytestcase
(
yyruleno
==
150
);
{
yygotominor
.
yy
441
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy506
,
-
1
);
}
break
;
case
80
:
/* intitemlist ::= intitem */
case
15
1
:
/* tagitemlist ::= tagitem */
yytestcase
(
yyruleno
==
151
);
{
yygotominor
.
yy
441
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy506
,
-
1
);
}
break
;
case
8
1
:
/* intitem ::= INTEGER */
case
15
2
:
/* tagitem ::= INTEGER */
yytestcase
(
yyruleno
==
152
);
case
15
3
:
/* tagitem ::= FLOAT */
yytestcase
(
yyruleno
==
153
);
case
15
4
:
/* tagitem ::= STRING */
yytestcase
(
yyruleno
==
154
);
case
15
5
:
/* tagitem ::= BOOL */
yytestcase
(
yyruleno
==
155
);
{
toTSDBType
(
yymsp
[
0
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
yygotominor
.
yy5
06
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
8
2
:
/* keep ::= KEEP intitemlist */
{
yygotominor
.
yy
441
=
yymsp
[
0
].
minor
.
yy441
;
}
break
;
case
8
3
:
/* cache ::= CACHE INTEGER */
case
8
4
:
/* replica ::= REPLICA INTEGER */
yytestcase
(
yyruleno
==
84
);
case
8
5
:
/* quorum ::= QUORUM INTEGER */
yytestcase
(
yyruleno
==
85
);
case
8
6
:
/* days ::= DAYS INTEGER */
yytestcase
(
yyruleno
==
86
);
case
8
7
:
/* minrows ::= MINROWS INTEGER */
yytestcase
(
yyruleno
==
87
);
case
8
8
:
/* maxrows ::= MAXROWS INTEGER */
yytestcase
(
yyruleno
==
88
);
case
8
9
:
/* blocks ::= BLOCKS INTEGER */
yytestcase
(
yyruleno
==
89
);
case
90
:
/* ctime ::= CTIME INTEGER */
yytestcase
(
yyruleno
==
90
);
case
9
1
:
/* wal ::= WAL INTEGER */
yytestcase
(
yyruleno
==
91
);
case
9
2
:
/* fsync ::= FSYNC INTEGER */
yytestcase
(
yyruleno
==
92
);
case
9
3
:
/* comp ::= COMP INTEGER */
yytestcase
(
yyruleno
==
93
);
case
9
4
:
/* prec ::= PRECISION STRING */
yytestcase
(
yyruleno
==
94
);
case
9
5
:
/* update ::= UPDATE INTEGER */
yytestcase
(
yyruleno
==
95
);
case
9
6
:
/* cachelast ::= CACHELAST INTEGER */
yytestcase
(
yyruleno
==
96
);
case
9
7
:
/* partitions ::= PARTITIONS INTEGER */
yytestcase
(
yyruleno
==
97
);
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
9
7
:
/* db_optr ::= */
{
setDefaultCreateDbOption
(
&
yygotominor
.
yy3
72
);
yygotominor
.
yy37
2
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
case
9
8
:
/* db_optr ::= */
{
setDefaultCreateDbOption
(
&
yygotominor
.
yy3
82
);
yygotominor
.
yy38
2
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
break
;
case
9
8
:
/* db_optr ::= db_optr cache */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
cacheBlockSize
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
9
9
:
/* db_optr ::= db_optr cache */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
cacheBlockSize
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
99
:
/* db_optr ::= db_optr replica */
case
11
6
:
/* alter_db_optr ::= alter_db_optr replica */
yytestcase
(
yyruleno
==
116
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
replica
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
100
:
/* db_optr ::= db_optr replica */
case
11
7
:
/* alter_db_optr ::= alter_db_optr replica */
yytestcase
(
yyruleno
==
117
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
replica
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
0
:
/* db_optr ::= db_optr quorum */
case
11
7
:
/* alter_db_optr ::= alter_db_optr quorum */
yytestcase
(
yyruleno
==
117
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
quorum
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
1
:
/* db_optr ::= db_optr quorum */
case
11
8
:
/* alter_db_optr ::= alter_db_optr quorum */
yytestcase
(
yyruleno
==
118
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
quorum
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
1
:
/* db_optr ::= db_optr days */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
daysPerFile
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
2
:
/* db_optr ::= db_optr days */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
daysPerFile
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
2
:
/* db_optr ::= db_optr minrows */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
minRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
case
10
3
:
/* db_optr ::= db_optr minrows */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
minRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
break
;
case
10
3
:
/* db_optr ::= db_optr maxrows */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
maxRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
case
10
4
:
/* db_optr ::= db_optr maxrows */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
maxRowsPerBlock
=
strtod
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
break
;
case
10
4
:
/* db_optr ::= db_optr blocks */
case
1
19
:
/* alter_db_optr ::= alter_db_optr blocks */
yytestcase
(
yyruleno
==
119
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
numOfBlocks
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
5
:
/* db_optr ::= db_optr blocks */
case
1
20
:
/* alter_db_optr ::= alter_db_optr blocks */
yytestcase
(
yyruleno
==
120
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
numOfBlocks
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
5
:
/* db_optr ::= db_optr ctime */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
commitTime
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
6
:
/* db_optr ::= db_optr ctime */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
commitTime
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
6
:
/* db_optr ::= db_optr wal */
case
12
1
:
/* alter_db_optr ::= alter_db_optr wal */
yytestcase
(
yyruleno
==
121
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
walLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
7
:
/* db_optr ::= db_optr wal */
case
12
2
:
/* alter_db_optr ::= alter_db_optr wal */
yytestcase
(
yyruleno
==
122
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
walLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
7
:
/* db_optr ::= db_optr fsync */
case
12
2
:
/* alter_db_optr ::= alter_db_optr fsync */
yytestcase
(
yyruleno
==
122
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
8
:
/* db_optr ::= db_optr fsync */
case
12
3
:
/* alter_db_optr ::= alter_db_optr fsync */
yytestcase
(
yyruleno
==
123
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
fsyncPeriod
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
10
8
:
/* db_optr ::= db_optr comp */
case
12
0
:
/* alter_db_optr ::= alter_db_optr comp */
yytestcase
(
yyruleno
==
120
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
compressionLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
10
9
:
/* db_optr ::= db_optr comp */
case
12
1
:
/* alter_db_optr ::= alter_db_optr comp */
yytestcase
(
yyruleno
==
121
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
compressionLevel
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
1
09
:
/* db_optr ::= db_optr prec */
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
precision
=
yymsp
[
0
].
minor
.
yy0
;
}
case
1
10
:
/* db_optr ::= db_optr prec */
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
precision
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
11
0
:
/* db_optr ::= db_optr keep */
case
11
8
:
/* alter_db_optr ::= alter_db_optr keep */
yytestcase
(
yyruleno
==
118
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy372
.
keep
=
yymsp
[
0
].
minor
.
yy93
;
}
case
11
1
:
/* db_optr ::= db_optr keep */
case
11
9
:
/* alter_db_optr ::= alter_db_optr keep */
yytestcase
(
yyruleno
==
119
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy382
.
keep
=
yymsp
[
0
].
minor
.
yy441
;
}
break
;
case
11
1
:
/* db_optr ::= db_optr update */
case
12
3
:
/* alter_db_optr ::= alter_db_optr update */
yytestcase
(
yyruleno
==
123
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
update
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
11
2
:
/* db_optr ::= db_optr update */
case
12
4
:
/* alter_db_optr ::= alter_db_optr update */
yytestcase
(
yyruleno
==
124
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
update
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
11
2
:
/* db_optr ::= db_optr cachelast */
case
12
4
:
/* alter_db_optr ::= alter_db_optr cachelast */
yytestcase
(
yyruleno
==
124
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
cachelast
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
11
3
:
/* db_optr ::= db_optr cachelast */
case
12
5
:
/* alter_db_optr ::= alter_db_optr cachelast */
yytestcase
(
yyruleno
==
125
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
cachelast
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
11
3
:
/* topic_optr ::= db_optr */
case
12
5
:
/* alter_topic_optr ::= alter_db_optr */
yytestcase
(
yyruleno
==
125
);
{
yygotominor
.
yy3
72
=
yymsp
[
0
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
dbType
=
TSDB_DB_TYPE_TOPIC
;
}
case
11
4
:
/* topic_optr ::= db_optr */
case
12
6
:
/* alter_topic_optr ::= alter_db_optr */
yytestcase
(
yyruleno
==
126
);
{
yygotominor
.
yy3
82
=
yymsp
[
0
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
dbType
=
TSDB_DB_TYPE_TOPIC
;
}
break
;
case
11
4
:
/* topic_optr ::= topic_optr partitions */
case
12
6
:
/* alter_topic_optr ::= alter_topic_optr partitions */
yytestcase
(
yyruleno
==
126
);
{
yygotominor
.
yy3
72
=
yymsp
[
-
1
].
minor
.
yy372
;
yygotominor
.
yy37
2
.
partitions
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
11
5
:
/* topic_optr ::= topic_optr partitions */
case
12
7
:
/* alter_topic_optr ::= alter_topic_optr partitions */
yytestcase
(
yyruleno
==
127
);
{
yygotominor
.
yy3
82
=
yymsp
[
-
1
].
minor
.
yy382
;
yygotominor
.
yy38
2
.
partitions
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
11
5
:
/* alter_db_optr ::= */
{
setDefaultCreateDbOption
(
&
yygotominor
.
yy3
72
);
yygotominor
.
yy37
2
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
case
11
6
:
/* alter_db_optr ::= */
{
setDefaultCreateDbOption
(
&
yygotominor
.
yy3
82
);
yygotominor
.
yy38
2
.
dbType
=
TSDB_DB_TYPE_DEFAULT
;}
break
;
case
12
7
:
/* typename ::= ids */
case
12
8
:
/* typename ::= ids */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tSetColumnType
(
&
yygotominor
.
yy3
25
,
&
yymsp
[
0
].
minor
.
yy0
);
tSetColumnType
(
&
yygotominor
.
yy3
43
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
12
8
:
/* typename ::= ids LP signed RP */
case
12
9
:
/* typename ::= ids LP signed RP */
{
if
(
yymsp
[
-
1
].
minor
.
yy
27
9
<=
0
)
{
if
(
yymsp
[
-
1
].
minor
.
yy
36
9
<=
0
)
{
yymsp
[
-
3
].
minor
.
yy0
.
type
=
0
;
tSetColumnType
(
&
yygotominor
.
yy3
25
,
&
yymsp
[
-
3
].
minor
.
yy0
);
tSetColumnType
(
&
yygotominor
.
yy3
43
,
&
yymsp
[
-
3
].
minor
.
yy0
);
}
else
{
yymsp
[
-
3
].
minor
.
yy0
.
type
=
-
yymsp
[
-
1
].
minor
.
yy
27
9
;
// negative value of name length
tSetColumnType
(
&
yygotominor
.
yy3
25
,
&
yymsp
[
-
3
].
minor
.
yy0
);
yymsp
[
-
3
].
minor
.
yy0
.
type
=
-
yymsp
[
-
1
].
minor
.
yy
36
9
;
// negative value of name length
tSetColumnType
(
&
yygotominor
.
yy3
43
,
&
yymsp
[
-
3
].
minor
.
yy0
);
}
}
break
;
case
1
29
:
/* typename ::= ids UNSIGNED */
case
1
30
:
/* typename ::= ids UNSIGNED */
{
yymsp
[
-
1
].
minor
.
yy0
.
type
=
0
;
yymsp
[
-
1
].
minor
.
yy0
.
n
=
((
yymsp
[
0
].
minor
.
yy0
.
z
+
yymsp
[
0
].
minor
.
yy0
.
n
)
-
yymsp
[
-
1
].
minor
.
yy0
.
z
);
tSetColumnType
(
&
yygotominor
.
yy3
25
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tSetColumnType
(
&
yygotominor
.
yy3
43
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
break
;
case
13
0
:
/* signed ::= INTEGER */
case
13
1
:
/* signed ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
131
);
{
yygotominor
.
yy
27
9
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
case
13
1
:
/* signed ::= INTEGER */
case
13
2
:
/* signed ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
132
);
{
yygotominor
.
yy
36
9
=
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
break
;
case
13
2
:
/* signed ::= MINUS INTEGER */
case
13
3
:
/* cmd ::= CREATE TABLE create_table_args */
yytestcase
(
yyruleno
==
133
);
case
13
4
:
/* cmd ::= CREATE TABLE create_stable_args */
yytestcase
(
yyruleno
==
134
);
case
13
5
:
/* cmd ::= CREATE STABLE create_stable_args */
yytestcase
(
yyruleno
==
135
);
{
yygotominor
.
yy
27
9
=
-
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);}
case
13
3
:
/* signed ::= MINUS INTEGER */
case
13
4
:
/* cmd ::= CREATE TABLE create_table_args */
yytestcase
(
yyruleno
==
134
);
case
13
5
:
/* cmd ::= CREATE TABLE create_stable_args */
yytestcase
(
yyruleno
==
135
);
case
13
6
:
/* cmd ::= CREATE STABLE create_stable_args */
yytestcase
(
yyruleno
==
136
);
{
yygotominor
.
yy
36
9
=
-
strtol
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);}
break
;
case
13
6
:
/* cmd ::= CREATE TABLE create_table_list */
{
pInfo
->
type
=
TSDB_SQL_CREATE_TABLE
;
pInfo
->
pCreateTableInfo
=
yymsp
[
0
].
minor
.
yy
53
2
;}
case
13
7
:
/* cmd ::= CREATE TABLE create_table_list */
{
pInfo
->
type
=
TSDB_SQL_CREATE_TABLE
;
pInfo
->
pCreateTableInfo
=
yymsp
[
0
].
minor
.
yy
18
2
;}
break
;
case
13
7
:
/* create_table_list ::= create_from_stable */
case
13
8
:
/* create_table_list ::= create_from_stable */
{
SCreateTableSql
*
pCreateTable
=
calloc
(
1
,
sizeof
(
SCreateTableSql
));
pCreateTable
->
childTableInfo
=
taosArrayInit
(
4
,
sizeof
(
SCreatedTableInfo
));
taosArrayPush
(
pCreateTable
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy
528
);
taosArrayPush
(
pCreateTable
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy
456
);
pCreateTable
->
type
=
TSQL_CREATE_TABLE_FROM_STABLE
;
yygotominor
.
yy
53
2
=
pCreateTable
;
yygotominor
.
yy
18
2
=
pCreateTable
;
}
break
;
case
13
8
:
/* create_table_list ::= create_table_list create_from_stable */
case
13
9
:
/* create_table_list ::= create_table_list create_from_stable */
{
taosArrayPush
(
yymsp
[
-
1
].
minor
.
yy
532
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy528
);
yygotominor
.
yy
532
=
yymsp
[
-
1
].
minor
.
yy53
2
;
taosArrayPush
(
yymsp
[
-
1
].
minor
.
yy
182
->
childTableInfo
,
&
yymsp
[
0
].
minor
.
yy456
);
yygotominor
.
yy
182
=
yymsp
[
-
1
].
minor
.
yy18
2
;
}
break
;
case
1
39
:
/* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
case
1
40
:
/* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
yygotominor
.
yy
532
=
tSetCreateTableInfo
(
yymsp
[
-
1
].
minor
.
yy93
,
NULL
,
NULL
,
TSQL_CREATE_TABLE
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
53
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yygotominor
.
yy
182
=
tSetCreateTableInfo
(
yymsp
[
-
1
].
minor
.
yy441
,
NULL
,
NULL
,
TSQL_CREATE_TABLE
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
18
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
4
].
minor
.
yy0
,
&
yymsp
[
-
5
].
minor
.
yy0
);
}
break
;
case
14
0
:
/* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
case
14
1
:
/* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
yygotominor
.
yy
532
=
tSetCreateTableInfo
(
yymsp
[
-
5
].
minor
.
yy93
,
yymsp
[
-
1
].
minor
.
yy93
,
NULL
,
TSQL_CREATE_STABLE
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
53
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yygotominor
.
yy
182
=
tSetCreateTableInfo
(
yymsp
[
-
5
].
minor
.
yy441
,
yymsp
[
-
1
].
minor
.
yy441
,
NULL
,
TSQL_CREATE_STABLE
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
18
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
}
break
;
case
14
1
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
case
14
2
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
yygotominor
.
yy
528
=
createNewChildTableInfo
(
&
yymsp
[
-
5
].
minor
.
yy0
,
NULL
,
yymsp
[
-
1
].
minor
.
yy93
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
yygotominor
.
yy
456
=
createNewChildTableInfo
(
&
yymsp
[
-
5
].
minor
.
yy0
,
NULL
,
yymsp
[
-
1
].
minor
.
yy441
,
&
yymsp
[
-
8
].
minor
.
yy0
,
&
yymsp
[
-
9
].
minor
.
yy0
);
}
break
;
case
14
2
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
case
14
3
:
/* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
yymsp
[
-
8
].
minor
.
yy0
.
n
+=
yymsp
[
-
7
].
minor
.
yy0
.
n
;
yymsp
[
-
11
].
minor
.
yy0
.
n
+=
yymsp
[
-
10
].
minor
.
yy0
.
n
;
yygotominor
.
yy
528
=
createNewChildTableInfo
(
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy93
,
yymsp
[
-
1
].
minor
.
yy93
,
&
yymsp
[
-
11
].
minor
.
yy0
,
&
yymsp
[
-
12
].
minor
.
yy0
);
yygotominor
.
yy
456
=
createNewChildTableInfo
(
&
yymsp
[
-
8
].
minor
.
yy0
,
yymsp
[
-
5
].
minor
.
yy441
,
yymsp
[
-
1
].
minor
.
yy441
,
&
yymsp
[
-
11
].
minor
.
yy0
,
&
yymsp
[
-
12
].
minor
.
yy0
);
}
break
;
case
14
3
:
/* tagNamelist ::= tagNamelist COMMA ids */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy
93
,
&
yymsp
[
0
].
minor
.
yy0
);
yygotominor
.
yy93
=
yymsp
[
-
2
].
minor
.
yy93
;
}
case
14
4
:
/* tagNamelist ::= tagNamelist COMMA ids */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy
441
,
&
yymsp
[
0
].
minor
.
yy0
);
yygotominor
.
yy441
=
yymsp
[
-
2
].
minor
.
yy441
;
}
break
;
case
14
4
:
/* tagNamelist ::= ids */
{
yygotominor
.
yy
93
=
taosArrayInit
(
4
,
sizeof
(
SStrToken
));
taosArrayPush
(
yygotominor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy0
);}
case
14
5
:
/* tagNamelist ::= ids */
{
yygotominor
.
yy
441
=
taosArrayInit
(
4
,
sizeof
(
SStrToken
));
taosArrayPush
(
yygotominor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
14
5
:
/* create_table_args ::= ifnotexists ids cpxName AS select */
case
14
6
:
/* create_table_args ::= ifnotexists ids cpxName AS select */
{
yygotominor
.
yy
532
=
tSetCreateTableInfo
(
NULL
,
NULL
,
yymsp
[
0
].
minor
.
yy224
,
TSQL_CREATE_STREAM
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
53
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yygotominor
.
yy
182
=
tSetCreateTableInfo
(
NULL
,
NULL
,
yymsp
[
0
].
minor
.
yy236
,
TSQL_CREATE_STREAM
);
setSqlInfo
(
pInfo
,
yygotominor
.
yy
18
2
,
NULL
,
TSDB_SQL_CREATE_TABLE
);
yymsp
[
-
3
].
minor
.
yy0
.
n
+=
yymsp
[
-
2
].
minor
.
yy0
.
n
;
setCreatedTableName
(
pInfo
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
-
4
].
minor
.
yy0
);
}
break
;
case
14
6
:
/* columnlist ::= columnlist COMMA column */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy
93
,
&
yymsp
[
0
].
minor
.
yy325
);
yygotominor
.
yy93
=
yymsp
[
-
2
].
minor
.
yy93
;
}
case
14
7
:
/* columnlist ::= columnlist COMMA column */
{
taosArrayPush
(
yymsp
[
-
2
].
minor
.
yy
441
,
&
yymsp
[
0
].
minor
.
yy343
);
yygotominor
.
yy441
=
yymsp
[
-
2
].
minor
.
yy441
;
}
break
;
case
14
7
:
/* columnlist ::= column */
{
yygotominor
.
yy
93
=
taosArrayInit
(
4
,
sizeof
(
TAOS_FIELD
));
taosArrayPush
(
yygotominor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy325
);}
case
14
8
:
/* columnlist ::= column */
{
yygotominor
.
yy
441
=
taosArrayInit
(
4
,
sizeof
(
TAOS_FIELD
));
taosArrayPush
(
yygotominor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy343
);}
break
;
case
14
8
:
/* column ::= ids typename */
case
14
9
:
/* column ::= ids typename */
{
tSetColumnInfo
(
&
yygotominor
.
yy3
25
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy325
);
tSetColumnInfo
(
&
yygotominor
.
yy3
43
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy343
);
}
break
;
case
15
5
:
/* tagitem ::= NULL */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tVariantCreate
(
&
yygotominor
.
yy5
18
,
&
yymsp
[
0
].
minor
.
yy0
);
}
case
15
6
:
/* tagitem ::= NULL */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
0
;
tVariantCreate
(
&
yygotominor
.
yy5
06
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
15
6
:
/* tagitem ::= NOW */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
tVariantCreate
(
&
yygotominor
.
yy5
18
,
&
yymsp
[
0
].
minor
.
yy0
);}
case
15
7
:
/* tagitem ::= NOW */
{
yymsp
[
0
].
minor
.
yy0
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
tVariantCreate
(
&
yygotominor
.
yy5
06
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
15
7
:
/* tagitem ::= MINUS INTEGER */
case
15
8
:
/* tagitem ::= MINUS FLOAT */
yytestcase
(
yyruleno
==
158
);
case
1
59
:
/* tagitem ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
159
);
case
16
0
:
/* tagitem ::= PLUS FLOAT */
yytestcase
(
yyruleno
==
160
);
case
15
8
:
/* tagitem ::= MINUS INTEGER */
case
15
9
:
/* tagitem ::= MINUS FLOAT */
yytestcase
(
yyruleno
==
159
);
case
1
60
:
/* tagitem ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
160
);
case
16
1
:
/* tagitem ::= PLUS FLOAT */
yytestcase
(
yyruleno
==
161
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
yymsp
[
0
].
minor
.
yy0
.
type
;
toTSDBType
(
yymsp
[
-
1
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
yygotominor
.
yy5
18
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tVariantCreate
(
&
yygotominor
.
yy5
06
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
break
;
case
16
1
:
/* select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
case
16
2
:
/* select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{
yygotominor
.
yy2
24
=
tSetQuerySqlNode
(
&
yymsp
[
-
13
].
minor
.
yy0
,
yymsp
[
-
12
].
minor
.
yy93
,
yymsp
[
-
11
].
minor
.
yy330
,
yymsp
[
-
10
].
minor
.
yy68
,
yymsp
[
-
4
].
minor
.
yy93
,
yymsp
[
-
3
].
minor
.
yy93
,
&
yymsp
[
-
9
].
minor
.
yy42
,
&
yymsp
[
-
8
].
minor
.
yy15
,
&
yymsp
[
-
7
].
minor
.
yy274
,
&
yymsp
[
-
5
].
minor
.
yy0
,
yymsp
[
-
6
].
minor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy284
,
&
yymsp
[
-
1
].
minor
.
yy284
,
yymsp
[
-
2
].
minor
.
yy68
);
yygotominor
.
yy2
36
=
tSetQuerySqlNode
(
&
yymsp
[
-
13
].
minor
.
yy0
,
yymsp
[
-
12
].
minor
.
yy441
,
yymsp
[
-
11
].
minor
.
yy244
,
yymsp
[
-
10
].
minor
.
yy166
,
yymsp
[
-
4
].
minor
.
yy441
,
yymsp
[
-
3
].
minor
.
yy441
,
&
yymsp
[
-
9
].
minor
.
yy340
,
&
yymsp
[
-
8
].
minor
.
yy259
,
&
yymsp
[
-
7
].
minor
.
yy348
,
&
yymsp
[
-
5
].
minor
.
yy0
,
yymsp
[
-
6
].
minor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy414
,
&
yymsp
[
-
1
].
minor
.
yy414
,
yymsp
[
-
2
].
minor
.
yy166
);
}
break
;
case
16
2
:
/* select ::= LP select RP */
{
yygotominor
.
yy2
24
=
yymsp
[
-
1
].
minor
.
yy224
;}
case
16
3
:
/* select ::= LP select RP */
{
yygotominor
.
yy2
36
=
yymsp
[
-
1
].
minor
.
yy236
;}
break
;
case
16
3
:
/* union ::= select */
{
yygotominor
.
yy
93
=
setSubclause
(
NULL
,
yymsp
[
0
].
minor
.
yy224
);
}
case
16
4
:
/* union ::= select */
{
yygotominor
.
yy
441
=
setSubclause
(
NULL
,
yymsp
[
0
].
minor
.
yy236
);
}
break
;
case
16
4
:
/* union ::= union UNION ALL select */
{
yygotominor
.
yy
93
=
appendSelectClause
(
yymsp
[
-
3
].
minor
.
yy93
,
yymsp
[
0
].
minor
.
yy224
);
}
case
16
5
:
/* union ::= union UNION ALL select */
{
yygotominor
.
yy
441
=
appendSelectClause
(
yymsp
[
-
3
].
minor
.
yy441
,
yymsp
[
0
].
minor
.
yy236
);
}
break
;
case
16
5
:
/* cmd ::= union */
{
setSqlInfo
(
pInfo
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_SQL_SELECT
);
}
case
16
6
:
/* cmd ::= union */
{
setSqlInfo
(
pInfo
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_SQL_SELECT
);
}
break
;
case
16
6
:
/* select ::= SELECT selcollist */
case
16
7
:
/* select ::= SELECT selcollist */
{
yygotominor
.
yy2
24
=
tSetQuerySqlNode
(
&
yymsp
[
-
1
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy93
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
yygotominor
.
yy2
36
=
tSetQuerySqlNode
(
&
yymsp
[
-
1
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy441
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
}
break
;
case
16
7
:
/* sclp ::= selcollist COMMA */
{
yygotominor
.
yy
93
=
yymsp
[
-
1
].
minor
.
yy93
;}
case
16
8
:
/* sclp ::= selcollist COMMA */
{
yygotominor
.
yy
441
=
yymsp
[
-
1
].
minor
.
yy441
;}
break
;
case
16
8
:
/* sclp ::= */
case
19
8
:
/* orderby_opt ::= */
yytestcase
(
yyruleno
==
198
);
{
yygotominor
.
yy
93
=
0
;}
case
16
9
:
/* sclp ::= */
case
19
9
:
/* orderby_opt ::= */
yytestcase
(
yyruleno
==
199
);
{
yygotominor
.
yy
441
=
0
;}
break
;
case
1
69
:
/* selcollist ::= sclp distinct expr as */
case
1
70
:
/* selcollist ::= sclp distinct expr as */
{
yygotominor
.
yy
93
=
tSqlExprListAppend
(
yymsp
[
-
3
].
minor
.
yy93
,
yymsp
[
-
1
].
minor
.
yy68
,
yymsp
[
-
2
].
minor
.
yy0
.
n
?
&
yymsp
[
-
2
].
minor
.
yy0
:
0
,
yymsp
[
0
].
minor
.
yy0
.
n
?&
yymsp
[
0
].
minor
.
yy0
:
0
);
yygotominor
.
yy
441
=
tSqlExprListAppend
(
yymsp
[
-
3
].
minor
.
yy441
,
yymsp
[
-
1
].
minor
.
yy166
,
yymsp
[
-
2
].
minor
.
yy0
.
n
?
&
yymsp
[
-
2
].
minor
.
yy0
:
0
,
yymsp
[
0
].
minor
.
yy0
.
n
?&
yymsp
[
0
].
minor
.
yy0
:
0
);
}
break
;
case
17
0
:
/* selcollist ::= sclp STAR */
case
17
1
:
/* selcollist ::= sclp STAR */
{
tSqlExpr
*
pNode
=
tSqlExprCreateIdValue
(
NULL
,
TK_ALL
);
yygotominor
.
yy
93
=
tSqlExprListAppend
(
yymsp
[
-
1
].
minor
.
yy93
,
pNode
,
0
,
0
);
yygotominor
.
yy
441
=
tSqlExprListAppend
(
yymsp
[
-
1
].
minor
.
yy441
,
pNode
,
0
,
0
);
}
break
;
case
17
1
:
/* as ::= AS ids */
case
17
2
:
/* as ::= ids */
yytestcase
(
yyruleno
==
172
);
case
17
2
:
/* as ::= AS ids */
case
17
3
:
/* as ::= ids */
yytestcase
(
yyruleno
==
173
);
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
17
3
:
/* as ::= */
case
17
4
:
/* as ::= */
{
yygotominor
.
yy0
.
n
=
0
;
}
break
;
case
17
4
:
/* distinct ::= DISTINCT */
case
17
5
:
/* distinct ::= DISTINCT */
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;
}
break
;
case
17
6
:
/* from ::= FROM tablelist */
case
17
7
:
/* from ::= FROM sub */
yytestcase
(
yyruleno
==
177
);
{
yygotominor
.
yy
330
=
yymsp
[
0
].
minor
.
yy330
;}
case
17
7
:
/* from ::= FROM tablelist */
case
17
8
:
/* from ::= FROM sub */
yytestcase
(
yyruleno
==
178
);
{
yygotominor
.
yy
244
=
yymsp
[
0
].
minor
.
yy244
;}
break
;
case
17
8
:
/* sub ::= LP union RP */
{
yygotominor
.
yy
330
=
addSubqueryElem
(
NULL
,
yymsp
[
-
1
].
minor
.
yy93
,
NULL
);}
case
17
9
:
/* sub ::= LP union RP */
{
yygotominor
.
yy
244
=
addSubqueryElem
(
NULL
,
yymsp
[
-
1
].
minor
.
yy441
,
NULL
);}
break
;
case
1
79
:
/* sub ::= LP union RP ids */
{
yygotominor
.
yy
330
=
addSubqueryElem
(
NULL
,
yymsp
[
-
2
].
minor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy0
);}
case
1
80
:
/* sub ::= LP union RP ids */
{
yygotominor
.
yy
244
=
addSubqueryElem
(
NULL
,
yymsp
[
-
2
].
minor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
18
0
:
/* sub ::= sub COMMA LP union RP ids */
{
yygotominor
.
yy
330
=
addSubqueryElem
(
yymsp
[
-
5
].
minor
.
yy330
,
yymsp
[
-
2
].
minor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy0
);}
case
18
1
:
/* sub ::= sub COMMA LP union RP ids */
{
yygotominor
.
yy
244
=
addSubqueryElem
(
yymsp
[
-
5
].
minor
.
yy244
,
yymsp
[
-
2
].
minor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
18
1
:
/* tablelist ::= ids cpxName */
case
18
2
:
/* tablelist ::= ids cpxName */
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yygotominor
.
yy
330
=
setTableNameList
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
yygotominor
.
yy
244
=
setTableNameList
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
}
break
;
case
18
2
:
/* tablelist ::= ids cpxName ids */
case
18
3
:
/* tablelist ::= ids cpxName ids */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
yymsp
[
-
1
].
minor
.
yy0
.
n
;
yygotominor
.
yy
330
=
setTableNameList
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
yygotominor
.
yy
244
=
setTableNameList
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
18
3
:
/* tablelist ::= tablelist COMMA ids cpxName */
case
18
4
:
/* tablelist ::= tablelist COMMA ids cpxName */
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yygotominor
.
yy
330
=
setTableNameList
(
yymsp
[
-
3
].
minor
.
yy330
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
yygotominor
.
yy
244
=
setTableNameList
(
yymsp
[
-
3
].
minor
.
yy244
,
&
yymsp
[
-
1
].
minor
.
yy0
,
NULL
);
}
break
;
case
18
4
:
/* tablelist ::= tablelist COMMA ids cpxName ids */
case
18
5
:
/* tablelist ::= tablelist COMMA ids cpxName ids */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
yymsp
[
-
1
].
minor
.
yy0
.
n
;
yygotominor
.
yy
330
=
setTableNameList
(
yymsp
[
-
4
].
minor
.
yy330
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
yygotominor
.
yy
244
=
setTableNameList
(
yymsp
[
-
4
].
minor
.
yy244
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
18
5
:
/* tmvar ::= VARIABLE */
case
18
6
:
/* tmvar ::= VARIABLE */
{
yygotominor
.
yy0
=
yymsp
[
0
].
minor
.
yy0
;}
break
;
case
18
6
:
/* interval_opt ::= INTERVAL LP tmvar RP */
{
yygotominor
.
yy
42
.
interval
=
yymsp
[
-
1
].
minor
.
yy0
;
yygotominor
.
yy42
.
offset
.
n
=
0
;}
case
18
7
:
/* interval_opt ::= INTERVAL LP tmvar RP */
{
yygotominor
.
yy
340
.
interval
=
yymsp
[
-
1
].
minor
.
yy0
;
yygotominor
.
yy340
.
offset
.
n
=
0
;}
break
;
case
18
7
:
/* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{
yygotominor
.
yy
42
.
interval
=
yymsp
[
-
3
].
minor
.
yy0
;
yygotominor
.
yy42
.
offset
=
yymsp
[
-
1
].
minor
.
yy0
;}
case
18
8
:
/* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{
yygotominor
.
yy
340
.
interval
=
yymsp
[
-
3
].
minor
.
yy0
;
yygotominor
.
yy340
.
offset
=
yymsp
[
-
1
].
minor
.
yy0
;}
break
;
case
18
8
:
/* interval_opt ::= */
{
memset
(
&
yygotominor
.
yy
42
,
0
,
sizeof
(
yygotominor
.
yy42
));}
case
18
9
:
/* interval_opt ::= */
{
memset
(
&
yygotominor
.
yy
340
,
0
,
sizeof
(
yygotominor
.
yy340
));}
break
;
case
1
89
:
/* session_option ::= */
{
yygotominor
.
yy
15
.
col
.
n
=
0
;
yygotominor
.
yy15
.
gap
.
n
=
0
;}
case
1
90
:
/* session_option ::= */
{
yygotominor
.
yy
259
.
col
.
n
=
0
;
yygotominor
.
yy259
.
gap
.
n
=
0
;}
break
;
case
19
0
:
/* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
case
19
1
:
/* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
yygotominor
.
yy
15
.
col
=
yymsp
[
-
4
].
minor
.
yy0
;
yygotominor
.
yy
15
.
gap
=
yymsp
[
-
1
].
minor
.
yy0
;
yygotominor
.
yy
259
.
col
=
yymsp
[
-
4
].
minor
.
yy0
;
yygotominor
.
yy
259
.
gap
=
yymsp
[
-
1
].
minor
.
yy0
;
}
break
;
case
19
1
:
/* windowstate_option ::= */
{
yygotominor
.
yy
274
.
col
.
n
=
0
;
yygotominor
.
yy274
.
col
.
z
=
NULL
;}
case
19
2
:
/* windowstate_option ::= */
{
yygotominor
.
yy
348
.
col
.
n
=
0
;
yygotominor
.
yy348
.
col
.
z
=
NULL
;}
break
;
case
19
2
:
/* windowstate_option ::= STATE_WINDOW LP ids RP */
{
yygotominor
.
yy
274
.
col
=
yymsp
[
-
1
].
minor
.
yy0
;
}
case
19
3
:
/* windowstate_option ::= STATE_WINDOW LP ids RP */
{
yygotominor
.
yy
348
.
col
=
yymsp
[
-
1
].
minor
.
yy0
;
}
break
;
case
19
3
:
/* fill_opt ::= */
{
yygotominor
.
yy
93
=
0
;
}
case
19
4
:
/* fill_opt ::= */
{
yygotominor
.
yy
441
=
0
;
}
break
;
case
19
4
:
/* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
case
19
5
:
/* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
tVariant
A
=
{
0
};
toTSDBType
(
yymsp
[
-
3
].
minor
.
yy0
.
type
);
tVariantCreate
(
&
A
,
&
yymsp
[
-
3
].
minor
.
yy0
);
tVariantListInsert
(
yymsp
[
-
1
].
minor
.
yy
93
,
&
A
,
-
1
,
0
);
yygotominor
.
yy
93
=
yymsp
[
-
1
].
minor
.
yy93
;
tVariantListInsert
(
yymsp
[
-
1
].
minor
.
yy
441
,
&
A
,
-
1
,
0
);
yygotominor
.
yy
441
=
yymsp
[
-
1
].
minor
.
yy441
;
}
break
;
case
19
5
:
/* fill_opt ::= FILL LP ID RP */
case
19
6
:
/* fill_opt ::= FILL LP ID RP */
{
toTSDBType
(
yymsp
[
-
1
].
minor
.
yy0
.
type
);
yygotominor
.
yy
93
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
-
1
);
yygotominor
.
yy
441
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy0
,
-
1
);
}
break
;
case
19
6
:
/* sliding_opt ::= SLIDING LP tmvar RP */
case
19
7
:
/* sliding_opt ::= SLIDING LP tmvar RP */
{
yygotominor
.
yy0
=
yymsp
[
-
1
].
minor
.
yy0
;
}
break
;
case
19
7
:
/* sliding_opt ::= */
case
19
8
:
/* sliding_opt ::= */
{
yygotominor
.
yy0
.
n
=
0
;
yygotominor
.
yy0
.
z
=
NULL
;
yygotominor
.
yy0
.
type
=
0
;
}
break
;
case
199
:
/* orderby_opt ::= ORDER BY sortlist */
{
yygotominor
.
yy
93
=
yymsp
[
0
].
minor
.
yy93
;}
case
200
:
/* orderby_opt ::= ORDER BY sortlist */
{
yygotominor
.
yy
441
=
yymsp
[
0
].
minor
.
yy441
;}
break
;
case
20
0
:
/* sortlist ::= sortlist COMMA item sortorder */
case
20
1
:
/* sortlist ::= sortlist COMMA item sortorder */
{
yygotominor
.
yy
93
=
tVariantListAppend
(
yymsp
[
-
3
].
minor
.
yy93
,
&
yymsp
[
-
1
].
minor
.
yy518
,
yymsp
[
0
].
minor
.
yy150
);
yygotominor
.
yy
441
=
tVariantListAppend
(
yymsp
[
-
3
].
minor
.
yy441
,
&
yymsp
[
-
1
].
minor
.
yy506
,
yymsp
[
0
].
minor
.
yy112
);
}
break
;
case
20
1
:
/* sortlist ::= item sortorder */
case
20
2
:
/* sortlist ::= item sortorder */
{
yygotominor
.
yy
93
=
tVariantListAppend
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy518
,
yymsp
[
0
].
minor
.
yy150
);
yygotominor
.
yy
441
=
tVariantListAppend
(
NULL
,
&
yymsp
[
-
1
].
minor
.
yy506
,
yymsp
[
0
].
minor
.
yy112
);
}
break
;
case
20
2
:
/* item ::= ids cpxName */
case
20
3
:
/* item ::= ids cpxName */
{
toTSDBType
(
yymsp
[
-
1
].
minor
.
yy0
.
type
);
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
tVariantCreate
(
&
yygotominor
.
yy5
18
,
&
yymsp
[
-
1
].
minor
.
yy0
);
tVariantCreate
(
&
yygotominor
.
yy5
06
,
&
yymsp
[
-
1
].
minor
.
yy0
);
}
break
;
case
20
3
:
/* sortorder ::= ASC */
case
20
5
:
/* sortorder ::= */
yytestcase
(
yyruleno
==
205
);
{
yygotominor
.
yy1
50
=
TSDB_ORDER_ASC
;
}
case
20
4
:
/* sortorder ::= ASC */
case
20
6
:
/* sortorder ::= */
yytestcase
(
yyruleno
==
206
);
{
yygotominor
.
yy1
12
=
TSDB_ORDER_ASC
;
}
break
;
case
20
4
:
/* sortorder ::= DESC */
{
yygotominor
.
yy1
50
=
TSDB_ORDER_DESC
;}
case
20
5
:
/* sortorder ::= DESC */
{
yygotominor
.
yy1
12
=
TSDB_ORDER_DESC
;}
break
;
case
20
6
:
/* groupby_opt ::= */
{
yygotominor
.
yy
93
=
0
;}
case
20
7
:
/* groupby_opt ::= */
{
yygotominor
.
yy
441
=
0
;}
break
;
case
20
7
:
/* groupby_opt ::= GROUP BY grouplist */
{
yygotominor
.
yy
93
=
yymsp
[
0
].
minor
.
yy93
;}
case
20
8
:
/* groupby_opt ::= GROUP BY grouplist */
{
yygotominor
.
yy
441
=
yymsp
[
0
].
minor
.
yy441
;}
break
;
case
20
8
:
/* grouplist ::= grouplist COMMA item */
case
20
9
:
/* grouplist ::= grouplist COMMA item */
{
yygotominor
.
yy
93
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy93
,
&
yymsp
[
0
].
minor
.
yy518
,
-
1
);
yygotominor
.
yy
441
=
tVariantListAppend
(
yymsp
[
-
2
].
minor
.
yy441
,
&
yymsp
[
0
].
minor
.
yy506
,
-
1
);
}
break
;
case
2
09
:
/* grouplist ::= item */
case
2
10
:
/* grouplist ::= item */
{
yygotominor
.
yy
93
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy518
,
-
1
);
yygotominor
.
yy
441
=
tVariantListAppend
(
NULL
,
&
yymsp
[
0
].
minor
.
yy506
,
-
1
);
}
break
;
case
21
0
:
/* having_opt ::= */
case
22
0
:
/* where_opt ::= */
yytestcase
(
yyruleno
==
220
);
case
26
2
:
/* expritem ::= */
yytestcase
(
yyruleno
==
262
);
{
yygotominor
.
yy
68
=
0
;}
case
21
1
:
/* having_opt ::= */
case
22
1
:
/* where_opt ::= */
yytestcase
(
yyruleno
==
221
);
case
26
3
:
/* expritem ::= */
yytestcase
(
yyruleno
==
263
);
{
yygotominor
.
yy
166
=
0
;}
break
;
case
21
1
:
/* having_opt ::= HAVING expr */
case
22
1
:
/* where_opt ::= WHERE expr */
yytestcase
(
yyruleno
==
221
);
case
26
1
:
/* expritem ::= expr */
yytestcase
(
yyruleno
==
261
);
{
yygotominor
.
yy
68
=
yymsp
[
0
].
minor
.
yy68
;}
case
21
2
:
/* having_opt ::= HAVING expr */
case
22
2
:
/* where_opt ::= WHERE expr */
yytestcase
(
yyruleno
==
222
);
case
26
2
:
/* expritem ::= expr */
yytestcase
(
yyruleno
==
262
);
{
yygotominor
.
yy
166
=
yymsp
[
0
].
minor
.
yy166
;}
break
;
case
21
2
:
/* limit_opt ::= */
case
21
6
:
/* slimit_opt ::= */
yytestcase
(
yyruleno
==
216
);
{
yygotominor
.
yy
284
.
limit
=
-
1
;
yygotominor
.
yy28
4
.
offset
=
0
;}
case
21
3
:
/* limit_opt ::= */
case
21
7
:
/* slimit_opt ::= */
yytestcase
(
yyruleno
==
217
);
{
yygotominor
.
yy
414
.
limit
=
-
1
;
yygotominor
.
yy41
4
.
offset
=
0
;}
break
;
case
21
3
:
/* limit_opt ::= LIMIT signed */
case
21
7
:
/* slimit_opt ::= SLIMIT signed */
yytestcase
(
yyruleno
==
217
);
{
yygotominor
.
yy
284
.
limit
=
yymsp
[
0
].
minor
.
yy279
;
yygotominor
.
yy28
4
.
offset
=
0
;}
case
21
4
:
/* limit_opt ::= LIMIT signed */
case
21
8
:
/* slimit_opt ::= SLIMIT signed */
yytestcase
(
yyruleno
==
218
);
{
yygotominor
.
yy
414
.
limit
=
yymsp
[
0
].
minor
.
yy369
;
yygotominor
.
yy41
4
.
offset
=
0
;}
break
;
case
21
4
:
/* limit_opt ::= LIMIT signed OFFSET signed */
{
yygotominor
.
yy
284
.
limit
=
yymsp
[
-
2
].
minor
.
yy279
;
yygotominor
.
yy284
.
offset
=
yymsp
[
0
].
minor
.
yy27
9
;}
case
21
5
:
/* limit_opt ::= LIMIT signed OFFSET signed */
{
yygotominor
.
yy
414
.
limit
=
yymsp
[
-
2
].
minor
.
yy369
;
yygotominor
.
yy414
.
offset
=
yymsp
[
0
].
minor
.
yy36
9
;}
break
;
case
21
5
:
/* limit_opt ::= LIMIT signed COMMA signed */
{
yygotominor
.
yy
284
.
limit
=
yymsp
[
0
].
minor
.
yy279
;
yygotominor
.
yy284
.
offset
=
yymsp
[
-
2
].
minor
.
yy27
9
;}
case
21
6
:
/* limit_opt ::= LIMIT signed COMMA signed */
{
yygotominor
.
yy
414
.
limit
=
yymsp
[
0
].
minor
.
yy369
;
yygotominor
.
yy414
.
offset
=
yymsp
[
-
2
].
minor
.
yy36
9
;}
break
;
case
21
8
:
/* slimit_opt ::= SLIMIT signed SOFFSET signed */
{
yygotominor
.
yy
284
.
limit
=
yymsp
[
-
2
].
minor
.
yy279
;
yygotominor
.
yy284
.
offset
=
yymsp
[
0
].
minor
.
yy27
9
;}
case
21
9
:
/* slimit_opt ::= SLIMIT signed SOFFSET signed */
{
yygotominor
.
yy
414
.
limit
=
yymsp
[
-
2
].
minor
.
yy369
;
yygotominor
.
yy414
.
offset
=
yymsp
[
0
].
minor
.
yy36
9
;}
break
;
case
2
19
:
/* slimit_opt ::= SLIMIT signed COMMA signed */
{
yygotominor
.
yy
284
.
limit
=
yymsp
[
0
].
minor
.
yy279
;
yygotominor
.
yy284
.
offset
=
yymsp
[
-
2
].
minor
.
yy27
9
;}
case
2
20
:
/* slimit_opt ::= SLIMIT signed COMMA signed */
{
yygotominor
.
yy
414
.
limit
=
yymsp
[
0
].
minor
.
yy369
;
yygotominor
.
yy414
.
offset
=
yymsp
[
-
2
].
minor
.
yy36
9
;}
break
;
case
22
2
:
/* expr ::= LP expr RP */
{
yygotominor
.
yy
68
=
yymsp
[
-
1
].
minor
.
yy68
;
yygotominor
.
yy68
->
token
.
z
=
yymsp
[
-
2
].
minor
.
yy0
.
z
;
yygotominor
.
yy68
->
token
.
n
=
(
yymsp
[
0
].
minor
.
yy0
.
z
-
yymsp
[
-
2
].
minor
.
yy0
.
z
+
1
);}
case
22
3
:
/* expr ::= LP expr RP */
{
yygotominor
.
yy
166
=
yymsp
[
-
1
].
minor
.
yy166
;
yygotominor
.
yy166
->
token
.
z
=
yymsp
[
-
2
].
minor
.
yy0
.
z
;
yygotominor
.
yy166
->
token
.
n
=
(
yymsp
[
0
].
minor
.
yy0
.
z
-
yymsp
[
-
2
].
minor
.
yy0
.
z
+
1
);}
break
;
case
22
3
:
/* expr ::= ID */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_ID
);}
case
22
4
:
/* expr ::= ID */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_ID
);}
break
;
case
22
4
:
/* expr ::= ID DOT ID */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ID
);}
case
22
5
:
/* expr ::= ID DOT ID */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ID
);}
break
;
case
22
5
:
/* expr ::= ID DOT STAR */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ALL
);}
case
22
6
:
/* expr ::= ID DOT STAR */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
1
+
yymsp
[
0
].
minor
.
yy0
.
n
);
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
2
].
minor
.
yy0
,
TK_ALL
);}
break
;
case
22
6
:
/* expr ::= INTEGER */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_INTEGER
);}
case
22
7
:
/* expr ::= INTEGER */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_INTEGER
);}
break
;
case
22
7
:
/* expr ::= MINUS INTEGER */
case
22
8
:
/* expr ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
228
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_INTEGER
;
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_INTEGER
);}
case
22
8
:
/* expr ::= MINUS INTEGER */
case
22
9
:
/* expr ::= PLUS INTEGER */
yytestcase
(
yyruleno
==
229
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_INTEGER
;
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_INTEGER
);}
break
;
case
2
29
:
/* expr ::= FLOAT */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_FLOAT
);}
case
2
30
:
/* expr ::= FLOAT */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_FLOAT
);}
break
;
case
23
0
:
/* expr ::= MINUS FLOAT */
case
23
1
:
/* expr ::= PLUS FLOAT */
yytestcase
(
yyruleno
==
231
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_FLOAT
;
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_FLOAT
);}
case
23
1
:
/* expr ::= MINUS FLOAT */
case
23
2
:
/* expr ::= PLUS FLOAT */
yytestcase
(
yyruleno
==
232
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_FLOAT
;
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_FLOAT
);}
break
;
case
23
2
:
/* expr ::= STRING */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_STRING
);}
case
23
3
:
/* expr ::= STRING */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_STRING
);}
break
;
case
23
3
:
/* expr ::= NOW */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NOW
);
}
case
23
4
:
/* expr ::= NOW */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NOW
);
}
break
;
case
23
4
:
/* expr ::= VARIABLE */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_VARIABLE
);}
case
23
5
:
/* expr ::= VARIABLE */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_VARIABLE
);}
break
;
case
23
5
:
/* expr ::= PLUS VARIABLE */
case
23
6
:
/* expr ::= MINUS VARIABLE */
yytestcase
(
yyruleno
==
236
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_VARIABLE
;
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_VARIABLE
);}
case
23
6
:
/* expr ::= PLUS VARIABLE */
case
23
7
:
/* expr ::= MINUS VARIABLE */
yytestcase
(
yyruleno
==
237
);
{
yymsp
[
-
1
].
minor
.
yy0
.
n
+=
yymsp
[
0
].
minor
.
yy0
.
n
;
yymsp
[
-
1
].
minor
.
yy0
.
type
=
TK_VARIABLE
;
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
-
1
].
minor
.
yy0
,
TK_VARIABLE
);}
break
;
case
23
7
:
/* expr ::= BOOL */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_BOOL
);}
case
23
8
:
/* expr ::= BOOL */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_BOOL
);}
break
;
case
23
8
:
/* expr ::= NULL */
{
yygotominor
.
yy
68
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NULL
);}
case
23
9
:
/* expr ::= NULL */
{
yygotominor
.
yy
166
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NULL
);}
break
;
case
2
39
:
/* expr ::= ID LP exprlist RP */
{
yygotominor
.
yy
68
=
tSqlExprCreateFunction
(
yymsp
[
-
1
].
minor
.
yy93
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
case
2
40
:
/* expr ::= ID LP exprlist RP */
{
yygotominor
.
yy
166
=
tSqlExprCreateFunction
(
yymsp
[
-
1
].
minor
.
yy441
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
break
;
case
24
0
:
/* expr ::= ID LP STAR RP */
{
yygotominor
.
yy
68
=
tSqlExprCreateFunction
(
NULL
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
case
24
1
:
/* expr ::= ID LP STAR RP */
{
yygotominor
.
yy
166
=
tSqlExprCreateFunction
(
NULL
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
break
;
case
24
1
:
/* expr ::= expr IS NULL */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
NULL
,
TK_ISNULL
);}
case
24
2
:
/* expr ::= expr IS NULL */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
NULL
,
TK_ISNULL
);}
break
;
case
24
2
:
/* expr ::= expr IS NOT NULL */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
3
].
minor
.
yy68
,
NULL
,
TK_NOTNULL
);}
case
24
3
:
/* expr ::= expr IS NOT NULL */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
3
].
minor
.
yy166
,
NULL
,
TK_NOTNULL
);}
break
;
case
24
3
:
/* expr ::= expr LT expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_LT
);}
case
24
4
:
/* expr ::= expr LT expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_LT
);}
break
;
case
24
4
:
/* expr ::= expr GT expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_GT
);}
case
24
5
:
/* expr ::= expr GT expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_GT
);}
break
;
case
24
5
:
/* expr ::= expr LE expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_LE
);}
case
24
6
:
/* expr ::= expr LE expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_LE
);}
break
;
case
24
6
:
/* expr ::= expr GE expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_GE
);}
case
24
7
:
/* expr ::= expr GE expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_GE
);}
break
;
case
24
7
:
/* expr ::= expr NE expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_NE
);}
case
24
8
:
/* expr ::= expr NE expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_NE
);}
break
;
case
24
8
:
/* expr ::= expr EQ expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_EQ
);}
case
24
9
:
/* expr ::= expr EQ expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_EQ
);}
break
;
case
2
49
:
/* expr ::= expr BETWEEN expr AND expr */
{
tSqlExpr
*
X2
=
tSqlExprClone
(
yymsp
[
-
4
].
minor
.
yy
68
);
yygotominor
.
yy68
=
tSqlExprCreate
(
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy68
,
yymsp
[
-
2
].
minor
.
yy68
,
TK_GE
),
tSqlExprCreate
(
X2
,
yymsp
[
0
].
minor
.
yy68
,
TK_LE
),
TK_AND
);}
case
2
50
:
/* expr ::= expr BETWEEN expr AND expr */
{
tSqlExpr
*
X2
=
tSqlExprClone
(
yymsp
[
-
4
].
minor
.
yy
166
);
yygotominor
.
yy166
=
tSqlExprCreate
(
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy166
,
yymsp
[
-
2
].
minor
.
yy166
,
TK_GE
),
tSqlExprCreate
(
X2
,
yymsp
[
0
].
minor
.
yy166
,
TK_LE
),
TK_AND
);}
break
;
case
25
0
:
/* expr ::= expr AND expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_AND
);}
case
25
1
:
/* expr ::= expr AND expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_AND
);}
break
;
case
25
1
:
/* expr ::= expr OR expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_OR
);
}
case
25
2
:
/* expr ::= expr OR expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_OR
);
}
break
;
case
25
2
:
/* expr ::= expr PLUS expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_PLUS
);
}
case
25
3
:
/* expr ::= expr PLUS expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_PLUS
);
}
break
;
case
25
3
:
/* expr ::= expr MINUS expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_MINUS
);
}
case
25
4
:
/* expr ::= expr MINUS expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_MINUS
);
}
break
;
case
25
4
:
/* expr ::= expr STAR expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_STAR
);
}
case
25
5
:
/* expr ::= expr STAR expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_STAR
);
}
break
;
case
25
5
:
/* expr ::= expr SLASH expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_DIVIDE
);}
case
25
6
:
/* expr ::= expr SLASH expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_DIVIDE
);}
break
;
case
25
6
:
/* expr ::= expr REM expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_REM
);
}
case
25
7
:
/* expr ::= expr REM expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_REM
);
}
break
;
case
25
7
:
/* expr ::= expr LIKE expr */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy68
,
yymsp
[
0
].
minor
.
yy68
,
TK_LIKE
);
}
case
25
8
:
/* expr ::= expr LIKE expr */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy166
,
yymsp
[
0
].
minor
.
yy166
,
TK_LIKE
);
}
break
;
case
25
8
:
/* expr ::= expr IN LP exprlist RP */
{
yygotominor
.
yy
68
=
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy68
,
(
tSqlExpr
*
)
yymsp
[
-
1
].
minor
.
yy93
,
TK_IN
);
}
case
25
9
:
/* expr ::= expr IN LP exprlist RP */
{
yygotominor
.
yy
166
=
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy166
,
(
tSqlExpr
*
)
yymsp
[
-
1
].
minor
.
yy441
,
TK_IN
);
}
break
;
case
2
59
:
/* exprlist ::= exprlist COMMA expritem */
{
yygotominor
.
yy
93
=
tSqlExprListAppend
(
yymsp
[
-
2
].
minor
.
yy93
,
yymsp
[
0
].
minor
.
yy68
,
0
,
0
);}
case
2
60
:
/* exprlist ::= exprlist COMMA expritem */
{
yygotominor
.
yy
441
=
tSqlExprListAppend
(
yymsp
[
-
2
].
minor
.
yy441
,
yymsp
[
0
].
minor
.
yy166
,
0
,
0
);}
break
;
case
26
0
:
/* exprlist ::= expritem */
{
yygotominor
.
yy
93
=
tSqlExprListAppend
(
0
,
yymsp
[
0
].
minor
.
yy68
,
0
,
0
);}
case
26
1
:
/* exprlist ::= expritem */
{
yygotominor
.
yy
441
=
tSqlExprListAppend
(
0
,
yymsp
[
0
].
minor
.
yy166
,
0
,
0
);}
break
;
case
26
3
:
/* cmd ::= RESET QUERY CACHE */
case
26
4
:
/* cmd ::= RESET QUERY CACHE */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_RESET_CACHE
,
0
);}
break
;
case
26
4
:
/* cmd ::= SYNCDB ids REPLICA */
case
26
5
:
/* cmd ::= SYNCDB ids REPLICA */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_SYNC_DB_REPLICA
,
1
,
&
yymsp
[
-
1
].
minor
.
yy0
);}
break
;
case
26
5
:
/* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
case
26
6
:
/* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
6
:
/* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
case
26
7
:
/* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -2630,21 +2638,21 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
7
:
/* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
case
26
8
:
/* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
8
:
/* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
case
26
9
:
/* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
2
69
:
/* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
case
2
70
:
/* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -2655,7 +2663,7 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
0
:
/* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
case
27
1
:
/* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
...
...
@@ -2669,33 +2677,33 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
1
:
/* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
case
27
2
:
/* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp
[
-
6
].
minor
.
yy0
.
n
+=
yymsp
[
-
5
].
minor
.
yy0
.
n
;
toTSDBType
(
yymsp
[
-
2
].
minor
.
yy0
.
type
);
SArray
*
A
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy5
18
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy5
06
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
6
].
minor
.
yy0
,
NULL
,
A
,
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
2
:
/* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
case
27
3
:
/* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
3
:
/* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
case
27
4
:
/* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
4
:
/* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
case
27
5
:
/* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -2706,21 +2714,21 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
5
:
/* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
case
27
6
:
/* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_CHANGE_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
6
:
/* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
case
27
7
:
/* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
7
:
/* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
case
27
8
:
/* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -2731,7 +2739,7 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
27
8
:
/* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
case
27
9
:
/* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
...
...
@@ -2745,32 +2753,32 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
2
79
:
/* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
case
2
80
:
/* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp
[
-
6
].
minor
.
yy0
.
n
+=
yymsp
[
-
5
].
minor
.
yy0
.
n
;
toTSDBType
(
yymsp
[
-
2
].
minor
.
yy0
.
type
);
SArray
*
A
=
tVariantListAppendToken
(
NULL
,
&
yymsp
[
-
2
].
minor
.
yy0
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy5
18
,
-
1
);
A
=
tVariantListAppend
(
A
,
&
yymsp
[
0
].
minor
.
yy5
06
,
-
1
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
6
].
minor
.
yy0
,
NULL
,
A
,
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
28
0
:
/* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
case
28
1
:
/* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
93
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy
441
,
NULL
,
TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
28
1
:
/* cmd ::= KILL CONNECTION INTEGER */
case
28
2
:
/* cmd ::= KILL CONNECTION INTEGER */
{
setKillSql
(
pInfo
,
TSDB_SQL_KILL_CONNECTION
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
28
2
:
/* cmd ::= KILL STREAM INTEGER COLON INTEGER */
case
28
3
:
/* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
+
yymsp
[
0
].
minor
.
yy0
.
n
);
setKillSql
(
pInfo
,
TSDB_SQL_KILL_STREAM
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
case
28
3
:
/* cmd ::= KILL QUERY INTEGER COLON INTEGER */
case
28
4
:
/* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
+
yymsp
[
0
].
minor
.
yy0
.
n
);
setKillSql
(
pInfo
,
TSDB_SQL_KILL_QUERY
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
default:
...
...
src/tsdb/src/tsdbCompact.c
浏览文件 @
86bbd50e
...
...
@@ -118,406 +118,407 @@ static int tsdbCompactMeta(STsdbRepo *pRepo) {
return
0
;
}
static
int
tsdbCompactTSData
(
STsdbRepo
*
pRepo
)
{
SCompactH
compactH
;
SDFileSet
*
pSet
=
NULL
;
static
int
tsdbCompactTSData
(
STsdbRepo
*
pRepo
)
{
SCompactH
compactH
;
SDFileSet
*
pSet
=
NULL
;
tsdbDebug
(
"vgId:%d start to compact TS data"
,
REPO_ID
(
pRepo
));
tsdbDebug
(
"vgId:%d start to compact TS data"
,
REPO_ID
(
pRepo
));
// If no file, just return 0;
if
(
taosArrayGetSize
(
REPO_FS
(
pRepo
)
->
cstatus
->
df
)
<=
0
)
{
tsdbDebug
(
"vgId:%d no TS data file to compact, compact over"
,
REPO_ID
(
pRepo
));
return
0
;
}
if
(
tsdbInitCompactH
(
&
compactH
,
pRepo
)
<
0
)
{
return
-
1
;
}
while
((
pSet
=
tsdbFSIterNext
(
&
(
compactH
.
fsIter
))))
{
// Remove those expired files
if
(
pSet
->
fid
<
compactH
.
rtn
.
minFid
)
{
tsdbInfo
(
"vgId:%d FSET %d on level %d disk id %d expires, remove it"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TSDB_FSET_LEVEL
(
pSet
),
TSDB_FSET_ID
(
pSet
));
continue
;
// If no file, just return 0;
if
(
taosArrayGetSize
(
REPO_FS
(
pRepo
)
->
cstatus
->
df
)
<=
0
)
{
tsdbDebug
(
"vgId:%d no TS data file to compact, compact over"
,
REPO_ID
(
pRepo
));
return
0
;
}
if
(
TSDB_FSET_LEVEL
(
pSet
)
==
TFS_MAX_LEVEL
)
{
tsdbDebug
(
"vgId:%d FSET %d on level %d, should not compact"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TFS_MAX_LEVEL
);
tsdbUpdateDFileSet
(
REPO_FS
(
pRepo
),
pSet
);
continue
;
}
if
(
tsdbCompactFSet
(
&
compactH
,
pSet
)
<
0
)
{
tsdbDestroyCompactH
(
&
compactH
);
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
if
(
tsdbInitCompactH
(
&
compactH
,
pRepo
)
<
0
)
{
return
-
1
;
}
}
tsdbDestroyCompactH
(
&
compactH
);
tsdbDebug
(
"vgId:%d compact TS data over"
,
REPO_ID
(
pRepo
));
return
0
;
}
while
((
pSet
=
tsdbFSIterNext
(
&
(
compactH
.
fsIter
))))
{
// Remove those expired files
if
(
pSet
->
fid
<
compactH
.
rtn
.
minFid
)
{
tsdbInfo
(
"vgId:%d FSET %d on level %d disk id %d expires, remove it"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TSDB_FSET_LEVEL
(
pSet
),
TSDB_FSET_ID
(
pSet
));
continue
;
}
static
int
tsdbCompactFSet
(
SCompactH
*
pComph
,
SDFileSet
*
pSet
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
SDiskID
did
;
if
(
TSDB_FSET_LEVEL
(
pSet
)
==
TFS_MAX_LEVEL
)
{
tsdbDebug
(
"vgId:%d FSET %d on level %d, should not compact"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TFS_MAX_LEVEL
);
tsdbUpdateDFileSet
(
REPO_FS
(
pRepo
),
pSet
);
continue
;
}
tsdbDebug
(
"vgId:%d start to compact FSET %d on level %d id %d"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TSDB_FSET_LEVEL
(
pSet
),
TSDB_FSET_ID
(
pSet
));
if
(
tsdbCompactFSet
(
&
compactH
,
pSet
)
<
0
)
{
tsdbDestroyCompactH
(
&
compactH
);
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
return
-
1
;
}
}
if
(
tsdbCompactFSetInit
(
pComph
,
pSet
)
<
0
)
{
return
-
1
;
tsdbDestroyCompactH
(
&
compactH
);
tsdbDebug
(
"vgId:%d compact TS data over"
,
REPO_ID
(
pRepo
));
return
0
;
}
if
(
!
tsdbShouldCompact
(
pComph
))
{
tsdbDebug
(
"vgId:%d no need to compact FSET %d"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
if
(
tsdbApplyRtnOnFSet
(
TSDB_COMPACT_REPO
(
pComph
),
pSet
,
&
(
pComph
->
rtn
))
<
0
)
{
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
}
else
{
// Create new fset as compacted fset
tfsAllocDisk
(
tsdbGetFidLevel
(
pSet
->
fid
,
&
(
pComph
->
rtn
)),
&
(
did
.
level
),
&
(
did
.
id
));
if
(
did
.
level
==
TFS_UNDECIDED_LEVEL
)
{
terrno
=
TSDB_CODE_TDB_NO_AVAIL_DISK
;
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
static
int
tsdbCompactFSet
(
SCompactH
*
pComph
,
SDFileSet
*
pSet
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
SDiskID
did
;
tsdbDebug
(
"vgId:%d start to compact FSET %d on level %d id %d"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
TSDB_FSET_LEVEL
(
pSet
),
TSDB_FSET_ID
(
pSet
));
tsdbInitDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
did
,
REPO_ID
(
pRepo
),
TSDB_FSET_FID
(
pSet
),
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
if
(
tsdbCreateDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCompactFSetEnd
(
pComph
);
if
(
tsdbCompactFSetInit
(
pComph
,
pSet
)
<
0
)
{
return
-
1
;
}
if
(
tsdbCompactFSetImpl
(
pComph
)
<
0
)
{
if
(
!
tsdbShouldCompact
(
pComph
))
{
tsdbDebug
(
"vgId:%d no need to compact FSET %d"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
if
(
tsdbApplyRtnOnFSet
(
TSDB_COMPACT_REPO
(
pComph
),
pSet
,
&
(
pComph
->
rtn
))
<
0
)
{
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
}
else
{
// Create new fset as compacted fset
tfsAllocDisk
(
tsdbGetFidLevel
(
pSet
->
fid
,
&
(
pComph
->
rtn
)),
&
(
did
.
level
),
&
(
did
.
id
));
if
(
did
.
level
==
TFS_UNDECIDED_LEVEL
)
{
terrno
=
TSDB_CODE_TDB_NO_AVAIL_DISK
;
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
tsdbInitDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
did
,
REPO_ID
(
pRepo
),
TSDB_FSET_FID
(
pSet
),
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
if
(
tsdbCreateDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
if
(
tsdbCompactFSetImpl
(
pComph
)
<
0
)
{
tsdbCloseDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbRemoveDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
}
tsdbCloseDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbRemoveDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbCompactFSetEnd
(
pComph
);
return
-
1
;
tsdbUpdateDFileSet
(
REPO_FS
(
pRepo
),
TSDB_COMPACT_WSET
(
pComph
));
tsdbDebug
(
"vgId:%d FSET %d compact over"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
}
tsdbCloseDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbUpdateDFileSet
(
REPO_FS
(
pRepo
),
TSDB_COMPACT_WSET
(
pComph
));
tsdbDebug
(
"vgId:%d FSET %d compact over"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
tsdbCompactFSetEnd
(
pComph
);
return
0
;
}
tsdbCompactFSetEnd
(
pComph
);
return
0
;
}
static
bool
tsdbShouldCompact
(
SCompactH
*
pComph
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SReadH
*
pReadh
=
&
(
pComph
->
readh
);
STableCompactH
*
pTh
;
SBlock
*
pBlock
;
int
defaultRows
=
TSDB_DEFAULT_BLOCK_ROWS
(
pCfg
->
maxRowsPerFileBlock
);
SDFile
*
pDataF
=
TSDB_READ_DATA_FILE
(
pReadh
);
SDFile
*
pLastF
=
TSDB_READ_LAST_FILE
(
pReadh
);
static
bool
tsdbShouldCompact
(
SCompactH
*
pComph
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SReadH
*
pReadh
=
&
(
pComph
->
readh
);
STableCompactH
*
pTh
;
SBlock
*
pBlock
;
int
defaultRows
=
TSDB_DEFAULT_BLOCK_ROWS
(
pCfg
->
maxRowsPerFileBlock
);
SDFile
*
pDataF
=
TSDB_READ_DATA_FILE
(
pReadh
);
SDFile
*
pLastF
=
TSDB_READ_LAST_FILE
(
pReadh
);
int
tblocks
=
0
;
// total blocks
int
nSubBlocks
=
0
;
// # of blocks with sub-blocks
int
nSmallBlocks
=
0
;
// # of blocks with rows < defaultRows
int64_t
tsize
=
0
;
int
tblocks
=
0
;
// total blocks
int
nSubBlocks
=
0
;
// # of blocks with sub-blocks
int
nSmallBlocks
=
0
;
// # of blocks with rows < defaultRows
int64_t
tsize
=
0
;
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pComph
->
tbArray
);
i
++
)
{
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
i
);
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pComph
->
tbArray
);
i
++
)
{
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
i
);
if
(
pTh
->
pTable
==
NULL
||
pTh
->
pBlkIdx
==
NULL
)
continue
;
if
(
pTh
->
pTable
==
NULL
||
pTh
->
pBlkIdx
==
NULL
)
continue
;
for
(
size_t
bidx
=
0
;
bidx
<
pTh
->
pBlkIdx
->
numOfBlocks
;
bidx
++
)
{
tblocks
++
;
pBlock
=
pTh
->
pInfo
->
blocks
+
bidx
;
for
(
size_t
bidx
=
0
;
bidx
<
pTh
->
pBlkIdx
->
numOfBlocks
;
bidx
++
)
{
tblocks
++
;
pBlock
=
pTh
->
pInfo
->
blocks
+
bidx
;
if
(
pBlock
->
numOfRows
<
defaultRows
)
{
nSmallBlocks
++
;
}
if
(
pBlock
->
numOfRows
<
defaultRows
)
{
nSmallBlocks
++
;
}
if
(
pBlock
->
numOfSubBlocks
>
1
)
{
nSubBlocks
++
;
for
(
int
k
=
0
;
k
<
pBlock
->
numOfSubBlocks
;
k
++
)
{
SBlock
*
iBlock
=
((
SBlock
*
)
POINTER_SHIFT
(
pTh
->
pInfo
,
pBlock
->
offset
))
+
k
;
tsize
=
tsize
+
iBlock
->
len
;
if
(
pBlock
->
numOfSubBlocks
>
1
)
{
nSubBlocks
++
;
for
(
int
k
=
0
;
k
<
pBlock
->
numOfSubBlocks
;
k
++
)
{
SBlock
*
iBlock
=
((
SBlock
*
)
POINTER_SHIFT
(
pTh
->
pInfo
,
pBlock
->
offset
))
+
k
;
tsize
=
tsize
+
iBlock
->
len
;
}
}
else
if
(
pBlock
->
numOfSubBlocks
==
1
)
{
tsize
+=
pBlock
->
len
;
}
else
{
ASSERT
(
0
);
}
}
else
if
(
pBlock
->
numOfSubBlocks
==
1
)
{
tsize
+=
pBlock
->
len
;
}
else
{
ASSERT
(
0
);
}
}
return
(((
nSubBlocks
*
1
.
0
/
tblocks
)
>
0
.
33
)
||
((
nSmallBlocks
*
1
.
0
/
tblocks
)
>
0
.
33
)
||
(
tsize
*
1
.
0
/
(
pDataF
->
info
.
size
+
pLastF
->
info
.
size
-
2
*
TSDB_FILE_HEAD_SIZE
)
<
0
.
85
));
}
return
(((
nSubBlocks
*
1
.
0
/
tblocks
)
>
0
.
33
)
||
((
nSmallBlocks
*
1
.
0
/
tblocks
)
>
0
.
33
)
||
(
tsize
*
1
.
0
/
(
pDataF
->
info
.
size
+
pLastF
->
info
.
size
-
2
*
TSDB_FILE_HEAD_SIZE
)
<
0
.
85
));
}
static
int
tsdbInitCompactH
(
SCompactH
*
pComph
,
STsdbRepo
*
pRepo
)
{
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
static
int
tsdbInitCompactH
(
SCompactH
*
pComph
,
STsdbRepo
*
pRepo
)
{
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
memset
(
pComph
,
0
,
sizeof
(
*
pComph
));
memset
(
pComph
,
0
,
sizeof
(
*
pComph
));
TSDB_FSET_SET_CLOSED
(
TSDB_COMPACT_WSET
(
pComph
));
TSDB_FSET_SET_CLOSED
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbGetRtnSnap
(
pRepo
,
&
(
pComph
->
rtn
));
tsdbFSIterInit
(
&
(
pComph
->
fsIter
),
REPO_FS
(
pRepo
),
TSDB_FS_ITER_FORWARD
);
tsdbGetRtnSnap
(
pRepo
,
&
(
pComph
->
rtn
));
tsdbFSIterInit
(
&
(
pComph
->
fsIter
),
REPO_FS
(
pRepo
),
TSDB_FS_ITER_FORWARD
);
if
(
tsdbInitReadH
(
&
(
pComph
->
readh
),
pRepo
)
<
0
)
{
return
-
1
;
}
if
(
tsdbInitReadH
(
&
(
pComph
->
readh
),
pRepo
)
<
0
)
{
return
-
1
;
}
if
(
tsdbInitCompTbArray
(
pComph
)
<
0
)
{
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
if
(
tsdbInitCompTbArray
(
pComph
)
<
0
)
{
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
aBlkIdx
=
taosArrayInit
(
1024
,
sizeof
(
SBlockIdx
));
if
(
pComph
->
aBlkIdx
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
aBlkIdx
=
taosArrayInit
(
1024
,
sizeof
(
SBlockIdx
));
if
(
pComph
->
aBlkIdx
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
aSupBlk
=
taosArrayInit
(
1024
,
sizeof
(
SBlock
));
if
(
pComph
->
aSupBlk
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
aSupBlk
=
taosArrayInit
(
1024
,
sizeof
(
SBlock
)
);
if
(
pComph
->
aSupBlk
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
pDataCols
=
tdNewDataCols
(
0
,
0
,
pCfg
->
maxRowsPerFileBlock
);
if
(
pComph
->
pDataCols
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
}
pComph
->
pDataCols
=
tdNewDataCols
(
0
,
0
,
pCfg
->
maxRowsPerFileBlock
);
if
(
pComph
->
pDataCols
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbDestroyCompactH
(
pComph
);
return
-
1
;
return
0
;
}
return
0
;
}
static
void
tsdbDestroyCompactH
(
SCompactH
*
pComph
)
{
pComph
->
pDataCols
=
tdFreeDataCols
(
pComph
->
pDataCols
);
pComph
->
aSupBlk
=
taosArrayDestroy
(
pComph
->
aSupBlk
);
pComph
->
aBlkIdx
=
taosArrayDestroy
(
pComph
->
aBlkIdx
);
tsdbDestroyCompTbArray
(
pComph
);
tsdbDestroyReadH
(
&
(
pComph
->
readh
));
tsdbCloseDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
}
static
int
tsdbInitCompTbArray
(
SCompactH
*
pComph
)
{
// Init pComp->tbArray
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbMeta
*
pMeta
=
pRepo
->
tsdbMeta
;
if
(
tsdbRLockRepoMeta
(
pRepo
)
<
0
)
return
-
1
;
pComph
->
tbArray
=
taosArrayInit
(
pMeta
->
maxTables
,
sizeof
(
STableCompactH
));
if
(
pComph
->
tbArray
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbUnlockRepoMeta
(
pRepo
);
return
-
1
;
static
void
tsdbDestroyCompactH
(
SCompactH
*
pComph
)
{
pComph
->
pDataCols
=
tdFreeDataCols
(
pComph
->
pDataCols
);
pComph
->
aSupBlk
=
taosArrayDestroy
(
pComph
->
aSupBlk
);
pComph
->
aBlkIdx
=
taosArrayDestroy
(
pComph
->
aBlkIdx
);
tsdbDestroyCompTbArray
(
pComph
);
tsdbDestroyReadH
(
&
(
pComph
->
readh
));
tsdbCloseDFileSet
(
TSDB_COMPACT_WSET
(
pComph
));
}
// Note here must start from 0
for
(
int
i
=
0
;
i
<
pMeta
->
maxTables
;
i
++
)
{
STableCompactH
ch
=
{
0
};
if
(
pMeta
->
tables
[
i
]
!=
NULL
)
{
tsdbRefTable
(
pMeta
->
tables
[
i
]);
ch
.
pTable
=
pMeta
->
tables
[
i
];
}
static
int
tsdbInitCompTbArray
(
SCompactH
*
pComph
)
{
// Init pComp->tbArray
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbMeta
*
pMeta
=
pRepo
->
tsdbMeta
;
if
(
tsdbRLockRepoMeta
(
pRepo
)
<
0
)
return
-
1
;
if
(
taosArrayPush
(
pComph
->
tbArray
,
&
ch
)
==
NULL
)
{
pComph
->
tbArray
=
taosArrayInit
(
pMeta
->
maxTables
,
sizeof
(
STableCompactH
));
if
(
pComph
->
tbArray
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbUnlockRepoMeta
(
pRepo
);
return
-
1
;
}
}
if
(
tsdbUnlockRepoMeta
(
pRepo
)
<
0
)
return
-
1
;
return
0
;
}
static
void
tsdbDestroyCompTbArray
(
SCompactH
*
pComph
)
{
STableCompactH
*
pTh
;
if
(
pComph
->
tbArray
==
NULL
)
return
;
// Note here must start from 0
for
(
int
i
=
0
;
i
<
pMeta
->
maxTables
;
i
++
)
{
STableCompactH
ch
=
{
0
};
if
(
pMeta
->
tables
[
i
]
!=
NULL
)
{
tsdbRefTable
(
pMeta
->
tables
[
i
]);
ch
.
pTable
=
pMeta
->
tables
[
i
];
}
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pComph
->
tbArray
);
i
++
)
{
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
i
);
if
(
pTh
->
pTable
)
{
tsdbUnRefTable
(
pTh
->
pTable
);
if
(
taosArrayPush
(
pComph
->
tbArray
,
&
ch
)
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tsdbUnlockRepoMeta
(
pRepo
);
return
-
1
;
}
}
pTh
->
pInfo
=
taosTZfree
(
pTh
->
pInfo
);
if
(
tsdbUnlockRepoMeta
(
pRepo
)
<
0
)
return
-
1
;
return
0
;
}
pComph
->
tbArray
=
taosArrayDestroy
(
pComph
->
tbArray
);
}
static
void
tsdbDestroyCompTbArray
(
SCompactH
*
pComph
)
{
STableCompactH
*
pTh
;
if
(
pComph
->
tbArray
==
NULL
)
return
;
static
int
tsdbCacheFSetIndex
(
SCompactH
*
pComph
)
{
SReadH
*
pReadH
=
&
(
pComph
->
readh
);
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pComph
->
tbArray
);
i
++
)
{
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
i
);
if
(
pTh
->
pTable
)
{
tsdbUnRefTable
(
pTh
->
pTable
);
}
pTh
->
pInfo
=
taosTZfree
(
pTh
->
pInfo
);
}
if
(
tsdbLoadBlockIdx
(
pReadH
)
<
0
)
{
return
-
1
;
pComph
->
tbArray
=
taosArrayDestroy
(
pComph
->
tbArray
);
}
for
(
int
tid
=
1
;
tid
<
taosArrayGetSize
(
pComph
->
tbArray
);
tid
++
)
{
STableCompactH
*
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
tid
);
pTh
->
pBlkIdx
=
NULL
;
static
int
tsdbCacheFSetIndex
(
SCompactH
*
pComph
)
{
SReadH
*
pReadH
=
&
(
pComph
->
readh
);
if
(
pTh
->
pTable
==
NULL
)
continue
;
if
(
tsdbSetReadTable
(
pReadH
,
pTh
->
pTable
)
<
0
)
{
if
(
tsdbLoadBlockIdx
(
pReadH
)
<
0
)
{
return
-
1
;
}
if
(
pReadH
->
pBlkIdx
==
NULL
)
continue
;
pTh
->
bindex
=
*
(
pReadH
->
pBlkIdx
);
pTh
->
pBlkIdx
=
&
(
pTh
->
bindex
)
;
for
(
int
tid
=
1
;
tid
<
taosArrayGetSize
(
pComph
->
tbArray
);
tid
++
)
{
STableCompactH
*
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
tid
);
pTh
->
pBlkIdx
=
NULL
;
if
(
tsdbMakeRoom
((
void
**
)(
&
(
pTh
->
pInfo
)),
pTh
->
pBlkIdx
->
len
)
<
0
)
{
return
-
1
;
}
if
(
pTh
->
pTable
==
NULL
)
continue
;
if
(
tsdbSetReadTable
(
pReadH
,
pTh
->
pTable
)
<
0
)
{
return
-
1
;
}
if
(
tsdbLoadBlockInfo
(
pReadH
,
(
void
*
)(
pTh
->
pInfo
))
<
0
)
{
return
-
1
;
}
}
if
(
pReadH
->
pBlkIdx
==
NULL
)
continue
;
pTh
->
bindex
=
*
(
pReadH
->
pBlkIdx
);
pTh
->
pBlkIdx
=
&
(
pTh
->
bindex
);
return
0
;
}
if
(
tsdbMakeRoom
((
void
**
)(
&
(
pTh
->
pInfo
)),
pTh
->
pBlkIdx
->
len
)
<
0
)
{
return
-
1
;
}
static
int
tsdbCompactFSetInit
(
SCompactH
*
pComph
,
SDFileSet
*
pSet
)
{
taosArrayClear
(
pComph
->
aBlkIdx
);
taosArrayClear
(
pComph
->
aSupBlk
);
if
(
tsdbLoadBlockInfo
(
pReadH
,
(
void
*
)(
pTh
->
pInfo
))
<
0
)
{
return
-
1
;
}
}
if
(
tsdbSetAndOpenReadFSet
(
&
(
pComph
->
readh
),
pSet
)
<
0
)
{
return
-
1
;
return
0
;
}
if
(
tsdbCacheFSetIndex
(
pComph
)
<
0
)
{
tsdbCloseAndUnsetFSet
(
&
(
pComph
->
readh
));
return
-
1
;
}
static
int
tsdbCompactFSetInit
(
SCompactH
*
pComph
,
SDFileSet
*
pSet
)
{
taosArrayClear
(
pComph
->
aBlkIdx
);
taosArrayClear
(
pComph
->
aSupBlk
);
return
0
;
}
if
(
tsdbSetAndOpenReadFSet
(
&
(
pComph
->
readh
),
pSet
)
<
0
)
{
return
-
1
;
}
static
void
tsdbCompactFSetEnd
(
SCompactH
*
pComph
)
{
tsdbCloseAndUnsetFSet
(
&
(
pComph
->
readh
));
}
if
(
tsdbCacheFSetIndex
(
pComph
)
<
0
)
{
tsdbCloseAndUnsetFSet
(
&
(
pComph
->
readh
));
return
-
1
;
}
static
int
tsdbCompactFSetImpl
(
SCompactH
*
pComph
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SReadH
*
pReadh
=
&
(
pComph
->
readh
);
SBlockIdx
blkIdx
;
void
**
ppBuf
=
&
(
TSDB_COMPACT_BUF
(
pComph
));
void
**
ppCBuf
=
&
(
TSDB_COMPACT_COMP_BUF
(
pComph
));
int
defaultRows
=
TSDB_DEFAULT_BLOCK_ROWS
(
pCfg
->
maxRowsPerFileBlock
);
return
0
;
}
taosArrayClear
(
pComph
->
aBlkIdx
);
static
void
tsdbCompactFSetEnd
(
SCompactH
*
pComph
)
{
tsdbCloseAndUnsetFSet
(
&
(
pComph
->
readh
));
}
for
(
int
tid
=
1
;
tid
<
taosArrayGetSize
(
pComph
->
tbArray
);
tid
++
)
{
STableCompactH
*
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
tid
);
STSchema
*
pSchema
;
static
int
tsdbCompactFSetImpl
(
SCompactH
*
pComph
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SReadH
*
pReadh
=
&
(
pComph
->
readh
);
SBlockIdx
blkIdx
;
void
**
ppBuf
=
&
(
TSDB_COMPACT_BUF
(
pComph
));
void
**
ppCBuf
=
&
(
TSDB_COMPACT_COMP_BUF
(
pComph
));
int
defaultRows
=
TSDB_DEFAULT_BLOCK_ROWS
(
pCfg
->
maxRowsPerFileBlock
);
if
(
pTh
->
pTable
==
NULL
||
pTh
->
pBlkIdx
==
NULL
)
continue
;
taosArrayClear
(
pComph
->
aBlkIdx
)
;
pSchema
=
tsdbGetTableSchemaImpl
(
pTh
->
pTable
,
true
,
true
,
-
1
);
taosArrayClear
(
pComph
->
aSupBlk
);
if
((
tdInitDataCols
(
pComph
->
pDataCols
,
pSchema
)
<
0
)
||
(
tdInitDataCols
(
pReadh
->
pDCols
[
0
],
pSchema
)
<
0
)
||
(
tdInitDataCols
(
pReadh
->
pDCols
[
1
],
pSchema
)
<
0
))
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
tdFreeSchema
(
pSchema
);
for
(
int
tid
=
1
;
tid
<
taosArrayGetSize
(
pComph
->
tbArray
);
tid
++
)
{
STableCompactH
*
pTh
=
(
STableCompactH
*
)
taosArrayGet
(
pComph
->
tbArray
,
tid
);
STSchema
*
pSchema
;
// Loop to compact each block data
for
(
int
i
=
0
;
i
<
pTh
->
pBlkIdx
->
numOfBlocks
;
i
++
)
{
SBlock
*
pBlock
=
pTh
->
pInfo
->
blocks
+
i
;
if
(
pTh
->
pTable
==
NULL
||
pTh
->
pBlkIdx
==
NULL
)
continue
;
// Load the block data
if
(
tsdbLoadBlockData
(
pReadh
,
pBlock
,
pTh
->
pInfo
)
<
0
)
{
pSchema
=
tsdbGetTableSchemaImpl
(
pTh
->
pTable
,
true
,
true
,
-
1
);
taosArrayClear
(
pComph
->
aSupBlk
);
if
((
tdInitDataCols
(
pComph
->
pDataCols
,
pSchema
)
<
0
)
||
(
tdInitDataCols
(
pReadh
->
pDCols
[
0
],
pSchema
)
<
0
)
||
(
tdInitDataCols
(
pReadh
->
pDCols
[
1
],
pSchema
)
<
0
))
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
tdFreeSchema
(
pSchema
);
// Loop to compact each block data
for
(
int
i
=
0
;
i
<
pTh
->
pBlkIdx
->
numOfBlocks
;
i
++
)
{
SBlock
*
pBlock
=
pTh
->
pInfo
->
blocks
+
i
;
// Merge pComph->pDataCols and pReadh->pDCols[0] and write data to file
if
(
pComph
->
pDataCols
->
numOfRows
==
0
&&
pBlock
->
numOfRows
>=
defaultRows
)
{
if
(
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pReadh
->
pDCols
[
0
],
ppBuf
,
ppCBuf
)
<
0
)
{
// Load the block data
if
(
tsdbLoadBlockData
(
pReadh
,
pBlock
,
pTh
->
pInfo
)
<
0
)
{
return
-
1
;
}
}
else
{
int
ridx
=
0
;
while
(
true
)
{
if
(
pReadh
->
pDCols
[
0
]
->
numOfRows
-
ridx
==
0
)
break
;
int
rowsToMerge
=
MIN
(
pReadh
->
pDCols
[
0
]
->
numOfRows
-
ridx
,
defaultRows
-
pComph
->
pDataCols
->
numOfRows
);
// Merge pComph->pDataCols and pReadh->pDCols[0] and write data to file
if
(
pComph
->
pDataCols
->
numOfRows
==
0
&&
pBlock
->
numOfRows
>=
defaultRows
)
{
if
(
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pReadh
->
pDCols
[
0
],
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
}
}
else
{
int
ridx
=
0
;
tdMergeDataCols
(
pComph
->
pDataCols
,
pReadh
->
pDCols
[
0
],
rowsToMerge
,
&
ridx
);
while
(
true
)
{
if
(
pReadh
->
pDCols
[
0
]
->
numOfRows
-
ridx
==
0
)
break
;
int
rowsToMerge
=
MIN
(
pReadh
->
pDCols
[
0
]
->
numOfRows
-
ridx
,
defaultRows
-
pComph
->
pDataCols
->
numOfRows
);
if
(
pComph
->
pDataCols
->
numOfRows
<
defaultRows
)
{
break
;
}
tdMergeDataCols
(
pComph
->
pDataCols
,
pReadh
->
pDCols
[
0
],
rowsToMerge
,
&
ridx
);
if
(
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pComph
->
pDataCols
,
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
if
(
pComph
->
pDataCols
->
numOfRows
<
defaultRows
)
{
break
;
}
if
(
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pComph
->
pDataCols
,
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
}
tdResetDataCols
(
pComph
->
pDataCols
);
}
tdResetDataCols
(
pComph
->
pDataCols
);
}
}
if
(
pComph
->
pDataCols
->
numOfRows
>
0
&&
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pComph
->
pDataCols
,
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
}
if
(
tsdbWriteBlockInfoImpl
(
TSDB_COMPACT_HEAD_FILE
(
pComph
),
pTh
->
pTable
,
pComph
->
aSupBlk
,
NULL
,
ppBuf
,
&
blkIdx
)
<
0
)
{
return
-
1
;
}
if
((
blkIdx
.
numOfBlocks
>
0
)
&&
(
taosArrayPush
(
pComph
->
aBlkIdx
,
(
void
*
)(
&
blkIdx
))
==
NULL
))
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
}
if
(
pComph
->
pDataCols
->
numOfRows
>
0
&&
tsdbWriteBlockToRightFile
(
pComph
,
pTh
->
pTable
,
pComph
->
pDataCols
,
ppBuf
,
ppCBuf
)
<
0
)
{
if
(
tsdbWriteBlockIdx
(
TSDB_COMPACT_HEAD_FILE
(
pComph
),
pComph
->
aBlkIdx
,
ppBuf
)
<
0
)
{
return
-
1
;
}
if
(
tsdbWriteBlockInfoImpl
(
TSDB_COMPACT_HEAD_FILE
(
pComph
),
pTh
->
pTable
,
pComph
->
aSupBlk
,
NULL
,
ppBuf
,
&
blkIdx
)
<
0
)
{
return
0
;
}
static
int
tsdbWriteBlockToRightFile
(
SCompactH
*
pComph
,
STable
*
pTable
,
SDataCols
*
pDataCols
,
void
**
ppBuf
,
void
**
ppCBuf
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SDFile
*
pDFile
;
bool
isLast
;
SBlock
block
;
ASSERT
(
pDataCols
->
numOfRows
>
0
);
if
(
pDataCols
->
numOfRows
<
pCfg
->
minRowsPerFileBlock
)
{
pDFile
=
TSDB_COMPACT_LAST_FILE
(
pComph
);
isLast
=
true
;
}
else
{
pDFile
=
TSDB_COMPACT_DATA_FILE
(
pComph
);
isLast
=
false
;
}
if
(
tsdbWriteBlockImpl
(
pRepo
,
pTable
,
pDFile
,
pDataCols
,
&
block
,
isLast
,
true
,
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
}
if
(
(
blkIdx
.
numOfBlocks
>
0
)
&&
(
taosArrayPush
(
pComph
->
aBlkIdx
,
(
void
*
)(
&
blkIdx
))
==
NULL
)
)
{
if
(
taosArrayPush
(
pComph
->
aSupBlk
,
(
void
*
)(
&
block
))
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
}
if
(
tsdbWriteBlockIdx
(
TSDB_COMPACT_HEAD_FILE
(
pComph
),
pComph
->
aBlkIdx
,
ppBuf
)
<
0
)
{
return
-
1
;
}
return
0
;
return
0
;
}
static
int
tsdbWriteBlockToRightFile
(
SCompactH
*
pComph
,
STable
*
pTable
,
SDataCols
*
pDataCols
,
void
**
ppBuf
,
void
**
ppCBuf
)
{
STsdbRepo
*
pRepo
=
TSDB_COMPACT_REPO
(
pComph
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SDFile
*
pDFile
;
bool
isLast
;
SBlock
block
;
ASSERT
(
pDataCols
->
numOfRows
>
0
);
if
(
pDataCols
->
numOfRows
<
pCfg
->
minRowsPerFileBlock
)
{
pDFile
=
TSDB_COMPACT_LAST_FILE
(
pComph
);
isLast
=
true
;
}
else
{
pDFile
=
TSDB_COMPACT_DATA_FILE
(
pComph
);
isLast
=
false
;
}
if
(
tsdbWriteBlockImpl
(
pRepo
,
pTable
,
pDFile
,
pDataCols
,
&
block
,
isLast
,
true
,
ppBuf
,
ppCBuf
)
<
0
)
{
return
-
1
;
}
if
(
taosArrayPush
(
pComph
->
aSupBlk
,
(
void
*
)(
&
block
))
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
return
0
;
}
src/util/src/ttokenizer.c
浏览文件 @
86bbd50e
...
...
@@ -219,6 +219,7 @@ static SKeyword keywordTable[] = {
{
"PARTITIONS"
,
TK_PARTITIONS
},
{
"TOPIC"
,
TK_TOPIC
},
{
"TOPICS"
,
TK_TOPICS
},
{
"COMPACT"
,
TK_COMPACT
},
{
"MODIFY"
,
TK_MODIFY
}
};
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
86bbd50e
...
...
@@ -114,6 +114,7 @@ int32_t vnodeSync(int32_t vgId) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
vnodeDrop
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
==
NULL
)
{
...
...
@@ -133,6 +134,19 @@ int32_t vnodeDrop(int32_t vgId) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
vnodeCompact
(
int32_t
vgId
)
{
void
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
!=
NULL
)
{
vDebug
(
"vgId:%d, compact vnode msg is received"
,
vgId
);
//not care success or not
tsdbCompact
(((
SVnodeObj
*
)
pVnode
)
->
tsdb
);
vnodeRelease
(
pVnode
);
}
else
{
vInfo
(
"vgId:%d, vnode not exist, can't compact it"
,
vgId
);
return
TSDB_CODE_VND_INVALID_VGROUP_ID
;
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
vnodeAlterImp
(
SVnodeObj
*
pVnode
,
SCreateVnodeMsg
*
pVnodeCfg
)
{
STsdbCfg
tsdbCfg
=
pVnode
->
tsdbCfg
;
...
...
src/vnode/src/vnodeMgmt.c
浏览文件 @
86bbd50e
...
...
@@ -148,6 +148,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) {
pLoad
->
status
=
pVnode
->
status
;
pLoad
->
role
=
pVnode
->
role
;
pLoad
->
replica
=
pVnode
->
syncCfg
.
replica
;
pLoad
->
compact
=
(
pVnode
->
tsdb
!=
NULL
)
&&
tsdbInCompact
(
pVnode
->
tsdb
)
?
1
:
0
;
}
int32_t
vnodeGetVnodeList
(
int32_t
vnodeList
[],
int32_t
*
numOfVnodes
)
{
...
...
tests/pytest/query/filter.py
浏览文件 @
86bbd50e
...
...
@@ -91,8 +91,8 @@ class TDTestCase:
tdSql
.
query
(
"select * from db.st where name = 1231231"
)
tdSql
.
checkRows
(
0
)
# <> for timestamp type
tdSql
.
query
(
"select * from db.st where ts <> '2020-05-13 10:00:00.002'"
)
# <> for timestamp type
not supported on primary timestamp
tdSql
.
error
(
"select * from db.st where ts <> '2020-05-13 10:00:00.002'"
)
# tdSql.checkRows(4)
# <> for numeric type
...
...
tests/pytest/query/querySecondtscolumnTowherenow.py
浏览文件 @
86bbd50e
...
...
@@ -58,8 +58,8 @@ class TDTestCase:
ts_len4
=
len
(
tdSql
.
cursor
.
fetchall
())
tdSql
.
execute
(
"select * from t2ts1 where ts = now"
)
ts_len5
=
len
(
tdSql
.
cursor
.
fetchall
())
tdSql
.
execute
(
"select * from t2ts1 where ts <> now"
)
ts_len6
=
len
(
tdSql
.
cursor
.
fetchall
())
#
tdSql.execute("select * from t2ts1 where ts <> now")
ts_len6
=
3
tdSql
.
execute
(
"select * from t2ts1 where ts between 0 and now"
)
ts_len7
=
len
(
tdSql
.
cursor
.
fetchall
())
tdSql
.
execute
(
"select * from t2ts1 where ts between now and now+100d"
)
...
...
tests/script/general/parser/timestamp_query.sim
浏览文件 @
86bbd50e
...
...
@@ -24,6 +24,8 @@ $tsu = $tsu + $ts0
print ==================>issue #3481, normal column not allowed,
sql_error select ts,c1,min(c2) from ts_stb0
print ==================>issue #4681, not equal operator on primary timestamp not allowed
sql_error select * from ts_stb0 where ts <> $ts0
##### select from supertable
$tb = $tbPrefix . 0
...
...
@@ -51,4 +53,4 @@ sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb wher
if $data13 != 598.000000000 then
print expect 598.000000000, actual $data03
return -1
endi
\ No newline at end of file
endi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录